@inluxc/propmaster 0.0.0-stage → 1.0.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 (444) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +696 -2
  3. package/dist/src/annotations/index.d.ts +11 -0
  4. package/dist/src/annotations/index.d.ts.map +1 -0
  5. package/dist/src/annotations/index.js +11 -0
  6. package/dist/src/annotations/index.js.map +1 -0
  7. package/dist/src/annotations/recorder.d.ts +57 -0
  8. package/dist/src/annotations/recorder.d.ts.map +1 -0
  9. package/dist/src/annotations/recorder.js +100 -0
  10. package/dist/src/annotations/recorder.js.map +1 -0
  11. package/dist/src/annotations/truncation.d.ts +34 -0
  12. package/dist/src/annotations/truncation.d.ts.map +1 -0
  13. package/dist/src/annotations/truncation.js +54 -0
  14. package/dist/src/annotations/truncation.js.map +1 -0
  15. package/dist/src/auth/apply.d.ts +15 -0
  16. package/dist/src/auth/apply.d.ts.map +1 -0
  17. package/dist/src/auth/apply.js +21 -0
  18. package/dist/src/auth/apply.js.map +1 -0
  19. package/dist/src/auth/setup.d.ts +56 -0
  20. package/dist/src/auth/setup.d.ts.map +1 -0
  21. package/dist/src/auth/setup.js +79 -0
  22. package/dist/src/auth/setup.js.map +1 -0
  23. package/dist/src/auth/state-file.d.ts +8 -0
  24. package/dist/src/auth/state-file.d.ts.map +1 -0
  25. package/dist/src/auth/state-file.js +13 -0
  26. package/dist/src/auth/state-file.js.map +1 -0
  27. package/dist/src/auth/token-manager.d.ts +61 -0
  28. package/dist/src/auth/token-manager.d.ts.map +1 -0
  29. package/dist/src/auth/token-manager.js +200 -0
  30. package/dist/src/auth/token-manager.js.map +1 -0
  31. package/dist/src/cli/banner.d.ts +23 -0
  32. package/dist/src/cli/banner.d.ts.map +1 -0
  33. package/dist/src/cli/banner.js +67 -0
  34. package/dist/src/cli/banner.js.map +1 -0
  35. package/dist/src/cli/check-tests.d.ts +143 -0
  36. package/dist/src/cli/check-tests.d.ts.map +1 -0
  37. package/dist/src/cli/check-tests.js +541 -0
  38. package/dist/src/cli/check-tests.js.map +1 -0
  39. package/dist/src/cli/coverage.d.ts +14 -0
  40. package/dist/src/cli/coverage.d.ts.map +1 -0
  41. package/dist/src/cli/coverage.js +97 -0
  42. package/dist/src/cli/coverage.js.map +1 -0
  43. package/dist/src/cli/doctor.d.ts +82 -0
  44. package/dist/src/cli/doctor.d.ts.map +1 -0
  45. package/dist/src/cli/doctor.js +656 -0
  46. package/dist/src/cli/doctor.js.map +1 -0
  47. package/dist/src/cli/env.d.ts +76 -0
  48. package/dist/src/cli/env.d.ts.map +1 -0
  49. package/dist/src/cli/env.js +344 -0
  50. package/dist/src/cli/env.js.map +1 -0
  51. package/dist/src/cli/failures.d.ts +29 -0
  52. package/dist/src/cli/failures.d.ts.map +1 -0
  53. package/dist/src/cli/failures.js +114 -0
  54. package/dist/src/cli/failures.js.map +1 -0
  55. package/dist/src/cli/fixture-catalog.d.ts +83 -0
  56. package/dist/src/cli/fixture-catalog.d.ts.map +1 -0
  57. package/dist/src/cli/fixture-catalog.js +773 -0
  58. package/dist/src/cli/fixture-catalog.js.map +1 -0
  59. package/dist/src/cli/fixture.d.ts +149 -0
  60. package/dist/src/cli/fixture.d.ts.map +1 -0
  61. package/dist/src/cli/fixture.js +742 -0
  62. package/dist/src/cli/fixture.js.map +1 -0
  63. package/dist/src/cli/flaky.d.ts +25 -0
  64. package/dist/src/cli/flaky.d.ts.map +1 -0
  65. package/dist/src/cli/flaky.js +96 -0
  66. package/dist/src/cli/flaky.js.map +1 -0
  67. package/dist/src/cli/generate.d.ts +37 -0
  68. package/dist/src/cli/generate.d.ts.map +1 -0
  69. package/dist/src/cli/generate.js +230 -0
  70. package/dist/src/cli/generate.js.map +1 -0
  71. package/dist/src/cli/init.d.ts +36 -0
  72. package/dist/src/cli/init.d.ts.map +1 -0
  73. package/dist/src/cli/init.js +1039 -0
  74. package/dist/src/cli/init.js.map +1 -0
  75. package/dist/src/cli/json-edit.d.ts +58 -0
  76. package/dist/src/cli/json-edit.d.ts.map +1 -0
  77. package/dist/src/cli/json-edit.js +250 -0
  78. package/dist/src/cli/json-edit.js.map +1 -0
  79. package/dist/src/cli/layout.d.ts +31 -0
  80. package/dist/src/cli/layout.d.ts.map +1 -0
  81. package/dist/src/cli/layout.js +175 -0
  82. package/dist/src/cli/layout.js.map +1 -0
  83. package/dist/src/cli/mcp-setup.d.ts +141 -0
  84. package/dist/src/cli/mcp-setup.d.ts.map +1 -0
  85. package/dist/src/cli/mcp-setup.js +548 -0
  86. package/dist/src/cli/mcp-setup.js.map +1 -0
  87. package/dist/src/cli/organize.d.ts +136 -0
  88. package/dist/src/cli/organize.d.ts.map +1 -0
  89. package/dist/src/cli/organize.js +467 -0
  90. package/dist/src/cli/organize.js.map +1 -0
  91. package/dist/src/cli/prompts.d.ts +102 -0
  92. package/dist/src/cli/prompts.d.ts.map +1 -0
  93. package/dist/src/cli/prompts.js +346 -0
  94. package/dist/src/cli/prompts.js.map +1 -0
  95. package/dist/src/cli/standards.d.ts +160 -0
  96. package/dist/src/cli/standards.d.ts.map +1 -0
  97. package/dist/src/cli/standards.js +389 -0
  98. package/dist/src/cli/standards.js.map +1 -0
  99. package/dist/src/cli/style.d.ts +28 -0
  100. package/dist/src/cli/style.d.ts.map +1 -0
  101. package/dist/src/cli/style.js +57 -0
  102. package/dist/src/cli/style.js.map +1 -0
  103. package/dist/src/config/env-loader.d.ts +33 -0
  104. package/dist/src/config/env-loader.d.ts.map +1 -0
  105. package/dist/src/config/env-loader.js +72 -0
  106. package/dist/src/config/env-loader.js.map +1 -0
  107. package/dist/src/config/index.d.ts +10 -0
  108. package/dist/src/config/index.d.ts.map +1 -0
  109. package/dist/src/config/index.js +10 -0
  110. package/dist/src/config/index.js.map +1 -0
  111. package/dist/src/config/loader.d.ts +66 -0
  112. package/dist/src/config/loader.d.ts.map +1 -0
  113. package/dist/src/config/loader.js +810 -0
  114. package/dist/src/config/loader.js.map +1 -0
  115. package/dist/src/config/schema.d.ts +596 -0
  116. package/dist/src/config/schema.d.ts.map +1 -0
  117. package/dist/src/config/schema.js +9 -0
  118. package/dist/src/config/schema.js.map +1 -0
  119. package/dist/src/containers/container-manager.d.ts +157 -0
  120. package/dist/src/containers/container-manager.d.ts.map +1 -0
  121. package/dist/src/containers/container-manager.js +627 -0
  122. package/dist/src/containers/container-manager.js.map +1 -0
  123. package/dist/src/coverage/code-coverage.d.ts +89 -0
  124. package/dist/src/coverage/code-coverage.d.ts.map +1 -0
  125. package/dist/src/coverage/code-coverage.js +395 -0
  126. package/dist/src/coverage/code-coverage.js.map +1 -0
  127. package/dist/src/coverage/inventory.d.ts +80 -0
  128. package/dist/src/coverage/inventory.d.ts.map +1 -0
  129. package/dist/src/coverage/inventory.js +417 -0
  130. package/dist/src/coverage/inventory.js.map +1 -0
  131. package/dist/src/coverage/languages.d.ts +34 -0
  132. package/dist/src/coverage/languages.d.ts.map +1 -0
  133. package/dist/src/coverage/languages.js +156 -0
  134. package/dist/src/coverage/languages.js.map +1 -0
  135. package/dist/src/coverage/report.d.ts +128 -0
  136. package/dist/src/coverage/report.d.ts.map +1 -0
  137. package/dist/src/coverage/report.js +472 -0
  138. package/dist/src/coverage/report.js.map +1 -0
  139. package/dist/src/errors.d.ts +164 -0
  140. package/dist/src/errors.d.ts.map +1 -0
  141. package/dist/src/errors.js +267 -0
  142. package/dist/src/errors.js.map +1 -0
  143. package/dist/src/fixtures/amqp.fixture.d.ts +163 -0
  144. package/dist/src/fixtures/amqp.fixture.d.ts.map +1 -0
  145. package/dist/src/fixtures/amqp.fixture.js +494 -0
  146. package/dist/src/fixtures/amqp.fixture.js.map +1 -0
  147. package/dist/src/fixtures/appium.fixture.d.ts +112 -0
  148. package/dist/src/fixtures/appium.fixture.d.ts.map +1 -0
  149. package/dist/src/fixtures/appium.fixture.js +309 -0
  150. package/dist/src/fixtures/appium.fixture.js.map +1 -0
  151. package/dist/src/fixtures/aws.d.ts +44 -0
  152. package/dist/src/fixtures/aws.d.ts.map +1 -0
  153. package/dist/src/fixtures/aws.js +93 -0
  154. package/dist/src/fixtures/aws.js.map +1 -0
  155. package/dist/src/fixtures/cassandra.fixture.d.ts +179 -0
  156. package/dist/src/fixtures/cassandra.fixture.d.ts.map +1 -0
  157. package/dist/src/fixtures/cassandra.fixture.js +489 -0
  158. package/dist/src/fixtures/cassandra.fixture.js.map +1 -0
  159. package/dist/src/fixtures/clickhouse.fixture.d.ts +171 -0
  160. package/dist/src/fixtures/clickhouse.fixture.d.ts.map +1 -0
  161. package/dist/src/fixtures/clickhouse.fixture.js +514 -0
  162. package/dist/src/fixtures/clickhouse.fixture.js.map +1 -0
  163. package/dist/src/fixtures/database.fixture.d.ts +63 -0
  164. package/dist/src/fixtures/database.fixture.d.ts.map +1 -0
  165. package/dist/src/fixtures/database.fixture.js +407 -0
  166. package/dist/src/fixtures/database.fixture.js.map +1 -0
  167. package/dist/src/fixtures/dynamodb.fixture.d.ts +243 -0
  168. package/dist/src/fixtures/dynamodb.fixture.d.ts.map +1 -0
  169. package/dist/src/fixtures/dynamodb.fixture.js +580 -0
  170. package/dist/src/fixtures/dynamodb.fixture.js.map +1 -0
  171. package/dist/src/fixtures/graphql.fixture.d.ts +107 -0
  172. package/dist/src/fixtures/graphql.fixture.d.ts.map +1 -0
  173. package/dist/src/fixtures/graphql.fixture.js +158 -0
  174. package/dist/src/fixtures/graphql.fixture.js.map +1 -0
  175. package/dist/src/fixtures/grpc.fixture.d.ts +167 -0
  176. package/dist/src/fixtures/grpc.fixture.d.ts.map +1 -0
  177. package/dist/src/fixtures/grpc.fixture.js +635 -0
  178. package/dist/src/fixtures/grpc.fixture.js.map +1 -0
  179. package/dist/src/fixtures/inbox.fixture.d.ts +136 -0
  180. package/dist/src/fixtures/inbox.fixture.d.ts.map +1 -0
  181. package/dist/src/fixtures/inbox.fixture.js +239 -0
  182. package/dist/src/fixtures/inbox.fixture.js.map +1 -0
  183. package/dist/src/fixtures/index.d.ts +174 -0
  184. package/dist/src/fixtures/index.d.ts.map +1 -0
  185. package/dist/src/fixtures/index.js +379 -0
  186. package/dist/src/fixtures/index.js.map +1 -0
  187. package/dist/src/fixtures/kafka-driver.d.ts +108 -0
  188. package/dist/src/fixtures/kafka-driver.d.ts.map +1 -0
  189. package/dist/src/fixtures/kafka-driver.js +113 -0
  190. package/dist/src/fixtures/kafka-driver.js.map +1 -0
  191. package/dist/src/fixtures/kafka.fixture.d.ts +75 -0
  192. package/dist/src/fixtures/kafka.fixture.d.ts.map +1 -0
  193. package/dist/src/fixtures/kafka.fixture.js +188 -0
  194. package/dist/src/fixtures/kafka.fixture.js.map +1 -0
  195. package/dist/src/fixtures/mock-server.fixture.d.ts +142 -0
  196. package/dist/src/fixtures/mock-server.fixture.d.ts.map +1 -0
  197. package/dist/src/fixtures/mock-server.fixture.js +271 -0
  198. package/dist/src/fixtures/mock-server.fixture.js.map +1 -0
  199. package/dist/src/fixtures/mongodb.fixture.d.ts +121 -0
  200. package/dist/src/fixtures/mongodb.fixture.d.ts.map +1 -0
  201. package/dist/src/fixtures/mongodb.fixture.js +258 -0
  202. package/dist/src/fixtures/mongodb.fixture.js.map +1 -0
  203. package/dist/src/fixtures/neo4j.fixture.d.ts +72 -0
  204. package/dist/src/fixtures/neo4j.fixture.d.ts.map +1 -0
  205. package/dist/src/fixtures/neo4j.fixture.js +202 -0
  206. package/dist/src/fixtures/neo4j.fixture.js.map +1 -0
  207. package/dist/src/fixtures/openapi.fixture.d.ts +101 -0
  208. package/dist/src/fixtures/openapi.fixture.d.ts.map +1 -0
  209. package/dist/src/fixtures/openapi.fixture.js +266 -0
  210. package/dist/src/fixtures/openapi.fixture.js.map +1 -0
  211. package/dist/src/fixtures/optional-package.d.ts +54 -0
  212. package/dist/src/fixtures/optional-package.d.ts.map +1 -0
  213. package/dist/src/fixtures/optional-package.js +79 -0
  214. package/dist/src/fixtures/optional-package.js.map +1 -0
  215. package/dist/src/fixtures/otp.fixture.d.ts +60 -0
  216. package/dist/src/fixtures/otp.fixture.d.ts.map +1 -0
  217. package/dist/src/fixtures/otp.fixture.js +101 -0
  218. package/dist/src/fixtures/otp.fixture.js.map +1 -0
  219. package/dist/src/fixtures/realtime.fixture.d.ts +205 -0
  220. package/dist/src/fixtures/realtime.fixture.d.ts.map +1 -0
  221. package/dist/src/fixtures/realtime.fixture.js +606 -0
  222. package/dist/src/fixtures/realtime.fixture.js.map +1 -0
  223. package/dist/src/fixtures/redis.fixture.d.ts +55 -0
  224. package/dist/src/fixtures/redis.fixture.d.ts.map +1 -0
  225. package/dist/src/fixtures/redis.fixture.js +209 -0
  226. package/dist/src/fixtures/redis.fixture.js.map +1 -0
  227. package/dist/src/fixtures/s3.fixture.d.ts +126 -0
  228. package/dist/src/fixtures/s3.fixture.d.ts.map +1 -0
  229. package/dist/src/fixtures/s3.fixture.js +296 -0
  230. package/dist/src/fixtures/s3.fixture.js.map +1 -0
  231. package/dist/src/fixtures/search.fixture.d.ts +178 -0
  232. package/dist/src/fixtures/search.fixture.d.ts.map +1 -0
  233. package/dist/src/fixtures/search.fixture.js +472 -0
  234. package/dist/src/fixtures/search.fixture.js.map +1 -0
  235. package/dist/src/fixtures/sqs.fixture.d.ts +172 -0
  236. package/dist/src/fixtures/sqs.fixture.d.ts.map +1 -0
  237. package/dist/src/fixtures/sqs.fixture.js +428 -0
  238. package/dist/src/fixtures/sqs.fixture.js.map +1 -0
  239. package/dist/src/index.d.ts +43 -0
  240. package/dist/src/index.d.ts.map +1 -0
  241. package/dist/src/index.js +48 -0
  242. package/dist/src/index.js.map +1 -0
  243. package/dist/src/mcp/guards.d.ts +21 -0
  244. package/dist/src/mcp/guards.d.ts.map +1 -0
  245. package/dist/src/mcp/guards.js +118 -0
  246. package/dist/src/mcp/guards.js.map +1 -0
  247. package/dist/src/mcp/project-tools.d.ts +14 -0
  248. package/dist/src/mcp/project-tools.d.ts.map +1 -0
  249. package/dist/src/mcp/project-tools.js +252 -0
  250. package/dist/src/mcp/project-tools.js.map +1 -0
  251. package/dist/src/mcp/protocol.d.ts +116 -0
  252. package/dist/src/mcp/protocol.d.ts.map +1 -0
  253. package/dist/src/mcp/protocol.js +199 -0
  254. package/dist/src/mcp/protocol.js.map +1 -0
  255. package/dist/src/mcp/server.d.ts +43 -0
  256. package/dist/src/mcp/server.d.ts.map +1 -0
  257. package/dist/src/mcp/server.js +244 -0
  258. package/dist/src/mcp/server.js.map +1 -0
  259. package/dist/src/mcp/test-tools.d.ts +65 -0
  260. package/dist/src/mcp/test-tools.d.ts.map +1 -0
  261. package/dist/src/mcp/test-tools.js +380 -0
  262. package/dist/src/mcp/test-tools.js.map +1 -0
  263. package/dist/src/mcp/tools.d.ts +49 -0
  264. package/dist/src/mcp/tools.d.ts.map +1 -0
  265. package/dist/src/mcp/tools.js +726 -0
  266. package/dist/src/mcp/tools.js.map +1 -0
  267. package/dist/src/network-error.d.ts +11 -0
  268. package/dist/src/network-error.d.ts.map +1 -0
  269. package/dist/src/network-error.js +34 -0
  270. package/dist/src/network-error.js.map +1 -0
  271. package/dist/src/openapi/contract.d.ts +98 -0
  272. package/dist/src/openapi/contract.d.ts.map +1 -0
  273. package/dist/src/openapi/contract.js +407 -0
  274. package/dist/src/openapi/contract.js.map +1 -0
  275. package/dist/src/openapi/generate.d.ts +89 -0
  276. package/dist/src/openapi/generate.d.ts.map +1 -0
  277. package/dist/src/openapi/generate.js +607 -0
  278. package/dist/src/openapi/generate.js.map +1 -0
  279. package/dist/src/openapi/load.d.ts +8 -0
  280. package/dist/src/openapi/load.d.ts.map +1 -0
  281. package/dist/src/openapi/load.js +26 -0
  282. package/dist/src/openapi/load.js.map +1 -0
  283. package/dist/src/package-manager.d.ts +58 -0
  284. package/dist/src/package-manager.d.ts.map +1 -0
  285. package/dist/src/package-manager.js +137 -0
  286. package/dist/src/package-manager.js.map +1 -0
  287. package/dist/src/reporter/history.d.ts +85 -0
  288. package/dist/src/reporter/history.d.ts.map +1 -0
  289. package/dist/src/reporter/history.js +147 -0
  290. package/dist/src/reporter/history.js.map +1 -0
  291. package/dist/src/reporter/index.d.ts +59 -0
  292. package/dist/src/reporter/index.d.ts.map +1 -0
  293. package/dist/src/reporter/index.js +201 -0
  294. package/dist/src/reporter/index.js.map +1 -0
  295. package/dist/src/reporter/last-run.d.ts +88 -0
  296. package/dist/src/reporter/last-run.d.ts.map +1 -0
  297. package/dist/src/reporter/last-run.js +133 -0
  298. package/dist/src/reporter/last-run.js.map +1 -0
  299. package/dist/src/reporter/quarantine.d.ts +62 -0
  300. package/dist/src/reporter/quarantine.d.ts.map +1 -0
  301. package/dist/src/reporter/quarantine.js +148 -0
  302. package/dist/src/reporter/quarantine.js.map +1 -0
  303. package/dist/src/secrets/index.d.ts +4 -0
  304. package/dist/src/secrets/index.d.ts.map +1 -0
  305. package/dist/src/secrets/index.js +3 -0
  306. package/dist/src/secrets/index.js.map +1 -0
  307. package/dist/src/secrets/provider.interface.d.ts +30 -0
  308. package/dist/src/secrets/provider.interface.d.ts.map +1 -0
  309. package/dist/src/secrets/provider.interface.js +2 -0
  310. package/dist/src/secrets/provider.interface.js.map +1 -0
  311. package/dist/src/secrets/providers/aws.provider.d.ts +33 -0
  312. package/dist/src/secrets/providers/aws.provider.d.ts.map +1 -0
  313. package/dist/src/secrets/providers/aws.provider.js +88 -0
  314. package/dist/src/secrets/providers/aws.provider.js.map +1 -0
  315. package/dist/src/secrets/providers/azure.provider.d.ts +26 -0
  316. package/dist/src/secrets/providers/azure.provider.d.ts.map +1 -0
  317. package/dist/src/secrets/providers/azure.provider.js +71 -0
  318. package/dist/src/secrets/providers/azure.provider.js.map +1 -0
  319. package/dist/src/secrets/providers/env-file.provider.d.ts +29 -0
  320. package/dist/src/secrets/providers/env-file.provider.d.ts.map +1 -0
  321. package/dist/src/secrets/providers/env-file.provider.js +56 -0
  322. package/dist/src/secrets/providers/env-file.provider.js.map +1 -0
  323. package/dist/src/secrets/providers/gitlab.provider.d.ts +26 -0
  324. package/dist/src/secrets/providers/gitlab.provider.d.ts.map +1 -0
  325. package/dist/src/secrets/providers/gitlab.provider.js +67 -0
  326. package/dist/src/secrets/providers/gitlab.provider.js.map +1 -0
  327. package/dist/src/secrets/providers/index.d.ts +52 -0
  328. package/dist/src/secrets/providers/index.d.ts.map +1 -0
  329. package/dist/src/secrets/providers/index.js +81 -0
  330. package/dist/src/secrets/providers/index.js.map +1 -0
  331. package/dist/src/secrets/providers/openbao.provider.d.ts +28 -0
  332. package/dist/src/secrets/providers/openbao.provider.d.ts.map +1 -0
  333. package/dist/src/secrets/providers/openbao.provider.js +29 -0
  334. package/dist/src/secrets/providers/openbao.provider.js.map +1 -0
  335. package/dist/src/secrets/providers/vault-compatible.d.ts +140 -0
  336. package/dist/src/secrets/providers/vault-compatible.d.ts.map +1 -0
  337. package/dist/src/secrets/providers/vault-compatible.js +405 -0
  338. package/dist/src/secrets/providers/vault-compatible.js.map +1 -0
  339. package/dist/src/secrets/providers/vault.provider.d.ts +27 -0
  340. package/dist/src/secrets/providers/vault.provider.d.ts.map +1 -0
  341. package/dist/src/secrets/providers/vault.provider.js +23 -0
  342. package/dist/src/secrets/providers/vault.provider.js.map +1 -0
  343. package/dist/src/secrets/secrets-manager.d.ts +67 -0
  344. package/dist/src/secrets/secrets-manager.d.ts.map +1 -0
  345. package/dist/src/secrets/secrets-manager.js +255 -0
  346. package/dist/src/secrets/secrets-manager.js.map +1 -0
  347. package/dist/src/steps/amqp.steps.d.ts +37 -0
  348. package/dist/src/steps/amqp.steps.d.ts.map +1 -0
  349. package/dist/src/steps/amqp.steps.js +86 -0
  350. package/dist/src/steps/amqp.steps.js.map +1 -0
  351. package/dist/src/steps/appium.steps.d.ts +53 -0
  352. package/dist/src/steps/appium.steps.d.ts.map +1 -0
  353. package/dist/src/steps/appium.steps.js +109 -0
  354. package/dist/src/steps/appium.steps.js.map +1 -0
  355. package/dist/src/steps/aws.steps.d.ts +47 -0
  356. package/dist/src/steps/aws.steps.d.ts.map +1 -0
  357. package/dist/src/steps/aws.steps.js +116 -0
  358. package/dist/src/steps/aws.steps.js.map +1 -0
  359. package/dist/src/steps/browser.steps.d.ts +54 -0
  360. package/dist/src/steps/browser.steps.d.ts.map +1 -0
  361. package/dist/src/steps/browser.steps.js +102 -0
  362. package/dist/src/steps/browser.steps.js.map +1 -0
  363. package/dist/src/steps/cassandra.steps.d.ts +32 -0
  364. package/dist/src/steps/cassandra.steps.d.ts.map +1 -0
  365. package/dist/src/steps/cassandra.steps.js +81 -0
  366. package/dist/src/steps/cassandra.steps.js.map +1 -0
  367. package/dist/src/steps/clickhouse.steps.d.ts +30 -0
  368. package/dist/src/steps/clickhouse.steps.d.ts.map +1 -0
  369. package/dist/src/steps/clickhouse.steps.js +73 -0
  370. package/dist/src/steps/clickhouse.steps.js.map +1 -0
  371. package/dist/src/steps/database.steps.d.ts +43 -0
  372. package/dist/src/steps/database.steps.d.ts.map +1 -0
  373. package/dist/src/steps/database.steps.js +79 -0
  374. package/dist/src/steps/database.steps.js.map +1 -0
  375. package/dist/src/steps/dynamodb.steps.d.ts +32 -0
  376. package/dist/src/steps/dynamodb.steps.d.ts.map +1 -0
  377. package/dist/src/steps/dynamodb.steps.js +89 -0
  378. package/dist/src/steps/dynamodb.steps.js.map +1 -0
  379. package/dist/src/steps/graphql.steps.d.ts +60 -0
  380. package/dist/src/steps/graphql.steps.d.ts.map +1 -0
  381. package/dist/src/steps/graphql.steps.js +76 -0
  382. package/dist/src/steps/graphql.steps.js.map +1 -0
  383. package/dist/src/steps/grpc.steps.d.ts +29 -0
  384. package/dist/src/steps/grpc.steps.d.ts.map +1 -0
  385. package/dist/src/steps/grpc.steps.js +68 -0
  386. package/dist/src/steps/grpc.steps.js.map +1 -0
  387. package/dist/src/steps/inbox.steps.d.ts +30 -0
  388. package/dist/src/steps/inbox.steps.d.ts.map +1 -0
  389. package/dist/src/steps/inbox.steps.js +72 -0
  390. package/dist/src/steps/inbox.steps.js.map +1 -0
  391. package/dist/src/steps/index.d.ts +43 -0
  392. package/dist/src/steps/index.d.ts.map +1 -0
  393. package/dist/src/steps/index.js +26 -0
  394. package/dist/src/steps/index.js.map +1 -0
  395. package/dist/src/steps/kafka.steps.d.ts +56 -0
  396. package/dist/src/steps/kafka.steps.d.ts.map +1 -0
  397. package/dist/src/steps/kafka.steps.js +61 -0
  398. package/dist/src/steps/kafka.steps.js.map +1 -0
  399. package/dist/src/steps/mock-server.steps.d.ts +21 -0
  400. package/dist/src/steps/mock-server.steps.d.ts.map +1 -0
  401. package/dist/src/steps/mock-server.steps.js +45 -0
  402. package/dist/src/steps/mock-server.steps.js.map +1 -0
  403. package/dist/src/steps/mongodb.steps.d.ts +107 -0
  404. package/dist/src/steps/mongodb.steps.d.ts.map +1 -0
  405. package/dist/src/steps/mongodb.steps.js +117 -0
  406. package/dist/src/steps/mongodb.steps.js.map +1 -0
  407. package/dist/src/steps/openapi.steps.d.ts +49 -0
  408. package/dist/src/steps/openapi.steps.d.ts.map +1 -0
  409. package/dist/src/steps/openapi.steps.js +113 -0
  410. package/dist/src/steps/openapi.steps.js.map +1 -0
  411. package/dist/src/steps/otp.steps.d.ts +43 -0
  412. package/dist/src/steps/otp.steps.d.ts.map +1 -0
  413. package/dist/src/steps/otp.steps.js +83 -0
  414. package/dist/src/steps/otp.steps.js.map +1 -0
  415. package/dist/src/steps/realtime.steps.d.ts +40 -0
  416. package/dist/src/steps/realtime.steps.d.ts.map +1 -0
  417. package/dist/src/steps/realtime.steps.js +116 -0
  418. package/dist/src/steps/realtime.steps.js.map +1 -0
  419. package/dist/src/steps/redis.steps.d.ts +54 -0
  420. package/dist/src/steps/redis.steps.d.ts.map +1 -0
  421. package/dist/src/steps/redis.steps.js +89 -0
  422. package/dist/src/steps/redis.steps.js.map +1 -0
  423. package/dist/src/steps/search.steps.d.ts +23 -0
  424. package/dist/src/steps/search.steps.d.ts.map +1 -0
  425. package/dist/src/steps/search.steps.js +54 -0
  426. package/dist/src/steps/search.steps.js.map +1 -0
  427. package/dist/src/test-data/factory.d.ts +82 -0
  428. package/dist/src/test-data/factory.d.ts.map +1 -0
  429. package/dist/src/test-data/factory.js +116 -0
  430. package/dist/src/test-data/factory.js.map +1 -0
  431. package/dist/src/test-data/index.d.ts +4 -0
  432. package/dist/src/test-data/index.d.ts.map +1 -0
  433. package/dist/src/test-data/index.js +4 -0
  434. package/dist/src/test-data/index.js.map +1 -0
  435. package/dist/src/test-data/registry.d.ts +37 -0
  436. package/dist/src/test-data/registry.d.ts.map +1 -0
  437. package/dist/src/test-data/registry.js +51 -0
  438. package/dist/src/test-data/registry.js.map +1 -0
  439. package/dist/src/test-data/tracking.d.ts +47 -0
  440. package/dist/src/test-data/tracking.d.ts.map +1 -0
  441. package/dist/src/test-data/tracking.js +166 -0
  442. package/dist/src/test-data/tracking.js.map +1 -0
  443. package/environments.json +263 -0
  444. package/package.json +299 -5
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Redis integration fixture for the Playwright Framework Template.
3
+ *
4
+ * Provides a Redis client with get, set, del, publish, and subscribe methods.
5
+ * Supports test-scoped key prefix isolation and automatic teardown cleanup.
6
+ *
7
+ * Uses ioredis for Redis connectivity.
8
+ *
9
+ * @requirements 5.1, 5.2, 5.3, 5.4, 5.5
10
+ */
11
+ import type { Redis } from 'ioredis';
12
+ import { RedisFixtureConfig } from '../config/schema.js';
13
+ import type { CleanupRegistry, KeepOption } from '../test-data/registry.js';
14
+ /**
15
+ * Options for the subscribe method.
16
+ */
17
+ export interface SubscribeOptions {
18
+ /** Timeout in ms to wait for a message (default: 5000). */
19
+ timeout?: number;
20
+ }
21
+ /**
22
+ * Redis client interface exposed to tests.
23
+ */
24
+ export interface RedisClient {
25
+ get(key: string): Promise<string | null>;
26
+ /** Sets a key; when the test ends it is deleted, or its previous value restored, unless `{ keep: true }`. */
27
+ set(key: string, value: string, ttl?: number, options?: KeepOption): Promise<void>;
28
+ del(key: string): Promise<number>;
29
+ publish(channel: string, message: string): Promise<number>;
30
+ subscribe(channel: string, options?: SubscribeOptions): Promise<string | null>;
31
+ quit(): Promise<void>;
32
+ }
33
+ /**
34
+ * Creates a Redis client instance connected to the configured server.
35
+ * Verifies connectivity with a PING command.
36
+ * If keyPrefix is configured, creates a separate subscriber client for pub/sub.
37
+ */
38
+ export declare function createRedisClient(config: RedisFixtureConfig): Promise<{
39
+ client: Redis;
40
+ subscriber: Redis | null;
41
+ }>;
42
+ /**
43
+ * Redis fixture definition for Playwright's test.extend() pattern.
44
+ *
45
+ * Setup: Creates ioredis client, verifies connection with PING,
46
+ * creates subscriber client if keyPrefix is configured.
47
+ * Teardown: Flushes prefixed keys, disconnects subscriber, quits main client.
48
+ */
49
+ export declare const redisFixture: {
50
+ redisClient: ({ redisConfig, dataCleanup }: {
51
+ redisConfig: RedisFixtureConfig;
52
+ dataCleanup: CleanupRegistry;
53
+ }, use: (client: RedisClient) => Promise<void>) => Promise<void>;
54
+ };
55
+ //# sourceMappingURL=redis.fixture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.fixture.d.ts","sourceRoot":"","sources":["../../../src/fixtures/redis.fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG5E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,6GAA6G;IAC7G,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3D,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC/E,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB;AAKD;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC;IACzE,MAAM,EAAE,KAAK,CAAC;IACd,UAAU,EAAE,KAAK,GAAG,IAAI,CAAC;CAC5B,CAAC,CAqED;AA6GD;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;IACrB,WAAW,iCACuB;QAAE,WAAW,EAAE,kBAAkB,CAAC;QAAC,WAAW,EAAE,eAAe,CAAA;KAAE,OAC1F,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC;CAsClD,CAAC"}
@@ -0,0 +1,209 @@
1
+ /**
2
+ * Redis integration fixture for the Playwright Framework Template.
3
+ *
4
+ * Provides a Redis client with get, set, del, publish, and subscribe methods.
5
+ * Supports test-scoped key prefix isolation and automatic teardown cleanup.
6
+ *
7
+ * Uses ioredis for Redis connectivity.
8
+ *
9
+ * @requirements 5.1, 5.2, 5.3, 5.4, 5.5
10
+ */
11
+ import { loadOptional } from './optional-package.js';
12
+ import { FixtureInitError } from '../errors.js';
13
+ import { trackRedis } from '../test-data/tracking.js';
14
+ const DEFAULT_CONNECTION_TIMEOUT = 5000;
15
+ const DEFAULT_SUBSCRIBE_TIMEOUT = 5000;
16
+ /**
17
+ * Creates a Redis client instance connected to the configured server.
18
+ * Verifies connectivity with a PING command.
19
+ * If keyPrefix is configured, creates a separate subscriber client for pub/sub.
20
+ */
21
+ export async function createRedisClient(config) {
22
+ const connectionTimeout = config.connectionTimeout ?? DEFAULT_CONNECTION_TIMEOUT;
23
+ // ioredis is an optional peer dependency, loaded on first use.
24
+ const { Redis } = await loadOptional('ioredis', 'redisClient');
25
+ const client = new Redis({
26
+ host: config.host,
27
+ port: config.port,
28
+ password: config.password,
29
+ db: config.db,
30
+ keyPrefix: config.keyPrefix,
31
+ connectTimeout: connectionTimeout,
32
+ maxRetriesPerRequest: 0,
33
+ retryStrategy: () => null, // Do not retry on connection failure
34
+ lazyConnect: true,
35
+ });
36
+ try {
37
+ await client.connect();
38
+ await client.ping();
39
+ }
40
+ catch (error) {
41
+ client.disconnect();
42
+ throw new FixtureInitError('redis', 'connect', {
43
+ host: config.host,
44
+ port: config.port,
45
+ timeout: connectionTimeout,
46
+ reason: error instanceof Error ? error.message : String(error),
47
+ }, error instanceof Error ? error : undefined);
48
+ }
49
+ let subscriber = null;
50
+ if (config.keyPrefix) {
51
+ subscriber = new Redis({
52
+ host: config.host,
53
+ port: config.port,
54
+ password: config.password,
55
+ db: config.db,
56
+ connectTimeout: connectionTimeout,
57
+ maxRetriesPerRequest: 0,
58
+ retryStrategy: () => null,
59
+ lazyConnect: true,
60
+ });
61
+ try {
62
+ await subscriber.connect();
63
+ }
64
+ catch (error) {
65
+ client.disconnect();
66
+ subscriber.disconnect();
67
+ throw new FixtureInitError('redis', 'connect', {
68
+ host: config.host,
69
+ port: config.port,
70
+ timeout: connectionTimeout,
71
+ reason: `Subscriber connection failed: ${error instanceof Error ? error.message : String(error)}`,
72
+ }, error instanceof Error ? error : undefined);
73
+ }
74
+ }
75
+ return { client, subscriber };
76
+ }
77
+ /**
78
+ * Builds the RedisClient interface wrapping the ioredis instances.
79
+ */
80
+ function buildRedisClient(client, subscriber, config) {
81
+ return {
82
+ async get(key) {
83
+ return client.get(key);
84
+ },
85
+ async set(key, value, ttl) {
86
+ if (ttl !== undefined) {
87
+ await client.set(key, value, 'EX', ttl);
88
+ }
89
+ else {
90
+ await client.set(key, value);
91
+ }
92
+ },
93
+ async del(key) {
94
+ return client.del(key);
95
+ },
96
+ async publish(channel, message) {
97
+ return client.publish(channel, message);
98
+ },
99
+ async subscribe(channel, options) {
100
+ const timeout = options?.timeout ?? DEFAULT_SUBSCRIBE_TIMEOUT;
101
+ const subClient = subscriber ?? client.duplicate();
102
+ const shouldDisconnect = !subscriber;
103
+ return new Promise((resolve) => {
104
+ let resolved = false;
105
+ const timer = setTimeout(() => {
106
+ if (!resolved) {
107
+ resolved = true;
108
+ subClient.unsubscribe(channel).catch(() => { });
109
+ if (shouldDisconnect) {
110
+ subClient.disconnect();
111
+ }
112
+ resolve(null);
113
+ }
114
+ }, timeout);
115
+ subClient.on('message', (ch, message) => {
116
+ if (ch === channel && !resolved) {
117
+ resolved = true;
118
+ clearTimeout(timer);
119
+ subClient.unsubscribe(channel).catch(() => { });
120
+ if (shouldDisconnect) {
121
+ subClient.disconnect();
122
+ }
123
+ resolve(message);
124
+ }
125
+ });
126
+ subClient.subscribe(channel).catch((err) => {
127
+ if (!resolved) {
128
+ resolved = true;
129
+ clearTimeout(timer);
130
+ if (shouldDisconnect) {
131
+ subClient.disconnect();
132
+ }
133
+ resolve(null);
134
+ }
135
+ });
136
+ });
137
+ },
138
+ async quit() {
139
+ await client.quit();
140
+ },
141
+ };
142
+ }
143
+ /**
144
+ * Flushes all keys matching the configured keyPrefix pattern.
145
+ */
146
+ async function flushPrefixedKeys(client, keyPrefix) {
147
+ const pattern = `${keyPrefix}*`;
148
+ let cursor = '0';
149
+ do {
150
+ // Use SCAN with the raw pattern (keyPrefix is already applied by ioredis for commands,
151
+ // but SCAN needs the full pattern including the prefix)
152
+ const [nextCursor, keys] = await client.scan(cursor, 'MATCH', pattern, 'COUNT', 100);
153
+ cursor = nextCursor;
154
+ if (keys.length > 0) {
155
+ // Keys returned by SCAN already include the prefix, so use unlink directly
156
+ // We need to strip the keyPrefix since ioredis auto-prepends it
157
+ const strippedKeys = keys.map((k) => k.startsWith(keyPrefix) ? k.slice(keyPrefix.length) : k);
158
+ await client.del(...strippedKeys);
159
+ }
160
+ } while (cursor !== '0');
161
+ }
162
+ /**
163
+ * Redis fixture definition for Playwright's test.extend() pattern.
164
+ *
165
+ * Setup: Creates ioredis client, verifies connection with PING,
166
+ * creates subscriber client if keyPrefix is configured.
167
+ * Teardown: Flushes prefixed keys, disconnects subscriber, quits main client.
168
+ */
169
+ export const redisFixture = {
170
+ redisClient: async ({ redisConfig, dataCleanup }, use) => {
171
+ const { client, subscriber } = await createRedisClient(redisConfig);
172
+ const redisClient = buildRedisClient(client, subscriber, redisConfig);
173
+ let cleanupError;
174
+ try {
175
+ await use(trackRedis(redisClient, dataCleanup));
176
+ // Undo the test's sets (every client is still connected here)
177
+ await dataCleanup.flush();
178
+ }
179
+ catch (error) {
180
+ cleanupError = error;
181
+ }
182
+ // Teardown
183
+ if (redisConfig.keyPrefix) {
184
+ try {
185
+ await flushPrefixedKeys(client, redisConfig.keyPrefix);
186
+ }
187
+ catch {
188
+ // Log warning but don't fail the test
189
+ }
190
+ }
191
+ if (subscriber) {
192
+ try {
193
+ subscriber.disconnect();
194
+ }
195
+ catch {
196
+ // Log warning but don't fail the test
197
+ }
198
+ }
199
+ try {
200
+ await client.quit();
201
+ }
202
+ catch {
203
+ client.disconnect();
204
+ }
205
+ if (cleanupError)
206
+ throw cleanupError;
207
+ },
208
+ };
209
+ //# sourceMappingURL=redis.fixture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis.fixture.js","sourceRoot":"","sources":["../../../src/fixtures/redis.fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAuBtD,MAAM,0BAA0B,GAAG,IAAI,CAAC;AACxC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AAC;QACL,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACb,IAAI,CAAC;gBACD,UAAU,CAAC,UAAU,EAAE,CAAC;YAC5B,CAAC;YAAC,MAAM,CAAC;gBACL,sCAAsC;YAC1C,CAAC;QACL,CAAC;QAED,IAAI,CAAC;YACD,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC;QAAC,MAAM,CAAC;YACL,MAAM,CAAC,UAAU,EAAE,CAAC;QACxB,CAAC;QACD,IAAI,YAAY;YAAE,MAAM,YAAY,CAAC;IACzC,CAAC;CACJ,CAAC"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * S3 fixture.
3
+ *
4
+ * `s3Client` writes, reads and waits for objects, against an emulator (Moto,
5
+ * LocalStack) or a real test account:
6
+ *
7
+ * - Every test gets its own key prefix (`s3Client.prefix`, from `key(name)`).
8
+ * Hand it to the application so the files a test causes are its own;
9
+ * everything under it is deleted when the test ends.
10
+ * - `putObject()` outside the prefix is undone too: a new key is deleted, an
11
+ * overwritten one gets its previous content back.
12
+ * - `waitForObject()` polls until the application has written a key, and
13
+ * fails with the keys that are there instead.
14
+ * - Buckets made with `createBucket()` are emptied and deleted afterwards.
15
+ *
16
+ * Uses @aws-sdk/client-s3, an optional peer dependency loaded on first use.
17
+ */
18
+ import type { S3Client as SdkS3Client } from '@aws-sdk/client-s3';
19
+ import type { AwsFixtureConfig } from '../config/schema.js';
20
+ import type { ContainerManager } from '../containers/container-manager.js';
21
+ import type { CleanupRegistry, KeepOption } from '../test-data/registry.js';
22
+ import { type AwsBody } from './aws.js';
23
+ export interface S3BucketOption {
24
+ /** Bucket (default: the config's `s3.bucket`). */
25
+ bucket?: string;
26
+ }
27
+ export interface S3PutOptions extends S3BucketOption, KeepOption {
28
+ /** Default: `application/json` for an object body, `text/plain` for a string, none for a Buffer. */
29
+ contentType?: string;
30
+ metadata?: Record<string, string>;
31
+ cacheControl?: string;
32
+ contentEncoding?: string;
33
+ }
34
+ export interface S3WaitOptions extends S3BucketOption {
35
+ /** Milliseconds to wait (default: the config's `timeout`, else 10000). */
36
+ timeout?: number;
37
+ }
38
+ /** An object read from S3. */
39
+ export interface S3Object {
40
+ bucket: string;
41
+ key: string;
42
+ /** The raw body. */
43
+ content: Buffer;
44
+ /** The body decoded as UTF-8. */
45
+ text(): string;
46
+ /** The body parsed as JSON; throws when it isn't JSON. */
47
+ json<T = unknown>(): T;
48
+ contentType?: string;
49
+ metadata: Record<string, string>;
50
+ etag?: string;
51
+ lastModified?: Date;
52
+ size: number;
53
+ }
54
+ /** A key in a listing. */
55
+ export interface S3ObjectSummary {
56
+ key: string;
57
+ size: number;
58
+ lastModified?: Date;
59
+ etag?: string;
60
+ }
61
+ /** What `headObject()` returns for a key that exists. */
62
+ export interface S3ObjectInfo {
63
+ key: string;
64
+ size: number;
65
+ contentType?: string;
66
+ metadata: Record<string, string>;
67
+ etag?: string;
68
+ lastModified?: Date;
69
+ }
70
+ export interface S3Client {
71
+ /** This test's key prefix, e.g. `propmaster-tests/t0-9f2a1c0b/`. Everything under it is deleted after the test. */
72
+ readonly prefix: string;
73
+ /** The config's default bucket, if any. */
74
+ readonly bucket: string | undefined;
75
+ /** `prefix + name`: a key of this test's own. */
76
+ key(name: string): string;
77
+ /** Writes an object. Undone after the test (deleted, or the previous content put back) unless `{ keep: true }`. */
78
+ putObject(key: string, body: AwsBody, options?: S3PutOptions): Promise<void>;
79
+ /** Reads an object; throws when it doesn't exist. */
80
+ getObject(key: string, options?: S3BucketOption): Promise<S3Object>;
81
+ /** Size, type and metadata of an object, or null when it doesn't exist. */
82
+ headObject(key: string, options?: S3BucketOption): Promise<S3ObjectInfo | null>;
83
+ /** True when the object exists. */
84
+ exists(key: string, options?: S3BucketOption): Promise<boolean>;
85
+ /** Every key under a prefix (default: this test's prefix), sorted. */
86
+ listObjects(prefix?: string, options?: S3BucketOption): Promise<S3ObjectSummary[]>;
87
+ /** Polls until the object exists, then reads it. Throws on timeout, listing the keys that are there. */
88
+ waitForObject(key: string, options?: S3WaitOptions): Promise<S3Object>;
89
+ /** Deletes an object (not undone). */
90
+ deleteObject(key: string, options?: S3BucketOption): Promise<void>;
91
+ /** Deletes every object under a prefix; returns how many. */
92
+ deletePrefix(prefix: string, options?: S3BucketOption): Promise<number>;
93
+ /** Creates a bucket. Emptied and deleted after the test unless `{ keep: true }` or it already existed. */
94
+ createBucket(bucket: string, options?: KeepOption): Promise<void>;
95
+ /** True when the bucket exists and is reachable. */
96
+ bucketExists(bucket: string): Promise<boolean>;
97
+ /** The AWS SDK client, for anything else. */
98
+ readonly sdk: SdkS3Client;
99
+ close(): void;
100
+ }
101
+ export interface CreateS3ClientOptions {
102
+ /** Undo stack for writes and buckets; without one nothing is cleaned up. */
103
+ registry?: CleanupRegistry;
104
+ /** Run ID in the per-test prefix (default: a new one). */
105
+ runId?: string;
106
+ }
107
+ /** The per-test prefix: the root (default `propmaster-tests/`) plus the run ID. */
108
+ export declare function s3TestPrefix(root: string | undefined, runId: string): string;
109
+ /** The "directory" of a key, for listing what's near a key that didn't show up. */
110
+ export declare function parentPrefix(key: string): string;
111
+ /** Builds the client. */
112
+ export declare function createS3Client(config: AwsFixtureConfig, options?: CreateS3ClientOptions): Promise<S3Client>;
113
+ /**
114
+ * Fixture definition for test.extend(). The undo actions run before the
115
+ * SDK client is destroyed.
116
+ */
117
+ export declare const s3Fixture: {
118
+ s3Client: ({ aws, stagehandContainers, dataCleanup }: {
119
+ aws: AwsFixtureConfig | undefined;
120
+ stagehandContainers: ContainerManager;
121
+ dataCleanup: CleanupRegistry;
122
+ }, use: (client: S3Client) => Promise<void>, testInfo: {
123
+ workerIndex: number;
124
+ }) => Promise<void>;
125
+ };
126
+ //# sourceMappingURL=s3.fixture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3.fixture.d.ts","sourceRoot":"","sources":["../../../src/fixtures/s3.fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,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