sendproof-core 0.1.0.alpha.1

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 (229) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +55 -0
  4. data/lib/sendproof/assets.rb +70 -0
  5. data/lib/sendproof/attribution.rb +98 -0
  6. data/lib/sendproof/capture.rb +66 -0
  7. data/lib/sendproof/clock.rb +54 -0
  8. data/lib/sendproof/configuration.rb +241 -0
  9. data/lib/sendproof/data_store.rb +34 -0
  10. data/lib/sendproof/dynamodb/store.rb +183 -0
  11. data/lib/sendproof/dynamodb.rb +17 -0
  12. data/lib/sendproof/elasticsearch/store.rb +24 -0
  13. data/lib/sendproof/elasticsearch.rb +17 -0
  14. data/lib/sendproof/firestore/interceptor.rb +38 -0
  15. data/lib/sendproof/firestore/store.rb +150 -0
  16. data/lib/sendproof/firestore.rb +99 -0
  17. data/lib/sendproof/handler.rb +23 -0
  18. data/lib/sendproof/identity.rb +37 -0
  19. data/lib/sendproof/limits.rb +113 -0
  20. data/lib/sendproof/middleware.rb +68 -0
  21. data/lib/sendproof/mongo/engine.rb +692 -0
  22. data/lib/sendproof/mongo/guarded.rb +100 -0
  23. data/lib/sendproof/mongo/plain.rb +45 -0
  24. data/lib/sendproof/mongo/store.rb +54 -0
  25. data/lib/sendproof/mongo/subscriber.rb +21 -0
  26. data/lib/sendproof/mongo.rb +41 -0
  27. data/lib/sendproof/mongoid/store.rb +58 -0
  28. data/lib/sendproof/mongoid.rb +65 -0
  29. data/lib/sendproof/observed_request.rb +108 -0
  30. data/lib/sendproof/opensearch/store.rb +21 -0
  31. data/lib/sendproof/opensearch.rb +17 -0
  32. data/lib/sendproof/operation_matcher.rb +28 -0
  33. data/lib/sendproof/pool_hooks.rb +80 -0
  34. data/lib/sendproof/preview_request.rb +44 -0
  35. data/lib/sendproof/preview_transport.rb +331 -0
  36. data/lib/sendproof/protocol.rb +81 -0
  37. data/lib/sendproof/provider.rb +83 -0
  38. data/lib/sendproof/recorder.rb +298 -0
  39. data/lib/sendproof/redaction.rb +98 -0
  40. data/lib/sendproof/redis/commands.rb +76 -0
  41. data/lib/sendproof/redis/store.rb +205 -0
  42. data/lib/sendproof/redis.rb +18 -0
  43. data/lib/sendproof/search/middleware.rb +39 -0
  44. data/lib/sendproof/search/store.rb +213 -0
  45. data/lib/sendproof/search.rb +82 -0
  46. data/lib/sendproof/stores/classify.rb +346 -0
  47. data/lib/sendproof/stores/guard.rb +127 -0
  48. data/lib/sendproof/stores/tables.rb +1328 -0
  49. data/lib/sendproof/stores.rb +12 -0
  50. data/lib/sendproof/trace_store.rb +110 -0
  51. data/lib/sendproof/transaction_control.rb +187 -0
  52. data/lib/sendproof/ui/action-bar.js +91 -0
  53. data/lib/sendproof/ui/api.js +239 -0
  54. data/lib/sendproof/ui/app.css +848 -0
  55. data/lib/sendproof/ui/app.js +742 -0
  56. data/lib/sendproof/ui/autofill.js +137 -0
  57. data/lib/sendproof/ui/code-copy.js +71 -0
  58. data/lib/sendproof/ui/code-picker.js +149 -0
  59. data/lib/sendproof/ui/commands.js +197 -0
  60. data/lib/sendproof/ui/components.js +77 -0
  61. data/lib/sendproof/ui/context-bar.js +82 -0
  62. data/lib/sendproof/ui/copy.js +92 -0
  63. data/lib/sendproof/ui/coverage-popover.js +35 -0
  64. data/lib/sendproof/ui/crumb-fit.js +80 -0
  65. data/lib/sendproof/ui/deprecation.js +164 -0
  66. data/lib/sendproof/ui/display-settings.js +175 -0
  67. data/lib/sendproof/ui/doc-diff.js +209 -0
  68. data/lib/sendproof/ui/docs-view.js +347 -0
  69. data/lib/sendproof/ui/favicon.png +0 -0
  70. data/lib/sendproof/ui/favicon.svg +1 -0
  71. data/lib/sendproof/ui/field-help.js +52 -0
  72. data/lib/sendproof/ui/field-modules.js +23 -0
  73. data/lib/sendproof/ui/fields/controls.js +179 -0
  74. data/lib/sendproof/ui/fields/dom.js +36 -0
  75. data/lib/sendproof/ui/fields/infer.js +71 -0
  76. data/lib/sendproof/ui/fields/lookup-source.js +63 -0
  77. data/lib/sendproof/ui/fields/lookup.js +285 -0
  78. data/lib/sendproof/ui/fields/render.js +496 -0
  79. data/lib/sendproof/ui/fields/select.js +175 -0
  80. data/lib/sendproof/ui/fields/validate.js +363 -0
  81. data/lib/sendproof/ui/fields/validation-formats.js +164 -0
  82. data/lib/sendproof/ui/fields/validation-references.js +68 -0
  83. data/lib/sendproof/ui/fields/validation-values.js +137 -0
  84. data/lib/sendproof/ui/generate-menu.js +44 -0
  85. data/lib/sendproof/ui/generate.js +184 -0
  86. data/lib/sendproof/ui/header-editor.js +777 -0
  87. data/lib/sendproof/ui/headers.js +188 -0
  88. data/lib/sendproof/ui/highlight.js +257 -0
  89. data/lib/sendproof/ui/history-popover.js +24 -0
  90. data/lib/sendproof/ui/i18n.js +253 -0
  91. data/lib/sendproof/ui/icons.js +87 -0
  92. data/lib/sendproof/ui/index.html +70 -0
  93. data/lib/sendproof/ui/issues.js +187 -0
  94. data/lib/sendproof/ui/json-view.js +166 -0
  95. data/lib/sendproof/ui/lang-icons.js +62 -0
  96. data/lib/sendproof/ui/layout.js +262 -0
  97. data/lib/sendproof/ui/listbox.js +334 -0
  98. data/lib/sendproof/ui/locales/ar-capture.js +366 -0
  99. data/lib/sendproof/ui/locales/ar-stores.js +116 -0
  100. data/lib/sendproof/ui/locales/ar.js +561 -0
  101. data/lib/sendproof/ui/locales/cs-capture.js +442 -0
  102. data/lib/sendproof/ui/locales/cs-stores.js +116 -0
  103. data/lib/sendproof/ui/locales/cs.js +689 -0
  104. data/lib/sendproof/ui/locales/da-capture.js +347 -0
  105. data/lib/sendproof/ui/locales/da-stores.js +116 -0
  106. data/lib/sendproof/ui/locales/da.js +522 -0
  107. data/lib/sendproof/ui/locales/de-capture.js +347 -0
  108. data/lib/sendproof/ui/locales/de-stores.js +116 -0
  109. data/lib/sendproof/ui/locales/de.js +519 -0
  110. data/lib/sendproof/ui/locales/el-capture.js +347 -0
  111. data/lib/sendproof/ui/locales/el-stores.js +116 -0
  112. data/lib/sendproof/ui/locales/el.js +520 -0
  113. data/lib/sendproof/ui/locales/en-capture.js +349 -0
  114. data/lib/sendproof/ui/locales/en-stores.js +95 -0
  115. data/lib/sendproof/ui/locales/en.js +522 -0
  116. data/lib/sendproof/ui/locales/es-capture.js +353 -0
  117. data/lib/sendproof/ui/locales/es-stores.js +116 -0
  118. data/lib/sendproof/ui/locales/es.js +525 -0
  119. data/lib/sendproof/ui/locales/fa-capture.js +348 -0
  120. data/lib/sendproof/ui/locales/fa-stores.js +116 -0
  121. data/lib/sendproof/ui/locales/fa.js +521 -0
  122. data/lib/sendproof/ui/locales/fi-capture.js +347 -0
  123. data/lib/sendproof/ui/locales/fi-stores.js +116 -0
  124. data/lib/sendproof/ui/locales/fi.js +523 -0
  125. data/lib/sendproof/ui/locales/fr-capture.js +353 -0
  126. data/lib/sendproof/ui/locales/fr-stores.js +116 -0
  127. data/lib/sendproof/ui/locales/fr.js +525 -0
  128. data/lib/sendproof/ui/locales/he-capture.js +358 -0
  129. data/lib/sendproof/ui/locales/he-stores.js +116 -0
  130. data/lib/sendproof/ui/locales/he.js +529 -0
  131. data/lib/sendproof/ui/locales/hi-capture.js +348 -0
  132. data/lib/sendproof/ui/locales/hi-stores.js +116 -0
  133. data/lib/sendproof/ui/locales/hi.js +523 -0
  134. data/lib/sendproof/ui/locales/id-capture.js +347 -0
  135. data/lib/sendproof/ui/locales/id-stores.js +116 -0
  136. data/lib/sendproof/ui/locales/id.js +521 -0
  137. data/lib/sendproof/ui/locales/it-capture.js +361 -0
  138. data/lib/sendproof/ui/locales/it-stores.js +116 -0
  139. data/lib/sendproof/ui/locales/it.js +523 -0
  140. data/lib/sendproof/ui/locales/ja-capture.js +346 -0
  141. data/lib/sendproof/ui/locales/ja-stores.js +116 -0
  142. data/lib/sendproof/ui/locales/ja.js +521 -0
  143. data/lib/sendproof/ui/locales/ko-capture.js +346 -0
  144. data/lib/sendproof/ui/locales/ko-stores.js +116 -0
  145. data/lib/sendproof/ui/locales/ko.js +522 -0
  146. data/lib/sendproof/ui/locales/nb-capture.js +349 -0
  147. data/lib/sendproof/ui/locales/nb-stores.js +116 -0
  148. data/lib/sendproof/ui/locales/nb.js +521 -0
  149. data/lib/sendproof/ui/locales/nl-capture.js +355 -0
  150. data/lib/sendproof/ui/locales/nl-stores.js +116 -0
  151. data/lib/sendproof/ui/locales/nl.js +520 -0
  152. data/lib/sendproof/ui/locales/pl-capture.js +432 -0
  153. data/lib/sendproof/ui/locales/pl-stores.js +116 -0
  154. data/lib/sendproof/ui/locales/pl.js +528 -0
  155. data/lib/sendproof/ui/locales/pt-BR-capture.js +350 -0
  156. data/lib/sendproof/ui/locales/pt-BR-stores.js +116 -0
  157. data/lib/sendproof/ui/locales/pt-BR.js +523 -0
  158. data/lib/sendproof/ui/locales/pt-PT-capture.js +350 -0
  159. data/lib/sendproof/ui/locales/pt-PT-stores.js +116 -0
  160. data/lib/sendproof/ui/locales/pt-PT.js +523 -0
  161. data/lib/sendproof/ui/locales/ru-capture.js +437 -0
  162. data/lib/sendproof/ui/locales/ru-stores.js +116 -0
  163. data/lib/sendproof/ui/locales/ru.js +624 -0
  164. data/lib/sendproof/ui/locales/sv-capture.js +349 -0
  165. data/lib/sendproof/ui/locales/sv-stores.js +116 -0
  166. data/lib/sendproof/ui/locales/sv.js +518 -0
  167. data/lib/sendproof/ui/locales/th-capture.js +347 -0
  168. data/lib/sendproof/ui/locales/th-stores.js +116 -0
  169. data/lib/sendproof/ui/locales/th.js +521 -0
  170. data/lib/sendproof/ui/locales/tr-capture.js +348 -0
  171. data/lib/sendproof/ui/locales/tr-stores.js +116 -0
  172. data/lib/sendproof/ui/locales/tr.js +521 -0
  173. data/lib/sendproof/ui/locales/uk-capture.js +442 -0
  174. data/lib/sendproof/ui/locales/uk-stores.js +116 -0
  175. data/lib/sendproof/ui/locales/uk.js +630 -0
  176. data/lib/sendproof/ui/locales/vi-capture.js +346 -0
  177. data/lib/sendproof/ui/locales/vi-stores.js +116 -0
  178. data/lib/sendproof/ui/locales/vi.js +523 -0
  179. data/lib/sendproof/ui/locales/zh-Hans-capture.js +347 -0
  180. data/lib/sendproof/ui/locales/zh-Hans-stores.js +116 -0
  181. data/lib/sendproof/ui/locales/zh-Hans.js +523 -0
  182. data/lib/sendproof/ui/locales/zh-Hant-capture.js +346 -0
  183. data/lib/sendproof/ui/locales/zh-Hant-stores.js +116 -0
  184. data/lib/sendproof/ui/locales/zh-Hant.js +522 -0
  185. data/lib/sendproof/ui/manifest.json +866 -0
  186. data/lib/sendproof/ui/markdown.js +39 -0
  187. data/lib/sendproof/ui/model-view.js +182 -0
  188. data/lib/sendproof/ui/navigation.js +233 -0
  189. data/lib/sendproof/ui/operation-header.js +76 -0
  190. data/lib/sendproof/ui/operations.js +7 -0
  191. data/lib/sendproof/ui/overview-view.js +63 -0
  192. data/lib/sendproof/ui/personas.js +59 -0
  193. data/lib/sendproof/ui/popover.js +71 -0
  194. data/lib/sendproof/ui/preview-false.js +108 -0
  195. data/lib/sendproof/ui/request-editor.js +496 -0
  196. data/lib/sendproof/ui/response-metadata.js +354 -0
  197. data/lib/sendproof/ui/response-viewer.js +618 -0
  198. data/lib/sendproof/ui/result-blocked.js +155 -0
  199. data/lib/sendproof/ui/result-capture.js +25 -0
  200. data/lib/sendproof/ui/result-database.js +185 -0
  201. data/lib/sendproof/ui/result-effects.js +176 -0
  202. data/lib/sendproof/ui/result-headers.js +106 -0
  203. data/lib/sendproof/ui/result-logs.js +408 -0
  204. data/lib/sendproof/ui/result-states.js +213 -0
  205. data/lib/sendproof/ui/results.js +371 -0
  206. data/lib/sendproof/ui/router.js +118 -0
  207. data/lib/sendproof/ui/schema-model.js +336 -0
  208. data/lib/sendproof/ui/schema-tree.js +344 -0
  209. data/lib/sendproof/ui/schema.js +397 -0
  210. data/lib/sendproof/ui/security.js +31 -0
  211. data/lib/sendproof/ui/seeded-menu.js +69 -0
  212. data/lib/sendproof/ui/settings.js +93 -0
  213. data/lib/sendproof/ui/shortcuts-sheet.js +73 -0
  214. data/lib/sendproof/ui/shortcuts.js +190 -0
  215. data/lib/sendproof/ui/sidebar.js +289 -0
  216. data/lib/sendproof/ui/signin.js +259 -0
  217. data/lib/sendproof/ui/snippets.js +530 -0
  218. data/lib/sendproof/ui/store-marks.js +47 -0
  219. data/lib/sendproof/ui/stores.js +131 -0
  220. data/lib/sendproof/ui/styles.css +971 -0
  221. data/lib/sendproof/ui/toggletip.js +53 -0
  222. data/lib/sendproof/ui/uuid.js +10 -0
  223. data/lib/sendproof/ui/view.js +122 -0
  224. data/lib/sendproof/ui/views.css +653 -0
  225. data/lib/sendproof/version.rb +9 -0
  226. data/lib/sendproof/workbench.rb +102 -0
  227. data/lib/sendproof-core.rb +3 -0
  228. data/lib/sendproof.rb +121 -0
  229. metadata +292 -0
