graphile-build-pg 4.12.2 → 5.0.0-0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/LICENSE.md +15 -19
  3. package/README.md +44 -59
  4. package/dist/_.d.ts +5 -0
  5. package/dist/_.d.ts.map +1 -0
  6. package/dist/_.js +13 -0
  7. package/dist/_.js.map +1 -0
  8. package/dist/behavior.d.ts +11 -0
  9. package/dist/behavior.d.ts.map +1 -0
  10. package/dist/behavior.js +56 -0
  11. package/dist/behavior.js.map +1 -0
  12. package/dist/index.d.ts +35 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +70 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/inputUtils.d.ts +31 -0
  17. package/dist/inputUtils.d.ts.map +1 -0
  18. package/dist/inputUtils.js +90 -0
  19. package/dist/inputUtils.js.map +1 -0
  20. package/dist/interfaces.d.ts +76 -0
  21. package/dist/interfaces.d.ts.map +1 -0
  22. package/dist/interfaces.js +3 -0
  23. package/dist/interfaces.js.map +1 -0
  24. package/dist/mergeTags.d.ts +3 -0
  25. package/dist/mergeTags.d.ts.map +1 -0
  26. package/dist/mergeTags.js +9 -0
  27. package/dist/mergeTags.js.map +1 -0
  28. package/dist/pgSources.d.ts +60 -0
  29. package/dist/pgSources.d.ts.map +1 -0
  30. package/dist/pgSources.js +108 -0
  31. package/dist/pgSources.js.map +1 -0
  32. package/dist/plugins/PgAllRowsPlugin.d.ts +22 -0
  33. package/dist/plugins/PgAllRowsPlugin.d.ts.map +1 -0
  34. package/dist/plugins/PgAllRowsPlugin.js +96 -0
  35. package/dist/plugins/PgAllRowsPlugin.js.map +1 -0
  36. package/dist/plugins/PgBasicsPlugin.d.ts +52 -0
  37. package/dist/plugins/PgBasicsPlugin.d.ts.map +1 -0
  38. package/dist/plugins/PgBasicsPlugin.js +91 -0
  39. package/dist/plugins/PgBasicsPlugin.js.map +1 -0
  40. package/dist/plugins/PgCodecsPlugin.d.ts +106 -0
  41. package/dist/plugins/PgCodecsPlugin.d.ts.map +1 -0
  42. package/dist/plugins/PgCodecsPlugin.js +814 -0
  43. package/dist/plugins/PgCodecsPlugin.js.map +1 -0
  44. package/dist/plugins/PgColumnDeprecationPlugin.d.ts +3 -0
  45. package/dist/plugins/PgColumnDeprecationPlugin.d.ts.map +1 -0
  46. package/dist/plugins/PgColumnDeprecationPlugin.js +30 -0
  47. package/dist/plugins/PgColumnDeprecationPlugin.js.map +1 -0
  48. package/dist/plugins/PgColumnsPlugin.d.ts +48 -0
  49. package/dist/plugins/PgColumnsPlugin.d.ts.map +1 -0
  50. package/dist/plugins/PgColumnsPlugin.js +275 -0
  51. package/dist/plugins/PgColumnsPlugin.js.map +1 -0
  52. package/dist/plugins/PgConditionArgumentPlugin.d.ts +17 -0
  53. package/dist/plugins/PgConditionArgumentPlugin.d.ts.map +1 -0
  54. package/dist/plugins/PgConditionArgumentPlugin.js +140 -0
  55. package/dist/plugins/PgConditionArgumentPlugin.js.map +1 -0
  56. package/dist/plugins/PgConditionCustomFieldsPlugin.d.ts +12 -0
  57. package/dist/plugins/PgConditionCustomFieldsPlugin.d.ts.map +1 -0
  58. package/dist/plugins/PgConditionCustomFieldsPlugin.js +81 -0
  59. package/dist/plugins/PgConditionCustomFieldsPlugin.js.map +1 -0
  60. package/dist/plugins/PgConnectionArgFirstLastBeforeAfterPlugin.d.ts +17 -0
  61. package/dist/plugins/PgConnectionArgFirstLastBeforeAfterPlugin.d.ts.map +1 -0
  62. package/dist/plugins/PgConnectionArgFirstLastBeforeAfterPlugin.js +85 -0
  63. package/dist/plugins/PgConnectionArgFirstLastBeforeAfterPlugin.js.map +1 -0
  64. package/dist/plugins/PgConnectionArgOrderByDefaultValuePlugin.d.ts +4 -0
  65. package/dist/plugins/PgConnectionArgOrderByDefaultValuePlugin.d.ts.map +1 -0
  66. package/dist/plugins/PgConnectionArgOrderByDefaultValuePlugin.js +45 -0
  67. package/dist/plugins/PgConnectionArgOrderByDefaultValuePlugin.js.map +1 -0
  68. package/dist/plugins/PgConnectionArgOrderByPlugin.d.ts +19 -0
  69. package/dist/plugins/PgConnectionArgOrderByPlugin.d.ts.map +1 -0
  70. package/dist/plugins/PgConnectionArgOrderByPlugin.js +124 -0
  71. package/dist/plugins/PgConnectionArgOrderByPlugin.js.map +1 -0
  72. package/dist/plugins/PgConnectionTotalCountPlugin.d.ts +16 -0
  73. package/dist/plugins/PgConnectionTotalCountPlugin.d.ts.map +1 -0
  74. package/dist/plugins/PgConnectionTotalCountPlugin.js +55 -0
  75. package/dist/plugins/PgConnectionTotalCountPlugin.js.map +1 -0
  76. package/dist/plugins/PgContextPlugin.d.ts +2 -0
  77. package/dist/plugins/PgContextPlugin.d.ts.map +1 -0
  78. package/dist/plugins/PgContextPlugin.js +50 -0
  79. package/dist/plugins/PgContextPlugin.js.map +1 -0
  80. package/dist/plugins/PgCustomTypeFieldPlugin.d.ts +82 -0
  81. package/dist/plugins/PgCustomTypeFieldPlugin.d.ts.map +1 -0
  82. package/dist/plugins/PgCustomTypeFieldPlugin.js +685 -0
  83. package/dist/plugins/PgCustomTypeFieldPlugin.js.map +1 -0
  84. package/dist/plugins/PgEnumTablesPlugin.d.ts +25 -0
  85. package/dist/plugins/PgEnumTablesPlugin.d.ts.map +1 -0
  86. package/dist/plugins/PgEnumTablesPlugin.js +204 -0
  87. package/dist/plugins/PgEnumTablesPlugin.js.map +1 -0
  88. package/dist/plugins/PgFakeConstraintsPlugin.d.ts +9 -0
  89. package/dist/plugins/PgFakeConstraintsPlugin.d.ts.map +1 -0
  90. package/dist/plugins/PgFakeConstraintsPlugin.js +263 -0
  91. package/dist/plugins/PgFakeConstraintsPlugin.js.map +1 -0
  92. package/dist/plugins/PgIntrospectionPlugin.d.ts +122 -0
  93. package/dist/plugins/PgIntrospectionPlugin.d.ts.map +1 -0
  94. package/dist/plugins/PgIntrospectionPlugin.js +285 -0
  95. package/dist/plugins/PgIntrospectionPlugin.js.map +1 -0
  96. package/dist/plugins/PgJWTPlugin.d.ts +26 -0
  97. package/dist/plugins/PgJWTPlugin.d.ts.map +1 -0
  98. package/dist/plugins/PgJWTPlugin.js +92 -0
  99. package/dist/plugins/PgJWTPlugin.js.map +1 -0
  100. package/dist/plugins/PgMutationCreatePlugin.d.ts +14 -0
  101. package/dist/plugins/PgMutationCreatePlugin.d.ts.map +1 -0
  102. package/dist/plugins/PgMutationCreatePlugin.js +164 -0
  103. package/dist/plugins/PgMutationCreatePlugin.js.map +1 -0
  104. package/dist/plugins/PgMutationPayloadEdgePlugin.d.ts +15 -0
  105. package/dist/plugins/PgMutationPayloadEdgePlugin.d.ts.map +1 -0
  106. package/dist/plugins/PgMutationPayloadEdgePlugin.js +144 -0
  107. package/dist/plugins/PgMutationPayloadEdgePlugin.js.map +1 -0
  108. package/dist/plugins/PgMutationUpdateDeletePlugin.d.ts +70 -0
  109. package/dist/plugins/PgMutationUpdateDeletePlugin.d.ts.map +1 -0
  110. package/dist/plugins/PgMutationUpdateDeletePlugin.js +434 -0
  111. package/dist/plugins/PgMutationUpdateDeletePlugin.js.map +1 -0
  112. package/dist/plugins/PgOrderAllColumnsPlugin.d.ts +17 -0
  113. package/dist/plugins/PgOrderAllColumnsPlugin.d.ts.map +1 -0
  114. package/dist/plugins/PgOrderAllColumnsPlugin.js +141 -0
  115. package/dist/plugins/PgOrderAllColumnsPlugin.js.map +1 -0
  116. package/dist/plugins/PgOrderByPrimaryKeyPlugin.d.ts +11 -0
  117. package/dist/plugins/PgOrderByPrimaryKeyPlugin.d.ts.map +1 -0
  118. package/dist/plugins/PgOrderByPrimaryKeyPlugin.js +83 -0
  119. package/dist/plugins/PgOrderByPrimaryKeyPlugin.js.map +1 -0
  120. package/dist/plugins/PgOrderCustomFieldsPlugin.d.ts +15 -0
  121. package/dist/plugins/PgOrderCustomFieldsPlugin.d.ts.map +1 -0
  122. package/dist/plugins/PgOrderCustomFieldsPlugin.js +88 -0
  123. package/dist/plugins/PgOrderCustomFieldsPlugin.js.map +1 -0
  124. package/dist/plugins/PgPolymorphismPlugin.d.ts +34 -0
  125. package/dist/plugins/PgPolymorphismPlugin.d.ts.map +1 -0
  126. package/dist/plugins/PgPolymorphismPlugin.js +469 -0
  127. package/dist/plugins/PgPolymorphismPlugin.js.map +1 -0
  128. package/dist/plugins/PgProceduresPlugin.d.ts +59 -0
  129. package/dist/plugins/PgProceduresPlugin.d.ts.map +1 -0
  130. package/dist/plugins/PgProceduresPlugin.js +367 -0
  131. package/dist/plugins/PgProceduresPlugin.js.map +1 -0
  132. package/dist/plugins/PgRBACPlugin.d.ts +10 -0
  133. package/dist/plugins/PgRBACPlugin.d.ts.map +1 -0
  134. package/dist/plugins/PgRBACPlugin.js +138 -0
  135. package/dist/plugins/PgRBACPlugin.js.map +1 -0
  136. package/dist/plugins/PgRefsPlugin.d.ts +42 -0
  137. package/dist/plugins/PgRefsPlugin.d.ts.map +1 -0
  138. package/dist/plugins/PgRefsPlugin.js +210 -0
  139. package/dist/plugins/PgRefsPlugin.js.map +1 -0
  140. package/dist/plugins/PgRelationsPlugin.d.ts +73 -0
  141. package/dist/plugins/PgRelationsPlugin.d.ts.map +1 -0
  142. package/dist/plugins/PgRelationsPlugin.js +807 -0
  143. package/dist/plugins/PgRelationsPlugin.js.map +1 -0
  144. package/dist/plugins/PgRemoveExtensionResourcesPlugin.d.ts +10 -0
  145. package/dist/plugins/PgRemoveExtensionResourcesPlugin.d.ts.map +1 -0
  146. package/dist/plugins/PgRemoveExtensionResourcesPlugin.js +58 -0
  147. package/dist/plugins/PgRemoveExtensionResourcesPlugin.js.map +1 -0
  148. package/dist/plugins/PgRowByUniquePlugin.d.ts +17 -0
  149. package/dist/plugins/PgRowByUniquePlugin.d.ts.map +1 -0
  150. package/dist/plugins/PgRowByUniquePlugin.js +123 -0
  151. package/dist/plugins/PgRowByUniquePlugin.js.map +1 -0
  152. package/dist/plugins/PgSmartCommentsPlugin.d.ts +14 -0
  153. package/dist/plugins/PgSmartCommentsPlugin.d.ts.map +1 -0
  154. package/dist/plugins/PgSmartCommentsPlugin.js +99 -0
  155. package/dist/plugins/PgSmartCommentsPlugin.js.map +1 -0
  156. package/dist/plugins/PgTableNodePlugin.d.ts +11 -0
  157. package/dist/plugins/PgTableNodePlugin.d.ts.map +1 -0
  158. package/dist/plugins/PgTableNodePlugin.js +106 -0
  159. package/dist/plugins/PgTableNodePlugin.js.map +1 -0
  160. package/dist/plugins/PgTablesPlugin.d.ts +155 -0
  161. package/dist/plugins/PgTablesPlugin.d.ts.map +1 -0
  162. package/dist/plugins/PgTablesPlugin.js +378 -0
  163. package/dist/plugins/PgTablesPlugin.js.map +1 -0
  164. package/dist/plugins/PgTypesPlugin.d.ts +23 -0
  165. package/dist/plugins/PgTypesPlugin.d.ts.map +1 -0
  166. package/dist/plugins/PgTypesPlugin.js +335 -0
  167. package/dist/plugins/PgTypesPlugin.js.map +1 -0
  168. package/dist/preset.d.ts +3 -0
  169. package/dist/preset.d.ts.map +1 -0
  170. package/dist/preset.js +76 -0
  171. package/dist/preset.js.map +1 -0
  172. package/dist/utils.d.ts +20 -0
  173. package/dist/utils.d.ts.map +1 -0
  174. package/dist/utils.js +362 -0
  175. package/dist/utils.js.map +1 -0
  176. package/dist/watchFixtures.d.ts +7 -0
  177. package/dist/watchFixtures.d.ts.map +1 -0
  178. package/{res/watch-fixtures.sql → dist/watchFixtures.js} +15 -3
  179. package/dist/watchFixtures.js.map +1 -0
  180. package/package.json +53 -41
  181. package/node8plus/GraphQLJSON.js +0 -92
  182. package/node8plus/GraphQLJSON.js.flow +0 -76
  183. package/node8plus/GraphQLJSON.js.map +0 -1
  184. package/node8plus/PgLiveProvider.js +0 -37
  185. package/node8plus/PgLiveProvider.js.flow +0 -32
  186. package/node8plus/PgLiveProvider.js.map +0 -1
  187. package/node8plus/QueryBuilder.d.ts +0 -112
  188. package/node8plus/QueryBuilder.js +0 -852
  189. package/node8plus/QueryBuilder.js.flow +0 -964
  190. package/node8plus/QueryBuilder.js.map +0 -1
  191. package/node8plus/index.d.ts +0 -121
  192. package/node8plus/index.js +0 -359
  193. package/node8plus/index.js.flow +0 -132
  194. package/node8plus/index.js.map +0 -1
  195. package/node8plus/inflections.js +0 -302
  196. package/node8plus/inflections.js.flow +0 -344
  197. package/node8plus/inflections.js.map +0 -1
  198. package/node8plus/omit.js +0 -128
  199. package/node8plus/omit.js.flow +0 -141
  200. package/node8plus/omit.js.map +0 -1
  201. package/node8plus/parseIdentifier.js +0 -16
  202. package/node8plus/parseIdentifier.js.flow +0 -15
  203. package/node8plus/parseIdentifier.js.map +0 -1
  204. package/node8plus/pgPrepareAndRun.js +0 -67
  205. package/node8plus/pgPrepareAndRun.js.flow +0 -67
  206. package/node8plus/pgPrepareAndRun.js.map +0 -1
  207. package/node8plus/plugins/PageInfoStartEndCursor.js +0 -57
  208. package/node8plus/plugins/PageInfoStartEndCursor.js.flow +0 -57
  209. package/node8plus/plugins/PageInfoStartEndCursor.js.map +0 -1
  210. package/node8plus/plugins/PgAllRows.js +0 -193
  211. package/node8plus/plugins/PgAllRows.js.flow +0 -233
  212. package/node8plus/plugins/PgAllRows.js.map +0 -1
  213. package/node8plus/plugins/PgBackwardRelationPlugin.js +0 -328
  214. package/node8plus/plugins/PgBackwardRelationPlugin.js.flow +0 -513
  215. package/node8plus/plugins/PgBackwardRelationPlugin.js.map +0 -1
  216. package/node8plus/plugins/PgBasicsPlugin.js +0 -707
  217. package/node8plus/plugins/PgBasicsPlugin.js.flow +0 -884
  218. package/node8plus/plugins/PgBasicsPlugin.js.map +0 -1
  219. package/node8plus/plugins/PgColumnDeprecationPlugin.js +0 -27
  220. package/node8plus/plugins/PgColumnDeprecationPlugin.js.flow +0 -27
  221. package/node8plus/plugins/PgColumnDeprecationPlugin.js.map +0 -1
  222. package/node8plus/plugins/PgColumnsPlugin.js +0 -190
  223. package/node8plus/plugins/PgColumnsPlugin.js.flow +0 -289
  224. package/node8plus/plugins/PgColumnsPlugin.js.map +0 -1
  225. package/node8plus/plugins/PgComputedColumnsPlugin.js +0 -118
  226. package/node8plus/plugins/PgComputedColumnsPlugin.js.flow +0 -137
  227. package/node8plus/plugins/PgComputedColumnsPlugin.js.map +0 -1
  228. package/node8plus/plugins/PgConditionComputedColumnPlugin.js +0 -182
  229. package/node8plus/plugins/PgConditionComputedColumnPlugin.js.flow +0 -214
  230. package/node8plus/plugins/PgConditionComputedColumnPlugin.js.map +0 -1
  231. package/node8plus/plugins/PgConnectionArgCondition.js +0 -142
  232. package/node8plus/plugins/PgConnectionArgCondition.js.flow +0 -202
  233. package/node8plus/plugins/PgConnectionArgCondition.js.map +0 -1
  234. package/node8plus/plugins/PgConnectionArgFirstLastBeforeAfter.js +0 -115
  235. package/node8plus/plugins/PgConnectionArgFirstLastBeforeAfter.js.flow +0 -142
  236. package/node8plus/plugins/PgConnectionArgFirstLastBeforeAfter.js.map +0 -1
  237. package/node8plus/plugins/PgConnectionArgOrderBy.js +0 -161
  238. package/node8plus/plugins/PgConnectionArgOrderBy.js.flow +0 -192
  239. package/node8plus/plugins/PgConnectionArgOrderBy.js.map +0 -1
  240. package/node8plus/plugins/PgConnectionArgOrderByDefaultValue.js +0 -48
  241. package/node8plus/plugins/PgConnectionArgOrderByDefaultValue.js.flow +0 -55
  242. package/node8plus/plugins/PgConnectionArgOrderByDefaultValue.js.map +0 -1
  243. package/node8plus/plugins/PgConnectionTotalCount.js +0 -67
  244. package/node8plus/plugins/PgConnectionTotalCount.js.flow +0 -73
  245. package/node8plus/plugins/PgConnectionTotalCount.js.map +0 -1
  246. package/node8plus/plugins/PgForwardRelationPlugin.js +0 -167
  247. package/node8plus/plugins/PgForwardRelationPlugin.js.flow +0 -226
  248. package/node8plus/plugins/PgForwardRelationPlugin.js.map +0 -1
  249. package/node8plus/plugins/PgIntrospectionPlugin.d.ts +0 -212
  250. package/node8plus/plugins/PgIntrospectionPlugin.js +0 -917
  251. package/node8plus/plugins/PgIntrospectionPlugin.js.flow +0 -1351
  252. package/node8plus/plugins/PgIntrospectionPlugin.js.map +0 -1
  253. package/node8plus/plugins/PgJWTPlugin.js +0 -115
  254. package/node8plus/plugins/PgJWTPlugin.js.flow +0 -155
  255. package/node8plus/plugins/PgJWTPlugin.js.map +0 -1
  256. package/node8plus/plugins/PgMutationCreatePlugin.js +0 -206
  257. package/node8plus/plugins/PgMutationCreatePlugin.js.flow +0 -297
  258. package/node8plus/plugins/PgMutationCreatePlugin.js.map +0 -1
  259. package/node8plus/plugins/PgMutationPayloadEdgePlugin.js +0 -176
  260. package/node8plus/plugins/PgMutationPayloadEdgePlugin.js.flow +0 -214
  261. package/node8plus/plugins/PgMutationPayloadEdgePlugin.js.map +0 -1
  262. package/node8plus/plugins/PgMutationProceduresPlugin.js +0 -57
  263. package/node8plus/plugins/PgMutationProceduresPlugin.js.flow +0 -64
  264. package/node8plus/plugins/PgMutationProceduresPlugin.js.map +0 -1
  265. package/node8plus/plugins/PgMutationUpdateDeletePlugin.js +0 -382
  266. package/node8plus/plugins/PgMutationUpdateDeletePlugin.js.flow +0 -611
  267. package/node8plus/plugins/PgMutationUpdateDeletePlugin.js.map +0 -1
  268. package/node8plus/plugins/PgNodeAliasPostGraphile.js +0 -39
  269. package/node8plus/plugins/PgNodeAliasPostGraphile.js.flow +0 -26
  270. package/node8plus/plugins/PgNodeAliasPostGraphile.js.map +0 -1
  271. package/node8plus/plugins/PgOrderAllColumnsPlugin.js +0 -64
  272. package/node8plus/plugins/PgOrderAllColumnsPlugin.js.flow +0 -79
  273. package/node8plus/plugins/PgOrderAllColumnsPlugin.js.map +0 -1
  274. package/node8plus/plugins/PgOrderByPrimaryKeyPlugin.js +0 -52
  275. package/node8plus/plugins/PgOrderByPrimaryKeyPlugin.js.flow +0 -45
  276. package/node8plus/plugins/PgOrderByPrimaryKeyPlugin.js.map +0 -1
  277. package/node8plus/plugins/PgOrderComputedColumnsPlugin.js +0 -103
  278. package/node8plus/plugins/PgOrderComputedColumnsPlugin.js.flow +0 -127
  279. package/node8plus/plugins/PgOrderComputedColumnsPlugin.js.map +0 -1
  280. package/node8plus/plugins/PgQueryProceduresPlugin.js +0 -98
  281. package/node8plus/plugins/PgQueryProceduresPlugin.js.flow +0 -113
  282. package/node8plus/plugins/PgQueryProceduresPlugin.js.map +0 -1
  283. package/node8plus/plugins/PgRecordFunctionConnectionPlugin.js +0 -152
  284. package/node8plus/plugins/PgRecordFunctionConnectionPlugin.js.flow +0 -202
  285. package/node8plus/plugins/PgRecordFunctionConnectionPlugin.js.map +0 -1
  286. package/node8plus/plugins/PgRecordReturnTypesPlugin.js +0 -127
  287. package/node8plus/plugins/PgRecordReturnTypesPlugin.js.flow +0 -176
  288. package/node8plus/plugins/PgRecordReturnTypesPlugin.js.map +0 -1
  289. package/node8plus/plugins/PgRowByUniqueConstraint.js +0 -157
  290. package/node8plus/plugins/PgRowByUniqueConstraint.js.flow +0 -170
  291. package/node8plus/plugins/PgRowByUniqueConstraint.js.map +0 -1
  292. package/node8plus/plugins/PgRowNode.js +0 -221
  293. package/node8plus/plugins/PgRowNode.js.flow +0 -256
  294. package/node8plus/plugins/PgRowNode.js.map +0 -1
  295. package/node8plus/plugins/PgScalarFunctionConnectionPlugin.js +0 -143
  296. package/node8plus/plugins/PgScalarFunctionConnectionPlugin.js.flow +0 -180
  297. package/node8plus/plugins/PgScalarFunctionConnectionPlugin.js.map +0 -1
  298. package/node8plus/plugins/PgTablesPlugin.js +0 -480
  299. package/node8plus/plugins/PgTablesPlugin.js.flow +0 -653
  300. package/node8plus/plugins/PgTablesPlugin.js.map +0 -1
  301. package/node8plus/plugins/PgTypesPlugin.js +0 -1531
  302. package/node8plus/plugins/PgTypesPlugin.js.flow +0 -1866
  303. package/node8plus/plugins/PgTypesPlugin.js.map +0 -1
  304. package/node8plus/plugins/addStartEndCursor.js +0 -25
  305. package/node8plus/plugins/addStartEndCursor.js.flow +0 -18
  306. package/node8plus/plugins/addStartEndCursor.js.map +0 -1
  307. package/node8plus/plugins/debugSql.js +0 -74
  308. package/node8plus/plugins/debugSql.js.flow +0 -79
  309. package/node8plus/plugins/debugSql.js.map +0 -1
  310. package/node8plus/plugins/introspectionQuery.js +0 -424
  311. package/node8plus/plugins/introspectionQuery.js.flow +0 -437
  312. package/node8plus/plugins/introspectionQuery.js.map +0 -1
  313. package/node8plus/plugins/makeProcField.d.ts +0 -26
  314. package/node8plus/plugins/makeProcField.js +0 -660
  315. package/node8plus/plugins/makeProcField.js.flow +0 -881
  316. package/node8plus/plugins/makeProcField.js.map +0 -1
  317. package/node8plus/plugins/pgField.d.ts +0 -27
  318. package/node8plus/plugins/pgField.js +0 -78
  319. package/node8plus/plugins/pgField.js.flow +0 -105
  320. package/node8plus/plugins/pgField.js.map +0 -1
  321. package/node8plus/plugins/viaTemporaryTable.js +0 -134
  322. package/node8plus/plugins/viaTemporaryTable.js.flow +0 -168
  323. package/node8plus/plugins/viaTemporaryTable.js.map +0 -1
  324. package/node8plus/postgresInterval.js +0 -35
  325. package/node8plus/postgresInterval.js.flow +0 -48
  326. package/node8plus/postgresInterval.js.map +0 -1
  327. package/node8plus/queryFromResolveDataFactory.js +0 -479
  328. package/node8plus/queryFromResolveDataFactory.js.flow +0 -566
  329. package/node8plus/queryFromResolveDataFactory.js.map +0 -1
  330. package/node8plus/utils.js +0 -38
  331. package/node8plus/utils.js.flow +0 -31
  332. package/node8plus/utils.js.map +0 -1
  333. package/node8plus/withPgClient.js +0 -117
  334. package/node8plus/withPgClient.js.flow +0 -104
  335. package/node8plus/withPgClient.js.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,38 @@
