@nocobase/plugin-idp-oauth 2.1.0-alpha.10

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 (451) hide show
  1. package/LICENSE.txt +107 -0
  2. package/README.md +14 -0
  3. package/build.config.ts +46 -0
  4. package/client.d.ts +2 -0
  5. package/client.js +1 -0
  6. package/dist/client/ErrorPage.d.ts +11 -0
  7. package/dist/client/InteractionPage.d.ts +11 -0
  8. package/dist/client/index.d.ts +9 -0
  9. package/dist/client/index.js +10 -0
  10. package/dist/client/locale.d.ts +10 -0
  11. package/dist/client/models/index.d.ts +11 -0
  12. package/dist/client/plugin.d.ts +13 -0
  13. package/dist/externalVersion.js +18 -0
  14. package/dist/index.d.ts +10 -0
  15. package/dist/index.js +48 -0
  16. package/dist/locale/en-US.json +1 -0
  17. package/dist/locale/zh-CN.json +1 -0
  18. package/dist/node_modules/eta/LICENSE +7 -0
  19. package/dist/node_modules/eta/README.md +185 -0
  20. package/dist/node_modules/eta/dist/core.d.ts +179 -0
  21. package/dist/node_modules/eta/dist/core.d.ts.map +1 -0
  22. package/dist/node_modules/eta/dist/core.js +42 -0
  23. package/dist/node_modules/eta/dist/core.js.map +1 -0
  24. package/dist/node_modules/eta/dist/index.cjs +542 -0
  25. package/dist/node_modules/eta/dist/index.cjs.map +1 -0
  26. package/dist/node_modules/eta/dist/index.d.cts +187 -0
  27. package/dist/node_modules/eta/dist/index.d.cts.map +1 -0
  28. package/dist/node_modules/eta/dist/index.d.mts +187 -0
  29. package/dist/node_modules/eta/dist/index.d.mts.map +1 -0
  30. package/dist/node_modules/eta/dist/index.mjs +512 -0
  31. package/dist/node_modules/eta/dist/index.mjs.map +1 -0
  32. package/dist/node_modules/eta/package.json +75 -0
  33. package/dist/node_modules/jose/LICENSE.md +21 -0
  34. package/dist/node_modules/jose/README.md +153 -0
  35. package/dist/node_modules/jose/dist/types/index.d.ts +55 -0
  36. package/dist/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +31 -0
  37. package/dist/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +65 -0
  38. package/dist/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +31 -0
  39. package/dist/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +83 -0
  40. package/dist/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +38 -0
  41. package/dist/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +74 -0
  42. package/dist/node_modules/jose/dist/types/jwk/embedded.d.ts +17 -0
  43. package/dist/node_modules/jose/dist/types/jwk/thumbprint.d.ts +32 -0
  44. package/dist/node_modules/jose/dist/types/jwks/local.d.ts +29 -0
  45. package/dist/node_modules/jose/dist/types/jwks/remote.d.ts +237 -0
  46. package/dist/node_modules/jose/dist/types/jws/compact/sign.d.ts +36 -0
  47. package/dist/node_modules/jose/dist/types/jws/compact/verify.d.ts +33 -0
  48. package/dist/node_modules/jose/dist/types/jws/flattened/sign.d.ts +42 -0
  49. package/dist/node_modules/jose/dist/types/jws/flattened/verify.d.ts +33 -0
  50. package/dist/node_modules/jose/dist/types/jws/general/sign.d.ts +53 -0
  51. package/dist/node_modules/jose/dist/types/jws/general/verify.d.ts +41 -0
  52. package/dist/node_modules/jose/dist/types/jwt/decrypt.d.ts +35 -0
  53. package/dist/node_modules/jose/dist/types/jwt/encrypt.d.ts +91 -0
  54. package/dist/node_modules/jose/dist/types/jwt/sign.d.ts +43 -0
  55. package/dist/node_modules/jose/dist/types/jwt/unsecured.d.ts +43 -0
  56. package/dist/node_modules/jose/dist/types/jwt/verify.d.ts +37 -0
  57. package/dist/node_modules/jose/dist/types/key/export.d.ts +33 -0
  58. package/dist/node_modules/jose/dist/types/key/generate_key_pair.d.ts +47 -0
  59. package/dist/node_modules/jose/dist/types/key/generate_secret.d.ts +35 -0
  60. package/dist/node_modules/jose/dist/types/key/import.d.ts +83 -0
  61. package/dist/node_modules/jose/dist/types/types.d.ts +852 -0
  62. package/dist/node_modules/jose/dist/types/util/base64url.d.ts +9 -0
  63. package/dist/node_modules/jose/dist/types/util/decode_jwt.d.ts +18 -0
  64. package/dist/node_modules/jose/dist/types/util/decode_protected_header.d.ts +17 -0
  65. package/dist/node_modules/jose/dist/types/util/errors.d.ts +213 -0
  66. package/dist/node_modules/jose/dist/webapi/index.js +32 -0
  67. package/dist/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +27 -0
  68. package/dist/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +27 -0
  69. package/dist/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +155 -0
  70. package/dist/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +165 -0
  71. package/dist/node_modules/jose/dist/webapi/jwe/general/decrypt.js +31 -0
  72. package/dist/node_modules/jose/dist/webapi/jwe/general/encrypt.js +182 -0
  73. package/dist/node_modules/jose/dist/webapi/jwk/embedded.js +17 -0
  74. package/dist/node_modules/jose/dist/webapi/jwk/thumbprint.js +68 -0
  75. package/dist/node_modules/jose/dist/webapi/jwks/local.js +119 -0
  76. package/dist/node_modules/jose/dist/webapi/jwks/remote.js +179 -0
  77. package/dist/node_modules/jose/dist/webapi/jws/compact/sign.js +18 -0
  78. package/dist/node_modules/jose/dist/webapi/jws/compact/verify.js +21 -0
  79. package/dist/node_modules/jose/dist/webapi/jws/flattened/sign.js +89 -0
  80. package/dist/node_modules/jose/dist/webapi/jws/flattened/verify.js +110 -0
  81. package/dist/node_modules/jose/dist/webapi/jws/general/sign.js +70 -0
  82. package/dist/node_modules/jose/dist/webapi/jws/general/verify.js +24 -0
  83. package/dist/node_modules/jose/dist/webapi/jwt/decrypt.js +23 -0
  84. package/dist/node_modules/jose/dist/webapi/jwt/encrypt.js +101 -0
  85. package/dist/node_modules/jose/dist/webapi/jwt/sign.js +52 -0
  86. package/dist/node_modules/jose/dist/webapi/jwt/unsecured.js +63 -0
  87. package/dist/node_modules/jose/dist/webapi/jwt/verify.js +15 -0
  88. package/dist/node_modules/jose/dist/webapi/key/export.js +11 -0
  89. package/dist/node_modules/jose/dist/webapi/key/generate_key_pair.js +97 -0
  90. package/dist/node_modules/jose/dist/webapi/key/generate_secret.js +40 -0
  91. package/dist/node_modules/jose/dist/webapi/key/import.js +57 -0
  92. package/dist/node_modules/jose/dist/webapi/lib/aesgcmkw.js +15 -0
  93. package/dist/node_modules/jose/dist/webapi/lib/aeskw.js +25 -0
  94. package/dist/node_modules/jose/dist/webapi/lib/asn1.js +243 -0
  95. package/dist/node_modules/jose/dist/webapi/lib/base64.js +22 -0
  96. package/dist/node_modules/jose/dist/webapi/lib/buffer_utils.js +43 -0
  97. package/dist/node_modules/jose/dist/webapi/lib/check_key_type.js +122 -0
  98. package/dist/node_modules/jose/dist/webapi/lib/content_encryption.js +217 -0
  99. package/dist/node_modules/jose/dist/webapi/lib/crypto_key.js +136 -0
  100. package/dist/node_modules/jose/dist/webapi/lib/deflate.js +44 -0
  101. package/dist/node_modules/jose/dist/webapi/lib/ecdhes.js +52 -0
  102. package/dist/node_modules/jose/dist/webapi/lib/helpers.js +19 -0
  103. package/dist/node_modules/jose/dist/webapi/lib/invalid_key_input.js +27 -0
  104. package/dist/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -0
  105. package/dist/node_modules/jose/dist/webapi/lib/jwk_to_key.js +107 -0
  106. package/dist/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +238 -0
  107. package/dist/node_modules/jose/dist/webapi/lib/key_management.js +186 -0
  108. package/dist/node_modules/jose/dist/webapi/lib/key_to_jwk.js +31 -0
  109. package/dist/node_modules/jose/dist/webapi/lib/normalize_key.js +166 -0
  110. package/dist/node_modules/jose/dist/webapi/lib/pbes2kw.js +39 -0
  111. package/dist/node_modules/jose/dist/webapi/lib/rsaes.js +24 -0
  112. package/dist/node_modules/jose/dist/webapi/lib/signing.js +68 -0
  113. package/dist/node_modules/jose/dist/webapi/lib/type_checks.js +40 -0
  114. package/dist/node_modules/jose/dist/webapi/lib/validate_algorithms.js +10 -0
  115. package/dist/node_modules/jose/dist/webapi/lib/validate_crit.js +33 -0
  116. package/dist/node_modules/jose/dist/webapi/util/base64url.js +30 -0
  117. package/dist/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -0
  118. package/dist/node_modules/jose/dist/webapi/util/decode_protected_header.js +34 -0
  119. package/dist/node_modules/jose/dist/webapi/util/errors.js +99 -0
  120. package/dist/node_modules/jose/package.json +200 -0
  121. package/dist/node_modules/light-my-request/.gitattributes +2 -0
  122. package/dist/node_modules/light-my-request/.github/dependabot.yml +13 -0
  123. package/dist/node_modules/light-my-request/.github/stale.yml +21 -0
  124. package/dist/node_modules/light-my-request/.github/workflows/benchmark.yml +30 -0
  125. package/dist/node_modules/light-my-request/.github/workflows/ci.yml +23 -0
  126. package/dist/node_modules/light-my-request/LICENSE +32 -0
  127. package/dist/node_modules/light-my-request/benchmark/benchmark.js +164 -0
  128. package/dist/node_modules/light-my-request/build/build-validation.js +100 -0
  129. package/dist/node_modules/light-my-request/eslint.config.js +9 -0
  130. package/dist/node_modules/light-my-request/index.js +2 -0
  131. package/dist/node_modules/light-my-request/lib/config-validator.js +919 -0
  132. package/dist/node_modules/light-my-request/lib/form-data.js +79 -0
  133. package/dist/node_modules/light-my-request/lib/parse-url.js +47 -0
  134. package/dist/node_modules/light-my-request/lib/request.js +290 -0
  135. package/dist/node_modules/light-my-request/lib/response.js +240 -0
  136. package/dist/node_modules/light-my-request/node_modules/process-warning/.gitattributes +2 -0
  137. package/dist/node_modules/light-my-request/node_modules/process-warning/.github/dependabot.yml +13 -0
  138. package/dist/node_modules/light-my-request/node_modules/process-warning/.github/workflows/ci.yml +24 -0
  139. package/dist/node_modules/light-my-request/node_modules/process-warning/.taprc +2 -0
  140. package/dist/node_modules/light-my-request/node_modules/process-warning/benchmarks/warn.js +25 -0
  141. package/dist/node_modules/light-my-request/node_modules/process-warning/eslint.config.js +6 -0
  142. package/dist/node_modules/light-my-request/node_modules/process-warning/examples/example.js +11 -0
  143. package/dist/node_modules/light-my-request/node_modules/process-warning/index.js +124 -0
  144. package/dist/node_modules/light-my-request/node_modules/process-warning/package.json +73 -0
  145. package/dist/node_modules/light-my-request/node_modules/process-warning/test/emit-interpolated-string.test.js +29 -0
  146. package/dist/node_modules/light-my-request/node_modules/process-warning/test/emit-once-only.test.js +28 -0
  147. package/dist/node_modules/light-my-request/node_modules/process-warning/test/emit-reset.test.js +36 -0
  148. package/dist/node_modules/light-my-request/node_modules/process-warning/test/emit-set.test.js +30 -0
  149. package/dist/node_modules/light-my-request/node_modules/process-warning/test/emit-unlimited.test.js +37 -0
  150. package/dist/node_modules/light-my-request/node_modules/process-warning/test/index.test.js +99 -0
  151. package/dist/node_modules/light-my-request/node_modules/process-warning/test/issue-88.test.js +33 -0
  152. package/dist/node_modules/light-my-request/node_modules/process-warning/test/jest.test.js +22 -0
  153. package/dist/node_modules/light-my-request/node_modules/process-warning/test/no-warnings.test.js +80 -0
  154. package/dist/node_modules/light-my-request/node_modules/process-warning/types/index.d.ts +37 -0
  155. package/dist/node_modules/light-my-request/node_modules/process-warning/types/index.test-d.ts +36 -0
  156. package/dist/node_modules/light-my-request/package.json +1 -0
  157. package/dist/node_modules/light-my-request/test/async-await.test.js +55 -0
  158. package/dist/node_modules/light-my-request/test/index.test.js +2316 -0
  159. package/dist/node_modules/light-my-request/test/request.test.js +16 -0
  160. package/dist/node_modules/light-my-request/test/response.test.js +19 -0
  161. package/dist/node_modules/light-my-request/test/stream.test.js +359 -0
  162. package/dist/node_modules/light-my-request/types/index.d.ts +128 -0
  163. package/dist/node_modules/light-my-request/types/index.test-d.ts +149 -0
  164. package/dist/node_modules/oidc-provider/LICENSE.md +21 -0
  165. package/dist/node_modules/oidc-provider/README.md +174 -0
  166. package/dist/node_modules/oidc-provider/lib/actions/authorization/assign_claims.js +28 -0
  167. package/dist/node_modules/oidc-provider/lib/actions/authorization/assign_defaults.js +17 -0
  168. package/dist/node_modules/oidc-provider/lib/actions/authorization/authenticated_client_id.js +6 -0
  169. package/dist/node_modules/oidc-provider/lib/actions/authorization/backchannel_request_remap_errors.js +17 -0
  170. package/dist/node_modules/oidc-provider/lib/actions/authorization/backchannel_request_response.js +41 -0
  171. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_ciba_context.js +12 -0
  172. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_claims.js +68 -0
  173. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_client.js +21 -0
  174. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_client_grant_type.js +21 -0
  175. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_dpop_jkt.js +35 -0
  176. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_extra_params.js +18 -0
  177. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_id_token_hint.js +23 -0
  178. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_max_age.js +25 -0
  179. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_openid_scope.js +47 -0
  180. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_pkce.js +41 -0
  181. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_prompt.js +25 -0
  182. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_redirect_uri.js +41 -0
  183. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_requested_expiry.js +16 -0
  184. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_response_mode.js +54 -0
  185. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_response_type.js +26 -0
  186. package/dist/node_modules/oidc-provider/lib/actions/authorization/check_scope.js +53 -0
  187. package/dist/node_modules/oidc-provider/lib/actions/authorization/ciba_load_account.js +58 -0
  188. package/dist/node_modules/oidc-provider/lib/actions/authorization/ciba_required.js +13 -0
  189. package/dist/node_modules/oidc-provider/lib/actions/authorization/device_authorization_response.js +31 -0
  190. package/dist/node_modules/oidc-provider/lib/actions/authorization/device_user_flow.js +31 -0
  191. package/dist/node_modules/oidc-provider/lib/actions/authorization/device_user_flow_errors.js +37 -0
  192. package/dist/node_modules/oidc-provider/lib/actions/authorization/device_user_flow_response.js +55 -0
  193. package/dist/node_modules/oidc-provider/lib/actions/authorization/index.js +200 -0
  194. package/dist/node_modules/oidc-provider/lib/actions/authorization/interaction_emit.js +9 -0
  195. package/dist/node_modules/oidc-provider/lib/actions/authorization/interactions.js +149 -0
  196. package/dist/node_modules/oidc-provider/lib/actions/authorization/load_account.js +15 -0
  197. package/dist/node_modules/oidc-provider/lib/actions/authorization/load_grant.js +29 -0
  198. package/dist/node_modules/oidc-provider/lib/actions/authorization/load_pushed_authorization_request.js +36 -0
  199. package/dist/node_modules/oidc-provider/lib/actions/authorization/oauth_required.js +11 -0
  200. package/dist/node_modules/oidc-provider/lib/actions/authorization/oidc_required.js +27 -0
  201. package/dist/node_modules/oidc-provider/lib/actions/authorization/one_redirect_uri_clients.js +20 -0
  202. package/dist/node_modules/oidc-provider/lib/actions/authorization/process_request_object.js +214 -0
  203. package/dist/node_modules/oidc-provider/lib/actions/authorization/pushed_authorization_request_remap_errors.js +17 -0
  204. package/dist/node_modules/oidc-provider/lib/actions/authorization/pushed_authorization_request_response.js +65 -0
  205. package/dist/node_modules/oidc-provider/lib/actions/authorization/reject_registration.js +12 -0
  206. package/dist/node_modules/oidc-provider/lib/actions/authorization/reject_request_and_uri.js +12 -0
  207. package/dist/node_modules/oidc-provider/lib/actions/authorization/reject_unsupported.js +33 -0
  208. package/dist/node_modules/oidc-provider/lib/actions/authorization/respond.js +46 -0
  209. package/dist/node_modules/oidc-provider/lib/actions/authorization/resume.js +111 -0
  210. package/dist/node_modules/oidc-provider/lib/actions/authorization/strip_outside_jar_params.js +19 -0
  211. package/dist/node_modules/oidc-provider/lib/actions/authorization/unsupported_rar.js +9 -0
  212. package/dist/node_modules/oidc-provider/lib/actions/challenge.js +22 -0
  213. package/dist/node_modules/oidc-provider/lib/actions/code_verification.js +122 -0
  214. package/dist/node_modules/oidc-provider/lib/actions/discovery.js +151 -0
  215. package/dist/node_modules/oidc-provider/lib/actions/end_session.js +222 -0
  216. package/dist/node_modules/oidc-provider/lib/actions/grants/authorization_code.js +144 -0
  217. package/dist/node_modules/oidc-provider/lib/actions/grants/ciba.js +127 -0
  218. package/dist/node_modules/oidc-provider/lib/actions/grants/client_credentials.js +79 -0
  219. package/dist/node_modules/oidc-provider/lib/actions/grants/device_code.js +125 -0
  220. package/dist/node_modules/oidc-provider/lib/actions/grants/index.js +7 -0
  221. package/dist/node_modules/oidc-provider/lib/actions/grants/refresh_token.js +229 -0
  222. package/dist/node_modules/oidc-provider/lib/actions/index.js +25 -0
  223. package/dist/node_modules/oidc-provider/lib/actions/interaction.js +150 -0
  224. package/dist/node_modules/oidc-provider/lib/actions/introspection.js +164 -0
  225. package/dist/node_modules/oidc-provider/lib/actions/jwks.js +7 -0
  226. package/dist/node_modules/oidc-provider/lib/actions/registration.js +274 -0
  227. package/dist/node_modules/oidc-provider/lib/actions/revocation.js +81 -0
  228. package/dist/node_modules/oidc-provider/lib/actions/token.js +74 -0
  229. package/dist/node_modules/oidc-provider/lib/actions/userinfo.js +183 -0
  230. package/dist/node_modules/oidc-provider/lib/adapters/memory_adapter.js +95 -0
  231. package/dist/node_modules/oidc-provider/lib/consts/client_attributes.js +211 -0
  232. package/dist/node_modules/oidc-provider/lib/consts/dev_keystore.js +18 -0
  233. package/dist/node_modules/oidc-provider/lib/consts/index.js +13 -0
  234. package/dist/node_modules/oidc-provider/lib/consts/jwa.js +47 -0
  235. package/dist/node_modules/oidc-provider/lib/consts/non_rejectable_claims.js +1 -0
  236. package/dist/node_modules/oidc-provider/lib/consts/param_list.js +23 -0
  237. package/dist/node_modules/oidc-provider/lib/helpers/_/camel_case.js +1 -0
  238. package/dist/node_modules/oidc-provider/lib/helpers/_/defaults.js +28 -0
  239. package/dist/node_modules/oidc-provider/lib/helpers/_/difference.js +1 -0
  240. package/dist/node_modules/oidc-provider/lib/helpers/_/is_plain_object.js +1 -0
  241. package/dist/node_modules/oidc-provider/lib/helpers/_/map_keys.js +9 -0
  242. package/dist/node_modules/oidc-provider/lib/helpers/_/merge.js +25 -0
  243. package/dist/node_modules/oidc-provider/lib/helpers/_/omit_by.js +11 -0
  244. package/dist/node_modules/oidc-provider/lib/helpers/_/pick.js +10 -0
  245. package/dist/node_modules/oidc-provider/lib/helpers/_/pick_by.js +10 -0
  246. package/dist/node_modules/oidc-provider/lib/helpers/_/remove.js +9 -0
  247. package/dist/node_modules/oidc-provider/lib/helpers/_/set.js +18 -0
  248. package/dist/node_modules/oidc-provider/lib/helpers/_/snake_case.js +1 -0
  249. package/dist/node_modules/oidc-provider/lib/helpers/_/upper_first.js +1 -0
  250. package/dist/node_modules/oidc-provider/lib/helpers/account_claims.js +6 -0
  251. package/dist/node_modules/oidc-provider/lib/helpers/add_client.js +14 -0
  252. package/dist/node_modules/oidc-provider/lib/helpers/als.js +3 -0
  253. package/dist/node_modules/oidc-provider/lib/helpers/append_www_authenticate.js +9 -0
  254. package/dist/node_modules/oidc-provider/lib/helpers/attention.js +23 -0
  255. package/dist/node_modules/oidc-provider/lib/helpers/base64url.js +11 -0
  256. package/dist/node_modules/oidc-provider/lib/helpers/certificate_thumbprint.js +15 -0
  257. package/dist/node_modules/oidc-provider/lib/helpers/challenge.js +111 -0
  258. package/dist/node_modules/oidc-provider/lib/helpers/check_attest_binding.js +10 -0
  259. package/dist/node_modules/oidc-provider/lib/helpers/claims.js +79 -0
  260. package/dist/node_modules/oidc-provider/lib/helpers/client_id_metadata_document.js +198 -0
  261. package/dist/node_modules/oidc-provider/lib/helpers/client_schema.js +700 -0
  262. package/dist/node_modules/oidc-provider/lib/helpers/combined_scope.js +17 -0
  263. package/dist/node_modules/oidc-provider/lib/helpers/configuration.js +544 -0
  264. package/dist/node_modules/oidc-provider/lib/helpers/constant_equals.js +20 -0
  265. package/dist/node_modules/oidc-provider/lib/helpers/defaults.js +3510 -0
  266. package/dist/node_modules/oidc-provider/lib/helpers/epoch_time.js +1 -0
  267. package/dist/node_modules/oidc-provider/lib/helpers/err_out.js +17 -0
  268. package/dist/node_modules/oidc-provider/lib/helpers/errors.js +161 -0
  269. package/dist/node_modules/oidc-provider/lib/helpers/features.js +51 -0
  270. package/dist/node_modules/oidc-provider/lib/helpers/fetch_body_check.js +25 -0
  271. package/dist/node_modules/oidc-provider/lib/helpers/fetch_request.js +221 -0
  272. package/dist/node_modules/oidc-provider/lib/helpers/filter_claims.js +16 -0
  273. package/dist/node_modules/oidc-provider/lib/helpers/formatters.js +24 -0
  274. package/dist/node_modules/oidc-provider/lib/helpers/grant_common.js +214 -0
  275. package/dist/node_modules/oidc-provider/lib/helpers/html_safe.js +19 -0
  276. package/dist/node_modules/oidc-provider/lib/helpers/initialize_adapter.js +24 -0
  277. package/dist/node_modules/oidc-provider/lib/helpers/initialize_app.js +243 -0
  278. package/dist/node_modules/oidc-provider/lib/helpers/initialize_clients.js +24 -0
  279. package/dist/node_modules/oidc-provider/lib/helpers/initialize_keystore.js +310 -0
  280. package/dist/node_modules/oidc-provider/lib/helpers/interaction_policy/check.js +21 -0
  281. package/dist/node_modules/oidc-provider/lib/helpers/interaction_policy/index.js +43 -0
  282. package/dist/node_modules/oidc-provider/lib/helpers/interaction_policy/prompt.js +95 -0
  283. package/dist/node_modules/oidc-provider/lib/helpers/interaction_policy/prompts/consent.js +105 -0
  284. package/dist/node_modules/oidc-provider/lib/helpers/interaction_policy/prompts/login.js +162 -0
  285. package/dist/node_modules/oidc-provider/lib/helpers/jwt.js +211 -0
  286. package/dist/node_modules/oidc-provider/lib/helpers/keystore.js +301 -0
  287. package/dist/node_modules/oidc-provider/lib/helpers/nanoid.js +5 -0
  288. package/dist/node_modules/oidc-provider/lib/helpers/oidc_context.js +284 -0
  289. package/dist/node_modules/oidc-provider/lib/helpers/params.js +27 -0
  290. package/dist/node_modules/oidc-provider/lib/helpers/pkce.js +30 -0
  291. package/dist/node_modules/oidc-provider/lib/helpers/pkce_format.js +17 -0
  292. package/dist/node_modules/oidc-provider/lib/helpers/process_response_types.js +202 -0
  293. package/dist/node_modules/oidc-provider/lib/helpers/re_render_errors.js +39 -0
  294. package/dist/node_modules/oidc-provider/lib/helpers/redirect_uri.js +16 -0
  295. package/dist/node_modules/oidc-provider/lib/helpers/resolve_resource.js +33 -0
  296. package/dist/node_modules/oidc-provider/lib/helpers/resolve_response_mode.js +7 -0
  297. package/dist/node_modules/oidc-provider/lib/helpers/resource_server.js +20 -0
  298. package/dist/node_modules/oidc-provider/lib/helpers/revoke.js +27 -0
  299. package/dist/node_modules/oidc-provider/lib/helpers/script_src_sha.js +21 -0
  300. package/dist/node_modules/oidc-provider/lib/helpers/sector_identifier.js +19 -0
  301. package/dist/node_modules/oidc-provider/lib/helpers/sector_validate.js +55 -0
  302. package/dist/node_modules/oidc-provider/lib/helpers/set_rt_bindings.js +21 -0
  303. package/dist/node_modules/oidc-provider/lib/helpers/token_find.js +51 -0
  304. package/dist/node_modules/oidc-provider/lib/helpers/type_validators.js +8 -0
  305. package/dist/node_modules/oidc-provider/lib/helpers/user_code_form.js +19 -0
  306. package/dist/node_modules/oidc-provider/lib/helpers/user_codes.js +38 -0
  307. package/dist/node_modules/oidc-provider/lib/helpers/valid_url.js +8 -0
  308. package/dist/node_modules/oidc-provider/lib/helpers/validate_dpop.js +129 -0
  309. package/dist/node_modules/oidc-provider/lib/helpers/validate_presence.js +17 -0
  310. package/dist/node_modules/oidc-provider/lib/helpers/weak_cache.js +11 -0
  311. package/dist/node_modules/oidc-provider/lib/index.js +21 -0
  312. package/dist/node_modules/oidc-provider/lib/models/access_token.js +31 -0
  313. package/dist/node_modules/oidc-provider/lib/models/authorization_code.js +27 -0
  314. package/dist/node_modules/oidc-provider/lib/models/backchannel_authentication_request.js +26 -0
  315. package/dist/node_modules/oidc-provider/lib/models/base_model.js +141 -0
  316. package/dist/node_modules/oidc-provider/lib/models/base_token.js +86 -0
  317. package/dist/node_modules/oidc-provider/lib/models/client.js +593 -0
  318. package/dist/node_modules/oidc-provider/lib/models/client_credentials.js +19 -0
  319. package/dist/node_modules/oidc-provider/lib/models/device_code.js +44 -0
  320. package/dist/node_modules/oidc-provider/lib/models/formats/dynamic.js +21 -0
  321. package/dist/node_modules/oidc-provider/lib/models/formats/index.js +14 -0
  322. package/dist/node_modules/oidc-provider/lib/models/formats/jwt.js +198 -0
  323. package/dist/node_modules/oidc-provider/lib/models/formats/opaque.js +58 -0
  324. package/dist/node_modules/oidc-provider/lib/models/grant.js +243 -0
  325. package/dist/node_modules/oidc-provider/lib/models/id_token.js +271 -0
  326. package/dist/node_modules/oidc-provider/lib/models/index.js +37 -0
  327. package/dist/node_modules/oidc-provider/lib/models/initial_access_token.js +12 -0
  328. package/dist/node_modules/oidc-provider/lib/models/interaction.js +73 -0
  329. package/dist/node_modules/oidc-provider/lib/models/mixins/apply.js +4 -0
  330. package/dist/node_modules/oidc-provider/lib/models/mixins/consumable.js +17 -0
  331. package/dist/node_modules/oidc-provider/lib/models/mixins/has_format.js +46 -0
  332. package/dist/node_modules/oidc-provider/lib/models/mixins/has_grant_id.js +12 -0
  333. package/dist/node_modules/oidc-provider/lib/models/mixins/has_grant_type.js +8 -0
  334. package/dist/node_modules/oidc-provider/lib/models/mixins/has_policies.js +38 -0
  335. package/dist/node_modules/oidc-provider/lib/models/mixins/is_attestation_constrained.js +15 -0
  336. package/dist/node_modules/oidc-provider/lib/models/mixins/is_sender_constrained.js +50 -0
  337. package/dist/node_modules/oidc-provider/lib/models/mixins/is_session_bound.js +38 -0
  338. package/dist/node_modules/oidc-provider/lib/models/mixins/set_audience.js +21 -0
  339. package/dist/node_modules/oidc-provider/lib/models/mixins/stores_auth.js +16 -0
  340. package/dist/node_modules/oidc-provider/lib/models/mixins/stores_pkce.js +9 -0
  341. package/dist/node_modules/oidc-provider/lib/models/pushed_authorization_request.js +21 -0
  342. package/dist/node_modules/oidc-provider/lib/models/refresh_token.js +47 -0
  343. package/dist/node_modules/oidc-provider/lib/models/registration_access_token.js +8 -0
  344. package/dist/node_modules/oidc-provider/lib/models/replay_detection.js +31 -0
  345. package/dist/node_modules/oidc-provider/lib/models/session.js +192 -0
  346. package/dist/node_modules/oidc-provider/lib/provider.js +453 -0
  347. package/dist/node_modules/oidc-provider/lib/response_modes/form_post.js +36 -0
  348. package/dist/node_modules/oidc-provider/lib/response_modes/fragment.js +7 -0
  349. package/dist/node_modules/oidc-provider/lib/response_modes/index.js +15 -0
  350. package/dist/node_modules/oidc-provider/lib/response_modes/jwt.js +43 -0
  351. package/dist/node_modules/oidc-provider/lib/response_modes/query.js +7 -0
  352. package/dist/node_modules/oidc-provider/lib/response_modes/web_message.js +55 -0
  353. package/dist/node_modules/oidc-provider/lib/shared/assemble_params.js +7 -0
  354. package/dist/node_modules/oidc-provider/lib/shared/attest_client_auth.js +111 -0
  355. package/dist/node_modules/oidc-provider/lib/shared/authorization_error_handler.js +104 -0
  356. package/dist/node_modules/oidc-provider/lib/shared/check_rar.js +75 -0
  357. package/dist/node_modules/oidc-provider/lib/shared/check_resource.js +77 -0
  358. package/dist/node_modules/oidc-provider/lib/shared/client_auth.js +263 -0
  359. package/dist/node_modules/oidc-provider/lib/shared/conditional_body.js +9 -0
  360. package/dist/node_modules/oidc-provider/lib/shared/cors.js +49 -0
  361. package/dist/node_modules/oidc-provider/lib/shared/error_handler.js +59 -0
  362. package/dist/node_modules/oidc-provider/lib/shared/jwt_client_auth.js +79 -0
  363. package/dist/node_modules/oidc-provider/lib/shared/no_cache.js +4 -0
  364. package/dist/node_modules/oidc-provider/lib/shared/reject_dupes.js +45 -0
  365. package/dist/node_modules/oidc-provider/lib/shared/reject_structured_tokens.js +18 -0
  366. package/dist/node_modules/oidc-provider/lib/shared/selective_body.js +60 -0
  367. package/dist/node_modules/oidc-provider/lib/shared/session.js +68 -0
  368. package/dist/node_modules/oidc-provider/lib/shared/set_www_authenticate_header.js +52 -0
  369. package/dist/node_modules/oidc-provider/lib/views/index.js +22 -0
  370. package/dist/node_modules/oidc-provider/lib/views/interaction.js +171 -0
  371. package/dist/node_modules/oidc-provider/lib/views/layout.js +237 -0
  372. package/dist/node_modules/oidc-provider/lib/views/login.js +43 -0
  373. package/dist/node_modules/oidc-provider/node_modules/@koa/router/LICENSE +21 -0
  374. package/dist/node_modules/oidc-provider/node_modules/@koa/router/README.md +1370 -0
  375. package/dist/node_modules/oidc-provider/node_modules/@koa/router/dist/index.d.mts +1003 -0
  376. package/dist/node_modules/oidc-provider/node_modules/@koa/router/dist/index.d.ts +1003 -0
  377. package/dist/node_modules/oidc-provider/node_modules/@koa/router/dist/index.js +1616 -0
  378. package/dist/node_modules/oidc-provider/node_modules/@koa/router/dist/index.mjs +1573 -0
  379. package/dist/node_modules/oidc-provider/node_modules/@koa/router/package.json +122 -0
  380. package/dist/node_modules/oidc-provider/node_modules/debug/LICENSE +20 -0
  381. package/dist/node_modules/oidc-provider/node_modules/debug/README.md +481 -0
  382. package/dist/node_modules/oidc-provider/node_modules/debug/package.json +64 -0
  383. package/dist/node_modules/oidc-provider/node_modules/debug/src/browser.js +272 -0
  384. package/dist/node_modules/oidc-provider/node_modules/debug/src/common.js +292 -0
  385. package/dist/node_modules/oidc-provider/node_modules/debug/src/index.js +10 -0
  386. package/dist/node_modules/oidc-provider/node_modules/debug/src/node.js +263 -0
  387. package/dist/node_modules/oidc-provider/node_modules/http-errors/HISTORY.md +186 -0
  388. package/dist/node_modules/oidc-provider/node_modules/http-errors/LICENSE +23 -0
  389. package/dist/node_modules/oidc-provider/node_modules/http-errors/README.md +169 -0
  390. package/dist/node_modules/oidc-provider/node_modules/http-errors/index.js +290 -0
  391. package/dist/node_modules/oidc-provider/node_modules/http-errors/package.json +54 -0
  392. package/dist/node_modules/oidc-provider/node_modules/jsesc/LICENSE-MIT.txt +20 -0
  393. package/dist/node_modules/oidc-provider/node_modules/jsesc/README.md +422 -0
  394. package/dist/node_modules/oidc-provider/node_modules/jsesc/bin/jsesc +148 -0
  395. package/dist/node_modules/oidc-provider/node_modules/jsesc/jsesc.js +337 -0
  396. package/dist/node_modules/oidc-provider/node_modules/jsesc/man/jsesc.1 +94 -0
  397. package/dist/node_modules/oidc-provider/node_modules/jsesc/package.json +56 -0
  398. package/dist/node_modules/oidc-provider/node_modules/nanoid/LICENSE +20 -0
  399. package/dist/node_modules/oidc-provider/node_modules/nanoid/README.md +38 -0
  400. package/dist/node_modules/oidc-provider/node_modules/nanoid/bin/nanoid.js +55 -0
  401. package/dist/node_modules/oidc-provider/node_modules/nanoid/index.browser.js +29 -0
  402. package/dist/node_modules/oidc-provider/node_modules/nanoid/index.d.ts +106 -0
  403. package/dist/node_modules/oidc-provider/node_modules/nanoid/index.js +47 -0
  404. package/dist/node_modules/oidc-provider/node_modules/nanoid/nanoid.js +1 -0
  405. package/dist/node_modules/oidc-provider/node_modules/nanoid/non-secure/index.d.ts +48 -0
  406. package/dist/node_modules/oidc-provider/node_modules/nanoid/non-secure/index.js +21 -0
  407. package/dist/node_modules/oidc-provider/node_modules/nanoid/package.json +46 -0
  408. package/dist/node_modules/oidc-provider/node_modules/nanoid/url-alphabet/index.js +2 -0
  409. package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/LICENSE +21 -0
  410. package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/Readme.md +224 -0
  411. package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/dist/index.d.ts +144 -0
  412. package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/dist/index.js +409 -0
  413. package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/dist/index.js.map +1 -0
  414. package/dist/node_modules/oidc-provider/node_modules/path-to-regexp/package.json +64 -0
  415. package/dist/node_modules/oidc-provider/node_modules/statuses/HISTORY.md +87 -0
  416. package/dist/node_modules/oidc-provider/node_modules/statuses/LICENSE +23 -0
  417. package/dist/node_modules/oidc-provider/node_modules/statuses/README.md +139 -0
  418. package/dist/node_modules/oidc-provider/node_modules/statuses/codes.json +65 -0
  419. package/dist/node_modules/oidc-provider/node_modules/statuses/index.js +146 -0
  420. package/dist/node_modules/oidc-provider/node_modules/statuses/package.json +49 -0
  421. package/dist/node_modules/oidc-provider/package.json +95 -0
  422. package/dist/node_modules/quick-lru/index.d.ts +178 -0
  423. package/dist/node_modules/quick-lru/index.js +329 -0
  424. package/dist/node_modules/quick-lru/license +9 -0
  425. package/dist/node_modules/quick-lru/package.json +54 -0
  426. package/dist/node_modules/quick-lru/readme.md +236 -0
  427. package/dist/node_modules/statuses/HISTORY.md +65 -0
  428. package/dist/node_modules/statuses/LICENSE +23 -0
  429. package/dist/node_modules/statuses/README.md +127 -0
  430. package/dist/node_modules/statuses/codes.json +66 -0
  431. package/dist/node_modules/statuses/index.js +113 -0
  432. package/dist/node_modules/statuses/package.json +48 -0
  433. package/dist/server/cache-adapter.d.ts +33 -0
  434. package/dist/server/cache-adapter.js +159 -0
  435. package/dist/server/index.d.ts +10 -0
  436. package/dist/server/index.js +48 -0
  437. package/dist/server/interaction.d.ts +26 -0
  438. package/dist/server/interaction.js +172 -0
  439. package/dist/server/paths.d.ts +19 -0
  440. package/dist/server/paths.js +64 -0
  441. package/dist/server/plugin.d.ts +16 -0
  442. package/dist/server/plugin.js +108 -0
  443. package/dist/server/provider-dispatch.d.ts +32 -0
  444. package/dist/server/provider-dispatch.js +252 -0
  445. package/dist/server/service.d.ts +63 -0
  446. package/dist/server/service.js +540 -0
  447. package/dist/server/utils.d.ts +12 -0
  448. package/dist/server/utils.js +58 -0
  449. package/package.json +24 -0
  450. package/server.d.ts +2 -0
  451. package/server.js +1 -0
