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,530 @@
1
+ // Request samples: one exporter per language, all fed the same prepared request. Keep formatting
2
+ // independent from the form so adding a language never affects execution.
3
+ //
4
+ // Every exporter
5
+ // - receives credentials already replaced by REDACTED (see prepareRequest),
6
+ // - writes code a person would write: one statement per line, JSON bodies indented,
7
+ // - escapes each string for its own language (quotes, backslashes, newlines, control
8
+ // characters and the language's interpolation sigils), and
9
+ // - uses the language's raw/verbatim/heredoc form for multi-line bodies only when that form
10
+ // reproduces the bytes exactly; otherwise it falls back to an escaped one-line string.
11
+
12
+ /**
13
+ * The formats the picker offers, in display order. `label` is the language, `library` the client
14
+ * it uses (shown muted beside it), `icon` the mark in lang-icons.js, `lexer` the grammar id in
15
+ * highlight.js and `hidden` formats are exportable but not part of the picker (.http is only
16
+ * copied, as before).
17
+ */
18
+ export const snippetFormats = [
19
+ { id: 'curl', label: 'cURL', library: 'bash', icon: 'curl', lexer: 'bash' },
20
+ { id: 'fetch', label: 'JavaScript', library: 'fetch', icon: 'javascript', lexer: 'javascript' },
21
+ { id: 'python', label: 'Python', library: 'requests', icon: 'python', lexer: 'python' },
22
+ { id: 'csharp', label: 'C#', library: 'HttpClient', icon: 'csharp', lexer: 'csharp' },
23
+ { id: 'go', label: 'Go', library: 'net/http', icon: 'go', lexer: 'go' },
24
+ { id: 'java', label: 'Java', library: 'java.net.http', icon: 'java', lexer: 'java' },
25
+ { id: 'kotlin', label: 'Kotlin', library: 'Ktor', icon: 'kotlin', lexer: 'kotlin' },
26
+ { id: 'php', label: 'PHP', library: 'Guzzle', icon: 'php', lexer: 'php' },
27
+ { id: 'ruby', label: 'Ruby', library: 'Net::HTTP', icon: 'ruby', lexer: 'ruby' },
28
+ { id: 'rust', label: 'Rust', library: 'reqwest', icon: 'rust', lexer: 'rust' },
29
+ { id: 'powershell', label: 'PowerShell', library: 'Invoke-RestMethod', icon: 'powershell', lexer: 'powershell' },
30
+ { id: 'http', label: '.http', library: 'REST Client', icon: 'http', lexer: 'http', hidden: true },
31
+ ];
32
+
33
+ /** The formats shown in the language picker. */
34
+ export const pickerFormats = snippetFormats.filter(format => !format.hidden);
35
+
36
+ const redacted = 'REDACTED';
37
+ const credentialName = /authorization|cookie|password|passwd|secret|token|api[-_]?key/i;
38
+
39
+ // ---------------------------------------------------------------------------------------------
40
+ // Request preparation
41
+ // ---------------------------------------------------------------------------------------------
42
+
43
+ function prepareRequest(request, sensitiveNames) {
44
+ const custom = new Set(sensitiveNames.map(name => name.toLowerCase()));
45
+ const sensitive = name => credentialName.test(name) || custom.has(name.toLowerCase());
46
+ const method = request.method.toUpperCase();
47
+ if (!/^[A-Z]+$/.test(method)) throw new Error('Unsupported HTTP method.');
48
+ const url = new URL(request.url);
49
+ url.username = '';
50
+ url.password = '';
51
+ url.hash = '';
52
+ for (const name of new Set(url.searchParams.keys())) {
53
+ if (sensitive(name)) url.searchParams.set(name, redacted);
54
+ }
55
+
56
+ const headers = new Headers(request.headers);
57
+ for (const name of headers.keys()) {
58
+ if (sensitive(name)) headers.set(name, redacted);
59
+ }
60
+ let body = request.body ?? null;
61
+ if (body instanceof URLSearchParams) body = body.toString();
62
+ if (body !== null && typeof body !== 'string') {
63
+ throw new Error('File and binary bodies cannot be copied as text.');
64
+ }
65
+
66
+ // Host schemes can use custom credential names in a query, header or body.
67
+ const mediaType = headers.get('content-type') ?? '';
68
+ if (body && /json/i.test(mediaType)) {
69
+ const parsed = JSON.parse(body);
70
+ let changed = false;
71
+ const masked = JSON.stringify(parsed, (key, value) => {
72
+ if (!sensitive(key)) return value;
73
+ changed = true;
74
+ return redacted;
75
+ }, 2);
76
+ // The exact bytes are kept unless a credential had to be masked.
77
+ if (changed) body = masked;
78
+ } else if (body && mediaType.includes('application/x-www-form-urlencoded')) {
79
+ const form = new URLSearchParams(body);
80
+ for (const name of new Set(form.keys())) {
81
+ if (sensitive(name)) form.set(name, redacted);
82
+ }
83
+ body = form.toString();
84
+ }
85
+ return { method, url: url.href, headers, body };
86
+ }
87
+
88
+ /** Header names as they're conventionally written (Content-Type), since Headers lowercases them. */
89
+ const canonical = name => name.replace(/(^|-)([a-z])/g, (match, dash, letter) => dash + letter.toUpperCase());
90
+
91
+ /**
92
+ * Code snippets are for reading and pasting: header names are canonical and JSON bodies are
93
+ * indented. The .http export keeps the exact bytes, so it can be replayed byte for byte.
94
+ * `json` says the body is valid JSON (so JavaScript can show it as an object literal) and `value`
95
+ * is its parsed form, which exporters re-indent to match the code around the body.
96
+ */
97
+ function readable(prepared) {
98
+ const headers = [...prepared.headers].map(([name, value]) => [canonical(name), value]);
99
+ let body = prepared.body;
100
+ let json = false;
101
+ let value;
102
+ if (body && /json/i.test(prepared.headers.get('content-type') || '')) {
103
+ try { value = JSON.parse(body); body = JSON.stringify(value, null, 2); json = true; } catch { /* Keep malformed JSON as typed. */ }
104
+ }
105
+ return { ...prepared, headers, body, json, value, contentType: prepared.headers.get('content-type') };
106
+ }
107
+
108
+ // ---------------------------------------------------------------------------------------------
109
+ // Shared string helpers
110
+ // ---------------------------------------------------------------------------------------------
111
+
112
+ const lower = name => name.toLowerCase();
113
+ /** Headers without the given (lower-case) names. */
114
+ const without = (headers, names) => headers.filter(([name]) => !names.includes(lower(name)));
115
+ /** Prefixes every non-empty line, so blank lines never gain trailing spaces. */
116
+ const indent = (text, pad) => text.split('\n').map(line => line ? pad + line : line).join('\n');
117
+ const isMultiline = text => text.includes('\n');
118
+
119
+ /**
120
+ * The body text for code indented in steps of `unit`. Whitespace in JSON means nothing, so a JSON
121
+ * body is re-serialised with the language's own indent unit; any other body is exact.
122
+ */
123
+ const bodyText = (prepared, unit) => prepared.json ? JSON.stringify(prepared.value, null, unit) : prepared.body;
124
+ /**
125
+ * Prefixes every line after the first, for a literal that opens on a statement's line: the body
126
+ * then sits one level inside the statement and its closing line lines up with the statement.
127
+ */
128
+ const hang = (text, pad) => text.split('\n').map((line, index) => index && line ? pad + line : line).join('\n');
129
+
130
+ const unicode4 = code => '\\u' + code.toString(16).padStart(4, '0');
131
+ const unicodeBraces = code => '\\u{' + code.toString(16) + '}';
132
+
133
+ /**
134
+ * Quotes a string with `"` (or the given delimiter), escaping the backslash, the delimiter, line
135
+ * breaks, control characters, lone surrogates and the line separators some compilers reject
136
+ * (U+0085, U+2028, U+2029). `unicode(code)` writes one escape in the language's syntax and
137
+ * `extra` maps further characters (such as `$` in Kotlin) to their escapes.
138
+ */
139
+ function quote(value, { unicode = unicode4, extra = {}, delimiter = '"' } = {}) {
140
+ let out = '';
141
+ for (const char of value) {
142
+ const code = char.codePointAt(0);
143
+ if (Object.hasOwn(extra, char)) out += extra[char];
144
+ else if (char === '\\') out += '\\\\';
145
+ else if (char === delimiter) out += '\\' + delimiter;
146
+ else if (char === '\n') out += '\\n';
147
+ else if (char === '\r') out += '\\r';
148
+ else if (char === '\t') out += '\\t';
149
+ else if (code < 0x20 || code === 0x7f || code === 0x85 || code === 0x2028 || code === 0x2029 || (code >= 0xd800 && code <= 0xdfff)) out += unicode(code);
150
+ else out += char;
151
+ }
152
+ return delimiter + out + delimiter;
153
+ }
154
+
155
+ /**
156
+ * Whether a multi-line body can sit in an indented block (Java text block, Kotlin trimIndent,
157
+ * Ruby squiggly heredoc) and come back byte for byte: the compiler removes the smallest common
158
+ * indent and trailing blanks, so some line must start at column 0 and none may end in a blank.
159
+ */
160
+ function blockSafe(body) {
161
+ if (!isMultiline(body) || body.includes('\r') || body.endsWith('\n')) return false;
162
+ const rows = body.split('\n');
163
+ return rows.some(row => /^\S/.test(row)) && rows.every(row => row === '' || (!/\s$/.test(row) && /\S/.test(row)));
164
+ }
165
+
166
+ /** Raw forms keep line breaks as `\n` only, so a body with a carriage return takes the escaped route. */
167
+ const hasCarriageReturn = text => text.includes('\r');
168
+
169
+ /** A heredoc marker no line of the body can end early: JSON, or BODY, BODY1, ... */
170
+ function uniqueMarker(body, preferred) {
171
+ const clash = marker => new RegExp(`^\\s*${marker}\\b`, 'm').test(body);
172
+ let marker = preferred;
173
+ for (let n = 1; clash(marker); n++) marker = `BODY${n}`;
174
+ return marker;
175
+ }
176
+
177
+ // ---------------------------------------------------------------------------------------------
178
+ // cURL
179
+ // ---------------------------------------------------------------------------------------------
180
+
181
+ const shellString = value => "'" + value.replaceAll("'", "'\\''") + "'";
182
+
183
+ function curl(request) {
184
+ const { method, url, headers, body } = request;
185
+ const parts = [`curl --request ${method} --url ${shellString(url)}`];
186
+ for (const [name, value] of headers) {
187
+ parts.push(`--header ${shellString(name + ': ' + value)}`);
188
+ }
189
+ // A JSON body hangs under its flag: keys one level in, the closing brace level with --data-raw.
190
+ if (body !== null) parts.push(`--data-raw ${shellString(request.json ? hang(bodyText(request, 2), ' ') : body)}`);
191
+ return parts.join(' \\' + '\n ');
192
+ }
193
+
194
+ // ---------------------------------------------------------------------------------------------
195
+ // .http (REST Client): the exact bytes, never reformatted
196
+ // ---------------------------------------------------------------------------------------------
197
+
198
+ function httpFile({ method, url, headers, body }) {
199
+ const lines = [method + ' ' + url];
200
+ for (const [name, value] of headers) lines.push(name + ': ' + value);
201
+ if (body !== null) lines.push('', body);
202
+ return lines.join('\n');
203
+ }
204
+
205
+ // ---------------------------------------------------------------------------------------------
206
+ // JavaScript (fetch)
207
+ // ---------------------------------------------------------------------------------------------
208
+
209
+ function fetchCall({ method, url, headers, body, json }) {
210
+ const options = [` method: ${quote(method)},`];
211
+ if (headers.length) {
212
+ options.push(` headers: {\n${headers.map(([name, value]) => ` ${quote(name)}: ${quote(value)},`).join('\n')}\n },`);
213
+ }
214
+ if (body !== null) {
215
+ // JSON is valid JavaScript, so a JSON body reads as an object. A "__proto__" key would set the
216
+ // prototype in a literal, so that one stays a string.
217
+ const asObject = json && !body.includes('"__proto__"');
218
+ options.push(asObject ? ` body: JSON.stringify(${indent(body, ' ').trimStart()}),` : ` body: ${quote(body)},`);
219
+ }
220
+ options.push(' credentials: "include",');
221
+ return `const response = await fetch(${quote(url)}, {\n${options.join('\n')}\n});\n\nconsole.log(response.status, await response.text());`;
222
+ }
223
+
224
+ // ---------------------------------------------------------------------------------------------
225
+ // Python (requests)
226
+ // ---------------------------------------------------------------------------------------------
227
+
228
+ function python(request) {
229
+ const { method, url, headers } = request;
230
+ const body = request.body === null ? null : bodyText(request, 4);
231
+ const lines = ['# pip install requests', 'import requests', '', `url = ${quote(url)}`];
232
+ if (headers.length) {
233
+ lines.push('headers = {', ...headers.map(([name, value]) => ` ${quote(name)}: ${quote(value)},`), '}');
234
+ }
235
+ const call = [quote(method), 'url'];
236
+ if (headers.length) call.push('headers=headers');
237
+ if (body !== null) {
238
+ // A raw triple-quoted string is verbatim, unless the body would end or break its quotes.
239
+ const raw = isMultiline(body) && !hasCarriageReturn(body) && !body.includes('"""') && !/["\\]$/.test(body);
240
+ lines.push(`payload = ${raw ? `r"""${body}"""` : quote(body)}`);
241
+ call.push('data=payload.encode("utf-8")');
242
+ }
243
+ lines.push('', `response = requests.request(${call.join(', ')})`, 'print(response.status_code, response.text)');
244
+ return lines.join('\n');
245
+ }
246
+
247
+ // ---------------------------------------------------------------------------------------------
248
+ // C# (HttpClient)
249
+ // ---------------------------------------------------------------------------------------------
250
+
251
+ const csharpMethods = { GET: 'Get', POST: 'Post', PUT: 'Put', DELETE: 'Delete', PATCH: 'Patch', HEAD: 'Head', OPTIONS: 'Options', TRACE: 'Trace' };
252
+
253
+ /**
254
+ * A C# 11 raw string literal (`"""`), long enough to hold any run of quotes in the body. JSON
255
+ * hangs: its lines sit one level in and the closing fence lines up with the statement (the extra
256
+ * indent is JSON whitespace). Other bodies are exact: the fence's indent is stripped from each line.
257
+ */
258
+ function csharpRaw(body, hanging) {
259
+ const longest = Math.max(0, ...(body.match(/"+/g) ?? []).map(run => run.length));
260
+ const fence = '"'.repeat(Math.max(3, longest + 1));
261
+ return `${fence}\n${indent(body, ' ')}\n${hanging ? '' : ' '}${fence}`;
262
+ }
263
+
264
+ function csharp(request) {
265
+ const { method, url, headers, contentType } = request;
266
+ const body = request.body === null ? null : bodyText(request, 4);
267
+ const verb = csharpMethods[method] ? `HttpMethod.${csharpMethods[method]}` : `new HttpMethod(${quote(method)})`;
268
+ const lines = ['using System.Net.Http;', 'using System.Text;', '',
269
+ 'using var handler = new HttpClientHandler { AllowAutoRedirect = false };',
270
+ 'using var client = new HttpClient(handler);'];
271
+ if (body !== null) {
272
+ const raw = isMultiline(body) && !hasCarriageReturn(body);
273
+ lines.push('', `var body = ${raw ? csharpRaw(body, request.json) : quote(body)};`);
274
+ }
275
+ lines.push('', `using var request = new HttpRequestMessage(${verb}, ${quote(url)});`);
276
+ // Content-* headers belong to the content, so they only exist when there is a body.
277
+ const ordinary = headers.filter(([name]) => !lower(name).startsWith('content-'));
278
+ const content = without(headers.filter(([name]) => lower(name).startsWith('content-')), ['content-type', 'content-length']);
279
+ for (const [name, value] of ordinary) lines.push(`request.Headers.TryAddWithoutValidation(${quote(name)}, ${quote(value)});`);
280
+ if (body !== null) {
281
+ // StringContent adds its own charset, so only the media type is passed; with no Content-Type
282
+ // header the bytes go out without one.
283
+ const mediaType = contentType?.split(';')[0].trim();
284
+ lines.push(mediaType
285
+ ? `request.Content = new StringContent(body, Encoding.UTF8, ${quote(mediaType)});`
286
+ : 'request.Content = new ByteArrayContent(Encoding.UTF8.GetBytes(body));');
287
+ for (const [name, value] of content) lines.push(`request.Content.Headers.TryAddWithoutValidation(${quote(name)}, ${quote(value)});`);
288
+ }
289
+ lines.push('', 'using var response = await client.SendAsync(request);', 'Console.WriteLine(await response.Content.ReadAsStringAsync());');
290
+ return lines.join('\n');
291
+ }
292
+
293
+ // ---------------------------------------------------------------------------------------------
294
+ // Go (net/http)
295
+ // ---------------------------------------------------------------------------------------------
296
+
297
+ const goMethods = { GET: 'Get', POST: 'Post', PUT: 'Put', DELETE: 'Delete', PATCH: 'Patch', HEAD: 'Head', OPTIONS: 'Options', TRACE: 'Trace' };
298
+
299
+ function go(request) {
300
+ const { method, url, headers } = request;
301
+ const body = request.body === null ? null : bodyText(request, '\t');
302
+ const imports = ['"fmt"', '"io"', '"net/http"', ...(body !== null ? ['"strings"'] : [])];
303
+ const lines = ['package main', '', 'import (', ...imports.map(name => `\t${name}`), ')', '', 'func main() {'];
304
+ let reader = 'nil';
305
+ if (body !== null) {
306
+ // A backtick string is verbatim, except that Go drops carriage returns and cannot hold a
307
+ // backtick: those are joined in as "`" so the rest of the body stays readable. The body is a
308
+ // variable of its own; JSON hangs one tab inside it and closes level with the statement.
309
+ const raw = isMultiline(body) && !hasCarriageReturn(body);
310
+ const text = request.json ? hang(body, '\t') : body;
311
+ const literal = raw ? text.split('`').map(part => '`' + part + '`').join(' + "`" + ') : quote(body);
312
+ lines.push(`\tpayload := ${literal}`, '\tbody := strings.NewReader(payload)');
313
+ reader = 'body';
314
+ }
315
+ const verb = goMethods[method] ? `http.Method${goMethods[method]}` : quote(method);
316
+ lines.push(`\treq, err := http.NewRequest(${verb}, ${quote(url)}, ${reader})`, '\tif err != nil {', '\t\tpanic(err)', '\t}');
317
+ // net/http sets Host from the URL and Content-Length from the body.
318
+ for (const [name, value] of without(headers, ['host', 'content-length'])) lines.push(`\treq.Header.Set(${quote(name)}, ${quote(value)})`);
319
+ lines.push('', '\tresp, err := http.DefaultClient.Do(req)', '\tif err != nil {', '\t\tpanic(err)', '\t}', '\tdefer resp.Body.Close()', '',
320
+ '\tdata, err := io.ReadAll(resp.Body)', '\tif err != nil {', '\t\tpanic(err)', '\t}', '\tfmt.Println(resp.Status, string(data))', '}');
321
+ return lines.join('\n');
322
+ }
323
+
324
+ // ---------------------------------------------------------------------------------------------
325
+ // Java (java.net.http)
326
+ // ---------------------------------------------------------------------------------------------
327
+
328
+ /** Text block escapes: backslashes and any `"""` in the body. */
329
+ const escapeTextBlock = body => body.replaceAll('\\', '\\\\').replaceAll('"""', '""\\"');
330
+ /** A text block (Java 15+) for an exact body: it ends without a newline. */
331
+ const javaTextBlock = (body, pad) => `"""\n${indent(escapeTextBlock(body), pad)}"""`;
332
+
333
+ function java(request) {
334
+ const { method, url, headers } = request;
335
+ const body = request.body === null ? null : bodyText(request, 4);
336
+ const pad = ' '.repeat(8);
337
+ const lines = ['import java.net.URI;', 'import java.net.http.HttpClient;', 'import java.net.http.HttpRequest;',
338
+ 'import java.net.http.HttpRequest.BodyPublishers;', 'import java.net.http.HttpResponse;', 'import java.net.http.HttpResponse.BodyHandlers;', '',
339
+ 'public class Main {', ' public static void main(String[] args) throws Exception {', `${pad}HttpClient client = HttpClient.newHttpClient();`];
340
+ if (body !== null) {
341
+ // JSON hangs: one level in, the closing delimiter level with the statement (the leftover indent
342
+ // and final newline are JSON whitespace). Other bodies are exact: they sit at the delimiter's indent.
343
+ const hanging = request.json && isMultiline(body) && !hasCarriageReturn(body);
344
+ const literal = hanging ? `"""\n${indent(escapeTextBlock(body), pad + ' ')}\n${pad}"""` : blockSafe(body) ? javaTextBlock(body, pad + ' ') : quote(body);
345
+ lines.push('', `${pad}String body = ${literal};`);
346
+ }
347
+ const publisher = body !== null ? 'BodyPublishers.ofString(body)' : 'BodyPublishers.noBody()';
348
+ const shortcuts = { GET: '.GET()', DELETE: '.DELETE()' };
349
+ const verb = body !== null && (method === 'POST' || method === 'PUT') ? `.${method}(${publisher})`
350
+ : body === null && shortcuts[method] ? shortcuts[method] : `.method(${quote(method)}, ${publisher})`;
351
+ lines.push('', `${pad}HttpRequest request = HttpRequest.newBuilder()`, `${pad} .uri(URI.create(${quote(url)}))`);
352
+ // The JDK client refuses these; it sets them from the URI and the body.
353
+ for (const [name, value] of without(headers, ['host', 'content-length', 'connection', 'expect', 'upgrade'])) {
354
+ lines.push(`${pad} .header(${quote(name)}, ${quote(value)})`);
355
+ }
356
+ lines.push(`${pad} ${verb}`, `${pad} .build();`, '',
357
+ `${pad}HttpResponse<String> response = client.send(request, BodyHandlers.ofString());`,
358
+ `${pad}System.out.println(response.statusCode() + " " + response.body());`, ' }', '}');
359
+ return lines.join('\n');
360
+ }
361
+
362
+ // ---------------------------------------------------------------------------------------------
363
+ // Kotlin (Ktor client)
364
+ // ---------------------------------------------------------------------------------------------
365
+
366
+ const kotlinMethods = { GET: 'Get', POST: 'Post', PUT: 'Put', DELETE: 'Delete', PATCH: 'Patch', HEAD: 'Head', OPTIONS: 'Options' };
367
+ const kotlinString = value => quote(value, { extra: { $: '\\$' } });
368
+
369
+ function kotlin(request) {
370
+ const { method, url, headers, contentType } = request;
371
+ const body = request.body === null ? null : bodyText(request, 4);
372
+ const lines = ['// Gradle: implementation("io.ktor:ktor-client-cio:3.0.0")', 'import io.ktor.client.HttpClient', 'import io.ktor.client.engine.cio.CIO',
373
+ 'import io.ktor.client.request.header', 'import io.ktor.client.request.request', ...(body !== null ? ['import io.ktor.client.request.setBody'] : []),
374
+ 'import io.ktor.client.statement.bodyAsText', ...(contentType ? ['import io.ktor.http.ContentType'] : []), 'import io.ktor.http.HttpMethod',
375
+ ...(contentType ? ['import io.ktor.http.contentType'] : []), 'import kotlinx.coroutines.runBlocking', '', 'fun main() = runBlocking {'];
376
+ if (body !== null) {
377
+ // A raw string is verbatim, but `$` starts a template and `"""` would end it.
378
+ // JSON hangs: lines one level in and the closing quotes level with the statement; trimIndent
379
+ // removes the common indent, so the body comes back as written.
380
+ const raw = (request.json ? isMultiline(body) && !hasCarriageReturn(body) : blockSafe(body)) && !body.includes('"""');
381
+ const close = request.json ? ' ' : ' ';
382
+ lines.push(raw ? ` val body = """\n${indent(body.replaceAll('$', () => "${'$'}"), ' ')}\n${close}""".trimIndent()` : ` val body = ${kotlinString(body)}`, '');
383
+ }
384
+ const verb = kotlinMethods[method] ? `HttpMethod.${kotlinMethods[method]}` : `HttpMethod.parse(${kotlinString(method)})`;
385
+ lines.push(' val client = HttpClient(CIO)', ` val response = client.request(${kotlinString(url)}) {`, ` method = ${verb}`);
386
+ // Ktor owns these: Content-Type has its own setter, the others are computed from the body.
387
+ for (const [name, value] of without(headers, ['content-type', 'content-length', 'transfer-encoding', 'upgrade'])) {
388
+ lines.push(` header(${kotlinString(name)}, ${kotlinString(value)})`);
389
+ }
390
+ if (contentType) lines.push(` contentType(ContentType.parse(${kotlinString(contentType)}))`);
391
+ if (body !== null) lines.push(' setBody(body)');
392
+ lines.push(' }', ' println("${response.status} ${response.bodyAsText()}")', ' client.close()', '}');
393
+ return lines.join('\n');
394
+ }
395
+
396
+ // ---------------------------------------------------------------------------------------------
397
+ // PHP (Guzzle)
398
+ // ---------------------------------------------------------------------------------------------
399
+
400
+ /** A single-quoted PHP string: only the backslash and the quote are special, and `$` stays literal. */
401
+ const phpString = value => "'" + value.replace(/[\\']/g, '\\$&') + "'";
402
+ const phpDouble = value => quote(value, { unicode: unicodeBraces, extra: { $: '\\$' } });
403
+
404
+ function php(request) {
405
+ const { method, url, headers } = request;
406
+ const body = request.body === null ? null : bodyText(request, 4);
407
+ const lines = ['<?php', '', '// composer require guzzlehttp/guzzle', "require 'vendor/autoload.php';", '', 'use GuzzleHttp\\Client;', '', '$client = new Client();', '',
408
+ `$response = $client->request(${phpString(method)}, ${phpString(url)}, [`];
409
+ if (headers.length) {
410
+ lines.push(" 'headers' => [", ...headers.map(([name, value]) => ` ${phpString(name)} => ${phpString(value)},`), ' ],');
411
+ }
412
+ if (body !== null) {
413
+ // A nowdoc is verbatim. Its closing marker may be indented (PHP 7.3+), which strips the indent.
414
+ // A line that starts with a tab cannot sit under the space indent PHP requires.
415
+ if (isMultiline(body) && !hasCarriageReturn(body) && !/^\t/m.test(body)) {
416
+ const marker = uniqueMarker(body, 'JSON');
417
+ // JSON hangs: lines one level in, the marker level with the statement (the leftover indent is JSON whitespace).
418
+ lines.push(` 'body' => <<<'${marker}'`, indent(body, ' '), `${request.json ? ' ' : ' '}${marker},`);
419
+ } else {
420
+ lines.push(` 'body' => ${phpDouble(body)},`);
421
+ }
422
+ }
423
+ // Without this Guzzle throws on 4xx and 5xx instead of returning the response.
424
+ lines.push(" 'http_errors' => false,", ']);', '', "echo $response->getStatusCode(), ' ', $response->getBody(), PHP_EOL;");
425
+ return lines.join('\n');
426
+ }
427
+
428
+ // ---------------------------------------------------------------------------------------------
429
+ // Ruby (Net::HTTP)
430
+ // ---------------------------------------------------------------------------------------------
431
+
432
+ const rubyMethods = { GET: 'Get', POST: 'Post', PUT: 'Put', DELETE: 'Delete', PATCH: 'Patch', HEAD: 'Head', OPTIONS: 'Options', TRACE: 'Trace' };
433
+ /** A double-quoted Ruby string. `#` is escaped so "#{...}" can never interpolate. */
434
+ const rubyString = value => quote(value, { extra: { '#': '\\#' } });
435
+
436
+ function ruby(request) {
437
+ const { method, url, headers } = request;
438
+ const body = request.body === null ? null : bodyText(request, 2);
439
+ const lines = ['require "net/http"', 'require "uri"', '', `uri = URI(${rubyString(url)})`, ''];
440
+ lines.push(rubyMethods[method]
441
+ ? `request = Net::HTTP::${rubyMethods[method]}.new(uri)`
442
+ : `request = Net::HTTPGenericRequest.new(${rubyString(method)}, ${body !== null}, true, uri)`);
443
+ for (const [name, value] of headers) lines.push(`request[${rubyString(name)}] = ${rubyString(value)}`);
444
+ if (body !== null) {
445
+ if (blockSafe(body)) {
446
+ // A single-quoted squiggly heredoc is verbatim apart from its trailing newline, which chomp removes.
447
+ const marker = uniqueMarker(body, 'JSON');
448
+ lines.push(`request.body = <<~'${marker}'.chomp`, indent(body, ' '), marker);
449
+ } else {
450
+ lines.push(`request.body = ${rubyString(body)}`);
451
+ }
452
+ }
453
+ lines.push('', 'response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|', ' http.request(request)', 'end', '',
454
+ 'puts response.code, response.body');
455
+ return lines.join('\n');
456
+ }
457
+
458
+ // ---------------------------------------------------------------------------------------------
459
+ // Rust (reqwest, blocking)
460
+ // ---------------------------------------------------------------------------------------------
461
+
462
+ const rustMethods = { GET: 'get', POST: 'post', PUT: 'put', DELETE: 'delete', PATCH: 'patch', HEAD: 'head' };
463
+ const rustString = value => quote(value, { unicode: code => `\\u{${code.toString(16)}}` });
464
+
465
+ /** A raw string with enough `#` to outlast any `"#` in the body. */
466
+ function rustRaw(body) {
467
+ const longest = Math.max(0, ...(body.match(/"#*/g) ?? []).map(run => run.length - 1));
468
+ const hashes = '#'.repeat(longest + 1);
469
+ return `r${hashes}"${body}"${hashes}`;
470
+ }
471
+
472
+ function rust(request) {
473
+ const { method, url, headers } = request;
474
+ const body = request.body === null ? null : bodyText(request, 4);
475
+ const lines = ['// Cargo.toml: reqwest = { version = "0.12", features = ["blocking"] }', 'use reqwest::blocking::Client;', '',
476
+ 'fn main() -> Result<(), reqwest::Error> {', ' let client = Client::new();'];
477
+ if (body !== null) {
478
+ // The body is a variable of its own: JSON hangs one level inside the statement and closes level with it.
479
+ const raw = isMultiline(body) && !hasCarriageReturn(body);
480
+ lines.push(` let body = ${raw ? rustRaw(request.json ? hang(body, ' ') : body) : rustString(body)};`);
481
+ }
482
+ lines.push(' let response = client');
483
+ lines.push(rustMethods[method]
484
+ ? ` .${rustMethods[method]}(${rustString(url)})`
485
+ : ` .request(reqwest::Method::from_bytes(${rustString(method)}.as_bytes()).unwrap(), ${rustString(url)})`);
486
+ for (const [name, value] of without(headers, ['content-length'])) lines.push(` .header(${rustString(name)}, ${rustString(value)})`);
487
+ if (body !== null) lines.push(' .body(body)');
488
+ lines.push(' .send()?;', '', ' println!("{} {}", response.status(), response.text()?);', ' Ok(())', '}');
489
+ return lines.join('\n');
490
+ }
491
+
492
+ // ---------------------------------------------------------------------------------------------
493
+ // PowerShell (Invoke-RestMethod)
494
+ // ---------------------------------------------------------------------------------------------
495
+
496
+ /** A single-quoted string: only the quote is special, and PowerShell also treats curly quotes as quotes. */
497
+ const powershellString = value => "'" + value.replace(/['\u2018\u2019\u201a\u201b]/g, match => match + match) + "'";
498
+
499
+ function powershell(request) {
500
+ const { method, url, headers, contentType } = request;
501
+ const body = request.body === null ? null : bodyText(request, 2);
502
+ const lines = [];
503
+ const plain = without(headers, ['content-type']);
504
+ if (plain.length) lines.push('$headers = @{', ...plain.map(([name, value]) => ` ${powershellString(name)} = ${powershellString(value)}`), '}');
505
+ if (body !== null) {
506
+ // A single-quoted here-string is verbatim; it ends at the first line that begins with '@.
507
+ const verbatim = isMultiline(body) && !hasCarriageReturn(body) && !/^'@/m.test(body);
508
+ // The closing '@ must start its line, so JSON hangs two spaces inside the opening line instead.
509
+ lines.push(verbatim ? `$body = @'\n${request.json ? indent(body, ' ') : body}\n'@` : `$body = ${powershellString(body)}`);
510
+ }
511
+ if (lines.length) lines.push('');
512
+ const params = [['Method', powershellString(method)], ['Uri', powershellString(url)]];
513
+ if (plain.length) params.push(['Headers', '$headers']);
514
+ if (contentType) params.push(['ContentType', powershellString(contentType)]);
515
+ if (body !== null) params.push(['Body', '$body']);
516
+ const width = Math.max(...params.map(([name]) => name.length));
517
+ lines.push('$params = @{', ...params.map(([name, value]) => ` ${name.padEnd(width)} = ${value}`), '}', 'Invoke-RestMethod @params');
518
+ return lines.join('\n');
519
+ }
520
+
521
+ const exporters = new Map([['curl', curl], ['fetch', fetchCall], ['python', python], ['csharp', csharp], ['go', go], ['java', java],
522
+ ['kotlin', kotlin], ['php', php], ['ruby', ruby], ['rust', rust], ['powershell', powershell], ['http', httpFile]]);
523
+
524
+ /** Export a prepared request, replacing recognized credentials before formatting. */
525
+ export function formatRequest(format, request, sensitiveNames = []) {
526
+ const exportRequest = exporters.get(format);
527
+ if (!exportRequest) throw new Error('Unsupported request format.');
528
+ const prepared = prepareRequest(request, sensitiveNames);
529
+ return exportRequest(format === 'http' ? prepared : readable(prepared));
530
+ }
@@ -0,0 +1,47 @@
1
+ // Store marks: each vendor's own published logo, as inline SVG. Data only; ui/stores.js renders them.
2
+ //
3
+ // Sources and terms (each mark remains its owner's trademark; it is used only to name the store
4
+ // beside its name in text, never as Sendproof's own branding or to imply endorsement):
5
+ // sqlite SQLite feather, from the SQLite source tree (sqlite/art/sqlite370.eps), which its
6
+ // authors dedicate to the public domain. Path data via Simple Icons (CC0 1.0).
7
+ // postgresql "Slonik", wiki.postgresql.org/wiki/Logo, used under the PostgreSQL trademark policy
8
+ // (postgresql.org/about/policies/trademarks). Path data via Simple Icons (CC0 1.0).
9
+ // mysql MySQL dolphin wordmark, mysql.com/about/legal/logos.html (Oracle trademark guidelines).
10
+ // Path data via Simple Icons (CC0 1.0).
11
+ // mariadb MariaDB sea lion, mariadb.com/about-us/logos (MariaDB Foundation logo guidelines).
12
+ // Path data via Simple Icons (CC0 1.0).
13
+ // mongodb MongoDB leaf, mongodb.com/pressroom (MongoDB trademark standards). Path data via
14
+ // Simple Icons (CC0 1.0).
15
+ // redis Redis logo, redis.io/brand-guidelines (Redis trademark policy). Path data via
16
+ // Simple Icons (CC0 1.0).
17
+ // cassandra Apache Cassandra eye, apache.org/logos (Apache trademark policy,
18
+ // apache.org/foundation/marks; artwork Apache-2.0). Path data via Simple Icons.
19
+ // elasticsearch Elasticsearch logo, elastic.co/brand (Elastic trademark guidelines). Path data via
20
+ // Simple Icons (CC0 1.0).
21
+ // opensearch OpenSearch logo, opensearch.org/trademark-brand-policy.html. Path data via
22
+ // Simple Icons (CC0 1.0).
23
+ // firestore Firebase logo, firebase.google.com/brand-guidelines (Firestore is a Firebase
24
+ // product). Path data via Simple Icons (CC0 1.0).
25
+ //
26
+ // No mark, on purpose: SQL Server, Azure Cosmos DB and Amazon DynamoDB. Microsoft's Azure Architecture
27
+ // Icons and AWS's Architecture Icons are licensed for architecture diagrams, training materials and
28
+ // documentation only (learn.microsoft.com/azure/architecture/icons, "Icon terms"; aws.amazon.com/
29
+ // architecture/icons), not for a product's interface, and neither vendor publishes another mark for
30
+ // this use. ui/stores.js shows the generic store glyph for them, with the store's name beside it as
31
+ // for every store, so the layout is the same.
32
+ //
33
+ // Each mark is one path with class "f", so ui/app.css (section "Data stores") sets the vendor's brand colour per theme
34
+ // (dark mode lifts the colours that would sink into a dark panel). No ids, so a mark can appear
35
+ // any number of times on a page.
36
+ export const MARKS = {
37
+ sqlite: { box: '0 0 24 24', body: '<path class="f" d="M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71 8.71 0 0 0-.547.535c-2.109 2.237-4.066 6.38-4.674 9.544.237.48.422 1.093.544 1.561a13.044 13.044 0 0 1 .164.703s-.019-.071-.096-.296l-.05-.146a1.689 1.689 0 0 0-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376 1.176.484.884.778 2.4.778 2.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304 1.346-.226 1.478.152.256.296.698.422 1.186.286 1.1.485 2.44.485 2.44l.017.224a22.41 22.41 0 0 0 .056 2.748c.095 1.146.273 2.13.5 2.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29 1.661-8.304 1.723-4.55 4.113-8.201 6.3-9.945-1.993 1.8-4.692 7.63-5.5 9.788-.904 2.416-1.545 4.684-1.931 6.857.666-2.037 2.821-2.912 2.821-2.912s1.057-1.304 2.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184 3.613-1.72C21.695 7.9 24.195 2.767 21.678.521m-18.573.543A1.842 1.842 0 0 0 1.27 2.9v16.608a1.84 1.84 0 0 0 1.835 1.834h9.418a22.953 22.953 0 0 1-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01 27.01 0 0 0-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432 0-.12.015-.245.037-.386a9.98 9.98 0 0 1 .234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8 32.8 0 0 1 .382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28 2.587-7.443 4.8-9.791.066-.069.133-.128.198-.194Z"/>' },
38
+ postgresql: { box: '0 0 24 24', body: '<path class="f" d="M23.5594 14.7228a.5269.5269 0 0 0-.0563-.1191c-.139-.2632-.4768-.3418-1.0074-.2321-1.6533.3411-2.2935.1312-2.5256-.0191 1.342-2.0482 2.445-4.522 3.0411-6.8297.2714-1.0507.7982-3.5237.1222-4.7316a1.5641 1.5641 0 0 0-.1509-.235C21.6931.9086 19.8007.0248 17.5099.0005c-1.4947-.0158-2.7705.3461-3.1161.4794a9.449 9.449 0 0 0-.5159-.0816 8.044 8.044 0 0 0-1.3114-.1278c-1.1822-.0184-2.2038.2642-3.0498.8406-.8573-.3211-4.7888-1.645-7.2219.0788C.9359 2.1526.3086 3.8733.4302 6.3043c.0409.818.5069 3.334 1.2423 5.7436.4598 1.5065.9387 2.7019 1.4334 3.582.553.9942 1.1259 1.5933 1.7143 1.7895.4474.1491 1.1327.1441 1.8581-.7279.8012-.9635 1.5903-1.8258 1.9446-2.2069.4351.2355.9064.3625 1.39.3772a.0569.0569 0 0 0 .0004.0041 11.0312 11.0312 0 0 0-.2472.3054c-.3389.4302-.4094.5197-1.5002.7443-.3102.064-1.1344.2339-1.1464.8115-.0025.1224.0329.2309.0919.3268.2269.4231.9216.6097 1.015.6331 1.3345.3335 2.5044.092 3.3714-.6787-.017 2.231.0775 4.4174.3454 5.0874.2212.5529.7618 1.9045 2.4692 1.9043.2505 0 .5263-.0291.8296-.0941 1.7819-.3821 2.5557-1.1696 2.855-2.9059.1503-.8707.4016-2.8753.5388-4.1012.0169-.0703.0357-.1207.057-.1362.0007-.0005.0697-.0471.4272.0307a.3673.3673 0 0 0 .0443.0068l.2539.0223.0149.001c.8468.0384 1.9114-.1426 2.5312-.4308.6438-.2988 1.8057-1.0323 1.5951-1.6698zM2.371 11.8765c-.7435-2.4358-1.1779-4.8851-1.2123-5.5719-.1086-2.1714.4171-3.6829 1.5623-4.4927 1.8367-1.2986 4.8398-.5408 6.108-.13-.0032.0032-.0066.0061-.0098.0094-2.0238 2.044-1.9758 5.536-1.9708 5.7495-.0002.0823.0066.1989.0162.3593.0348.5873.0996 1.6804-.0735 2.9184-.1609 1.1504.1937 2.2764.9728 3.0892.0806.0841.1648.1631.2518.2374-.3468.3714-1.1004 1.1926-1.9025 2.1576-.5677.6825-.9597.5517-1.0886.5087-.3919-.1307-.813-.5871-1.2381-1.3223-.4796-.839-.9635-2.0317-1.4155-3.5126zm6.0072 5.0871c-.1711-.0428-.3271-.1132-.4322-.1772.0889-.0394.2374-.0902.4833-.1409 1.2833-.2641 1.4815-.4506 1.9143-1.0002.0992-.126.2116-.2687.3673-.4426a.3549.3549 0 0 0 .0737-.1298c.1708-.1513.2724-.1099.4369-.0417.156.0646.3078.26.3695.4752.0291.1016.0619.2945-.0452.4444-.9043 1.2658-2.2216 1.2494-3.1676 1.0128zm2.094-3.988-.0525.141c-.133.3566-.2567.6881-.3334 1.003-.6674-.0021-1.3168-.2872-1.8105-.8024-.6279-.6551-.9131-1.5664-.7825-2.5004.1828-1.3079.1153-2.4468.079-3.0586-.005-.0857-.0095-.1607-.0122-.2199.2957-.2621 1.6659-.9962 2.6429-.7724.4459.1022.7176.4057.8305.928.5846 2.7038.0774 3.8307-.3302 4.7363-.084.1866-.1633.3629-.2311.5454zm7.3637 4.5725c-.0169.1768-.0358.376-.0618.5959l-.146.4383a.3547.3547 0 0 0-.0182.1077c-.0059.4747-.054.6489-.115.8693-.0634.2292-.1353.4891-.1794 1.0575-.11 1.4143-.8782 2.2267-2.4172 2.5565-1.5155.3251-1.7843-.4968-2.0212-1.2217a6.5824 6.5824 0 0 0-.0769-.2266c-.2154-.5858-.1911-1.4119-.1574-2.5551.0165-.5612-.0249-1.9013-.3302-2.6462.0044-.2932.0106-.5909.019-.8918a.3529.3529 0 0 0-.0153-.1126 1.4927 1.4927 0 0 0-.0439-.208c-.1226-.4283-.4213-.7866-.7797-.9351-.1424-.059-.4038-.1672-.7178-.0869.067-.276.1831-.5875.309-.9249l.0529-.142c.0595-.16.134-.3257.213-.5012.4265-.9476 1.0106-2.2453.3766-5.1772-.2374-1.0981-1.0304-1.6343-2.2324-1.5098-.7207.0746-1.3799.3654-1.7088.5321a5.6716 5.6716 0 0 0-.1958.1041c.0918-1.1064.4386-3.1741 1.7357-4.4823a4.0306 4.0306 0 0 1 .3033-.276.3532.3532 0 0 0 .1447-.0644c.7524-.5706 1.6945-.8506 2.802-.8325.4091.0067.8017.0339 1.1742.081 1.939.3544 3.2439 1.4468 4.0359 2.3827.8143.9623 1.2552 1.9315 1.4312 2.4543-1.3232-.1346-2.2234.1268-2.6797.779-.9926 1.4189.543 4.1729 1.2811 5.4964.1353.2426.2522.4522.2889.5413.2403.5825.5515.9713.7787 1.2552.0696.087.1372.1714.1885.245-.4008.1155-1.1208.3825-1.0552 1.717-.0123.1563-.0423.4469-.0834.8148-.0461.2077-.0702.4603-.0994.7662zm.8905-1.6211c-.0405-.8316.2691-.9185.5967-1.0105a2.8566 2.8566 0 0 0 .135-.0406 1.202 1.202 0 0 0 .1342.103c.5703.3765 1.5823.4213 3.0068.1344-.2016.1769-.5189.3994-.9533.6011-.4098.1903-1.0957.333-1.7473.3636-.7197.0336-1.0859-.0807-1.1721-.151zm.5695-9.2712c-.0059.3508-.0542.6692-.1054 1.0017-.055.3576-.112.7274-.1264 1.1762-.0142.4368.0404.8909.0932 1.3301.1066.887.216 1.8003-.2075 2.7014a3.5272 3.5272 0 0 1-.1876-.3856c-.0527-.1276-.1669-.3326-.3251-.6162-.6156-1.1041-2.0574-3.6896-1.3193-4.7446.3795-.5427 1.3408-.5661 2.1781-.463zm.2284 7.0137a12.3762 12.3762 0 0 0-.0853-.1074l-.0355-.0444c.7262-1.1995.5842-2.3862.4578-3.4385-.0519-.4318-.1009-.8396-.0885-1.2226.0129-.4061.0666-.7543.1185-1.0911.0639-.415.1288-.8443.1109-1.3505.0134-.0531.0188-.1158.0118-.1902-.0457-.4855-.5999-1.938-1.7294-3.253-.6076-.7073-1.4896-1.4972-2.6889-2.0395.5251-.1066 1.2328-.2035 2.0244-.1859 2.0515.0456 3.6746.8135 4.8242 2.2824a.908.908 0 0 1 .0667.1002c.7231 1.3556-.2762 6.2751-2.9867 10.5405zm-8.8166-6.1162c-.025.1794-.3089.4225-.6211.4225a.5821.5821 0 0 1-.0809-.0056c-.1873-.026-.3765-.144-.5059-.3156-.0458-.0605-.1203-.178-.1055-.2844.0055-.0401.0261-.0985.0925-.1488.1182-.0894.3518-.1226.6096-.0867.3163.0441.6426.1938.6113.4186zm7.9305-.4114c.0111.0792-.049.201-.1531.3102-.0683.0717-.212.1961-.4079.2232a.5456.5456 0 0 1-.075.0052c-.2935 0-.5414-.2344-.5607-.3717-.024-.1765.2641-.3106.5611-.352.297-.0414.6111.0088.6356.1851z"/>' },
39
+ mysql: { box: '0 0 24 24', body: '<path class="f" d="M16.405 5.501c-.115 0-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77 18.695h-.927a50.854 50.854 0 00-.27-4.41h-.008l-1.41 4.41H2.45l-1.4-4.41h-.01a72.892 72.892 0 00-.195 4.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335 4.064h.008l1.347-4.064h1.095c.242 2.015.384 3.86.428 5.53zm4.017-4.08c-.378 2.045-.876 3.533-1.492 4.46-.482.716-1.01 1.073-1.583 1.073-.153 0-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268 0 .483-.075.647-.222.197-.18.295-.382.295-.605 0-.155-.077-.47-.23-.944L6.23 14.615h.91l.727 2.36c.164.536.233.91.205 1.123.4-1.064.678-2.227.835-3.483zm12.325 4.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253 0-1.83-.718-2.746-2.155-2.746-.704 0-1.254.232-1.65.697-.43.508-.646 1.256-.646 2.245 0 .972.19 1.686.574 2.14.35.41.877.615 1.583.615.264 0 .506-.033.725-.098l1.325.772.36-.622zM15.5 17.588c-.225-.36-.337-.94-.337-1.736 0-1.393.424-2.09 1.27-2.09.443 0 .77.167.977.5.224.362.336.936.336 1.723 0 1.404-.424 2.108-1.27 2.108-.445 0-.77-.167-.978-.5zm-1.658-.425c0 .47-.172.856-.516 1.156-.344.3-.803.45-1.384.45-.543 0-1.064-.172-1.573-.515l.237-.476c.438.22.833.328 1.19.328.332 0 .593-.073.783-.22a.754.754 0 00.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177 0-.45.157-.81.47-1.085.315-.278.72-.415 1.22-.415.512 0 .98.136 1.4.41l-.213.476a2.726 2.726 0 00-1.064-.23c-.283 0-.502.068-.654.206a.685.685 0 00-.248.524c0 .328.234.61.666.85.393.215 1.187.67 1.187.67.433.305.648.63.648 1.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223 3.223 0 00-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867 8.867 0 00-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69 17.69 0 01-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422 1.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146 1.693.194 2.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445 3.445 0 01-.35-.4 8.76 8.76 0 01-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188 1.01-.027.007-.014 0-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478 2.478 0 01-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953 5.953 0 012.085 2.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z"/>' },
40
+ mariadb: { box: '0 0 24 24', body: '<path class="f" d="M23.157 4.412c-.676.284-.79.31-1.673.372-.65.045-.757.057-1.212.209-.75.246-1.395.75-2.02 1.59-.296.398-1.249 1.913-1.249 1.988 0 .057-.65.998-.915 1.32-.574.713-1.08 1.079-2.14 1.59-.77.36-1.224.524-4.102 1.477-1.073.353-2.133.738-2.367.864-.852.449-1.515 1.036-2.203 1.938-1.003 1.32-.972 1.313-3.042.947a12.264 12.264 0 00-.675-.063c-.644-.05-1.023.044-1.332.334L0 17.193l.177.088c.094.05.353.234.561.398.215.17.461.347.55.391.088.044.17.088.183.101.012.013-.089.17-.228.353-.435.581-.593.871-.574 1.048.019.164.032.17.43.17.517-.006.826-.056 1.261-.208.65-.233 2.058-.94 2.784-1.4.776-.5 1.717-.998 1.956-1.042.082-.02.354-.07.594-.114.58-.107 1.464-.095 2.587.05.108.013.373.045.6.064.227.025.43.057.454.076.026.012.474.037.998.056.934.026 1.104.007 1.3-.189.126-.133.385-.631.498-.985.209-.643.417-.921.366-.492-.113.966-.322 1.692-.713 2.411-.259.499-.663 1.092-.934 1.395-.322.347-.315.36.088.315.619-.063 1.471-.397 2.096-.82.827-.562 1.647-1.691 2.19-3.03.107-.27.22-.22.183.083-.013.094-.038.315-.057.498l-.031.328.353-.202c.833-.48 1.414-1.262 2.127-2.884.227-.518.877-2.922 1.073-3.976a9.64 9.64 0 01.271-1.042c.127-.429.196-.555.48-.858.183-.19.625-.555.978-.808.72-.505.953-.75 1.187-1.205.208-.417.284-1.13.132-1.357-.132-.202-.284-.196-.763.006Z"/>' },
41
+ mongodb: { box: '0 0 24 24', body: '<path class="f" d="M17.193 9.555c-1.264-5.58-4.252-7.414-4.573-8.115-.28-.394-.53-.954-.735-1.44-.036.495-.055.685-.523 1.184-.723.566-4.438 3.682-4.74 10.02-.282 5.912 4.27 9.435 4.888 9.884l.07.05A73.49 73.49 0 0111.91 24h.481c.114-1.032.284-2.056.51-3.07.417-.296.604-.463.85-.693a11.342 11.342 0 003.639-8.464c.01-.814-.103-1.662-.197-2.218zm-5.336 8.195s0-8.291.275-8.29c.213 0 .49 10.695.49 10.695-.381-.045-.765-1.76-.765-2.405z"/>' },
42
+ redis: { box: '0 0 24 24', body: '<path class="f" d="M22.71 13.145c-1.66 2.092-3.452 4.483-7.038 4.483-3.203 0-4.397-2.825-4.48-5.12.701 1.484 2.073 2.685 4.214 2.63 4.117-.133 6.94-3.852 6.94-7.239 0-4.05-3.022-6.972-8.268-6.972-3.752 0-8.4 1.428-11.455 3.685C2.59 6.937 3.885 9.958 4.35 9.626c2.648-1.904 4.748-3.13 6.784-3.744C8.12 9.244.886 17.05 0 18.425c.1 1.261 1.66 4.648 2.424 4.648.232 0 .431-.133.664-.365a100.49 100.49 0 0 0 5.54-6.765c.222 3.104 1.748 6.898 6.014 6.898 3.819 0 7.604-2.756 9.33-8.965.2-.764-.73-1.361-1.261-.73zm-4.349-5.013c0 1.959-1.926 2.922-3.685 2.922-.941 0-1.664-.247-2.235-.568 1.051-1.592 2.092-3.225 3.21-4.973 1.972.334 2.71 1.43 2.71 2.619z"/>' },
43
+ cassandra: { box: '0 0 24 24', body: '<path class="f" d="M10.374 10.53a3.102 3.102 0 0 1-.428-.222l.555.143c0 .02-.01.036-.01.055l-.117.025zm-.283 1.506-.315.253.852-1.079-1.078.391c.002.017.009.033.009.05a.57.57 0 0 1-.184.42c.102.217.228.424.375.616a3.2 3.2 0 0 1 .34-.651zm.717-2.347-.652-.82a.427.427 0 0 1-.506.162c-.054.073-.083.162-.13.24l1.258.463c.011-.015.019-.031.03-.045zm-1.666.444c-.07.314-.087.637-.05.956a.566.566 0 0 1 .451.475l.946-.606c-.067-.022-.126-.06-.191-.088l-1.119-.08.64-.14a3.186 3.186 0 0 1-.668-.554l-.01.037zM20.1 11.648c-.164.202.833 1.022.833 1.022s-1.654-1.022-2.234-.72c-.278.144.574.811 1.175 1.242-.428-.274-.982-.571-1.175-.408-.328.277 1.565 2.549 1.565 2.549s-2.145-2.322-2.36-2.209c-.214.114.593 1.224.593 1.224s-1.06-1.16-1.35-.959c-.29.202 1.514 3.218 1.514 3.218s-1.956-3.091-2.763-2.574c1.268 2.782.795 3.18.795 3.18s-.162-2.839-1.742-2.764c-.795.038.379 2.12.379 2.12s-1.08-1.902-1.8-1.864c1.326 2.51.854 3.53.854 3.53s.219-2.143-1.58-3.336c.682.606-.427 3.336-.427 3.336s.976-4.023-.719-3.256c-.268.121-.019 2.007-.019 2.007s-.34-2.158-.851-2.045c-.298.066-1.893 2.99-1.893 2.99s1.306-3.16.908-3.027c-.29.096-.833 1.4-.833 1.4s.265-1.287 0-1.363c-.264-.075-1.74 1.363-1.74 1.363s1.097-1.287.908-1.552c-.287-.402-.623-.42-1.022-.265-.581.226-1.363 1.287-1.363 1.287s.78-1.074.643-1.476c-.219-.647-2.46 1.249-2.46 1.249s1.325-1.25 1.022-1.514c-.303-.265-1.947-.183-2.46-.185-1.515-.004-2.039-.36-2.498-.724 1.987.997 3.803-.151 6.094.494l.21.06c-1.3-.558-2.144-1.378-2.226-2.354-.036-.416.074-.827.297-1.222.619-.4 1.29-.773 2.06-1.095a4 4 0 0 0-.064.698c0 2.44 2.203 4.417 4.92 4.417s4.92-1.977 4.92-4.417c0-.45-.083-.881-.223-1.29 1.431.404 2.45.968 3.132 1.335.022.092.045.184.053.279.024.274-.018.547-.11.814.095-.147.198-.288.28-.445.367-.997 1.855.227 1.855.227s-1.085-.454-1.06-.24c.026.215 1.628.96 1.628.96s-1.45-.455-1.362-.114c.088.34 1.817 1.703 1.817 1.703s-1.956-1.489-2.12-1.287zm-7.268 2.65.042-.008-.06.01zM9.256 9.753c.12.13.26.234.396.343l.927-.029-1.064-.788c-.093.154-.195.303-.26.474Zm10.62 3.44c.3.215.54.373.54.373s-.24-.181-.54-.374zM7.507 8.617c-.14.229-.214.492-.215.76a3.99 3.99 0 0 0 2.358 3.64c0-.005.002-.01.003-.014a3.19 3.19 0 0 1-.58-.788c-.648.099-.926-.794-.336-1.08a3.174 3.174 0 0 1 .138-1.388 3.162 3.162 0 0 1-.52-1.36c-.296.07-.579.147-.848.23Zm1.488.82c.108-.24.243-.46.402-.661a.435.435 0 0 1 .568-.557c.077-.059.166-.099.248-.15a16.17 16.17 0 0 0-1.727.284c.114.388.272.76.509 1.084Zm2.285 3.928c1.4 0 2.633-.723 3.344-1.816a3.399 3.399 0 0 0-1.265-.539l-.297-.023.916.9-1.197-.467.704 1.078-1.074-.832-.012.006.347 1.278-.596-1.134-.098 1.33-.401-1.326-.472 1.261.114-1.359c-.006-.002-.01-.006-.015-.008l-.814 1.154.286-1.067c-.34.322-.605.713-.781 1.146.095.102.197.198.303.29.322.083.66.128 1.008.128zm10.145-4.434c.971-.567 1.716-1.955 1.716-1.955s-1.893 1.955-3.205 1.665c1.186-.934 1.766-2.549 1.766-2.549s-1.506 2.325-2.448 2.423c1.086-.959 1.54-2.322 1.54-2.322s-1.237 1.817-2.196 1.944c1.287-1.161 1.338-1.893 1.338-1.893s-1.781 2.302-2.499 1.943c.858-.934 1.439-2.12 1.439-2.12s-1.489 2.019-1.893 1.69c-.277-.05.454-.958.454-.958s-.908.807-1.16.606c.454-.278 1.236-1.64 1.236-1.64S16 7.505 15.621 7.304l.731-1.483s-.73 1.483-1.715 1.23c.454-.58.63-1.112.63-1.112s-.756 1.213-1.69.885c-.22-.077.273-.635.273-.635s-.626.61-1.055.534c-.43-.076.025-.858.025-.858s-.757 1.186-.908 1.136c-.152-.05.075-.833.075-.833s-.555.908-.858.858c-.302-.05 0-.934 0-.934s-.328.984-.58.909c-.252-.076-.303-.656-.303-.656s-.068.788-.429.858c-2.725.53-5.728 1.69-9.489 5.45C3.887 10.738 5.3 7.91 11.962 7.659c5.044-.191 7.399 2.137 8.177 2.17C22.51 9.93 24 7.633 24 7.633s-1.489 1.716-2.574 1.3zm-7.74.872-.608.464v.001l.054.003a3.35 3.35 0 0 0 .554-.468zm1.583-.426c0-.536-.237-.929-.594-1.217a3.178 3.178 0 0 1-.165.825.393.393 0 0 1-.328.681c-.154.233-.34.445-.549.63l.661.034-.995.237c-.025.018-.045.041-.07.058a3.194 3.194 0 0 1 1.536.691c.32-.574.504-1.235.504-1.94zM10.99 7.996a3.5 3.5 0 0 0-.785.46.427.427 0 0 1-.013.357l.885.643.023-.016-.36-1.262.627 1.12c.018-.006.04-.006.058-.011l-.02-1.251.398 1.163.477-1.15.016 1.268c.004.001.007.005.012.007l.713-1.005-.363 1.218.009.01 1.04-.69-.759 1.05.002.005.95-.34c.012-.016.028-.029.041-.045a.395.395 0 0 1 .394-.632 3.43 3.43 0 0 0 .27-.784 13.99 13.99 0 0 0-2.798-.168c-.286.011-.55.033-.817.053Z"/>' },
44
+ elasticsearch: { box: '0 0 24 24', body: '<path class="f" d="M13.394 0C8.683 0 4.609 2.716 2.644 6.667h15.641a4.77 4.77 0 0 0 3.073-1.11c.446-.375.864-.785 1.247-1.243l.001-.002A11.974 11.974 0 0 0 13.394 0zM1.804 8.889a12.009 12.009 0 0 0 0 6.222h14.7a3.111 3.111 0 1 0 0-6.222zm.84 8.444C4.61 21.283 8.684 24 13.395 24c3.701 0 7.011-1.677 9.212-4.312l-.001-.002a9.958 9.958 0 0 0-1.247-1.243 4.77 4.77 0 0 0-3.073-1.11z"/>' },
45
+ opensearch: { box: '0 0 24 24', body: '<path class="f" d="M23.1515 8.8125a.8484.8484 0 0 0-.8484.8485c0 6.982-5.6601 12.6421-12.6421 12.6421a.8485.8485 0 0 0 0 1.6969C17.5802 24 24 17.5802 24 9.661a.8485.8485 0 0 0-.8485-.8485Zm-5.121 5.4375c.816-1.3311 1.6051-3.1058 1.4498-5.5905-.3216-5.1468-4.9832-9.0512-9.3851-8.6281C8.372.1971 6.6025 1.6017 6.7598 4.1177c.0683 1.0934.6034 1.7386 1.473 2.2348.8279.4722 1.8914.7713 3.097 1.1104 1.4563.4096 3.1455.8697 4.4438 1.8265 1.5561 1.1467 2.6198 2.4759 2.2569 4.9606Zm-16.561-9C.6535 6.581-.1355 8.3558.0197 10.8405c.3216 5.1468 4.9832 9.0512 9.385 8.6281 1.7233-.1657 3.4927-1.5703 3.3355-4.0863-.0683-1.0934-.6034-1.7386-1.4731-2.2348-.8278-.4722-1.8913-.7713-3.0969-1.1104-1.4563-.4096-3.1455-.8697-4.4438-1.8265-1.5561-1.1467-2.6198-2.476-2.257-4.9606Z"/>' },
46
+ firestore: { box: '0 0 24 24', body: '<path class="f" d="M19.455 8.369c-.538-.748-1.778-2.285-3.681-4.569-.826-.991-1.535-1.832-1.884-2.245a146 146 0 0 0-.488-.576l-.207-.245-.113-.133-.022-.032-.01-.005L12.57 0l-.609.488c-1.555 1.246-2.828 2.851-3.681 4.64-.523 1.064-.864 2.105-1.043 3.176-.047.241-.088.489-.121.738-.209-.017-.421-.028-.632-.033-.018-.001-.035-.002-.059-.003a7.46 7.46 0 0 0-2.28.274l-.317.089-.163.286c-.765 1.342-1.198 2.869-1.252 4.416-.07 2.01.477 3.954 1.583 5.625 1.082 1.633 2.61 2.882 4.42 3.611l.236.095.071.025.003-.001a9.59 9.59 0 0 0 2.941.568q.171.006.342.006c1.273 0 2.513-.249 3.69-.742l.008.004.313-.145a9.63 9.63 0 0 0 3.927-3.335c1.01-1.49 1.577-3.234 1.641-5.042.075-2.161-.643-4.304-2.133-6.371m-7.083 6.695c.328 1.244.264 2.44-.191 3.558-1.135-1.12-1.967-2.352-2.475-3.665-.543-1.404-.87-2.74-.974-3.975.48.157.922.366 1.315.622 1.132.737 1.914 1.902 2.325 3.461zm.207 6.022c.482.368.99.712 1.513 1.028-.771.21-1.565.302-2.369.273a8 8 0 0 1-.373-.022c.458-.394.869-.823 1.228-1.279zm1.347-6.431c-.516-1.957-1.527-3.437-3.002-4.398-.647-.421-1.385-.741-2.194-.95.011-.134.026-.268.043-.4.014-.113.03-.216.046-.313.133-.689.332-1.37.589-2.025.099-.25.206-.499.321-.74l.004-.008c.177-.358.376-.719.61-1.105l.092-.152-.003-.001c.544-.851 1.197-1.627 1.942-2.311l.288.341c.672.796 1.304 1.548 1.878 2.237 1.291 1.549 2.966 3.583 3.612 4.48 1.277 1.771 1.893 3.579 1.83 5.375-.049 1.395-.461 2.755-1.195 3.933-.694 1.116-1.661 2.05-2.8 2.708-.636-.318-1.559-.839-2.539-1.599.79-1.575.952-3.28.479-5.072zm-2.575 5.397c-.725.939-1.587 1.55-2.09 1.856-.081-.029-.163-.06-.243-.093l-.065-.026c-1.49-.616-2.747-1.656-3.635-3.01-.907-1.384-1.356-2.993-1.298-4.653.041-1.19.338-2.327.882-3.379.316-.07.638-.114.96-.131l.084-.002c.162-.003.324-.003.478 0 .227.011.454.035.677.07.073 1.513.445 3.145 1.105 4.852.637 1.644 1.694 3.162 3.144 4.515z"/>' },
47
+ };