1
+ # graphile-build-pg
2
+
3
+ ## 5.0.0-0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`25037fc15`](undefined)]:
8
+ - @dataplan/pg@0.0.1-0.2
9
+ - grafast@0.0.1-0.2
10
+ - graphile-build@5.0.0-0.3
11
+ - graphile-export@0.0.2-0.2
12
+
13
+ ## 5.0.0-0.2
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [[`55f15cf35`](undefined)]:
18
+ - @dataplan/pg@0.0.1-0.1
19
+ - grafast@0.0.1-0.1
20
+ - graphile-build@5.0.0-0.2
21
+ - graphile-export@0.0.2-0.1
22
+
23
+ ## 5.0.0-0.1
24
+
25
+ ### Patch Changes
26
+
27
+ - [#125](https://github.com/benjie/postgraphile-private/pull/125)
28
+ [`91f2256b3`](https://github.com/benjie/postgraphile-private/commit/91f2256b3fd699bec19fc86f1ca79df057e58639)
29
+ Thanks [@benjie](https://github.com/benjie)! - Initial changesets release
30
+
31
+ - Updated dependencies
32
+ [[`91f2256b3`](https://github.com/benjie/postgraphile-private/commit/91f2256b3fd699bec19fc86f1ca79df057e58639)]:
33
+ - @dataplan/pg@0.0.1-0.0
34
+ - grafast@0.0.1-0.0
35
+ - graphile-build@5.0.0-0.1
36
+ - graphile-config@0.0.1-0.0
37
+ - graphile-export@0.0.2-0.0
38
+ - pg-introspection@0.0.1-0.0
package/LICENSE.md CHANGED
@@ -1,24 +1,20 @@
1
1
  # The MIT License (MIT)
2
2
 
3
- Copyright © `2018` Benjie Gillam
3
+ Copyright © `2023` Benjie Gillam
4
4
 
5
- Permission is hereby granted, free of charge, to any person
6
- obtaining a copy of this software and associated documentation
7
- files (the Software”), to deal in the Software without
8
- restriction, including without limitation the rights to use,
9
- copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the
11
- Software is furnished to do so, subject to the following
12
- conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the “Software”), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
13
11
 
14
- The above copyright notice and this permission notice shall be
15
- included in all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
16
14
 
17
- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
18
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
- OTHER DEALINGS IN THE SOFTWARE.
15
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,32 +1,53 @@
1
1
  # graphile-build-pg
2
2
 
3
- <span class="badge-patreon"><a href="https://patreon.com/benjie" title="Support Graphile development on Patreon"><img src="https://img.shields.io/badge/sponsor-via%20Patreon-orange.svg" alt="Patreon sponsor button" /></a></span>
3
+ [![GitHub Sponsors](https://img.shields.io/github/sponsors/benjie?color=ff69b4&label=github%20sponsors)](https://github.com/sponsors/benjie)
4
+ [![Patreon sponsor button](https://img.shields.io/badge/sponsor-via%20Patreon-orange.svg)](https://patreon.com/benjie)
4
5
  [![Discord chat room](https://img.shields.io/discord/489127045289476126.svg)](http://discord.gg/graphile)
5
- [![Package on npm](https://img.shields.io/npm/v/graphile-build-pg.svg?style=flat)](https://www.npmjs.com/package/graphile-build-pg)
6
- ![MIT license](https://img.shields.io/npm/l/graphile-build-pg.svg)
7
6
  [![Follow](https://img.shields.io/badge/twitter-@GraphileHQ-blue.svg)](https://twitter.com/GraphileHQ)
8
7
 
9
- `graphile-build-pg` is a collection of Graphile Engine plugins that allow you
10
- to extend your GraphQL schema with high-performance types and fields based on
11
- resources found in your PostgreSQL database schema.
8
+ `graphile-build-pg` is a collection of [graphile-build][] plugins that extend
9
+ your GraphQL schema with types and fields based on the tables, views, functions
10
+ and other resources in your PostgreSQL database.
11
+
12
+ This is achieved by introspecting your database with [pg-introspection][] and
13
+ then building [@dataplan/pg][] data sources for these entities. Then our plugins
14
+ inspect these data sources and create the relevant GraphQL types, fields, and
15
+ [grafast][] plan resolver functions. The result is a high-performance, powerful,
16
+ auto-generated but highly flexible GraphQL schema.
17
+
18
+ If you don't want to use your database introspection results to generate the
19
+ schema, you can instead build the data sources yourself giving you full control
20
+ over what goes into your GraphQL API whilst still saving you significant effort
21
+ versus writing the schema without auto-generation.
22
+
23
+ `graphile-build-pg` is a core component of [PostGraphile][], a library that
24
+ helps you craft your ideal, incredibly performant, best practices GraphQL API
25
+ backed primarily by a PostgreSQL database with minimal developer effort.
12
26
 
13
27
  <!-- SPONSORS_BEGIN -->
14
28
 
15
29
  ## Crowd-funded open-source software
16
30
 
17
- To help us develop this software sustainably under the MIT license, we ask
18
- all individuals and businesses that use it to help support its ongoing
19
- maintenance and development via sponsorship.
31
+ To help us develop this software sustainably under the MIT license, we ask all
32
+ individuals and businesses that use it to help support its ongoing maintenance
33
+ and development via sponsorship.
20
34
 
21
35
  ### [Click here to find out more about sponsors and sponsorship.](https://www.graphile.org/sponsor/)
22
36
 
23
37
  And please give some love to our featured sponsors 🤩:
24
38
 
25
39
  <table><tr>
40
+ <td align="center"><a href="https://surge.io/"><img src="https://graphile.org/images/sponsors/surge.png" width="90" height="90" alt="Surge" /><br />Surge</a> *</td>
41
+ <td align="center"><a href="https://www.netflix.com/"><img src="https://graphile.org/images/sponsors/Netflix.png" width="90" height="90" alt="Netflix" /><br />Netflix</a> *</td>
42
+ <td align="center"><a href="https://qwick.com/"><img src="https://graphile.org/images/sponsors/qwick.png" width="90" height="90" alt="Qwick" /><br />Qwick</a> *</td>
43
+ <td align="center"><a href="https://www.the-guild.dev/"><img src="https://graphile.org/images/sponsors/theguild.png" width="90" height="90" alt="The Guild" /><br />The Guild</a> *</td>
44
+ </tr><tr>
26
45
  <td align="center"><a href="http://chads.website"><img src="https://graphile.org/images/sponsors/chadf.png" width="90" height="90" alt="Chad Furman" /><br />Chad Furman</a> *</td>
27
- <td align="center"><a href="https://storyscript.com/?utm_source=postgraphile"><img src="https://graphile.org/images/sponsors/storyscript.png" width="90" height="90" alt="Storyscript" /><br />Storyscript</a> *</td>
28
- <td align="center"><a href="https://postlight.com/?utm_source=graphile"><img src="https://graphile.org/images/sponsors/postlight.jpg" width="90" height="90" alt="Postlight" /><br />Postlight</a> *</td>
29
- <td align="center"><a href="https://surge.io/"><img src="https://graphile.org/images/sponsors/surge.png" width="90" height="90" alt="Surge.io" /><br />Surge.io</a> *</td>
46
+ <td align="center"><a href="https://www.fanatics.com/"><img src="https://graphile.org/images/sponsors/fanatics.png" width="90" height="90" alt="Fanatics" /><br />Fanatics</a> *</td>
47
+ <td align="center"><a href="https://dovetailapp.com/"><img src="https://graphile.org/images/sponsors/dovetail.png" width="90" height="90" alt="Dovetail" /><br />Dovetail</a> *</td>
48
+ <td align="center"><a href="https://www.enzuzo.com/"><img src="https://graphile.org/images/sponsors/enzuzo.png" width="90" height="90" alt="Enzuzo" /><br />Enzuzo</a> *</td>
49
+ </tr><tr>
50
+ <td align="center"><a href="https://stellate.co/"><img src="https://graphile.org/images/sponsors/Stellate.png" width="90" height="90" alt="Stellate" /><br />Stellate</a> *</td>
30
51
  </tr></table>
31
52
 
32
53
  <em>\* Sponsors the entire Graphile suite</em>
@@ -35,50 +56,14 @@ And please give some love to our featured sponsors 🤩:
35
56
 
36
57
  ## About
37
58
 
38
- Thanks to Graphile Engine's advanced [query
39
- look-ahead](https://www.graphile.org/graphile-build/look-ahead/) features,
40
- the plugins in this package do not exhibit the N+1 query problem common in
41
- many database-based GraphQL APIs. For all but the flattest GraphQL queries
42
- these plugins typically outperform `DataLoader`-based solutions.
43
-
44
- An example of an application built on `graphile-build-pg` is
45
- [PostGraphile](https://github.com/graphile/postgraphile) which with one
46
- command connects to your PostgreSQL database and provides a full highly
47
- performant standards-compliant GraphQL API.
48
-
49
- **It is recommended that you use PostGraphile directly unless you really want
50
- to get low level access to this library.**
51
-
52
- If you prefer to use the plugins yourself it's advised that you use the
53
- `defaultPlugins` export from `graphile-build-pg` and then create a new array
54
- based on that into which you may insert or remove specific plugins. This is
55
- because it is ordered in a way to ensure the plugins work correctly (and we
56
- may still split up or restructure the plugins).
57
-
58
- ### Export: `defaultPlugins`
59
-
60
- An array of graphql-build plugins in the correct order to generate a
61
- well-thought-out GraphQL object tree based on your PostgreSQL schema. This is
62
- the array that `postgraphile-core` uses.
63
-
64
- ### Manual usage
65
-
66
- ```js
67
- import { defaultPlugins, getBuilder } from "graphile-build";
68
- import { defaultPlugins as pgDefaultPlugins } from "graphile-build-pg";
69
-
70
- async function getSchema(
71
- pgConfig = process.env.DATABASE_URL,
72
- pgSchemas = ["public"],
73
- additionalPlugins = []
74
- ) {
75
- return getBuilder(
76
- [...defaultPlugins, ...pgDefaultPlugins, ...additionalPlugins],
77
- {
78
- pgConfig,
79
- pgSchemas,
80
- pgExtendedTypes: true,
81
- }
82
- );
83
- }
84
- ```
59
+ Thanks to Gra*fast*'s query planning capabilities, the plugins in this package
60
+ do not exhibit the N+1 query problem common in many database-based GraphQL APIs;
61
+ for all but the flattest GraphQL queries these plugins typically significantly
62
+ outperform `DataLoader`-based solutions - and the more complex your GraphQL
63
+ query becomes the greater the benefit.
64
+
65
+ [postgraphile]: https://postgraphile.org
66
+ [graphile-build]: https://npmjs.com/package/graphile-build
67
+ [grafast]: https://grafast.org
68
+ [pg-introspection]: https://npmjs.com/package/pg-introspection
69
+ [@dataplan/pg]: https://grafast.org/grafast/step-library/dataplan-pg/
package/dist/_.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns a new array containing only the unique elements of `list`.
3
+ */
4
+ export declare function uniq<T>(list: T[]): T[];
5
+ //# sourceMappingURL=_.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_.d.ts","sourceRoot":"","sources":["../src/_.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAEtC"}
package/dist/_.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uniq = void 0;
4
+ // TODO: benchmark this; might be faster to use `Array.from()` or an explicit
5
+ // for loop with set existance check
6
+ /**
7
+ * Returns a new array containing only the unique elements of `list`.
8
+ */
9
+ function uniq(list) {
10
+ return [...new Set(list)];
11
+ }
12
+ exports.uniq = uniq;
13
+ //# sourceMappingURL=_.js.map
package/dist/_.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_.js","sourceRoot":"","sources":["../src/_.ts"],"names":[],"mappings":";;;AAAA,6EAA6E;AAC7E,oCAAoC;AACpC;;GAEG;AACH,SAAgB,IAAI,CAAI,IAAS;IAC/B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5B,CAAC;AAFD,oBAEC"}
@@ -0,0 +1,11 @@
1
+ import "./interfaces.js";
2
+ import type { PgSourceExtensions, PgSourceRefExtensions, PgSourceRelationExtensions, PgTypeCodecExtensions } from "@dataplan/pg";
3
+ declare type ArrayOrDirect<T> = Array<T> | T;
4
+ /**
5
+ * Takes a smart tags object and extracts the 'behavior' (or 'behaviour')
6
+ * property and coerces it to be a string. Returns null if no behavior was
7
+ * specified (in which case the default behavior should be used).
8
+ */
9
+ export declare function getBehavior(extensions: ArrayOrDirect<Partial<PgSourceExtensions | PgSourceRelationExtensions | PgTypeCodecExtensions | PgSourceRefExtensions> | undefined>): string | null;
10
+ export {};
11
+ //# sourceMappingURL=behavior.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"behavior.d.ts","sourceRoot":"","sources":["../src/behavior.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAOtB,aAAK,aAAa,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAErC;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,aAAa,CACrB,OAAO,CACH,kBAAkB,GAClB,0BAA0B,GAC1B,qBAAqB,GACrB,qBAAqB,CACxB,GACD,SAAS,CACZ,GACA,MAAM,GAAG,IAAI,CA2Cf"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBehavior = void 0;
4
+ require("./interfaces.js");
5
+ const grafast_1 = require("grafast");
6
+ const util_1 = require("util");
7
+ /**
8
+ * Takes a smart tags object and extracts the 'behavior' (or 'behaviour')
9
+ * property and coerces it to be a string. Returns null if no behavior was
10
+ * specified (in which case the default behavior should be used).
11
+ */
12
+ function getBehavior(extensions) {
13
+ const allExtensions = Array.isArray(extensions) ? extensions : [extensions];
14
+ const behaviors = [];
15
+ for (const extensions of allExtensions) {
16
+ // TODO: all of these are just for user convenience, users should be guided not to use them.
17
+ add(extensions?.tags?.behaviours);
18
+ add(extensions?.tags?.behaviors);
19
+ add(extensions?.tags?.behaviour);
20
+ // This is the real one
21
+ add(extensions?.tags?.behavior);
22
+ }
23
+ return behaviors.join(" ");
24
+ function add(rawBehavior) {
25
+ const behavior = typeof rawBehavior === "string" ? rawBehavior.trim() : rawBehavior;
26
+ if (!behavior) {
27
+ return;
28
+ }
29
+ if (Array.isArray(behavior)) {
30
+ if (grafast_1.isDev && !behavior.every(isValidBehavior)) {
31
+ throw new Error(`Invalid value for behavior; expected a string or string array using simple alphanumeric strings, but found ${(0, util_1.inspect)(behavior)}`);
32
+ }
33
+ behaviors.push(behavior.join(" "));
34
+ return;
35
+ }
36
+ if (isValidBehavior(behavior)) {
37
+ behaviors.push(behavior);
38
+ return;
39
+ }
40
+ throw new Error(`Invalid value for behavior; expected a string or string array using simple alphanumeric strings, but found ${(0, util_1.inspect)(behavior)}`);
41
+ }
42
+ }
43
+ exports.getBehavior = getBehavior;
44
+ /**
45
+ * We're strict with this because we want to be able to expand this in future.
46
+ * For example I want to allow `@behavior all some` to operate the same as
47
+ * `@behavior all\n@behavior some`. I also want to be able to add
48
+ * `@behavior -all` to remove a previously enabled behavior.
49
+ *
50
+ * @internal
51
+ */
52
+ function isValidBehavior(behavior) {
53
+ return (typeof behavior === "string" &&
54
+ /^[+-]?([a-zA-Z](?:[_:]?[a-zA-Z0-9])+|\*)(?:\s+[+-]?(?:[a-zA-Z]([_:]?[a-zA-Z0-9])+|\*))*$/.test(behavior));
55
+ }
56
+ //# sourceMappingURL=behavior.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"behavior.js","sourceRoot":"","sources":["../src/behavior.ts"],"names":[],"mappings":";;;AAAA,2BAAyB;AAQzB,qCAAgC;AAChC,+BAA+B;AAO/B;;;;GAIG;AACH,SAAgB,WAAW,CACzB,UAQC;IAED,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAC5E,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KAAK,MAAM,UAAU,IAAI,aAAa,EAAE;QACtC,4FAA4F;QAC5F,GAAG,CAAC,UAAU,EAAE,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set } from "./preset.js";
2
+ export declare const version: any;
3
+ export { PgSmartTagsDict, PgSourceRelationTags, PgSourceTags, PgTypeCodecTags, PgTypeColumnTags, } from "./interfaces.js";
4
+ export { getWithPgClientFromPgSource, withPgClientFromPgSource, } from "./pgSources.js";
5
+ export { PgAllRowsPlugin } from "./plugins/PgAllRowsPlugin.js";
6
+ export { PgBasicsPlugin } from "./plugins/PgBasicsPlugin.js";
7
+ export { PgCodecsPlugin } from "./plugins/PgCodecsPlugin.js";
8
+ export { PgColumnDeprecationPlugin } from "./plugins/PgColumnDeprecationPlugin.js";
9
+ export { PgColumnsPlugin } from "./plugins/PgColumnsPlugin.js";
10
+ export { PgConditionArgumentPlugin } from "./plugins/PgConditionArgumentPlugin.js";
11
+ export { PgConditionCustomFieldsPlugin } from "./plugins/PgConditionCustomFieldsPlugin.js";
12
+ export { PgConnectionArgFirstLastBeforeAfterPlugin } from "./plugins/PgConnectionArgFirstLastBeforeAfterPlugin.js";
13
+ export { PgConnectionArgOrderByDefaultValuePlugin } from "./plugins/PgConnectionArgOrderByDefaultValuePlugin.js";
14
+ export { PgConnectionArgOrderByPlugin } from "./plugins/PgConnectionArgOrderByPlugin.js";
15
+ export { PgConnectionTotalCountPlugin } from "./plugins/PgConnectionTotalCountPlugin.js";
16
+ export { PgCustomTypeFieldPlugin } from "./plugins/PgCustomTypeFieldPlugin.js";
17
+ export { PgEnumTablesPlugin } from "./plugins/PgEnumTablesPlugin.js";
18
+ export { PgFakeConstraintsPlugin } from "./plugins/PgFakeConstraintsPlugin.js";
19
+ export { PgIntrospectionPlugin } from "./plugins/PgIntrospectionPlugin.js";
20
+ export { PgJWTPlugin } from "./plugins/PgJWTPlugin.js";
21
+ export { PgMutationCreatePlugin } from "./plugins/PgMutationCreatePlugin.js";
22
+ export { PgMutationPayloadEdgePlugin } from "./plugins/PgMutationPayloadEdgePlugin.js";
23
+ export { PgMutationUpdateDeletePlugin } from "./plugins/PgMutationUpdateDeletePlugin.js";
24
+ export { PgOrderAllColumnsPlugin } from "./plugins/PgOrderAllColumnsPlugin.js";
25
+ export { PgOrderByPrimaryKeyPlugin } from "./plugins/PgOrderByPrimaryKeyPlugin.js";
26
+ export { PgOrderCustomFieldsPlugin } from "./plugins/PgOrderCustomFieldsPlugin.js";
27
+ export { PgProceduresPlugin } from "./plugins/PgProceduresPlugin.js";
28
+ export { PgRBACPlugin } from "./plugins/PgRBACPlugin.js";
29
+ export { PgRelationsPlugin } from "./plugins/PgRelationsPlugin.js";
30
+ export { PgRowByUniquePlugin } from "./plugins/PgRowByUniquePlugin.js";
31
+ export { PgTableNodePlugin } from "./plugins/PgTableNodePlugin.js";
32
+ export { PgTablesPlugin } from "./plugins/PgTablesPlugin.js";
33
+ export { PgTypesPlugin } from "./plugins/PgTypesPlugin.js";
34
+ export { addBehaviorToTags } from "./utils.js";
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,eAAO,MAAM,OAAO,KAAqC,CAAC;AAC1D,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,MA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"}
package/dist/index.js ADDED
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addBehaviorToTags = exports.PgTypesPlugin = exports.PgTablesPlugin = exports.PgTableNodePlugin = exports.PgRowByUniquePlugin = exports.PgRelationsPlugin = exports.PgRBACPlugin = exports.PgProceduresPlugin = exports.PgOrderCustomFieldsPlugin = exports.PgOrderByPrimaryKeyPlugin = exports.PgOrderAllColumnsPlugin = exports.PgMutationUpdateDeletePlugin = exports.PgMutationPayloadEdgePlugin = exports.PgMutationCreatePlugin = exports.PgJWTPlugin = exports.PgIntrospectionPlugin = exports.PgFakeConstraintsPlugin = exports.PgEnumTablesPlugin = exports.PgCustomTypeFieldPlugin = exports.PgConnectionTotalCountPlugin = exports.PgConnectionArgOrderByPlugin = exports.PgConnectionArgOrderByDefaultValuePlugin = exports.PgConnectionArgFirstLastBeforeAfterPlugin = exports.PgConditionCustomFieldsPlugin = exports.PgConditionArgumentPlugin = exports.PgColumnsPlugin = exports.PgColumnDeprecationPlugin = exports.PgCodecsPlugin = exports.PgBasicsPlugin = exports.PgAllRowsPlugin = exports.withPgClientFromPgSource = exports.getWithPgClientFromPgSource = exports.version = exports.defaultPreset = void 0;
4
+ var preset_js_1 = require("./preset.js");
5
+ Object.defineProperty(exports, "defaultPreset", { enumerable: true, get: function () { return preset_js_1.defaultPreset; } });
6
+ exports.version = require("../package.json").version;
7
+ var pgSources_js_1 = require("./pgSources.js");
8
+ Object.defineProperty(exports, "getWithPgClientFromPgSource", { enumerable: true, get: function () { return pgSources_js_1.getWithPgClientFromPgSource; } });
9
+ Object.defineProperty(exports, "withPgClientFromPgSource", { enumerable: true, get: function () { return pgSources_js_1.withPgClientFromPgSource; } });
10
+ var PgAllRowsPlugin_js_1 = require("./plugins/PgAllRowsPlugin.js");
11
+ Object.defineProperty(exports, "PgAllRowsPlugin", { enumerable: true, get: function () { return PgAllRowsPlugin_js_1.PgAllRowsPlugin; } });
12
+ var PgBasicsPlugin_js_1 = require("./plugins/PgBasicsPlugin.js");
13
+ Object.defineProperty(exports, "PgBasicsPlugin", { enumerable: true, get: function () { return PgBasicsPlugin_js_1.PgBasicsPlugin; } });
14
+ var PgCodecsPlugin_js_1 = require("./plugins/PgCodecsPlugin.js");
15
+ Object.defineProperty(exports, "PgCodecsPlugin", { enumerable: true, get: function () { return PgCodecsPlugin_js_1.PgCodecsPlugin; } });
16
+ var PgColumnDeprecationPlugin_js_1 = require("./plugins/PgColumnDeprecationPlugin.js");
17
+ Object.defineProperty(exports, "PgColumnDeprecationPlugin", { enumerable: true, get: function () { return PgColumnDeprecationPlugin_js_1.PgColumnDeprecationPlugin; } });
18
+ var PgColumnsPlugin_js_1 = require("./plugins/PgColumnsPlugin.js");
19
+ Object.defineProperty(exports, "PgColumnsPlugin", { enumerable: true, get: function () { return PgColumnsPlugin_js_1.PgColumnsPlugin; } });
20
+ var PgConditionArgumentPlugin_js_1 = require("./plugins/PgConditionArgumentPlugin.js");
21
+ Object.defineProperty(exports, "PgConditionArgumentPlugin", { enumerable: true, get: function () { return PgConditionArgumentPlugin_js_1.PgConditionArgumentPlugin; } });
22
+ var PgConditionCustomFieldsPlugin_js_1 = require("./plugins/PgConditionCustomFieldsPlugin.js");
23
+ Object.defineProperty(exports, "PgConditionCustomFieldsPlugin", { enumerable: true, get: function () { return PgConditionCustomFieldsPlugin_js_1.PgConditionCustomFieldsPlugin; } });
24
+ var PgConnectionArgFirstLastBeforeAfterPlugin_js_1 = require("./plugins/PgConnectionArgFirstLastBeforeAfterPlugin.js");
25
+ Object.defineProperty(exports, "PgConnectionArgFirstLastBeforeAfterPlugin", { enumerable: true, get: function () { return PgConnectionArgFirstLastBeforeAfterPlugin_js_1.PgConnectionArgFirstLastBeforeAfterPlugin; } });
26
+ var PgConnectionArgOrderByDefaultValuePlugin_js_1 = require("./plugins/PgConnectionArgOrderByDefaultValuePlugin.js");
27
+ Object.defineProperty(exports, "PgConnectionArgOrderByDefaultValuePlugin", { enumerable: true, get: function () { return PgConnectionArgOrderByDefaultValuePlugin_js_1.PgConnectionArgOrderByDefaultValuePlugin; } });
28
+ var PgConnectionArgOrderByPlugin_js_1 = require("./plugins/PgConnectionArgOrderByPlugin.js");
29
+ Object.defineProperty(exports, "PgConnectionArgOrderByPlugin", { enumerable: true, get: function () { return PgConnectionArgOrderByPlugin_js_1.PgConnectionArgOrderByPlugin; } });
30
+ var PgConnectionTotalCountPlugin_js_1 = require("./plugins/PgConnectionTotalCountPlugin.js");
31
+ Object.defineProperty(exports, "PgConnectionTotalCountPlugin", { enumerable: true, get: function () { return PgConnectionTotalCountPlugin_js_1.PgConnectionTotalCountPlugin; } });
32
+ var PgCustomTypeFieldPlugin_js_1 = require("./plugins/PgCustomTypeFieldPlugin.js");
33
+ Object.defineProperty(exports, "PgCustomTypeFieldPlugin", { enumerable: true, get: function () { return PgCustomTypeFieldPlugin_js_1.PgCustomTypeFieldPlugin; } });
34
+ var PgEnumTablesPlugin_js_1 = require("./plugins/PgEnumTablesPlugin.js");
35
+ Object.defineProperty(exports, "PgEnumTablesPlugin", { enumerable: true, get: function () { return PgEnumTablesPlugin_js_1.PgEnumTablesPlugin; } });
36
+ var PgFakeConstraintsPlugin_js_1 = require("./plugins/PgFakeConstraintsPlugin.js");
37
+ Object.defineProperty(exports, "PgFakeConstraintsPlugin", { enumerable: true, get: function () { return PgFakeConstraintsPlugin_js_1.PgFakeConstraintsPlugin; } });
38
+ var PgIntrospectionPlugin_js_1 = require("./plugins/PgIntrospectionPlugin.js");
39
+ Object.defineProperty(exports, "PgIntrospectionPlugin", { enumerable: true, get: function () { return PgIntrospectionPlugin_js_1.PgIntrospectionPlugin; } });
40
+ var PgJWTPlugin_js_1 = require("./plugins/PgJWTPlugin.js");
41
+ Object.defineProperty(exports, "PgJWTPlugin", { enumerable: true, get: function () { return PgJWTPlugin_js_1.PgJWTPlugin; } });
42
+ var PgMutationCreatePlugin_js_1 = require("./plugins/PgMutationCreatePlugin.js");
43
+ Object.defineProperty(exports, "PgMutationCreatePlugin", { enumerable: true, get: function () { return PgMutationCreatePlugin_js_1.PgMutationCreatePlugin; } });
44
+ var PgMutationPayloadEdgePlugin_js_1 = require("./plugins/PgMutationPayloadEdgePlugin.js");
45
+ Object.defineProperty(exports, "PgMutationPayloadEdgePlugin", { enumerable: true, get: function () { return PgMutationPayloadEdgePlugin_js_1.PgMutationPayloadEdgePlugin; } });
46
+ var PgMutationUpdateDeletePlugin_js_1 = require("./plugins/PgMutationUpdateDeletePlugin.js");
47
+ Object.defineProperty(exports, "PgMutationUpdateDeletePlugin", { enumerable: true, get: function () { return PgMutationUpdateDeletePlugin_js_1.PgMutationUpdateDeletePlugin; } });
48
+ var PgOrderAllColumnsPlugin_js_1 = require("./plugins/PgOrderAllColumnsPlugin.js");
49
+ Object.defineProperty(exports, "PgOrderAllColumnsPlugin", { enumerable: true, get: function () { return PgOrderAllColumnsPlugin_js_1.PgOrderAllColumnsPlugin; } });
50
+ var PgOrderByPrimaryKeyPlugin_js_1 = require("./plugins/PgOrderByPrimaryKeyPlugin.js");
51
+ Object.defineProperty(exports, "PgOrderByPrimaryKeyPlugin", { enumerable: true, get: function () { return PgOrderByPrimaryKeyPlugin_js_1.PgOrderByPrimaryKeyPlugin; } });
52
+ var PgOrderCustomFieldsPlugin_js_1 = require("./plugins/PgOrderCustomFieldsPlugin.js");
53
+ Object.defineProperty(exports, "PgOrderCustomFieldsPlugin", { enumerable: true, get: function () { return PgOrderCustomFieldsPlugin_js_1.PgOrderCustomFieldsPlugin; } });
54
+ var PgProceduresPlugin_js_1 = require("./plugins/PgProceduresPlugin.js");
55
+ Object.defineProperty(exports, "PgProceduresPlugin", { enumerable: true, get: function () { return PgProceduresPlugin_js_1.PgProceduresPlugin; } });
56
+ var PgRBACPlugin_js_1 = require("./plugins/PgRBACPlugin.js");
57
+ Object.defineProperty(exports, "PgRBACPlugin", { enumerable: true, get: function () { return PgRBACPlugin_js_1.PgRBACPlugin; } });
58
+ var PgRelationsPlugin_js_1 = require("./plugins/PgRelationsPlugin.js");
59
+ Object.defineProperty(exports, "PgRelationsPlugin", { enumerable: true, get: function () { return PgRelationsPlugin_js_1.PgRelationsPlugin; } });
60
+ var PgRowByUniquePlugin_js_1 = require("./plugins/PgRowByUniquePlugin.js");
61
+ Object.defineProperty(exports, "PgRowByUniquePlugin", { enumerable: true, get: function () { return PgRowByUniquePlugin_js_1.PgRowByUniquePlugin; } });
62
+ var PgTableNodePlugin_js_1 = require("./plugins/PgTableNodePlugin.js");
63
+ Object.defineProperty(exports, "PgTableNodePlugin", { enumerable: true, get: function () { return PgTableNodePlugin_js_1.PgTableNodePlugin; } });
64
+ var PgTablesPlugin_js_1 = require("./plugins/PgTablesPlugin.js");
65
+ Object.defineProperty(exports, "PgTablesPlugin", { enumerable: true, get: function () { return PgTablesPlugin_js_1.PgTablesPlugin; } });
66
+ var PgTypesPlugin_js_1 = require("./plugins/PgTypesPlugin.js");
67
+ Object.defineProperty(exports, "PgTypesPlugin", { enumerable: true, get: function () { return PgTypesPlugin_js_1.PgTypesPlugin; } });
68
+ var utils_js_1 = require("./utils.js");
69
+ Object.defineProperty(exports, "addBehaviorToTags", { enumerable: true, get: function () { return utils_js_1.addBehaviorToTags; } });
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAAnC,0GAAA,aAAa,OAAA;AACT,QAAA,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;AAQ1D,+CAGwB;AAFtB,2HAAA,2BAA2B,OAAA;AAC3B,wHAAA,wBAAwB,OAAA;AAE1B,mEAA+D;AAAtD,qHAAA,eAAe,OAAA;AACxB,iEAA6D;AAApD,mHAAA,cAAc,OAAA;AACvB,iEAA6D;AAApD,mHAAA,cAAc,OAAA;AACvB,uFAAmF;AAA1E,yIAAA,yBAAyB,OAAA;AAClC,mEA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PgTypeCodecMeta {
7
+ /**
8
+ * Given a `situation` such as 'input', 'output', 'patch', etc. returns the
9
+ * name of the GraphQL type to use for this PgTypeCodec.
10
+ */
11
+ typeNameBySituation: {
12
+ [situation: string]: string;
13
+ };
14
+ }
15
+ /**
16
+ * A map from PgTypeCodec to its associated metadata.
17
+ */
18
+ export declare type PgTypeCodecMetaLookup = Map<PgTypeCodec<any, any, any>, PgTypeCodecMeta>;
19
+ /**
20
+ * Creates an empty meta object for the given codec.
21
+ */
22
+ export declare function makePgTypeCodecMeta(_codec: PgTypeCodec<any, any, any>): PgTypeCodecMeta;
23
+ /**
24
+ * Given the input object, this function walks through all the pgSources and
25
+ * all their codecs and relations and extracts the full set of reachable
26
+ * codecs.
27
+ *
28
+ * Memoized for performance, using a WeakMap.
29
+ */
30
+ export declare function getCodecMetaLookupFromInput(input: GraphileBuild.BuildInput): PgTypeCodecMetaLookup;
31
+ //# sourceMappingURL=inputUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputUtils.d.ts","sourceRoot":"","sources":["../src/inputUtils.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAKV,WAAW,EAEZ,MAAM,cAAc,CAAC;AAGtB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,mBAAmB,EAAE;QACnB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;KAC7B,CAAC;CACH;AAED;;GAEG;AACH,oBAAY,qBAAqB,GAAG,GAAG,CACrC,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAC1B,eAAe,CAChB,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GACjC,eAAe,CAIjB;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,aAAa,CAAC,UAAU,GAC9B,qBAAqB,CAYvB"}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCodecMetaLookupFromInput = exports.makePgTypeCodecMeta = void 0;
4
+ require("graphile-build");
5
+ const pg_1 = require("@dataplan/pg");
6
+ /**
7
+ * Creates an empty meta object for the given codec.
8
+ */
9
+ function makePgTypeCodecMeta(_codec) {
10
+ return {
11
+ typeNameBySituation: {},
12
+ };
13
+ }
14
+ exports.makePgTypeCodecMeta = makePgTypeCodecMeta;
15
+ /**
16
+ * Given the input object, this function walks through all the pgSources and
17
+ * all their codecs and relations and extracts the full set of reachable
18
+ * codecs.
19
+ *
20
+ * Memoized for performance, using a WeakMap.
21
+ */
22
+ function getCodecMetaLookupFromInput(input) {
23
+ const metaLookup = new Map();
24
+ const seenSources = new Set();
25
+ if (input.pgCodecs) {
26
+ for (const codec of input.pgCodecs) {
27
+ walkCodec(codec, metaLookup);
28
+ }
29
+ }
30
+ for (const source of input.pgSources) {
31
+ walkSource(resolveSource(source), metaLookup, seenSources);
32
+ }
33
+ return metaLookup;
34
+ }
35
+ exports.getCodecMetaLookupFromInput = getCodecMetaLookupFromInput;
36
+ /**
37
+ * Walks the given source's codecs/relations and pushes all discovered codecs
38
+ * into `metaLookup`
39
+ *
40
+ * @internal
41
+ */
42
+ function walkSource(source, metaLookup, seenSources) {
43
+ if (seenSources.has(source)) {
44
+ return;
45
+ }
46
+ seenSources.add(source);
47
+ if (!metaLookup.has(source.codec)) {
48
+ walkCodec(source.codec, metaLookup);
49
+ }
50
+ const relations = source.getRelations();
51
+ if (relations) {
52
+ for (const relationshipName in relations) {
53
+ walkSource(resolveSource(relations[relationshipName].source), metaLookup, seenSources);
54
+ }
55
+ }
56
+ }
57
+ /**
58
+ * Adds the given codec to `metaLookup` and also walks the related codecs (for
59
+ * columns, and inner-codecs).
60
+ *
61
+ * @internal
62
+ */
63
+ function walkCodec(codec, metaLookup) {
64
+ if (metaLookup.has(codec)) {
65
+ return;
66
+ }
67
+ metaLookup.set(codec, makePgTypeCodecMeta(codec));
68
+ if (codec.columns) {
69
+ for (const columnName in codec.columns) {
70
+ walkCodec(codec.columns[columnName].codec, metaLookup);
71
+ }
72
+ }
73
+ if (codec.arrayOfCodec) {
74
+ walkCodec(codec.arrayOfCodec, metaLookup);
75
+ }
76
+ if (codec.domainOfCodec) {
77
+ walkCodec(codec.domainOfCodec, metaLookup);
78
+ }
79
+ if (codec.rangeOfCodec) {
80
+ walkCodec(codec.rangeOfCodec, metaLookup);
81
+ }
82
+ }
83
+ /**
84
+ * Where a source might be a PgSource or a PgSourceBuilder, this ensures we
85
+ * return a PgSource.
86
+ */
87
+ function resolveSource(source) {
88
+ return source instanceof pg_1.PgSourceBuilder ? source.get() : source;
89
+ }
90
+ //# sourceMappingURL=inputUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputUtils.js","sourceRoot":"","sources":["../src/inputUtils.ts"],"names":[],"mappings":";;;AAAA,0BAAwB;AAUxB,qCAA+C;AAuB/C;;GAEG;AACH,SAAgB,mBAAmB,CACjC,MAAkC;IAElC,OAAO;QACL,mBAAmB,EAAE,EAAE;KACxB,CAAC;AACJ,CAAC;AAND,kDAMC;AAED;;;;;;GAMG;AACH,SAAgB,2BAA2B,CACzC,KAA+B;IAE/B,MAAM,UAAU,GAA0B,IAAI,GAAG,EAAE,CAAC;IACpD,MAAM,WAAW,GAAG,IAAI,GAAG,EAAgC,CAAC;IAC5D,IAAI,KAAK,CAAC,QAAQ,EAAE;QAClB,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClC,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;SAC9B;KACF;IACD,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,SAAS,EAAE;QACpC,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;KAC5D;IACD,OAAO,UAAU,CAAC;AACpB,CAA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