@tellescope/sdk 1.256.14 → 1.256.15

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 (283) hide show
  1. package/lib/cjs/tests/api_tests/auto_merge_form_submission.test.js +1 -1
  2. package/lib/cjs/tests/api_tests/auto_merge_form_submission.test.js.map +1 -1
  3. package/lib/cjs/tests/api_tests/enduser_observations_auto_review.test.d.ts +5 -0
  4. package/lib/cjs/tests/api_tests/enduser_observations_auto_review.test.d.ts.map +1 -0
  5. package/lib/cjs/tests/api_tests/enduser_observations_auto_review.test.js +388 -0
  6. package/lib/cjs/tests/api_tests/enduser_observations_auto_review.test.js.map +1 -0
  7. package/lib/cjs/tests/api_tests/integrations_redacted.test.js +3 -3
  8. package/lib/cjs/tests/api_tests/integrations_redacted.test.js.map +1 -1
  9. package/lib/cjs/tests/api_tests/organization_signup.test.d.ts +1 -1
  10. package/lib/cjs/tests/api_tests/organization_signup.test.js +1 -1
  11. package/lib/cjs/tests/api_tests/purchase_made_trigger.test.d.ts.map +1 -1
  12. package/lib/cjs/tests/api_tests/purchase_made_trigger.test.js +103 -162
  13. package/lib/cjs/tests/api_tests/purchase_made_trigger.test.js.map +1 -1
  14. package/lib/cjs/tests/api_tests/security/F-0200-form-logic-js-execution.test.d.ts +33 -0
  15. package/lib/cjs/tests/api_tests/security/F-0200-form-logic-js-execution.test.d.ts.map +1 -0
  16. package/lib/cjs/tests/api_tests/security/F-0200-form-logic-js-execution.test.js +249 -0
  17. package/lib/cjs/tests/api_tests/security/F-0200-form-logic-js-execution.test.js.map +1 -0
  18. package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts +42 -0
  19. package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts.map +1 -0
  20. package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js +281 -0
  21. package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js.map +1 -0
  22. package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.d.ts +38 -0
  23. package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.d.ts.map +1 -0
  24. package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.js +390 -0
  25. package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.js.map +1 -0
  26. package/lib/cjs/tests/api_tests/security/allowed-paths-confinement.test.d.ts +6 -0
  27. package/lib/cjs/tests/api_tests/security/allowed-paths-confinement.test.d.ts.map +1 -0
  28. package/lib/cjs/tests/api_tests/security/allowed-paths-confinement.test.js +1003 -0
  29. package/lib/cjs/tests/api_tests/security/allowed-paths-confinement.test.js.map +1 -0
  30. package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.d.ts +42 -0
  31. package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.d.ts.map +1 -0
  32. package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.js +323 -0
  33. package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.js.map +1 -0
  34. package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts +29 -0
  35. package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts.map +1 -0
  36. package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.js +335 -0
  37. package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.js.map +1 -0
  38. package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts +32 -0
  39. package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts.map +1 -0
  40. package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js +237 -0
  41. package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js.map +1 -0
  42. package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts +28 -0
  43. package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts.map +1 -0
  44. package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.js +349 -0
  45. package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.js.map +1 -0
  46. package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts +30 -0
  47. package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts.map +1 -0
  48. package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js +314 -0
  49. package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js.map +1 -0
  50. package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.d.ts +21 -0
  51. package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.d.ts.map +1 -0
  52. package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.js +362 -0
  53. package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.js.map +1 -0
  54. package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.d.ts +21 -0
  55. package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.d.ts.map +1 -0
  56. package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.js +366 -0
  57. package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.js.map +1 -0
  58. package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.d.ts +32 -0
  59. package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.d.ts.map +1 -0
  60. package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.js +248 -0
  61. package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.js.map +1 -0
  62. package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts +19 -0
  63. package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts.map +1 -0
  64. package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.js +138 -0
  65. package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.js.map +1 -0
  66. package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts +24 -0
  67. package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts.map +1 -0
  68. package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js +201 -0
  69. package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js.map +1 -0
  70. package/lib/cjs/tests/api_tests/security/invite-user-enumeration.test.d.ts +29 -0
  71. package/lib/cjs/tests/api_tests/security/invite-user-enumeration.test.d.ts.map +1 -0
  72. package/lib/cjs/tests/api_tests/security/invite-user-enumeration.test.js +278 -0
  73. package/lib/cjs/tests/api_tests/security/invite-user-enumeration.test.js.map +1 -0
  74. package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.d.ts +17 -0
  75. package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.d.ts.map +1 -0
  76. package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.js +155 -0
  77. package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.js.map +1 -0
  78. package/lib/cjs/tests/api_tests/security/prototype-pollution.test.d.ts +2 -0
  79. package/lib/cjs/tests/api_tests/security/prototype-pollution.test.d.ts.map +1 -0
  80. package/lib/cjs/tests/api_tests/security/prototype-pollution.test.js +88 -0
  81. package/lib/cjs/tests/api_tests/security/prototype-pollution.test.js.map +1 -0
  82. package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts +34 -0
  83. package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts.map +1 -0
  84. package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.js +230 -0
  85. package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.js.map +1 -0
  86. package/lib/cjs/tests/api_tests/security/sanitize-user-html-with-iframes.test.d.ts +2 -0
  87. package/lib/cjs/tests/api_tests/security/sanitize-user-html-with-iframes.test.d.ts.map +1 -0
  88. package/lib/cjs/tests/api_tests/security/sanitize-user-html-with-iframes.test.js +242 -0
  89. package/lib/cjs/tests/api_tests/security/sanitize-user-html-with-iframes.test.js.map +1 -0
  90. package/lib/cjs/tests/api_tests/security/sanitize-user-html.test.d.ts +2 -0
  91. package/lib/cjs/tests/api_tests/security/sanitize-user-html.test.d.ts.map +1 -0
  92. package/lib/cjs/tests/api_tests/security/sanitize-user-html.test.js +148 -0
  93. package/lib/cjs/tests/api_tests/security/sanitize-user-html.test.js.map +1 -0
  94. package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts +45 -0
  95. package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts.map +1 -0
  96. package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.js +388 -0
  97. package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.js.map +1 -0
  98. package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.d.ts +38 -0
  99. package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.d.ts.map +1 -0
  100. package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.js +222 -0
  101. package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.js.map +1 -0
  102. package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts +6 -0
  103. package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts.map +1 -0
  104. package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js +354 -0
  105. package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js.map +1 -0
  106. package/lib/cjs/tests/api_tests/security/webhook-outbound-ssrf.test.d.ts +28 -0
  107. package/lib/cjs/tests/api_tests/security/webhook-outbound-ssrf.test.d.ts.map +1 -0
  108. package/lib/cjs/tests/api_tests/security/webhook-outbound-ssrf.test.js +442 -0
  109. package/lib/cjs/tests/api_tests/security/webhook-outbound-ssrf.test.js.map +1 -0
  110. package/lib/cjs/tests/api_tests/security/webhook-timeout.test.d.ts +19 -0
  111. package/lib/cjs/tests/api_tests/security/webhook-timeout.test.d.ts.map +1 -0
  112. package/lib/cjs/tests/api_tests/security/webhook-timeout.test.js +156 -0
  113. package/lib/cjs/tests/api_tests/security/webhook-timeout.test.js.map +1 -0
  114. package/lib/cjs/tests/api_tests/webhook_error_handling.test.js +2 -2
  115. package/lib/cjs/tests/api_tests/webhook_error_handling.test.js.map +1 -1
  116. package/lib/cjs/tests/tests.d.ts.map +1 -1
  117. package/lib/cjs/tests/tests.js +58 -46
  118. package/lib/cjs/tests/tests.js.map +1 -1
  119. package/lib/cjs/tests/unit_tests/openapi_spec_freshness.test.d.ts +1 -1
  120. package/lib/cjs/tests/unit_tests/openapi_spec_freshness.test.js +1 -1
  121. package/lib/cjs/tsconfig.cjs.tsbuildinfo +1 -0
  122. package/lib/esm/enduser.d.ts +0 -1
  123. package/lib/esm/enduser.d.ts.map +1 -1
  124. package/lib/esm/sdk.d.ts +2 -3
  125. package/lib/esm/sdk.d.ts.map +1 -1
  126. package/lib/esm/session.d.ts +0 -1
  127. package/lib/esm/session.d.ts.map +1 -1
  128. package/lib/esm/tests/api_tests/auto_merge_form_submission.test.js +1 -1
  129. package/lib/esm/tests/api_tests/auto_merge_form_submission.test.js.map +1 -1
  130. package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.d.ts +5 -0
  131. package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.d.ts.map +1 -0
  132. package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.js +383 -0
  133. package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.js.map +1 -0
  134. package/lib/esm/tests/api_tests/integrations_redacted.test.js +3 -3
  135. package/lib/esm/tests/api_tests/integrations_redacted.test.js.map +1 -1
  136. package/lib/esm/tests/api_tests/organization_signup.test.d.ts +1 -1
  137. package/lib/esm/tests/api_tests/organization_signup.test.js +1 -1
  138. package/lib/esm/tests/api_tests/purchase_made_trigger.test.d.ts.map +1 -1
  139. package/lib/esm/tests/api_tests/purchase_made_trigger.test.js +104 -163
  140. package/lib/esm/tests/api_tests/purchase_made_trigger.test.js.map +1 -1
  141. package/lib/esm/tests/api_tests/security/F-0200-form-logic-js-execution.test.d.ts +33 -0
  142. package/lib/esm/tests/api_tests/security/F-0200-form-logic-js-execution.test.d.ts.map +1 -0
  143. package/lib/esm/tests/api_tests/security/F-0200-form-logic-js-execution.test.js +244 -0
  144. package/lib/esm/tests/api_tests/security/F-0200-form-logic-js-execution.test.js.map +1 -0
  145. package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts +42 -0
  146. package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts.map +1 -0
  147. package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js +276 -0
  148. package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js.map +1 -0
  149. package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.d.ts +38 -0
  150. package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.d.ts.map +1 -0
  151. package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.js +386 -0
  152. package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.js.map +1 -0
  153. package/lib/esm/tests/api_tests/security/allowed-paths-confinement.test.d.ts +6 -0
  154. package/lib/esm/tests/api_tests/security/allowed-paths-confinement.test.d.ts.map +1 -0
  155. package/lib/esm/tests/api_tests/security/allowed-paths-confinement.test.js +996 -0
  156. package/lib/esm/tests/api_tests/security/allowed-paths-confinement.test.js.map +1 -0
  157. package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.d.ts +42 -0
  158. package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.d.ts.map +1 -0
  159. package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.js +316 -0
  160. package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.js.map +1 -0
  161. package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts +29 -0
  162. package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts.map +1 -0
  163. package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.js +331 -0
  164. package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.js.map +1 -0
  165. package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts +32 -0
  166. package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts.map +1 -0
  167. package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js +233 -0
  168. package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js.map +1 -0
  169. package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts +28 -0
  170. package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts.map +1 -0
  171. package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.js +345 -0
  172. package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.js.map +1 -0
  173. package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts +30 -0
  174. package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts.map +1 -0
  175. package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js +310 -0
  176. package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js.map +1 -0
  177. package/lib/esm/tests/api_tests/security/enduser-cross-create.test.d.ts +21 -0
  178. package/lib/esm/tests/api_tests/security/enduser-cross-create.test.d.ts.map +1 -0
  179. package/lib/esm/tests/api_tests/security/enduser-cross-create.test.js +358 -0
  180. package/lib/esm/tests/api_tests/security/enduser-cross-create.test.js.map +1 -0
  181. package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.d.ts +21 -0
  182. package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.d.ts.map +1 -0
  183. package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.js +362 -0
  184. package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.js.map +1 -0
  185. package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.d.ts +32 -0
  186. package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.d.ts.map +1 -0
  187. package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.js +243 -0
  188. package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.js.map +1 -0
  189. package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts +19 -0
  190. package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts.map +1 -0
  191. package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.js +134 -0
  192. package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.js.map +1 -0
  193. package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts +24 -0
  194. package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts.map +1 -0
  195. package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js +194 -0
  196. package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js.map +1 -0
  197. package/lib/esm/tests/api_tests/security/invite-user-enumeration.test.d.ts +29 -0
  198. package/lib/esm/tests/api_tests/security/invite-user-enumeration.test.d.ts.map +1 -0
  199. package/lib/esm/tests/api_tests/security/invite-user-enumeration.test.js +271 -0
  200. package/lib/esm/tests/api_tests/security/invite-user-enumeration.test.js.map +1 -0
  201. package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.d.ts +17 -0
  202. package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.d.ts.map +1 -0
  203. package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.js +151 -0
  204. package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.js.map +1 -0
  205. package/lib/esm/tests/api_tests/security/prototype-pollution.test.d.ts +2 -0
  206. package/lib/esm/tests/api_tests/security/prototype-pollution.test.d.ts.map +1 -0
  207. package/lib/esm/tests/api_tests/security/prototype-pollution.test.js +84 -0
  208. package/lib/esm/tests/api_tests/security/prototype-pollution.test.js.map +1 -0
  209. package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts +34 -0
  210. package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts.map +1 -0
  211. package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.js +223 -0
  212. package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.js.map +1 -0
  213. package/lib/esm/tests/api_tests/security/sanitize-user-html-with-iframes.test.d.ts +2 -0
  214. package/lib/esm/tests/api_tests/security/sanitize-user-html-with-iframes.test.d.ts.map +1 -0
  215. package/lib/esm/tests/api_tests/security/sanitize-user-html-with-iframes.test.js +238 -0
  216. package/lib/esm/tests/api_tests/security/sanitize-user-html-with-iframes.test.js.map +1 -0
  217. package/lib/esm/tests/api_tests/security/sanitize-user-html.test.d.ts +2 -0
  218. package/lib/esm/tests/api_tests/security/sanitize-user-html.test.d.ts.map +1 -0
  219. package/lib/esm/tests/api_tests/security/sanitize-user-html.test.js +144 -0
  220. package/lib/esm/tests/api_tests/security/sanitize-user-html.test.js.map +1 -0
  221. package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts +45 -0
  222. package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts.map +1 -0
  223. package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.js +381 -0
  224. package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.js.map +1 -0
  225. package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.d.ts +38 -0
  226. package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.d.ts.map +1 -0
  227. package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.js +218 -0
  228. package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.js.map +1 -0
  229. package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts +6 -0
  230. package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts.map +1 -0
  231. package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js +350 -0
  232. package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js.map +1 -0
  233. package/lib/esm/tests/api_tests/security/webhook-outbound-ssrf.test.d.ts +28 -0
  234. package/lib/esm/tests/api_tests/security/webhook-outbound-ssrf.test.d.ts.map +1 -0
  235. package/lib/esm/tests/api_tests/security/webhook-outbound-ssrf.test.js +435 -0
  236. package/lib/esm/tests/api_tests/security/webhook-outbound-ssrf.test.js.map +1 -0
  237. package/lib/esm/tests/api_tests/security/webhook-timeout.test.d.ts +19 -0
  238. package/lib/esm/tests/api_tests/security/webhook-timeout.test.d.ts.map +1 -0
  239. package/lib/esm/tests/api_tests/security/webhook-timeout.test.js +149 -0
  240. package/lib/esm/tests/api_tests/security/webhook-timeout.test.js.map +1 -0
  241. package/lib/esm/tests/api_tests/webhook_error_handling.test.js +2 -2
  242. package/lib/esm/tests/api_tests/webhook_error_handling.test.js.map +1 -1
  243. package/lib/esm/tests/tests.d.ts.map +1 -1
  244. package/lib/esm/tests/tests.js +36 -24
  245. package/lib/esm/tests/tests.js.map +1 -1
  246. package/lib/esm/tests/unit_tests/openapi_spec_freshness.test.d.ts +1 -1
  247. package/lib/esm/tests/unit_tests/openapi_spec_freshness.test.js +1 -1
  248. package/lib/tsconfig.tsbuildinfo +1 -1
  249. package/package.json +10 -10
  250. package/src/tests/api_tests/auto_merge_form_submission.test.ts +1 -1
  251. package/src/tests/api_tests/enduser_observations_auto_review.test.ts +358 -0
  252. package/src/tests/api_tests/integrations_redacted.test.ts +1 -1
  253. package/src/tests/api_tests/organization_signup.test.ts +2 -2
  254. package/src/tests/api_tests/purchase_made_trigger.test.ts +29 -41
  255. package/src/tests/api_tests/security/{F-0196-add-to-journey-foreign-enduserid.test.ts → add-to-journey-foreign-enduserid.test.ts} +6 -7
  256. package/src/tests/api_tests/security/{F-0005-ai-conversations-rbac.test.ts → ai-conversations-rbac.test.ts} +14 -14
  257. package/src/tests/api_tests/security/{F-0166-allowed-paths-wildcard-bypass.test.ts → allowed-paths-confinement.test.ts} +11 -11
  258. package/src/tests/api_tests/security/{F-0192-automated-actions-process-gate.test.ts → automated-actions-process-gate.test.ts} +6 -7
  259. package/src/tests/api_tests/security/{F-0179-booking-info-idor-token-mint.test.ts → booking-info-idor-token-mint.test.ts} +5 -6
  260. package/src/tests/api_tests/security/{F-0053-cascade-role-rename-cross-tenant.test.ts → cascade-role-rename-cross-tenant.test.ts} +10 -10
  261. package/src/tests/api_tests/security/{F-0001-data-sync-redaction-bypass.test.ts → data-sync-redaction-bypass.test.ts} +9 -9
  262. package/src/tests/api_tests/security/{F-0006-develop-health-benefit-verification-rbac.test.ts → develop-health-benefit-verification-rbac.test.ts} +7 -8
  263. package/src/tests/api_tests/security/{F-0116-F-0119-enduser-cross-create.test.ts → enduser-cross-create.test.ts} +25 -25
  264. package/src/tests/api_tests/security/{F-0106-F-0110-enduser-write-restrictions.test.ts → enduser-write-restrictions.test.ts} +12 -14
  265. package/src/tests/api_tests/security/form-logic-js-execution.test.ts +183 -0
  266. package/src/tests/api_tests/security/{F-0145-globalunique-leak.test.ts → globalunique-conflict-redaction.test.ts} +5 -6
  267. package/src/tests/api_tests/security/{F-0008-handle-incoming-communication-cross-tenant.test.ts → handle-incoming-communication-cross-tenant.test.ts} +8 -8
  268. package/src/tests/api_tests/security/{F-0007-invite-user-enumeration.test.ts → invite-user-enumeration.test.ts} +8 -8
  269. package/src/tests/api_tests/security/{F-0151-load-inbox-redaction.test.ts → load-inbox-redaction.test.ts} +5 -6
  270. package/src/tests/api_tests/security/{F-0016-prototype-pollution.test.ts → prototype-pollution.test.ts} +4 -4
  271. package/src/tests/api_tests/security/{F-0025-proxy-image-unauth-ssrf.test.ts → proxy-image-unauth-ssrf.test.ts} +11 -12
  272. package/src/tests/api_tests/security/{F-0013-sanitize-user-html-with-iframes.test.ts → sanitize-user-html-with-iframes.test.ts} +5 -5
  273. package/src/tests/api_tests/security/{F-0013-sanitize-user-html.test.ts → sanitize-user-html.test.ts} +4 -4
  274. package/src/tests/api_tests/security/{F-0191-schema-adminonly-enforcement.test.ts → schema-adminonly-enforcement.test.ts} +6 -7
  275. package/src/tests/api_tests/security/{F-0076-self-admin-role-assignment.test.ts → self-admin-role-assignment.test.ts} +13 -13
  276. package/src/tests/api_tests/security/{F-0185-startlinktoken-enduser-staff-escalation.test.ts → startlinktoken-enduser-staff-escalation.test.ts} +6 -6
  277. package/src/tests/api_tests/security/{F-0015-webhook-outbound-ssrf.test.ts → webhook-outbound-ssrf.test.ts} +13 -14
  278. package/src/tests/api_tests/security/{F-0155-webhook-timeout.test.ts → webhook-timeout.test.ts} +6 -7
  279. package/src/tests/api_tests/webhook_error_handling.test.ts +1 -1
  280. package/src/tests/tests.ts +41 -24
  281. package/src/tests/unit_tests/openapi_spec_freshness.test.ts +1 -1
  282. package/test_generated.pdf +0 -0
  283. package/src/tests/api_tests/security/readonly-enduser-preview.test.ts +0 -301
