@wirebench/engine 2.1.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 (583) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/dist/assert/contract.d.ts +3 -0
  4. package/dist/assert/contract.js +17 -0
  5. package/dist/assert/index.d.ts +4 -0
  6. package/dist/assert/index.js +27 -0
  7. package/dist/assert/match.d.ts +3 -0
  8. package/dist/assert/match.js +58 -0
  9. package/dist/assert/model.d.ts +73 -0
  10. package/dist/assert/model.js +8 -0
  11. package/dist/assert/schema.d.ts +34 -0
  12. package/dist/assert/schema.js +46 -0
  13. package/dist/assert/sla.d.ts +3 -0
  14. package/dist/assert/sla.js +8 -0
  15. package/dist/assert/soap-fault.d.ts +3 -0
  16. package/dist/assert/soap-fault.js +20 -0
  17. package/dist/assert/status.d.ts +3 -0
  18. package/dist/assert/status.js +14 -0
  19. package/dist/errors.d.ts +77 -0
  20. package/dist/errors.js +121 -0
  21. package/dist/fs.d.ts +35 -0
  22. package/dist/fs.js +64 -0
  23. package/dist/generate.d.ts +12 -0
  24. package/dist/generate.js +14 -0
  25. package/dist/grpc/browser.d.ts +11 -0
  26. package/dist/grpc/browser.js +9 -0
  27. package/dist/grpc/cache.d.ts +113 -0
  28. package/dist/grpc/cache.js +244 -0
  29. package/dist/grpc/call.d.ts +64 -0
  30. package/dist/grpc/call.js +72 -0
  31. package/dist/grpc/codec.d.ts +29 -0
  32. package/dist/grpc/codec.js +416 -0
  33. package/dist/grpc/command.d.ts +23 -0
  34. package/dist/grpc/command.js +91 -0
  35. package/dist/grpc/expand.d.ts +25 -0
  36. package/dist/grpc/expand.js +52 -0
  37. package/dist/grpc/framing.d.ts +28 -0
  38. package/dist/grpc/framing.js +61 -0
  39. package/dist/grpc/import.d.ts +47 -0
  40. package/dist/grpc/import.js +88 -0
  41. package/dist/grpc/model.d.ts +179 -0
  42. package/dist/grpc/model.js +91 -0
  43. package/dist/grpc/proto/describe.d.ts +92 -0
  44. package/dist/grpc/proto/describe.js +205 -0
  45. package/dist/grpc/proto/load.d.ts +35 -0
  46. package/dist/grpc/proto/load.js +112 -0
  47. package/dist/grpc/proto/sample.d.ts +21 -0
  48. package/dist/grpc/proto/sample.js +79 -0
  49. package/dist/grpc/proto/well-known.d.ts +42 -0
  50. package/dist/grpc/proto/well-known.js +143 -0
  51. package/dist/grpc/reconcile.d.ts +42 -0
  52. package/dist/grpc/reconcile.js +153 -0
  53. package/dist/grpc/reflection/client.d.ts +70 -0
  54. package/dist/grpc/reflection/client.js +197 -0
  55. package/dist/grpc/reflection/descriptors.d.ts +69 -0
  56. package/dist/grpc/reflection/descriptors.js +140 -0
  57. package/dist/grpc/reflection/proto.d.ts +33 -0
  58. package/dist/grpc/reflection/proto.js +144 -0
  59. package/dist/grpc/send.d.ts +132 -0
  60. package/dist/grpc/send.js +435 -0
  61. package/dist/grpc/shape.d.ts +29 -0
  62. package/dist/grpc/shape.js +36 -0
  63. package/dist/grpc/status.d.ts +21 -0
  64. package/dist/grpc/status.js +62 -0
  65. package/dist/grpc/target.d.ts +21 -0
  66. package/dist/grpc/target.js +66 -0
  67. package/dist/http/auth/apply.d.ts +37 -0
  68. package/dist/http/auth/apply.js +74 -0
  69. package/dist/http/auth/basic.d.ts +36 -0
  70. package/dist/http/auth/basic.js +69 -0
  71. package/dist/http/auth/md4.d.ts +13 -0
  72. package/dist/http/auth/md4.js +81 -0
  73. package/dist/http/auth/ntlm-transport.d.ts +61 -0
  74. package/dist/http/auth/ntlm-transport.js +97 -0
  75. package/dist/http/auth/ntlm.d.ts +190 -0
  76. package/dist/http/auth/ntlm.js +377 -0
  77. package/dist/http/client.d.ts +73 -0
  78. package/dist/http/client.js +403 -0
  79. package/dist/http/curl-flags.d.ts +15 -0
  80. package/dist/http/curl-flags.js +95 -0
  81. package/dist/http/curl.d.ts +94 -0
  82. package/dist/http/curl.js +245 -0
  83. package/dist/http/decompress.d.ts +7 -0
  84. package/dist/http/decompress.js +22 -0
  85. package/dist/http/errors.d.ts +22 -0
  86. package/dist/http/errors.js +144 -0
  87. package/dist/http/failed-request.d.ts +27 -0
  88. package/dist/http/failed-request.js +48 -0
  89. package/dist/http/headers.d.ts +15 -0
  90. package/dist/http/headers.js +50 -0
  91. package/dist/http/heredoc.d.ts +25 -0
  92. package/dist/http/heredoc.js +74 -0
  93. package/dist/http/proxy.d.ts +103 -0
  94. package/dist/http/proxy.js +168 -0
  95. package/dist/http/raw-capture.d.ts +23 -0
  96. package/dist/http/raw-capture.js +57 -0
  97. package/dist/http/timings.d.ts +79 -0
  98. package/dist/http/timings.js +212 -0
  99. package/dist/http/tls.d.ts +111 -0
  100. package/dist/http/tls.js +167 -0
  101. package/dist/http/types.d.ts +125 -0
  102. package/dist/http/types.js +6 -0
  103. package/dist/import-detect.d.ts +26 -0
  104. package/dist/import-detect.js +169 -0
  105. package/dist/import.d.ts +20 -0
  106. package/dist/import.js +163 -0
  107. package/dist/index.d.ts +272 -0
  108. package/dist/index.js +157 -0
  109. package/dist/json/cursor.d.ts +43 -0
  110. package/dist/json/cursor.js +168 -0
  111. package/dist/operations.d.ts +12 -0
  112. package/dist/operations.js +52 -0
  113. package/dist/project/attachments-cache.d.ts +80 -0
  114. package/dist/project/attachments-cache.js +186 -0
  115. package/dist/project/endpoints.d.ts +23 -0
  116. package/dist/project/endpoints.js +47 -0
  117. package/dist/project/environments.d.ts +68 -0
  118. package/dist/project/environments.js +124 -0
  119. package/dist/project/fs.d.ts +45 -0
  120. package/dist/project/fs.js +78 -0
  121. package/dist/project/history.d.ts +171 -0
  122. package/dist/project/history.js +179 -0
  123. package/dist/project/keystores.d.ts +24 -0
  124. package/dist/project/keystores.js +66 -0
  125. package/dist/project/load.d.ts +44 -0
  126. package/dist/project/load.js +634 -0
  127. package/dist/project/migrate.d.ts +27 -0
  128. package/dist/project/migrate.js +46 -0
  129. package/dist/project/model.d.ts +401 -0
  130. package/dist/project/model.js +126 -0
  131. package/dist/project/paths.d.ts +134 -0
  132. package/dist/project/paths.js +259 -0
  133. package/dist/project/preferences.d.ts +318 -0
  134. package/dist/project/preferences.js +239 -0
  135. package/dist/project/properties.d.ts +97 -0
  136. package/dist/project/properties.js +356 -0
  137. package/dist/project/save.d.ts +65 -0
  138. package/dist/project/save.js +295 -0
  139. package/dist/project/schema.d.ts +1329 -0
  140. package/dist/project/schema.js +737 -0
  141. package/dist/project/serialize.d.ts +42 -0
  142. package/dist/project/serialize.js +385 -0
  143. package/dist/project/wss-configs.d.ts +40 -0
  144. package/dist/project/wss-configs.js +142 -0
  145. package/dist/project/yaml.d.ts +17 -0
  146. package/dist/project/yaml.js +39 -0
  147. package/dist/redact/index.d.ts +77 -0
  148. package/dist/redact/index.js +328 -0
  149. package/dist/redact/literal.d.ts +12 -0
  150. package/dist/redact/literal.js +68 -0
  151. package/dist/rest/auth.d.ts +53 -0
  152. package/dist/rest/auth.js +80 -0
  153. package/dist/rest/body.d.ts +61 -0
  154. package/dist/rest/body.js +184 -0
  155. package/dist/rest/browser.d.ts +12 -0
  156. package/dist/rest/browser.js +11 -0
  157. package/dist/rest/cookies.d.ts +41 -0
  158. package/dist/rest/cookies.js +102 -0
  159. package/dist/rest/curl.d.ts +75 -0
  160. package/dist/rest/curl.js +417 -0
  161. package/dist/rest/expand.d.ts +35 -0
  162. package/dist/rest/expand.js +104 -0
  163. package/dist/rest/model.d.ts +247 -0
  164. package/dist/rest/model.js +118 -0
  165. package/dist/rest/oauth2.d.ts +118 -0
  166. package/dist/rest/oauth2.js +212 -0
  167. package/dist/rest/openapi/cache.d.ts +54 -0
  168. package/dist/rest/openapi/cache.js +128 -0
  169. package/dist/rest/openapi/import.d.ts +67 -0
  170. package/dist/rest/openapi/import.js +91 -0
  171. package/dist/rest/openapi/map.d.ts +102 -0
  172. package/dist/rest/openapi/map.js +477 -0
  173. package/dist/rest/openapi/model.d.ts +203 -0
  174. package/dist/rest/openapi/model.js +37 -0
  175. package/dist/rest/openapi/parse.d.ts +44 -0
  176. package/dist/rest/openapi/parse.js +1530 -0
  177. package/dist/rest/openapi/refs.d.ts +63 -0
  178. package/dist/rest/openapi/refs.js +258 -0
  179. package/dist/rest/openapi/sample.d.ts +68 -0
  180. package/dist/rest/openapi/sample.js +336 -0
  181. package/dist/rest/postman/import.d.ts +21 -0
  182. package/dist/rest/postman/import.js +47 -0
  183. package/dist/rest/postman/index.d.ts +7 -0
  184. package/dist/rest/postman/index.js +7 -0
  185. package/dist/rest/postman/map.d.ts +28 -0
  186. package/dist/rest/postman/map.js +427 -0
  187. package/dist/rest/postman/model.d.ts +118 -0
  188. package/dist/rest/postman/model.js +7 -0
  189. package/dist/rest/postman/parse.d.ts +29 -0
  190. package/dist/rest/postman/parse.js +518 -0
  191. package/dist/rest/response.d.ts +72 -0
  192. package/dist/rest/response.js +221 -0
  193. package/dist/rest/send.d.ts +102 -0
  194. package/dist/rest/send.js +148 -0
  195. package/dist/rest/url.d.ts +92 -0
  196. package/dist/rest/url.js +213 -0
  197. package/dist/run/effective-auth.d.ts +10 -0
  198. package/dist/run/effective-auth.js +19 -0
  199. package/dist/run/index.d.ts +8 -0
  200. package/dist/run/index.js +4 -0
  201. package/dist/run/prepare.d.ts +43 -0
  202. package/dist/run/prepare.js +280 -0
  203. package/dist/run/run.d.ts +53 -0
  204. package/dist/run/run.js +223 -0
  205. package/dist/run/secret-needs.d.ts +13 -0
  206. package/dist/run/secret-needs.js +125 -0
  207. package/dist/run/select.d.ts +34 -0
  208. package/dist/run/select.js +76 -0
  209. package/dist/secrets/env-names.d.ts +27 -0
  210. package/dist/secrets/env-names.js +40 -0
  211. package/dist/secrets/resolve.d.ts +58 -0
  212. package/dist/secrets/resolve.js +136 -0
  213. package/dist/send-options.d.ts +141 -0
  214. package/dist/send-options.js +228 -0
  215. package/dist/send.d.ts +53 -0
  216. package/dist/send.js +210 -0
  217. package/dist/soap/body-builder.d.ts +38 -0
  218. package/dist/soap/body-builder.js +250 -0
  219. package/dist/soap/build-problems.d.ts +12 -0
  220. package/dist/soap/build-problems.js +2 -0
  221. package/dist/soap/charset.d.ts +23 -0
  222. package/dist/soap/charset.js +47 -0
  223. package/dist/soap/envelope.d.ts +44 -0
  224. package/dist/soap/envelope.js +76 -0
  225. package/dist/soap/fault.d.ts +46 -0
  226. package/dist/soap/fault.js +129 -0
  227. package/dist/soap/form-request.d.ts +34 -0
  228. package/dist/soap/form-request.js +251 -0
  229. package/dist/soap/legacy-project/definition-fetcher.d.ts +21 -0
  230. package/dist/soap/legacy-project/definition-fetcher.js +43 -0
  231. package/dist/soap/legacy-project/format.d.ts +18 -0
  232. package/dist/soap/legacy-project/format.js +24 -0
  233. package/dist/soap/legacy-project/import.d.ts +21 -0
  234. package/dist/soap/legacy-project/import.js +46 -0
  235. package/dist/soap/legacy-project/index.d.ts +9 -0
  236. package/dist/soap/legacy-project/index.js +5 -0
  237. package/dist/soap/legacy-project/map.d.ts +91 -0
  238. package/dist/soap/legacy-project/map.js +290 -0
  239. package/dist/soap/legacy-project/model.d.ts +98 -0
  240. package/dist/soap/legacy-project/model.js +5 -0
  241. package/dist/soap/legacy-project/parse.d.ts +16 -0
  242. package/dist/soap/legacy-project/parse.js +325 -0
  243. package/dist/soap/mime/cid-scan.d.ts +36 -0
  244. package/dist/soap/mime/cid-scan.js +52 -0
  245. package/dist/soap/mime/inline-files.d.ts +39 -0
  246. package/dist/soap/mime/inline-files.js +71 -0
  247. package/dist/soap/mime/mtom.d.ts +74 -0
  248. package/dist/soap/mime/mtom.js +134 -0
  249. package/dist/soap/mime/multipart.d.ts +66 -0
  250. package/dist/soap/mime/multipart.js +329 -0
  251. package/dist/soap/mime/send-pipeline.d.ts +61 -0
  252. package/dist/soap/mime/send-pipeline.js +145 -0
  253. package/dist/soap/mime/swa.d.ts +45 -0
  254. package/dist/soap/mime/swa.js +62 -0
  255. package/dist/soap/mime/types.d.ts +69 -0
  256. package/dist/soap/mime/types.js +10 -0
  257. package/dist/soap/namespace-scope.d.ts +32 -0
  258. package/dist/soap/namespace-scope.js +85 -0
  259. package/dist/soap/prefixes.d.ts +24 -0
  260. package/dist/soap/prefixes.js +70 -0
  261. package/dist/soap/recreate.d.ts +28 -0
  262. package/dist/soap/recreate.js +168 -0
  263. package/dist/soap/request-builder.d.ts +63 -0
  264. package/dist/soap/request-builder.js +161 -0
  265. package/dist/soap/response-parser.d.ts +29 -0
  266. package/dist/soap/response-parser.js +71 -0
  267. package/dist/soap/soap-action.d.ts +31 -0
  268. package/dist/soap/soap-action.js +28 -0
  269. package/dist/soap/transforms.d.ts +52 -0
  270. package/dist/soap/transforms.js +164 -0
  271. package/dist/types.d.ts +307 -0
  272. package/dist/types.js +6 -0
  273. package/dist/validate/index.d.ts +61 -0
  274. package/dist/validate/index.js +72 -0
  275. package/dist/validate/schema-file-set.d.ts +51 -0
  276. package/dist/validate/schema-file-set.js +288 -0
  277. package/dist/validate/schema-validator.d.ts +53 -0
  278. package/dist/validate/schema-validator.js +251 -0
  279. package/dist/validate/soap-structure.d.ts +34 -0
  280. package/dist/validate/soap-structure.js +255 -0
  281. package/dist/validate/types.d.ts +47 -0
  282. package/dist/validate/types.js +8 -0
  283. package/dist/validate/wsi/assertions/helpers.d.ts +145 -0
  284. package/dist/validate/wsi/assertions/helpers.js +387 -0
  285. package/dist/validate/wsi/assertions/index.d.ts +44 -0
  286. package/dist/validate/wsi/assertions/index.js +77 -0
  287. package/dist/validate/wsi/assertions/message/helpers.d.ts +63 -0
  288. package/dist/validate/wsi/assertions/message/helpers.js +168 -0
  289. package/dist/validate/wsi/assertions/message/index.d.ts +39 -0
  290. package/dist/validate/wsi/assertions/message/index.js +62 -0
  291. package/dist/validate/wsi/assertions/message/r1001.d.ts +10 -0
  292. package/dist/validate/wsi/assertions/message/r1001.js +38 -0
  293. package/dist/validate/wsi/assertions/message/r1003.d.ts +14 -0
  294. package/dist/validate/wsi/assertions/message/r1003.js +45 -0
  295. package/dist/validate/wsi/assertions/message/r1005.d.ts +12 -0
  296. package/dist/validate/wsi/assertions/message/r1005.js +37 -0
  297. package/dist/validate/wsi/assertions/message/r1006.d.ts +10 -0
  298. package/dist/validate/wsi/assertions/message/r1006.js +49 -0
  299. package/dist/validate/wsi/assertions/message/r1007.d.ts +10 -0
  300. package/dist/validate/wsi/assertions/message/r1007.js +30 -0
  301. package/dist/validate/wsi/assertions/message/r1011.d.ts +10 -0
  302. package/dist/validate/wsi/assertions/message/r1011.js +33 -0
  303. package/dist/validate/wsi/assertions/message/r1012.d.ts +13 -0
  304. package/dist/validate/wsi/assertions/message/r1012.js +37 -0
  305. package/dist/validate/wsi/assertions/message/r1013.d.ts +9 -0
  306. package/dist/validate/wsi/assertions/message/r1013.js +42 -0
  307. package/dist/validate/wsi/assertions/message/r1014.d.ts +10 -0
  308. package/dist/validate/wsi/assertions/message/r1014.js +30 -0
  309. package/dist/validate/wsi/assertions/message/r1015.d.ts +12 -0
  310. package/dist/validate/wsi/assertions/message/r1015.js +36 -0
  311. package/dist/validate/wsi/assertions/message/r1017.d.ts +10 -0
  312. package/dist/validate/wsi/assertions/message/r1017.js +30 -0
  313. package/dist/validate/wsi/assertions/message/r1100.d.ts +10 -0
  314. package/dist/validate/wsi/assertions/message/r1100.js +39 -0
  315. package/dist/validate/wsi/assertions/message/r1101.d.ts +10 -0
  316. package/dist/validate/wsi/assertions/message/r1101.js +37 -0
  317. package/dist/validate/wsi/assertions/message/r1102.d.ts +10 -0
  318. package/dist/validate/wsi/assertions/message/r1102.js +41 -0
  319. package/dist/validate/wsi/assertions/message/r1103.d.ts +10 -0
  320. package/dist/validate/wsi/assertions/message/r1103.js +28 -0
  321. package/dist/validate/wsi/assertions/message/r1107.d.ts +10 -0
  322. package/dist/validate/wsi/assertions/message/r1107.js +38 -0
  323. package/dist/validate/wsi/assertions/message/r1109.d.ts +10 -0
  324. package/dist/validate/wsi/assertions/message/r1109.js +32 -0
  325. package/dist/validate/wsi/assertions/message/r1124.d.ts +10 -0
  326. package/dist/validate/wsi/assertions/message/r1124.js +31 -0
  327. package/dist/validate/wsi/assertions/message/r1132.d.ts +9 -0
  328. package/dist/validate/wsi/assertions/message/r1132.js +23 -0
  329. package/dist/validate/wsi/assertions/message/r1140.d.ts +10 -0
  330. package/dist/validate/wsi/assertions/message/r1140.js +42 -0
  331. package/dist/validate/wsi/assertions/message/r1141.d.ts +10 -0
  332. package/dist/validate/wsi/assertions/message/r1141.js +32 -0
  333. package/dist/validate/wsi/assertions/message/r2113.d.ts +11 -0
  334. package/dist/validate/wsi/assertions/message/r2113.js +33 -0
  335. package/dist/validate/wsi/assertions/message/r2211.d.ts +7 -0
  336. package/dist/validate/wsi/assertions/message/r2211.js +42 -0
  337. package/dist/validate/wsi/assertions/r2001.d.ts +15 -0
  338. package/dist/validate/wsi/assertions/r2001.js +47 -0
  339. package/dist/validate/wsi/assertions/r2002.d.ts +11 -0
  340. package/dist/validate/wsi/assertions/r2002.js +38 -0
  341. package/dist/validate/wsi/assertions/r2003.d.ts +7 -0
  342. package/dist/validate/wsi/assertions/r2003.js +32 -0
  343. package/dist/validate/wsi/assertions/r2005.d.ts +7 -0
  344. package/dist/validate/wsi/assertions/r2005.js +40 -0
  345. package/dist/validate/wsi/assertions/r2101.d.ts +14 -0
  346. package/dist/validate/wsi/assertions/r2101.js +65 -0
  347. package/dist/validate/wsi/assertions/r2102.d.ts +10 -0
  348. package/dist/validate/wsi/assertions/r2102.js +41 -0
  349. package/dist/validate/wsi/assertions/r2105.d.ts +8 -0
  350. package/dist/validate/wsi/assertions/r2105.js +39 -0
  351. package/dist/validate/wsi/assertions/r2110.d.ts +8 -0
  352. package/dist/validate/wsi/assertions/r2110.js +38 -0
  353. package/dist/validate/wsi/assertions/r2111.d.ts +6 -0
  354. package/dist/validate/wsi/assertions/r2111.js +30 -0
  355. package/dist/validate/wsi/assertions/r2112.d.ts +7 -0
  356. package/dist/validate/wsi/assertions/r2112.js +35 -0
  357. package/dist/validate/wsi/assertions/r2201.d.ts +7 -0
  358. package/dist/validate/wsi/assertions/r2201.js +28 -0
  359. package/dist/validate/wsi/assertions/r2203.d.ts +7 -0
  360. package/dist/validate/wsi/assertions/r2203.js +30 -0
  361. package/dist/validate/wsi/assertions/r2204.d.ts +6 -0
  362. package/dist/validate/wsi/assertions/r2204.js +29 -0
  363. package/dist/validate/wsi/assertions/r2205.d.ts +8 -0
  364. package/dist/validate/wsi/assertions/r2205.js +46 -0
  365. package/dist/validate/wsi/assertions/r2206.d.ts +7 -0
  366. package/dist/validate/wsi/assertions/r2206.js +36 -0
  367. package/dist/validate/wsi/assertions/r2209.d.ts +12 -0
  368. package/dist/validate/wsi/assertions/r2209.js +37 -0
  369. package/dist/validate/wsi/assertions/r2210.d.ts +7 -0
  370. package/dist/validate/wsi/assertions/r2210.js +30 -0
  371. package/dist/validate/wsi/assertions/r2303.d.ts +7 -0
  372. package/dist/validate/wsi/assertions/r2303.js +44 -0
  373. package/dist/validate/wsi/assertions/r2304.d.ts +6 -0
  374. package/dist/validate/wsi/assertions/r2304.js +32 -0
  375. package/dist/validate/wsi/assertions/r2401.d.ts +12 -0
  376. package/dist/validate/wsi/assertions/r2401.js +31 -0
  377. package/dist/validate/wsi/assertions/r2701.d.ts +7 -0
  378. package/dist/validate/wsi/assertions/r2701.js +28 -0
  379. package/dist/validate/wsi/assertions/r2702.d.ts +6 -0
  380. package/dist/validate/wsi/assertions/r2702.js +26 -0
  381. package/dist/validate/wsi/assertions/r2705.d.ts +11 -0
  382. package/dist/validate/wsi/assertions/r2705.js +31 -0
  383. package/dist/validate/wsi/assertions/r2706.d.ts +7 -0
  384. package/dist/validate/wsi/assertions/r2706.js +29 -0
  385. package/dist/validate/wsi/assertions/r2710.d.ts +13 -0
  386. package/dist/validate/wsi/assertions/r2710.js +37 -0
  387. package/dist/validate/wsi/assertions/r2716.d.ts +7 -0
  388. package/dist/validate/wsi/assertions/r2716.js +29 -0
  389. package/dist/validate/wsi/assertions/r2717.d.ts +9 -0
  390. package/dist/validate/wsi/assertions/r2717.js +31 -0
  391. package/dist/validate/wsi/assertions/r2718.d.ts +7 -0
  392. package/dist/validate/wsi/assertions/r2718.js +41 -0
  393. package/dist/validate/wsi/assertions/r2720.d.ts +7 -0
  394. package/dist/validate/wsi/assertions/r2720.js +29 -0
  395. package/dist/validate/wsi/assertions/r2721.d.ts +6 -0
  396. package/dist/validate/wsi/assertions/r2721.js +27 -0
  397. package/dist/validate/wsi/assertions/r2722.d.ts +6 -0
  398. package/dist/validate/wsi/assertions/r2722.js +29 -0
  399. package/dist/validate/wsi/assertions/r2801.d.ts +7 -0
  400. package/dist/validate/wsi/assertions/r2801.js +39 -0
  401. package/dist/validate/wsi/assertions/r2803.d.ts +7 -0
  402. package/dist/validate/wsi/assertions/r2803.js +29 -0
  403. package/dist/validate/wsi/docs.d.ts +29 -0
  404. package/dist/validate/wsi/docs.js +167 -0
  405. package/dist/validate/wsi/index.d.ts +16 -0
  406. package/dist/validate/wsi/index.js +11 -0
  407. package/dist/validate/wsi/report-html.d.ts +36 -0
  408. package/dist/validate/wsi/report-html.js +135 -0
  409. package/dist/validate/wsi/run-message.d.ts +50 -0
  410. package/dist/validate/wsi/run-message.js +190 -0
  411. package/dist/validate/wsi/run-wsdl.d.ts +48 -0
  412. package/dist/validate/wsi/run-wsdl.js +99 -0
  413. package/dist/validate/wsi/types.d.ts +173 -0
  414. package/dist/validate/wsi/types.js +17 -0
  415. package/dist/workspace/commit-message.d.ts +47 -0
  416. package/dist/workspace/commit-message.js +195 -0
  417. package/dist/workspace/environments.d.ts +79 -0
  418. package/dist/workspace/environments.js +115 -0
  419. package/dist/workspace/index.d.ts +28 -0
  420. package/dist/workspace/index.js +19 -0
  421. package/dist/workspace/load.d.ts +45 -0
  422. package/dist/workspace/load.js +155 -0
  423. package/dist/workspace/local-state.d.ts +37 -0
  424. package/dist/workspace/local-state.js +59 -0
  425. package/dist/workspace/migrate.d.ts +38 -0
  426. package/dist/workspace/migrate.js +50 -0
  427. package/dist/workspace/model.d.ts +86 -0
  428. package/dist/workspace/model.js +54 -0
  429. package/dist/workspace/paths.d.ts +64 -0
  430. package/dist/workspace/paths.js +97 -0
  431. package/dist/workspace/reidentify.d.ts +22 -0
  432. package/dist/workspace/reidentify.js +122 -0
  433. package/dist/workspace/save.d.ts +31 -0
  434. package/dist/workspace/save.js +84 -0
  435. package/dist/workspace/schema.d.ts +93 -0
  436. package/dist/workspace/schema.js +115 -0
  437. package/dist/workspace/serialize.d.ts +24 -0
  438. package/dist/workspace/serialize.js +60 -0
  439. package/dist/workspace/share.d.ts +52 -0
  440. package/dist/workspace/share.js +89 -0
  441. package/dist/ws/browser.d.ts +13 -0
  442. package/dist/ws/browser.js +11 -0
  443. package/dist/ws/call.d.ts +53 -0
  444. package/dist/ws/call.js +106 -0
  445. package/dist/ws/command.d.ts +19 -0
  446. package/dist/ws/command.js +28 -0
  447. package/dist/ws/expand.d.ts +38 -0
  448. package/dist/ws/expand.js +76 -0
  449. package/dist/ws/model.d.ts +191 -0
  450. package/dist/ws/model.js +83 -0
  451. package/dist/ws/pretty.d.ts +12 -0
  452. package/dist/ws/pretty.js +25 -0
  453. package/dist/ws/session.d.ts +50 -0
  454. package/dist/ws/session.js +333 -0
  455. package/dist/ws/shape.d.ts +18 -0
  456. package/dist/ws/shape.js +28 -0
  457. package/dist/ws/transcript.d.ts +14 -0
  458. package/dist/ws/transcript.js +29 -0
  459. package/dist/ws/url.d.ts +3 -0
  460. package/dist/ws/url.js +44 -0
  461. package/dist/wsa/headers.d.ts +78 -0
  462. package/dist/wsa/headers.js +244 -0
  463. package/dist/wsa/model.d.ts +66 -0
  464. package/dist/wsa/model.js +52 -0
  465. package/dist/wsa/policy-detect.d.ts +81 -0
  466. package/dist/wsa/policy-detect.js +245 -0
  467. package/dist/wsdl/cache-naming.d.ts +39 -0
  468. package/dist/wsdl/cache-naming.js +90 -0
  469. package/dist/wsdl/cache.d.ts +48 -0
  470. package/dist/wsdl/cache.js +141 -0
  471. package/dist/wsdl/docs-generator.d.ts +47 -0
  472. package/dist/wsdl/docs-generator.js +439 -0
  473. package/dist/wsdl/dom-utils.d.ts +15 -0
  474. package/dist/wsdl/dom-utils.js +50 -0
  475. package/dist/wsdl/export-definition.d.ts +38 -0
  476. package/dist/wsdl/export-definition.js +100 -0
  477. package/dist/wsdl/fetch.d.ts +13 -0
  478. package/dist/wsdl/fetch.js +60 -0
  479. package/dist/wsdl/merge.d.ts +17 -0
  480. package/dist/wsdl/merge.js +57 -0
  481. package/dist/wsdl/model.d.ts +176 -0
  482. package/dist/wsdl/model.js +17 -0
  483. package/dist/wsdl/parse-binding.d.ts +6 -0
  484. package/dist/wsdl/parse-binding.js +150 -0
  485. package/dist/wsdl/parse-wsdl.d.ts +47 -0
  486. package/dist/wsdl/parse-wsdl.js +161 -0
  487. package/dist/wsdl/qname.d.ts +28 -0
  488. package/dist/wsdl/qname.js +41 -0
  489. package/dist/wsdl/ref-policy.d.ts +54 -0
  490. package/dist/wsdl/ref-policy.js +87 -0
  491. package/dist/wsdl/resolver.d.ts +81 -0
  492. package/dist/wsdl/resolver.js +276 -0
  493. package/dist/wsdl/update-definition.d.ts +106 -0
  494. package/dist/wsdl/update-definition.js +314 -0
  495. package/dist/wss/apply.d.ts +40 -0
  496. package/dist/wss/apply.js +212 -0
  497. package/dist/wss/c14n-prefixes.d.ts +27 -0
  498. package/dist/wss/c14n-prefixes.js +95 -0
  499. package/dist/wss/incoming/decrypt.d.ts +35 -0
  500. package/dist/wss/incoming/decrypt.js +57 -0
  501. package/dist/wss/incoming/index.d.ts +56 -0
  502. package/dist/wss/incoming/index.js +189 -0
  503. package/dist/wss/incoming/verify.d.ts +74 -0
  504. package/dist/wss/incoming/verify.js +440 -0
  505. package/dist/wss/key-identifiers.d.ts +76 -0
  506. package/dist/wss/key-identifiers.js +139 -0
  507. package/dist/wss/keystore/certificate.d.ts +45 -0
  508. package/dist/wss/keystore/certificate.js +134 -0
  509. package/dist/wss/keystore/index.d.ts +50 -0
  510. package/dist/wss/keystore/index.js +80 -0
  511. package/dist/wss/keystore/model.d.ts +83 -0
  512. package/dist/wss/keystore/model.js +27 -0
  513. package/dist/wss/keystore/pem.d.ts +21 -0
  514. package/dist/wss/keystore/pem.js +140 -0
  515. package/dist/wss/keystore/pkcs12.d.ts +21 -0
  516. package/dist/wss/keystore/pkcs12.js +125 -0
  517. package/dist/wss/model.d.ts +160 -0
  518. package/dist/wss/model.js +37 -0
  519. package/dist/wss/outgoing/encryption.d.ts +76 -0
  520. package/dist/wss/outgoing/encryption.js +618 -0
  521. package/dist/wss/outgoing/signature.d.ts +73 -0
  522. package/dist/wss/outgoing/signature.js +239 -0
  523. package/dist/wss/outgoing/timestamp.d.ts +29 -0
  524. package/dist/wss/outgoing/timestamp.js +39 -0
  525. package/dist/wss/outgoing/username-token.d.ts +36 -0
  526. package/dist/wss/outgoing/username-token.js +68 -0
  527. package/dist/wss/security-header.d.ts +31 -0
  528. package/dist/wss/security-header.js +83 -0
  529. package/dist/xml/index.d.ts +7 -0
  530. package/dist/xml/index.js +7 -0
  531. package/dist/xml/namespaces.d.ts +36 -0
  532. package/dist/xml/namespaces.js +60 -0
  533. package/dist/xml/parse.d.ts +79 -0
  534. package/dist/xml/parse.js +109 -0
  535. package/dist/xml/positions.d.ts +26 -0
  536. package/dist/xml/positions.js +71 -0
  537. package/dist/xml/pretty.d.ts +37 -0
  538. package/dist/xml/pretty.js +137 -0
  539. package/dist/xml/serialize.d.ts +6 -0
  540. package/dist/xml/serialize.js +8 -0
  541. package/dist/xml/tolerant-tree.d.ts +56 -0
  542. package/dist/xml/tolerant-tree.js +134 -0
  543. package/dist/xpath/evaluate-async.d.ts +31 -0
  544. package/dist/xpath/evaluate-async.js +81 -0
  545. package/dist/xpath/evaluate.d.ts +98 -0
  546. package/dist/xpath/evaluate.js +340 -0
  547. package/dist/xpath/jsonpath.d.ts +40 -0
  548. package/dist/xpath/jsonpath.js +109 -0
  549. package/dist/xpath/namespaces.d.ts +29 -0
  550. package/dist/xpath/namespaces.js +101 -0
  551. package/dist/xpath/worker.d.ts +7 -0
  552. package/dist/xpath/worker.js +26 -0
  553. package/dist/xsd/builtins.d.ts +36 -0
  554. package/dist/xsd/builtins.js +108 -0
  555. package/dist/xsd/check-references.d.ts +25 -0
  556. package/dist/xsd/check-references.js +145 -0
  557. package/dist/xsd/form-edits.d.ts +57 -0
  558. package/dist/xsd/form-edits.js +153 -0
  559. package/dist/xsd/form-model.d.ts +153 -0
  560. package/dist/xsd/form-model.js +691 -0
  561. package/dist/xsd/locate.d.ts +42 -0
  562. package/dist/xsd/locate.js +249 -0
  563. package/dist/xsd/model.d.ts +249 -0
  564. package/dist/xsd/model.js +1 -0
  565. package/dist/xsd/parse-particles.d.ts +48 -0
  566. package/dist/xsd/parse-particles.js +320 -0
  567. package/dist/xsd/parse-schema.d.ts +21 -0
  568. package/dist/xsd/parse-schema.js +143 -0
  569. package/dist/xsd/resolve-content.d.ts +18 -0
  570. package/dist/xsd/resolve-content.js +242 -0
  571. package/dist/xsd/sample-generator.d.ts +51 -0
  572. package/dist/xsd/sample-generator.js +291 -0
  573. package/dist/xsd/sample-types.d.ts +21 -0
  574. package/dist/xsd/sample-types.js +69 -0
  575. package/dist/xsd/sample-values.d.ts +54 -0
  576. package/dist/xsd/sample-values.js +267 -0
  577. package/dist/xsd/schema-set.d.ts +51 -0
  578. package/dist/xsd/schema-set.js +203 -0
  579. package/dist/xsd/xml-scan.d.ts +64 -0
  580. package/dist/xsd/xml-scan.js +286 -0
  581. package/dist/xsd/xml-writer.d.ts +56 -0
  582. package/dist/xsd/xml-writer.js +103 -0
  583. package/package.json +69 -0
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Turns a {@link Project} into the exact set of files it occupies on disk.
3
+ *
4
+ * Keeping this pure (project in, `relative path -> file content` out) means the
5
+ * saver only has to diff two maps, and tests can assert on the layout without
6
+ * touching a file system.
7
+ */
8
+ import type { AuthConfig, Project, WssRef } from './model.js';
9
+ /** A project's files, keyed by path relative to the project root (always `/`-separated). */
10
+ export type ProjectFiles = ReadonlyMap<string, string>;
11
+ /** Relative path of the manifest. */
12
+ export declare const MANIFEST_PATH = "wirebench.yaml";
13
+ /** Relative path of the keystore registry. */
14
+ export declare const KEYSTORES_PATH = "wss/keystores.yaml";
15
+ /**
16
+ * One authentication configuration as written: its own fields only, in the schema's spelling,
17
+ * with absent optionals and an empty scope list dropped. Every scheme's secret is a reference,
18
+ * so there is nothing here to redact — the values live in the keychain (ADR-0004).
19
+ */
20
+ export declare function authDocument(auth: AuthConfig): Record<string, unknown>;
21
+ /**
22
+ * Relative path of a WS-Security configuration file.
23
+ *
24
+ * @throws ProjectError `project-path-invalid` when `ref.file` is not a
25
+ * relative path rooted at `wss/` with only safe segments.
26
+ */
27
+ export declare function wssRefPath(direction: 'outgoing' | 'incoming', ref: WssRef): string;
28
+ /** Options for {@link projectFiles}. */
29
+ export interface ProjectFilesOptions {
30
+ /** Recorded in the manifest as `writtenBy`. Defaults to `'wirebench'`. */
31
+ readonly writer?: string;
32
+ }
33
+ /**
34
+ * Builds the complete `relative path -> content` map for a project.
35
+ *
36
+ * Every slug is validated with {@link assertPathSegment} (and every
37
+ * `WssRef.file` with {@link assertWssRelativePath}) before any path is built,
38
+ * so a corrupted slug or an unvalidated file reference throws
39
+ * `ProjectError('project-path-invalid')` here — before `saveProject` ever
40
+ * touches the file system.
41
+ */
42
+ export declare function projectFiles(project: Project, options?: ProjectFilesOptions): ProjectFiles;
@@ -0,0 +1,385 @@
1
+ /**
2
+ * Turns a {@link Project} into the exact set of files it occupies on disk.
3
+ *
4
+ * Keeping this pure (project in, `relative path -> file content` out) means the
5
+ * saver only has to diff two maps, and tests can assert on the layout without
6
+ * touching a file system.
7
+ */
8
+ import { ProjectError } from '../errors.js';
9
+ import { wsMessageFileName } from '../ws/model.js';
10
+ import { RAW_LANGUAGE_EXTENSIONS } from '../rest/model.js';
11
+ import { API_FILE, APIS_DIR, assertPathSegment, assertWssRelativePath, ENVIRONMENTS_DIR, FOLDER_FILE, INTERFACES_DIR, MAX_FOLDER_DEPTH, OPERATIONS_DIR, REQUEST_SUFFIX, REQUESTS_DIR, restBodyFileName, WSS_DIR, slugify, } from './paths.js';
12
+ import { compact, stringifyYaml } from './yaml.js';
13
+ /** Relative path of the manifest. */
14
+ export const MANIFEST_PATH = 'wirebench.yaml';
15
+ /** Relative path of the keystore registry. */
16
+ export const KEYSTORES_PATH = `${WSS_DIR}/keystores.yaml`;
17
+ /**
18
+ * The `disabled` list as written: sorted, deduplicated, and dropped entirely once it would be
19
+ * empty — a name with no entry left in `properties` never outlives its map, so it is filtered
20
+ * out here rather than merely sorted.
21
+ */
22
+ function disabledList(disabled, properties) {
23
+ const known = new Set(Object.keys(properties));
24
+ const kept = [...new Set(disabled.filter((name) => known.has(name)))].sort();
25
+ return kept.length > 0 ? kept : undefined;
26
+ }
27
+ /**
28
+ * One authentication configuration as written: its own fields only, in the schema's spelling,
29
+ * with absent optionals and an empty scope list dropped. Every scheme's secret is a reference,
30
+ * so there is nothing here to redact — the values live in the keychain (ADR-0004).
31
+ */
32
+ export function authDocument(auth) {
33
+ if (auth.type === 'oauth2') {
34
+ return compact({ ...auth, scopes: auth.scopes.length > 0 ? [...auth.scopes] : undefined });
35
+ }
36
+ return compact({ ...auth });
37
+ }
38
+ function requestDocument(request) {
39
+ return compact({
40
+ kind: request.kind,
41
+ id: request.id,
42
+ name: request.name,
43
+ order: request.order,
44
+ description: request.description,
45
+ endpointId: request.endpointId,
46
+ endpointUrl: request.endpointUrl,
47
+ soapVersion: request.soapVersion,
48
+ soapAction: request.soapAction,
49
+ headers: request.headers.map((h) => ({ name: h.name, value: h.value })),
50
+ attachments: request.attachments.map((a) => compact({ ...a })),
51
+ auth: request.auth === undefined ? undefined : authDocument(request.auth),
52
+ wsa: request.wsa === undefined ? undefined : compact({ ...request.wsa }),
53
+ wssOutgoingRef: request.wssOutgoingRef,
54
+ wssIncomingRef: request.wssIncomingRef,
55
+ properties: compact({ ...request.properties }),
56
+ assertions: request.assertions.length > 0 ? request.assertions.map((a) => compact({ ...a })) : undefined,
57
+ orphaned: request.orphaned === true ? true : undefined,
58
+ });
59
+ }
60
+ function interfaceDocument(iface) {
61
+ return compact({
62
+ kind: iface.kind,
63
+ id: iface.id,
64
+ name: iface.name,
65
+ order: iface.order,
66
+ definitionUrl: iface.definitionUrl,
67
+ cacheDefinition: iface.cacheDefinition,
68
+ targetNamespace: iface.targetNamespace,
69
+ endpoints: iface.endpoints.map((e) => compact({ ...e, auth: e.auth === undefined ? undefined : authDocument(e.auth) })),
70
+ defaultEndpointId: iface.defaultEndpointId,
71
+ wsa: compact({ ...iface.wsa }),
72
+ auth: iface.auth === undefined ? undefined : authDocument(iface.auth),
73
+ operations: iface.operations.map((op) => ({
74
+ name: op.name,
75
+ bindingName: op.bindingName,
76
+ slug: op.slug,
77
+ order: op.order,
78
+ })),
79
+ });
80
+ }
81
+ /** One table row as written: `enabled` only when `false`, so a file stays quiet about the default. */
82
+ function keyValueDocuments(rows) {
83
+ return rows.map((row) => compact({
84
+ name: row.name,
85
+ value: row.value,
86
+ enabled: row.enabled ? undefined : false,
87
+ description: row.description,
88
+ }));
89
+ }
90
+ /**
91
+ * A body as written, plus the sibling file a raw body needs.
92
+ *
93
+ * The text of a raw body is deliberately *not* in the request document: it goes to
94
+ * `<slug>.body.<ext>` beside it, so a JSON payload is a JSON file in git — reviewable, searchable
95
+ * and mergeable — rather than a quoted blob inside YAML.
96
+ */
97
+ function bodyDocument(body, requestSlug) {
98
+ switch (body.kind) {
99
+ case 'raw': {
100
+ const name = restBodyFileName(requestSlug, RAW_LANGUAGE_EXTENSIONS[body.language]);
101
+ assertPathSegment(name);
102
+ return {
103
+ document: compact({ kind: 'raw', language: body.language, contentType: body.contentType, file: name }),
104
+ file: [name, body.text],
105
+ };
106
+ }
107
+ case 'form':
108
+ return { document: { kind: 'form', fields: keyValueDocuments(body.fields) } };
109
+ case 'multipart':
110
+ return {
111
+ document: {
112
+ kind: 'multipart',
113
+ parts: body.parts.map((part) => compact({ ...part, enabled: part.enabled ? undefined : false })),
114
+ },
115
+ };
116
+ case 'binary':
117
+ return { document: { kind: 'binary', source: { ...body.source }, contentType: body.contentType } };
118
+ default:
119
+ return { document: { kind: 'none' } };
120
+ }
121
+ }
122
+ function restRequestDocument(request) {
123
+ const body = bodyDocument(request.body, request.slug);
124
+ return compact({
125
+ kind: request.kind,
126
+ id: request.id,
127
+ name: request.name,
128
+ order: request.order,
129
+ description: request.description,
130
+ method: request.method,
131
+ url: request.url,
132
+ pathParams: request.pathParams.length > 0 ? keyValueDocuments(request.pathParams) : undefined,
133
+ query: request.query.length > 0 ? keyValueDocuments(request.query) : undefined,
134
+ headers: request.headers.length > 0 ? keyValueDocuments(request.headers) : undefined,
135
+ body: body.document,
136
+ auth: authDocument(request.auth),
137
+ settings: Object.keys(request.settings).length > 0 ? compact({ ...request.settings }) : undefined,
138
+ assertions: request.assertions.length > 0 ? request.assertions.map((a) => compact({ ...a })) : undefined,
139
+ orphaned: request.orphaned === true ? true : undefined,
140
+ });
141
+ }
142
+ const writeRestRequest = (files, dir, request) => {
143
+ const body = bodyDocument(request.body, request.slug);
144
+ files.set(`${dir}/${request.slug}${REQUEST_SUFFIX}`, stringifyYaml(restRequestDocument(request)));
145
+ if (body.file !== undefined) {
146
+ files.set(`${dir}/${body.file[0]}`, body.file[1]);
147
+ }
148
+ };
149
+ /**
150
+ * A gRPC request as written: the message text goes to `<slug>.body.json` beside the document, the
151
+ * same convention as a REST raw body, so a message is a JSON file in git.
152
+ */
153
+ const writeGrpcRequest = (files, dir, request) => {
154
+ const messageFile = restBodyFileName(request.slug, 'json');
155
+ assertPathSegment(messageFile);
156
+ files.set(`${dir}/${request.slug}${REQUEST_SUFFIX}`, stringifyYaml(compact({
157
+ kind: request.kind,
158
+ id: request.id,
159
+ name: request.name,
160
+ order: request.order,
161
+ description: request.description,
162
+ service: request.service,
163
+ method: request.method,
164
+ methodKind: request.methodKind,
165
+ metadata: request.metadata.length > 0 ? keyValueDocuments(request.metadata) : undefined,
166
+ message: messageFile,
167
+ auth: authDocument(request.auth),
168
+ settings: Object.keys(request.settings).length > 0 ? compact({ ...request.settings }) : undefined,
169
+ orphaned: request.orphaned === true ? true : undefined,
170
+ })));
171
+ files.set(`${dir}/${messageFile}`, request.message);
172
+ };
173
+ /**
174
+ * A WebSocket request as written: each saved message goes to a sibling file, so a JSON message is a
175
+ * JSON file in git. Siblings rather than a directory, because every directory here loads as a folder.
176
+ *
177
+ * @throws ProjectError `duplicate-slug` when two of the request's messages share a slug.
178
+ */
179
+ const writeWsRequest = (files, dir, request) => {
180
+ const messages = request.messages.map((message) => {
181
+ const file = wsMessageFileName(request.slug, message);
182
+ assertPathSegment(file);
183
+ if (files.has(`${dir}/${file}`)) {
184
+ throw new ProjectError('duplicate-slug', `Request "${request.name}" has two messages named "${message.slug}"`, {
185
+ details: { file: `${dir}/${file}` },
186
+ });
187
+ }
188
+ files.set(`${dir}/${file}`, message.content);
189
+ return compact({
190
+ id: message.id,
191
+ name: message.name,
192
+ format: message.format === 'binary' ? 'binary' : undefined,
193
+ file,
194
+ });
195
+ });
196
+ files.set(`${dir}/${request.slug}${REQUEST_SUFFIX}`, stringifyYaml(compact({
197
+ kind: request.kind,
198
+ id: request.id,
199
+ name: request.name,
200
+ order: request.order,
201
+ description: request.description,
202
+ url: request.url,
203
+ query: request.query.length > 0 ? keyValueDocuments(request.query) : undefined,
204
+ headers: request.headers.length > 0 ? keyValueDocuments(request.headers) : undefined,
205
+ subprotocols: request.subprotocols.length > 0 ? [...request.subprotocols] : undefined,
206
+ auth: authDocument(request.auth),
207
+ settings: Object.keys(request.settings).length > 0 ? compact({ ...request.settings }) : undefined,
208
+ messages: messages.length > 0 ? messages : undefined,
209
+ })));
210
+ };
211
+ /**
212
+ * Adds one folder's own file, its requests (and their body files) and, recursively, the folders
213
+ * below it.
214
+ *
215
+ * @throws ProjectError `project-path-invalid` for an unsafe slug, `project-folder-too-deep` for a
216
+ * tree deeper than {@link MAX_FOLDER_DEPTH} — before any path is built, never after.
217
+ */
218
+ function addFolderFiles(files, dir, node, depth, writeRequest) {
219
+ for (const request of node.requests) {
220
+ assertPathSegment(request.slug);
221
+ writeRequest(files, dir, request);
222
+ }
223
+ for (const folder of node.folders) {
224
+ assertPathSegment(folder.slug);
225
+ if (depth + 1 > MAX_FOLDER_DEPTH) {
226
+ throw new ProjectError('project-folder-too-deep', `Folder "${folder.name}" would nest more than ${String(MAX_FOLDER_DEPTH)} deep`, { details: { folder: folder.slug, depth: depth + 1, max: MAX_FOLDER_DEPTH } });
227
+ }
228
+ const childDir = `${dir}/${folder.slug}`;
229
+ files.set(`${childDir}/${FOLDER_FILE}`, stringifyYaml(compact({
230
+ id: folder.id,
231
+ name: folder.name,
232
+ order: folder.order,
233
+ description: folder.description,
234
+ auth: folder.auth === undefined ? undefined : authDocument(folder.auth),
235
+ })));
236
+ addFolderFiles(files, childDir, folder, depth + 1, writeRequest);
237
+ }
238
+ }
239
+ /** Every file one REST API occupies, keyed by path relative to the project root. */
240
+ function addApiFiles(files, api) {
241
+ assertPathSegment(api.slug);
242
+ const base = `${APIS_DIR}/${api.slug}`;
243
+ files.set(`${base}/${API_FILE}`, stringifyYaml(compact({
244
+ kind: api.kind,
245
+ id: api.id,
246
+ name: api.name,
247
+ order: api.order,
248
+ description: api.description,
249
+ baseUrl: api.baseUrl,
250
+ servers: api.servers.length > 0 ? api.servers.map((server) => compact({ ...server })) : undefined,
251
+ auth: api.auth === undefined ? undefined : authDocument(api.auth),
252
+ definition: api.definition === undefined ? undefined : compact({ ...api.definition }),
253
+ })));
254
+ addFolderFiles(files, `${base}/${REQUESTS_DIR}`, api, 0, writeRestRequest);
255
+ }
256
+ /** Every file one gRPC API occupies. It shares `apis/` with the REST ones; its `kind` says which it is. */
257
+ function addGrpcApiFiles(files, api) {
258
+ assertPathSegment(api.slug);
259
+ const base = `${APIS_DIR}/${api.slug}`;
260
+ files.set(`${base}/${API_FILE}`, stringifyYaml(compact({
261
+ kind: api.kind,
262
+ id: api.id,
263
+ name: api.name,
264
+ order: api.order,
265
+ description: api.description,
266
+ target: api.target,
267
+ tls: api.tls,
268
+ metadata: api.metadata.length > 0 ? keyValueDocuments(api.metadata) : undefined,
269
+ auth: api.auth === undefined ? undefined : authDocument(api.auth),
270
+ definition: api.definition === undefined
271
+ ? undefined
272
+ : compact({
273
+ kind: api.definition.kind,
274
+ source: api.definition.source,
275
+ cache: api.definition.cache,
276
+ roots: [...api.definition.roots],
277
+ reflectionVersion: api.definition.reflectionVersion,
278
+ trustInvalid: api.definition.trustInvalid,
279
+ }),
280
+ })));
281
+ addFolderFiles(files, `${base}/${REQUESTS_DIR}`, api, 0, writeGrpcRequest);
282
+ }
283
+ /** Every file one WebSocket API occupies. It shares `apis/` with the others; its `kind` says which it is. */
284
+ function addWsApiFiles(files, api) {
285
+ assertPathSegment(api.slug);
286
+ const base = `${APIS_DIR}/${api.slug}`;
287
+ files.set(`${base}/${API_FILE}`, stringifyYaml(compact({
288
+ kind: api.kind,
289
+ id: api.id,
290
+ name: api.name,
291
+ order: api.order,
292
+ description: api.description,
293
+ url: api.url,
294
+ headers: api.headers.length > 0 ? keyValueDocuments(api.headers) : undefined,
295
+ auth: api.auth === undefined ? undefined : authDocument(api.auth),
296
+ definition: api.definition === undefined ? undefined : compact({ ...api.definition }),
297
+ })));
298
+ addFolderFiles(files, `${base}/${REQUESTS_DIR}`, api, 0, writeWsRequest);
299
+ }
300
+ function wssDocument(ref) {
301
+ return stringifyYaml(ref.document);
302
+ }
303
+ /**
304
+ * Relative path of a WS-Security configuration file.
305
+ *
306
+ * @throws ProjectError `project-path-invalid` when `ref.file` is not a
307
+ * relative path rooted at `wss/` with only safe segments.
308
+ */
309
+ export function wssRefPath(direction, ref) {
310
+ if (ref.file !== undefined) {
311
+ assertWssRelativePath(ref.file);
312
+ return ref.file;
313
+ }
314
+ return `${WSS_DIR}/${direction}/${slugify(ref.name)}.yaml`;
315
+ }
316
+ /**
317
+ * Builds the complete `relative path -> content` map for a project.
318
+ *
319
+ * Every slug is validated with {@link assertPathSegment} (and every
320
+ * `WssRef.file` with {@link assertWssRelativePath}) before any path is built,
321
+ * so a corrupted slug or an unvalidated file reference throws
322
+ * `ProjectError('project-path-invalid')` here — before `saveProject` ever
323
+ * touches the file system.
324
+ */
325
+ export function projectFiles(project, options) {
326
+ const files = new Map();
327
+ const writer = options?.writer ?? 'wirebench';
328
+ files.set(MANIFEST_PATH, stringifyYaml(compact({
329
+ formatVersion: project.formatVersion,
330
+ id: project.id,
331
+ name: project.name,
332
+ description: project.description,
333
+ settings: compact({ ...project.settings }),
334
+ properties: { ...project.properties },
335
+ disabled: disabledList(project.disabledProperties, project.properties),
336
+ activeEnvironmentId: project.activeEnvironmentId,
337
+ writtenBy: writer,
338
+ })));
339
+ for (const environment of project.environments) {
340
+ assertPathSegment(environment.slug);
341
+ files.set(`${ENVIRONMENTS_DIR}/${environment.slug}.yaml`, stringifyYaml(compact({
342
+ id: environment.id,
343
+ name: environment.name,
344
+ order: environment.order,
345
+ endpoints: { ...environment.endpoints },
346
+ properties: { ...environment.properties },
347
+ disabled: disabledList(environment.disabledProperties, environment.properties),
348
+ })));
349
+ }
350
+ for (const iface of project.interfaces) {
351
+ assertPathSegment(iface.slug);
352
+ const base = `${INTERFACES_DIR}/${iface.slug}`;
353
+ files.set(`${base}/interface.yaml`, stringifyYaml(interfaceDocument(iface)));
354
+ for (const operation of iface.operations) {
355
+ assertPathSegment(operation.slug);
356
+ const dir = `${base}/${OPERATIONS_DIR}/${operation.slug}`;
357
+ for (const request of operation.requests) {
358
+ assertPathSegment(request.slug);
359
+ files.set(`${dir}/${request.slug}${REQUEST_SUFFIX}`, stringifyYaml(requestDocument(request)));
360
+ files.set(`${dir}/${request.slug}.xml`, request.envelopeXml);
361
+ }
362
+ }
363
+ }
364
+ for (const api of project.apis) {
365
+ addApiFiles(files, api);
366
+ }
367
+ for (const api of project.grpcApis) {
368
+ addGrpcApiFiles(files, api);
369
+ }
370
+ for (const api of project.wsApis) {
371
+ addWsApiFiles(files, api);
372
+ }
373
+ for (const [direction, refs] of [
374
+ ['outgoing', project.wss.outgoing],
375
+ ['incoming', project.wss.incoming],
376
+ ]) {
377
+ for (const ref of refs) {
378
+ files.set(wssRefPath(direction, ref), wssDocument(ref));
379
+ }
380
+ }
381
+ if (project.wss.keystores.length > 0) {
382
+ files.set(KEYSTORES_PATH, stringifyYaml({ keystores: project.wss.keystores.map((k) => k.document) }));
383
+ }
384
+ return files;
385
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The bridge between the project model's loose `WssRef` (which round-trips a
3
+ * `wss/{outgoing,incoming}/<id>.yaml` document verbatim, so a field written by a later build
4
+ * survives) and the typed configurations the WS-Security code takes — the same shape as
5
+ * `project/keystores.ts` does for the keystore registry.
6
+ */
7
+ import type { WssRef } from './model.js';
8
+ import type { WssIncomingConfig, WssOutgoingConfig } from '../wss/model.js';
9
+ /**
10
+ * Reads one outgoing configuration out of its `WssRef`.
11
+ *
12
+ * @param ref the `Project.wss.outgoing` entry
13
+ * @returns the typed configuration
14
+ * @throws ProjectError `wss-config-invalid` when the stored document is not one
15
+ */
16
+ export declare function toWssOutgoingConfig(ref: WssRef): WssOutgoingConfig;
17
+ /**
18
+ * The `WssRef` that stores `config`, preserving any unknown fields the existing document had.
19
+ *
20
+ * @param config the configuration to persist
21
+ * @param existing the ref being replaced, when this is an update
22
+ * @returns the ref to put into `Project.wss.outgoing`
23
+ */
24
+ export declare function toWssOutgoingRef(config: WssOutgoingConfig, existing?: WssRef): WssRef;
25
+ /**
26
+ * Reads one incoming configuration out of its `WssRef`.
27
+ *
28
+ * @param ref the `Project.wss.incoming` entry
29
+ * @returns the typed configuration
30
+ * @throws ProjectError `wss-config-invalid` when the stored document is not one
31
+ */
32
+ export declare function toWssIncomingConfig(ref: WssRef): WssIncomingConfig;
33
+ /**
34
+ * The `WssRef` that stores `config`, preserving any unknown fields the existing document had.
35
+ *
36
+ * @param config the configuration to persist
37
+ * @param existing the ref being replaced, when this is an update
38
+ * @returns the ref to put into `Project.wss.incoming`
39
+ */
40
+ export declare function toWssIncomingRef(config: WssIncomingConfig, existing?: WssRef): WssRef;
@@ -0,0 +1,142 @@
1
+ /**
2
+ * The bridge between the project model's loose `WssRef` (which round-trips a
3
+ * `wss/{outgoing,incoming}/<id>.yaml` document verbatim, so a field written by a later build
4
+ * survives) and the typed configurations the WS-Security code takes — the same shape as
5
+ * `project/keystores.ts` does for the keystore registry.
6
+ */
7
+ import { ProjectError } from '../errors.js';
8
+ import { wssEntrySchema, wssIncomingFileSchema, wssOutgoingFileSchema } from './schema.js';
9
+ import { DEFAULT_WSS_TIMESTAMP_SKEW_SECONDS } from '../wss/model.js';
10
+ /**
11
+ * One stored entry as a typed {@link WssEntry}. An entry this build does not understand (a
12
+ * signature written by a later build, say) is carried through verbatim rather than dropped;
13
+ * applying it then fails loudly with `wss-entry-unsupported` instead of silently doing nothing.
14
+ */
15
+ function toWssEntry(entry) {
16
+ const parsed = wssEntrySchema.safeParse(entry);
17
+ if (parsed.success) {
18
+ return parsed.data;
19
+ }
20
+ const kind = entry['kind'];
21
+ return { ...entry, kind: typeof kind === 'string' ? kind : 'unknown' };
22
+ }
23
+ /**
24
+ * Reads one outgoing configuration out of its `WssRef`.
25
+ *
26
+ * @param ref the `Project.wss.outgoing` entry
27
+ * @returns the typed configuration
28
+ * @throws ProjectError `wss-config-invalid` when the stored document is not one
29
+ */
30
+ export function toWssOutgoingConfig(ref) {
31
+ const parsed = wssOutgoingFileSchema.safeParse(ref.document);
32
+ if (!parsed.success) {
33
+ throw new ProjectError('wss-config-invalid', `Outgoing WS-Security configuration "${ref.name}" is invalid.`, {
34
+ details: { id: ref.id, issues: parsed.error.issues.map((issue) => issue.message) },
35
+ });
36
+ }
37
+ const document = parsed.data;
38
+ return {
39
+ id: document.id,
40
+ name: document.name,
41
+ ...(document.defaultAlias !== undefined ? { defaultAlias: document.defaultAlias } : {}),
42
+ ...(document.defaultPasswordRef !== undefined ? { defaultPasswordRef: document.defaultPasswordRef } : {}),
43
+ ...(document.actor !== undefined ? { actor: document.actor } : {}),
44
+ mustUnderstand: document.mustUnderstand ?? false,
45
+ entries: (document.entries ?? []).map(toWssEntry),
46
+ };
47
+ }
48
+ /**
49
+ * The `WssRef` that stores `config`, preserving any unknown fields the existing document had.
50
+ *
51
+ * @param config the configuration to persist
52
+ * @param existing the ref being replaced, when this is an update
53
+ * @returns the ref to put into `Project.wss.outgoing`
54
+ */
55
+ export function toWssOutgoingRef(config, existing) {
56
+ const document = { ...existing?.document };
57
+ document['id'] = config.id;
58
+ document['name'] = config.name;
59
+ document['mustUnderstand'] = config.mustUnderstand;
60
+ document['entries'] = config.entries;
61
+ for (const [key, value] of [
62
+ ['defaultAlias', config.defaultAlias],
63
+ ['defaultPasswordRef', config.defaultPasswordRef],
64
+ ['actor', config.actor],
65
+ ]) {
66
+ if (value === undefined) {
67
+ delete document[key];
68
+ }
69
+ else {
70
+ document[key] = value;
71
+ }
72
+ }
73
+ return {
74
+ id: config.id,
75
+ name: config.name,
76
+ ...(existing?.file !== undefined ? { file: existing.file } : {}),
77
+ document,
78
+ };
79
+ }
80
+ /**
81
+ * Reads one incoming configuration out of its `WssRef`.
82
+ *
83
+ * @param ref the `Project.wss.incoming` entry
84
+ * @returns the typed configuration
85
+ * @throws ProjectError `wss-config-invalid` when the stored document is not one
86
+ */
87
+ export function toWssIncomingConfig(ref) {
88
+ const parsed = wssIncomingFileSchema.safeParse(ref.document);
89
+ if (!parsed.success) {
90
+ throw new ProjectError('wss-config-invalid', `Incoming WS-Security configuration "${ref.name}" is invalid.`, {
91
+ details: { id: ref.id },
92
+ });
93
+ }
94
+ const document = parsed.data;
95
+ return {
96
+ id: document.id,
97
+ name: document.name,
98
+ ...(document.decryptKeystoreRef !== undefined ? { decryptKeystoreRef: document.decryptKeystoreRef } : {}),
99
+ ...(document.decryptAlias !== undefined ? { decryptAlias: document.decryptAlias } : {}),
100
+ ...(document.decryptKeyPasswordRef !== undefined ? { decryptKeyPasswordRef: document.decryptKeyPasswordRef } : {}),
101
+ ...(document.signatureKeystoreRef !== undefined ? { signatureKeystoreRef: document.signatureKeystoreRef } : {}),
102
+ requireSignature: document.requireSignature ?? false,
103
+ requireTimestamp: document.requireTimestamp ?? false,
104
+ timestampSkewSeconds: document.timestampSkewSeconds ?? DEFAULT_WSS_TIMESTAMP_SKEW_SECONDS,
105
+ verifyChain: document.verifyChain ?? true,
106
+ };
107
+ }
108
+ /**
109
+ * The `WssRef` that stores `config`, preserving any unknown fields the existing document had.
110
+ *
111
+ * @param config the configuration to persist
112
+ * @param existing the ref being replaced, when this is an update
113
+ * @returns the ref to put into `Project.wss.incoming`
114
+ */
115
+ export function toWssIncomingRef(config, existing) {
116
+ const document = { ...existing?.document };
117
+ document['id'] = config.id;
118
+ document['name'] = config.name;
119
+ document['requireSignature'] = config.requireSignature;
120
+ document['requireTimestamp'] = config.requireTimestamp;
121
+ document['timestampSkewSeconds'] = config.timestampSkewSeconds;
122
+ document['verifyChain'] = config.verifyChain;
123
+ for (const [key, value] of [
124
+ ['decryptKeystoreRef', config.decryptKeystoreRef],
125
+ ['decryptAlias', config.decryptAlias],
126
+ ['decryptKeyPasswordRef', config.decryptKeyPasswordRef],
127
+ ['signatureKeystoreRef', config.signatureKeystoreRef],
128
+ ]) {
129
+ if (value === undefined) {
130
+ delete document[key];
131
+ }
132
+ else {
133
+ document[key] = value;
134
+ }
135
+ }
136
+ return {
137
+ id: config.id,
138
+ name: config.name,
139
+ ...(existing?.file !== undefined ? { file: existing.file } : {}),
140
+ document,
141
+ };
142
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * YAML (de)serialisation tuned for git-friendly project files: keys sorted so
3
+ * the byte order is a function of the data alone, and no line wrapping so a
4
+ * long URL stays on one line and diffs stay readable.
5
+ */
6
+ /** Serialises a value to YAML with stable key order and unwrapped scalars. */
7
+ export declare function stringifyYaml(value: unknown): string;
8
+ /**
9
+ * Parses YAML text, raising `ProjectError('project-file-invalid')` with the
10
+ * offending file path when the document is malformed.
11
+ */
12
+ export declare function parseYaml(text: string, file: string): unknown;
13
+ /**
14
+ * Drops `undefined` entries (and empty optional containers) so optional model
15
+ * fields never surface as `key: null` in the YAML.
16
+ */
17
+ export declare function compact<T extends Record<string, unknown>>(value: T): Record<string, unknown>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * YAML (de)serialisation tuned for git-friendly project files: keys sorted so
3
+ * the byte order is a function of the data alone, and no line wrapping so a
4
+ * long URL stays on one line and diffs stay readable.
5
+ */
6
+ import { parse as parseYamlDocument, stringify as stringifyYamlDocument } from 'yaml';
7
+ import { ProjectError } from '../errors.js';
8
+ /** Serialises a value to YAML with stable key order and unwrapped scalars. */
9
+ export function stringifyYaml(value) {
10
+ return stringifyYamlDocument(value, { sortMapEntries: true, lineWidth: 0 });
11
+ }
12
+ /**
13
+ * Parses YAML text, raising `ProjectError('project-file-invalid')` with the
14
+ * offending file path when the document is malformed.
15
+ */
16
+ export function parseYaml(text, file) {
17
+ try {
18
+ return parseYamlDocument(text);
19
+ }
20
+ catch (error) {
21
+ throw new ProjectError('project-file-invalid', `Malformed YAML in ${file}`, {
22
+ details: { file, issues: [{ path: '', message: error instanceof Error ? error.message : String(error) }] },
23
+ cause: error,
24
+ });
25
+ }
26
+ }
27
+ /**
28
+ * Drops `undefined` entries (and empty optional containers) so optional model
29
+ * fields never surface as `key: null` in the YAML.
30
+ */
31
+ export function compact(value) {
32
+ const out = {};
33
+ for (const [key, entry] of Object.entries(value)) {
34
+ if (entry !== undefined) {
35
+ out[key] = entry;
36
+ }
37
+ }
38
+ return out;
39
+ }