graphile-build 4.12.3 → 5.0.0-0.10

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 (207) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/LICENSE.md +15 -19
  3. package/README.md +32 -33
  4. package/dist/SchemaBuilder.d.ts +57 -0
  5. package/dist/SchemaBuilder.d.ts.map +1 -0
  6. package/dist/SchemaBuilder.js +181 -0
  7. package/dist/SchemaBuilder.js.map +1 -0
  8. package/dist/SchemaBuilderHooks.d.ts +7 -0
  9. package/dist/SchemaBuilderHooks.d.ts.map +1 -0
  10. package/dist/SchemaBuilderHooks.js +38 -0
  11. package/dist/SchemaBuilderHooks.js.map +1 -0
  12. package/dist/behavior.d.ts +11 -0
  13. package/dist/behavior.d.ts.map +1 -0
  14. package/dist/behavior.js +104 -0
  15. package/dist/behavior.js.map +1 -0
  16. package/dist/callbackToAsyncIterator.d.ts +10 -0
  17. package/dist/callbackToAsyncIterator.d.ts.map +1 -0
  18. package/dist/callbackToAsyncIterator.js +95 -0
  19. package/dist/callbackToAsyncIterator.js.map +1 -0
  20. package/dist/extend.d.ts +12 -0
  21. package/dist/extend.d.ts.map +1 -0
  22. package/dist/extend.js +48 -0
  23. package/dist/extend.js.map +1 -0
  24. package/dist/global.d.ts +575 -0
  25. package/dist/global.d.ts.map +1 -0
  26. package/dist/global.js +3 -0
  27. package/dist/global.js.map +1 -0
  28. package/dist/index.d.ts +46 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +289 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/inflection.d.ts +72 -0
  33. package/dist/inflection.d.ts.map +1 -0
  34. package/dist/inflection.js +101 -0
  35. package/dist/inflection.js.map +1 -0
  36. package/dist/interfaces.d.ts +226 -0
  37. package/dist/interfaces.d.ts.map +1 -0
  38. package/dist/interfaces.js +3 -0
  39. package/dist/interfaces.js.map +1 -0
  40. package/dist/makeNewBuild.d.ts +7 -0
  41. package/dist/makeNewBuild.d.ts.map +1 -0
  42. package/dist/makeNewBuild.js +261 -0
  43. package/dist/makeNewBuild.js.map +1 -0
  44. package/dist/newWithHooks/index.d.ts +22 -0
  45. package/dist/newWithHooks/index.d.ts.map +1 -0
  46. package/dist/newWithHooks/index.js +354 -0
  47. package/dist/newWithHooks/index.js.map +1 -0
  48. package/dist/plugins/AddNodeInterfaceToSuitableTypesPlugin.d.ts +3 -0
  49. package/dist/plugins/AddNodeInterfaceToSuitableTypesPlugin.d.ts.map +1 -0
  50. package/dist/plugins/AddNodeInterfaceToSuitableTypesPlugin.js +60 -0
  51. package/dist/plugins/AddNodeInterfaceToSuitableTypesPlugin.js.map +1 -0
  52. package/dist/plugins/BuiltinScalarConnectionsPlugin.d.ts +4 -0
  53. package/dist/plugins/BuiltinScalarConnectionsPlugin.d.ts.map +1 -0
  54. package/dist/plugins/BuiltinScalarConnectionsPlugin.js +42 -0
  55. package/dist/plugins/BuiltinScalarConnectionsPlugin.js.map +1 -0
  56. package/dist/plugins/ClientMutationIdDescriptionPlugin.d.ts +12 -0
  57. package/dist/plugins/ClientMutationIdDescriptionPlugin.d.ts.map +1 -0
  58. package/dist/plugins/ClientMutationIdDescriptionPlugin.js +72 -0
  59. package/dist/plugins/ClientMutationIdDescriptionPlugin.js.map +1 -0
  60. package/dist/plugins/CommonTypesPlugin.d.ts +15 -0
  61. package/dist/plugins/CommonTypesPlugin.d.ts.map +1 -0
  62. package/dist/plugins/CommonTypesPlugin.js +114 -0
  63. package/dist/plugins/CommonTypesPlugin.js.map +1 -0
  64. package/dist/plugins/ConnectionPlugin.d.ts +26 -0
  65. package/dist/plugins/ConnectionPlugin.d.ts.map +1 -0
  66. package/dist/plugins/ConnectionPlugin.js +145 -0
  67. package/dist/plugins/ConnectionPlugin.js.map +1 -0
  68. package/dist/plugins/CursorTypePlugin.d.ts +10 -0
  69. package/dist/plugins/CursorTypePlugin.d.ts.map +1 -0
  70. package/dist/plugins/CursorTypePlugin.js +27 -0
  71. package/dist/plugins/CursorTypePlugin.js.map +1 -0
  72. package/dist/plugins/MutationPayloadQueryPlugin.d.ts +8 -0
  73. package/dist/plugins/MutationPayloadQueryPlugin.d.ts.map +1 -0
  74. package/dist/plugins/MutationPayloadQueryPlugin.js +42 -0
  75. package/dist/plugins/MutationPayloadQueryPlugin.js.map +1 -0
  76. package/dist/plugins/MutationPlugin.d.ts +14 -0
  77. package/dist/plugins/MutationPlugin.d.ts.map +1 -0
  78. package/dist/plugins/MutationPlugin.js +69 -0
  79. package/dist/plugins/MutationPlugin.js.map +1 -0
  80. package/dist/plugins/NodeAccessorPlugin.d.ts +13 -0
  81. package/dist/plugins/NodeAccessorPlugin.d.ts.map +1 -0
  82. package/dist/plugins/NodeAccessorPlugin.js +80 -0
  83. package/dist/plugins/NodeAccessorPlugin.js.map +1 -0
  84. package/dist/plugins/NodeIdCodecBase64JSONPlugin.d.ts +3 -0
  85. package/dist/plugins/NodeIdCodecBase64JSONPlugin.d.ts.map +1 -0
  86. package/dist/plugins/NodeIdCodecBase64JSONPlugin.js +32 -0
  87. package/dist/plugins/NodeIdCodecBase64JSONPlugin.js.map +1 -0
  88. package/dist/plugins/NodeIdCodecPipeStringPlugin.d.ts +3 -0
  89. package/dist/plugins/NodeIdCodecPipeStringPlugin.d.ts.map +1 -0
  90. package/dist/plugins/NodeIdCodecPipeStringPlugin.js +32 -0
  91. package/dist/plugins/NodeIdCodecPipeStringPlugin.js.map +1 -0
  92. package/dist/plugins/NodePlugin.d.ts +35 -0
  93. package/dist/plugins/NodePlugin.d.ts.map +1 -0
  94. package/dist/plugins/NodePlugin.js +130 -0
  95. package/dist/plugins/NodePlugin.js.map +1 -0
  96. package/dist/plugins/PageInfoStartEndCursorPlugin.d.ts +11 -0
  97. package/dist/plugins/PageInfoStartEndCursorPlugin.d.ts.map +1 -0
  98. package/dist/plugins/PageInfoStartEndCursorPlugin.js +42 -0
  99. package/dist/plugins/PageInfoStartEndCursorPlugin.js.map +1 -0
  100. package/dist/plugins/QueryPlugin.d.ts +16 -0
  101. package/dist/plugins/QueryPlugin.d.ts.map +1 -0
  102. package/dist/plugins/QueryPlugin.js +69 -0
  103. package/dist/plugins/QueryPlugin.js.map +1 -0
  104. package/dist/plugins/QueryQueryPlugin.d.ts +7 -0
  105. package/dist/plugins/QueryQueryPlugin.d.ts.map +1 -0
  106. package/dist/plugins/QueryQueryPlugin.js +39 -0
  107. package/dist/plugins/QueryQueryPlugin.js.map +1 -0
  108. package/dist/plugins/RegisterQueryNodePlugin.d.ts +3 -0
  109. package/dist/plugins/RegisterQueryNodePlugin.d.ts.map +1 -0
  110. package/dist/plugins/RegisterQueryNodePlugin.js +36 -0
  111. package/dist/plugins/RegisterQueryNodePlugin.js.map +1 -0
  112. package/dist/plugins/StreamDeferPlugin.d.ts +9 -0
  113. package/dist/plugins/StreamDeferPlugin.d.ts.map +1 -0
  114. package/dist/plugins/StreamDeferPlugin.js +26 -0
  115. package/dist/plugins/StreamDeferPlugin.js.map +1 -0
  116. package/dist/plugins/SubscriptionPlugin.d.ts +14 -0
  117. package/dist/plugins/SubscriptionPlugin.d.ts.map +1 -0
  118. package/dist/plugins/SubscriptionPlugin.js +69 -0
  119. package/dist/plugins/SubscriptionPlugin.js.map +1 -0
  120. package/dist/plugins/SwallowErrorsPlugin.d.ts +14 -0
  121. package/dist/plugins/SwallowErrorsPlugin.d.ts.map +1 -0
  122. package/dist/plugins/SwallowErrorsPlugin.js +38 -0
  123. package/dist/plugins/SwallowErrorsPlugin.js.map +1 -0
  124. package/dist/plugins/TrimEmptyDescriptionsPlugin.d.ts +3 -0
  125. package/dist/plugins/TrimEmptyDescriptionsPlugin.d.ts.map +1 -0
  126. package/dist/plugins/TrimEmptyDescriptionsPlugin.js +62 -0
  127. package/dist/plugins/TrimEmptyDescriptionsPlugin.js.map +1 -0
  128. package/dist/plugins/index.d.ts +22 -0
  129. package/dist/plugins/index.d.ts.map +1 -0
  130. package/dist/plugins/index.js +44 -0
  131. package/dist/plugins/index.js.map +1 -0
  132. package/dist/preset.d.ts +4 -0
  133. package/dist/preset.d.ts.map +1 -0
  134. package/dist/preset.js +30 -0
  135. package/dist/preset.js.map +1 -0
  136. package/dist/swallowError.d.ts +9 -0
  137. package/dist/swallowError.d.ts.map +1 -0
  138. package/dist/swallowError.js +34 -0
  139. package/dist/swallowError.js.map +1 -0
  140. package/dist/utils.d.ts +47 -0
  141. package/dist/utils.d.ts.map +1 -0
  142. package/dist/utils.js +170 -0
  143. package/dist/utils.js.map +1 -0
  144. package/package.json +38 -29
  145. package/node8plus/Live.d.ts +0 -88
  146. package/node8plus/Live.js +0 -324
  147. package/node8plus/Live.js.flow +0 -365
  148. package/node8plus/Live.js.map +0 -1
  149. package/node8plus/SchemaBuilder.d.ts +0 -339
  150. package/node8plus/SchemaBuilder.js +0 -461
  151. package/node8plus/SchemaBuilder.js.flow +0 -621
  152. package/node8plus/SchemaBuilder.js.map +0 -1
  153. package/node8plus/callbackToAsyncIterator.js +0 -120
  154. package/node8plus/callbackToAsyncIterator.js.flow +0 -102
  155. package/node8plus/callbackToAsyncIterator.js.map +0 -1
  156. package/node8plus/extend.js +0 -46
  157. package/node8plus/extend.js.flow +0 -47
  158. package/node8plus/extend.js.map +0 -1
  159. package/node8plus/index.d.ts +0 -74
  160. package/node8plus/index.js +0 -187
  161. package/node8plus/index.js.flow +0 -104
  162. package/node8plus/index.js.map +0 -1
  163. package/node8plus/makeNewBuild.js +0 -820
  164. package/node8plus/makeNewBuild.js.flow +0 -1120
  165. package/node8plus/makeNewBuild.js.map +0 -1
  166. package/node8plus/plugins/AddQueriesToSubscriptionsPlugin.js +0 -84
  167. package/node8plus/plugins/AddQueriesToSubscriptionsPlugin.js.flow +0 -83
  168. package/node8plus/plugins/AddQueriesToSubscriptionsPlugin.js.map +0 -1
  169. package/node8plus/plugins/ClientMutationIdDescriptionPlugin.js +0 -74
  170. package/node8plus/plugins/ClientMutationIdDescriptionPlugin.js.flow +0 -92
  171. package/node8plus/plugins/ClientMutationIdDescriptionPlugin.js.map +0 -1
  172. package/node8plus/plugins/MutationPayloadQueryPlugin.js +0 -43
  173. package/node8plus/plugins/MutationPayloadQueryPlugin.js.flow +0 -41
  174. package/node8plus/plugins/MutationPayloadQueryPlugin.js.map +0 -1
  175. package/node8plus/plugins/MutationPlugin.js +0 -53
  176. package/node8plus/plugins/MutationPlugin.js.flow +0 -59
  177. package/node8plus/plugins/MutationPlugin.js.map +0 -1
  178. package/node8plus/plugins/NodePlugin.js +0 -188
  179. package/node8plus/plugins/NodePlugin.js.flow +0 -266
  180. package/node8plus/plugins/NodePlugin.js.map +0 -1
  181. package/node8plus/plugins/QueryPlugin.js +0 -56
  182. package/node8plus/plugins/QueryPlugin.js.flow +0 -74
  183. package/node8plus/plugins/QueryPlugin.js.map +0 -1
  184. package/node8plus/plugins/StandardTypesPlugin.js +0 -90
  185. package/node8plus/plugins/StandardTypesPlugin.js.flow +0 -99
  186. package/node8plus/plugins/StandardTypesPlugin.js.map +0 -1
  187. package/node8plus/plugins/SubscriptionPlugin.js +0 -75
  188. package/node8plus/plugins/SubscriptionPlugin.js.flow +0 -79
  189. package/node8plus/plugins/SubscriptionPlugin.js.map +0 -1
  190. package/node8plus/plugins/SwallowErrorsPlugin.js +0 -31
  191. package/node8plus/plugins/SwallowErrorsPlugin.js.flow +0 -28
  192. package/node8plus/plugins/SwallowErrorsPlugin.js.map +0 -1
  193. package/node8plus/plugins/TrimEmptyDescriptionsPlugin.js +0 -54
  194. package/node8plus/plugins/TrimEmptyDescriptionsPlugin.js.flow +0 -40
  195. package/node8plus/plugins/TrimEmptyDescriptionsPlugin.js.map +0 -1
  196. package/node8plus/plugins/index.js +0 -88
  197. package/node8plus/plugins/index.js.flow +0 -25
  198. package/node8plus/plugins/index.js.map +0 -1
  199. package/node8plus/resolveNode.js +0 -50
  200. package/node8plus/resolveNode.js.flow +0 -49
  201. package/node8plus/resolveNode.js.map +0 -1
  202. package/node8plus/swallowError.js +0 -35
  203. package/node8plus/swallowError.js.flow +0 -31
  204. package/node8plus/swallowError.js.map +0 -1
  205. package/node8plus/utils.js +0 -102
  206. package/node8plus/utils.js.flow +0 -91
  207. package/node8plus/utils.js.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,100 @@
