@grafserv/persisted 0.0.0-beta.2 → 0.0.0-beta.21

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,245 @@
1
1
  # @grafserv/persisted
2
2
 
3
+ ## 0.0.0-beta.21
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ [[`437570f97`](https://github.com/graphile/crystal/commit/437570f97e8520afaf3d0d0b514d1f4c31546b76)]:
9
+ - grafast@0.1.1-beta.9
10
+ - grafserv@0.1.1-beta.11
11
+
12
+ ## 0.0.0-beta.20
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+ [[`bd5a908a4`](https://github.com/graphile/crystal/commit/bd5a908a4d04310f90dfb46ad87398ffa993af3b)]:
18
+ - grafast@0.1.1-beta.8
19
+ - grafserv@0.1.1-beta.10
20
+
21
+ ## 0.0.0-beta.19
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+ [[`357d475f5`](https://github.com/graphile/crystal/commit/357d475f54fecc8c51892e0346d6872b34132430),
27
+ [`3551725e7`](https://github.com/graphile/crystal/commit/3551725e71c3ed876554e19e5ab2c1dcb0fb1143),
28
+ [`80836471e`](https://github.com/graphile/crystal/commit/80836471e5cedb29dee63bc5002550c4f1713cfd),
29
+ [`a5c20fefb`](https://github.com/graphile/crystal/commit/a5c20fefb571dea6d1187515dc48dd547e9e6204),
30
+ [`1ce08980e`](https://github.com/graphile/crystal/commit/1ce08980e2a52ed9bc81564d248c19648ecd3616),
31
+ [`dff4f2535`](https://github.com/graphile/crystal/commit/dff4f2535ac6ce893089b312fcd5fffcd98573a5),
32
+ [`a287a57c2`](https://github.com/graphile/crystal/commit/a287a57c2765da0fb6a132ea0953f64453210ceb),
33
+ [`2fe56f9a6`](https://github.com/graphile/crystal/commit/2fe56f9a6dac03484ace45c29c2223a65f9ca1db),
34
+ [`fed603d71`](https://github.com/graphile/crystal/commit/fed603d719c02f33e12190f925c9e3b06c581fac),
35
+ [`ed6e0d278`](https://github.com/graphile/crystal/commit/ed6e0d2788217a1c419634837f4208013eaf2923),
36
+ [`e82e4911e`](https://github.com/graphile/crystal/commit/e82e4911e32138df1b90ec0fde555ea963018d21),
37
+ [`42ece5aa6`](https://github.com/graphile/crystal/commit/42ece5aa6ca05345ebc17fb5c7d55df3b79b7612),
38
+ [`e0d69e518`](https://github.com/graphile/crystal/commit/e0d69e518a98c70f9b90f59d243ce33978c1b5a1),
39
+ [`db8ceed0f`](https://github.com/graphile/crystal/commit/db8ceed0f17923eb78ff09c9f3f28800a5c7e3b6),
40
+ [`a5a0816bd`](https://github.com/graphile/crystal/commit/a5a0816bddc85a841770202db57457ff13137852),
41
+ [`6699388ec`](https://github.com/graphile/crystal/commit/6699388ec167d35c71220ce5d9113cac578da6cb),
42
+ [`966203504`](https://github.com/graphile/crystal/commit/96620350467ab8c65b56adf2f055e19450f8e772),
43
+ [`c1645b249`](https://github.com/graphile/crystal/commit/c1645b249aae949a548cd916e536ccfb63e5ab35),
44
+ [`ed8bbaa3c`](https://github.com/graphile/crystal/commit/ed8bbaa3cd1563a7601ca8c6b0412633b0ea4ce9),
45
+ [`a0e82b9c5`](https://github.com/graphile/crystal/commit/a0e82b9c5f4e585f1af1e147299cd07944ece6f8),
46
+ [`14e2412ee`](https://github.com/graphile/crystal/commit/14e2412ee368e8d53abf6774c7f0069f32d4e8a3),
47
+ [`57ab0e1e7`](https://github.com/graphile/crystal/commit/57ab0e1e72c01213b21d3efc539cd655d83d993a),
48
+ [`8442242e4`](https://github.com/graphile/crystal/commit/8442242e43cac7d89ca0c413cf42c9fabf6f247f),
49
+ [`64ce7b765`](https://github.com/graphile/crystal/commit/64ce7b7650530251aec38a51089da66f914c19b4),
50
+ [`cba842357`](https://github.com/graphile/crystal/commit/cba84235786acbd77ade53bae7a3fba4a9be1eb7),
51
+ [`2fa77d0f2`](https://github.com/graphile/crystal/commit/2fa77d0f237cdb98d3dafb6b5e4083a2c6c38673)]:
52
+ - grafast@0.1.1-beta.7
53
+ - graphile-config@0.0.1-beta.8
54
+ - grafserv@0.1.1-beta.9
55
+
56
+ ## 0.0.0-beta.18
57
+
58
+ ### Patch Changes
59
+
60
+ - Updated dependencies
61
+ [[`9f85c614d`](https://github.com/graphile/crystal/commit/9f85c614d48dc745c5fed15333dbb75af7fddc88),
62
+ [`6c6be29f1`](https://github.com/graphile/crystal/commit/6c6be29f12b24782c926b2bc62ed2ede09ac05de),
63
+ [`8315e8d01`](https://github.com/graphile/crystal/commit/8315e8d01c118cebc4ebbc53a2f264b958b252ad)]:
64
+ - grafast@0.1.1-beta.6
65
+ - grafserv@0.1.1-beta.8
66
+
67
+ ## 0.0.0-beta.17
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies
72
+ [[`63dd7ea99`](https://github.com/graphile/crystal/commit/63dd7ea992d30ad711dd85a73a127484a0e35479),
73
+ [`d801c9778`](https://github.com/graphile/crystal/commit/d801c9778a86d61e060896460af9fe62a733534a),
74
+ [`c21252541`](https://github.com/graphile/crystal/commit/c212525410cb2d97a808964ad727d0a68dd15f8b),
75
+ [`ef44c29b2`](https://github.com/graphile/crystal/commit/ef44c29b24a1ad5a042ae1536a4546dd64b17195),
76
+ [`5de3e86eb`](https://github.com/graphile/crystal/commit/5de3e86eba1ddfe5e07732d0325c63e5d72d4b5b)]:
77
+ - grafast@0.1.1-beta.5
78
+ - grafserv@0.1.1-beta.7
79
+ - graphile-config@0.0.1-beta.7
80
+
81
+ ## 0.0.0-beta.16
82
+
83
+ ### Patch Changes
84
+
85
+ - Updated dependencies
86
+ [[`de7add402`](https://github.com/graphile/crystal/commit/de7add402bd4a45c8782fce69bf210635360cbe8),
87
+ [`a2176ea32`](https://github.com/graphile/crystal/commit/a2176ea324db0801249661b30e9c9d314c6fb159),
88
+ [`886833e2e`](https://github.com/graphile/crystal/commit/886833e2e319f23d905d7184ca88fca701b94044)]:
89
+ - grafserv@0.1.1-beta.6
90
+ - grafast@0.1.1-beta.4
91
+
92
+ ## 0.0.0-beta.15
93
+
94
+ ### Patch Changes
95
+
96
+ - Updated dependencies
97
+ [[`0df5511ac`](https://github.com/graphile/crystal/commit/0df5511ac8b79ea34f8d12ebf8feeb421f8fe971)]:
98
+ - graphile-config@0.0.1-beta.6
99
+ - grafast@0.1.1-beta.3
100
+ - grafserv@0.1.1-beta.5
101
+
102
+ ## 0.0.0-beta.14
103
+
104
+ ### Patch Changes
105
+
106
+ - [#1877](https://github.com/graphile/crystal/pull/1877)
107
+ [`8a0cdb95f`](https://github.com/graphile/crystal/commit/8a0cdb95f200b28b0ea1ab5caa12b23dce5f374f)
108
+ Thanks [@benjie](https://github.com/benjie)! - Move 'declare global' out of
109
+ 'interfaces.ts' and into 'index.ts' or equivalent. Should make TypeScript more
110
+ aware of these types.
111
+ - Updated dependencies
112
+ [[`3fdc2bce4`](https://github.com/graphile/crystal/commit/3fdc2bce42418773f808c5b8309dfb361cd95ce9),
113
+ [`aeef362b5`](https://github.com/graphile/crystal/commit/aeef362b5744816f01e4a6f714bbd77f92332bc5),
114
+ [`8a76db07f`](https://github.com/graphile/crystal/commit/8a76db07f4c110cecc6225504f9a05ccbcbc7b92),
115
+ [`8a0cdb95f`](https://github.com/graphile/crystal/commit/8a0cdb95f200b28b0ea1ab5caa12b23dce5f374f),
116
+ [`995e25035`](https://github.com/graphile/crystal/commit/995e250352217fdf8f036b8ed6cad3fab520817f),
117
+ [`1c9f1c0ed`](https://github.com/graphile/crystal/commit/1c9f1c0edf4e621a5b6345d3a41527a18143c6ae)]:
118
+ - grafast@0.1.1-beta.2
119
+ - graphile-config@0.0.1-beta.5
120
+ - grafserv@0.1.1-beta.4
121
+
122
+ ## 0.0.0-beta.13
123
+
124
+ ### Patch Changes
125
+
126
+ - Updated dependencies
127
+ [[`9696a1b08`](https://github.com/graphile/crystal/commit/9696a1b0885442f44e3a6ca6a4909ec96a445884),
128
+ [`49fcb0d58`](https://github.com/graphile/crystal/commit/49fcb0d585b31b291c9072c339d6f5b550eefc9f),
129
+ [`7aef73319`](https://github.com/graphile/crystal/commit/7aef73319a8a147c700727be62427e1eefdefbf8)]:
130
+ - grafserv@0.1.1-beta.3
131
+ - grafast@0.1.1-beta.1
132
+ - graphile-config@0.0.1-beta.4
133
+
134
+ ## 0.0.0-beta.12
135
+
136
+ ### Patch Changes
137
+
138
+ - Updated dependencies []:
139
+ - grafserv@0.1.1-beta.2
140
+
141
+ ## 0.0.0-beta.11
142
+
143
+ ### Patch Changes
144
+
145
+ - Updated dependencies
146
+ [[`781a89758`](https://github.com/graphile/crystal/commit/781a89758fff2712f0080d8fafb4048da189b782),
147
+ [`a38e650d6`](https://github.com/graphile/crystal/commit/a38e650d67d6c7ff0cf5b853377622090ede3a50)]:
148
+ - grafserv@0.1.1-beta.1
149
+
150
+ ## 0.0.0-beta.10
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies
155
+ [[`4a4d26d87`](https://github.com/graphile/crystal/commit/4a4d26d87ce74589429b8ca5126a7bfdf30351b8),
156
+ [`b2bce88da`](https://github.com/graphile/crystal/commit/b2bce88da26c7a8965468be16fc2d935eadd3434),
157
+ [`861a8a306`](https://github.com/graphile/crystal/commit/861a8a306ef42a821da19e77903ddd7e8130bfb3),
158
+ [`2d31f058b`](https://github.com/graphile/crystal/commit/2d31f058b34d3f5ef11699582b9a4960a4ebc471)]:
159
+ - grafast@0.1.1-beta.0
160
+ - grafserv@0.1.1-beta.0
161
+
162
+ ## 0.0.0-beta.9
163
+
164
+ ### Patch Changes
165
+
166
+ - [#514](https://github.com/graphile/crystal-pre-merge/pull/514)
167
+ [`c9848f693`](https://github.com/graphile/crystal-pre-merge/commit/c9848f6936a5abd7740c0638bfb458fb5551f03b)
168
+ Thanks [@benjie](https://github.com/benjie)! - Update package.json repository
169
+ information
170
+
171
+ - Updated dependencies
172
+ [[`c9848f693`](https://github.com/graphile/crystal-pre-merge/commit/c9848f6936a5abd7740c0638bfb458fb5551f03b),
173
+ [`ede1092fe`](https://github.com/graphile/crystal-pre-merge/commit/ede1092fe197719b6fa786f4cfa75f6a1f4c56c1),
174
+ [`566983fbd`](https://github.com/graphile/crystal-pre-merge/commit/566983fbd99c4b2df8c4ebd6260521670a2b7dfc),
175
+ [`409bf6071`](https://github.com/graphile/crystal-pre-merge/commit/409bf607180d4d8faec658c803e5ec4d1a00c451)]:
176
+ - graphile-config@0.0.1-beta.3
177
+ - grafserv@0.0.1-beta.9
178
+ - grafast@0.0.1-beta.8
179
+ - @graphile/lru@5.0.0-beta.3
180
+
181
+ ## 0.0.0-beta.8
182
+
183
+ ### Patch Changes
184
+
185
+ - Updated dependencies []:
186
+ - grafserv@0.0.1-beta.8
187
+
188
+ ## 0.0.0-beta.7
189
+
190
+ ### Patch Changes
191
+
192
+ - Updated dependencies
193
+ [[`3700e204f`](https://github.com/benjie/crystal/commit/3700e204f430db182c92ca7abc82017c81fa1f9b)]:
194
+ - grafast@0.0.1-beta.7
195
+ - grafserv@0.0.1-beta.7
196
+
197
+ ## 0.0.0-beta.6
198
+
199
+ ### Patch Changes
200
+
201
+ - [#496](https://github.com/benjie/crystal/pull/496)
202
+ [`c9bfd9892`](https://github.com/benjie/crystal/commit/c9bfd989247f9433fb5b18c5175c9d8d64cd21a1)
203
+ Thanks [@benjie](https://github.com/benjie)! - Update dependencies (sometimes
204
+ through major versions).
205
+
206
+ - Updated dependencies
207
+ [[`c9bfd9892`](https://github.com/benjie/crystal/commit/c9bfd989247f9433fb5b18c5175c9d8d64cd21a1),
208
+ [`e613b476d`](https://github.com/benjie/crystal/commit/e613b476d6ee867d1f7509c895dabee40e7f9a31)]:
209
+ - graphile-config@0.0.1-beta.2
210
+ - grafserv@0.0.1-beta.6
211
+ - grafast@0.0.1-beta.6
212
+ - @graphile/lru@5.0.0-beta.2
213
+
214
+ ## 0.0.0-beta.5
215
+
216
+ ### Patch Changes
217
+
218
+ - Updated dependencies
219
+ [[`53186213a`](https://github.com/benjie/crystal/commit/53186213ade962f4b66cb0d5ea8b57b5ce7ea85f)]:
220
+ - grafast@0.0.1-beta.5
221
+ - grafserv@0.0.1-beta.5
222
+
223
+ ## 0.0.0-beta.4
224
+
225
+ ### Patch Changes
226
+
227
+ - Updated dependencies
228
+ [[`f9cc88dc4`](https://github.com/benjie/crystal/commit/f9cc88dc442d371aee154a28d4e63c6da39f6b2e),
229
+ [`22fa6230a`](https://github.com/benjie/crystal/commit/22fa6230aa7c7271e5360e619ec9e1f52c6ea49c),
230
+ [`fa8cfcf9b`](https://github.com/benjie/crystal/commit/fa8cfcf9b4ce0c3e12511f3f6392051924a719e5)]:
231
+ - grafast@0.0.1-beta.4
232
+ - grafserv@0.0.1-beta.4
233
+
234
+ ## 0.0.0-beta.3
235
+
236
+ ### Patch Changes
237
+
238
+ - Updated dependencies
239
+ [[`46cd08aa1`](https://github.com/benjie/crystal/commit/46cd08aa13e3bac4d186c72c6ce24997f37658af)]:
240
+ - grafast@0.0.1-beta.3
241
+ - grafserv@0.0.1-beta.3
242
+
3
243
  ## 0.0.0-beta.2
4
244
 
5
245
  ### Patch Changes
package/README.md CHANGED
@@ -21,9 +21,9 @@ servers you will need different software.
21
21
 
22
22
  ## Crowd-funded open-source software
23
23
 
24
- To help us develop this software sustainably under the MIT license, we ask all
25
- individuals and businesses that use it to help support its ongoing maintenance
26
- and development via sponsorship.
24
+ To help us develop this software sustainably, we ask all individuals and
25
+ businesses that use it to help support its ongoing maintenance and development
26
+ via sponsorship.
27
27
 
28
28
  ### [Click here to find out more about sponsors and sponsorship.](https://www.graphile.org/sponsor/)
29
29
 
@@ -32,12 +32,11 @@ And please give some love to our featured sponsors 🤩:
32
32
  <table><tr>
33
33
  <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>
34
34
  <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>
35
- <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>
36
35
  <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>
37
- </tr><tr>
38
- <td align="center"><a href=""><img src="https://graphile.org/images/sponsors/chadf.png" width="90" height="90" alt="Chad Furman" /><br />Chad Furman</a> *</td>
39
36
  <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>
40
- <td align="center"><a href="https://www.accenture.com/"><img src="https://graphile.org/images/sponsors/accenture.svg" width="90" height="90" alt="Accenture" /><br />Accenture</a> *</td>
37
+ </tr><tr>
38
+ <td align="center"><a href="https://gosteelhead.com/"><img src="https://graphile.org/images/sponsors/steelhead.svg" width="90" height="90" alt="Steelhead" /><br />Steelhead</a> *</td>
39
+ <td align="center"><a href="https://www.sylvera.com/"><img src="https://graphile.org/images/sponsors/sylvera.svg" width="90" height="90" alt="Sylvera" /><br />Sylvera</a> *</td>
41
40
  </tr></table>
42
41
 
43
42
  <em>\* Sponsors the entire Graphile suite</em>
@@ -47,8 +46,8 @@ And please give some love to our featured sponsors 🤩:
47
46
  ## Installation
48
47
 
49
48
  ```sh
50
- yarn add @grafserv/persisted
51
- # or: npm install --save @grafserv/persisted
49
+ yarn add @grafserv/persisted@beta
50
+ # or: npm install --save @grafserv/persisted@beta
52
51
  ```
53
52
 
54
53
  ## Usage
package/dist/index.d.ts CHANGED
@@ -1,4 +1,79 @@
1
+ import type { ParsedGraphQLBody, ProcessGraphQLRequestBodyEvent } from "grafserv";
1
2
  export type { PersistedOperationGetter } from "./interfaces.js";
3
+ import type { PersistedOperationGetter } from "./interfaces.js";
2
4
  declare const PersistedPlugin: GraphileConfig.Plugin;
3
5
  export default PersistedPlugin;
6
+ declare global {
7
+ namespace GraphileConfig {
8
+ interface GrafservOptions {
9
+ /**
10
+ * This function will be passed a GraphQL request object (normally
11
+ * `{query: string, variables?: any, operationName?: string, extensions?: any}`,
12
+ * but in the case of persisted operations it likely won't have a `query`
13
+ * property), and must extract the hash to use to identify the persisted
14
+ * operation. For Apollo Client, this might be something like:
15
+ * `request?.extensions?.persistedQuery?.sha256Hash`; for Relay something
16
+ * like: `request?.documentId`.
17
+ */
18
+ hashFromPayload?(request: ParsedGraphQLBody): string | undefined;
19
+ /**
20
+ * We can read persisted operations from a folder (they must be named
21
+ * `<hash>.graphql`). When used in this way, the first request for a hash
22
+ * will read the file, and then the result will be cached such that the
23
+ * **filesystem read** will only impact the first use of that hash. We
24
+ * periodically scan the folder for new files, requests for hashes that
25
+ * were not present in our last scan of the folder will be rejected to
26
+ * mitigate denial of service attacks asking for non-existent hashes.
27
+ */
28
+ persistedOperationsDirectory?: string;
29
+ /**
30
+ * How many milliseconds should we leave it between scans of the persisted
31
+ * operations folder, checking for new files?
32
+ *
33
+ * Set this to the string "watch" to use `fs.watch` to monitor for changes. [EXPERIMENTAL].
34
+ *
35
+ * Set to `-1` to disable.
36
+ *
37
+ * Default: -1
38
+ */
39
+ persistedOperationsDirectoryScanInterval?: number | "watch";
40
+ /**
41
+ * An optional string-string key-value object defining the persisted
42
+ * operations, where the keys are the hashes, and the values are the
43
+ * operation document strings to use.
44
+ */
45
+ persistedOperations?: {
46
+ [hash: string]: string;
47
+ };
48
+ /**
49
+ * If your known persisted operations may change over time, or you'd rather
50
+ * load them on demand, you may supply this function. Note this function is
51
+ * **performance critical** so you should use caching to improve
52
+ * performance of any follow-up requests for the same hash.
53
+ */
54
+ persistedOperationsGetter?: PersistedOperationGetter;
55
+ /**
56
+ * There are situations where you may want to allow arbitrary operations
57
+ * (for example using GraphiQL in development, or allowing an admin to
58
+ * make arbitrary requests in production) whilst enforcing Persisted
59
+ * Operations for the application and non-admin users. This function
60
+ * allows you to determine under which circumstances persisted operations
61
+ * may be bypassed.
62
+ *
63
+ * IMPORTANT: this function must not throw!
64
+ *
65
+ * @example
66
+ *
67
+ * ```
68
+ * app.use(postgraphile(DATABASE_URL, SCHEMAS, {
69
+ * allowUnpersistedOperation(event) {
70
+ * return process.env.NODE_ENV === "development" && event.request?.getHeader('referer')?.endsWith("/graphiql");
71
+ * }
72
+ * });
73
+ * ```
74
+ */
75
+ allowUnpersistedOperation?: boolean | ((event: ProcessGraphQLRequestBodyEvent) => boolean);
76
+ }
77
+ }
78
+ }
4
79
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,YAAY,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAKhE,QAAA,MAAM,eAAe,EAAE,cAAc,CAAC,MA8CrC,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,iBAAiB,EACjB,8BAA8B,EAC/B,MAAM,UAAU,CAAC;AAGlB,YAAY,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAGhE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAGhE,QAAA,MAAM,eAAe,EAAE,cAAc,CAAC,MA8CrC,CAAC;AAEF,eAAe,eAAe,CAAC;AAoR/B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,cAAc,CAAC;QACvB,UAAU,eAAe;YACvB;;;;;;;;eAQG;YACH,eAAe,CAAC,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAAC;YAEjE;;;;;;;;eAQG;YACH,4BAA4B,CAAC,EAAE,MAAM,CAAC;YAEtC;;;;;;;;;eASG;YACH,wCAAwC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;YAE5D;;;;eAIG;YACH,mBAAmB,CAAC,EAAE;gBAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;aAAE,CAAC;YAEjD;;;;;eAKG;YACH,yBAAyB,CAAC,EAAE,wBAAwB,CAAC;YAErD;;;;;;;;;;;;;;;;;;;eAmBG;YACH,yBAAyB,CAAC,EACtB,OAAO,GACP,CAAC,CAAC,KAAK,EAAE,8BAA8B,KAAK,OAAO,CAAC,CAAC;SAC1D;KACF;CACF"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const grafast_1 = require("grafast");
5
4
  const promises_1 = tslib_1.__importDefault(require("node:fs/promises"));
5
+ const grafast_1 = require("grafast");
6
6
  const lru_1 = tslib_1.__importDefault(require("@graphile/lru"));
7
7
  const version_js_1 = require("./version.js");
8
8
  const PersistedPlugin = {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,qCAAoC;AAMpC,wEAAmC;AAGnC,gEAAgC;AAEhC,6CAAuC;AAEvC,MAAM,eAAe,GAA0B;IAC7C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,0CAA0C;IACvD,OAAO,EAAP,oBAAO;IAEP,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,yBAAyB,CAAC,IAAI,EAAE,KAAK;gBACnC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;gBACvB,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC;gBAC7C,IAAI,CAAC,OAAO,EAAE;oBACZ,MAAM,IAAI,mBAAS,CACjB,yDAAyD,EACzD,EAAE,UAAU,EAAE,GAAG,EAAE,CACpB,CAAC;iBACH;gBACD,MAAM,SAAS,GAAG,6BAA6B,CAC7C,IAAI,EACJ,OAAO,EACP,+BAA+B,CAAC,OAAO,EAAE,KAAK,CAAC,CAChD,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,CAAC;QACxC,sBAAsB,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAC7C;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAoCD,SAAS,+BAA+B,CACtC,OAAuC,EACvC,KAAqC;IAErC,MAAM,EAAE,yBAAyB,EAAE,GAAG,OAAO,CAAC;IAC9C,IAAI,OAAO,yBAAyB,KAAK,UAAU,EAAE;QACnD,OAAO,yBAAyB,CAAC,KAAK,CAAC,CAAC;KACzC;IACD,OAAO,CAAC,CAAC,yBAAyB,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,SAAS,6BAA6B,CACpC,OAA0B,EAC1B,OAAuC,EACvC,yBAAkC;IAElC,IAAI;QACF,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,sBAAsB,CAAC;QAC1E,MAAM,IAAI,GAAG,eAAe,CAAC,OAAyB,CAAC,CAAC;QACxD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,IAAI,yBAAyB,IAAI,OAAO,OAAO,EAAE,KAAK,KAAK,QAAQ,EAAE;gBACnE,OAAO,OAAO,CAAC,KAAK,CAAC;aACtB;YAED,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE,CAAC;SACH;QACD,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;KACrB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,gDAAgD,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QAE5E,2EAA2E;QAC3E,6BAA6B;QAC7B,OAAO,IAAI,CAAC;KACb;AACH,CAAC"}
@@ -1,81 +1,7 @@
1
1
  import type { PromiseOrDirect } from "grafast";
2
- import type { ParsedGraphQLBody, ProcessGraphQLRequestBodyEvent } from "grafserv";
3
2
  /**
4
3
  * Given a persisted operation hash, return the associated GraphQL operation
5
4
  * document.
6
5
  */
7
6
  export type PersistedOperationGetter = (hash: string) => PromiseOrDirect<string>;
8
- declare global {
9
- namespace GraphileConfig {
10
- interface GrafservOptions {
11
- /**
12
- * This function will be passed a GraphQL request object (normally
13
- * `{query: string, variables?: any, operationName?: string, extensions?: any}`,
14
- * but in the case of persisted operations it likely won't have a `query`
15
- * property), and must extract the hash to use to identify the persisted
16
- * operation. For Apollo Client, this might be something like:
17
- * `request?.extensions?.persistedQuery?.sha256Hash`; for Relay something
18
- * like: `request?.documentId`.
19
- */
20
- hashFromPayload?(request: ParsedGraphQLBody): string | undefined;
21
- /**
22
- * We can read persisted operations from a folder (they must be named
23
- * `<hash>.graphql`). When used in this way, the first request for a hash
24
- * will read the file, and then the result will be cached such that the
25
- * **filesystem read** will only impact the first use of that hash. We
26
- * periodically scan the folder for new files, requests for hashes that
27
- * were not present in our last scan of the folder will be rejected to
28
- * mitigate denial of service attacks asking for non-existent hashes.
29
- */
30
- persistedOperationsDirectory?: string;
31
- /**
32
- * How many milliseconds should we leave it between scans of the persisted
33
- * operations folder, checking for new files?
34
- *
35
- * Set this to the string "watch" to use `fs.watch` to monitor for changes. [EXPERIMENTAL].
36
- *
37
- * Set to `-1` to disable.
38
- *
39
- * Default: -1
40
- */
41
- persistedOperationsDirectoryScanInterval?: number | "watch";
42
- /**
43
- * An optional string-string key-value object defining the persisted
44
- * operations, where the keys are the hashes, and the values are the
45
- * operation document strings to use.
46
- */
47
- persistedOperations?: {
48
- [hash: string]: string;
49
- };
50
- /**
51
- * If your known persisted operations may change over time, or you'd rather
52
- * load them on demand, you may supply this function. Note this function is
53
- * **performance critical** so you should use caching to improve
54
- * performance of any follow-up requests for the same hash.
55
- */
56
- persistedOperationsGetter?: PersistedOperationGetter;
57
- /**
58
- * There are situations where you may want to allow arbitrary operations
59
- * (for example using GraphiQL in development, or allowing an admin to
60
- * make arbitrary requests in production) whilst enforcing Persisted
61
- * Operations for the application and non-admin users. This function
62
- * allows you to determine under which circumstances persisted operations
63
- * may be bypassed.
64
- *
65
- * IMPORTANT: this function must not throw!
66
- *
67
- * @example
68
- *
69
- * ```
70
- * app.use(postgraphile(DATABASE_URL, SCHEMAS, {
71
- * allowUnpersistedOperation(event) {
72
- * return process.env.NODE_ENV === "development" && event.request?.getHeader('referer')?.endsWith("/graphiql");
73
- * }
74
- * });
75
- * ```
76
- */
77
- allowUnpersistedOperation?: boolean | ((event: ProcessGraphQLRequestBodyEvent) => boolean);
78
- }
79
- }
80
- }
81
7
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EACV,iBAAiB,EACjB,8BAA8B,EAC/B,MAAM,UAAU,CAAC;AAGlB;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,IAAI,EAAE,MAAM,KACT,eAAe,CAAC,MAAM,CAAC,CAAC;AAE7B,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,cAAc,CAAC;QACvB,UAAU,eAAe;YACvB;;;;;;;;eAQG;YACH,eAAe,CAAC,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAAC;YAEjE;;;;;;;;eAQG;YACH,4BAA4B,CAAC,EAAE,MAAM,CAAC;YAEtC;;;;;;;;;eASG;YACH,wCAAwC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;YAE5D;;;;eAIG;YACH,mBAAmB,CAAC,EAAE;gBAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;aAAE,CAAC;YAEjD;;;;;eAKG;YACH,yBAAyB,CAAC,EAAE,wBAAwB,CAAC;YAErD;;;;;;;;;;;;;;;;;;;eAmBG;YACH,yBAAyB,CAAC,EACtB,OAAO,GACP,CAAC,CAAC,KAAK,EAAE,8BAA8B,KAAK,OAAO,CAAC,CAAC;SAC1D;KACF;CACF"}
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,IAAI,EAAE,MAAM,KACT,eAAe,CAAC,MAAM,CAAC,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const version = "0.0.0-beta.2";
1
+ export declare const version = "0.0.0-beta.21";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,iBAAiB,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
package/dist/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  // This file is autogenerated by /scripts/postversion.mjs
5
- exports.version = "0.0.0-beta.2";
5
+ exports.version = "0.0.0-beta.21";
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AAC5C,QAAA,OAAO,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AAC5C,QAAA,OAAO,GAAG,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafserv/persisted",
3
- "version": "0.0.0-beta.2",
3
+ "version": "0.0.0-beta.21",
4
4
  "description": "Persisted operations support for Grafserv",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "git+https://github.com/graphile/heart.git"
20
+ "url": "git+https://github.com/graphile/crystal.git"
21
21
  },
22
22
  "keywords": [
23
23
  "persisted",
@@ -35,20 +35,20 @@
35
35
  "author": "Benjie Gillam <code@benjiegillam.com>",
36
36
  "license": "MIT",
37
37
  "bugs": {
38
- "url": "https://github.com/graphile/heart/issues"
38
+ "url": "https://github.com/graphile/crystal/issues"
39
39
  },
40
- "homepage": "https://github.com/graphile/heart/tree/main/grafast/grafserv-persisted",
40
+ "homepage": "https://github.com/graphile/crystal/tree/main/grafast/grafserv-persisted",
41
41
  "dependencies": {
42
- "@graphile/lru": "^5.0.0-beta.1",
43
- "tslib": "^2.5.0"
42
+ "@graphile/lru": "^5.0.0-beta.3",
43
+ "tslib": "^2.6.2"
44
44
  },
45
45
  "engines": {
46
46
  "node": ">=16.10"
47
47
  },
48
48
  "peerDependencies": {
49
- "grafast": "^0.0.1-beta.2",
50
- "grafserv": "^0.0.1-beta.2",
51
- "graphile-config": "^0.0.1-beta.1"
49
+ "grafast": "^0.1.1-beta.9",
50
+ "grafserv": "^0.1.1-beta.11",
51
+ "graphile-config": "^0.0.1-beta.8"
52
52
  },
53
53
  "peerDependenciesMeta": {
54
54
  "graphile-config": {
@@ -56,13 +56,13 @@
56
56
  }
57
57
  },
58
58
  "devDependencies": {
59
- "grafast": "^0.0.1-beta.2",
60
- "grafserv": "^0.0.1-beta.2",
61
- "graphile-config": "^0.0.1-beta.1",
62
- "jest": "^28.1.3",
63
- "jest-serializer-graphql-schema": "^5.0.0-beta.1",
59
+ "grafast": "^0.1.1-beta.9",
60
+ "grafserv": "^0.1.1-beta.11",
61
+ "graphile-config": "^0.0.1-beta.8",
62
+ "jest": "^29.6.4",
63
+ "jest-serializer-graphql-schema": "^5.0.0-beta.3",
64
64
  "ts-node": "^10.9.1",
65
- "typescript": "^5.0.4"
65
+ "typescript": "^5.2.2"
66
66
  },
67
67
  "files": [
68
68
  "dist",