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

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,236 @@
1
1
  # @grafserv/persisted
2
2
 
3
+ ## 0.0.0-beta.20
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ [[`bd5a908a4`](https://github.com/graphile/crystal/commit/bd5a908a4d04310f90dfb46ad87398ffa993af3b)]:
9
+ - grafast@0.1.1-beta.8
10
+ - grafserv@0.1.1-beta.10
11
+
12
+ ## 0.0.0-beta.19
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+ [[`357d475f5`](https://github.com/graphile/crystal/commit/357d475f54fecc8c51892e0346d6872b34132430),
18
+ [`3551725e7`](https://github.com/graphile/crystal/commit/3551725e71c3ed876554e19e5ab2c1dcb0fb1143),
19
+ [`80836471e`](https://github.com/graphile/crystal/commit/80836471e5cedb29dee63bc5002550c4f1713cfd),
20
+ [`a5c20fefb`](https://github.com/graphile/crystal/commit/a5c20fefb571dea6d1187515dc48dd547e9e6204),
21
+ [`1ce08980e`](https://github.com/graphile/crystal/commit/1ce08980e2a52ed9bc81564d248c19648ecd3616),
22
+ [`dff4f2535`](https://github.com/graphile/crystal/commit/dff4f2535ac6ce893089b312fcd5fffcd98573a5),
23
+ [`a287a57c2`](https://github.com/graphile/crystal/commit/a287a57c2765da0fb6a132ea0953f64453210ceb),
24
+ [`2fe56f9a6`](https://github.com/graphile/crystal/commit/2fe56f9a6dac03484ace45c29c2223a65f9ca1db),
25
+ [`fed603d71`](https://github.com/graphile/crystal/commit/fed603d719c02f33e12190f925c9e3b06c581fac),
26
+ [`ed6e0d278`](https://github.com/graphile/crystal/commit/ed6e0d2788217a1c419634837f4208013eaf2923),
27
+ [`e82e4911e`](https://github.com/graphile/crystal/commit/e82e4911e32138df1b90ec0fde555ea963018d21),
28
+ [`42ece5aa6`](https://github.com/graphile/crystal/commit/42ece5aa6ca05345ebc17fb5c7d55df3b79b7612),
29
+ [`e0d69e518`](https://github.com/graphile/crystal/commit/e0d69e518a98c70f9b90f59d243ce33978c1b5a1),
30
+ [`db8ceed0f`](https://github.com/graphile/crystal/commit/db8ceed0f17923eb78ff09c9f3f28800a5c7e3b6),
31
+ [`a5a0816bd`](https://github.com/graphile/crystal/commit/a5a0816bddc85a841770202db57457ff13137852),
32
+ [`6699388ec`](https://github.com/graphile/crystal/commit/6699388ec167d35c71220ce5d9113cac578da6cb),
33
+ [`966203504`](https://github.com/graphile/crystal/commit/96620350467ab8c65b56adf2f055e19450f8e772),
34
+ [`c1645b249`](https://github.com/graphile/crystal/commit/c1645b249aae949a548cd916e536ccfb63e5ab35),
35
+ [`ed8bbaa3c`](https://github.com/graphile/crystal/commit/ed8bbaa3cd1563a7601ca8c6b0412633b0ea4ce9),
36
+ [`a0e82b9c5`](https://github.com/graphile/crystal/commit/a0e82b9c5f4e585f1af1e147299cd07944ece6f8),
37
+ [`14e2412ee`](https://github.com/graphile/crystal/commit/14e2412ee368e8d53abf6774c7f0069f32d4e8a3),
38
+ [`57ab0e1e7`](https://github.com/graphile/crystal/commit/57ab0e1e72c01213b21d3efc539cd655d83d993a),
39
+ [`8442242e4`](https://github.com/graphile/crystal/commit/8442242e43cac7d89ca0c413cf42c9fabf6f247f),
40
+ [`64ce7b765`](https://github.com/graphile/crystal/commit/64ce7b7650530251aec38a51089da66f914c19b4),
41
+ [`cba842357`](https://github.com/graphile/crystal/commit/cba84235786acbd77ade53bae7a3fba4a9be1eb7),
42
+ [`2fa77d0f2`](https://github.com/graphile/crystal/commit/2fa77d0f237cdb98d3dafb6b5e4083a2c6c38673)]:
43
+ - grafast@0.1.1-beta.7
44
+ - graphile-config@0.0.1-beta.8
45
+ - grafserv@0.1.1-beta.9
46
+
47
+ ## 0.0.0-beta.18
48
+
49
+ ### Patch Changes
50
+
51
+ - Updated dependencies
52
+ [[`9f85c614d`](https://github.com/graphile/crystal/commit/9f85c614d48dc745c5fed15333dbb75af7fddc88),
53
+ [`6c6be29f1`](https://github.com/graphile/crystal/commit/6c6be29f12b24782c926b2bc62ed2ede09ac05de),
54
+ [`8315e8d01`](https://github.com/graphile/crystal/commit/8315e8d01c118cebc4ebbc53a2f264b958b252ad)]:
55
+ - grafast@0.1.1-beta.6
56
+ - grafserv@0.1.1-beta.8
57
+
58
+ ## 0.0.0-beta.17
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies
63
+ [[`63dd7ea99`](https://github.com/graphile/crystal/commit/63dd7ea992d30ad711dd85a73a127484a0e35479),
64
+ [`d801c9778`](https://github.com/graphile/crystal/commit/d801c9778a86d61e060896460af9fe62a733534a),
65
+ [`c21252541`](https://github.com/graphile/crystal/commit/c212525410cb2d97a808964ad727d0a68dd15f8b),
66
+ [`ef44c29b2`](https://github.com/graphile/crystal/commit/ef44c29b24a1ad5a042ae1536a4546dd64b17195),
67
+ [`5de3e86eb`](https://github.com/graphile/crystal/commit/5de3e86eba1ddfe5e07732d0325c63e5d72d4b5b)]:
68
+ - grafast@0.1.1-beta.5
69
+ - grafserv@0.1.1-beta.7
70
+ - graphile-config@0.0.1-beta.7
71
+
72
+ ## 0.0.0-beta.16
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies
77
+ [[`de7add402`](https://github.com/graphile/crystal/commit/de7add402bd4a45c8782fce69bf210635360cbe8),
78
+ [`a2176ea32`](https://github.com/graphile/crystal/commit/a2176ea324db0801249661b30e9c9d314c6fb159),
79
+ [`886833e2e`](https://github.com/graphile/crystal/commit/886833e2e319f23d905d7184ca88fca701b94044)]:
80
+ - grafserv@0.1.1-beta.6
81
+ - grafast@0.1.1-beta.4
82
+
83
+ ## 0.0.0-beta.15
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies
88
+ [[`0df5511ac`](https://github.com/graphile/crystal/commit/0df5511ac8b79ea34f8d12ebf8feeb421f8fe971)]:
89
+ - graphile-config@0.0.1-beta.6
90
+ - grafast@0.1.1-beta.3
91
+ - grafserv@0.1.1-beta.5
92
+
93
+ ## 0.0.0-beta.14
94
+
95
+ ### Patch Changes
96
+
97
+ - [#1877](https://github.com/graphile/crystal/pull/1877)
98
+ [`8a0cdb95f`](https://github.com/graphile/crystal/commit/8a0cdb95f200b28b0ea1ab5caa12b23dce5f374f)
99
+ Thanks [@benjie](https://github.com/benjie)! - Move 'declare global' out of
100
+ 'interfaces.ts' and into 'index.ts' or equivalent. Should make TypeScript more
101
+ aware of these types.
102
+ - Updated dependencies
103
+ [[`3fdc2bce4`](https://github.com/graphile/crystal/commit/3fdc2bce42418773f808c5b8309dfb361cd95ce9),
104
+ [`aeef362b5`](https://github.com/graphile/crystal/commit/aeef362b5744816f01e4a6f714bbd77f92332bc5),
105
+ [`8a76db07f`](https://github.com/graphile/crystal/commit/8a76db07f4c110cecc6225504f9a05ccbcbc7b92),
106
+ [`8a0cdb95f`](https://github.com/graphile/crystal/commit/8a0cdb95f200b28b0ea1ab5caa12b23dce5f374f),
107
+ [`995e25035`](https://github.com/graphile/crystal/commit/995e250352217fdf8f036b8ed6cad3fab520817f),
108
+ [`1c9f1c0ed`](https://github.com/graphile/crystal/commit/1c9f1c0edf4e621a5b6345d3a41527a18143c6ae)]:
109
+ - grafast@0.1.1-beta.2
110
+ - graphile-config@0.0.1-beta.5
111
+ - grafserv@0.1.1-beta.4
112
+
113
+ ## 0.0.0-beta.13
114
+
115
+ ### Patch Changes
116
+
117
+ - Updated dependencies
118
+ [[`9696a1b08`](https://github.com/graphile/crystal/commit/9696a1b0885442f44e3a6ca6a4909ec96a445884),
119
+ [`49fcb0d58`](https://github.com/graphile/crystal/commit/49fcb0d585b31b291c9072c339d6f5b550eefc9f),
120
+ [`7aef73319`](https://github.com/graphile/crystal/commit/7aef73319a8a147c700727be62427e1eefdefbf8)]:
121
+ - grafserv@0.1.1-beta.3
122
+ - grafast@0.1.1-beta.1
123
+ - graphile-config@0.0.1-beta.4
124
+
125
+ ## 0.0.0-beta.12
126
+
127
+ ### Patch Changes
128
+
129
+ - Updated dependencies []:
130
+ - grafserv@0.1.1-beta.2
131
+
132
+ ## 0.0.0-beta.11
133
+
134
+ ### Patch Changes
135
+
136
+ - Updated dependencies
137
+ [[`781a89758`](https://github.com/graphile/crystal/commit/781a89758fff2712f0080d8fafb4048da189b782),
138
+ [`a38e650d6`](https://github.com/graphile/crystal/commit/a38e650d67d6c7ff0cf5b853377622090ede3a50)]:
139
+ - grafserv@0.1.1-beta.1
140
+
141
+ ## 0.0.0-beta.10
142
+
143
+ ### Patch Changes
144
+
145
+ - Updated dependencies
146
+ [[`4a4d26d87`](https://github.com/graphile/crystal/commit/4a4d26d87ce74589429b8ca5126a7bfdf30351b8),
147
+ [`b2bce88da`](https://github.com/graphile/crystal/commit/b2bce88da26c7a8965468be16fc2d935eadd3434),
148
+ [`861a8a306`](https://github.com/graphile/crystal/commit/861a8a306ef42a821da19e77903ddd7e8130bfb3),
149
+ [`2d31f058b`](https://github.com/graphile/crystal/commit/2d31f058b34d3f5ef11699582b9a4960a4ebc471)]:
150
+ - grafast@0.1.1-beta.0
151
+ - grafserv@0.1.1-beta.0
152
+
153
+ ## 0.0.0-beta.9
154
+
155
+ ### Patch Changes
156
+
157
+ - [#514](https://github.com/graphile/crystal-pre-merge/pull/514)
158
+ [`c9848f693`](https://github.com/graphile/crystal-pre-merge/commit/c9848f6936a5abd7740c0638bfb458fb5551f03b)
159
+ Thanks [@benjie](https://github.com/benjie)! - Update package.json repository
160
+ information
161
+
162
+ - Updated dependencies
163
+ [[`c9848f693`](https://github.com/graphile/crystal-pre-merge/commit/c9848f6936a5abd7740c0638bfb458fb5551f03b),
164
+ [`ede1092fe`](https://github.com/graphile/crystal-pre-merge/commit/ede1092fe197719b6fa786f4cfa75f6a1f4c56c1),
165
+ [`566983fbd`](https://github.com/graphile/crystal-pre-merge/commit/566983fbd99c4b2df8c4ebd6260521670a2b7dfc),
166
+ [`409bf6071`](https://github.com/graphile/crystal-pre-merge/commit/409bf607180d4d8faec658c803e5ec4d1a00c451)]:
167
+ - graphile-config@0.0.1-beta.3
168
+ - grafserv@0.0.1-beta.9
169
+ - grafast@0.0.1-beta.8
170
+ - @graphile/lru@5.0.0-beta.3
171
+
172
+ ## 0.0.0-beta.8
173
+
174
+ ### Patch Changes
175
+
176
+ - Updated dependencies []:
177
+ - grafserv@0.0.1-beta.8
178
+
179
+ ## 0.0.0-beta.7
180
+
181
+ ### Patch Changes
182
+
183
+ - Updated dependencies
184
+ [[`3700e204f`](https://github.com/benjie/crystal/commit/3700e204f430db182c92ca7abc82017c81fa1f9b)]:
185
+ - grafast@0.0.1-beta.7
186
+ - grafserv@0.0.1-beta.7
187
+
188
+ ## 0.0.0-beta.6
189
+
190
+ ### Patch Changes
191
+
192
+ - [#496](https://github.com/benjie/crystal/pull/496)
193
+ [`c9bfd9892`](https://github.com/benjie/crystal/commit/c9bfd989247f9433fb5b18c5175c9d8d64cd21a1)
194
+ Thanks [@benjie](https://github.com/benjie)! - Update dependencies (sometimes
195
+ through major versions).
196
+
197
+ - Updated dependencies
198
+ [[`c9bfd9892`](https://github.com/benjie/crystal/commit/c9bfd989247f9433fb5b18c5175c9d8d64cd21a1),
199
+ [`e613b476d`](https://github.com/benjie/crystal/commit/e613b476d6ee867d1f7509c895dabee40e7f9a31)]:
200
+ - graphile-config@0.0.1-beta.2
201
+ - grafserv@0.0.1-beta.6
202
+ - grafast@0.0.1-beta.6
203
+ - @graphile/lru@5.0.0-beta.2
204
+
205
+ ## 0.0.0-beta.5
206
+
207
+ ### Patch Changes
208
+
209
+ - Updated dependencies
210
+ [[`53186213a`](https://github.com/benjie/crystal/commit/53186213ade962f4b66cb0d5ea8b57b5ce7ea85f)]:
211
+ - grafast@0.0.1-beta.5
212
+ - grafserv@0.0.1-beta.5
213
+
214
+ ## 0.0.0-beta.4
215
+
216
+ ### Patch Changes
217
+
218
+ - Updated dependencies
219
+ [[`f9cc88dc4`](https://github.com/benjie/crystal/commit/f9cc88dc442d371aee154a28d4e63c6da39f6b2e),
220
+ [`22fa6230a`](https://github.com/benjie/crystal/commit/22fa6230aa7c7271e5360e619ec9e1f52c6ea49c),
221
+ [`fa8cfcf9b`](https://github.com/benjie/crystal/commit/fa8cfcf9b4ce0c3e12511f3f6392051924a719e5)]:
222
+ - grafast@0.0.1-beta.4
223
+ - grafserv@0.0.1-beta.4
224
+
225
+ ## 0.0.0-beta.3
226
+
227
+ ### Patch Changes
228
+
229
+ - Updated dependencies
230
+ [[`46cd08aa1`](https://github.com/benjie/crystal/commit/46cd08aa13e3bac4d186c72c6ce24997f37658af)]:
231
+ - grafast@0.0.1-beta.3
232
+ - grafserv@0.0.1-beta.3
233
+
3
234
  ## 0.0.0-beta.2
4
235
 
5
236
  ### 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,CAAC;gBACF,mBAAmB;gBACnB,IAAI,SAAS,IAAI,IAAI,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;oBACtD,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;wBAC1B,IAAI,OAAO,CAAC,KAAK,QAAQ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AE,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.20";
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.20";
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.20",
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.8",
50
+ "grafserv": "^0.1.1-beta.10",
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.8",
60
+ "grafserv": "^0.1.1-beta.10",
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",