@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,11 @@
1
+ /**
2
+ * Annotations module barrel export.
3
+ *
4
+ * Re-exports all public annotation utilities for truncation,
5
+ * credential redaction, and fixture operation recording.
6
+ *
7
+ * @requirements 12.1
8
+ */
9
+ export { truncate, redactCredentials } from './truncation.js';
10
+ export { recordDatabase, recordKafka, recordRedis, recordOpenApi } from './recorder.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/annotations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Annotations module barrel export.
3
+ *
4
+ * Re-exports all public annotation utilities for truncation,
5
+ * credential redaction, and fixture operation recording.
6
+ *
7
+ * @requirements 12.1
8
+ */
9
+ export { truncate, redactCredentials } from './truncation.js';
10
+ export { recordDatabase, recordKafka, recordRedis, recordOpenApi } from './recorder.js';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/annotations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Annotation recorder module for attaching fixture operation metadata
3
+ * to Playwright test results via testInfo.annotations.
4
+ *
5
+ * Each recorder function serializes a typed metadata object as JSON
6
+ * into the annotation description field. All values are redacted for
7
+ * credentials and truncated to their respective limits before recording.
8
+ *
9
+ * @requirements 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7
10
+ */
11
+ /** Minimal testInfo interface to avoid importing Playwright's TestInfo directly */
12
+ type TestInfo = {
13
+ annotations: Array<{
14
+ type: string;
15
+ description?: string;
16
+ }>;
17
+ };
18
+ /**
19
+ * Records a database fixture operation annotation.
20
+ *
21
+ * @param testInfo - Playwright test info object
22
+ * @param operation - The database operation type (query or execute)
23
+ * @param sql - The SQL statement executed
24
+ * @param rowCount - Number of rows returned or affected
25
+ */
26
+ export declare function recordDatabase(testInfo: TestInfo, operation: 'query' | 'execute', sql: string, rowCount: number): void;
27
+ /**
28
+ * Records a Kafka fixture operation annotation.
29
+ *
30
+ * @param testInfo - Playwright test info object
31
+ * @param operation - The Kafka operation type (produce or consume)
32
+ * @param topic - The Kafka topic name
33
+ * @param messageCount - Number of messages produced or consumed
34
+ */
35
+ export declare function recordKafka(testInfo: TestInfo, operation: 'produce' | 'consume', topic: string, messageCount: number): void;
36
+ /**
37
+ * Records a Redis fixture operation annotation.
38
+ *
39
+ * @param testInfo - Playwright test info object
40
+ * @param operation - The Redis operation type
41
+ * @param key - The Redis key or channel name
42
+ * @param result - The string representation of the result value
43
+ */
44
+ export declare function recordRedis(testInfo: TestInfo, operation: 'get' | 'set' | 'del' | 'publish' | 'subscribe', key: string, result: string): void;
45
+ /**
46
+ * Records an OpenAPI fixture operation annotation.
47
+ *
48
+ * @param testInfo - Playwright test info object
49
+ * @param method - The HTTP method (GET, POST, PUT, DELETE, etc.)
50
+ * @param path - The request path
51
+ * @param reqBody - The request body as a string
52
+ * @param status - The HTTP response status code
53
+ * @param resBody - The response body as a string
54
+ */
55
+ export declare function recordOpenApi(testInfo: TestInfo, method: string, path: string, reqBody: string, status: number, resBody: string): void;
56
+ export {};
57
+ //# sourceMappingURL=recorder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../src/annotations/recorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,mFAAmF;AACnF,KAAK,QAAQ,GAAG;IACZ,WAAW,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9D,CAAC;AAQF;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC1B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,GAAG,SAAS,EAC9B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACjB,IAAI,CAYN;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACvB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,GACrB,IAAI,CAYN;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACvB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,GAAG,WAAW,EAC1D,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GACf,IAAI,CAYN;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CACzB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAChB,IAAI,CAcN"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Annotation recorder module for attaching fixture operation metadata
3
+ * to Playwright test results via testInfo.annotations.
4
+ *
5
+ * Each recorder function serializes a typed metadata object as JSON
6
+ * into the annotation description field. All values are redacted for
7
+ * credentials and truncated to their respective limits before recording.
8
+ *
9
+ * @requirements 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, 12.7
10
+ */
11
+ import { truncate, redactCredentials } from './truncation.js';
12
+ const ANNOTATION_TYPE = 'fixture-operation';
13
+ const SQL_LIMIT = 2048;
14
+ const REDIS_RESULT_LIMIT = 1024;
15
+ const HTTP_BODY_LIMIT = 4096;
16
+ /**
17
+ * Records a database fixture operation annotation.
18
+ *
19
+ * @param testInfo - Playwright test info object
20
+ * @param operation - The database operation type (query or execute)
21
+ * @param sql - The SQL statement executed
22
+ * @param rowCount - Number of rows returned or affected
23
+ */
24
+ export function recordDatabase(testInfo, operation, sql, rowCount) {
25
+ const metadata = {
26
+ fixture: 'database',
27
+ operation,
28
+ sql: truncate(redactCredentials(sql), SQL_LIMIT),
29
+ rowCount,
30
+ };
31
+ testInfo.annotations.push({
32
+ type: ANNOTATION_TYPE,
33
+ description: JSON.stringify(metadata),
34
+ });
35
+ }
36
+ /**
37
+ * Records a Kafka fixture operation annotation.
38
+ *
39
+ * @param testInfo - Playwright test info object
40
+ * @param operation - The Kafka operation type (produce or consume)
41
+ * @param topic - The Kafka topic name
42
+ * @param messageCount - Number of messages produced or consumed
43
+ */
44
+ export function recordKafka(testInfo, operation, topic, messageCount) {
45
+ const metadata = {
46
+ fixture: 'kafka',
47
+ operation,
48
+ topic: redactCredentials(topic),
49
+ messageCount,
50
+ };
51
+ testInfo.annotations.push({
52
+ type: ANNOTATION_TYPE,
53
+ description: JSON.stringify(metadata),
54
+ });
55
+ }
56
+ /**
57
+ * Records a Redis fixture operation annotation.
58
+ *
59
+ * @param testInfo - Playwright test info object
60
+ * @param operation - The Redis operation type
61
+ * @param key - The Redis key or channel name
62
+ * @param result - The string representation of the result value
63
+ */
64
+ export function recordRedis(testInfo, operation, key, result) {
65
+ const metadata = {
66
+ fixture: 'redis',
67
+ operation,
68
+ key: redactCredentials(key),
69
+ result: truncate(redactCredentials(result), REDIS_RESULT_LIMIT),
70
+ };
71
+ testInfo.annotations.push({
72
+ type: ANNOTATION_TYPE,
73
+ description: JSON.stringify(metadata),
74
+ });
75
+ }
76
+ /**
77
+ * Records an OpenAPI fixture operation annotation.
78
+ *
79
+ * @param testInfo - Playwright test info object
80
+ * @param method - The HTTP method (GET, POST, PUT, DELETE, etc.)
81
+ * @param path - The request path
82
+ * @param reqBody - The request body as a string
83
+ * @param status - The HTTP response status code
84
+ * @param resBody - The response body as a string
85
+ */
86
+ export function recordOpenApi(testInfo, method, path, reqBody, status, resBody) {
87
+ const metadata = {
88
+ fixture: 'openapi',
89
+ method: redactCredentials(method),
90
+ path: redactCredentials(path),
91
+ requestBody: truncate(redactCredentials(reqBody), HTTP_BODY_LIMIT),
92
+ responseStatus: status,
93
+ responseBody: truncate(redactCredentials(resBody), HTTP_BODY_LIMIT),
94
+ };
95
+ testInfo.annotations.push({
96
+ type: ANNOTATION_TYPE,
97
+ description: JSON.stringify(metadata),
98
+ });
99
+ }
100
+ //# sourceMappingURL=recorder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recorder.js","sourceRoot":"","sources":["../../../src/annotations/recorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAO9D,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAChC,MAAM,eAAe,GAAG,IAAI,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC1B,QAAkB,EAClB,SAA8B,EAC9B,GAAW,EACX,QAAgB;IAEhB,MAAM,QAAQ,GAAG;QACb,OAAO,EAAE,UAAmB;QAC5B,SAAS;QACT,GAAG,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;QAChD,QAAQ;KACX,CAAC;IAEF,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC;QACtB,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;KACxC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CACvB,QAAkB,EAClB,SAAgC,EAChC,KAAa,EACb,YAAoB;IAEpB,MAAM,QAAQ,GAAG;QACb,OAAO,EAAE,OAAgB;QACzB,SAAS;QACT,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC;QAC/B,YAAY;KACf,CAAC;IAEF,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC;QACtB,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;KACxC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CACvB,QAAkB,EAClB,SAA0D,EAC1D,GAAW,EACX,MAAc;IAEd,MAAM,QAAQ,GAAG;QACb,OAAO,EAAE,OAAgB;QACzB,SAAS;QACT,GAAG,EAAE,iBAAiB,CAAC,GAAG,CAAC;QAC3B,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC;KAClE,CAAC;IAEF,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC;QACtB,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;KACxC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CACzB,QAAkB,EAClB,MAAc,EACd,IAAY,EACZ,OAAe,EACf,MAAc,EACd,OAAe;IAEf,MAAM,QAAQ,GAAG;QACb,OAAO,EAAE,SAAkB;QAC3B,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC;QACjC,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC;QAC7B,WAAW,EAAE,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;QAClE,cAAc,EAAE,MAAM;QACtB,YAAY,EAAE,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;KACtE,CAAC;IAEF,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC;QACtB,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;KACxC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Truncation and credential redaction utilities for the annotation system.
3
+ *
4
+ * These utilities ensure annotation values stay within size limits and
5
+ * that sensitive data (passwords, tokens, API keys) is never recorded
6
+ * in test metadata.
7
+ */
8
+ /**
9
+ * Truncates a string value to the specified character limit.
10
+ *
11
+ * If the value length exceeds the limit, returns the first `limit` characters
12
+ * followed by the `[truncated]` indicator. Otherwise returns the original string.
13
+ *
14
+ * @param value - The string to potentially truncate
15
+ * @param limit - Maximum number of characters before truncation
16
+ * @returns The original string or a truncated version with indicator
17
+ */
18
+ export declare function truncate(value: string, limit: number): string;
19
+ /**
20
+ * Redacts credential patterns from a string value.
21
+ *
22
+ * Scans for common credential patterns and replaces matched sensitive
23
+ * values with `[REDACTED]`:
24
+ * - `password=...` / `pwd=...` in connection strings
25
+ * - `Bearer ...` / `Basic ...` authorization headers
26
+ * - `token=...` / `api_key=...` query parameters
27
+ * - AWS access key IDs (AKIA...)
28
+ * - JWT tokens (eyJ...)
29
+ *
30
+ * @param value - The string to scan for credentials
31
+ * @returns The string with all detected credentials replaced by [REDACTED]
32
+ */
33
+ export declare function redactCredentials(value: string): string;
34
+ //# sourceMappingURL=truncation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"truncation.d.ts","sourceRoot":"","sources":["../../../src/annotations/truncation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAK7D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAmCvD"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Truncation and credential redaction utilities for the annotation system.
3
+ *
4
+ * These utilities ensure annotation values stay within size limits and
5
+ * that sensitive data (passwords, tokens, API keys) is never recorded
6
+ * in test metadata.
7
+ */
8
+ const TRUNCATION_INDICATOR = '[truncated]';
9
+ /**
10
+ * Truncates a string value to the specified character limit.
11
+ *
12
+ * If the value length exceeds the limit, returns the first `limit` characters
13
+ * followed by the `[truncated]` indicator. Otherwise returns the original string.
14
+ *
15
+ * @param value - The string to potentially truncate
16
+ * @param limit - Maximum number of characters before truncation
17
+ * @returns The original string or a truncated version with indicator
18
+ */
19
+ export function truncate(value, limit) {
20
+ if (value.length <= limit) {
21
+ return value;
22
+ }
23
+ return value.slice(0, limit) + TRUNCATION_INDICATOR;
24
+ }
25
+ /**
26
+ * Redacts credential patterns from a string value.
27
+ *
28
+ * Scans for common credential patterns and replaces matched sensitive
29
+ * values with `[REDACTED]`:
30
+ * - `password=...` / `pwd=...` in connection strings
31
+ * - `Bearer ...` / `Basic ...` authorization headers
32
+ * - `token=...` / `api_key=...` query parameters
33
+ * - AWS access key IDs (AKIA...)
34
+ * - JWT tokens (eyJ...)
35
+ *
36
+ * @param value - The string to scan for credentials
37
+ * @returns The string with all detected credentials replaced by [REDACTED]
38
+ */
39
+ export function redactCredentials(value) {
40
+ let result = value;
41
+ // Connection string password fields: password=... or pwd=...
42
+ // Matches until semicolon, ampersand, whitespace, or end of string
43
+ result = result.replace(/\b(password|pwd)\s*=\s*([^;&\s]+)/gi, '$1=[REDACTED]');
44
+ // Bearer and Basic authorization tokens
45
+ result = result.replace(/\b(Bearer|Basic)\s+[^\s,;]+/gi, '$1 [REDACTED]');
46
+ // Query parameter tokens: token=... or api_key=...
47
+ result = result.replace(/\b(token|api_key)\s*=\s*([^;&\s]+)/gi, '$1=[REDACTED]');
48
+ // AWS access key IDs (starts with AKIA, 20 chars)
49
+ result = result.replace(/\bAKIA[0-9A-Z]{16}\b/g, '[REDACTED]');
50
+ // JWT tokens (three base64url segments separated by dots)
51
+ result = result.replace(/\beyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g, '[REDACTED]');
52
+ return result;
53
+ }
54
+ //# sourceMappingURL=truncation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"truncation.js","sourceRoot":"","sources":["../../../src/annotations/truncation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAE3C;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAa,EAAE,KAAa;IACjD,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,oBAAoB,CAAC;AACxD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC3C,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,6DAA6D;IAC7D,mEAAmE;IACnE,MAAM,GAAG,MAAM,CAAC,OAAO,CACnB,qCAAqC,EACrC,eAAe,CAClB,CAAC;IAEF,wCAAwC;IACxC,MAAM,GAAG,MAAM,CAAC,OAAO,CACnB,+BAA+B,EAC/B,eAAe,CAClB,CAAC;IAEF,mDAAmD;IACnD,MAAM,GAAG,MAAM,CAAC,OAAO,CACnB,sCAAsC,EACtC,eAAe,CAClB,CAAC;IAEF,kDAAkD;IAClD,MAAM,GAAG,MAAM,CAAC,OAAO,CACnB,uBAAuB,EACvB,YAAY,CACf,CAAC;IAEF,0DAA0D;IAC1D,MAAM,GAAG,MAAM,CAAC,OAAO,CACnB,2DAA2D,EAC3D,YAAY,CACf,CAAC;IAEF,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Applies the auth helpers' bearer token to the OpenAPI, GraphQL, gRPC and realtime clients.
3
+ * The token is fetched per request from the worker's TokenManager, so a token
4
+ * that expires mid-test is refreshed. A header the test set itself wins.
5
+ */
6
+ import type { AuthConfig } from '../config/schema.js';
7
+ import type { TokenManager } from './token-manager.js';
8
+ export type AuthTarget = 'openapi' | 'graphql' | 'grpc' | 'realtime';
9
+ /** True when auth has a token endpoint and `applyTo` (default: every client) includes `target`. */
10
+ export declare function authApplies(config: AuthConfig | undefined, target: AuthTarget): config is AuthConfig;
11
+ /** A function that returns the current bearer token for the test's role. */
12
+ export declare function bearerSource(tokens: TokenManager, config: AuthConfig, role: string | undefined): () => Promise<string>;
13
+ /** Headers with `Authorization: Bearer <token>` added unless one is already set (any case). */
14
+ export declare function withBearer(headers: HeadersInit | undefined, token: () => Promise<string>): Promise<Headers>;
15
+ //# sourceMappingURL=apply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/auth/apply.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAErE,mGAAmG;AACnG,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,IAAI,UAAU,CAEpG;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAEtH;AAED,+FAA+F;AAC/F,wBAAsB,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAIjH"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Applies the auth helpers' bearer token to the OpenAPI, GraphQL, gRPC and realtime clients.
3
+ * The token is fetched per request from the worker's TokenManager, so a token
4
+ * that expires mid-test is refreshed. A header the test set itself wins.
5
+ */
6
+ /** True when auth has a token endpoint and `applyTo` (default: every client) includes `target`. */
7
+ export function authApplies(config, target) {
8
+ return !!config && !!(config.tokenUrl || config.issuer) && (config.applyTo ?? ['openapi', 'graphql', 'grpc', 'realtime']).includes(target);
9
+ }
10
+ /** A function that returns the current bearer token for the test's role. */
11
+ export function bearerSource(tokens, config, role) {
12
+ return () => tokens.getToken(config, role);
13
+ }
14
+ /** Headers with `Authorization: Bearer <token>` added unless one is already set (any case). */
15
+ export async function withBearer(headers, token) {
16
+ const result = new Headers(headers);
17
+ if (!result.has('authorization'))
18
+ result.set('Authorization', `Bearer ${await token()}`);
19
+ return result;
20
+ }
21
+ //# sourceMappingURL=apply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../src/auth/apply.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,mGAAmG;AACnG,MAAM,UAAU,WAAW,CAAC,MAA8B,EAAE,MAAkB;IAC1E,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC/I,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,YAAY,CAAC,MAAoB,EAAE,MAAkB,EAAE,IAAwB;IAC3F,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,+FAA+F;AAC/F,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAgC,EAAE,KAA4B;IAC3F,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;QAAE,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,MAAM,KAAK,EAAE,EAAE,CAAC,CAAC;IACzF,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Per-role browser login: log each role in once in a setup project, save its
3
+ * browser state, and let tests start already logged in with
4
+ * `test.use({ authRole: 'admin' })`.
5
+ *
6
+ * // tests/e2e/auth.setup.ts
7
+ * import { setupAuth } from '@inluxc/propmaster';
8
+ *
9
+ * setupAuth({
10
+ * login: async ({ page }, { username, password }) => {
11
+ * await page.goto('/login');
12
+ * await page.getByLabel('Email').fill(username!);
13
+ * await page.getByLabel('Password').fill(password!);
14
+ * await page.getByRole('button', { name: 'Sign in' }).click();
15
+ * await page.waitForURL('**\/dashboard');
16
+ * },
17
+ * });
18
+ */
19
+ import type { BrowserContext, Page } from '@playwright/test';
20
+ import type { AuthConfig } from '../config/schema.js';
21
+ import { type ResolvedRole } from './token-manager.js';
22
+ export interface SetupAuthOptions {
23
+ /**
24
+ * Your app's login steps for one role. Use the credentials from config
25
+ * (`auth.roles.<role>`), never hard-coded ones.
26
+ */
27
+ login: (fixtures: {
28
+ page: Page;
29
+ context: BrowserContext;
30
+ }, role: ResolvedRole) => Promise<void>;
31
+ /**
32
+ * Roles to log in. Default: every role in `auth.roles` from environments.json
33
+ * / PW_AUTH_*, or the default role. Pass them when the roles are only set in
34
+ * a project's `use` block, which isn't known until the tests run.
35
+ */
36
+ roles?: string[];
37
+ /** Reuse a saved state younger than this many minutes instead of logging in again (default: always log in). */
38
+ maxAgeMinutes?: number;
39
+ /** Auth config (default: loaded from environments.json / PW_AUTH_* like the fixtures). */
40
+ config?: AuthConfig;
41
+ }
42
+ /** The roles setupAuth logs in when `roles` isn't given. */
43
+ export declare function rolesToSetUp(config: AuthConfig): string[];
44
+ /** True when the role's saved state exists and is younger than `maxAgeMinutes`. */
45
+ export declare function hasFreshAuthState(role: string, maxAgeMinutes: number, stateDir?: string): boolean;
46
+ /** Saves the context's cookies and storage as the role's login state. */
47
+ export declare function saveAuthState(context: BrowserContext, role: string, stateDir?: string): Promise<string>;
48
+ /** The role's credentials (its settings merged over the top-level auth config), for custom setup tests. */
49
+ export declare function authCredentials(role?: string, config?: AuthConfig): ResolvedRole;
50
+ /**
51
+ * Registers one setup test per role that runs `login` in a fresh browser
52
+ * context and saves the result to `.auth/<role>.json`. Call it at the top
53
+ * level of a `*.setup.ts` file run by a setup project the e2e projects depend on.
54
+ */
55
+ export declare function setupAuth(options: SetupAuthOptions): void;
56
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/auth/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAItD,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE9E,MAAM,WAAW,gBAAgB;IAC7B;;;OAGG;IACH,KAAK,EAAE,CAAC,QAAQ,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,cAAc,CAAA;KAAE,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChG;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,+GAA+G;IAC/G,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,UAAU,CAAC;CACvB;AAUD,4DAA4D;AAC5D,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE,CAGzD;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAGjG;AAED,yEAAyE;AACzE,wBAAsB,aAAa,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAK7G;AAED,2GAA2G;AAC3G,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,GAAE,UAA6B,GAAG,YAAY,CAElG;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAoBzD"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Per-role browser login: log each role in once in a setup project, save its
3
+ * browser state, and let tests start already logged in with
4
+ * `test.use({ authRole: 'admin' })`.
5
+ *
6
+ * // tests/e2e/auth.setup.ts
7
+ * import { setupAuth } from '@inluxc/propmaster';
8
+ *
9
+ * setupAuth({
10
+ * login: async ({ page }, { username, password }) => {
11
+ * await page.goto('/login');
12
+ * await page.getByLabel('Email').fill(username!);
13
+ * await page.getByLabel('Password').fill(password!);
14
+ * await page.getByRole('button', { name: 'Sign in' }).click();
15
+ * await page.waitForURL('**\/dashboard');
16
+ * },
17
+ * });
18
+ */
19
+ import { existsSync, mkdirSync, statSync } from 'node:fs';
20
+ import { dirname } from 'node:path';
21
+ import { ConfigLoader } from '../config/loader.js';
22
+ import { test } from '../fixtures/index.js';
23
+ import { authStateFile } from './state-file.js';
24
+ import { resolveRole, roleName } from './token-manager.js';
25
+ function loadAuthConfig() {
26
+ try {
27
+ return new ConfigLoader().load().auth ?? {};
28
+ }
29
+ catch {
30
+ return {};
31
+ }
32
+ }
33
+ /** The roles setupAuth logs in when `roles` isn't given. */
34
+ export function rolesToSetUp(config) {
35
+ const roles = Object.keys(config.roles ?? {});
36
+ return roles.length ? roles : [roleName(config)];
37
+ }
38
+ /** True when the role's saved state exists and is younger than `maxAgeMinutes`. */
39
+ export function hasFreshAuthState(role, maxAgeMinutes, stateDir) {
40
+ const file = authStateFile(role, stateDir);
41
+ return existsSync(file) && Date.now() - statSync(file).mtimeMs < maxAgeMinutes * 60_000;
42
+ }
43
+ /** Saves the context's cookies and storage as the role's login state. */
44
+ export async function saveAuthState(context, role, stateDir) {
45
+ const file = authStateFile(role, stateDir);
46
+ mkdirSync(dirname(file), { recursive: true });
47
+ await context.storageState({ path: file });
48
+ return file;
49
+ }
50
+ /** The role's credentials (its settings merged over the top-level auth config), for custom setup tests. */
51
+ export function authCredentials(role, config = loadAuthConfig()) {
52
+ return resolveRole(config, role);
53
+ }
54
+ /**
55
+ * Registers one setup test per role that runs `login` in a fresh browser
56
+ * context and saves the result to `.auth/<role>.json`. Call it at the top
57
+ * level of a `*.setup.ts` file run by a setup project the e2e projects depend on.
58
+ */
59
+ export function setupAuth(options) {
60
+ // The roles must be known now, to register one setup test each.
61
+ const roles = options.roles ?? rolesToSetUp(options.config ?? loadAuthConfig());
62
+ for (const role of roles) {
63
+ // Setup steps, not test cases: no TestCaseID (setup files aren't checked by `propmaster check`).
64
+ test(`log in as ${role}`, async ({ page, context, authConfig }) => {
65
+ // Credentials and paths at run time, so a project's `use: { auth }` applies.
66
+ const config = options.config ?? authConfig ?? loadAuthConfig();
67
+ if (options.maxAgeMinutes !== undefined && hasFreshAuthState(role, options.maxAgeMinutes, config.stateDir)) {
68
+ test.skip(true, `saved login state for "${role}" is younger than ${options.maxAgeMinutes} minutes`);
69
+ }
70
+ await test.step(`Log in as ${role}`, async () => {
71
+ await options.login({ page, context }, resolveRole(config, role));
72
+ });
73
+ await test.step(`Save the login state for ${role}`, async () => {
74
+ await saveAuthState(context, role, config.stateDir);
75
+ });
76
+ });
77
+ }
78
+ }
79
+ //# sourceMappingURL=setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/auth/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AAoB9E,SAAS,cAAc;IACnB,IAAI,CAAC;QACD,OAAO,IAAI,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,EAAE,CAAC;IACd,CAAC;AACL,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,YAAY,CAAC,MAAkB;IAC3C,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC9C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,aAAqB,EAAE,QAAiB;IACpF,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,GAAG,aAAa,GAAG,MAAM,CAAC;AAC5F,CAAC;AAED,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAuB,EAAE,IAAY,EAAE,QAAiB;IACxF,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC3C,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,MAAM,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,2GAA2G;AAC3G,MAAM,UAAU,eAAe,CAAC,IAAa,EAAE,MAAM,GAAe,cAAc,EAAE;IAChF,OAAO,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,OAAyB;IAC/C,gEAAgE;IAChE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,IAAI,cAAc,EAAE,CAAC,CAAC;IAEhF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,iGAAiG;QACjG,IAAI,CAAC,aAAa,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;YAC9D,6EAA6E;YAC7E,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,UAAU,IAAI,cAAc,EAAE,CAAC;YAChE,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS,IAAI,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACzG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,0BAA0B,IAAI,qBAAqB,OAAO,CAAC,aAAa,UAAU,CAAC,CAAC;YACxG,CAAC;YACD,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,EAAE,KAAK,IAAI,EAAE;gBAC5C,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;YACtE,CAAC,CAAC,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC,4BAA4B,IAAI,EAAE,EAAE,KAAK,IAAI,EAAE;gBAC3D,MAAM,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;YACxD,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Where a role's saved browser login state (Playwright `storageState`) lives.
3
+ * Kept free of fixture imports so the fixture registry can use it.
4
+ */
5
+ export declare const DEFAULT_STATE_DIR = ".auth";
6
+ /** Absolute path of a role's saved login state, e.g. `<cwd>/.auth/admin.json`. */
7
+ export declare function authStateFile(role: string, stateDir?: string): string;
8
+ //# sourceMappingURL=state-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-file.d.ts","sourceRoot":"","sources":["../../../src/auth/state-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,iBAAiB,UAAU,CAAC;AAEzC,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAA0B,GAAG,MAAM,CAGxF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Where a role's saved browser login state (Playwright `storageState`) lives.
3
+ * Kept free of fixture imports so the fixture registry can use it.
4
+ */
5
+ import { resolve } from 'node:path';
6
+ export const DEFAULT_STATE_DIR = '.auth';
7
+ /** Absolute path of a role's saved login state, e.g. `<cwd>/.auth/admin.json`. */
8
+ export function authStateFile(role, stateDir = DEFAULT_STATE_DIR) {
9
+ if (!/^[\w.-]+$/.test(role))
10
+ throw new Error(`invalid role name "${role}": use letters, digits, '.', '_' or '-'`);
11
+ return resolve(stateDir, `${role}.json`);
12
+ }
13
+ //# sourceMappingURL=state-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-file.js","sourceRoot":"","sources":["../../../src/auth/state-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAEzC,kFAAkF;AAClF,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,QAAQ,GAAW,iBAAiB;IAC5E,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,yCAAyC,CAAC,CAAC;IAClH,OAAO,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,OAAO,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * OAuth 2.0 / OIDC access tokens for tests.
3
+ *
4
+ * One TokenManager lives per Playwright worker (the `propmasterAuth` worker
5
+ * fixture). It fetches a token the first time a role needs one, caches it,
6
+ * and gets a new one shortly before it expires — with the refresh token when
7
+ * the server issued one, otherwise with a fresh grant. Concurrent requests for
8
+ * the same role share one network call.
9
+ *
10
+ * Secrets never appear in errors: messages name the endpoint, role, client ID
11
+ * and the server's `error`/`error_description`, nothing else.
12
+ *
13
+ * Uses Node's built-in fetch; no package needed.
14
+ */
15
+ import type { AuthConfig } from '../config/schema.js';
16
+ export declare const DEFAULT_ROLE = "default";
17
+ export interface TokenSet {
18
+ accessToken: string;
19
+ tokenType: string;
20
+ /** Epoch ms. */
21
+ expiresAt: number;
22
+ refreshToken?: string;
23
+ idToken?: string;
24
+ }
25
+ /** A role's effective settings: the role's own values over the top-level ones. */
26
+ export interface ResolvedRole {
27
+ name: string;
28
+ clientId?: string;
29
+ clientSecret?: string;
30
+ username?: string;
31
+ password?: string;
32
+ scope?: string;
33
+ grantType: 'client_credentials' | 'password';
34
+ extra: Record<string, string>;
35
+ }
36
+ /** The role a test uses: `authRole`, else `defaultRole`, else `default`. */
37
+ export declare function roleName(config: AuthConfig, authRole?: string): string;
38
+ /** Merges a role's settings over the top-level ones. Unknown roles fail with the list of known ones. */
39
+ export declare function resolveRole(config: AuthConfig, authRole?: string): ResolvedRole;
40
+ /** `exp` from a JWT, without verifying it (only to schedule a refresh). */
41
+ export declare function jwtExpiry(token: string): number | undefined;
42
+ type Fetch = typeof fetch;
43
+ export declare class TokenManager {
44
+ private readonly fetchImpl;
45
+ private readonly now;
46
+ private readonly tokens;
47
+ private readonly pending;
48
+ private readonly endpoints;
49
+ constructor(fetchImpl?: Fetch, now?: () => number);
50
+ /** A valid access token for the role, fetched or refreshed as needed. */
51
+ getToken(config: AuthConfig, authRole?: string): Promise<string>;
52
+ getTokenSet(config: AuthConfig, authRole?: string): Promise<TokenSet>;
53
+ /** Forgets cached tokens (all, or one role's), e.g. after the server revoked them. */
54
+ invalidate(authRole?: string): void;
55
+ /** `tokenUrl`, or the issuer's discovery document's `token_endpoint`. */
56
+ tokenEndpoint(config: AuthConfig): Promise<string>;
57
+ private obtain;
58
+ private request;
59
+ }
60
+ export {};
61
+ //# sourceMappingURL=token-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-manager.d.ts","sourceRoot":"","sources":["../../../src/auth/token-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,qBAAqB,CAAC;AAGtE,eAAO,MAAM,YAAY,YAAY,CAAC;AAKtC,MAAM,WAAW,QAAQ;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,kFAAkF;AAClF,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,oBAAoB,GAAG,UAAU,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wGAAwG;AACxG,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,CAsB/E;AAED,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAS3D;AAED,KAAK,KAAK,GAAG,OAAO,KAAK,CAAC;AAE1B,qBAAa,YAAY;IAMjB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG;IANxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+B;IACtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwC;IAChE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsC;IAEhE,YACqB,SAAS,GAAE,KAAmC,EAC9C,GAAG,GAAE,MAAM,MAAiB,EAC7C;IAEJ,yEAAyE;IACnE,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAErE;IAEK,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAkB1E;IAED,sFAAsF;IACtF,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAGlC;IAED,yEAAyE;IACzE,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBjD;YAEa,MAAM;YAqBN,OAAO;CA2CxB"}