@tellescope/sdk 1.256.13 → 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 (352) 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 +20 -0
  10. package/lib/cjs/tests/api_tests/organization_signup.test.d.ts.map +1 -0
  11. package/lib/cjs/tests/api_tests/organization_signup.test.js +272 -0
  12. package/lib/cjs/tests/api_tests/organization_signup.test.js.map +1 -0
  13. package/lib/cjs/tests/api_tests/purchase_made_trigger.test.d.ts.map +1 -1
  14. package/lib/cjs/tests/api_tests/purchase_made_trigger.test.js +103 -162
  15. package/lib/cjs/tests/api_tests/purchase_made_trigger.test.js.map +1 -1
  16. package/lib/cjs/tests/api_tests/security/F-0179-booking-info-idor-token-mint.test.d.ts +30 -0
  17. package/lib/cjs/tests/api_tests/security/F-0179-booking-info-idor-token-mint.test.d.ts.map +1 -0
  18. package/lib/cjs/tests/api_tests/security/F-0179-booking-info-idor-token-mint.test.js +336 -0
  19. package/lib/cjs/tests/api_tests/security/F-0179-booking-info-idor-token-mint.test.js.map +1 -0
  20. package/lib/cjs/tests/api_tests/security/F-0185-startlinktoken-enduser-staff-escalation.test.d.ts +6 -0
  21. package/lib/cjs/tests/api_tests/security/F-0185-startlinktoken-enduser-staff-escalation.test.d.ts.map +1 -0
  22. package/lib/cjs/tests/api_tests/security/F-0185-startlinktoken-enduser-staff-escalation.test.js +354 -0
  23. package/lib/cjs/tests/api_tests/security/F-0185-startlinktoken-enduser-staff-escalation.test.js.map +1 -0
  24. package/lib/cjs/tests/api_tests/security/F-0191-schema-adminonly-enforcement.test.d.ts +46 -0
  25. package/lib/cjs/tests/api_tests/security/F-0191-schema-adminonly-enforcement.test.d.ts.map +1 -0
  26. package/lib/cjs/tests/api_tests/security/F-0191-schema-adminonly-enforcement.test.js +389 -0
  27. package/lib/cjs/tests/api_tests/security/F-0191-schema-adminonly-enforcement.test.js.map +1 -0
  28. package/lib/cjs/tests/api_tests/security/F-0192-automated-actions-process-gate.test.d.ts +43 -0
  29. package/lib/cjs/tests/api_tests/security/F-0192-automated-actions-process-gate.test.d.ts.map +1 -0
  30. package/lib/cjs/tests/api_tests/security/F-0192-automated-actions-process-gate.test.js +324 -0
  31. package/lib/cjs/tests/api_tests/security/F-0192-automated-actions-process-gate.test.js.map +1 -0
  32. package/lib/cjs/tests/api_tests/security/F-0196-add-to-journey-foreign-enduserid.test.d.ts +43 -0
  33. package/lib/cjs/tests/api_tests/security/F-0196-add-to-journey-foreign-enduserid.test.d.ts.map +1 -0
  34. package/lib/cjs/tests/api_tests/security/F-0196-add-to-journey-foreign-enduserid.test.js +282 -0
  35. package/lib/cjs/tests/api_tests/security/F-0196-add-to-journey-foreign-enduserid.test.js.map +1 -0
  36. package/lib/cjs/tests/api_tests/security/F-0200-form-logic-js-execution.test.d.ts +33 -0
  37. package/lib/cjs/tests/api_tests/security/F-0200-form-logic-js-execution.test.d.ts.map +1 -0
  38. package/lib/cjs/tests/api_tests/security/F-0200-form-logic-js-execution.test.js +249 -0
  39. package/lib/cjs/tests/api_tests/security/F-0200-form-logic-js-execution.test.js.map +1 -0
  40. package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts +42 -0
  41. package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts.map +1 -0
  42. package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js +281 -0
  43. package/lib/cjs/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js.map +1 -0
  44. package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.d.ts +38 -0
  45. package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.d.ts.map +1 -0
  46. package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.js +390 -0
  47. package/lib/cjs/tests/api_tests/security/ai-conversations-rbac.test.js.map +1 -0
  48. package/lib/cjs/tests/api_tests/security/allowed-paths-confinement.test.d.ts +6 -0
  49. package/lib/cjs/tests/api_tests/security/allowed-paths-confinement.test.d.ts.map +1 -0
  50. package/lib/cjs/tests/api_tests/security/allowed-paths-confinement.test.js +1003 -0
  51. package/lib/cjs/tests/api_tests/security/allowed-paths-confinement.test.js.map +1 -0
  52. package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.d.ts +42 -0
  53. package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.d.ts.map +1 -0
  54. package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.js +323 -0
  55. package/lib/cjs/tests/api_tests/security/automated-actions-process-gate.test.js.map +1 -0
  56. package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts +29 -0
  57. package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts.map +1 -0
  58. package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.js +335 -0
  59. package/lib/cjs/tests/api_tests/security/booking-info-idor-token-mint.test.js.map +1 -0
  60. package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts +32 -0
  61. package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts.map +1 -0
  62. package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js +237 -0
  63. package/lib/cjs/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js.map +1 -0
  64. package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts +28 -0
  65. package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts.map +1 -0
  66. package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.js +349 -0
  67. package/lib/cjs/tests/api_tests/security/data-sync-redaction-bypass.test.js.map +1 -0
  68. package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts +30 -0
  69. package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts.map +1 -0
  70. package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js +314 -0
  71. package/lib/cjs/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js.map +1 -0
  72. package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.d.ts +21 -0
  73. package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.d.ts.map +1 -0
  74. package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.js +362 -0
  75. package/lib/cjs/tests/api_tests/security/enduser-cross-create.test.js.map +1 -0
  76. package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.d.ts +21 -0
  77. package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.d.ts.map +1 -0
  78. package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.js +366 -0
  79. package/lib/cjs/tests/api_tests/security/enduser-write-restrictions.test.js.map +1 -0
  80. package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.d.ts +32 -0
  81. package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.d.ts.map +1 -0
  82. package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.js +248 -0
  83. package/lib/cjs/tests/api_tests/security/form-logic-js-execution.test.js.map +1 -0
  84. package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts +19 -0
  85. package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts.map +1 -0
  86. package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.js +138 -0
  87. package/lib/cjs/tests/api_tests/security/globalunique-conflict-redaction.test.js.map +1 -0
  88. package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts +24 -0
  89. package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts.map +1 -0
  90. package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js +201 -0
  91. package/lib/cjs/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js.map +1 -0
  92. package/lib/cjs/tests/api_tests/security/invite-user-enumeration.test.d.ts +29 -0
  93. package/lib/cjs/tests/api_tests/security/invite-user-enumeration.test.d.ts.map +1 -0
  94. package/lib/cjs/tests/api_tests/security/invite-user-enumeration.test.js +278 -0
  95. package/lib/cjs/tests/api_tests/security/invite-user-enumeration.test.js.map +1 -0
  96. package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.d.ts +17 -0
  97. package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.d.ts.map +1 -0
  98. package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.js +155 -0
  99. package/lib/cjs/tests/api_tests/security/load-inbox-redaction.test.js.map +1 -0
  100. package/lib/cjs/tests/api_tests/security/prototype-pollution.test.d.ts +2 -0
  101. package/lib/cjs/tests/api_tests/security/prototype-pollution.test.d.ts.map +1 -0
  102. package/lib/cjs/tests/api_tests/security/prototype-pollution.test.js +88 -0
  103. package/lib/cjs/tests/api_tests/security/prototype-pollution.test.js.map +1 -0
  104. package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts +34 -0
  105. package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts.map +1 -0
  106. package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.js +230 -0
  107. package/lib/cjs/tests/api_tests/security/proxy-image-unauth-ssrf.test.js.map +1 -0
  108. package/lib/cjs/tests/api_tests/security/sanitize-user-html-with-iframes.test.d.ts +2 -0
  109. package/lib/cjs/tests/api_tests/security/sanitize-user-html-with-iframes.test.d.ts.map +1 -0
  110. package/lib/cjs/tests/api_tests/security/sanitize-user-html-with-iframes.test.js +242 -0
  111. package/lib/cjs/tests/api_tests/security/sanitize-user-html-with-iframes.test.js.map +1 -0
  112. package/lib/cjs/tests/api_tests/security/sanitize-user-html.test.d.ts +2 -0
  113. package/lib/cjs/tests/api_tests/security/sanitize-user-html.test.d.ts.map +1 -0
  114. package/lib/cjs/tests/api_tests/security/sanitize-user-html.test.js +148 -0
  115. package/lib/cjs/tests/api_tests/security/sanitize-user-html.test.js.map +1 -0
  116. package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts +45 -0
  117. package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts.map +1 -0
  118. package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.js +388 -0
  119. package/lib/cjs/tests/api_tests/security/schema-adminonly-enforcement.test.js.map +1 -0
  120. package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.d.ts +38 -0
  121. package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.d.ts.map +1 -0
  122. package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.js +222 -0
  123. package/lib/cjs/tests/api_tests/security/self-admin-role-assignment.test.js.map +1 -0
  124. package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts +6 -0
  125. package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts.map +1 -0
  126. package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js +354 -0
  127. package/lib/cjs/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js.map +1 -0
  128. package/lib/cjs/tests/api_tests/security/webhook-outbound-ssrf.test.d.ts +28 -0
  129. package/lib/cjs/tests/api_tests/security/webhook-outbound-ssrf.test.d.ts.map +1 -0
  130. package/lib/cjs/tests/api_tests/security/webhook-outbound-ssrf.test.js +442 -0
  131. package/lib/cjs/tests/api_tests/security/webhook-outbound-ssrf.test.js.map +1 -0
  132. package/lib/cjs/tests/api_tests/security/webhook-timeout.test.d.ts +19 -0
  133. package/lib/cjs/tests/api_tests/security/webhook-timeout.test.d.ts.map +1 -0
  134. package/lib/cjs/tests/api_tests/security/webhook-timeout.test.js +156 -0
  135. package/lib/cjs/tests/api_tests/security/webhook-timeout.test.js.map +1 -0
  136. package/lib/cjs/tests/api_tests/tickets_bulk_assign_from_queue.test.d.ts +5 -0
  137. package/lib/cjs/tests/api_tests/tickets_bulk_assign_from_queue.test.d.ts.map +1 -0
  138. package/lib/cjs/tests/api_tests/tickets_bulk_assign_from_queue.test.js +329 -0
  139. package/lib/cjs/tests/api_tests/tickets_bulk_assign_from_queue.test.js.map +1 -0
  140. package/lib/cjs/tests/api_tests/webhook_error_handling.test.js +2 -2
  141. package/lib/cjs/tests/api_tests/webhook_error_handling.test.js.map +1 -1
  142. package/lib/cjs/tests/setup_isolated.d.ts +68 -0
  143. package/lib/cjs/tests/setup_isolated.d.ts.map +1 -0
  144. package/lib/cjs/tests/setup_isolated.js +232 -0
  145. package/lib/cjs/tests/setup_isolated.js.map +1 -0
  146. package/lib/cjs/tests/tests.d.ts.map +1 -1
  147. package/lib/cjs/tests/tests.js +287 -227
  148. package/lib/cjs/tests/tests.js.map +1 -1
  149. package/lib/cjs/tests/unit_tests/do_not_send_address.test.d.ts +2 -0
  150. package/lib/cjs/tests/unit_tests/do_not_send_address.test.d.ts.map +1 -0
  151. package/lib/cjs/tests/unit_tests/do_not_send_address.test.js +89 -0
  152. package/lib/cjs/tests/unit_tests/do_not_send_address.test.js.map +1 -0
  153. package/lib/cjs/tests/unit_tests/openapi_spec_freshness.test.d.ts +17 -0
  154. package/lib/cjs/tests/unit_tests/openapi_spec_freshness.test.d.ts.map +1 -0
  155. package/lib/cjs/tests/unit_tests/openapi_spec_freshness.test.js +140 -0
  156. package/lib/cjs/tests/unit_tests/openapi_spec_freshness.test.js.map +1 -0
  157. package/lib/cjs/tsconfig.cjs.tsbuildinfo +1 -0
  158. package/lib/esm/tests/api_tests/auto_merge_form_submission.test.js +1 -1
  159. package/lib/esm/tests/api_tests/auto_merge_form_submission.test.js.map +1 -1
  160. package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.d.ts +5 -0
  161. package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.d.ts.map +1 -0
  162. package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.js +383 -0
  163. package/lib/esm/tests/api_tests/enduser_observations_auto_review.test.js.map +1 -0
  164. package/lib/esm/tests/api_tests/integrations_redacted.test.js +3 -3
  165. package/lib/esm/tests/api_tests/integrations_redacted.test.js.map +1 -1
  166. package/lib/esm/tests/api_tests/organization_signup.test.d.ts +20 -0
  167. package/lib/esm/tests/api_tests/organization_signup.test.d.ts.map +1 -0
  168. package/lib/esm/tests/api_tests/organization_signup.test.js +264 -0
  169. package/lib/esm/tests/api_tests/organization_signup.test.js.map +1 -0
  170. package/lib/esm/tests/api_tests/purchase_made_trigger.test.d.ts.map +1 -1
  171. package/lib/esm/tests/api_tests/purchase_made_trigger.test.js +104 -163
  172. package/lib/esm/tests/api_tests/purchase_made_trigger.test.js.map +1 -1
  173. package/lib/esm/tests/api_tests/security/F-0179-booking-info-idor-token-mint.test.d.ts +30 -0
  174. package/lib/esm/tests/api_tests/security/F-0179-booking-info-idor-token-mint.test.d.ts.map +1 -0
  175. package/lib/esm/tests/api_tests/security/F-0179-booking-info-idor-token-mint.test.js +332 -0
  176. package/lib/esm/tests/api_tests/security/F-0179-booking-info-idor-token-mint.test.js.map +1 -0
  177. package/lib/esm/tests/api_tests/security/F-0185-startlinktoken-enduser-staff-escalation.test.d.ts +6 -0
  178. package/lib/esm/tests/api_tests/security/F-0185-startlinktoken-enduser-staff-escalation.test.d.ts.map +1 -0
  179. package/lib/esm/tests/api_tests/security/F-0185-startlinktoken-enduser-staff-escalation.test.js +350 -0
  180. package/lib/esm/tests/api_tests/security/F-0185-startlinktoken-enduser-staff-escalation.test.js.map +1 -0
  181. package/lib/esm/tests/api_tests/security/F-0191-schema-adminonly-enforcement.test.d.ts +46 -0
  182. package/lib/esm/tests/api_tests/security/F-0191-schema-adminonly-enforcement.test.d.ts.map +1 -0
  183. package/lib/esm/tests/api_tests/security/F-0191-schema-adminonly-enforcement.test.js +382 -0
  184. package/lib/esm/tests/api_tests/security/F-0191-schema-adminonly-enforcement.test.js.map +1 -0
  185. package/lib/esm/tests/api_tests/security/F-0192-automated-actions-process-gate.test.d.ts +43 -0
  186. package/lib/esm/tests/api_tests/security/F-0192-automated-actions-process-gate.test.d.ts.map +1 -0
  187. package/lib/esm/tests/api_tests/security/F-0192-automated-actions-process-gate.test.js +317 -0
  188. package/lib/esm/tests/api_tests/security/F-0192-automated-actions-process-gate.test.js.map +1 -0
  189. package/lib/esm/tests/api_tests/security/F-0196-add-to-journey-foreign-enduserid.test.d.ts +43 -0
  190. package/lib/esm/tests/api_tests/security/F-0196-add-to-journey-foreign-enduserid.test.d.ts.map +1 -0
  191. package/lib/esm/tests/api_tests/security/F-0196-add-to-journey-foreign-enduserid.test.js +277 -0
  192. package/lib/esm/tests/api_tests/security/F-0196-add-to-journey-foreign-enduserid.test.js.map +1 -0
  193. package/lib/esm/tests/api_tests/security/F-0200-form-logic-js-execution.test.d.ts +33 -0
  194. package/lib/esm/tests/api_tests/security/F-0200-form-logic-js-execution.test.d.ts.map +1 -0
  195. package/lib/esm/tests/api_tests/security/F-0200-form-logic-js-execution.test.js +244 -0
  196. package/lib/esm/tests/api_tests/security/F-0200-form-logic-js-execution.test.js.map +1 -0
  197. package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts +42 -0
  198. package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.d.ts.map +1 -0
  199. package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js +276 -0
  200. package/lib/esm/tests/api_tests/security/add-to-journey-foreign-enduserid.test.js.map +1 -0
  201. package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.d.ts +38 -0
  202. package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.d.ts.map +1 -0
  203. package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.js +386 -0
  204. package/lib/esm/tests/api_tests/security/ai-conversations-rbac.test.js.map +1 -0
  205. package/lib/esm/tests/api_tests/security/allowed-paths-confinement.test.d.ts +6 -0
  206. package/lib/esm/tests/api_tests/security/allowed-paths-confinement.test.d.ts.map +1 -0
  207. package/lib/esm/tests/api_tests/security/allowed-paths-confinement.test.js +996 -0
  208. package/lib/esm/tests/api_tests/security/allowed-paths-confinement.test.js.map +1 -0
  209. package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.d.ts +42 -0
  210. package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.d.ts.map +1 -0
  211. package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.js +316 -0
  212. package/lib/esm/tests/api_tests/security/automated-actions-process-gate.test.js.map +1 -0
  213. package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts +29 -0
  214. package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.d.ts.map +1 -0
  215. package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.js +331 -0
  216. package/lib/esm/tests/api_tests/security/booking-info-idor-token-mint.test.js.map +1 -0
  217. package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts +32 -0
  218. package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.d.ts.map +1 -0
  219. package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js +233 -0
  220. package/lib/esm/tests/api_tests/security/cascade-role-rename-cross-tenant.test.js.map +1 -0
  221. package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts +28 -0
  222. package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.d.ts.map +1 -0
  223. package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.js +345 -0
  224. package/lib/esm/tests/api_tests/security/data-sync-redaction-bypass.test.js.map +1 -0
  225. package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts +30 -0
  226. package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.d.ts.map +1 -0
  227. package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js +310 -0
  228. package/lib/esm/tests/api_tests/security/develop-health-benefit-verification-rbac.test.js.map +1 -0
  229. package/lib/esm/tests/api_tests/security/enduser-cross-create.test.d.ts +21 -0
  230. package/lib/esm/tests/api_tests/security/enduser-cross-create.test.d.ts.map +1 -0
  231. package/lib/esm/tests/api_tests/security/enduser-cross-create.test.js +358 -0
  232. package/lib/esm/tests/api_tests/security/enduser-cross-create.test.js.map +1 -0
  233. package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.d.ts +21 -0
  234. package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.d.ts.map +1 -0
  235. package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.js +362 -0
  236. package/lib/esm/tests/api_tests/security/enduser-write-restrictions.test.js.map +1 -0
  237. package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.d.ts +32 -0
  238. package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.d.ts.map +1 -0
  239. package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.js +243 -0
  240. package/lib/esm/tests/api_tests/security/form-logic-js-execution.test.js.map +1 -0
  241. package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts +19 -0
  242. package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.d.ts.map +1 -0
  243. package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.js +134 -0
  244. package/lib/esm/tests/api_tests/security/globalunique-conflict-redaction.test.js.map +1 -0
  245. package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts +24 -0
  246. package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.d.ts.map +1 -0
  247. package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js +194 -0
  248. package/lib/esm/tests/api_tests/security/handle-incoming-communication-cross-tenant.test.js.map +1 -0
  249. package/lib/esm/tests/api_tests/security/invite-user-enumeration.test.d.ts +29 -0
  250. package/lib/esm/tests/api_tests/security/invite-user-enumeration.test.d.ts.map +1 -0
  251. package/lib/esm/tests/api_tests/security/invite-user-enumeration.test.js +271 -0
  252. package/lib/esm/tests/api_tests/security/invite-user-enumeration.test.js.map +1 -0
  253. package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.d.ts +17 -0
  254. package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.d.ts.map +1 -0
  255. package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.js +151 -0
  256. package/lib/esm/tests/api_tests/security/load-inbox-redaction.test.js.map +1 -0
  257. package/lib/esm/tests/api_tests/security/prototype-pollution.test.d.ts +2 -0
  258. package/lib/esm/tests/api_tests/security/prototype-pollution.test.d.ts.map +1 -0
  259. package/lib/esm/tests/api_tests/security/prototype-pollution.test.js +84 -0
  260. package/lib/esm/tests/api_tests/security/prototype-pollution.test.js.map +1 -0
  261. package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts +34 -0
  262. package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.d.ts.map +1 -0
  263. package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.js +223 -0
  264. package/lib/esm/tests/api_tests/security/proxy-image-unauth-ssrf.test.js.map +1 -0
  265. package/lib/esm/tests/api_tests/security/sanitize-user-html-with-iframes.test.d.ts +2 -0
  266. package/lib/esm/tests/api_tests/security/sanitize-user-html-with-iframes.test.d.ts.map +1 -0
  267. package/lib/esm/tests/api_tests/security/sanitize-user-html-with-iframes.test.js +238 -0
  268. package/lib/esm/tests/api_tests/security/sanitize-user-html-with-iframes.test.js.map +1 -0
  269. package/lib/esm/tests/api_tests/security/sanitize-user-html.test.d.ts +2 -0
  270. package/lib/esm/tests/api_tests/security/sanitize-user-html.test.d.ts.map +1 -0
  271. package/lib/esm/tests/api_tests/security/sanitize-user-html.test.js +144 -0
  272. package/lib/esm/tests/api_tests/security/sanitize-user-html.test.js.map +1 -0
  273. package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts +45 -0
  274. package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.d.ts.map +1 -0
  275. package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.js +381 -0
  276. package/lib/esm/tests/api_tests/security/schema-adminonly-enforcement.test.js.map +1 -0
  277. package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.d.ts +38 -0
  278. package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.d.ts.map +1 -0
  279. package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.js +218 -0
  280. package/lib/esm/tests/api_tests/security/self-admin-role-assignment.test.js.map +1 -0
  281. package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts +6 -0
  282. package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.d.ts.map +1 -0
  283. package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js +350 -0
  284. package/lib/esm/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.js.map +1 -0
  285. package/lib/esm/tests/api_tests/security/webhook-outbound-ssrf.test.d.ts +28 -0
  286. package/lib/esm/tests/api_tests/security/webhook-outbound-ssrf.test.d.ts.map +1 -0
  287. package/lib/esm/tests/api_tests/security/webhook-outbound-ssrf.test.js +435 -0
  288. package/lib/esm/tests/api_tests/security/webhook-outbound-ssrf.test.js.map +1 -0
  289. package/lib/esm/tests/api_tests/security/webhook-timeout.test.d.ts +19 -0
  290. package/lib/esm/tests/api_tests/security/webhook-timeout.test.d.ts.map +1 -0
  291. package/lib/esm/tests/api_tests/security/webhook-timeout.test.js +149 -0
  292. package/lib/esm/tests/api_tests/security/webhook-timeout.test.js.map +1 -0
  293. package/lib/esm/tests/api_tests/tickets_bulk_assign_from_queue.test.d.ts +5 -0
  294. package/lib/esm/tests/api_tests/tickets_bulk_assign_from_queue.test.d.ts.map +1 -0
  295. package/lib/esm/tests/api_tests/tickets_bulk_assign_from_queue.test.js +324 -0
  296. package/lib/esm/tests/api_tests/tickets_bulk_assign_from_queue.test.js.map +1 -0
  297. package/lib/esm/tests/api_tests/webhook_error_handling.test.js +2 -2
  298. package/lib/esm/tests/api_tests/webhook_error_handling.test.js.map +1 -1
  299. package/lib/esm/tests/setup_isolated.d.ts +68 -0
  300. package/lib/esm/tests/setup_isolated.d.ts.map +1 -0
  301. package/lib/esm/tests/setup_isolated.js +221 -0
  302. package/lib/esm/tests/setup_isolated.js.map +1 -0
  303. package/lib/esm/tests/tests.d.ts.map +1 -1
  304. package/lib/esm/tests/tests.js +287 -227
  305. package/lib/esm/tests/tests.js.map +1 -1
  306. package/lib/esm/tests/unit_tests/do_not_send_address.test.d.ts +2 -0
  307. package/lib/esm/tests/unit_tests/do_not_send_address.test.d.ts.map +1 -0
  308. package/lib/esm/tests/unit_tests/do_not_send_address.test.js +85 -0
  309. package/lib/esm/tests/unit_tests/do_not_send_address.test.js.map +1 -0
  310. package/lib/esm/tests/unit_tests/openapi_spec_freshness.test.d.ts +17 -0
  311. package/lib/esm/tests/unit_tests/openapi_spec_freshness.test.d.ts.map +1 -0
  312. package/lib/esm/tests/unit_tests/openapi_spec_freshness.test.js +113 -0
  313. package/lib/esm/tests/unit_tests/openapi_spec_freshness.test.js.map +1 -0
  314. package/lib/tsconfig.tsbuildinfo +1 -1
  315. package/package.json +10 -10
  316. package/src/tests/api_tests/auto_merge_form_submission.test.ts +1 -1
  317. package/src/tests/api_tests/enduser_observations_auto_review.test.ts +358 -0
  318. package/src/tests/api_tests/integrations_redacted.test.ts +1 -1
  319. package/src/tests/api_tests/organization_signup.test.ts +240 -0
  320. package/src/tests/api_tests/purchase_made_trigger.test.ts +29 -41
  321. package/src/tests/api_tests/security/add-to-journey-foreign-enduserid.test.ts +207 -0
  322. package/src/tests/api_tests/security/{F-0005-ai-conversations-rbac.test.ts → ai-conversations-rbac.test.ts} +14 -14
  323. package/src/tests/api_tests/security/{F-0166-allowed-paths-wildcard-bypass.test.ts → allowed-paths-confinement.test.ts} +11 -11
  324. package/src/tests/api_tests/security/automated-actions-process-gate.test.ts +237 -0
  325. package/src/tests/api_tests/security/booking-info-idor-token-mint.test.ts +224 -0
  326. package/src/tests/api_tests/security/{F-0053-cascade-role-rename-cross-tenant.test.ts → cascade-role-rename-cross-tenant.test.ts} +10 -10
  327. package/src/tests/api_tests/security/{F-0001-data-sync-redaction-bypass.test.ts → data-sync-redaction-bypass.test.ts} +9 -9
  328. package/src/tests/api_tests/security/{F-0006-develop-health-benefit-verification-rbac.test.ts → develop-health-benefit-verification-rbac.test.ts} +7 -8
  329. package/src/tests/api_tests/security/{F-0116-F-0119-enduser-cross-create.test.ts → enduser-cross-create.test.ts} +25 -25
  330. package/src/tests/api_tests/security/{F-0106-F-0110-enduser-write-restrictions.test.ts → enduser-write-restrictions.test.ts} +12 -14
  331. package/src/tests/api_tests/security/form-logic-js-execution.test.ts +183 -0
  332. package/src/tests/api_tests/security/{F-0145-globalunique-leak.test.ts → globalunique-conflict-redaction.test.ts} +5 -6
  333. package/src/tests/api_tests/security/{F-0008-handle-incoming-communication-cross-tenant.test.ts → handle-incoming-communication-cross-tenant.test.ts} +8 -8
  334. package/src/tests/api_tests/security/{F-0007-invite-user-enumeration.test.ts → invite-user-enumeration.test.ts} +8 -8
  335. package/src/tests/api_tests/security/{F-0151-load-inbox-redaction.test.ts → load-inbox-redaction.test.ts} +5 -6
  336. package/src/tests/api_tests/security/{F-0016-prototype-pollution.test.ts → prototype-pollution.test.ts} +4 -4
  337. package/src/tests/api_tests/security/{F-0025-proxy-image-unauth-ssrf.test.ts → proxy-image-unauth-ssrf.test.ts} +11 -12
  338. package/src/tests/api_tests/security/{F-0013-sanitize-user-html-with-iframes.test.ts → sanitize-user-html-with-iframes.test.ts} +5 -5
  339. package/src/tests/api_tests/security/{F-0013-sanitize-user-html.test.ts → sanitize-user-html.test.ts} +4 -4
  340. package/src/tests/api_tests/security/schema-adminonly-enforcement.test.ts +287 -0
  341. package/src/tests/api_tests/security/{F-0076-self-admin-role-assignment.test.ts → self-admin-role-assignment.test.ts} +13 -13
  342. package/src/tests/api_tests/security/startlinktoken-enduser-staff-escalation.test.ts +162 -0
  343. package/src/tests/api_tests/security/{F-0015-webhook-outbound-ssrf.test.ts → webhook-outbound-ssrf.test.ts} +13 -14
  344. package/src/tests/api_tests/security/{F-0155-webhook-timeout.test.ts → webhook-timeout.test.ts} +6 -7
  345. package/src/tests/api_tests/tickets_bulk_assign_from_queue.test.ts +279 -0
  346. package/src/tests/api_tests/webhook_error_handling.test.ts +1 -1
  347. package/src/tests/setup_isolated.ts +170 -0
  348. package/src/tests/tests.ts +60 -18
  349. package/src/tests/unit_tests/do_not_send_address.test.ts +60 -0
  350. package/src/tests/unit_tests/openapi_spec_freshness.test.ts +88 -0
  351. package/test_generated.pdf +0 -0
  352. package/src/tests/api_tests/security/readonly-enduser-preview.test.ts +0 -301