1
+ # graphile-build
2
+
3
+ ## 5.0.0-0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ [[`208166269`](https://github.com/benjie/postgraphile-private/commit/208166269177d6e278b056e1c77d26a2d8f59f49)]:
9
+ - grafast@0.0.1-0.8
10
+
11
+ ## 5.0.0-0.9
12
+
13
+ ### Patch Changes
14
+
15
+ - [`6ebe3a13e`](https://github.com/benjie/postgraphile-private/commit/6ebe3a13e563f2bd665b24a5c84bbfc5eba1cc0a)
16
+ Thanks [@benjie](https://github.com/benjie)! - Enable omitting update/delete
17
+ mutations using behaviors on unique constraints.
18
+
19
+ ## 5.0.0-0.8
20
+
21
+ ### Patch Changes
22
+
23
+ - [`677c8f5fc`](undefined) - Create new getTags() introspection helper and use
24
+ it. Rename GraphileBuild.GraphileBuildSchemaOptions to
25
+ GraphileBuild.SchemaOptions. Fix a couple minor inflection bugs. Add some
26
+ missing descriptions. Fix the initial inflection types to not leak
27
+ implementation details. Fix inflectors to use ResolvedPreset rather than
28
+ Preset.
29
+ - Updated dependencies []:
30
+ - grafast@0.0.1-0.7
31
+
32
+ ## 5.0.0-0.7
33
+
34
+ ### Patch Changes
35
+
36
+ - [`9b296ba54`](undefined) - More secure, more compatible, and lots of fixes
37
+ across the monorepo
38
+
39
+ - Updated dependencies [[`9b296ba54`](undefined)]:
40
+ - grafast@0.0.1-0.6
41
+ - graphile-config@0.0.1-0.2
42
+
43
+ ## 5.0.0-0.6
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [[`cd37fd02a`](undefined)]:
48
+ - grafast@0.0.1-0.5
49
+
50
+ ## 5.0.0-0.5
51
+
52
+ ### Patch Changes
53
+
54
+ - [`768f32681`](undefined) - Fix peerDependencies ranges
55
+
56
+ - Updated dependencies [[`768f32681`](undefined)]:
57
+ - grafast@0.0.1-0.4
58
+ - graphile-export@0.0.2-0.4
59
+
60
+ ## 5.0.0-0.4
61
+
62
+ ### Patch Changes
63
+
64
+ - [`d11c1911c`](undefined) - Fix dependencies
65
+
66
+ - Updated dependencies [[`d11c1911c`](undefined)]:
67
+ - grafast@0.0.1-0.3
68
+ - graphile-config@0.0.1-0.1
69
+ - graphile-export@0.0.2-0.3
70
+
71
+ ## 5.0.0-0.3
72
+
73
+ ### Patch Changes
74
+
75
+ - Updated dependencies [[`25037fc15`](undefined)]:
76
+ - grafast@0.0.1-0.2
77
+ - graphile-export@0.0.2-0.2
78
+
79
+ ## 5.0.0-0.2
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [[`55f15cf35`](undefined)]:
84
+ - grafast@0.0.1-0.1
85
+ - graphile-export@0.0.2-0.1
86
+
87
+ ## 5.0.0-0.1
88
+
89
+ ### Patch Changes
90
+
91
+ - [#125](https://github.com/benjie/postgraphile-private/pull/125)
92
+ [`91f2256b3`](https://github.com/benjie/postgraphile-private/commit/91f2256b3fd699bec19fc86f1ca79df057e58639)
93
+ Thanks [@benjie](https://github.com/benjie)! - Initial changesets release
94
+
95
+ - Updated dependencies
96
+ [[`91f2256b3`](https://github.com/benjie/postgraphile-private/commit/91f2256b3fd699bec19fc86f1ca79df057e58639)]:
97
+ - @graphile/lru@5.0.0-0.1
98
+ - grafast@0.0.1-0.0
99
+ - graphile-config@0.0.1-0.0
100
+ - graphile-export@0.0.2-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,34 +1,37 @@
1
1
  # graphile-build
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.svg?style=flat)](https://www.npmjs.com/package/graphile-build)
6
- ![MIT license](https://img.shields.io/npm/l/graphile-build.svg)
7
6
  [![Follow](https://img.shields.io/badge/twitter-@GraphileHQ-blue.svg)](https://twitter.com/GraphileHQ)
8
7
 
9
- `graphile-build` is the core of Graphile Engine. It provides a framework to
10
- build high-performance extensible GraphQL APIs by combining plugins and using
11
- advanced query look-ahead features. Each plugin typically has its own small
12
- purpose (such as implementing the Node interface, adding `query: Query` to
13
- mutation payloads, or watching an external source for schema changes) and by
14
- combining these plugins together you get a large, powerful, and manageable
15
- GraphQL schema. Plugins enable you to make broad changes to your GraphQL
16
- schema with minimal code and without sacrificing performance.
17
-
18
- An example of an application built on `graphile-build` is
19
- [PostGraphile](https://github.com/graphile/postgraphile) which with one
20
- command connects to your PostgreSQL database and provides a full highly
21
- performant standards-compliant GraphQL API. The separate `graphile-build-pg`
22
- module contains the plugins that are specific to PostgreSQL support
23
- (`graphile-build` itself does not know about databases).
8
+ `graphile-build` provides a framework to build extensible GraphQL APIs by
9
+ combining plugins. Each plugin typically has its own small purpose (such as
10
+ implementing the [`Node` interface][global-object-identification], adding
11
+ `query: Query` to mutation payloads, or watching an external source for schema
12
+ changes) and by combining these plugins together you get a large, powerful, and
13
+ manageable GraphQL schema. Plugins enable you to make broad changes to your
14
+ GraphQL schema with minimal code, and because you're changing your schema in
15
+ broad ways it helps to guarantee consistency.
16
+
17
+ Graphile Build has strong built-in support for [Gra*fast*](https://grafast.org)
18
+ so you can make an exceptionally performant auto-generated (or
19
+ generator-assisted) GraphQL API.
20
+
21
+ [PostGraphile](https://github.com/graphile/postgraphile) uses Graphile Build and
22
+ Gra*fast* to produce an extremely high performance standards-compliant GraphQL
23
+ API with minimal fuss. The separate
24
+ [`graphile-build-pg` module](../graphile-build-pg/README.md) contains the
25
+ plugins that are specific to PostgreSQL support (`graphile-build` itself does
26
+ not know nor care about databases).
24
27
 
25
28
  <!-- SPONSORS_BEGIN -->
26
29
 
27
30
  ## Crowd-funded open-source software
28
31
 
29
- To help us develop this software sustainably under the MIT license, we ask
30
- all individuals and businesses that use it to help support its ongoing
31
- maintenance and development via sponsorship.
32
+ To help us develop this software sustainably under the MIT license, we ask all
33
+ individuals and businesses that use it to help support its ongoing maintenance
34
+ and development via sponsorship.
32
35
 
33
36
  ### [Click here to find out more about sponsors and sponsorship.](https://www.graphile.org/sponsor/)
34
37
 
@@ -36,16 +39,16 @@ And please give some love to our featured sponsors 🤩:
36
39
 
37
40
  <table><tr>
38
41
  <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>
39
- <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="Story.ai" /><br />Story.ai</a> *</td>
40
- <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>
42
+ <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>
43
+ <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>
41
44
  <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>
42
45
  </tr><tr>
43
- <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>
46
+ <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>
44
47
  <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>
45
- <td align="center"><a href="https://graphcdn.io/"><img src="https://graphile.org/images/sponsors/GraphCDN.png" width="90" height="90" alt="GraphCDN" /><br />GraphCDN</a> *</td>
46
48
  <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>
47
- </tr><tr>
48
49
  <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>
50
+ </tr><tr>
51
+ <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>
49
52
  </tr></table>
50
53
 
51
54
  <em>\* Sponsors the entire Graphile suite</em>
@@ -54,11 +57,7 @@ And please give some love to our featured sponsors 🤩:
54
57
 
55
58
  ## Documentation
56
59
 
57
- **For in-depth documentation about `graphile-build`, please see [the graphile
58
- documentation website at graphile.org](https://www.graphile.org/).** The
59
- below just serves as a limited quick-reference for people already familiar
60
- with the library.
60
+ TODO!
61
61
 
62
- **Please note: rather than using the raw plugin interface that
63
- `graphile-build` exposes, you may want to use the helpers in
64
- the `graphile-utils` module.**
62
+ [global-object-identification]:
63
+ https://relay.dev/graphql/objectidentification.htm
@@ -0,0 +1,57 @@
1
+ /// <reference types="node" />
2
+ import "./global.js";
3
+ import { EventEmitter } from "events";
4
+ import { GraphQLSchema } from "graphql";
5
+ import type { NewWithHooksFunction } from "./newWithHooks/index.js";
6
+ /**
7
+ * The class responsible for building a GraphQL schema from graphile-build
8
+ * plugins by orchestrating the various callback functions.
9
+ */
10
+ declare class SchemaBuilder<TBuild extends GraphileBuild.Build = GraphileBuild.Build> extends EventEmitter {
11
+ private inflection;
12
+ options: GraphileBuild.SchemaOptions;
13
+ depth: number;
14
+ hooks: GraphileBuild.SchemaBuilderHooks<TBuild>;
15
+ _currentPluginName: string | null | undefined;
16
+ /**
17
+ * Given a Build object, a GraphQL type constructor and a spec, applies the
18
+ * hooks to the spec and then constructs the type, returning the result.
19
+ */
20
+ newWithHooks: NewWithHooksFunction;
21
+ constructor(options: GraphileBuild.SchemaOptions, inflection: GraphileBuild.Inflection);
22
+ /**
23
+ * @internal
24
+ */
25
+ _setPluginName(name: string | null | undefined): void;
26
+ /**
27
+ * Registers 'fn' as a hook for the given 'hookName'. Every hook `fn` takes
28
+ * three arguments:
29
+ *
30
+ * - obj - the object currently being inspected
31
+ * - build - the current build object (which contains a number of utilities
32
+ * and the context of the build)
33
+ * - context - information specific to the current invocation of the hook
34
+ *
35
+ * The function must return a replacement object for `obj` or `obj` itself.
36
+ * Generally we advice that you return the object itself, modifying it as
37
+ * necessary. In JavaScript, modifying an object object tends to be
38
+ * significantly faster than returning a modified clone.
39
+ */
40
+ hook<THookName extends keyof GraphileBuild.SchemaBuilderHooks<TBuild>>(hookName: THookName, fn: GraphileBuild.SchemaBuilderHooks[THookName][number]): void;
41
+ /**
42
+ * Applies the given 'hookName' hooks to the given 'input' and returns the
43
+ * result, which is typically a derivative of 'input'.
44
+ */
45
+ applyHooks<THookName extends keyof GraphileBuild.SchemaBuilderHooks<TBuild>>(hookName: THookName, input: Parameters<GraphileBuild.SchemaBuilderHooks<TBuild>[THookName][number]>[0], build: Parameters<GraphileBuild.SchemaBuilderHooks<TBuild>[THookName][number]>[1], context: Parameters<GraphileBuild.SchemaBuilderHooks<TBuild>[THookName][number]>[2], debugStr?: string): Parameters<GraphileBuild.SchemaBuilderHooks<TBuild>[THookName][number]>[0];
46
+ /**
47
+ * Create the 'Build' object.
48
+ */
49
+ createBuild(input: GraphileBuild.BuildInput): TBuild;
50
+ /**
51
+ * Given the `input` (result of the "gather" phase), builds the GraphQL
52
+ * schema synchronously.
53
+ */
54
+ buildSchema(input: GraphileBuild.BuildInput): GraphQLSchema;
55
+ }
56
+ export default SchemaBuilder;
57
+ //# sourceMappingURL=SchemaBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaBuilder.d.ts","sourceRoot":"","sources":["../src/SchemaBuilder.ts"],"names":[],"mappings":";AAAA,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAkB,MAAM,SAAS,CAAC;AAGxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAapE;;;GAGG;AACH,cAAM,aAAa,CACjB,MAAM,SAAS,aAAa,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CACxD,SAAQ,YAAY;IAelB,OAAO,CAAC,UAAU;IAdpB,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAEhD,kBAAkB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAE9C;;;OAGG;IACH,YAAY,EAAE,oBAAoB,CAAC;gBAGjC,OAAO,EAAE,aAAa,CAAC,aAAa,EAC5B,UAAU,EAAE,aAAa,CAAC,UAAU;IAiB9C;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAI9C;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,SAAS,SAAS,MAAM,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,EACnE,QAAQ,EAAE,SAAS,EACnB,EAAE,EAAE,aAAa,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GACtD,IAAI;IAWP;;;OAGG;IACH,UAAU,CAAC,SAAS,SAAS,MAAM,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,EACzE,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,UAAU,CACf,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAC5D,CAAC,CAAC,CAAC,EACJ,KAAK,EAAE,UAAU,CACf,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAC5D,CAAC,CAAC,CAAC,EACJ,OAAO,EAAE,UAAU,CACjB,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAC5D,CAAC,CAAC,CAAC,EACJ,QAAQ,SAAK,GACZ,UAAU,CACX,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAC5D,CAAC,CAAC,CAAC;IA4EJ;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,GAAG,MAAM;IA6BpD;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,GAAG,aAAa;CAgD5D;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ require("./global.js");
5
+ const debug_1 = tslib_1.__importDefault(require("debug"));
6
+ const events_1 = require("events");
7
+ const graphql_1 = require("graphql");
8
+ const makeNewBuild_js_1 = tslib_1.__importDefault(require("./makeNewBuild.js"));
9
+ const index_js_1 = require("./newWithHooks/index.js");
10
+ const SchemaBuilderHooks_js_1 = require("./SchemaBuilderHooks.js");
11
+ const utils_js_1 = require("./utils.js");
12
+ const debug = (0, debug_1.default)("graphile-build:SchemaBuilder");
13
+ const INIT_OBJECT = Object.freeze(Object.create(null));
14
+ const INDENT = " ";
15
+ /**
16
+ * The class responsible for building a GraphQL schema from graphile-build
17
+ * plugins by orchestrating the various callback functions.
18
+ */
19
+ class SchemaBuilder extends events_1.EventEmitter {
20
+ inflection;
21
+ options;
22
+ depth;
23
+ hooks;
24
+ _currentPluginName;
25
+ /**
26
+ * Given a Build object, a GraphQL type constructor and a spec, applies the
27
+ * hooks to the spec and then constructs the type, returning the result.
28
+ */
29
+ newWithHooks;
30
+ constructor(options, inflection) {
31
+ super();
32
+ this.inflection = inflection;
33
+ if (!options) {
34
+ throw new Error("Please pass options to SchemaBuilder");
35
+ }
36
+ this.options = options;
37
+ // Because hooks can nest, this keeps track of how deep we are.
38
+ this.depth = -1;
39
+ this.hooks = (0, SchemaBuilderHooks_js_1.makeSchemaBuilderHooks)();
40
+ this.newWithHooks = (0, index_js_1.makeNewWithHooks)({ builder: this }).newWithHooks;
41
+ }
42
+ /**
43
+ * @internal
44
+ */
45
+ _setPluginName(name) {
46
+ this._currentPluginName = name;
47
+ }
48
+ /**
49
+ * Registers 'fn' as a hook for the given 'hookName'. Every hook `fn` takes
50
+ * three arguments:
51
+ *
52
+ * - obj - the object currently being inspected
53
+ * - build - the current build object (which contains a number of utilities
54
+ * and the context of the build)
55
+ * - context - information specific to the current invocation of the hook
56
+ *
57
+ * The function must return a replacement object for `obj` or `obj` itself.
58
+ * Generally we advice that you return the object itself, modifying it as
59
+ * necessary. In JavaScript, modifying an object object tends to be
60
+ * significantly faster than returning a modified clone.
61
+ */
62
+ hook(hookName, fn) {
63
+ if (!this.hooks[hookName]) {
64
+ // TODO: fuzzy-find a similar hook
65
+ throw new Error(`Sorry, '${hookName}' is not a supported hook`);
66
+ }
67
+ if (this._currentPluginName) {
68
+ fn.displayName = `${this._currentPluginName}/schema.hooks.${hookName}`;
69
+ }
70
+ this.hooks[hookName].push(fn);
71
+ }
72
+ /**
73
+ * Applies the given 'hookName' hooks to the given 'input' and returns the
74
+ * result, which is typically a derivative of 'input'.
75
+ */
76
+ applyHooks(hookName, input, build, context, debugStr = "") {
77
+ if (!input) {
78
+ throw new Error("applyHooks was called with falsy input");
79
+ }
80
+ this.depth++;
81
+ const indent = INDENT.repeat(this.depth);
82
+ try {
83
+ debug(`%s[%s%s]: Running...`, indent, hookName, debugStr);
84
+ const hooks = this.hooks[hookName];
85
+ if (!hooks) {
86
+ throw new Error(`Sorry, '${hookName}' is not a registered hook`);
87
+ }
88
+ let newObj = input;
89
+ for (const hook of hooks) {
90
+ this.depth++;
91
+ try {
92
+ const hookDisplayName = hook.displayName || hook.name || "anonymous";
93
+ debug(`%s[%s%s]: Executing '%s'`, indent, hookName, debugStr, hookDisplayName);
94
+ const previousHookName = build.status.currentHookName;
95
+ const previousHookEvent = build.status.currentHookEvent;
96
+ build.status.currentHookName = hookDisplayName;
97
+ build.status.currentHookEvent = hookName;
98
+ const oldObj = newObj;
99
+ newObj = hook(newObj, build, context);
100
+ if (hookName === "build") {
101
+ /*
102
+ * Unlike all the other hooks, the `build` hook must always use the
103
+ * same `build` object - never returning a new object for fear of
104
+ * causing issues to other build hooks that reference the old
105
+ * object and don't get the new additions.
106
+ */
107
+ if (newObj !== oldObj) {
108
+ throw new Error(`Build hook '${hookDisplayName}' returned a new object; 'build' hooks must always return the same Build object - please use 'return build.extend(build, {...})' instead.`);
109
+ }
110
+ }
111
+ build.status.currentHookName = previousHookName;
112
+ build.status.currentHookEvent = previousHookEvent;
113
+ if (!newObj) {
114
+ throw new Error(`GraphileBuild.Hook '${hook.displayName || hook.name || "anonymous"}' for '${hookName}' returned falsy value '${newObj}'`);
115
+ }
116
+ debug(`%s[%s%s]: '%s' complete`, indent, hookName, debugStr, hookDisplayName);
117
+ }
118
+ finally {
119
+ this.depth--;
120
+ }
121
+ }
122
+ debug(`%s[%s%s]: Complete`, indent, hookName, debugStr);
123
+ return newObj;
124
+ }
125
+ finally {
126
+ this.depth--;
127
+ }
128
+ }
129
+ /**
130
+ * Create the 'Build' object.
131
+ */
132
+ createBuild(input) {
133
+ const initialBuild = (0, makeNewBuild_js_1.default)(this, input, this.inflection);
134
+ const build = this.applyHooks("build", initialBuild, initialBuild, {
135
+ scope: Object.create(null),
136
+ type: "build",
137
+ });
138
+ // Bind all functions so they can be dereferenced
139
+ (0, utils_js_1.bindAll)(build, Object.keys(build).filter((key) => typeof build[key] === "function"));
140
+ const finalBuild = Object.freeze(build);
141
+ finalBuild.status.isBuildPhaseComplete = true;
142
+ const initContext = {
143
+ scope: Object.create(null),
144
+ type: "init",
145
+ };
146
+ this.applyHooks("init", INIT_OBJECT, finalBuild, initContext);
147
+ finalBuild.status.isInitPhaseComplete = true;
148
+ return finalBuild;
149
+ }
150
+ /**
151
+ * Given the `input` (result of the "gather" phase), builds the GraphQL
152
+ * schema synchronously.
153
+ */
154
+ buildSchema(input) {
155
+ const build = this.createBuild(input);
156
+ const schemaSpec = {
157
+ directives: [...build.graphql.specifiedDirectives],
158
+ };
159
+ const schemaScope = {
160
+ __origin: `Graphile built-in`,
161
+ };
162
+ const tempSchema = this.newWithHooks(build, graphql_1.GraphQLSchema, schemaSpec, schemaScope);
163
+ const finalizeContext = {
164
+ scope: Object.create(null),
165
+ type: "finalize",
166
+ };
167
+ const schema = tempSchema
168
+ ? this.applyHooks("finalize", tempSchema, build, finalizeContext, "Finalizing GraphQL schema")
169
+ : tempSchema;
170
+ if (!schema) {
171
+ throw new Error("Schema generation failed");
172
+ }
173
+ const validationErrors = (0, graphql_1.validateSchema)(schema);
174
+ if (validationErrors.length) {
175
+ throw new AggregateError(validationErrors, `Schema construction failed due to ${validationErrors.length} validation failure(s). First failure was: ${String(validationErrors[0])}`);
176
+ }
177
+ return schema;
178
+ }
179
+ }
180
+ exports.default = SchemaBuilder;
181
+ //# sourceMappingURL=SchemaBuilder.js.map
@@ -0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E,UAAU;SACjB,CAAC;QAEF,MAAM,MAAM,GAAG,UAAU;YACvB,CAAC,CAAC,IAAI,CAAC,UAAU,CACb,UAAU,EACV,UAAU,EACV,KAAK,EACL,eAAe,EACf,2BAA2B,CAC5B;YACH,CAAC,CAAC,UAAU,CAAC;QAEf,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC7C;QAED,MAAM,gBAAgB,GAAG,IAAA,wBAAc,EAAC,MAAM,CAAC,CAAC;QAChD,IAAI,gBAAgB,CAAC,MAAM,EAAE;YAC3B,MAAM,IAAI,cAAc,CACtB,gBAAgB,EAChB,qCACE,gBAAgB,CAAC,MACnB,8CAA8C,MAAM,CAClD,gBAAgB,CAAC,CAAC,CAAC,CACpB,EAAE,CACJ,CAAC;SACH;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,kBAAe,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ import "./global.js";
2
+ /**
3
+ * Returns a new object with arrays for each supported schema hook, ready for
4
+ * hook functions to be registered into it.
5
+ */
6
+ export declare function makeSchemaBuilderHooks<TBuild extends GraphileBuild.Build = GraphileBuild.Build>(): GraphileBuild.SchemaBuilderHooks<TBuild>;
7
+ //# sourceMappingURL=SchemaBuilderHooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaBuilderHooks.d.ts","sourceRoot":"","sources":["../src/SchemaBuilderHooks.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,SAAS,aAAa,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,KACrD,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,CA2B5C"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeSchemaBuilderHooks = void 0;
4
+ require("./global.js");
5
+ /**
6
+ * Returns a new object with arrays for each supported schema hook, ready for
7
+ * hook functions to be registered into it.
8
+ */
9
+ function makeSchemaBuilderHooks() {
10
+ return {
11
+ build: [],
12
+ init: [],
13
+ finalize: [],
14
+ GraphQLSchema: [],
15
+ GraphQLSchema_types: [],
16
+ GraphQLObjectType: [],
17
+ GraphQLObjectType_interfaces: [],
18
+ GraphQLObjectType_fields: [],
19
+ GraphQLObjectType_fields_field: [],
20
+ GraphQLObjectType_fields_field_args: [],
21
+ GraphQLInputObjectType: [],
22
+ GraphQLInputObjectType_fields: [],
23
+ GraphQLInputObjectType_fields_field: [],
24
+ GraphQLEnumType: [],
25
+ GraphQLEnumType_values: [],
26
+ GraphQLEnumType_values_value: [],
27
+ GraphQLUnionType: [],
28
+ GraphQLUnionType_types: [],
29
+ GraphQLInterfaceType: [],
30
+ GraphQLInterfaceType_fields: [],
31
+ GraphQLInterfaceType_fields_field: [],
32
+ GraphQLInterfaceType_fields_field_args: [],
33
+ GraphQLInterfaceType_interfaces: [],
34
+ GraphQLScalarType: [],
35
+ };
36
+ }
37
+ exports.makeSchemaBuilderHooks = makeSchemaBuilderHooks;
38
+ //# sourceMappingURL=SchemaBuilderHooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaBuilderHooks.js","sourceRoot":"","sources":["../src/SchemaBuilderHooks.ts"],"names":[],"mappings":";;;AAAA,uBAAqB;AAErB;;;GAGG;AACH,SAAgB,sBAAsB;IAGpC,OAAO;QACL,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,aAAa,EAAE,EAAE;QACjB,mBAAmB,EAAE,EAAE;QACvB,iBAAiB,EAAE,EAAE;QACrB,4BAA4B,EAAE,EAAE;QAChC,wBAAwB,EAAE,EAAE;QAC5B,8BAA8B,EAAE,EAAE;QAClC,mCAAmC,EAAE,EAAE;QACvC,sBAAsB,EAAE,EAAE;QAC1B,6BAA6B,EAAE,EAAE;QACjC,mCAAmC,EAAE,EAAE;QACvC,eAAe,EAAE,EAAE;QACnB,sBAAsB,EAAE,EAAE;QAC1B,4BAA4B,EAAE,EAAE;QAChC,gBAAgB,EAAE,EAAE;QACpB,sBAAsB,EAAE,EAAE;QAC1B,oBAAoB,EAAE,EAAE;QACxB,2BAA2B,EAAE,EAAE;QAC/B,iCAAiC,EAAE,EAAE;QACrC,sCAAsC,EAAE,EAAE;QAC1C,+BAA+B,EAAE,EAAE;QACnC,iBAAiB,EAAE,EAAE;KACtB,CAAC;AACJ,CAAC;AA7BD,wDA6BC"}
@@ -0,0 +1,11 @@
1
+ export declare class Behavior {
2
+ private globalBehaviorDefaults;
3
+ addDefaultBehavior(behavior: string): void;
4
+ /**
5
+ * @param localBehaviorSpecsString - the behavior of the entity as determined by details on the entity itself and any applicable ancestors
6
+ * @param filter - the behavior the plugin specifies
7
+ * @param defaultBehavior - allows the plugin to specify a default behavior for this in the event that it's not defined elsewhere (lowest priority)
8
+ */
9
+ matches(localBehaviorSpecsString: string | string[] | null | undefined, filter: string, defaultBehavior?: string): boolean | undefined;
10
+ }
11
+ //# sourceMappingURL=behavior.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"behavior.d.ts","sourceRoot":"","sources":["../src/behavior.ts"],"names":[],"mappings":"AAMA,qBAAa,QAAQ;IACnB,OAAO,CAAC,sBAAsB,CAAM;IAG7B,kBAAkB,CAAC,QAAQ,EAAE,MAAM;IAS1C;;;;OAIG;IACI,OAAO,CACZ,wBAAwB,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,EAC9D,MAAM,EAAE,MAAM,EACd,eAAe,SAAK,GACnB,OAAO,GAAG,SAAS;CAkBvB"}