@@ -0,0 +1,1328 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Generated by scripts/embed_store_tables.rb from spec/data-stores/. Do not edit by hand.
4
+ # A unit test fails when this copy differs from the spec tables.
5
+
6
+ require "json"
7
+
8
+ module Sendproof
9
+ module Stores
10
+ # The shared classification tables, embedded unchanged from spec/data-stores/*.json.
11
+ module Tables
12
+ # The redis table (spec/data-stores/redis.json).
13
+ REDIS = JSON.parse(<<~'JSON').freeze
14
+ {
15
+ "$comment": "Write-guard classification for Redis, shared by every binding. Generated from COMMAND on Redis 7.4 (readonly flag without write), plus session commands (including CLIENT MAINT_NOTIFICATIONS, which Redis 8 clients such as go-redis 9.23 send on connect) and common module reads. Anything not listed is a write. See spec/data-stores.md.",
16
+ "store": "redis",
17
+ "version": 1,
18
+ "source": "redis 7.4 COMMAND flags",
19
+ "default": "write",
20
+ "keyFormat": "Upper-case command name; a container command and its subcommand are joined with a vertical bar, as in OBJECT|ENCODING.",
21
+ "read": [
22
+ "BITCOUNT",
23
+ "BITFIELD_RO",
24
+ "BITPOS",
25
+ "DBSIZE",
26
+ "DUMP",
27
+ "EVALSHA_RO",
28
+ "EVAL_RO",
29
+ "EXISTS",
30
+ "EXPIRETIME",
31
+ "FCALL_RO",
32
+ "GEODIST",
33
+ "GEOHASH",
34
+ "GEOPOS",
35
+ "GEORADIUSBYMEMBER_RO",
36
+ "GEORADIUS_RO",
37
+ "GEOSEARCH",
38
+ "GET",
39
+ "GETBIT",
40
+ "GETRANGE",
41
+ "HEXISTS",
42
+ "HEXPIRETIME",
43
+ "HGET",
44
+ "HGETALL",
45
+ "HKEYS",
46
+ "HLEN",
47
+ "HMGET",
48
+ "HPEXPIRETIME",
49
+ "HPTTL",
50
+ "HRANDFIELD",
51
+ "HSCAN",
52
+ "HSTRLEN",
53
+ "HTTL",
54
+ "HVALS",
55
+ "KEYS",
56
+ "LCS",
57
+ "LINDEX",
58
+ "LLEN",
59
+ "LOLWUT",
60
+ "LPOS",
61
+ "LRANGE",
62
+ "MEMORY|USAGE",
63
+ "MGET",
64
+ "OBJECT|ENCODING",
65
+ "OBJECT|FREQ",
66
+ "OBJECT|IDLETIME",
67
+ "OBJECT|REFCOUNT",
68
+ "PEXPIRETIME",
69
+ "PFCOUNT",
70
+ "PTTL",
71
+ "RANDOMKEY",
72
+ "SCAN",
73
+ "SCARD",
74
+ "SDIFF",
75
+ "SINTER",
76
+ "SINTERCARD",
77
+ "SISMEMBER",
78
+ "SMEMBERS",
79
+ "SMISMEMBER",
80
+ "SORT_RO",
81
+ "SRANDMEMBER",
82
+ "SSCAN",
83
+ "STRLEN",
84
+ "SUBSTR",
85
+ "SUNION",
86
+ "TOUCH",
87
+ "TTL",
88
+ "TYPE",
89
+ "XINFO|CONSUMERS",
90
+ "XINFO|GROUPS",
91
+ "XINFO|STREAM",
92
+ "XLEN",
93
+ "XPENDING",
94
+ "XRANGE",
95
+ "XREAD",
96
+ "XREVRANGE",
97
+ "ZCARD",
98
+ "ZCOUNT",
99
+ "ZDIFF",
100
+ "ZINTER",
101
+ "ZINTERCARD",
102
+ "ZLEXCOUNT",
103
+ "ZMSCORE",
104
+ "ZRANDMEMBER",
105
+ "ZRANGE",
106
+ "ZRANGEBYLEX",
107
+ "ZRANGEBYSCORE",
108
+ "ZRANK",
109
+ "ZREVRANGE",
110
+ "ZREVRANGEBYLEX",
111
+ "ZREVRANGEBYSCORE",
112
+ "ZREVRANK",
113
+ "ZSCAN",
114
+ "ZSCORE",
115
+ "ZUNION"
116
+ ],
117
+ "moduleRead": [
118
+ "BF.CARD",
119
+ "BF.EXISTS",
120
+ "BF.INFO",
121
+ "BF.MEXISTS",
122
+ "CF.COUNT",
123
+ "CF.EXISTS",
124
+ "CF.INFO",
125
+ "CF.MEXISTS",
126
+ "FT._LIST",
127
+ "FT.AGGREGATE",
128
+ "FT.EXPLAIN",
129
+ "FT.INFO",
130
+ "FT.SEARCH",
131
+ "FT.SPELLCHECK",
132
+ "FT.SUGGET",
133
+ "FT.SUGLEN",
134
+ "FT.TAGVALS",
135
+ "JSON.ARRINDEX",
136
+ "JSON.ARRLEN",
137
+ "JSON.GET",
138
+ "JSON.MGET",
139
+ "JSON.OBJKEYS",
140
+ "JSON.OBJLEN",
141
+ "JSON.RESP",
142
+ "JSON.STRLEN",
143
+ "JSON.TYPE",
144
+ "TS.GET",
145
+ "TS.INFO",
146
+ "TS.MGET",
147
+ "TS.MRANGE",
148
+ "TS.MREVRANGE",
149
+ "TS.QUERYINDEX",
150
+ "TS.RANGE",
151
+ "TS.REVRANGE"
152
+ ],
153
+ "session": [
154
+ "ASKING",
155
+ "AUTH",
156
+ "CLIENT|GETNAME",
157
+ "CLIENT|ID",
158
+ "CLIENT|INFO",
159
+ "CLIENT|MAINT_NOTIFICATIONS",
160
+ "CLIENT|SETINFO",
161
+ "CLIENT|SETNAME",
162
+ "COMMAND",
163
+ "COMMAND|COUNT",
164
+ "COMMAND|DOCS",
165
+ "COMMAND|INFO",
166
+ "COMMAND|LIST",
167
+ "ECHO",
168
+ "HELLO",
169
+ "INFO",
170
+ "LASTSAVE",
171
+ "PING",
172
+ "QUIT",
173
+ "READONLY",
174
+ "READWRITE",
175
+ "RESET",
176
+ "ROLE",
177
+ "SELECT",
178
+ "TIME",
179
+ "WAIT",
180
+ "WAITAOF"
181
+ ],
182
+ "transaction": [
183
+ "MULTI",
184
+ "EXEC",
185
+ "DISCARD",
186
+ "WATCH",
187
+ "UNWATCH"
188
+ ],
189
+ "notes": {
190
+ "EVAL, EVALSHA, FCALL": "Writes: a script can write. EVAL_RO, EVALSHA_RO and FCALL_RO are reads because the server refuses writes inside them.",
191
+ "GETEX, GETDEL": "Writes: GETEX can change a TTL and GETDEL deletes the key.",
192
+ "SORT, GEORADIUS, GEORADIUSBYMEMBER": "Writes: each accepts STORE. Their _RO variants are reads.",
193
+ "XREADGROUP": "Write: it moves entries into a consumer group pending list. XREAD is a read.",
194
+ "PUBLISH, SPUBLISH, SUBSCRIBE": "Writes: delivery to subscribers cannot be undone.",
195
+ "SCRIPT LOAD, FUNCTION LOAD": "Writes: they change server state.",
196
+ "MULTI": "MULTI, EXEC and DISCARD are allowed, but each queued command is classified on its own. A queued write blocks the Preview before EXEC is sent; the binding then sends DISCARD or closes the connection, so nothing queued runs."
197
+ }
198
+ }
199
+ JSON
200
+
201
+ # The mongodb table (spec/data-stores/mongodb.json).
202
+ MONGODB = JSON.parse(<<~'JSON').freeze
203
+ {
204
+ "$comment": "Write-guard and Preview classification for MongoDB, shared by every binding. Command names are the first key of the command document, compared case-insensitively. Anything not listed is a write. See spec/data-stores.md.",
205
+ "store": "mongodb",
206
+ "version": 1,
207
+ "source": "MongoDB 8.2 database commands; transaction limits checked against mongo:8.2 in tests/conformance/compose.yml",
208
+ "default": "write",
209
+ "read": [
210
+ "aggregate",
211
+ "collStats",
212
+ "count",
213
+ "dataSize",
214
+ "dbStats",
215
+ "distinct",
216
+ "explain",
217
+ "find",
218
+ "getMore",
219
+ "killCursors",
220
+ "listCollections",
221
+ "listDatabases",
222
+ "listIndexes"
223
+ ],
224
+ "session": [
225
+ "abortTransaction",
226
+ "authenticate",
227
+ "buildInfo",
228
+ "connectionStatus",
229
+ "endSessions",
230
+ "getParameter",
231
+ "hello",
232
+ "isMaster",
233
+ "ismaster",
234
+ "logout",
235
+ "ping",
236
+ "saslContinue",
237
+ "saslStart",
238
+ "serverStatus",
239
+ "startSession"
240
+ ],
241
+ "conditional": {
242
+ "aggregate": "A write when any stage, at any depth of the pipeline, is $out or $merge.",
243
+ "explain": "Classified as the command inside its explain field.",
244
+ "findAndModify": "Always a write, including findOneAndUpdate, findOneAndReplace and findOneAndDelete with no match.",
245
+ "abortTransaction": "Allowed for a transaction the handler started itself. In Preview the binding owns the transaction and refuses a handler's abortTransaction or commitTransaction for it."
246
+ },
247
+ "notInTransaction": {
248
+ "$comment": "Refused by the server inside a multi-document transaction. In Preview mode a binding blocks these before sending, with the reason below.",
249
+ "commands": [
250
+ "count",
251
+ "create",
252
+ "listCollections",
253
+ "listIndexes",
254
+ "drop",
255
+ "dropDatabase",
256
+ "dropIndexes",
257
+ "renameCollection",
258
+ "collMod",
259
+ "convertToCapped",
260
+ "cloneCollectionAsCapped",
261
+ "mapReduce",
262
+ "createUser",
263
+ "dropUser",
264
+ "createRole"
265
+ ],
266
+ "stages": [
267
+ "$out",
268
+ "$merge",
269
+ "$collStats",
270
+ "$currentOp",
271
+ "$indexStats",
272
+ "$listSessions",
273
+ "$planCacheStats"
274
+ ],
275
+ "rules": [
276
+ "createIndexes on a collection that existed before the transaction",
277
+ "any write to a capped collection",
278
+ "any operation on the admin, config or local database, or on a system.* collection"
279
+ ],
280
+ "reason": "Preview unavailable: MongoDB can't run {operation} inside a transaction"
281
+ }
282
+ }
283
+ JSON
284
+
285
+ # The dynamodb table (spec/data-stores/dynamodb.json).
286
+ DYNAMODB = JSON.parse(<<~'JSON').freeze
287
+ {
288
+ "$comment": "Write-guard classification for DynamoDB, shared by every binding. Operation names are the API action names (the X-Amz-Target suffix). Anything not listed is a write. See spec/data-stores.md.",
289
+ "store": "dynamodb",
290
+ "version": 1,
291
+ "source": "Amazon DynamoDB API reference, DynamoDB_20120810",
292
+ "default": "write",
293
+ "read": [
294
+ "BatchGetItem",
295
+ "DescribeContinuousBackups",
296
+ "DescribeContributorInsights",
297
+ "DescribeEndpoints",
298
+ "DescribeGlobalTable",
299
+ "DescribeGlobalTableSettings",
300
+ "DescribeKinesisStreamingDestination",
301
+ "DescribeLimits",
302
+ "DescribeTable",
303
+ "DescribeTableReplicaAutoScaling",
304
+ "DescribeTimeToLive",
305
+ "GetItem",
306
+ "GetResourcePolicy",
307
+ "ListBackups",
308
+ "ListContributorInsights",
309
+ "ListExports",
310
+ "ListGlobalTables",
311
+ "ListImports",
312
+ "ListTables",
313
+ "ListTagsOfResource",
314
+ "Query",
315
+ "Scan",
316
+ "TransactGetItems"
317
+ ],
318
+ "partiql": {
319
+ "operations": [
320
+ "ExecuteStatement",
321
+ "BatchExecuteStatement",
322
+ "ExecuteTransaction"
323
+ ],
324
+ "rule": "A read only when every statement in the request is a SELECT: after skipping whitespace, -- line comments and /* */ block comments, the first word, compared case-insensitively, is SELECT. Any other statement (INSERT, UPDATE, DELETE, EXISTS checks inside a write transaction, or text that can't be parsed) makes the whole request a write."
325
+ },
326
+ "notes": {
327
+ "UpdateItem": "Always a write, whatever its ReturnValues or condition.",
328
+ "PutItem, DeleteItem": "Always writes, including conditional writes whose condition fails.",
329
+ "TransactWriteItems, BatchWriteItem": "Always writes; a ConditionCheck-only transaction is still classified as a write."
330
+ }
331
+ }
332
+ JSON
333
+
334
+ # The elasticsearch table (spec/data-stores/elasticsearch.json).
335
+ ELASTICSEARCH = JSON.parse(<<~'JSON').freeze
336
+ {
337
+ "$comment": "Write-guard classification for Elasticsearch and OpenSearch, shared by every binding. Sourced from the Elasticsearch 8 REST API reference and its machine-readable specification (elastic/elasticsearch-specification, whose endpoint ids are the operation names here) and the OpenSearch 2.x REST API reference (opensearch.org/docs/latest/api-reference/, including the SQL, PPL, point-in-time and asynchronous-search plugins). The unit is the HTTP method and path the client's transport sends. Anything not listed is a write, except GET and HEAD, which only read. See spec/data-stores.md.",
338
+ "store": "elasticsearch",
339
+ "stores": [
340
+ "elasticsearch",
341
+ "opensearch"
342
+ ],
343
+ "version": 1,
344
+ "source": "Elasticsearch 8 REST API specification; OpenSearch 2.19 REST API reference",
345
+ "default": "write",
346
+ "methodDefault": {
347
+ "GET": "read",
348
+ "HEAD": "read"
349
+ },
350
+ "keyFormat": "Match the upper-case HTTP method and the path without its query string, after removing any path prefix the client is configured with, collapsing repeated slashes and dropping a trailing slash. Compare each segment after percent-decoding it.",
351
+ "segments": {
352
+ "{index}": "One segment naming indices, aliases or data streams: it doesn't start with an underscore, and it may hold commas and wildcards (logs-*,metrics).",
353
+ "{id}": "Any one non-empty segment.",
354
+ "literal": "Any other segment must be equal, case-sensitively."
355
+ },
356
+ "matching": "Entries are tried in order and the first entry whose methods and one of whose paths match decides. When none matches, methodDefault decides, and otherwise default. db.operation.name is the entry's name. Without an entry, the name is the method and the path with every segment that doesn't start with an underscore replaced by {}, as in \"PUT /{}\".",
357
+ "endpoints": [
358
+ {
359
+ "kind": "read",
360
+ "name": "search",
361
+ "methods": [
362
+ "GET",
363
+ "POST"
364
+ ],
365
+ "paths": [
366
+ "/_search",
367
+ "/{index}/_search"
368
+ ]
369
+ },
370
+ {
371
+ "kind": "read",
372
+ "name": "search_template",
373
+ "methods": [
374
+ "GET",
375
+ "POST"
376
+ ],
377
+ "paths": [
378
+ "/_search/template",
379
+ "/{index}/_search/template"
380
+ ]
381
+ },
382
+ {
383
+ "kind": "read",
384
+ "name": "msearch",
385
+ "methods": [
386
+ "GET",
387
+ "POST"
388
+ ],
389
+ "paths": [
390
+ "/_msearch",
391
+ "/{index}/_msearch"
392
+ ]
393
+ },
394
+ {
395
+ "kind": "read",
396
+ "name": "msearch_template",
397
+ "methods": [
398
+ "GET",
399
+ "POST"
400
+ ],
401
+ "paths": [
402
+ "/_msearch/template",
403
+ "/{index}/_msearch/template"
404
+ ]
405
+ },
406
+ {
407
+ "kind": "read",
408
+ "name": "render_search_template",
409
+ "methods": [
410
+ "GET",
411
+ "POST"
412
+ ],
413
+ "paths": [
414
+ "/_render/template",
415
+ "/_render/template/{id}"
416
+ ]
417
+ },
418
+ {
419
+ "kind": "read",
420
+ "name": "scroll",
421
+ "methods": [
422
+ "GET",
423
+ "POST"
424
+ ],
425
+ "paths": [
426
+ "/_search/scroll",
427
+ "/_search/scroll/{id}"
428
+ ]
429
+ },
430
+ {
431
+ "kind": "session",
432
+ "name": "clear_scroll",
433
+ "methods": [
434
+ "DELETE"
435
+ ],
436
+ "paths": [
437
+ "/_search/scroll",
438
+ "/_search/scroll/{id}"
439
+ ]
440
+ },
441
+ {
442
+ "kind": "read",
443
+ "name": "count",
444
+ "methods": [
445
+ "GET",
446
+ "POST"
447
+ ],
448
+ "paths": [
449
+ "/_count",
450
+ "/{index}/_count"
451
+ ]
452
+ },
453
+ {
454
+ "kind": "read",
455
+ "name": "mget",
456
+ "methods": [
457
+ "GET",
458
+ "POST"
459
+ ],
460
+ "paths": [
461
+ "/_mget",
462
+ "/{index}/_mget"
463
+ ]
464
+ },
465
+ {
466
+ "kind": "read",
467
+ "name": "field_caps",
468
+ "methods": [
469
+ "GET",
470
+ "POST"
471
+ ],
472
+ "paths": [
473
+ "/_field_caps",
474
+ "/{index}/_field_caps"
475
+ ]
476
+ },
477
+ {
478
+ "kind": "read",
479
+ "name": "explain",
480
+ "methods": [
481
+ "GET",
482
+ "POST"
483
+ ],
484
+ "paths": [
485
+ "/{index}/_explain/{id}"
486
+ ]
487
+ },
488
+ {
489
+ "kind": "read",
490
+ "name": "indices.validate_query",
491
+ "methods": [
492
+ "GET",
493
+ "POST"
494
+ ],
495
+ "paths": [
496
+ "/_validate/query",
497
+ "/{index}/_validate/query"
498
+ ]
499
+ },
500
+ {
501
+ "kind": "read",
502
+ "name": "indices.analyze",
503
+ "methods": [
504
+ "GET",
505
+ "POST"
506
+ ],
507
+ "paths": [
508
+ "/_analyze",
509
+ "/{index}/_analyze"
510
+ ]
511
+ },
512
+ {
513
+ "kind": "read",
514
+ "name": "termvectors",
515
+ "methods": [
516
+ "GET",
517
+ "POST"
518
+ ],
519
+ "paths": [
520
+ "/{index}/_termvectors",
521
+ "/{index}/_termvectors/{id}"
522
+ ]
523
+ },
524
+ {
525
+ "kind": "read",
526
+ "name": "mtermvectors",
527
+ "methods": [
528
+ "GET",
529
+ "POST"
530
+ ],
531
+ "paths": [
532
+ "/_mtermvectors",
533
+ "/{index}/_mtermvectors"
534
+ ]
535
+ },
536
+ {
537
+ "kind": "read",
538
+ "name": "rank_eval",
539
+ "methods": [
540
+ "GET",
541
+ "POST"
542
+ ],
543
+ "paths": [
544
+ "/_rank_eval",
545
+ "/{index}/_rank_eval"
546
+ ]
547
+ },
548
+ {
549
+ "kind": "read",
550
+ "name": "knn_search",
551
+ "methods": [
552
+ "GET",
553
+ "POST"
554
+ ],
555
+ "paths": [
556
+ "/{index}/_knn_search"
557
+ ]
558
+ },
559
+ {
560
+ "kind": "read",
561
+ "name": "terms_enum",
562
+ "methods": [
563
+ "GET",
564
+ "POST"
565
+ ],
566
+ "paths": [
567
+ "/{index}/_terms_enum"
568
+ ]
569
+ },
570
+ {
571
+ "kind": "read",
572
+ "name": "search_shards",
573
+ "methods": [
574
+ "GET",
575
+ "POST"
576
+ ],
577
+ "paths": [
578
+ "/_search_shards",
579
+ "/{index}/_search_shards"
580
+ ]
581
+ },
582
+ {
583
+ "kind": "session",
584
+ "name": "open_point_in_time",
585
+ "methods": [
586
+ "POST"
587
+ ],
588
+ "paths": [
589
+ "/{index}/_pit"
590
+ ]
591
+ },
592
+ {
593
+ "kind": "session",
594
+ "name": "close_point_in_time",
595
+ "methods": [
596
+ "DELETE"
597
+ ],
598
+ "paths": [
599
+ "/_pit"
600
+ ]
601
+ },
602
+ {
603
+ "kind": "session",
604
+ "name": "create_pit",
605
+ "methods": [
606
+ "POST"
607
+ ],
608
+ "paths": [
609
+ "/{index}/_search/point_in_time"
610
+ ]
611
+ },
612
+ {
613
+ "kind": "session",
614
+ "name": "delete_pit",
615
+ "methods": [
616
+ "DELETE"
617
+ ],
618
+ "paths": [
619
+ "/_search/point_in_time",
620
+ "/_search/point_in_time/_all"
621
+ ]
622
+ },
623
+ {
624
+ "kind": "read",
625
+ "name": "async_search.submit",
626
+ "methods": [
627
+ "POST"
628
+ ],
629
+ "paths": [
630
+ "/_async_search",
631
+ "/{index}/_async_search"
632
+ ]
633
+ },
634
+ {
635
+ "kind": "session",
636
+ "name": "async_search.delete",
637
+ "methods": [
638
+ "DELETE"
639
+ ],
640
+ "paths": [
641
+ "/_async_search/{id}"
642
+ ]
643
+ },
644
+ {
645
+ "kind": "read",
646
+ "name": "asynchronous_search.search",
647
+ "methods": [
648
+ "POST"
649
+ ],
650
+ "paths": [
651
+ "/_plugins/_asynchronous_search"
652
+ ]
653
+ },
654
+ {
655
+ "kind": "session",
656
+ "name": "asynchronous_search.delete",
657
+ "methods": [
658
+ "DELETE"
659
+ ],
660
+ "paths": [
661
+ "/_plugins/_asynchronous_search/{id}"
662
+ ]
663
+ },
664
+ {
665
+ "kind": "read",
666
+ "name": "eql.search",
667
+ "methods": [
668
+ "GET",
669
+ "POST"
670
+ ],
671
+ "paths": [
672
+ "/{index}/_eql/search"
673
+ ]
674
+ },
675
+ {
676
+ "kind": "session",
677
+ "name": "eql.delete",
678
+ "methods": [
679
+ "DELETE"
680
+ ],
681
+ "paths": [
682
+ "/_eql/search/{id}"
683
+ ]
684
+ },
685
+ {
686
+ "kind": "read",
687
+ "name": "esql.query",
688
+ "methods": [
689
+ "POST"
690
+ ],
691
+ "paths": [
692
+ "/_query"
693
+ ]
694
+ },
695
+ {
696
+ "kind": "read",
697
+ "name": "esql.async_query",
698
+ "methods": [
699
+ "POST"
700
+ ],
701
+ "paths": [
702
+ "/_query/async"
703
+ ]
704
+ },
705
+ {
706
+ "kind": "session",
707
+ "name": "esql.async_query_delete",
708
+ "methods": [
709
+ "DELETE"
710
+ ],
711
+ "paths": [
712
+ "/_query/async/{id}"
713
+ ]
714
+ },
715
+ {
716
+ "kind": "sql",
717
+ "name": "sql.query",
718
+ "methods": [
719
+ "GET",
720
+ "POST"
721
+ ],
722
+ "paths": [
723
+ "/_sql"
724
+ ]
725
+ },
726
+ {
727
+ "kind": "read",
728
+ "name": "sql.translate",
729
+ "methods": [
730
+ "GET",
731
+ "POST"
732
+ ],
733
+ "paths": [
734
+ "/_sql/translate"
735
+ ]
736
+ },
737
+ {
738
+ "kind": "session",
739
+ "name": "sql.clear_cursor",
740
+ "methods": [
741
+ "POST"
742
+ ],
743
+ "paths": [
744
+ "/_sql/close"
745
+ ]
746
+ },
747
+ {
748
+ "kind": "session",
749
+ "name": "sql.delete_async",
750
+ "methods": [
751
+ "DELETE"
752
+ ],
753
+ "paths": [
754
+ "/_sql/async/delete/{id}"
755
+ ]
756
+ },
757
+ {
758
+ "kind": "sql",
759
+ "name": "sql.query",
760
+ "methods": [
761
+ "GET",
762
+ "POST"
763
+ ],
764
+ "paths": [
765
+ "/_plugins/_sql",
766
+ "/_opendistro/_sql"
767
+ ]
768
+ },
769
+ {
770
+ "kind": "read",
771
+ "name": "sql.explain",
772
+ "methods": [
773
+ "GET",
774
+ "POST"
775
+ ],
776
+ "paths": [
777
+ "/_plugins/_sql/_explain",
778
+ "/_opendistro/_sql/_explain"
779
+ ]
780
+ },
781
+ {
782
+ "kind": "session",
783
+ "name": "sql.close",
784
+ "methods": [
785
+ "POST"
786
+ ],
787
+ "paths": [
788
+ "/_plugins/_sql/close",
789
+ "/_opendistro/_sql/close"
790
+ ]
791
+ },
792
+ {
793
+ "kind": "read",
794
+ "name": "ppl.query",
795
+ "methods": [
796
+ "GET",
797
+ "POST"
798
+ ],
799
+ "paths": [
800
+ "/_plugins/_ppl",
801
+ "/_opendistro/_ppl"
802
+ ]
803
+ },
804
+ {
805
+ "kind": "read",
806
+ "name": "ppl.explain",
807
+ "methods": [
808
+ "GET",
809
+ "POST"
810
+ ],
811
+ "paths": [
812
+ "/_plugins/_ppl/_explain",
813
+ "/_opendistro/_ppl/_explain"
814
+ ]
815
+ },
816
+ {
817
+ "kind": "read",
818
+ "name": "scripts_painless_execute",
819
+ "methods": [
820
+ "GET",
821
+ "POST"
822
+ ],
823
+ "paths": [
824
+ "/_scripts/painless/_execute"
825
+ ]
826
+ },
827
+ {
828
+ "kind": "read",
829
+ "name": "ingest.simulate",
830
+ "methods": [
831
+ "GET",
832
+ "POST"
833
+ ],
834
+ "paths": [
835
+ "/_ingest/pipeline/_simulate",
836
+ "/_ingest/pipeline/{id}/_simulate",
837
+ "/_ingest/_simulate",
838
+ "/_ingest/{index}/_simulate"
839
+ ]
840
+ },
841
+ {
842
+ "kind": "read",
843
+ "name": "indices.simulate_template",
844
+ "methods": [
845
+ "POST"
846
+ ],
847
+ "paths": [
848
+ "/_index_template/_simulate",
849
+ "/_index_template/_simulate/{id}"
850
+ ]
851
+ },
852
+ {
853
+ "kind": "read",
854
+ "name": "indices.simulate_index_template",
855
+ "methods": [
856
+ "POST"
857
+ ],
858
+ "paths": [
859
+ "/_index_template/_simulate_index/{id}"
860
+ ]
861
+ },
862
+ {
863
+ "kind": "read",
864
+ "name": "get",
865
+ "methods": [
866
+ "GET"
867
+ ],
868
+ "paths": [
869
+ "/{index}/_doc/{id}"
870
+ ]
871
+ },
872
+ {
873
+ "kind": "read",
874
+ "name": "exists",
875
+ "methods": [
876
+ "HEAD"
877
+ ],
878
+ "paths": [
879
+ "/{index}/_doc/{id}"
880
+ ]
881
+ },
882
+ {
883
+ "kind": "read",
884
+ "name": "get_source",
885
+ "methods": [
886
+ "GET"
887
+ ],
888
+ "paths": [
889
+ "/{index}/_source/{id}"
890
+ ]
891
+ },
892
+ {
893
+ "kind": "read",
894
+ "name": "exists_source",
895
+ "methods": [
896
+ "HEAD"
897
+ ],
898
+ "paths": [
899
+ "/{index}/_source/{id}"
900
+ ]
901
+ },
902
+ {
903
+ "kind": "write",
904
+ "name": "bulk",
905
+ "methods": [
906
+ "POST",
907
+ "PUT"
908
+ ],
909
+ "paths": [
910
+ "/_bulk",
911
+ "/{index}/_bulk"
912
+ ]
913
+ },
914
+ {
915
+ "kind": "write",
916
+ "name": "index",
917
+ "methods": [
918
+ "POST",
919
+ "PUT"
920
+ ],
921
+ "paths": [
922
+ "/{index}/_doc",
923
+ "/{index}/_doc/{id}"
924
+ ]
925
+ },
926
+ {
927
+ "kind": "write",
928
+ "name": "create",
929
+ "methods": [
930
+ "POST",
931
+ "PUT"
932
+ ],
933
+ "paths": [
934
+ "/{index}/_create/{id}"
935
+ ]
936
+ },
937
+ {
938
+ "kind": "write",
939
+ "name": "update",
940
+ "methods": [
941
+ "POST"
942
+ ],
943
+ "paths": [
944
+ "/{index}/_update/{id}"
945
+ ]
946
+ },
947
+ {
948
+ "kind": "write",
949
+ "name": "delete",
950
+ "methods": [
951
+ "DELETE"
952
+ ],
953
+ "paths": [
954
+ "/{index}/_doc/{id}"
955
+ ]
956
+ },
957
+ {
958
+ "kind": "write",
959
+ "name": "update_by_query",
960
+ "methods": [
961
+ "POST"
962
+ ],
963
+ "paths": [
964
+ "/{index}/_update_by_query"
965
+ ]
966
+ },
967
+ {
968
+ "kind": "write",
969
+ "name": "delete_by_query",
970
+ "methods": [
971
+ "POST"
972
+ ],
973
+ "paths": [
974
+ "/{index}/_delete_by_query"
975
+ ]
976
+ },
977
+ {
978
+ "kind": "write",
979
+ "name": "reindex",
980
+ "methods": [
981
+ "POST"
982
+ ],
983
+ "paths": [
984
+ "/_reindex"
985
+ ]
986
+ },
987
+ {
988
+ "kind": "write",
989
+ "name": "put_script",
990
+ "methods": [
991
+ "POST",
992
+ "PUT"
993
+ ],
994
+ "paths": [
995
+ "/_scripts/{id}",
996
+ "/_scripts/{id}/{id}"
997
+ ]
998
+ },
999
+ {
1000
+ "kind": "write",
1001
+ "name": "delete_script",
1002
+ "methods": [
1003
+ "DELETE"
1004
+ ],
1005
+ "paths": [
1006
+ "/_scripts/{id}"
1007
+ ]
1008
+ },
1009
+ {
1010
+ "kind": "write",
1011
+ "name": "indices.create",
1012
+ "methods": [
1013
+ "PUT"
1014
+ ],
1015
+ "paths": [
1016
+ "/{index}"
1017
+ ]
1018
+ },
1019
+ {
1020
+ "kind": "write",
1021
+ "name": "indices.delete",
1022
+ "methods": [
1023
+ "DELETE"
1024
+ ],
1025
+ "paths": [
1026
+ "/{index}"
1027
+ ]
1028
+ },
1029
+ {
1030
+ "kind": "write",
1031
+ "name": "indices.put_mapping",
1032
+ "methods": [
1033
+ "POST",
1034
+ "PUT"
1035
+ ],
1036
+ "paths": [
1037
+ "/{index}/_mapping"
1038
+ ]
1039
+ },
1040
+ {
1041
+ "kind": "write",
1042
+ "name": "indices.put_settings",
1043
+ "methods": [
1044
+ "PUT"
1045
+ ],
1046
+ "paths": [
1047
+ "/_settings",
1048
+ "/{index}/_settings"
1049
+ ]
1050
+ },
1051
+ {
1052
+ "kind": "write",
1053
+ "name": "indices.put_alias",
1054
+ "methods": [
1055
+ "POST",
1056
+ "PUT"
1057
+ ],
1058
+ "paths": [
1059
+ "/{index}/_alias/{id}",
1060
+ "/{index}/_aliases/{id}"
1061
+ ]
1062
+ },
1063
+ {
1064
+ "kind": "write",
1065
+ "name": "indices.delete_alias",
1066
+ "methods": [
1067
+ "DELETE"
1068
+ ],
1069
+ "paths": [
1070
+ "/{index}/_alias/{id}",
1071
+ "/{index}/_aliases/{id}"
1072
+ ]
1073
+ },
1074
+ {
1075
+ "kind": "write",
1076
+ "name": "indices.update_aliases",
1077
+ "methods": [
1078
+ "POST"
1079
+ ],
1080
+ "paths": [
1081
+ "/_aliases"
1082
+ ]
1083
+ },
1084
+ {
1085
+ "kind": "write",
1086
+ "name": "indices.put_index_template",
1087
+ "methods": [
1088
+ "POST",
1089
+ "PUT"
1090
+ ],
1091
+ "paths": [
1092
+ "/_index_template/{id}"
1093
+ ]
1094
+ },
1095
+ {
1096
+ "kind": "write",
1097
+ "name": "indices.delete_index_template",
1098
+ "methods": [
1099
+ "DELETE"
1100
+ ],
1101
+ "paths": [
1102
+ "/_index_template/{id}"
1103
+ ]
1104
+ },
1105
+ {
1106
+ "kind": "write",
1107
+ "name": "indices.put_template",
1108
+ "methods": [
1109
+ "POST",
1110
+ "PUT"
1111
+ ],
1112
+ "paths": [
1113
+ "/_template/{id}"
1114
+ ]
1115
+ },
1116
+ {
1117
+ "kind": "write",
1118
+ "name": "indices.delete_template",
1119
+ "methods": [
1120
+ "DELETE"
1121
+ ],
1122
+ "paths": [
1123
+ "/_template/{id}"
1124
+ ]
1125
+ },
1126
+ {
1127
+ "kind": "write",
1128
+ "name": "cluster.put_component_template",
1129
+ "methods": [
1130
+ "POST",
1131
+ "PUT"
1132
+ ],
1133
+ "paths": [
1134
+ "/_component_template/{id}"
1135
+ ]
1136
+ },
1137
+ {
1138
+ "kind": "write",
1139
+ "name": "cluster.delete_component_template",
1140
+ "methods": [
1141
+ "DELETE"
1142
+ ],
1143
+ "paths": [
1144
+ "/_component_template/{id}"
1145
+ ]
1146
+ },
1147
+ {
1148
+ "kind": "write",
1149
+ "name": "indices.open",
1150
+ "methods": [
1151
+ "POST"
1152
+ ],
1153
+ "paths": [
1154
+ "/{index}/_open"
1155
+ ]
1156
+ },
1157
+ {
1158
+ "kind": "write",
1159
+ "name": "indices.close",
1160
+ "methods": [
1161
+ "POST"
1162
+ ],
1163
+ "paths": [
1164
+ "/{index}/_close"
1165
+ ]
1166
+ },
1167
+ {
1168
+ "kind": "write",
1169
+ "name": "indices.rollover",
1170
+ "methods": [
1171
+ "POST"
1172
+ ],
1173
+ "paths": [
1174
+ "/{index}/_rollover",
1175
+ "/{index}/_rollover/{id}"
1176
+ ]
1177
+ },
1178
+ {
1179
+ "kind": "write",
1180
+ "name": "ingest.put_pipeline",
1181
+ "methods": [
1182
+ "PUT"
1183
+ ],
1184
+ "paths": [
1185
+ "/_ingest/pipeline/{id}"
1186
+ ]
1187
+ },
1188
+ {
1189
+ "kind": "write",
1190
+ "name": "ingest.delete_pipeline",
1191
+ "methods": [
1192
+ "DELETE"
1193
+ ],
1194
+ "paths": [
1195
+ "/_ingest/pipeline/{id}"
1196
+ ]
1197
+ }
1198
+ ],
1199
+ "sql": {
1200
+ "rule": "A sql endpoint is a read only when the JSON body's query field holds one statement whose first word, after whitespace and -- and /* */ comments, is SELECT, SHOW, DESCRIBE or DESC (case-insensitive), with nothing but whitespace, comments and one optional semicolon after it outside quotes; or when the body has a cursor and no query (the next page of an earlier read). Anything else, including a query passed only in the URL, is a write. OpenSearch's legacy SQL engine can run DELETE statements, which is why this is not a plain read.",
1201
+ "readWords": [
1202
+ "SELECT",
1203
+ "SHOW",
1204
+ "DESCRIBE",
1205
+ "DESC"
1206
+ ]
1207
+ },
1208
+ "rules": [
1209
+ "GET and HEAD are reads on every path, because neither engine changes data on them.",
1210
+ "POST is not a write by itself: _search, _msearch, _count, _mget, _field_caps and the other read entries take their query in a POST body.",
1211
+ "_bulk is always a write, even when every action in it would fail. So are _update_by_query, _delete_by_query and _reindex, including requests whose query matches nothing, and every PUT.",
1212
+ "Search requests that carry scripts (script_fields, script queries, runtime_mappings) are still reads: search scripts can't write. Storing a script (PUT or POST _scripts/{id}) is a write.",
1213
+ "Point-in-time, scroll, async-search and SQL cursor handles are session state, not data: opening and closing them is allowed."
1214
+ ],
1215
+ "notes": {
1216
+ "Preview": "Neither engine has a rollback, so both run in guard mode only.",
1217
+ "Index, alias and template management": "Creating, deleting, opening, closing, rolling over and remapping indices, aliases, index templates, component templates, ingest pipelines and cluster settings are writes."
1218
+ }
1219
+ }
1220
+ JSON
1221
+
1222
+ # The firestore table (spec/data-stores/firestore.json).
1223
+ FIRESTORE = JSON.parse(<<~'JSON').freeze
1224
+ {
1225
+ "$comment": "Write-guard classification for Google Cloud Firestore (native mode), shared by every binding. Sourced from the Firestore RPC reference for google.firestore.v1.Firestore and google.firestore.admin.v1.FirestoreAdmin (cloud.google.com/firestore/docs/reference/rpc, firestore.proto and its google.api.http REST bindings). The unit is the RPC method name; a hook on the REST transport derives it with the rules under fromRest. Anything not listed is a write. See spec/data-stores.md.",
1226
+ "store": "firestore",
1227
+ "version": 1,
1228
+ "source": "google.firestore.v1 and google.firestore.admin.v1 RPC reference",
1229
+ "default": "write",
1230
+ "keyFormat": "The RPC method name, case-sensitive, from the gRPC path /google.firestore.v1.Firestore/<Method>. A method of any other service is a write unless listed under services.",
1231
+ "services": {
1232
+ "google.firestore.v1.Firestore": {
1233
+ "read": [
1234
+ "GetDocument",
1235
+ "ListDocuments",
1236
+ "BatchGetDocuments",
1237
+ "RunQuery",
1238
+ "RunAggregationQuery",
1239
+ "PartitionQuery",
1240
+ "Listen",
1241
+ "ListCollectionIds"
1242
+ ],
1243
+ "session": [
1244
+ "BeginTransaction",
1245
+ "Rollback"
1246
+ ],
1247
+ "write": [
1248
+ "CreateDocument",
1249
+ "UpdateDocument",
1250
+ "DeleteDocument",
1251
+ "Commit",
1252
+ "BatchWrite",
1253
+ "Write"
1254
+ ]
1255
+ },
1256
+ "google.firestore.admin.v1.FirestoreAdmin": {
1257
+ "readPrefixes": [
1258
+ "Get",
1259
+ "List"
1260
+ ],
1261
+ "rule": "A method whose name starts with Get or List is a read; every other admin method (CreateIndex, DeleteIndex, UpdateField, ExportDocuments, ImportDocuments, CreateDatabase, DeleteDatabase, RestoreDatabase, BulkDeleteDocuments and the rest) is a write."
1262
+ }
1263
+ },
1264
+ "conditional": {
1265
+ "Commit": "A write when its writes list has at least one entry. A Commit with no writes only ends a transaction that read and wrote nothing, so it is session. A hook that can't read the request message treats every Commit as a write."
1266
+ },
1267
+ "rules": [
1268
+ "Listen and RunQuery are reads even when they stream for a long time, and RunQuery, BatchGetDocuments and RunAggregationQuery stay reads when they begin a transaction (new_transaction).",
1269
+ "BeginTransaction and Rollback are allowed: they hold or release a transaction but change no data. Writes reach the database only through Commit, BatchWrite, Write and the document RPCs.",
1270
+ "Write is a bidirectional stream. Opening it is a write, so the guard refuses the stream before its first message.",
1271
+ "BatchWrite is a write even when every write in it would fail its precondition."
1272
+ ],
1273
+ "fromRest": {
1274
+ "$comment": "For hooks on the REST transport (an SDK's REST fallback, or plain HTTP). Paths start /v1/projects/{project}/databases/{database}/documents.",
1275
+ "verbs": {
1276
+ "batchGet": "BatchGetDocuments",
1277
+ "beginTransaction": "BeginTransaction",
1278
+ "commit": "Commit",
1279
+ "rollback": "Rollback",
1280
+ "runQuery": "RunQuery",
1281
+ "runAggregationQuery": "RunAggregationQuery",
1282
+ "partitionQuery": "PartitionQuery",
1283
+ "write": "Write",
1284
+ "listen": "Listen",
1285
+ "listCollectionIds": "ListCollectionIds",
1286
+ "batchWrite": "BatchWrite"
1287
+ },
1288
+ "order": [
1289
+ {
1290
+ "when": "the last path segment ends in :<verb>",
1291
+ "rpc": "the verbs entry for <verb>; an unknown verb is a write"
1292
+ },
1293
+ {
1294
+ "when": "method GET on a document (an even number of segments after documents)",
1295
+ "rpc": "GetDocument"
1296
+ },
1297
+ {
1298
+ "when": "method GET on a collection (an odd number of segments after documents)",
1299
+ "rpc": "ListDocuments"
1300
+ },
1301
+ {
1302
+ "when": "method PATCH",
1303
+ "rpc": "UpdateDocument"
1304
+ },
1305
+ {
1306
+ "when": "method DELETE",
1307
+ "rpc": "DeleteDocument"
1308
+ },
1309
+ {
1310
+ "when": "method POST on a collection",
1311
+ "rpc": "CreateDocument"
1312
+ },
1313
+ {
1314
+ "when": "anything else",
1315
+ "rpc": "the method name, which is a write"
1316
+ }
1317
+ ],
1318
+ "target": "db.collection.name is the collection id: the segment before the document id, or the last segment of a collection path. For a batch or query RPC it is the collection the request names (structuredQuery.from[0].collectionId), when there is one."
1319
+ },
1320
+ "notes": {
1321
+ "Preview": "A Firestore transaction can be rolled back, but it must do every read before its first write and its reads don't see its own buffered writes. Arbitrary handlers break both rules, so Firestore runs in guard mode only.",
1322
+ "Credentials": "OAuth access tokens, the authorization metadata and service-account keys are never captured."
1323
+ }
1324
+ }
1325
+ JSON
1326
+ end
1327
+ end
1328
+ end