@@ -0,0 +1,389 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
+ 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;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ var __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.schema_adminonly_enforcement_tests = void 0;
54
+ require('source-map-support').install();
55
+ var axios_1 = __importDefault(require("axios"));
56
+ var sdk_1 = require("../../../sdk");
57
+ var testing_1 = require("@tellescope/testing");
58
+ var constants_1 = require("@tellescope/constants");
59
+ var setup_1 = require("../../setup");
60
+ var host = process.env.API_URL || 'http://localhost:8080';
61
+ var RAND = function () { return Math.random().toString(36).slice(2, 10); };
62
+ var ALL = 'All';
63
+ var FULL_ACCESS = { create: ALL, read: ALL, update: ALL, delete: ALL };
64
+ /**
65
+ * Regression test for F-0191
66
+ * (security-audit/findings/F-0191-schema-adminonly-not-enforced.md).
67
+ *
68
+ * `adminOnly: true` on a CUSTOM action in schema.ts was documentation-only. The runtime gate
69
+ * (routing.ts:944) reads the flag off the options object built by getCustomEndpointFields, and
70
+ * api.ts:609 set `adminOnly: o.adminOnly` without ever consulting `action.adminOnly`. So every
71
+ * admin-only custom action had to declare the flag twice, and the copies desynced: 11 of 20
72
+ * declared custom actions were unenforced at runtime while both public doc artifacts
73
+ * (openapi.json and the unauthenticated GET /documentation feed, which read the SCHEMA flag)
74
+ * advertised "**Admin only.**".
75
+ *
76
+ * DEFAULT CRUD actions never had this bug — routing.ts:2434 etc. read
77
+ * model.defaultActions.<op>.adminOnly straight off the schema. The fix
78
+ * (`adminOnly: o.adminOnly ?? action.adminOnly`) makes custom actions behave the same way.
79
+ *
80
+ * Five of the 11 were de-flagged in the schema instead, because the flag itself was wrong and
81
+ * enforcing it would revert a deliberate decision: users.invite_user carries an explicit
82
+ * "no longer admin only, but controlled by users.create" and send_invitation_to_existing is its
83
+ * sibling; organizations.create_and_join is the self-service signup path and would 401 every new
84
+ * org (a fresh user has no roles — the handler is what grants Admin); sync_note_to_canvas is
85
+ * designed around `access: 'read'` for non-admin callers; background_errors.mark_read substitutes
86
+ * its own RBAC check that intentionally admits non-admins holding the verb.
87
+ *
88
+ * SAFETY: every probe fails EARLY inside its handler — after the adminOnly gate but before any
89
+ * vendor call. Pre-fix these requests really do reach the handler, and these handlers talk to
90
+ * Twilio, Athena and Canvas:
91
+ * - trigger_events : no `action` key + an absent triggerId => the loop `continue`s (inert)
92
+ * - athena-subscription: frequency 1 trips the `frequency < 5` guard on the handler's first line
93
+ * - sync-athena : 404s on the missing Athena integration (skipped if one exists)
94
+ * - link-twilio : takes NO parameters and can CREATE A REAL TWILIO SUBACCOUNT, so it is
95
+ * probed only when the org already has a twilioSID (handler short-circuits)
96
+ * - twilio-embed : no phoneNumberSid => 404 no-config or 400, both before any Twilio call
97
+ * - handle-autoreply : absent enduserId => `if (!enduser) return` (communications.ts:42)
98
+ * Input validation runs BEFORE the adminOnly gate (routing.ts:921 orders access, then validate),
99
+ * so every probe body must be schema-VALID or the test would prove nothing.
100
+ *
101
+ * RED (pre-fix): the six group-B rows fail — each reaches its handler and returns a non-401.
102
+ * GREEN (post-fix): all six return 401 "Admin access only"; the group-A controls are unchanged.
103
+ */
104
+ var schema_adminonly_enforcement_tests = function (_a) {
105
+ var sdk = _a.sdk;
106
+ return __awaiter(void 0, void 0, void 0, function () {
107
+ var checks, record, request, isAdminDenial, summarize, roleId, attackerId, enduserId, role, rbap, attacker, attackerToken, adminToken, attackerSDK, enduser, doomed, ABSENT_ID, athenaIntegrationExists, existing, _b, orgHasTwilioSID, org, _c, groupB, _i, groupB_1, probe, attackerResult, baseline, badProbe, groupA, _d, groupA_1, probe, r, _e, checks_1, c, _f, checks_2, c, _g, _h, _j;
108
+ var _k;
109
+ return __generator(this, function (_l) {
110
+ switch (_l.label) {
111
+ case 0:
112
+ (0, testing_1.log_header)("F-0191: schema-declared adminOnly must be enforced on custom actions");
113
+ checks = [];
114
+ record = function (label, pass, detail) { return checks.push({ label: label, pass: pass, detail: detail }); };
115
+ request = function (authToken, method, path, data) { return __awaiter(void 0, void 0, void 0, function () {
116
+ var r;
117
+ return __generator(this, function (_a) {
118
+ switch (_a.label) {
119
+ case 0: return [4 /*yield*/, axios_1.default.request(__assign(__assign({ method: method, url: "".concat(host, "/v1").concat(path) }, method === 'get' ? { params: data } : { data: data }), { headers: { Authorization: "Bearer ".concat(authToken) }, validateStatus: function () { return true; } }))];
120
+ case 1:
121
+ r = _a.sent();
122
+ return [2 /*return*/, { status: r.status, body: r.data }];
123
+ }
124
+ });
125
+ }); };
126
+ isAdminDenial = function (r) {
127
+ var _a;
128
+ return (r.status === 401 && ((_a = r.body) === null || _a === void 0 ? void 0 : _a.message) === 'Admin access only');
129
+ };
130
+ summarize = function (r) {
131
+ var _a;
132
+ return ("".concat(r.status, " ").concat(((_a = JSON.stringify(r.body)) !== null && _a !== void 0 ? _a : '').slice(0, 120)));
133
+ };
134
+ roleId = '';
135
+ attackerId = '';
136
+ enduserId = '';
137
+ _l.label = 1;
138
+ case 1:
139
+ _l.trys.push([1, , 27, 40]);
140
+ role = "f0191-staff-".concat(RAND());
141
+ return [4 /*yield*/, sdk.api.role_based_access_permissions.createOne({
142
+ role: role,
143
+ permissions: __assign(__assign({}, constants_1.PROVIDER_PERMISSIONS), {
144
+ // grant exactly the verbs the actions under test declare, so a rejection proves the ADMIN
145
+ // gate fired rather than ordinary RBAC
146
+ automation_triggers: FULL_ACCESS, organizations: FULL_ACCESS, availability_blocks: FULL_ACCESS, background_errors: FULL_ACCESS, users: FULL_ACCESS }),
147
+ })];
148
+ case 2:
149
+ rbap = _l.sent();
150
+ roleId = rbap.id;
151
+ return [4 /*yield*/, sdk.api.users.createOne({
152
+ email: "f0191-attacker-".concat(RAND(), "@tellescope.example"),
153
+ fname: 'F0191', lname: 'Staff',
154
+ verifiedEmail: true,
155
+ notificationEmailsDisabled: true,
156
+ roles: [role],
157
+ })];
158
+ case 3:
159
+ attacker = _l.sent();
160
+ attackerId = attacker.id;
161
+ return [4 /*yield*/, sdk.api.users.generate_auth_token({ id: attackerId })];
162
+ case 4:
163
+ attackerToken = (_l.sent()).authToken;
164
+ return [4 /*yield*/, sdk.api.users.generate_auth_token({ id: sdk.userInfo.id })];
165
+ case 5:
166
+ adminToken = (_l.sent()).authToken;
167
+ attackerSDK = new sdk_1.Session({ host: host, authToken: attackerToken });
168
+ return [4 /*yield*/, attackerSDK.refresh_session()];
169
+ case 6:
170
+ _l.sent();
171
+ record('setup: attacker is a non-admin holding every verb under test', attackerSDK.userInfo.id === attackerId && !((_k = attackerSDK.userInfo.roles) !== null && _k !== void 0 ? _k : []).includes('Admin'), "id=".concat(attackerSDK.userInfo.id, " roles=").concat(JSON.stringify(attackerSDK.userInfo.roles)));
172
+ return [4 /*yield*/, sdk.api.endusers.createOne({ fname: 'F0191', lname: 'Patient' })];
173
+ case 7:
174
+ enduser = _l.sent();
175
+ enduserId = enduser.id;
176
+ return [4 /*yield*/, sdk.api.endusers.createOne({ fname: 'F0191', lname: 'Absent' })];
177
+ case 8:
178
+ doomed = _l.sent();
179
+ ABSENT_ID = doomed.id;
180
+ return [4 /*yield*/, sdk.api.endusers.deleteOne(ABSENT_ID)
181
+ /* ===== environment guards for the two probes input alone cannot make safe ===== */
182
+ ];
183
+ case 9:
184
+ _l.sent();
185
+ athenaIntegrationExists = false;
186
+ _l.label = 10;
187
+ case 10:
188
+ _l.trys.push([10, 12, , 13]);
189
+ return [4 /*yield*/, sdk.api.integrations.load_redacted({})];
190
+ case 11:
191
+ existing = _l.sent();
192
+ athenaIntegrationExists = !!existing.integrations.find(function (i) { var _a; return /athena/i.test((_a = i.title) !== null && _a !== void 0 ? _a : ''); });
193
+ return [3 /*break*/, 13];
194
+ case 12:
195
+ _b = _l.sent();
196
+ return [3 /*break*/, 13];
197
+ case 13:
198
+ orgHasTwilioSID = false;
199
+ _l.label = 14;
200
+ case 14:
201
+ _l.trys.push([14, 16, , 17]);
202
+ return [4 /*yield*/, sdk.api.organizations.getOne(sdk.userInfo.businessId)];
203
+ case 15:
204
+ org = _l.sent();
205
+ orgHasTwilioSID = !!(org === null || org === void 0 ? void 0 : org.twilioSID);
206
+ return [3 /*break*/, 17];
207
+ case 16:
208
+ _c = _l.sent();
209
+ return [3 /*break*/, 17];
210
+ case 17:
211
+ groupB = [
212
+ {
213
+ label: 'automation_triggers.trigger_events',
214
+ method: 'post', path: '/automation-triggers/trigger-events',
215
+ // no `action` key: stays off the arbitrary-action-execution branch entirely
216
+ data: { triggers: [{ enduserId: enduserId, automationTriggerId: ABSENT_ID }] },
217
+ },
218
+ {
219
+ label: 'organizations.add_athena_subscription',
220
+ method: 'post', path: '/organizations/athena-subscription',
221
+ data: { type: 'patients', frequency: 1 }, // trips `frequency < 5` on the handler's first line
222
+ },
223
+ {
224
+ label: 'organizations.sync_athena_subscription',
225
+ method: 'post', path: '/organizations/sync-athena-subscription',
226
+ data: { type: 'patients' },
227
+ skip: athenaIntegrationExists
228
+ ? 'org HAS an Athena integration — probing would call Athena.process_subscription for real'
229
+ : undefined,
230
+ },
231
+ {
232
+ label: 'organizations.link_twilio',
233
+ method: 'post', path: '/organizations/link-twilio',
234
+ data: {},
235
+ skip: orgHasTwilioSID
236
+ ? undefined
237
+ : 'org has no twilioSID — probing would CREATE A REAL TWILIO SUBACCOUNT',
238
+ },
239
+ {
240
+ label: 'organizations.load_twilio_embed',
241
+ method: 'get', path: '/organizations/twilio-embed',
242
+ data: { type: 'tfn-verification' }, // no phoneNumberSid => rejected before any Twilio call
243
+ },
244
+ {
245
+ label: 'availability_blocks.handle_autoreply',
246
+ method: 'post', path: '/handle-out-of-office-autoreply',
247
+ data: { channel: 'Email', enduserId: ABSENT_ID }, // communications.ts:42 `if (!enduser) return`
248
+ },
249
+ ];
250
+ _i = 0, groupB_1 = groupB;
251
+ _l.label = 18;
252
+ case 18:
253
+ if (!(_i < groupB_1.length)) return [3 /*break*/, 22];
254
+ probe = groupB_1[_i];
255
+ if (probe.skip) {
256
+ record("B: ".concat(probe.label, " rejects a non-admin"), true, "SKIPPED (safety) \u2014 ".concat(probe.skip));
257
+ return [3 /*break*/, 21];
258
+ }
259
+ return [4 /*yield*/, request(attackerToken, probe.method, probe.path, probe.data)
260
+ // baseline: an admin must NOT be admin-denied on the same path, so a blanket 401 can't pass
261
+ ];
262
+ case 19:
263
+ attackerResult = _l.sent();
264
+ return [4 /*yield*/, request(adminToken, probe.method, probe.path, probe.data)];
265
+ case 20:
266
+ baseline = _l.sent();
267
+ badProbe = isAdminDenial(baseline);
268
+ record("B: ".concat(probe.label, " rejects a non-admin"), !badProbe && isAdminDenial(attackerResult), "attacker=".concat(summarize(attackerResult), " | admin baseline=").concat(baseline.status)
269
+ + (badProbe ? ' BAD PROBE: admin was also admin-denied' : ''));
270
+ _l.label = 21;
271
+ case 21:
272
+ _i++;
273
+ return [3 /*break*/, 18];
274
+ case 22:
275
+ groupA = [
276
+ {
277
+ label: 'organizations.sync_note_to_canvas',
278
+ method: 'post', path: '/organizations/sync-note-to-canvas',
279
+ data: { enduserId: ABSENT_ID, note: 'F-0191 control' }, // 404 Enduser not found
280
+ },
281
+ {
282
+ label: 'background_errors.mark_read',
283
+ method: 'post', path: '/background-errors/mark-read', data: {},
284
+ },
285
+ {
286
+ label: 'users.send_invitation_to_existing',
287
+ method: 'post', path: '/invite-existing-user-to-organization',
288
+ // takes userId (not email); an absent id hits RecordNotFoundError, well short of any invite
289
+ data: { userId: ABSENT_ID },
290
+ },
291
+ ];
292
+ _d = 0, groupA_1 = groupA;
293
+ _l.label = 23;
294
+ case 23:
295
+ if (!(_d < groupA_1.length)) return [3 /*break*/, 26];
296
+ probe = groupA_1[_d];
297
+ return [4 /*yield*/, request(attackerToken, probe.method, probe.path, probe.data)];
298
+ case 24:
299
+ r = _l.sent();
300
+ record("A: ".concat(probe.label, " stays reachable by a non-admin (flag intentionally dropped)"), !isAdminDenial(r), "".concat(summarize(r), " (expected a handler response, not 401 Admin access only)"));
301
+ _l.label = 25;
302
+ case 25:
303
+ _d++;
304
+ return [3 /*break*/, 23];
305
+ case 26:
306
+ /* ===== report: print full table first, then assert (harness exits on first failure) ===== */
307
+ console.log('\n F-0191 check summary:');
308
+ for (_e = 0, checks_1 = checks; _e < checks_1.length; _e++) {
309
+ c = checks_1[_e];
310
+ console.log(" ".concat(c.pass ? 'PASS' : 'FAIL', " ").concat(c.label, " \u2014 ").concat(c.detail));
311
+ }
312
+ console.log('');
313
+ for (_f = 0, checks_2 = checks; _f < checks_2.length; _f++) {
314
+ c = checks_2[_f];
315
+ (0, testing_1.assert)(c.pass, "".concat(c.label, " \u2014 ").concat(c.detail), c.label);
316
+ }
317
+ return [3 /*break*/, 40];
318
+ case 27:
319
+ if (!enduserId) return [3 /*break*/, 31];
320
+ _l.label = 28;
321
+ case 28:
322
+ _l.trys.push([28, 30, , 31]);
323
+ return [4 /*yield*/, sdk.api.endusers.deleteOne(enduserId)];
324
+ case 29:
325
+ _l.sent();
326
+ return [3 /*break*/, 31];
327
+ case 30:
328
+ _g = _l.sent();
329
+ return [3 /*break*/, 31];
330
+ case 31:
331
+ if (!attackerId) return [3 /*break*/, 35];
332
+ _l.label = 32;
333
+ case 32:
334
+ _l.trys.push([32, 34, , 35]);
335
+ return [4 /*yield*/, sdk.api.users.deleteOne(attackerId)];
336
+ case 33:
337
+ _l.sent();
338
+ return [3 /*break*/, 35];
339
+ case 34:
340
+ _h = _l.sent();
341
+ return [3 /*break*/, 35];
342
+ case 35:
343
+ if (!roleId) return [3 /*break*/, 39];
344
+ _l.label = 36;
345
+ case 36:
346
+ _l.trys.push([36, 38, , 39]);
347
+ return [4 /*yield*/, sdk.api.role_based_access_permissions.deleteOne(roleId)];
348
+ case 37:
349
+ _l.sent();
350
+ return [3 /*break*/, 39];
351
+ case 38:
352
+ _j = _l.sent();
353
+ return [3 /*break*/, 39];
354
+ case 39: return [7 /*endfinally*/];
355
+ case 40: return [2 /*return*/];
356
+ }
357
+ });
358
+ });
359
+ };
360
+ exports.schema_adminonly_enforcement_tests = schema_adminonly_enforcement_tests;
361
+ // Allow running this test file independently
362
+ if (require.main === module) {
363
+ console.log("\uD83C\uDF10 Using API URL: ".concat(host));
364
+ var sdk_2 = new sdk_1.Session({ host: host });
365
+ var sdkNonAdmin_1 = new sdk_1.Session({ host: host });
366
+ var runTests = function () { return __awaiter(void 0, void 0, void 0, function () {
367
+ return __generator(this, function (_a) {
368
+ switch (_a.label) {
369
+ case 0: return [4 /*yield*/, (0, setup_1.setup_tests)(sdk_2, sdkNonAdmin_1)];
370
+ case 1:
371
+ _a.sent();
372
+ return [4 /*yield*/, (0, exports.schema_adminonly_enforcement_tests)({ sdk: sdk_2, sdkNonAdmin: sdkNonAdmin_1 })];
373
+ case 2:
374
+ _a.sent();
375
+ return [2 /*return*/];
376
+ }
377
+ });
378
+ }); };
379
+ runTests()
380
+ .then(function () {
381
+ console.log("✅ F-0191 schema adminOnly enforcement test suite completed successfully");
382
+ process.exit(0);
383
+ })
384
+ .catch(function (error) {
385
+ console.error("❌ F-0191 schema adminOnly enforcement test suite failed:", error);
386
+ process.exit(1);
387
+ });
388
+ }
389
+ //# sourceMappingURL=F-0191-schema-adminonly-enforcement.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"F-0191-schema-adminonly-enforcement.test.js","sourceRoot":"","sources":["../../../../../src/tests/api_tests/security/F-0191-schema-adminonly-enforcement.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE,CAAC;AAExC,gDAAyB;AAEzB,oCAAsC;AACtC,+CAG4B;AAC5B,mDAA4D;AAC5D,qCAAyC;AAEzC,IAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,uBAAgC,CAAA;AAEpE,IAAM,IAAI,GAAG,cAAM,OAAA,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAvC,CAAuC,CAAA;AAE1D,IAAM,GAAG,GAAG,KAAc,CAAA;AAC1B,IAAM,WAAW,GAAG,EAAE,MAAM,EAAE,GAAG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C,KAAG,EAAE,aAAW,CAAC,EAAA;;oBAAnC,SAAmC,CAAA;oBACnC,qBAAM,IAAA,0CAAkC,EAAC,EAAE,GAAG,OAAA,EAAE,WAAW,eAAA,EAAE,CAAC,EAAA;;oBAA9D,SAA8D,CAAA;;;;SAC/D,CAAA;IAED,QAAQ,EAAE;SACP,IAAI,CAAC;QACJ,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAA;QACtF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,CAAC;SACD,KAAK,CAAC,UAAC,KAAK;QACX,OAAO,CAAC,KAAK,CAAC,0DAA0D,EAAE,KAAK,CAAC,CAAA;QAChF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,CAAC,CAAA;CACL"}
@@ -0,0 +1,43 @@
1
+ import { Session } from "../../../sdk";
2
+ /**
3
+ * Regression test for F-0192
4
+ * (security-audit/findings/F-0192-automated-actions-process-fire-replay.md).
5
+ *
6
+ * `automated_actions.process` (api.ts:3902) is the WORKER's action runner — its schema description
7
+ * reads "Used by worker for new action types". It was registered with only
8
+ * `{ requiresSubscription: true }`, so the framework gated it on the ordinary
9
+ * `automated_actions.update` verb, which the default provider role holds ('Assigned'). The handler
10
+ * then dispatched `automatedAction.action` through a 14-branch if-chain reaching real vendors:
11
+ * chargebeeChargeCardOnFile (card charge), belugaAutoRx / belugaTriggerRefill / mdiTriggerRefill
12
+ * (prescriptions and refills), createScriptSureDraft (medication draft), healthiePushForms /
13
+ * metriportPushFormResponse (PHI export). It checked neither the row's `status` nor whether it had
14
+ * already run, so any row was replayable: MDI advances to the next scheduled refill each call,
15
+ * Chargebee charges again. And there was no storeUserLog, so the action was attributed to the
16
+ * worker rather than the caller.
17
+ *
18
+ * The fix has three parts:
19
+ * 1. `adminOnly: true` on the api.ts registration (routing.ts:944 reads the flag from that
20
+ * options object — a schema-only flag is inert, which is the separate finding F-0191).
21
+ * 2. A single-fire claim for human callers: an atomic findOneAndUpdate with `status: 'active'` in
22
+ * the filter, stamping `finished` + `processedAt` before the vendor dispatch. The worker
23
+ * (`wasAutomated`) is exempt because its own claim in
24
+ * worker/modules/database.ts:114 is already atomic and it needs the row to stay 'active'
25
+ * across the call so a retryable failure (worker/modules/automations.ts:2053) can be
26
+ * re-claimed after the lock times out.
27
+ * 3. storeUserLog on the human path, recording the caller and the automatedActionId.
28
+ *
29
+ * The seeded row uses `setEnduserStatus`, which is NOT one of the API's if-chain branches, so it
30
+ * falls through to `{ success: false, unimplemented: true }` (api.ts) — no vendor call, no Bedrock,
31
+ * no PHI export. `processAfter` is set an hour out so the live worker cannot race the row (the same
32
+ * trick mdi_trigger_refill / beluga_trigger_refill use).
33
+ *
34
+ * RED (pre-fix): A1 fails (a non-admin holding only `automated_actions.update` reaches the handler)
35
+ * and C1 fails (the second call on the same row executes again instead of being rejected).
36
+ * B1 (admin positive control) passes pre-fix and must keep passing.
37
+ * GREEN (post-fix): all five checks pass.
38
+ */
39
+ export declare const automated_actions_process_gate_tests: ({ sdk }: {
40
+ sdk: Session;
41
+ sdkNonAdmin: Session;
42
+ }) => Promise<void>;
43
+ //# sourceMappingURL=F-0192-automated-actions-process-gate.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"F-0192-automated-actions-process-gate.test.d.ts","sourceRoot":"","sources":["../../../../../src/tests/api_tests/security/F-0192-automated-actions-process-gate.test.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AA0BtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,oCAAoC;SAA2B,OAAO;iBAAe,OAAO;mBAoJxG,CAAA"}