@@ -0,0 +1,179 @@
1
+ //#region src/parse.d.ts
2
+ type TagType = "r" | "e" | "i" | "";
3
+ interface TemplateObject {
4
+ t: TagType;
5
+ val: string;
6
+ lineNo?: number;
7
+ }
8
+ type AstObject = string | TemplateObject;
9
+ declare function parse(this: Eta$1, str: string): Array<AstObject>;
10
+ //#endregion
11
+ //#region src/config.d.ts
12
+ type trimConfig = "nl" | "slurp" | false;
13
+ interface Options {
14
+ /** Compile to async function */
15
+ async?: boolean;
16
+ /** Absolute path to template file */
17
+ filepath?: string;
18
+ }
19
+ interface EtaConfig {
20
+ /** Whether or not to automatically XML-escape interpolations. Default true */
21
+ autoEscape: boolean;
22
+ /** Apply a filter function defined on the class to every interpolation or raw interpolation */
23
+ autoFilter: boolean;
24
+ /** Configure automatic whitespace trimming. Default `[false, 'nl']` */
25
+ autoTrim: trimConfig | [trimConfig, trimConfig];
26
+ /** Whether or not to cache templates if `name` or `filename` is passed */
27
+ cache: boolean;
28
+ /** Holds cache of resolved filepaths. Set to `false` to disable. */
29
+ cacheFilepaths: boolean;
30
+ /** Whether to pretty-format error messages (introduces runtime penalties) */
31
+ debug: boolean;
32
+ /** Function to XML-sanitize interpolations */
33
+ escapeFunction: (str: unknown) => string;
34
+ /** Function applied to all interpolations when autoFilter is true */
35
+ filterFunction: (val: unknown) => string;
36
+ /** Name of the function that can be used in template code to output text to the result (like EJS's `outputFunctionName`). */
37
+ outputFunctionName: string;
38
+ /** Raw JS code inserted in the template function. Useful for declaring global variables for user templates */
39
+ functionHeader: string;
40
+ /** Parsing options */
41
+ parse: {
42
+ /** Which prefix to use for evaluation. Default `""`, does not support `"-"` or `"_"` */
43
+ exec: string;
44
+ /** Which prefix to use for interpolation. Default `"="`, does not support `"-"` or `"_"` */
45
+ interpolate: string;
46
+ /** Which prefix to use for raw interpolation. Default `"~"`, does not support `"-"` or `"_"` */
47
+ raw: string;
48
+ };
49
+ /** Array of plugins */
50
+ plugins: Array<{
51
+ processFnString?: (fnString: string, env?: EtaConfig) => string;
52
+ processAST?: (ast: AstObject[], env?: EtaConfig) => AstObject[];
53
+ processTemplate?: (fnString: string, env?: EtaConfig) => string;
54
+ }>;
55
+ /** Remove empty lines and whitespace between lines */
56
+ rmWhitespace: boolean;
57
+ /** Delimiters: by default `['<%', '%>']` */
58
+ tags: [string, string];
59
+ /** Make data available on the global object instead of varName */
60
+ useWith: boolean;
61
+ /** Name of the data object. Default `it` */
62
+ varName: string;
63
+ /** Directory that contains templates */
64
+ views?: string;
65
+ /** Control template file extension defaults. Default `.eta` */
66
+ defaultExtension?: string;
67
+ }
68
+ //#endregion
69
+ //#region src/compile.d.ts
70
+ type TemplateFunction = (this: Eta$1, data?: object, options?: Partial<Options>) => string;
71
+ /**
72
+ * Takes a template string and returns a template function that can be called with (data, config)
73
+ *
74
+ * @param str - The template string
75
+ * @param config - A custom configuration object (optional)
76
+ */
77
+ declare function compile(this: Eta$1, str: string, options?: Partial<Options>): TemplateFunction;
78
+ //#endregion
79
+ //#region src/compile-string.d.ts
80
+ /**
81
+ * Compiles a template string to a function string. Most often users just use `compile()`, which calls `compileToString` and creates a new function using the result
82
+ */
83
+ declare function compileToString(this: Eta$1, str: string, options?: Partial<Options>): string;
84
+ /**
85
+ * Loops through the AST generated by `parse` and transform each item into JS calls
86
+ *
87
+ * **Example**
88
+ *
89
+ * ```js
90
+ * let templateAST = ['Hi ', { val: 'it.name', t: 'i' }]
91
+ * compileBody.call(Eta, templateAST)
92
+ * // => "__eta.res+='Hi '\n__eta.res+=__eta.e(it.name)\n"
93
+ * ```
94
+ */
95
+ declare function compileBody(this: Eta$1, buff: Array<AstObject>): string;
96
+ //#endregion
97
+ //#region src/err.d.ts
98
+ declare class EtaError extends Error {
99
+ constructor(message: string);
100
+ }
101
+ declare class EtaParseError extends EtaError {
102
+ constructor(message: string);
103
+ }
104
+ declare class EtaRuntimeError extends EtaError {
105
+ constructor(message: string);
106
+ }
107
+ declare class EtaFileResolutionError extends EtaError {
108
+ constructor(message: string);
109
+ }
110
+ declare class EtaNameResolutionError extends EtaError {
111
+ constructor(message: string);
112
+ }
113
+ declare function RuntimeErr(originalError: Error, str: string, lineNo: number, path: string): never;
114
+ //#endregion
115
+ //#region src/render.d.ts
116
+ declare function render<T extends object>(this: Eta$1, template: string | TemplateFunction,
117
+ // template name or template function
118
+ data: T, meta?: {
119
+ filepath: string;
120
+ }): string;
121
+ declare function renderAsync<T extends object>(this: Eta$1, template: string | TemplateFunction,
122
+ // template name or template function
123
+ data: T, meta?: {
124
+ filepath: string;
125
+ }): Promise<string>;
126
+ declare function renderString<T extends object>(this: Eta$1, template: string, data: T): string;
127
+ declare function renderStringAsync<T extends object>(this: Eta$1, template: string, data: T): Promise<string>;
128
+ //#endregion
129
+ //#region src/storage.d.ts
130
+ /**
131
+ * Handles storage and accessing of values
132
+ *
133
+ * In this case, we use it to store compiled template functions
134
+ * Indexed by their `name` or `filename`
135
+ */
136
+ declare class Cacher<T> {
137
+ private cache;
138
+ constructor(cache: Record<string, T>);
139
+ define(key: string, val: T): void;
140
+ get(key: string): T;
141
+ remove(key: string): void;
142
+ reset(): void;
143
+ load(cacheObj: Record<string, T>): void;
144
+ }
145
+ //#endregion
146
+ //#region src/internal.d.ts
147
+ declare class Eta$1 {
148
+ constructor(customConfig?: Partial<EtaConfig>);
149
+ config: EtaConfig;
150
+ RuntimeErr: typeof RuntimeErr;
151
+ compile: typeof compile;
152
+ compileToString: typeof compileToString;
153
+ compileBody: typeof compileBody;
154
+ parse: typeof parse;
155
+ render: typeof render;
156
+ renderAsync: typeof renderAsync;
157
+ renderString: typeof renderString;
158
+ renderStringAsync: typeof renderStringAsync;
159
+ filepathCache: Record<string, string>;
160
+ templatesSync: Cacher<TemplateFunction>;
161
+ templatesAsync: Cacher<TemplateFunction>;
162
+ resolvePath: null | ((this: Eta$1, template: string, options?: Partial<Options>) => string);
163
+ readFile: null | ((this: Eta$1, path: string) => string);
164
+ configure(customConfig: Partial<EtaConfig>): void;
165
+ withConfig(customConfig: Partial<EtaConfig>): this & {
166
+ config: EtaConfig;
167
+ };
168
+ loadTemplate(name: string, template: string | TemplateFunction,
169
+ // template string or template function
170
+ options?: {
171
+ async: boolean;
172
+ }): void;
173
+ }
174
+ //#endregion
175
+ //#region src/core.d.ts
176
+ declare class Eta extends Eta$1 {}
177
+ //#endregion
178
+ export { Eta, type EtaConfig, EtaError, EtaFileResolutionError, EtaNameResolutionError, EtaParseError, EtaRuntimeError, type Options, type TemplateFunction };
179
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","names":[],"sources":["../src/parse.ts","../src/config.ts","../src/compile.ts","../src/compile-string.ts","../src/err.ts","../src/render.ts","../src/storage.ts","../src/internal.ts","../src/core.ts"],"sourcesContent":[],"mappings":";AAIY,KAAA,OAAA,GAAO,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,EAAA;AAEF,UAAA,cAAA,CAAc;EAMnB,CAAA,EALP,OAKO;EAsBI,GAAA,EAAA,MAAK;EAAO,MAAA,CAAA,EAAA,MAAA;;AAAmB,KAtBnC,SAAA,GAsBmC,MAAA,GAtBd,cAsBc;AAAK,iBAApC,KAAA,CAAoC,IAAA,EAAxB,KAAwB,EAAA,GAAA,EAAA,MAAA,CAAA,EAAL,KAAK,CAAC,SAAD,CAAA;;;AA9BpD,KCDK,UAAA,GDCc,IAAA,GAAA,OAAA,GAAA,KAAA;AAEF,UCDA,OAAA,CDCc;EAMnB;EAsBI,KAAA,CAAA,EAAK,OAAA;EAAO;EAAyB,QAAA,CAAA,EAAA,MAAA;;AAAD,UCrBnC,SAAA,CDqBmC;;;;EC/B/C,UAAA,EAAA,OAAU;EAEE;EAQA,QAAA,EAQL,UARc,GAAA,CAQA,UARA,EAQY,UARZ,CAAA;EAQd;EAAc,KAAA,EAAA,OAAA;EAAY;EAqCS,cAAA,EAAA,OAAA;EACxB;EAAmB,KAAA,EAAA,OAAA;EAAc;EACT,cAAA,EAAA,CAAA,GAAA,EAAA,OAAA,EAAA,GAAA,MAAA;EAHpC;EAAK,cAAA,EAAA,CAAA,GAAA,EAAA,OAAA,EAAA,GAAA,MAAA;;;;ECrDJ,cAAA,EAAA,MAAgB;EACpB;EAEY,KAAA,EAAA;IAAR;IAAO,IAAA,EAAA,MAAA;IAcH;IACR,WAAA,EAAA,MAAA;IAEY;IAAR,GAAA,EAAA,MAAA;EACT,CAAA;EAAgB;WDgCR;+CACoC;uBACxB,mBAAmB,cAAc;IEnDxC,eAAe,CAAA,EAAA,CAAA,QAAA,EAAA,MAAA,EAAA,GAAA,CAAA,EFoDgB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NqBuC,CMrBhC,gBNqBgC,CAAA;EACT,cAAA,EMrB7B,MNqB6B,CMrBtB,gBNqBsB,CAAA;EAHpC,WAAA,EAAA,IAAA,GAAA,CAAA,CAAA,IAAA,EMbG,KNaH,EAAA,QAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EMboC,ONapC,CMb4C,ONa5C,CAAA,EAAA,GAAA,MAAA,CAAA;EAAK,QAAA,EAAA,IAAA,GAAA,CAAA,CAAA,IAAA,EMXW,KNWX,EAAA,IAAA,EAAA,MAAA,EAAA,GAAA,MAAA,CAAA;0BMPU,QAAQ;2BAIP,QAAQ;YAA8B;ELlDrD,CAAA;EACJ,YAAA,CAAA,IAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,GKuDe,gBLvDf;EAAA;EAEY,OAAD,CAAC,EAAA;IAAR,KAAA,EAAA,OAAA;EAAO,CAAA,CAAA,EAAA,IAAA;AAcnB;;;AFagB,cQtBH,GAAA,SAAY,KAAA,CRsBJ"}
@@ -0,0 +1,42 @@
1
+ var e=class extends Error{constructor(e){super(e),this.name=`Eta Error`}},t=class extends e{constructor(e){super(e),this.name=`EtaParser Error`}},n=class extends e{constructor(e){super(e),this.name=`EtaRuntime Error`}},r=class extends e{constructor(e){super(e),this.name=`EtaFileResolution Error`}},i=class extends e{constructor(e){super(e),this.name=`EtaNameResolution Error`}};function a(e,n,r){let i=n.slice(0,r).split(/\n/),a=i.length,o=i[a-1].length+1;throw e+=` at line `+a+` col `+o+`:
2
+
3
+ `+n.split(/\n/)[a-1]+`
4
+ `+Array(o).join(` `)+`^`,new t(e)}function o(e,t,r,i){let a=t.split(`
5
+ `),o=Math.max(r-3,0),s=Math.min(a.length,r+3),c=i,l=a.slice(o,s).map((e,t)=>{let n=t+o+1;return(n===r?` >> `:` `)+n+`| `+e}).join(`
6
+ `),u=new n((c?c+`:`+r+`
7
+ `:`line `+r+`
8
+ `)+l+`
9
+
10
+ `+e.message);throw u.name=e.name,u.cause=e,u}const s=(async()=>{}).constructor;function c(e,n){let r=this.config,i=n?.async?s:Function;try{return new i(r.varName,`options`,this.compileToString.call(this,e,n))}catch(r){throw r instanceof SyntaxError?new t(`Bad template syntax
11
+
12
+ `+r.message+`
13
+ `+Array(r.message.length+1).join(`=`)+`
14
+ `+this.compileToString.call(this,e,n)+`
15
+ `):r}}function l(e,t){let n=this.config,r=t?.async,i=this.compileBody,a=this.parse.call(this,e),o=`${n.functionHeader}
16
+ let include = (__eta_t, __eta_d) => this.render(__eta_t, {...${n.varName}, ...(__eta_d ?? {})}, options);
17
+ let includeAsync = (__eta_t, __eta_d) => this.renderAsync(__eta_t, {...${n.varName}, ...(__eta_d ?? {})}, options);
18
+
19
+ let __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${n.debug?`, line: 1, templateStr: "`+e.replace(/\\|"/g,`\\$&`).replace(/\r\n|\n|\r/g,`\\n`)+`"`:``}};
20
+
21
+ function layout(path, data) {
22
+ __eta.layout = path;
23
+ __eta.layoutData = data;
24
+ }${n.debug?`try {`:``}${n.useWith?`with(`+n.varName+`||{}){`:``}
25
+
26
+ function ${n.outputFunctionName}(s){__eta.res+=s;}
27
+
28
+ ${i.call(this,a)}
29
+ if (__eta.layout) {
30
+ __eta.res = ${r?`await includeAsync`:`include`} (__eta.layout, {...${n.varName}, body: __eta.res, ...__eta.layoutData});
31
+ }
32
+ ${n.useWith?`}`:``}${n.debug?`} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }`:``}
33
+ return __eta.res;
34
+ `;if(n.plugins)for(let e=0;e<n.plugins.length;e++){let t=n.plugins[e];t.processFnString&&(o=t.processFnString(o,n))}return o}function u(e){let t=this.config,n=0,r=e.length,i=``;for(;n<r;n++){let r=e[n];if(typeof r==`string`)i+=`__eta.res+='`+r+`';
35
+ `;else{let e=r.t,n=r.val||``;t.debug&&(i+=`__eta.line=`+r.lineNo+`
36
+ `),e===`r`?(t.autoFilter&&(n=`__eta.f(`+n+`)`),i+=`__eta.res+=`+n+`;
37
+ `):e===`i`?(t.autoFilter&&(n=`__eta.f(`+n+`)`),t.autoEscape&&(n=`__eta.e(`+n+`)`),i+=`__eta.res+=`+n+`;
38
+ `):e===`e`&&(i+=n+`
39
+ `)}}return i}function d(e,t,n,r){let i,a;return Array.isArray(t.autoTrim)?(i=t.autoTrim[1],a=t.autoTrim[0]):i=a=t.autoTrim,(n||n===!1)&&(i=n),(r||r===!1)&&(a=r),!a&&!i?e:i===`slurp`&&a===`slurp`?e.trim():(i===`_`||i===`slurp`?e=e.trimStart():(i===`-`||i===`nl`)&&(e=e.replace(/^(?:\r\n|\n|\r)/,``)),a===`_`||a===`slurp`?e=e.trimEnd():(a===`-`||a===`nl`)&&(e=e.replace(/(?:\r\n|\n|\r)$/,``)),e)}const f={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function p(e){return f[e]}function m(e){let t=String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,p):t}const h={autoEscape:!0,autoFilter:!1,autoTrim:[!1,`nl`],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:m,filterFunction:e=>String(e),outputFunctionName:`output`,functionHeader:``,parse:{exec:``,interpolate:`=`,raw:`~`},plugins:[],rmWhitespace:!1,tags:[`<%`,`%>`],useWith:!1,varName:`it`,defaultExtension:`.eta`},g=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,_=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,v=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function y(e){return e.replace(/[.*+\-?^${}()|[\]\\]/g,`\\$&`)}function b(e,t){return e.slice(0,t).split(`
40
+ `).length}function x(e){let t=this.config,n=[],r=!1,i=0,o=t.parse;if(t.plugins)for(let n=0;n<t.plugins.length;n++){let r=t.plugins[n];r.processTemplate&&(e=r.processTemplate(e,t))}t.rmWhitespace&&(e=e.replace(/[\r\n]+/g,`
41
+ `).replace(/^\s+|\s+$/gm,``)),g.lastIndex=0,_.lastIndex=0,v.lastIndex=0;function s(e,i){e&&(e=d(e,t,r,i),e&&(e=e.replace(/\\|'/g,`\\$&`).replace(/\r\n|\n|\r/g,`\\n`),n.push(e)))}let c=[o.exec,o.interpolate,o.raw].reduce((e,t)=>e&&t?e+`|`+y(t):t?y(t):e,``),l=RegExp(y(t.tags[0])+`(-|_)?\\s*(`+c+`)?\\s*`,`g`),u=RegExp(`'|"|\`|\\/\\*|(\\s*(-|_)?`+y(t.tags[1])+`)`,`g`),f;for(;f=l.exec(e);){let c=e.slice(i,f.index);i=f[0].length+f.index;let d=f[1],p=f[2]||``;s(c,d),u.lastIndex=i;let m,h=!1;for(;m=u.exec(e);)if(m[1]){let t=e.slice(i,m.index);l.lastIndex=i=u.lastIndex,r=m[2],h={t:p===o.exec?`e`:p===o.raw?`r`:p===o.interpolate?`i`:``,val:t};break}else{let t=m[0];if(t===`/*`){let t=e.indexOf(`*/`,u.lastIndex);t===-1&&a(`unclosed comment`,e,m.index),u.lastIndex=t}else t===`'`?(_.lastIndex=m.index,_.exec(e)?u.lastIndex=_.lastIndex:a(`unclosed string`,e,m.index)):t===`"`?(v.lastIndex=m.index,v.exec(e)?u.lastIndex=v.lastIndex:a(`unclosed string`,e,m.index)):t==="`"&&(g.lastIndex=m.index,g.exec(e)?u.lastIndex=g.lastIndex:a(`unclosed string`,e,m.index))}h?(t.debug&&(h.lineNo=b(e,f.index)),n.push(h)):a(`unclosed tag`,e,f.index)}if(s(e.slice(i,e.length),!1),t.plugins)for(let e=0;e<t.plugins.length;e++){let r=t.plugins[e];r.processAST&&(n=r.processAST(n,t))}return n}function S(e,t){let n=t?.async?this.templatesAsync:this.templatesSync;if(this.resolvePath&&this.readFile&&!e.startsWith(`@`)){let e=t.filepath,r=n.get(e);if(this.config.cache&&r)return r;{let r=this.readFile(e),i=this.compile(r,t);return this.config.cache&&n.define(e,i),i}}else{let t=n.get(e);if(t)return t;throw new i(`Failed to get template '${e}'`)}}function C(e,t,n){let r,i={...n,async:!1};return typeof e==`string`?(this.resolvePath&&this.readFile&&!e.startsWith(`@`)&&(i.filepath=this.resolvePath(e,i)),r=S.call(this,e,i)):r=e,r.call(this,t,i)}function w(e,t,n){let r,i={...n,async:!0};typeof e==`string`?(this.resolvePath&&this.readFile&&!e.startsWith(`@`)&&(i.filepath=this.resolvePath(e,i)),r=S.call(this,e,i)):r=e;let a=r.call(this,t,i);return Promise.resolve(a)}function T(e,t){let n=this.compile(e,{async:!1});return C.call(this,n,t)}function E(e,t){let n=this.compile(e,{async:!0});return w.call(this,n,t)}var D=class{constructor(e){this.cache=e}define(e,t){this.cache[e]=t}get(e){return this.cache[e]}remove(e){delete this.cache[e]}reset(){this.cache={}}load(e){this.cache={...this.cache,...e}}},O=class{constructor(e){e?this.config={...h,...e}:this.config={...h}}config;RuntimeErr=o;compile=c;compileToString=l;compileBody=u;parse=x;render=C;renderAsync=w;renderString=T;renderStringAsync=E;filepathCache={};templatesSync=new D({});templatesAsync=new D({});resolvePath=null;readFile=null;configure(e){this.config={...this.config,...e}}withConfig(e){return{...this,config:{...this.config,...e}}}loadTemplate(e,t,n){if(typeof t==`string`)(n?.async?this.templatesAsync:this.templatesSync).define(e,this.compile(t,n));else{let r=this.templatesSync;(t.constructor.name===`AsyncFunction`||n?.async)&&(r=this.templatesAsync),r.define(e,t)}}},k=class extends O{};export{k as Eta,e as EtaError,r as EtaFileResolutionError,i as EtaNameResolutionError,t as EtaParseError,n as EtaRuntimeError};
42
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","names":["config: EtaConfig","compileBody","buffer: Array<AstObject>","leftTrim: string | false","rightTrim: string | false","escMap: { [key: string]: string }","defaultConfig: EtaConfig","buffer: Array<AstObject>","trimLeftOfNextStr: string | false","m: RegExpExecArray | null","closeTag: RegExpExecArray | null","currentObj: AstObject | false","templateFn: TemplateFunction","cache: Record<string, T>","Eta","EtaCore"],"sources":["../src/err.ts","../src/compile.ts","../src/compile-string.ts","../src/utils.ts","../src/config.ts","../src/parse.ts","../src/render.ts","../src/storage.ts","../src/internal.ts","../src/core.ts"],"sourcesContent":["export class EtaError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"Eta Error\";\n }\n}\n\nexport class EtaParseError extends EtaError {\n constructor(message: string) {\n super(message);\n this.name = \"EtaParser Error\";\n }\n}\n\nexport class EtaRuntimeError extends EtaError {\n constructor(message: string) {\n super(message);\n this.name = \"EtaRuntime Error\";\n }\n}\n\nexport class EtaFileResolutionError extends EtaError {\n constructor(message: string) {\n super(message);\n this.name = \"EtaFileResolution Error\";\n }\n}\n\nexport class EtaNameResolutionError extends EtaError {\n constructor(message: string) {\n super(message);\n this.name = \"EtaNameResolution Error\";\n }\n}\n\n/**\n * Throws an EtaError with a nicely formatted error and message showing where in the template the error occurred.\n */\n\nexport function ParseErr(message: string, str: string, indx: number): never {\n const whitespace = str.slice(0, indx).split(/\\n/);\n\n const lineNo = whitespace.length;\n const colNo = whitespace[lineNo - 1].length + 1;\n message +=\n \" at line \" +\n lineNo +\n \" col \" +\n colNo +\n \":\\n\\n\" +\n \" \" +\n str.split(/\\n/)[lineNo - 1] +\n \"\\n\" +\n \" \" +\n Array(colNo).join(\" \") +\n \"^\";\n throw new EtaParseError(message);\n}\n\nexport function RuntimeErr(\n originalError: Error,\n str: string,\n lineNo: number,\n path: string,\n): never {\n // code gratefully taken from https://github.com/mde/ejs and adapted\n\n const lines = str.split(\"\\n\");\n const start = Math.max(lineNo - 3, 0);\n const end = Math.min(lines.length, lineNo + 3);\n const filename = path;\n // Error context\n const context = lines\n .slice(start, end)\n .map((line, i) => {\n const curr = i + start + 1;\n return (curr === lineNo ? \" >> \" : \" \") + curr + \"| \" + line;\n })\n .join(\"\\n\");\n\n const header = filename\n ? filename + \":\" + lineNo + \"\\n\"\n : \"line \" + lineNo + \"\\n\";\n\n const err = new EtaRuntimeError(\n header + context + \"\\n\\n\" + originalError.message,\n );\n\n err.name = originalError.name; // the original name (e.g. ReferenceError) may be useful\n err.cause = originalError;\n\n throw err;\n}\n","import type { EtaConfig, Options } from \"./config.ts\";\nimport { EtaParseError } from \"./err.ts\";\nimport type { Eta } from \"./internal.ts\";\n\nexport type TemplateFunction = (\n this: Eta,\n data?: object,\n options?: Partial<Options>,\n) => string;\n/* END TYPES */\n\n/* istanbul ignore next */\nconst AsyncFunction = (async () => {}).constructor;\n\n/**\n * Takes a template string and returns a template function that can be called with (data, config)\n *\n * @param str - The template string\n * @param config - A custom configuration object (optional)\n */\n\nexport function compile(\n this: Eta,\n str: string,\n options?: Partial<Options>,\n): TemplateFunction {\n const config: EtaConfig = this.config;\n\n /* ASYNC HANDLING */\n // code gratefully taken from https://github.com/mde/ejs and adapted\n const ctor = options?.async\n ? (AsyncFunction as FunctionConstructor)\n : Function;\n /* END ASYNC HANDLING */\n\n try {\n return new ctor(\n config.varName,\n \"options\",\n this.compileToString.call(this, str, options),\n ) as TemplateFunction; // eslint-disable-line no-new-func\n } catch (e) {\n if (e instanceof SyntaxError) {\n throw new EtaParseError(\n \"Bad template syntax\\n\\n\" +\n e.message +\n \"\\n\" +\n Array(e.message.length + 1).join(\"=\") +\n \"\\n\" +\n this.compileToString.call(this, str, options) +\n \"\\n\", // This will put an extra newline before the callstack for extra readability\n );\n } else {\n throw e;\n }\n }\n}\n","import type { Options } from \"./config.ts\";\nimport type { Eta } from \"./internal.ts\";\nimport type { AstObject } from \"./parse.ts\";\n\n/**\n * Compiles a template string to a function string. Most often users just use `compile()`, which calls `compileToString` and creates a new function using the result\n */\n\nexport function compileToString(\n this: Eta,\n str: string,\n options?: Partial<Options>,\n): string {\n const config = this.config;\n const isAsync = options?.async;\n\n const compileBody = this.compileBody;\n\n const buffer: Array<AstObject> = this.parse.call(this, str);\n\n // note: when the include function passes through options, the only parameter that matters is the filepath parameter\n let res = `${config.functionHeader}\nlet include = (__eta_t, __eta_d) => this.render(__eta_t, {...${config.varName}, ...(__eta_d ?? {})}, options);\nlet includeAsync = (__eta_t, __eta_d) => this.renderAsync(__eta_t, {...${config.varName}, ...(__eta_d ?? {})}, options);\n\nlet __eta = {res: \"\", e: this.config.escapeFunction, f: this.config.filterFunction${\n config.debug\n ? ', line: 1, templateStr: \"' +\n str.replace(/\\\\|\"/g, \"\\\\$&\").replace(/\\r\\n|\\n|\\r/g, \"\\\\n\") +\n '\"'\n : \"\"\n }};\n\nfunction layout(path, data) {\n __eta.layout = path;\n __eta.layoutData = data;\n}${config.debug ? \"try {\" : \"\"}${\n config.useWith ? \"with(\" + config.varName + \"||{}){\" : \"\"\n }\n\nfunction ${config.outputFunctionName}(s){__eta.res+=s;}\n\n${compileBody.call(this, buffer)}\nif (__eta.layout) {\n __eta.res = ${\n isAsync ? \"await includeAsync\" : \"include\"\n } (__eta.layout, {...${\n config.varName\n }, body: __eta.res, ...__eta.layoutData});\n}\n${config.useWith ? \"}\" : \"\"}${\n config.debug\n ? \"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }\"\n : \"\"\n}\nreturn __eta.res;\n`;\n\n if (config.plugins) {\n for (let i = 0; i < config.plugins.length; i++) {\n const plugin = config.plugins[i];\n if (plugin.processFnString) {\n res = plugin.processFnString(res, config);\n }\n }\n }\n\n return res;\n}\n\n/**\n * Loops through the AST generated by `parse` and transform each item into JS calls\n *\n * **Example**\n *\n * ```js\n * let templateAST = ['Hi ', { val: 'it.name', t: 'i' }]\n * compileBody.call(Eta, templateAST)\n * // => \"__eta.res+='Hi '\\n__eta.res+=__eta.e(it.name)\\n\"\n * ```\n */\n\nexport function compileBody(this: Eta, buff: Array<AstObject>): string {\n const config = this.config;\n\n let i = 0;\n const buffLength = buff.length;\n let returnStr = \"\";\n\n for (i; i < buffLength; i++) {\n const currentBlock = buff[i];\n if (typeof currentBlock === \"string\") {\n const str = currentBlock;\n\n // we know string exists\n returnStr += \"__eta.res+='\" + str + \"';\\n\";\n } else {\n const type = currentBlock.t; // \"r\", \"e\", or \"i\"\n let content = currentBlock.val || \"\";\n\n if (config.debug) returnStr += \"__eta.line=\" + currentBlock.lineNo + \"\\n\";\n\n if (type === \"r\") {\n // raw\n\n if (config.autoFilter) {\n content = \"__eta.f(\" + content + \")\";\n }\n\n returnStr += \"__eta.res+=\" + content + \";\\n\";\n } else if (type === \"i\") {\n // interpolate\n\n if (config.autoFilter) {\n content = \"__eta.f(\" + content + \")\";\n }\n\n if (config.autoEscape) {\n content = \"__eta.e(\" + content + \")\";\n }\n\n returnStr += \"__eta.res+=\" + content + \";\\n\";\n } else if (type === \"e\") {\n // execute\n returnStr += content + \"\\n\";\n }\n }\n }\n\n return returnStr;\n}\n","import type { EtaConfig } from \"./config.ts\";\n\n/**\n * Takes a string within a template and trims it, based on the preceding tag's whitespace control and `config.autoTrim`\n */\n\nexport function trimWS(\n str: string,\n config: EtaConfig,\n wsLeft: string | false,\n wsRight?: string | false,\n): string {\n let leftTrim: string | false;\n let rightTrim: string | false;\n\n if (Array.isArray(config.autoTrim)) {\n // Slightly confusing,\n // but _}} will trim the left side of the following string\n leftTrim = config.autoTrim[1];\n rightTrim = config.autoTrim[0];\n } else {\n leftTrim = rightTrim = config.autoTrim;\n }\n\n if (wsLeft || wsLeft === false) {\n leftTrim = wsLeft;\n }\n\n if (wsRight || wsRight === false) {\n rightTrim = wsRight;\n }\n\n if (!rightTrim && !leftTrim) {\n return str;\n }\n\n if (leftTrim === \"slurp\" && rightTrim === \"slurp\") {\n return str.trim();\n }\n\n if (leftTrim === \"_\" || leftTrim === \"slurp\") {\n // full slurp\n str = str.trimStart();\n } else if (leftTrim === \"-\" || leftTrim === \"nl\") {\n // nl trim\n str = str.replace(/^(?:\\r\\n|\\n|\\r)/, \"\");\n }\n\n if (rightTrim === \"_\" || rightTrim === \"slurp\") {\n // full slurp\n str = str.trimEnd();\n } else if (rightTrim === \"-\" || rightTrim === \"nl\") {\n // nl trim\n str = str.replace(/(?:\\r\\n|\\n|\\r)$/, \"\");\n }\n\n return str;\n}\n\n/**\n * A map of special HTML characters to their XML-escaped equivalents\n */\n\nconst escMap: { [key: string]: string } = {\n \"&\": \"&amp;\",\n \"<\": \"&lt;\",\n \">\": \"&gt;\",\n '\"': \"&quot;\",\n \"'\": \"&#39;\",\n};\n\nfunction replaceChar(s: string): string {\n return escMap[s];\n}\n\n/**\n * XML-escapes an input value after converting it to a string\n *\n * @param str - Input value (usually a string)\n * @returns XML-escaped string\n */\n\nexport function XMLEscape(str: unknown): string {\n // To deal with XSS. Based on Escape implementations of Mustache.JS and Marko, then customized.\n const newStr = String(str);\n if (/[&<>\"']/.test(newStr)) {\n return newStr.replace(/[&<>\"']/g, replaceChar);\n } else {\n return newStr;\n }\n}\n","import type { AstObject } from \"./parse.ts\";\nimport { XMLEscape } from \"./utils.ts\";\n\ntype trimConfig = \"nl\" | \"slurp\" | false;\n\nexport interface Options {\n /** Compile to async function */\n async?: boolean;\n\n /** Absolute path to template file */\n filepath?: string;\n}\n\nexport interface EtaConfig {\n /** Whether or not to automatically XML-escape interpolations. Default true */\n autoEscape: boolean;\n\n /** Apply a filter function defined on the class to every interpolation or raw interpolation */\n autoFilter: boolean;\n\n /** Configure automatic whitespace trimming. Default `[false, 'nl']` */\n autoTrim: trimConfig | [trimConfig, trimConfig];\n\n /** Whether or not to cache templates if `name` or `filename` is passed */\n cache: boolean;\n\n /** Holds cache of resolved filepaths. Set to `false` to disable. */\n cacheFilepaths: boolean;\n\n /** Whether to pretty-format error messages (introduces runtime penalties) */\n debug: boolean;\n\n /** Function to XML-sanitize interpolations */\n escapeFunction: (str: unknown) => string;\n\n /** Function applied to all interpolations when autoFilter is true */\n filterFunction: (val: unknown) => string;\n\n /** Name of the function that can be used in template code to output text to the result (like EJS's `outputFunctionName`). */\n outputFunctionName: string;\n\n /** Raw JS code inserted in the template function. Useful for declaring global variables for user templates */\n functionHeader: string;\n\n /** Parsing options */\n parse: {\n /** Which prefix to use for evaluation. Default `\"\"`, does not support `\"-\"` or `\"_\"` */\n exec: string;\n\n /** Which prefix to use for interpolation. Default `\"=\"`, does not support `\"-\"` or `\"_\"` */\n interpolate: string;\n\n /** Which prefix to use for raw interpolation. Default `\"~\"`, does not support `\"-\"` or `\"_\"` */\n raw: string;\n };\n\n /** Array of plugins */\n plugins: Array<{\n processFnString?: (fnString: string, env?: EtaConfig) => string;\n processAST?: (ast: AstObject[], env?: EtaConfig) => AstObject[];\n processTemplate?: (fnString: string, env?: EtaConfig) => string;\n }>;\n\n /** Remove empty lines and whitespace between lines */\n rmWhitespace: boolean;\n\n /** Delimiters: by default `['<%', '%>']` */\n tags: [string, string];\n\n /** Make data available on the global object instead of varName */\n useWith: boolean;\n\n /** Name of the data object. Default `it` */\n varName: string;\n\n /** Directory that contains templates */\n views?: string;\n\n /** Control template file extension defaults. Default `.eta` */\n defaultExtension?: string;\n}\n\n/* END TYPES */\n\n/** Eta's base (global) configuration */\nconst defaultConfig: EtaConfig = {\n autoEscape: true,\n autoFilter: false,\n autoTrim: [false, \"nl\"],\n cache: false,\n cacheFilepaths: true,\n debug: false,\n escapeFunction: XMLEscape,\n // default filter function (not used unless enables) just stringifies the input\n filterFunction: (val) => String(val),\n outputFunctionName: \"output\",\n functionHeader: \"\",\n parse: {\n exec: \"\",\n interpolate: \"=\",\n raw: \"~\",\n },\n plugins: [],\n rmWhitespace: false,\n tags: [\"<%\", \"%>\"],\n useWith: false,\n varName: \"it\",\n defaultExtension: \".eta\",\n};\n\nexport { defaultConfig };\n","import { ParseErr } from \"./err.ts\";\nimport type { Eta } from \"./internal.ts\";\nimport { trimWS } from \"./utils.ts\";\n\nexport type TagType = \"r\" | \"e\" | \"i\" | \"\";\n\nexport interface TemplateObject {\n t: TagType;\n val: string;\n lineNo?: number;\n}\n\nexport type AstObject = string | TemplateObject;\n\n/* END TYPES */\n\nconst templateLitReg =\n /`(?:\\\\[\\s\\S]|\\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\\${)[^\\\\`])*`/g;\n\nconst singleQuoteReg = /'(?:\\\\[\\s\\w\"'\\\\`]|[^\\n\\r'\\\\])*?'/g;\n\nconst doubleQuoteReg = /\"(?:\\\\[\\s\\w\"'\\\\`]|[^\\n\\r\"\\\\])*?\"/g;\n\n/** Escape special regular expression characters inside a string */\n\nfunction escapeRegExp(string: string) {\n // From MDN\n return string.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, \"\\\\$&\"); // $& means the whole matched string\n}\n\nfunction getLineNo(str: string, index: number) {\n return str.slice(0, index).split(\"\\n\").length;\n}\n\nexport function parse(this: Eta, str: string): Array<AstObject> {\n const config = this.config;\n\n let buffer: Array<AstObject> = [];\n let trimLeftOfNextStr: string | false = false;\n let lastIndex = 0;\n const parseOptions = config.parse;\n\n if (config.plugins) {\n for (let i = 0; i < config.plugins.length; i++) {\n const plugin = config.plugins[i];\n if (plugin.processTemplate) {\n str = plugin.processTemplate(str, config);\n }\n }\n }\n\n /* Adding for EJS compatibility */\n if (config.rmWhitespace) {\n // Code taken directly from EJS\n // Have to use two separate replaces here as `^` and `$` operators don't\n // work well with `\\r` and empty lines don't work well with the `m` flag.\n // Essentially, this replaces the whitespace at the beginning and end of\n // each line and removes multiple newlines.\n str = str.replace(/[\\r\\n]+/g, \"\\n\").replace(/^\\s+|\\s+$/gm, \"\");\n }\n /* End rmWhitespace option */\n\n templateLitReg.lastIndex = 0;\n singleQuoteReg.lastIndex = 0;\n doubleQuoteReg.lastIndex = 0;\n\n function pushString(strng: string, shouldTrimRightOfString?: string | false) {\n if (strng) {\n // if string is truthy it must be of type 'string'\n\n strng = trimWS(\n strng,\n config,\n trimLeftOfNextStr, // this will only be false on the first str, the next ones will be null or undefined\n shouldTrimRightOfString,\n );\n\n if (strng) {\n // replace \\ with \\\\, ' with \\'\n // we're going to convert all CRLF to LF so it doesn't take more than one replace\n\n strng = strng.replace(/\\\\|'/g, \"\\\\$&\").replace(/\\r\\n|\\n|\\r/g, \"\\\\n\");\n\n buffer.push(strng);\n }\n }\n }\n\n const prefixes = [\n parseOptions.exec,\n parseOptions.interpolate,\n parseOptions.raw,\n ].reduce((accumulator, prefix) => {\n if (accumulator && prefix) {\n return accumulator + \"|\" + escapeRegExp(prefix);\n } else if (prefix) {\n // accumulator is falsy\n return escapeRegExp(prefix);\n } else {\n // prefix and accumulator are both falsy\n return accumulator;\n }\n }, \"\");\n\n const parseOpenReg = new RegExp(\n escapeRegExp(config.tags[0]) + \"(-|_)?\\\\s*(\" + prefixes + \")?\\\\s*\",\n \"g\",\n );\n\n const parseCloseReg = new RegExp(\n \"'|\\\"|`|\\\\/\\\\*|(\\\\s*(-|_)?\" + escapeRegExp(config.tags[1]) + \")\",\n \"g\",\n );\n\n let m: RegExpExecArray | null;\n\n // biome-ignore lint/suspicious/noAssignInExpressions: this is performant\n while ((m = parseOpenReg.exec(str))) {\n const precedingString = str.slice(lastIndex, m.index);\n\n lastIndex = m[0].length + m.index;\n\n const wsLeft = m[1];\n const prefix = m[2] || \"\"; // by default either ~, =, or empty\n\n pushString(precedingString, wsLeft);\n\n parseCloseReg.lastIndex = lastIndex;\n let closeTag: RegExpExecArray | null;\n let currentObj: AstObject | false = false;\n\n // biome-ignore lint/suspicious/noAssignInExpressions: this is performant\n while ((closeTag = parseCloseReg.exec(str))) {\n if (closeTag[1]) {\n const content = str.slice(lastIndex, closeTag.index);\n\n parseOpenReg.lastIndex = lastIndex = parseCloseReg.lastIndex;\n\n trimLeftOfNextStr = closeTag[2];\n\n const currentType: TagType =\n prefix === parseOptions.exec\n ? \"e\"\n : prefix === parseOptions.raw\n ? \"r\"\n : prefix === parseOptions.interpolate\n ? \"i\"\n : \"\";\n\n currentObj = { t: currentType, val: content };\n break;\n } else {\n const char = closeTag[0];\n if (char === \"/*\") {\n const commentCloseInd = str.indexOf(\"*/\", parseCloseReg.lastIndex);\n\n if (commentCloseInd === -1) {\n ParseErr(\"unclosed comment\", str, closeTag.index);\n }\n parseCloseReg.lastIndex = commentCloseInd;\n } else if (char === \"'\") {\n singleQuoteReg.lastIndex = closeTag.index;\n\n const singleQuoteMatch = singleQuoteReg.exec(str);\n if (singleQuoteMatch) {\n parseCloseReg.lastIndex = singleQuoteReg.lastIndex;\n } else {\n ParseErr(\"unclosed string\", str, closeTag.index);\n }\n } else if (char === '\"') {\n doubleQuoteReg.lastIndex = closeTag.index;\n const doubleQuoteMatch = doubleQuoteReg.exec(str);\n\n if (doubleQuoteMatch) {\n parseCloseReg.lastIndex = doubleQuoteReg.lastIndex;\n } else {\n ParseErr(\"unclosed string\", str, closeTag.index);\n }\n } else if (char === \"`\") {\n templateLitReg.lastIndex = closeTag.index;\n const templateLitMatch = templateLitReg.exec(str);\n if (templateLitMatch) {\n parseCloseReg.lastIndex = templateLitReg.lastIndex;\n } else {\n ParseErr(\"unclosed string\", str, closeTag.index);\n }\n }\n }\n }\n if (currentObj) {\n if (config.debug) {\n currentObj.lineNo = getLineNo(str, m.index);\n }\n buffer.push(currentObj);\n } else {\n ParseErr(\"unclosed tag\", str, m.index);\n }\n }\n\n pushString(str.slice(lastIndex, str.length), false);\n\n if (config.plugins) {\n for (let i = 0; i < config.plugins.length; i++) {\n const plugin = config.plugins[i];\n if (plugin.processAST) {\n buffer = plugin.processAST(buffer, config);\n }\n }\n }\n\n return buffer;\n}\n","import type { TemplateFunction } from \"./compile.ts\";\n\n/* TYPES */\nimport type { Options } from \"./config.ts\";\nimport { EtaNameResolutionError } from \"./err.ts\";\nimport type { Eta } from \"./internal.ts\";\n\n/* END TYPES */\n\nfunction handleCache(\n this: Eta,\n template: string,\n options: Partial<Options>,\n): TemplateFunction {\n const templateStore = options?.async\n ? this.templatesAsync\n : this.templatesSync;\n\n if (this.resolvePath && this.readFile && !template.startsWith(\"@\")) {\n const templatePath = options.filepath as string;\n\n const cachedTemplate = templateStore.get(templatePath);\n\n if (this.config.cache && cachedTemplate) {\n return cachedTemplate;\n } else {\n const templateString = this.readFile(templatePath);\n\n const templateFn = this.compile(templateString, options);\n\n if (this.config.cache) templateStore.define(templatePath, templateFn);\n\n return templateFn;\n }\n } else {\n const cachedTemplate = templateStore.get(template);\n\n if (cachedTemplate) {\n return cachedTemplate;\n } else {\n throw new EtaNameResolutionError(`Failed to get template '${template}'`);\n }\n }\n}\n\nexport function render<T extends object>(\n this: Eta,\n template: string | TemplateFunction, // template name or template function\n data: T,\n meta?: { filepath: string },\n): string {\n let templateFn: TemplateFunction;\n const options = { ...meta, async: false };\n\n if (typeof template === \"string\") {\n if (this.resolvePath && this.readFile && !template.startsWith(\"@\")) {\n options.filepath = this.resolvePath(template, options);\n }\n\n templateFn = handleCache.call(this, template, options);\n } else {\n templateFn = template;\n }\n\n const res = templateFn.call(this, data, options);\n\n return res;\n}\n\nexport function renderAsync<T extends object>(\n this: Eta,\n template: string | TemplateFunction, // template name or template function\n data: T,\n meta?: { filepath: string },\n): Promise<string> {\n let templateFn: TemplateFunction;\n const options = { ...meta, async: true };\n\n if (typeof template === \"string\") {\n if (this.resolvePath && this.readFile && !template.startsWith(\"@\")) {\n options.filepath = this.resolvePath(template, options);\n }\n\n templateFn = handleCache.call(this, template, options);\n } else {\n templateFn = template;\n }\n\n const res = templateFn.call(this, data, options);\n\n // Return a promise\n return Promise.resolve(res);\n}\n\nexport function renderString<T extends object>(\n this: Eta,\n template: string,\n data: T,\n): string {\n const templateFn = this.compile(template, { async: false });\n\n return render.call(this, templateFn, data);\n}\n\nexport function renderStringAsync<T extends object>(\n this: Eta,\n template: string,\n data: T,\n): Promise<string> {\n const templateFn = this.compile(template, { async: true });\n\n return renderAsync.call(this, templateFn, data);\n}\n","/**\n * Handles storage and accessing of values\n *\n * In this case, we use it to store compiled template functions\n * Indexed by their `name` or `filename`\n */\n\nexport class Cacher<T> {\n constructor(private cache: Record<string, T>) {}\n define(key: string, val: T): void {\n this.cache[key] = val;\n }\n get(key: string): T {\n return this.cache[key];\n }\n remove(key: string): void {\n delete this.cache[key];\n }\n reset(): void {\n this.cache = {};\n }\n load(cacheObj: Record<string, T>): void {\n this.cache = { ...this.cache, ...cacheObj };\n }\n}\n","import type { TemplateFunction } from \"./compile.ts\";\nimport { compile } from \"./compile.ts\";\nimport { compileBody, compileToString } from \"./compile-string.ts\";\nimport type { EtaConfig, Options } from \"./config.ts\";\nimport { defaultConfig } from \"./config.ts\";\nimport { EtaError, RuntimeErr } from \"./err.ts\";\nimport { parse } from \"./parse.ts\";\nimport {\n render,\n renderAsync,\n renderString,\n renderStringAsync,\n} from \"./render.ts\";\nimport { Cacher } from \"./storage.ts\";\n\nexport class Eta {\n constructor(customConfig?: Partial<EtaConfig>) {\n if (customConfig) {\n this.config = { ...defaultConfig, ...customConfig };\n } else {\n this.config = { ...defaultConfig };\n }\n }\n\n config: EtaConfig;\n\n RuntimeErr = RuntimeErr;\n\n compile = compile;\n compileToString = compileToString;\n compileBody = compileBody;\n parse = parse;\n render = render;\n renderAsync = renderAsync;\n renderString = renderString;\n renderStringAsync = renderStringAsync;\n\n filepathCache: Record<string, string> = {};\n templatesSync: Cacher<TemplateFunction> = new Cacher<TemplateFunction>({});\n templatesAsync: Cacher<TemplateFunction> = new Cacher<TemplateFunction>({});\n\n // resolvePath takes a relative path from the \"views\" directory\n resolvePath:\n | null\n | ((this: Eta, template: string, options?: Partial<Options>) => string) =\n null;\n readFile: null | ((this: Eta, path: string) => string) = null;\n\n // METHODS\n\n configure(customConfig: Partial<EtaConfig>) {\n this.config = { ...this.config, ...customConfig };\n }\n\n withConfig(customConfig: Partial<EtaConfig>): this & { config: EtaConfig } {\n return { ...this, config: { ...this.config, ...customConfig } };\n }\n\n loadTemplate(\n name: string,\n template: string | TemplateFunction, // template string or template function\n options?: { async: boolean },\n ): void {\n if (typeof template === \"string\") {\n const templates = options?.async\n ? this.templatesAsync\n : this.templatesSync;\n\n templates.define(name, this.compile(template, options));\n } else {\n let templates = this.templatesSync;\n\n if (template.constructor.name === \"AsyncFunction\" || options?.async) {\n templates = this.templatesAsync;\n }\n\n templates.define(name, template);\n }\n }\n}\n\n// for instance checking against thrown errors\nexport { EtaError };\n","import { Eta as EtaCore } from \"./internal.ts\";\n\nexport type { TemplateFunction } from \"./compile.ts\";\nexport type { EtaConfig, Options } from \"./config.ts\";\nexport {\n EtaError,\n EtaFileResolutionError,\n EtaNameResolutionError,\n EtaParseError,\n EtaRuntimeError,\n} from \"./err.ts\";\n\nexport class Eta extends EtaCore {}\n"],"mappings":"AAAA,IAAa,EAAb,cAA8B,KAAM,CAClC,YAAY,EAAiB,CAC3B,MAAM,EAAQ,CACd,KAAK,KAAO,cAIH,EAAb,cAAmC,CAAS,CAC1C,YAAY,EAAiB,CAC3B,MAAM,EAAQ,CACd,KAAK,KAAO,oBAIH,EAAb,cAAqC,CAAS,CAC5C,YAAY,EAAiB,CAC3B,MAAM,EAAQ,CACd,KAAK,KAAO,qBAIH,EAAb,cAA4C,CAAS,CACnD,YAAY,EAAiB,CAC3B,MAAM,EAAQ,CACd,KAAK,KAAO,4BAIH,EAAb,cAA4C,CAAS,CACnD,YAAY,EAAiB,CAC3B,MAAM,EAAQ,CACd,KAAK,KAAO,4BAQhB,SAAgB,EAAS,EAAiB,EAAa,EAAqB,CAC1E,IAAM,EAAa,EAAI,MAAM,EAAG,EAAK,CAAC,MAAM,KAAK,CAE3C,EAAS,EAAW,OACpB,EAAQ,EAAW,EAAS,GAAG,OAAS,EAa9C,KAZA,IACE,YACA,EACA,QACA,EACA;;IAEA,EAAI,MAAM,KAAK,CAAC,EAAS,GACzB;IAEA,MAAM,EAAM,CAAC,KAAK,IAAI,CACtB,IACI,IAAI,EAAc,EAAQ,CAGlC,SAAgB,EACd,EACA,EACA,EACA,EACO,CAGP,IAAM,EAAQ,EAAI,MAAM;EAAK,CACvB,EAAQ,KAAK,IAAI,EAAS,EAAG,EAAE,CAC/B,EAAM,KAAK,IAAI,EAAM,OAAQ,EAAS,EAAE,CACxC,EAAW,EAEX,EAAU,EACb,MAAM,EAAO,EAAI,CACjB,KAAK,EAAM,IAAM,CAChB,IAAM,EAAO,EAAI,EAAQ,EACzB,OAAQ,IAAS,EAAS,OAA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