@@ -0,0 +1,28 @@
1
+ import { Session } from "../../../sdk";
2
+ /**
3
+ * Regression test: `/v1/data-sync` redaction.
4
+ *
5
+ * The /v1/data-sync handler must apply the central applyRedactions() pipeline to
6
+ * every non-deleted record. The original bug: redactions were gated behind
7
+ * `if (session.fieldRedactions && session.fieldRedactions[record.modelName])`
8
+ * which meant any session without role-based field redactions (including all
9
+ * admins) received raw records — leaking schema-level `redactions: ['all']`
10
+ * fields (hashedPass, hashedPassword, hashedInviteCode).
11
+ *
12
+ * This test:
13
+ * 1. Configures a non-admin user with broad read access on users + endusers
14
+ * and NO fieldRedactions — the realistic "regular user with read access"
15
+ * condition that triggers the bypass.
16
+ * 2. Creates an enduser with a password to populate the sync stream.
17
+ * 3. Calls /v1/data-sync as the non-admin.
18
+ * 4. Asserts no returned record contains hashedPass / hashedPassword /
19
+ * hashedInviteCode.
20
+ *
21
+ * Pre-fix: assertion fails with leaked records.
22
+ * Post-fix: assertion passes.
23
+ */
24
+ export declare const data_sync_redaction_bypass_tests: ({ sdk, sdkNonAdmin }: {
25
+ sdk: Session;
26
+ sdkNonAdmin: Session;
27
+ }) => Promise<void>;
28
+ //# sourceMappingURL=data-sync-redaction-bypass.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-sync-redaction-bypass.test.d.ts","sourceRoot":"","sources":["../../../../../src/tests/api_tests/security/data-sync-redaction-bypass.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAwCtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,gCAAgC;SAAwC,OAAO;iBAAe,OAAO;mBAqJjH,CAAA"}
@@ -0,0 +1,345 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ require('source-map-support').install();
49
+ import { Session } from "../../../sdk";
50
+ import { async_test, log_header, wait, } from "@tellescope/testing";
51
+ import { setup_tests } from "../../setup";
52
+ import { PROVIDER_PERMISSIONS } from "@tellescope/constants";
53
+ var host = process.env.API_URL || 'http://localhost:8080';
54
+ var _a = [process.env.NON_ADMIN_EMAIL, process.env.NON_ADMIN_PASSWORD], nonAdminEmail = _a[0], nonAdminPassword = _a[1];
55
+ var FULL_ACCESS = { create: 'All', read: 'All', update: 'All', delete: 'All' };
56
+ // Schema fields tagged `redactions: ['all']` that must never appear in
57
+ // `/v1/data-sync` results. See packages/public/schema/src/schema.ts.
58
+ var REDACTABLE_FIELDS_BY_MODEL = {
59
+ users: ['hashedPass', 'hashedInviteCode'],
60
+ endusers: ['hashedPassword'],
61
+ };
62
+ var collectViolations = function (results) {
63
+ var violations = [];
64
+ for (var _i = 0, results_1 = results; _i < results_1.length; _i++) {
65
+ var record = results_1[_i];
66
+ if (!record.data || record.data === 'deleted')
67
+ continue;
68
+ var fields = REDACTABLE_FIELDS_BY_MODEL[record.modelName];
69
+ if (!fields)
70
+ continue;
71
+ var parsed = void 0;
72
+ try {
73
+ parsed = JSON.parse(record.data);
74
+ }
75
+ catch (_a) {
76
+ continue;
77
+ }
78
+ for (var _b = 0, fields_1 = fields; _b < fields_1.length; _b++) {
79
+ var f = fields_1[_b];
80
+ if (f in parsed && parsed[f] !== undefined && parsed[f] !== null && parsed[f] !== '') {
81
+ violations.push({ modelName: record.modelName, recordId: record.recordId, leakedField: f });
82
+ }
83
+ }
84
+ }
85
+ return violations;
86
+ };
87
+ /**
88
+ * Regression test: `/v1/data-sync` redaction.
89
+ *
90
+ * The /v1/data-sync handler must apply the central applyRedactions() pipeline to
91
+ * every non-deleted record. The original bug: redactions were gated behind
92
+ * `if (session.fieldRedactions && session.fieldRedactions[record.modelName])`
93
+ * which meant any session without role-based field redactions (including all
94
+ * admins) received raw records — leaking schema-level `redactions: ['all']`
95
+ * fields (hashedPass, hashedPassword, hashedInviteCode).
96
+ *
97
+ * This test:
98
+ * 1. Configures a non-admin user with broad read access on users + endusers
99
+ * and NO fieldRedactions — the realistic "regular user with read access"
100
+ * condition that triggers the bypass.
101
+ * 2. Creates an enduser with a password to populate the sync stream.
102
+ * 3. Calls /v1/data-sync as the non-admin.
103
+ * 4. Asserts no returned record contains hashedPass / hashedPassword /
104
+ * hashedInviteCode.
105
+ *
106
+ * Pre-fix: assertion fails with leaked records.
107
+ * Post-fix: assertion passes.
108
+ */
109
+ export var data_sync_redaction_bypass_tests = function (_a) {
110
+ var sdk = _a.sdk, sdkNonAdmin = _a.sdkNonAdmin;
111
+ return __awaiter(void 0, void 0, void 0, function () {
112
+ var roleName, testEnduserId, rbapId, originalRoles, rbap, testEnduser, sync_1, violations_1, userRecordsInStream_1, adminSync, adminViolations_1, otherUsersInStream_2, linkedAccountLeaks_1, _i, otherUsersInStream_1, record, parsed, _b, _c, _d, _e;
113
+ return __generator(this, function (_f) {
114
+ switch (_f.label) {
115
+ case 0:
116
+ log_header("/v1/data-sync field-redaction bypass regression");
117
+ roleName = "f0001-data-sync-bypass-".concat(Date.now());
118
+ originalRoles = sdkNonAdmin.userInfo.roles;
119
+ _f.label = 1;
120
+ case 1:
121
+ _f.trys.push([1, , 15, 32]);
122
+ return [4 /*yield*/, sdk.api.role_based_access_permissions.createOne({
123
+ role: roleName,
124
+ permissions: __assign(__assign({}, PROVIDER_PERMISSIONS), { users: FULL_ACCESS, endusers: FULL_ACCESS }),
125
+ // intentionally NO fieldRedactions — this is the exploit condition.
126
+ })];
127
+ case 2:
128
+ rbap = _f.sent();
129
+ rbapId = rbap.id;
130
+ // 2. Assign role to the non-admin user and re-authenticate so the new
131
+ // session reflects the role's permissions.
132
+ return [4 /*yield*/, sdk.api.users.updateOne(sdkNonAdmin.userInfo.id, { roles: [roleName] }, { replaceObjectFields: true })];
133
+ case 3:
134
+ // 2. Assign role to the non-admin user and re-authenticate so the new
135
+ // session reflects the role's permissions.
136
+ _f.sent();
137
+ return [4 /*yield*/, wait(undefined, 1500)];
138
+ case 4:
139
+ _f.sent();
140
+ return [4 /*yield*/, sdkNonAdmin.authenticate(nonAdminEmail, nonAdminPassword)
141
+ // 3. Create a test enduser and set a password — this populates
142
+ // `hashedPassword` on the enduser record and writes a data_sync_records
143
+ // row for it.
144
+ ];
145
+ case 5:
146
+ _f.sent();
147
+ return [4 /*yield*/, sdk.api.endusers.createOne({
148
+ fname: 'F0001Target',
149
+ lname: 'Patient',
150
+ email: "f0001-target-".concat(Date.now(), "@example.com"),
151
+ })];
152
+ case 6:
153
+ testEnduser = _f.sent();
154
+ testEnduserId = testEnduser.id;
155
+ return [4 /*yield*/, sdk.api.endusers.set_password({ id: testEnduser.id, password: 'F0001TestPassword!123' })
156
+ // The non-admin user's own `hashedPass` is set from login and refreshed
157
+ // on every write to their user record (e.g., the role-assignment update
158
+ // above). No extra setup needed for users.hashedPass to be in the stream.
159
+ ];
160
+ case 7:
161
+ _f.sent();
162
+ // The non-admin user's own `hashedPass` is set from login and refreshed
163
+ // on every write to their user record (e.g., the role-assignment update
164
+ // above). No extra setup needed for users.hashedPass to be in the stream.
165
+ return [4 /*yield*/, wait(undefined, 500)
166
+ // 4. As the non-admin, call /v1/data-sync from epoch zero to capture all
167
+ // sync records the role can see.
168
+ ];
169
+ case 8:
170
+ // The non-admin user's own `hashedPass` is set from login and refreshed
171
+ // on every write to their user record (e.g., the role-assignment update
172
+ // above). No extra setup needed for users.hashedPass to be in the stream.
173
+ _f.sent();
174
+ return [4 /*yield*/, sdkNonAdmin.sync({ from: new Date(0) })
175
+ // 5. Walk every record. Fail if any contains a `redactions: ['all']` field.
176
+ ];
177
+ case 9:
178
+ sync_1 = _f.sent();
179
+ violations_1 = collectViolations(sync_1.results);
180
+ userRecordsInStream_1 = sync_1.results.filter(function (r) { return r.modelName === 'users'; }).length;
181
+ return [4 /*yield*/, async_test("guard: /v1/data-sync sync stream contains at least one user record", function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
182
+ return [2 /*return*/, ({ userRecords: userRecordsInStream_1, totalRecords: sync_1.results.length })];
183
+ }); }); }, { onResult: function (r) { return r.userRecords >= 1; } })];
184
+ case 10:
185
+ _f.sent();
186
+ return [4 /*yield*/, async_test("/v1/data-sync must NOT return hashedPass / hashedPassword / hashedInviteCode", function () { return __awaiter(void 0, void 0, void 0, function () {
187
+ return __generator(this, function (_a) {
188
+ return [2 /*return*/, ({
189
+ violationCount: violations_1.length,
190
+ violations: violations_1.slice(0, 10),
191
+ affectedModels: Array.from(new Set(violations_1.map(function (v) { return v.modelName; }))),
192
+ affectedFields: Array.from(new Set(violations_1.map(function (v) { return v.leakedField; }))),
193
+ })];
194
+ });
195
+ }); }, { onResult: function (r) { return r.violationCount === 0; } })
196
+ // ========================================================================
197
+ // Additional coverage for applyRedactions code paths reachable via /v1/data-sync.
198
+ // Each of these is a distinct branch in applyRedactions (routing.ts:1165-1238)
199
+ // and could regress independently of this fix.
200
+ // ========================================================================
201
+ // Case A: schema-level `redactions: ['all']` must apply to ADMIN sessions too.
202
+ // Admins have no session.fieldRedactions, but `redactions: ['all']` is universal.
203
+ // Pre-fix: admin saw hashedPass via data-sync because applyRedactions was skipped entirely.
204
+ // Post-fix: applyRedactions always runs and `redactions: ['all']` strips for everyone.
205
+ ];
206
+ case 11:
207
+ _f.sent();
208
+ return [4 /*yield*/, sdk.sync({ from: new Date(0) })];
209
+ case 12:
210
+ adminSync = _f.sent();
211
+ adminViolations_1 = collectViolations(adminSync.results);
212
+ return [4 /*yield*/, async_test("coverage A: admin /v1/data-sync also strips redactions:['all'] fields (hashedPass etc.)", function () { return __awaiter(void 0, void 0, void 0, function () {
213
+ return __generator(this, function (_a) {
214
+ return [2 /*return*/, ({
215
+ violationCount: adminViolations_1.length,
216
+ violations: adminViolations_1.slice(0, 10),
217
+ })];
218
+ });
219
+ }); }, { onResult: function (r) { return r.violationCount === 0; } })
220
+ // Case B: `linkedAccountAccess` on users must be stripped when the caller is NOT
221
+ // the record's owner. This is a separate branch in applyRedactions (routing.ts:1220-1225)
222
+ // and protects against cross-user enumeration of who-requested-access-to-whom.
223
+ // The non-admin user reads other user records via data-sync; if any of those
224
+ // records have linkedAccountAccess set, it must be stripped on read.
225
+ ];
226
+ case 13:
227
+ _f.sent();
228
+ otherUsersInStream_2 = sync_1.results.filter(function (r) { return r.modelName === 'users' && r.recordId !== sdkNonAdmin.userInfo.id; });
229
+ linkedAccountLeaks_1 = [];
230
+ for (_i = 0, otherUsersInStream_1 = otherUsersInStream_2; _i < otherUsersInStream_1.length; _i++) {
231
+ record = otherUsersInStream_1[_i];
232
+ if (!record.data || record.data === 'deleted')
233
+ continue;
234
+ try {
235
+ parsed = JSON.parse(record.data);
236
+ if ('linkedAccountAccess' in parsed && parsed.linkedAccountAccess !== undefined) {
237
+ linkedAccountLeaks_1.push({ recordId: record.recordId });
238
+ }
239
+ }
240
+ catch (_g) { }
241
+ }
242
+ return [4 /*yield*/, async_test("coverage B: /v1/data-sync strips linkedAccountAccess from other users' records", function () { return __awaiter(void 0, void 0, void 0, function () {
243
+ return __generator(this, function (_a) {
244
+ return [2 /*return*/, ({
245
+ otherUserRecords: otherUsersInStream_2.length,
246
+ leakCount: linkedAccountLeaks_1.length,
247
+ leaks: linkedAccountLeaks_1.slice(0, 5),
248
+ })];
249
+ });
250
+ }); }, { onResult: function (r) { return r.leakCount === 0; } })];
251
+ case 14:
252
+ _f.sent();
253
+ return [3 /*break*/, 32];
254
+ case 15:
255
+ _f.trys.push([15, 17, , 18]);
256
+ return [4 /*yield*/, sdk.api.users.updateOne(sdkNonAdmin.userInfo.id, { roles: originalRoles !== null && originalRoles !== void 0 ? originalRoles : [] }, { replaceObjectFields: true })];
257
+ case 16:
258
+ _f.sent();
259
+ return [3 /*break*/, 18];
260
+ case 17:
261
+ _b = _f.sent();
262
+ return [3 /*break*/, 18];
263
+ case 18:
264
+ if (!rbapId) return [3 /*break*/, 22];
265
+ _f.label = 19;
266
+ case 19:
267
+ _f.trys.push([19, 21, , 22]);
268
+ return [4 /*yield*/, sdk.api.role_based_access_permissions.deleteOne(rbapId)];
269
+ case 20:
270
+ _f.sent();
271
+ return [3 /*break*/, 22];
272
+ case 21:
273
+ _c = _f.sent();
274
+ return [3 /*break*/, 22];
275
+ case 22:
276
+ if (!testEnduserId) return [3 /*break*/, 26];
277
+ _f.label = 23;
278
+ case 23:
279
+ _f.trys.push([23, 25, , 26]);
280
+ return [4 /*yield*/, sdk.api.endusers.deleteOne(testEnduserId)];
281
+ case 24:
282
+ _f.sent();
283
+ return [3 /*break*/, 26];
284
+ case 25:
285
+ _d = _f.sent();
286
+ return [3 /*break*/, 26];
287
+ case 26:
288
+ // Re-authenticate the non-admin to drop the exploit role from their JWT
289
+ // before subsequent tests run.
290
+ // Role restore above re-triggers deauthenticate_user; wait > 1s so the freshly minted
291
+ // token's (second-floored) iat lands after the deauth timestamp and isn't permanently
292
+ // rejected by is_logged_in's iat-slack check. Matches the in-test re-auth above.
293
+ return [4 /*yield*/, wait(undefined, 1500)];
294
+ case 27:
295
+ // Re-authenticate the non-admin to drop the exploit role from their JWT
296
+ // before subsequent tests run.
297
+ // Role restore above re-triggers deauthenticate_user; wait > 1s so the freshly minted
298
+ // token's (second-floored) iat lands after the deauth timestamp and isn't permanently
299
+ // rejected by is_logged_in's iat-slack check. Matches the in-test re-auth above.
300
+ _f.sent();
301
+ _f.label = 28;
302
+ case 28:
303
+ _f.trys.push([28, 30, , 31]);
304
+ return [4 /*yield*/, sdkNonAdmin.authenticate(nonAdminEmail, nonAdminPassword)];
305
+ case 29:
306
+ _f.sent();
307
+ return [3 /*break*/, 31];
308
+ case 30:
309
+ _e = _f.sent();
310
+ return [3 /*break*/, 31];
311
+ case 31: return [7 /*endfinally*/];
312
+ case 32: return [2 /*return*/];
313
+ }
314
+ });
315
+ });
316
+ };
317
+ // Allow running this test file independently
318
+ if (require.main === module) {
319
+ console.log("\uD83C\uDF10 Using API URL: ".concat(host));
320
+ var sdk_1 = new Session({ host: host });
321
+ var sdkNonAdmin_1 = new Session({ host: host });
322
+ var runTests = function () { return __awaiter(void 0, void 0, void 0, function () {
323
+ return __generator(this, function (_a) {
324
+ switch (_a.label) {
325
+ case 0: return [4 /*yield*/, setup_tests(sdk_1, sdkNonAdmin_1)];
326
+ case 1:
327
+ _a.sent();
328
+ return [4 /*yield*/, data_sync_redaction_bypass_tests({ sdk: sdk_1, sdkNonAdmin: sdkNonAdmin_1 })];
329
+ case 2:
330
+ _a.sent();
331
+ return [2 /*return*/];
332
+ }
333
+ });
334
+ }); };
335
+ runTests()
336
+ .then(function () {
337
+ console.log("✅ data-sync redaction-bypass test suite completed successfully");
338
+ process.exit(0);
339
+ })
340
+ .catch(function (error) {
341
+ console.error("❌ data-sync redaction-bypass test suite failed:", error);
342
+ process.exit(1);
343
+ });
344
+ }
345
+ //# sourceMappingURL=data-sync-redaction-bypass.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-sync-redaction-bypass.test.js","sourceRoot":"","sources":["../../../../../src/tests/api_tests/security/data-sync-redaction-bypass.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EACL,UAAU,EACV,UAAU,EACV,IAAI,GACL,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAE5D,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,uBAAgC,CAAA;AAC9D,IAAA,KAAoC,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAhG,aAAa,QAAA,EAAE,gBAAgB,QAAiE,CAAA;AAEvG,IAAM,WAAW,GAAG,EAAE,MAAM,EAAE,KAAc,EAAE,IAAI,EAAE,KAAc,EAAE,MAAM,EAAE,KAAc,EAAE,MAAM,EAAE,KAAc,EAAE,CAAA;AAEpH,uEAAuE;AACvE,qEAAqE;AACrE,IAAM,0BAA0B,GAA6B;IAC3D,KAAK,EAAK,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC5C,QAAQ,EAAE,CAAC,gBAAgB,CAAC;CAC7B,CAAA;AAID,IAAM,iBAAiB,GAAG,UAAC,OAAgE;IACzF,IAAM,UAAU,GAAgB,EAAE,CAAA;IAClC,KAAqB,UAAO,EAAP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AAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,CAAC,CAAA;CACL"}
@@ -0,0 +1,30 @@
1
+ import { Session } from "../../../sdk";
2
+ /**
3
+ * Regression test: the `develop_health_run_benefit_verification` RBAC gate.
4
+ *
5
+ * `enduser_eligibility_results.develop_health_run_benefit_verification` is registered with
6
+ * `noAccessPermissions: true` (packages/private/api/api/v1/api.ts, ~line 24606). Before the fix,
7
+ * it had no in-handler check on `session.access?.endusers?.read` /
8
+ * `session.access?.enduser_eligibility_results?.create`, so it loaded the caller-supplied
9
+ * enduser's PHI via `DB.endusers.findById` and forwarded it to the Develop Health integration
10
+ * regardless of the caller's role. It also let a zero-access caller fingerprint an enduser's
11
+ * profile completeness via the distinct validation error messages returned for missing fields.
12
+ *
13
+ * This test:
14
+ * 1. Creates a role with explicit NO_ACCESS for `endusers` and `enduser_eligibility_results`.
15
+ * 2. Assigns the role to the non-admin user and re-authenticates.
16
+ * 3. Calls the endpoint with a fake enduserId — asserts a 403-equivalent access error, not the
17
+ * validation-error / integration-not-found path that would run pre-fix.
18
+ *
19
+ * Pre-fix: the handler proceeds past `DB.endusers.findById` and either 400s with a
20
+ * `validate_enduser_for_develop_health` message (enduser not found — since the id is fake) or,
21
+ * for a real target id, would load PHI and forward it to Develop Health. Either way, the access
22
+ * check never fires. Test fails (no access-denial signal).
23
+ *
24
+ * Post-fix: the handler throws 403 before touching `DB.endusers` at all. Test passes.
25
+ */
26
+ export declare const develop_health_benefit_verification_rbac_tests: ({ sdk, sdkNonAdmin }: {
27
+ sdk: Session;
28
+ sdkNonAdmin: Session;
29
+ }) => Promise<void>;
30
+ //# sourceMappingURL=develop-health-benefit-verification-rbac.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"develop-health-benefit-verification-rbac.test.d.ts","sourceRoot":"","sources":["../../../../../src/tests/api_tests/security/develop-health-benefit-verification-rbac.test.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAYtC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,8CAA8C;SAAwC,OAAO;iBAAe,OAAO;mBA6I/H,CAAA"}