@mountaya/elements 0.0.0-stage → 0.2.0
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.
- package/CHANGELOG.md +273 -0
- package/LICENCE.fr.txt +280 -0
- package/LICENSE.txt +262 -0
- package/README.md +1510 -2
- package/THIRD-PARTY-NOTICES.txt +103 -0
- package/dist/agent/index.cjs +1211 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +1966 -0
- package/dist/agent/index.d.ts +1966 -0
- package/dist/agent/index.js +1181 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/camera/index.cjs +2512 -0
- package/dist/camera/index.cjs.map +1 -0
- package/dist/camera/index.d.cts +1723 -0
- package/dist/camera/index.d.ts +1723 -0
- package/dist/camera/index.js +2443 -0
- package/dist/camera/index.js.map +1 -0
- package/dist/chunk-5pTPpv4v.d.cts +897 -0
- package/dist/chunk-5pTPpv4v.d.ts +897 -0
- package/dist/chunk-6JzFMFHh.d.ts +119 -0
- package/dist/chunk-6qyuJVvt.d.ts +513 -0
- package/dist/chunk-9fp0lDic.cjs +583 -0
- package/dist/chunk-9fp0lDic.cjs.map +1 -0
- package/dist/chunk-A48H1rDg.d.cts +73 -0
- package/dist/chunk-A48H1rDg.d.ts +73 -0
- package/dist/chunk-B-m1AchR.cjs +57 -0
- package/dist/chunk-B-m1AchR.cjs.map +1 -0
- package/dist/chunk-B-qFTf04.d.ts +216 -0
- package/dist/chunk-B0YROiZh.d.cts +1475 -0
- package/dist/chunk-B14wgOvH.d.cts +68 -0
- package/dist/chunk-B19l3j9r.cjs +150 -0
- package/dist/chunk-B19l3j9r.cjs.map +1 -0
- package/dist/chunk-B2PtjVKg.cjs +86 -0
- package/dist/chunk-B2PtjVKg.cjs.map +1 -0
- package/dist/chunk-B56Oyb7W.cjs +70 -0
- package/dist/chunk-B56Oyb7W.cjs.map +1 -0
- package/dist/chunk-B5WGMQwK.cjs +113 -0
- package/dist/chunk-B5WGMQwK.cjs.map +1 -0
- package/dist/chunk-B98mKrdu.d.cts +302 -0
- package/dist/chunk-BB0PmqIM.d.cts +44 -0
- package/dist/chunk-BBikve0Z.cjs +269 -0
- package/dist/chunk-BBikve0Z.cjs.map +1 -0
- package/dist/chunk-BHeXmM0X.js +37 -0
- package/dist/chunk-BHeXmM0X.js.map +1 -0
- package/dist/chunk-BI8WZLpU.cjs +281 -0
- package/dist/chunk-BI8WZLpU.cjs.map +1 -0
- package/dist/chunk-BIEc_SkR.cjs +29 -0
- package/dist/chunk-BIEc_SkR.cjs.map +1 -0
- package/dist/chunk-BJ6L6_W9.cjs +553 -0
- package/dist/chunk-BJ6L6_W9.cjs.map +1 -0
- package/dist/chunk-BJ91UCbB.js +11 -0
- package/dist/chunk-BJ91UCbB.js.map +1 -0
- package/dist/chunk-BJEZWTKj.cjs +166 -0
- package/dist/chunk-BJEZWTKj.cjs.map +1 -0
- package/dist/chunk-BJz54mfg.cjs +10 -0
- package/dist/chunk-BJz54mfg.cjs.map +1 -0
- package/dist/chunk-BNX5LAfN.d.cts +912 -0
- package/dist/chunk-BP6KgA86.js +35 -0
- package/dist/chunk-BP6KgA86.js.map +1 -0
- package/dist/chunk-BRnjQq6K.d.cts +157 -0
- package/dist/chunk-BSiMEwPS.js +46 -0
- package/dist/chunk-BSiMEwPS.js.map +1 -0
- package/dist/chunk-BTPjDw_y.cjs +16 -0
- package/dist/chunk-BTPjDw_y.cjs.map +1 -0
- package/dist/chunk-BTUUABGI.js +17 -0
- package/dist/chunk-BTUUABGI.js.map +1 -0
- package/dist/chunk-BUeL9y7s.cjs +45 -0
- package/dist/chunk-BUeL9y7s.cjs.map +1 -0
- package/dist/chunk-BWMuCNc9.cjs +172 -0
- package/dist/chunk-BWMuCNc9.cjs.map +1 -0
- package/dist/chunk-BWjRfhpF.js +126 -0
- package/dist/chunk-BWjRfhpF.js.map +1 -0
- package/dist/chunk-BZ5KyZXI.d.ts +302 -0
- package/dist/chunk-B_4SVmvh.js +94 -0
- package/dist/chunk-B_4SVmvh.js.map +1 -0
- package/dist/chunk-BcTUuZQ3.js +95 -0
- package/dist/chunk-BcTUuZQ3.js.map +1 -0
- package/dist/chunk-BdkqSsJe.cjs +140 -0
- package/dist/chunk-BdkqSsJe.cjs.map +1 -0
- package/dist/chunk-BfktMVmI.js +70 -0
- package/dist/chunk-BfktMVmI.js.map +1 -0
- package/dist/chunk-BfzQb0EK.cjs +6 -0
- package/dist/chunk-BhWfT-22.d.cts +808 -0
- package/dist/chunk-BjJcqX5J.cjs +60 -0
- package/dist/chunk-BjJcqX5J.cjs.map +1 -0
- package/dist/chunk-Bk0L8g5J.d.cts +77 -0
- package/dist/chunk-Bk0L8g5J.d.ts +77 -0
- package/dist/chunk-Bl4_uVa6.cjs +11 -0
- package/dist/chunk-Bl4_uVa6.cjs.map +1 -0
- package/dist/chunk-BlKF4lrp.js +43 -0
- package/dist/chunk-BlKF4lrp.js.map +1 -0
- package/dist/chunk-Bm1FieGR.js +4 -0
- package/dist/chunk-Bm1FieGR.js.map +1 -0
- package/dist/chunk-Bn6ZbxkS.cjs +27 -0
- package/dist/chunk-BpN3hr6a.cjs +541 -0
- package/dist/chunk-BpN3hr6a.cjs.map +1 -0
- package/dist/chunk-Bq_WHTfd.d.cts +119 -0
- package/dist/chunk-Bqt4LBBz.cjs +648 -0
- package/dist/chunk-Bqt4LBBz.cjs.map +1 -0
- package/dist/chunk-Bqt97zwf.d.cts +54 -0
- package/dist/chunk-Bqt97zwf.d.ts +54 -0
- package/dist/chunk-BsBiN4w6.d.cts +245 -0
- package/dist/chunk-BvTpOUoC.cjs +207 -0
- package/dist/chunk-BvTpOUoC.cjs.map +1 -0
- package/dist/chunk-BwK6Hl3q.cjs +446 -0
- package/dist/chunk-BwK6Hl3q.cjs.map +1 -0
- package/dist/chunk-BxDQZDXR.d.cts +76 -0
- package/dist/chunk-BxDQZDXR.d.ts +76 -0
- package/dist/chunk-BxUio8kX.js +20 -0
- package/dist/chunk-BxUio8kX.js.map +1 -0
- package/dist/chunk-BxaocpFi.d.cts +1 -0
- package/dist/chunk-Bywi0K1N.js +36 -0
- package/dist/chunk-Bywi0K1N.js.map +1 -0
- package/dist/chunk-C-IlmkDl.js +59 -0
- package/dist/chunk-C-IlmkDl.js.map +1 -0
- package/dist/chunk-C5PtVewq.d.ts +389 -0
- package/dist/chunk-C5dpC7mQ.js +19 -0
- package/dist/chunk-C5dpC7mQ.js.map +1 -0
- package/dist/chunk-C5q1sgSa.js +46 -0
- package/dist/chunk-C5q1sgSa.js.map +1 -0
- package/dist/chunk-C6fU9G5I.cjs +221 -0
- package/dist/chunk-C6fU9G5I.cjs.map +1 -0
- package/dist/chunk-C71dpWUK.js +5 -0
- package/dist/chunk-C71dpWUK.js.map +1 -0
- package/dist/chunk-C82N1gQX.d.ts +1831 -0
- package/dist/chunk-C8HdaHpu.js +118 -0
- package/dist/chunk-C8HdaHpu.js.map +1 -0
- package/dist/chunk-C8ZGryck.js +236 -0
- package/dist/chunk-C8ZGryck.js.map +1 -0
- package/dist/chunk-C95NG0oD.cjs +43 -0
- package/dist/chunk-C95NG0oD.cjs.map +1 -0
- package/dist/chunk-C9aR8DXb.js +9 -0
- package/dist/chunk-C9aR8DXb.js.map +1 -0
- package/dist/chunk-CAUZnoCs.d.ts +525 -0
- package/dist/chunk-CBXWWuM9.cjs +82 -0
- package/dist/chunk-CBXWWuM9.cjs.map +1 -0
- package/dist/chunk-CC_Kquu7.d.cts +125 -0
- package/dist/chunk-CC_Kquu7.d.ts +125 -0
- package/dist/chunk-CCp85vXg.cjs +60 -0
- package/dist/chunk-CCp85vXg.cjs.map +1 -0
- package/dist/chunk-CEcB1_uK.js +39 -0
- package/dist/chunk-CEcB1_uK.js.map +1 -0
- package/dist/chunk-CFIo021l.d.cts +216 -0
- package/dist/chunk-CH_IZoJE.js +33 -0
- package/dist/chunk-CH_IZoJE.js.map +1 -0
- package/dist/chunk-CHrasH_g.cjs +25 -0
- package/dist/chunk-CHrasH_g.cjs.map +1 -0
- package/dist/chunk-CJVoSaAE.cjs +3 -0
- package/dist/chunk-CJp8nGcb.js +96 -0
- package/dist/chunk-CJp8nGcb.js.map +1 -0
- package/dist/chunk-CJwUtkOt.js +112 -0
- package/dist/chunk-CJwUtkOt.js.map +1 -0
- package/dist/chunk-CKhCOVIf.d.cts +751 -0
- package/dist/chunk-CKiVSRYg.js +50 -0
- package/dist/chunk-CKiVSRYg.js.map +1 -0
- package/dist/chunk-CKtd19eD.cjs +59 -0
- package/dist/chunk-CKtd19eD.cjs.map +1 -0
- package/dist/chunk-CL92KE3j.d.ts +3188 -0
- package/dist/chunk-CLqUlkAe.js +54 -0
- package/dist/chunk-CLqUlkAe.js.map +1 -0
- package/dist/chunk-CMG5OV0q.cjs +4741 -0
- package/dist/chunk-CMG5OV0q.cjs.map +1 -0
- package/dist/chunk-CN_TKSgm.js +10 -0
- package/dist/chunk-CN_TKSgm.js.map +1 -0
- package/dist/chunk-CNe6MtqV.cjs +29 -0
- package/dist/chunk-CNe6MtqV.cjs.map +1 -0
- package/dist/chunk-COQkDTC5.js +83 -0
- package/dist/chunk-COQkDTC5.js.map +1 -0
- package/dist/chunk-CPBl6K4M.cjs +168 -0
- package/dist/chunk-CPBl6K4M.cjs.map +1 -0
- package/dist/chunk-CPx0ZYFB.d.ts +3 -0
- package/dist/chunk-CQQhcP_C.d.ts +197 -0
- package/dist/chunk-CTNoajFh.d.cts +389 -0
- package/dist/chunk-CTd-qgJc.cjs +384 -0
- package/dist/chunk-CTd-qgJc.cjs.map +1 -0
- package/dist/chunk-CW80YYtU.cjs +1056 -0
- package/dist/chunk-CW80YYtU.cjs.map +1 -0
- package/dist/chunk-CWpqBgkF.d.cts +24 -0
- package/dist/chunk-CWpqBgkF.d.ts +24 -0
- package/dist/chunk-CXjRArgy.d.ts +3 -0
- package/dist/chunk-CXonfH3-.cjs +14 -0
- package/dist/chunk-CXonfH3-.cjs.map +1 -0
- package/dist/chunk-CYcouGXN.d.ts +825 -0
- package/dist/chunk-CZDAzEBw.cjs +1621 -0
- package/dist/chunk-CZDAzEBw.cjs.map +1 -0
- package/dist/chunk-C_fQFr70.d.cts +159 -0
- package/dist/chunk-C_fQFr70.d.ts +159 -0
- package/dist/chunk-CbOtHnnB.cjs +359 -0
- package/dist/chunk-CbOtHnnB.cjs.map +1 -0
- package/dist/chunk-CdA6ZMGk.d.cts +825 -0
- package/dist/chunk-Ce1_thm7.js +146 -0
- package/dist/chunk-Ce1_thm7.js.map +1 -0
- package/dist/chunk-CeD8Hw0j.d.cts +3188 -0
- package/dist/chunk-CeiTuMyt.d.cts +525 -0
- package/dist/chunk-Ch1OLzLi.js +1 -0
- package/dist/chunk-Cizu_j1N.cjs +87 -0
- package/dist/chunk-Cizu_j1N.cjs.map +1 -0
- package/dist/chunk-CjDe9z6A.d.cts +427 -0
- package/dist/chunk-Cl1etdlu.js +63 -0
- package/dist/chunk-Cl1etdlu.js.map +1 -0
- package/dist/chunk-CmoVJDoz.js +4 -0
- package/dist/chunk-CmoVJDoz.js.map +1 -0
- package/dist/chunk-CnLucxjG.cjs +197 -0
- package/dist/chunk-CnLucxjG.cjs.map +1 -0
- package/dist/chunk-CsWjBmdi.cjs +56 -0
- package/dist/chunk-CsWjBmdi.cjs.map +1 -0
- package/dist/chunk-CuseO5MZ.d.cts +3 -0
- package/dist/chunk-CvMHibbA.d.ts +427 -0
- package/dist/chunk-CwDeiN5U.js +870 -0
- package/dist/chunk-CwDeiN5U.js.map +1 -0
- package/dist/chunk-Cwdmx4tG.js +1 -0
- package/dist/chunk-D-4MxHTt.d.cts +105 -0
- package/dist/chunk-D-4MxHTt.d.ts +105 -0
- package/dist/chunk-D0LF-99V.js +1093 -0
- package/dist/chunk-D0LF-99V.js.map +1 -0
- package/dist/chunk-D1fe-0c_.js +367 -0
- package/dist/chunk-D1fe-0c_.js.map +1 -0
- package/dist/chunk-D21fEI6A.d.ts +1926 -0
- package/dist/chunk-D39gAxya.cjs +89 -0
- package/dist/chunk-D39gAxya.cjs.map +1 -0
- package/dist/chunk-D6KdIW5e.cjs +228 -0
- package/dist/chunk-D6KdIW5e.cjs.map +1 -0
- package/dist/chunk-D6qHYbgW.d.cts +36 -0
- package/dist/chunk-D89E-w70.d.ts +44 -0
- package/dist/chunk-D8bdTysL.js +552 -0
- package/dist/chunk-D8bdTysL.js.map +1 -0
- package/dist/chunk-D96QJT24.cjs +109 -0
- package/dist/chunk-D96QJT24.cjs.map +1 -0
- package/dist/chunk-DAmkQl-i.js +119 -0
- package/dist/chunk-DAmkQl-i.js.map +1 -0
- package/dist/chunk-DEfsb2lc.cjs +10 -0
- package/dist/chunk-DEfsb2lc.cjs.map +1 -0
- package/dist/chunk-DIFjT5-V.d.cts +66 -0
- package/dist/chunk-DJpUw8TN.d.ts +912 -0
- package/dist/chunk-DK6lm2IZ.cjs +11 -0
- package/dist/chunk-DK6lm2IZ.cjs.map +1 -0
- package/dist/chunk-DKqgr31j.cjs +61 -0
- package/dist/chunk-DKqgr31j.cjs.map +1 -0
- package/dist/chunk-DLZ0QYm9.js +37 -0
- package/dist/chunk-DLZ0QYm9.js.map +1 -0
- package/dist/chunk-DLjS0uaC.js +4 -0
- package/dist/chunk-DLjS0uaC.js.map +1 -0
- package/dist/chunk-DMokwmOV.cjs +49 -0
- package/dist/chunk-DMokwmOV.cjs.map +1 -0
- package/dist/chunk-DMvWgBZL.d.cts +1831 -0
- package/dist/chunk-DNfGfIF3.js +31 -0
- package/dist/chunk-DNfGfIF3.js.map +1 -0
- package/dist/chunk-DQbSRe8D.d.ts +245 -0
- package/dist/chunk-DSGkP8_y.js +45 -0
- package/dist/chunk-DSGkP8_y.js.map +1 -0
- package/dist/chunk-DTctvfSd.d.cts +197 -0
- package/dist/chunk-DWe7igyw.cjs +206 -0
- package/dist/chunk-DWe7igyw.cjs.map +1 -0
- package/dist/chunk-DWsMP5JR.d.ts +68 -0
- package/dist/chunk-DWsm3HIW.d.cts +120 -0
- package/dist/chunk-DWsm3HIW.d.ts +120 -0
- package/dist/chunk-DXABHjLa.cjs +3 -0
- package/dist/chunk-D_BeqSbc.cjs +42 -0
- package/dist/chunk-D_BeqSbc.cjs.map +1 -0
- package/dist/chunk-D_svQNdW.d.ts +66 -0
- package/dist/chunk-Dav4xWrp.js +330 -0
- package/dist/chunk-Dav4xWrp.js.map +1 -0
- package/dist/chunk-DbCPhepL.js +293 -0
- package/dist/chunk-DbCPhepL.js.map +1 -0
- package/dist/chunk-DcrTy-y2.cjs +43 -0
- package/dist/chunk-DcrTy-y2.cjs.map +1 -0
- package/dist/chunk-Ddv484ld.js +487 -0
- package/dist/chunk-Ddv484ld.js.map +1 -0
- package/dist/chunk-De0bjnhY.cjs +88 -0
- package/dist/chunk-De0bjnhY.cjs.map +1 -0
- package/dist/chunk-De2FmNPu.cjs +32 -0
- package/dist/chunk-De2FmNPu.cjs.map +1 -0
- package/dist/chunk-DeSjQXiI.d.ts +157 -0
- package/dist/chunk-Den0Ta6C.js +132 -0
- package/dist/chunk-Den0Ta6C.js.map +1 -0
- package/dist/chunk-DiDKEeEa.js +8 -0
- package/dist/chunk-DiDKEeEa.js.map +1 -0
- package/dist/chunk-Dj60k5PU.js +197 -0
- package/dist/chunk-Dj60k5PU.js.map +1 -0
- package/dist/chunk-DjnYQBCN.js +4705 -0
- package/dist/chunk-DjnYQBCN.js.map +1 -0
- package/dist/chunk-Dk9VKvyq.d.ts +1 -0
- package/dist/chunk-Dor1ERI9.cjs +85 -0
- package/dist/chunk-Dor1ERI9.cjs.map +1 -0
- package/dist/chunk-DpMouOoH.js +451 -0
- package/dist/chunk-DpMouOoH.js.map +1 -0
- package/dist/chunk-DposgdNL.cjs +52 -0
- package/dist/chunk-DposgdNL.cjs.map +1 -0
- package/dist/chunk-DqLTG_5Q.d.cts +3 -0
- package/dist/chunk-Dr5MCIpS.d.cts +63 -0
- package/dist/chunk-Dr5MCIpS.d.ts +63 -0
- package/dist/chunk-DrudttCC.cjs +4 -0
- package/dist/chunk-DsDYVJQC.js +173 -0
- package/dist/chunk-DsDYVJQC.js.map +1 -0
- package/dist/chunk-Dw8ur6FJ.js +27 -0
- package/dist/chunk-Dw8ur6FJ.js.map +1 -0
- package/dist/chunk-DwG6M_0v.js +64 -0
- package/dist/chunk-DwG6M_0v.js.map +1 -0
- package/dist/chunk-Dy9a5ibO.js +284 -0
- package/dist/chunk-Dy9a5ibO.js.map +1 -0
- package/dist/chunk-DyayZlQJ.js +157 -0
- package/dist/chunk-DyayZlQJ.js.map +1 -0
- package/dist/chunk-DyhJZC2i.js +126 -0
- package/dist/chunk-DyhJZC2i.js.map +1 -0
- package/dist/chunk-F9zBzmmG.cjs +45 -0
- package/dist/chunk-F9zBzmmG.cjs.map +1 -0
- package/dist/chunk-FyCYofv2.js +116 -0
- package/dist/chunk-FyCYofv2.js.map +1 -0
- package/dist/chunk-GHJRjAk2.js +1 -0
- package/dist/chunk-H14isiSf.d.ts +751 -0
- package/dist/chunk-HIJzXoN4.js +7 -0
- package/dist/chunk-HIJzXoN4.js.map +1 -0
- package/dist/chunk-Id_8kRtu.d.ts +36 -0
- package/dist/chunk-KN60yxBQ.js +5 -0
- package/dist/chunk-KN60yxBQ.js.map +1 -0
- package/dist/chunk-NM5yg6bh.cjs +82 -0
- package/dist/chunk-NM5yg6bh.cjs.map +1 -0
- package/dist/chunk-OXr3zJfM.cjs +119 -0
- package/dist/chunk-OXr3zJfM.cjs.map +1 -0
- package/dist/chunk-QGqgNC4z.d.ts +928 -0
- package/dist/chunk-QJBtJrZ0.js +36 -0
- package/dist/chunk-QJBtJrZ0.js.map +1 -0
- package/dist/chunk-QKWhxfPv.d.cts +361 -0
- package/dist/chunk-QKWhxfPv.d.ts +361 -0
- package/dist/chunk-QXW7b4Ev.d.cts +410 -0
- package/dist/chunk-RHZrxUrM.cjs +39 -0
- package/dist/chunk-RHZrxUrM.cjs.map +1 -0
- package/dist/chunk-RTxe2i66.js +91 -0
- package/dist/chunk-RTxe2i66.js.map +1 -0
- package/dist/chunk-RrKkJb6P.js +16 -0
- package/dist/chunk-RrKkJb6P.js.map +1 -0
- package/dist/chunk-VOJqpcnM.cjs +181 -0
- package/dist/chunk-VOJqpcnM.cjs.map +1 -0
- package/dist/chunk-VljGTrid.js +1 -0
- package/dist/chunk-X3UVwUEK.d.cts +513 -0
- package/dist/chunk-X9K2WChn.cjs +28 -0
- package/dist/chunk-X9K2WChn.cjs.map +1 -0
- package/dist/chunk-YrtOx6oy.js +251 -0
- package/dist/chunk-YrtOx6oy.js.map +1 -0
- package/dist/chunk-bY7ySujI.d.cts +928 -0
- package/dist/chunk-bYf1sBz5.d.cts +11 -0
- package/dist/chunk-bYf1sBz5.d.ts +11 -0
- package/dist/chunk-blfknWoM.d.cts +1926 -0
- package/dist/chunk-blqsohAb.js +113 -0
- package/dist/chunk-blqsohAb.js.map +1 -0
- package/dist/chunk-cDMCjodI.cjs +58 -0
- package/dist/chunk-cDMCjodI.cjs.map +1 -0
- package/dist/chunk-cWjE3qd6.cjs +10 -0
- package/dist/chunk-cWjE3qd6.cjs.map +1 -0
- package/dist/chunk-dfOgV3fu.js +26 -0
- package/dist/chunk-dfOgV3fu.js.map +1 -0
- package/dist/chunk-f9cTwUX1.cjs +125 -0
- package/dist/chunk-f9cTwUX1.cjs.map +1 -0
- package/dist/chunk-fHVYEZs4.cjs +28 -0
- package/dist/chunk-fHVYEZs4.cjs.map +1 -0
- package/dist/chunk-fWRUMgRI.js +22 -0
- package/dist/chunk-fWRUMgRI.js.map +1 -0
- package/dist/chunk-fozLXfHY.d.cts +55 -0
- package/dist/chunk-fozLXfHY.d.ts +55 -0
- package/dist/chunk-gWmB1l3A.cjs +3122 -0
- package/dist/chunk-gWmB1l3A.cjs.map +1 -0
- package/dist/chunk-gbj2R-_w.js +58 -0
- package/dist/chunk-gbj2R-_w.js.map +1 -0
- package/dist/chunk-iIWxsAXd.js +59 -0
- package/dist/chunk-iIWxsAXd.js.map +1 -0
- package/dist/chunk-lItIuOIS.cjs +137 -0
- package/dist/chunk-lItIuOIS.cjs.map +1 -0
- package/dist/chunk-m6Rh4PCe.cjs +798 -0
- package/dist/chunk-m6Rh4PCe.cjs.map +1 -0
- package/dist/chunk-o3IRANDf.cjs +99 -0
- package/dist/chunk-o3IRANDf.cjs.map +1 -0
- package/dist/chunk-obUcg3Sk.d.ts +808 -0
- package/dist/chunk-ohsf-6Rn.js +600 -0
- package/dist/chunk-ohsf-6Rn.js.map +1 -0
- package/dist/chunk-pBleU6Nv.js +3061 -0
- package/dist/chunk-pBleU6Nv.js.map +1 -0
- package/dist/chunk-px4e99cy.js +71 -0
- package/dist/chunk-px4e99cy.js.map +1 -0
- package/dist/chunk-qwYDLeXc.cjs +99 -0
- package/dist/chunk-qwYDLeXc.cjs.map +1 -0
- package/dist/chunk-rF_859Qk.cjs +101 -0
- package/dist/chunk-rF_859Qk.cjs.map +1 -0
- package/dist/chunk-rLJkqJ5j.d.ts +1475 -0
- package/dist/chunk-twQItIRg.cjs +338 -0
- package/dist/chunk-twQItIRg.cjs.map +1 -0
- package/dist/chunk-vnPrMVjY.js +10 -0
- package/dist/chunk-vnPrMVjY.js.map +1 -0
- package/dist/chunk-ws3bVwaS.d.ts +410 -0
- package/dist/chunk-xh3UkuVs.cjs +246 -0
- package/dist/chunk-xh3UkuVs.cjs.map +1 -0
- package/dist/chunk-yMzRr26E.js +153 -0
- package/dist/chunk-yMzRr26E.js.map +1 -0
- package/dist/collab/index.cjs +831 -0
- package/dist/collab/index.cjs.map +1 -0
- package/dist/collab/index.d.cts +824 -0
- package/dist/collab/index.d.ts +824 -0
- package/dist/collab/index.js +819 -0
- package/dist/collab/index.js.map +1 -0
- package/dist/data/index.cjs +39 -0
- package/dist/data/index.d.cts +6 -0
- package/dist/data/index.d.ts +6 -0
- package/dist/data/index.js +7 -0
- package/dist/editor/index.cjs +2713 -0
- package/dist/editor/index.cjs.map +1 -0
- package/dist/editor/index.d.cts +10 -0
- package/dist/editor/index.d.ts +10 -0
- package/dist/editor/index.js +2702 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/errors/index.cjs +11 -0
- package/dist/errors/index.d.cts +2 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +1 -0
- package/dist/geo/index.cjs +68 -0
- package/dist/geo/index.d.cts +6 -0
- package/dist/geo/index.d.ts +6 -0
- package/dist/geo/index.js +11 -0
- package/dist/i18n/fr/index.cjs +333 -0
- package/dist/i18n/fr/index.cjs.map +1 -0
- package/dist/i18n/fr/index.d.cts +18 -0
- package/dist/i18n/fr/index.d.ts +18 -0
- package/dist/i18n/fr/index.js +328 -0
- package/dist/i18n/fr/index.js.map +1 -0
- package/dist/i18n/index.cjs +451 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +268 -0
- package/dist/i18n/index.d.ts +268 -0
- package/dist/i18n/index.js +430 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/icons/index.cjs +37 -0
- package/dist/icons/index.d.cts +4 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +8 -0
- package/dist/index.cjs +517 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +174 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/layers/index.cjs +83 -0
- package/dist/layers/index.d.cts +3 -0
- package/dist/layers/index.d.ts +3 -0
- package/dist/layers/index.js +5 -0
- package/dist/map-client/index.cjs +5 -0
- package/dist/map-client/index.d.cts +6 -0
- package/dist/map-client/index.d.ts +6 -0
- package/dist/map-client/index.js +0 -0
- package/dist/maplibre-worker.mjs +12 -0
- package/dist/navigation/index.cjs +612 -0
- package/dist/navigation/index.cjs.map +1 -0
- package/dist/navigation/index.d.cts +551 -0
- package/dist/navigation/index.d.ts +551 -0
- package/dist/navigation/index.js +599 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/profile/index.cjs +177 -0
- package/dist/profile/index.d.cts +8 -0
- package/dist/profile/index.d.ts +8 -0
- package/dist/profile/index.js +10 -0
- package/dist/seams/index.cjs +15 -0
- package/dist/seams/index.d.cts +4 -0
- package/dist/seams/index.d.ts +4 -0
- package/dist/seams/index.js +4 -0
- package/dist/search/index.cjs +39 -0
- package/dist/search/index.d.cts +6 -0
- package/dist/search/index.d.ts +6 -0
- package/dist/search/index.js +3 -0
- package/dist/style/index.cjs +34 -0
- package/dist/style/index.d.cts +5 -0
- package/dist/style/index.d.ts +5 -0
- package/dist/style/index.js +5 -0
- package/dist/styles.css +11 -0
- package/dist/testing/index.cjs +444 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +217 -0
- package/dist/testing/index.d.ts +217 -0
- package/dist/testing/index.js +435 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/timezone/index.cjs +1953 -0
- package/dist/timezone/index.cjs.map +1 -0
- package/dist/timezone/index.d.cts +28 -0
- package/dist/timezone/index.d.ts +28 -0
- package/dist/timezone/index.js +1948 -0
- package/dist/timezone/index.js.map +1 -0
- package/dist/units/index.cjs +29 -0
- package/dist/units/index.d.cts +3 -0
- package/dist/units/index.d.ts +3 -0
- package/dist/units/index.js +3 -0
- package/dist/video/index.cjs +1713 -0
- package/dist/video/index.cjs.map +1 -0
- package/dist/video/index.d.cts +846 -0
- package/dist/video/index.d.ts +846 -0
- package/dist/video/index.js +1689 -0
- package/dist/video/index.js.map +1 -0
- package/dist/view/index.cjs +7 -0
- package/dist/view/index.d.cts +3 -0
- package/dist/view/index.d.ts +3 -0
- package/dist/view/index.js +1 -0
- package/package.json +433 -4
- package/src/agent/engines/session.ts +2255 -0
- package/src/agent/index.ts +109 -0
- package/src/agent/rules/agentError.ts +128 -0
- package/src/agent/rules/boundedInputJson.ts +53 -0
- package/src/agent/rules/conversation.ts +629 -0
- package/src/agent/rules/conversationFaults.ts +349 -0
- package/src/agent/rules/conversationHost.ts +390 -0
- package/src/agent/rules/dispatcher.ts +102 -0
- package/src/agent/rules/errorCodes.ts +78 -0
- package/src/agent/rules/errorStatus.ts +65 -0
- package/src/agent/rules/scriptedTransport.ts +390 -0
- package/src/agent/rules/stickToBottom.ts +38 -0
- package/src/agent/rules/toolResultPayload.ts +197 -0
- package/src/auth/rules/clientHeader.ts +22 -0
- package/src/auth/rules/sentCredential.ts +76 -0
- package/src/auth/rules/transformRequest.ts +803 -0
- package/src/camera/engines/videoFlight.ts +1758 -0
- package/src/camera/index.ts +157 -0
- package/src/camera/rules/clearance.ts +1099 -0
- package/src/camera/rules/fit.ts +132 -0
- package/src/camera/rules/modes.ts +1019 -0
- package/src/camera/rules/plan.ts +478 -0
- package/src/camera/rules/planner.ts +129 -0
- package/src/camera/rules/poseRanges.ts +38 -0
- package/src/camera/rules/presets.ts +185 -0
- package/src/camera/rules/profileSamples.ts +243 -0
- package/src/camera/rules/route.ts +596 -0
- package/src/camera/rules/routeContent.ts +105 -0
- package/src/camera/rules/spline.ts +765 -0
- package/src/camera/rules/sweptViewports.ts +39 -0
- package/src/camera/rules/track.ts +1412 -0
- package/src/camera/rules/vocabulary.ts +130 -0
- package/src/camera/rules/zoom.ts +216 -0
- package/src/collab/engines/session.ts +1902 -0
- package/src/collab/engines/trailingThrottle.ts +151 -0
- package/src/collab/index.ts +52 -0
- package/src/collab/rules/dispatch.ts +143 -0
- package/src/collab/rules/peerNames.ts +51 -0
- package/src/collab/rules/scriptedTransport.ts +244 -0
- package/src/compose/engines/baseMapSwitch.ts +1136 -0
- package/src/compose/engines/events.ts +962 -0
- package/src/compose/engines/mountayaMap.ts +5648 -0
- package/src/compose/engines/sentCredentials.ts +146 -0
- package/src/compose/engines/slotRequests.ts +413 -0
- package/src/compose/rules/accessRefusal.ts +109 -0
- package/src/compose/rules/accessStanding.ts +75 -0
- package/src/compose/rules/analysisKinds.ts +331 -0
- package/src/compose/rules/analysisLayers.ts +176 -0
- package/src/compose/rules/cameraMoves.ts +38 -0
- package/src/compose/rules/carriedLayers.ts +87 -0
- package/src/compose/rules/developmentWarnings.ts +167 -0
- package/src/compose/rules/fitBox.ts +67 -0
- package/src/compose/rules/fitCamera.ts +54 -0
- package/src/compose/rules/geoJsonSlot.ts +61 -0
- package/src/compose/rules/geometrySlots.ts +155 -0
- package/src/compose/rules/glyphNode.ts +62 -0
- package/src/compose/rules/layerKeys.ts +92 -0
- package/src/compose/rules/layerOrder.ts +85 -0
- package/src/compose/rules/layersManifest.ts +26 -0
- package/src/compose/rules/mapOptions.ts +300 -0
- package/src/compose/rules/maplibreWorkerVersion.gen.ts +8 -0
- package/src/compose/rules/markerPin.ts +122 -0
- package/src/compose/rules/markerRegistry.ts +85 -0
- package/src/compose/rules/markerSprite.ts +382 -0
- package/src/compose/rules/maxBounds.ts +120 -0
- package/src/compose/rules/overlayLookup.ts +49 -0
- package/src/compose/rules/paintDiff.ts +38 -0
- package/src/compose/rules/panLock.ts +77 -0
- package/src/compose/rules/patch.ts +124 -0
- package/src/compose/rules/queriedFeature.ts +55 -0
- package/src/compose/rules/queryLayers.ts +46 -0
- package/src/compose/rules/searchHighlight.ts +313 -0
- package/src/compose/rules/slotNames.ts +19 -0
- package/src/compose/rules/stripeImage.ts +253 -0
- package/src/compose/rules/swapMarker.ts +66 -0
- package/src/compose/rules/terrainVariant.ts +88 -0
- package/src/compose/rules/types.ts +559 -0
- package/src/compose/rules/urlHash.ts +19 -0
- package/src/compose/rules/viewOptions.ts +451 -0
- package/src/compose/rules/workerUrl.ts +131 -0
- package/src/data/engines/itineraryResource.ts +643 -0
- package/src/data/index.ts +78 -0
- package/src/data/rules/adapt.ts +473 -0
- package/src/data/rules/editModes.ts +51 -0
- package/src/data/rules/itinerary.ts +168 -0
- package/src/data/rules/nullable.ts +63 -0
- package/src/data/rules/roadAccess.ts +169 -0
- package/src/data/rules/segmentGroups.ts +309 -0
- package/src/data/rules/selectors.ts +95 -0
- package/src/data/rules/zones.ts +79 -0
- package/src/draw/engines/boundaryEngine.ts +1003 -0
- package/src/draw/engines/framedAdapter.ts +198 -0
- package/src/draw/engines/pointerCursor.ts +205 -0
- package/src/draw/engines/segmentEngine.ts +1405 -0
- package/src/draw/engines/snapIndex.ts +254 -0
- package/src/draw/engines/waypointEngine.ts +574 -0
- package/src/draw/engines/zoneEngine.ts +1137 -0
- package/src/draw/rules/drawFrame.ts +123 -0
- package/src/draw/rules/insertVertex.ts +226 -0
- package/src/draw/rules/screenSpace.ts +62 -0
- package/src/draw/rules/seeds.ts +185 -0
- package/src/draw/rules/snap.ts +115 -0
- package/src/draw/rules/snapCameraKey.ts +50 -0
- package/src/draw/rules/terraDrawShared.ts +214 -0
- package/src/draw/rules/zoneOutline.ts +213 -0
- package/src/editing/engines/cursor.ts +505 -0
- package/src/editing/engines/draftMarker.ts +149 -0
- package/src/editing/rules/accent.ts +11 -0
- package/src/editing/rules/engine.ts +288 -0
- package/src/editing/rules/placement.ts +22 -0
- package/src/editing/rules/positions.ts +89 -0
- package/src/editing/rules/sources.ts +9 -0
- package/src/editing/rules/types.ts +457 -0
- package/src/editing/rules/vocabulary.ts +10 -0
- package/src/editing/rules/waypointCursor.ts +228 -0
- package/src/editor/engines/directionArrows.ts +459 -0
- package/src/editor/engines/directions.ts +1383 -0
- package/src/editor/engines/editorClient.ts +134 -0
- package/src/editor/engines/eventScope.ts +59 -0
- package/src/editor/engines/frameLoop.ts +159 -0
- package/src/editor/engines/itineraryPreview.ts +272 -0
- package/src/editor/engines/mapLockGuard.ts +66 -0
- package/src/editor/engines/overlayRenderer.ts +2696 -0
- package/src/editor/engines/peerDraft.ts +760 -0
- package/src/editor/engines/poiPick.ts +305 -0
- package/src/editor/engines/pointPick.ts +84 -0
- package/src/editor/engines/roadAccessLine.ts +140 -0
- package/src/editor/engines/searchHighlight.ts +183 -0
- package/src/editor/engines/viewClient.ts +4091 -0
- package/src/editor/engines/zoneBadges.ts +503 -0
- package/src/editor/index.ts +97 -0
- package/src/editor/rules/accentColor.ts +116 -0
- package/src/editor/rules/camera.ts +121 -0
- package/src/editor/rules/contract.ts +120 -0
- package/src/editor/rules/icons.ts +825 -0
- package/src/editor/rules/markerElements.ts +244 -0
- package/src/editor/rules/style.ts +51 -0
- package/src/editor/rules/terrain.ts +98 -0
- package/src/editor/rules/tileWarm.ts +191 -0
- package/src/editor/rules/tilesReload.ts +158 -0
- package/src/editor/rules/zoneBadgePlacement.ts +1832 -0
- package/src/editor/rules/zoneTimeStyling.ts +119 -0
- package/src/errors/index.ts +25 -0
- package/src/errors/rules/errors.ts +158 -0
- package/src/errors/rules/print.ts +129 -0
- package/src/geo/index.ts +89 -0
- package/src/geo/rules/boundaries.ts +105 -0
- package/src/geo/rules/camera.ts +496 -0
- package/src/geo/rules/corridor.ts +242 -0
- package/src/geo/rules/elevationTiles.ts +269 -0
- package/src/geo/rules/formatLngLat.ts +63 -0
- package/src/geo/rules/geodesy.ts +125 -0
- package/src/geo/rules/geometry.ts +362 -0
- package/src/geo/rules/lineWalk.ts +77 -0
- package/src/geo/rules/longitude.ts +99 -0
- package/src/geo/rules/searchLimits.ts +22 -0
- package/src/geo/rules/segmentGeometry.ts +80 -0
- package/src/geo/rules/terrain.ts +107 -0
- package/src/geo/rules/tuples.ts +124 -0
- package/src/geo/rules/types.ts +54 -0
- package/src/geo/rules/webMercator.ts +57 -0
- package/src/i18n/fr/index.ts +17 -0
- package/src/i18n/fr/rules/fr.ts +85 -0
- package/src/i18n/fr/rules/words.gen.ts +277 -0
- package/src/i18n/index.ts +82 -0
- package/src/i18n/rules/bundle.ts +378 -0
- package/src/i18n/rules/config.ts +71 -0
- package/src/i18n/rules/dates.ts +165 -0
- package/src/i18n/rules/endonyms.gen.ts +19 -0
- package/src/i18n/rules/language.ts +92 -0
- package/src/i18n/rules/localizedName.ts +33 -0
- package/src/i18n/rules/merge.ts +106 -0
- package/src/i18n/rules/scope.ts +127 -0
- package/src/i18n/rules/strings.ts +632 -0
- package/src/i18n/rules/videoOverlay.ts +121 -0
- package/src/i18n/rules/wordForms.ts +95 -0
- package/src/i18n/rules/words.gen.ts +277 -0
- package/src/icons/index.ts +54 -0
- package/src/icons/rules/activities.ts +40 -0
- package/src/icons/rules/amenities.ts +250 -0
- package/src/icons/rules/artwork.gen.ts +83 -0
- package/src/icons/rules/artwork.ts +47 -0
- package/src/icons/rules/fallback.ts +21 -0
- package/src/icons/rules/lucideMarkers.gen.ts +112 -0
- package/src/icons/rules/lucideUi.gen.ts +197 -0
- package/src/icons/rules/paint.ts +107 -0
- package/src/icons/rules/parse.ts +475 -0
- package/src/icons/rules/provider.ts +373 -0
- package/src/icons/rules/sprites.ts +54 -0
- package/src/icons/rules/ui.ts +348 -0
- package/src/icons/rules/waypoints.ts +215 -0
- package/src/index.ts +993 -0
- package/src/layers/engines/layersSelection.ts +515 -0
- package/src/layers/engines/readoutEngine.ts +131 -0
- package/src/layers/index.ts +151 -0
- package/src/layers/rules/analysis.ts +135 -0
- package/src/layers/rules/enrichment.ts +30 -0
- package/src/layers/rules/geoJson.ts +270 -0
- package/src/layers/rules/hover.ts +67 -0
- package/src/layers/rules/itineraries.ts +182 -0
- package/src/layers/rules/layersPanel.ts +237 -0
- package/src/layers/rules/order.ts +194 -0
- package/src/layers/rules/overlayInstant.ts +49 -0
- package/src/layers/rules/overlays.ts +52 -0
- package/src/layers/rules/poiPanel.ts +119 -0
- package/src/layers/rules/pois.ts +114 -0
- package/src/layers/rules/readout.ts +340 -0
- package/src/layers/rules/streetView.ts +16 -0
- package/src/layers/rules/tileTimestamp.ts +146 -0
- package/src/layers/rules/timeSlider.ts +192 -0
- package/src/layers/rules/timeWindow.ts +123 -0
- package/src/layers/rules/zones.ts +43 -0
- package/src/layers/rules/zoom.ts +77 -0
- package/src/map-client/index.ts +71 -0
- package/src/map-client/rules/mapClient.ts +1945 -0
- package/src/navigation/engines/navigation.ts +493 -0
- package/src/navigation/index.ts +51 -0
- package/src/navigation/rules/followedRoute.ts +78 -0
- package/src/navigation/rules/instructions.ts +89 -0
- package/src/navigation/rules/itineraryRoute.ts +232 -0
- package/src/navigation/rules/offRoute.ts +41 -0
- package/src/navigation/rules/progress.ts +230 -0
- package/src/navigation/rules/prompts.ts +217 -0
- package/src/navigation/rules/routeRequest.ts +98 -0
- package/src/navigation/rules/status.ts +142 -0
- package/src/navigation/rules/steps.ts +234 -0
- package/src/navigation/rules/types.ts +83 -0
- package/src/profile/index.ts +307 -0
- package/src/profile/rules/amenityBadge.ts +35 -0
- package/src/profile/rules/amenityFilter.ts +74 -0
- package/src/profile/rules/amenityStacks.ts +66 -0
- package/src/profile/rules/axis.ts +89 -0
- package/src/profile/rules/axisCulling.ts +83 -0
- package/src/profile/rules/axisLookup.ts +180 -0
- package/src/profile/rules/climbs.ts +292 -0
- package/src/profile/rules/cursorMarker.ts +122 -0
- package/src/profile/rules/cursorReadout.ts +104 -0
- package/src/profile/rules/curvePlacement.ts +216 -0
- package/src/profile/rules/dock.ts +293 -0
- package/src/profile/rules/elevation.ts +1263 -0
- package/src/profile/rules/instant.ts +89 -0
- package/src/profile/rules/intl.ts +237 -0
- package/src/profile/rules/legEmphasis.ts +53 -0
- package/src/profile/rules/profileColors.ts +66 -0
- package/src/profile/rules/profileLayout.ts +59 -0
- package/src/profile/rules/profileSlices.ts +55 -0
- package/src/profile/rules/routeProfile.ts +475 -0
- package/src/profile/rules/rowMatch.ts +50 -0
- package/src/profile/rules/scale.ts +646 -0
- package/src/profile/rules/scaleFrame.ts +171 -0
- package/src/profile/rules/sectionChips.ts +83 -0
- package/src/profile/rules/sections.ts +923 -0
- package/src/profile/rules/slopeRamp.ts +160 -0
- package/src/profile/rules/statStrip.ts +103 -0
- package/src/profile/rules/steepness.ts +51 -0
- package/src/profile/rules/tableCells.ts +269 -0
- package/src/profile/rules/tableCursor.ts +87 -0
- package/src/profile/rules/unitPatterns.ts +335 -0
- package/src/profile/rules/units.ts +1025 -0
- package/src/profile/rules/waypointCard.ts +590 -0
- package/src/profile/rules/webAddress.ts +130 -0
- package/src/profile/rules/windowSpans.ts +65 -0
- package/src/rules/asciiFold.ts +17 -0
- package/src/rules/inDevelopment.ts +54 -0
- package/src/rules/listeners.ts +62 -0
- package/src/rules/timers.ts +9 -0
- package/src/rules/types.ts +22 -0
- package/src/rules/uuid.ts +87 -0
- package/src/seams/engines/geolocateControl.ts +286 -0
- package/src/seams/index.ts +50 -0
- package/src/seams/rules/clock.ts +169 -0
- package/src/seams/rules/geolocation.ts +165 -0
- package/src/seams/rules/segmentRoute.ts +187 -0
- package/src/search/engines/search.ts +1093 -0
- package/src/search/index.ts +99 -0
- package/src/search/rules/describe.ts +383 -0
- package/src/search/rules/filters.ts +195 -0
- package/src/search/rules/highlight.ts +270 -0
- package/src/search/rules/pick.ts +90 -0
- package/src/search/rules/rows.ts +258 -0
- package/src/search/rules/searchFocus.ts +27 -0
- package/src/search/rules/searchViewport.ts +44 -0
- package/src/search/rules/shown.ts +77 -0
- package/src/search/rules/types.ts +340 -0
- package/src/stream/rules/reconnectSchedule.ts +83 -0
- package/src/style/engines/organizationRead.ts +80 -0
- package/src/style/index.ts +63 -0
- package/src/style/rules/apply.ts +268 -0
- package/src/style/rules/attribution.ts +119 -0
- package/src/style/rules/itineraryLine.ts +142 -0
- package/src/style/rules/language.ts +668 -0
- package/src/style/rules/layout.gen.ts +27 -0
- package/src/style/rules/organization.ts +96 -0
- package/src/style/rules/paint.ts +143 -0
- package/src/style/rules/panelLayout.ts +51 -0
- package/src/style/rules/roadAccessColors.ts +29 -0
- package/src/style/rules/roadAccessLine.ts +267 -0
- package/src/style/rules/segmentColors.ts +207 -0
- package/src/testing/catalogs.ts +103 -0
- package/src/testing/index.ts +30 -0
- package/src/testing/mapClient.ts +241 -0
- package/src/testing/mountayaMap.ts +741 -0
- package/src/timezone/index.ts +14 -0
- package/src/timezone/rules/viewport.ts +875 -0
- package/src/units/index.ts +55 -0
- package/src/units/rules/conversions.ts +620 -0
- package/src/units/rules/preferenceChoices.ts +124 -0
- package/src/units/rules/preferences.ts +77 -0
- package/src/units/rules/rounding.ts +69 -0
- package/src/video/engines/videoRun.ts +654 -0
- package/src/video/engines/viewClient.ts +6 -0
- package/src/video/index.ts +83 -0
- package/src/video/profileOverlay/rules/contract.ts +210 -0
- package/src/video/profileOverlay/rules/curve.ts +216 -0
- package/src/video/profileOverlay/rules/draw.ts +410 -0
- package/src/video/profileOverlay/rules/fonts.ts +54 -0
- package/src/video/profileOverlay/rules/graphDesign.ts +690 -0
- package/src/video/profileOverlay/rules/minimalDesign.ts +144 -0
- package/src/video/profileOverlay/rules/registry.ts +23 -0
- package/src/video/profileOverlay/rules/staticLayer.ts +582 -0
- package/src/video/profileOverlay/rules/stripDesign.ts +327 -0
- package/src/video/profileOverlay/rules/types.ts +78 -0
- package/src/video/rules/videoConstants.ts +250 -0
- package/src/video/rules/videoEncoder.ts +277 -0
- package/src/video/rules/videoFrames.ts +99 -0
- package/src/video/rules/videoPreview.ts +185 -0
- package/src/video/rules/videoRecorder.ts +746 -0
- package/src/video/rules/videoWatermark.ts +155 -0
- package/src/video/rules/watermarkMark.ts +40 -0
- package/src/view/engines/viewClient.ts +6 -0
- package/src/view/index.ts +20 -0
|
@@ -0,0 +1,803 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authenticating the requests MapLibre makes for itself.
|
|
3
|
+
*
|
|
4
|
+
* This package never calls `fetch`. MapLibre fetches tiles, sprites and glyphs on its own
|
|
5
|
+
* schedule, and a credential belongs in a **header** (`X-API-Key`, `X-Session-Token`,
|
|
6
|
+
* `X-Share-Token`): the Tile API reads one from the query too, for a request that cannot set a
|
|
7
|
+
* header, and a key written into a URL template lands in every log, cache and `Referer` that URL
|
|
8
|
+
* reaches. A header cannot be baked into a URL template, so the place a credential is attached
|
|
9
|
+
* is MapLibre's `transformRequest` hook.
|
|
10
|
+
*
|
|
11
|
+
* That makes this function a published contract rather than an integration detail: without
|
|
12
|
+
* it there is no supported way to authenticate a Mountaya tile request, and every consumer
|
|
13
|
+
* would otherwise reinvent it, most of them by leaking the key somewhere.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { MountayaElementsError } from "../../errors/rules/errors.js";
|
|
17
|
+
import { CLIENT_HEADER_VALUE } from "./clientHeader.js";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* TransformedRequest is the part of MapLibre's `RequestParameters` a transform answers.
|
|
21
|
+
*
|
|
22
|
+
* Kept structural so the package does not force a `maplibre-gl` import into a consumer that
|
|
23
|
+
* only wants the type.
|
|
24
|
+
*/
|
|
25
|
+
export interface TransformedRequest {
|
|
26
|
+
readonly url: string;
|
|
27
|
+
readonly headers?: Record<string, string> | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the page's cookies ride the request.
|
|
30
|
+
*
|
|
31
|
+
* The member is typed as MapLibre types it, so a transform is handed to MapLibre as it is. A
|
|
32
|
+
* request {@link createTransformRequest} claims without the cookie flag carries `"omit"`, the
|
|
33
|
+
* third value `fetch` takes: MapLibre hands the member to `fetch` as written and names only
|
|
34
|
+
* the two values that send cookies somewhere.
|
|
35
|
+
*/
|
|
36
|
+
readonly credentials?: "same-origin" | "include" | undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* RequestTransform is MapLibre's `transformRequest` hook, as {@link createTransformRequest}
|
|
41
|
+
* answers it and as a host's own transform is chained behind it through `next`.
|
|
42
|
+
*
|
|
43
|
+
* @param url The URL MapLibre is about to fetch.
|
|
44
|
+
* @param resourceType What MapLibre fetches it as: `Tile`, `Style`, `Glyphs`, `SpriteImage`
|
|
45
|
+
* and the rest of its own vocabulary.
|
|
46
|
+
* @returns The request to make: the URL, and the headers and cookie policy to make it with.
|
|
47
|
+
*/
|
|
48
|
+
export type RequestTransform = (url: string, resourceType?: string) => TransformedRequest;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Credentials a browser may legitimately hold.
|
|
52
|
+
*
|
|
53
|
+
* A secret key is absent by construction. It mints session tokens server-side and can
|
|
54
|
+
* never reach a map, so there is no field here to put one in: the mistake is unavailable
|
|
55
|
+
* rather than merely discouraged, and a secret key pasted into the publishable key's place is
|
|
56
|
+
* refused where the credential is handed over, with every other key or token that cannot be
|
|
57
|
+
* sent (see {@link createTransformRequest}).
|
|
58
|
+
*/
|
|
59
|
+
export interface MapCredential {
|
|
60
|
+
readonly publishableKey?: string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Accompanies the publishable key; it does not replace it.
|
|
63
|
+
*
|
|
64
|
+
* A string, or a function called on every request the transform claims, never while it is
|
|
65
|
+
* built and never for a request bound elsewhere. A function is how one map follows a session
|
|
66
|
+
* token that rotates: each new tile, sprite and glyph request carries the token current at
|
|
67
|
+
* that request, and one already sent completes with the token it carried. While it answers
|
|
68
|
+
* `undefined`, the key goes out alone. A function that throws, or that answers neither a string
|
|
69
|
+
* nor `undefined`, is refused from the request it was read for, as
|
|
70
|
+
* {@link createTransformRequest} states.
|
|
71
|
+
*/
|
|
72
|
+
readonly sessionToken?: string | (() => string | undefined) | undefined;
|
|
73
|
+
/** Replaces the key entirely, for a share-link visitor. Read-only by nature. */
|
|
74
|
+
readonly shareToken?: string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Sends the browser's own session cookie with the request.
|
|
77
|
+
*
|
|
78
|
+
* For an application whose users are already signed in to Mountaya, or that fronts the
|
|
79
|
+
* API behind its own sign-in. The cookie is httpOnly, so there is no header a browser
|
|
80
|
+
* could build instead, which is the same reason `@mountaya/client` carries a CookieCredential.
|
|
81
|
+
*
|
|
82
|
+
* It combines with `shareToken`, and that pairing is load-bearing rather than merely
|
|
83
|
+
* allowed: the token authorizes the shared resource, while the cookie lets the API
|
|
84
|
+
* resolve the SIGNED-IN VIEWER's own access, so a viewer whose organization's agreement
|
|
85
|
+
* includes an analysis is served it on a shared itinerary. The token stays the sole
|
|
86
|
+
* authorization; the session never outranks it.
|
|
87
|
+
*
|
|
88
|
+
* Without it the page's cookies stay off every request the transform claims, one bound for the
|
|
89
|
+
* page's own origin included: the request carries `credentials: "omit"`, so a publishable key
|
|
90
|
+
* or a share token is never joined by a session the page happens to hold there. A transform
|
|
91
|
+
* chained through `next` does not change that: on a claimed request this flag alone decides.
|
|
92
|
+
*
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
readonly cookie?: boolean | undefined;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* TransformRequestOptions is what {@link createTransformRequest} takes: the credential, the
|
|
100
|
+
* origins it is sent to, the credential scoped to one resource's paths, and the transform a
|
|
101
|
+
* request the credential does not claim is handed on to.
|
|
102
|
+
*/
|
|
103
|
+
export interface TransformRequestOptions extends MapCredential {
|
|
104
|
+
/**
|
|
105
|
+
* Origins that count as Mountaya and so receive the credential.
|
|
106
|
+
*
|
|
107
|
+
* An entry is read as a `baseUrls` entry is, parsed and never compared as written: a trailing
|
|
108
|
+
* slash, the host's case and a default port are nothing, and an entry that carries a path
|
|
109
|
+
* claims that path and what lies under it.
|
|
110
|
+
*
|
|
111
|
+
* @default The public tile host, `https://tiles.mountaya.com`, unless `baseUrls` is given.
|
|
112
|
+
*/
|
|
113
|
+
readonly origins?: readonly string[] | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Base URLs that count as Mountaya: an origin, with the path the Tile API is mounted under.
|
|
116
|
+
*
|
|
117
|
+
* An entry claims a request whose origin is the entry's and whose path is the entry's or lies
|
|
118
|
+
* under it at a segment boundary. `https://example.com/tiles` claims
|
|
119
|
+
* `https://example.com/tiles/v1/zones`, and neither `https://example.com/tiles-private` nor
|
|
120
|
+
* `https://example.com.evil.net/tiles`. Both sides are parsed first, so a trailing slash, the
|
|
121
|
+
* host's case, a default port and dot segments are nothing, and only an `http` or `https`
|
|
122
|
+
* request is ever claimed.
|
|
123
|
+
*
|
|
124
|
+
* An entry is an `http` or `https` URL with no username or password, a path starting with one
|
|
125
|
+
* `/` on the page's own origin, or `""` for that origin whole. Its query and fragment are not
|
|
126
|
+
* read.
|
|
127
|
+
*
|
|
128
|
+
* The page's own origin is the origin of the page's address, `location`, which a `<base>`
|
|
129
|
+
* element does not move. A document whose address names no origin, at `about:blank` or under
|
|
130
|
+
* `file:`, has none of its own, so a path or `""` claims nothing there. A relative request is
|
|
131
|
+
* read as the browser resolves it, against the document's base URL where a document exists
|
|
132
|
+
* and against `location` otherwise, so one a `<base>` element sends to another host is bound
|
|
133
|
+
* for that host and no path or `""` claims it. A relative request the transform claims leaves
|
|
134
|
+
* as the absolute URL it resolved to: the credential reaches the address its claim was read
|
|
135
|
+
* against, whoever fetches the request.
|
|
136
|
+
*
|
|
137
|
+
* Where there is no page at all, as in Node, nothing resolves a relative URL: a path or `""`
|
|
138
|
+
* claims relative requests alone, and one it claims leaves as written.
|
|
139
|
+
*
|
|
140
|
+
* An origin cannot express a tile API mounted under a path, which is what a reverse proxy in
|
|
141
|
+
* front of the API produces. Supplying this narrows the match: `origins` stops
|
|
142
|
+
* defaulting, so a credential scoped to `https://example.com/tiles` is sent neither to
|
|
143
|
+
* `https://example.com/anything-else` nor to the public tile host.
|
|
144
|
+
*/
|
|
145
|
+
readonly baseUrls?: readonly string[] | undefined;
|
|
146
|
+
/**
|
|
147
|
+
* A BCP 47 tag sent as `Accept-Language`.
|
|
148
|
+
*
|
|
149
|
+
* Tile labels and legends are localized server-side, so a map that does not state a
|
|
150
|
+
* language is labelled in whatever the browser happens to prefer, which is rarely the
|
|
151
|
+
* language the rest of the application is rendering in.
|
|
152
|
+
*/
|
|
153
|
+
readonly language?: string | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* A second credential for one path prefix, where the default credential covers the rest.
|
|
156
|
+
*
|
|
157
|
+
* One map then paints a resource under a credential of its own beside layers the default
|
|
158
|
+
* credential reads. A share view needs no split: a share token reaches the overlays, the
|
|
159
|
+
* terrains and the layers manifest as well as the shared resource, so a share view states the
|
|
160
|
+
* token as its default credential and every tile it draws is sent under it.
|
|
161
|
+
*
|
|
162
|
+
* `pathPrefix` is matched against whichever origin or base URL claimed the request, so
|
|
163
|
+
* it stays a path and does not have to repeat the host. It takes a request whose path under
|
|
164
|
+
* that claim is the prefix or lies under it at a segment boundary: `/v1/itineraries/abc`
|
|
165
|
+
* takes `/v1/itineraries/abc/12/2093/1425` and not `/v1/itineraries/abcdef`. A trailing slash
|
|
166
|
+
* is nothing.
|
|
167
|
+
*/
|
|
168
|
+
readonly scoped?:
|
|
169
|
+
| {
|
|
170
|
+
readonly pathPrefix: string;
|
|
171
|
+
readonly credential: MapCredential;
|
|
172
|
+
}
|
|
173
|
+
| undefined;
|
|
174
|
+
/**
|
|
175
|
+
* A transform of the application's own, called first: this one reads its claim from the
|
|
176
|
+
* request that transform answers.
|
|
177
|
+
*
|
|
178
|
+
* The URL it answers is the one a claim is read from, and a header it sets stands over the
|
|
179
|
+
* same header set here. Its `credentials` stands on a request the transform does not claim. On
|
|
180
|
+
* a claimed request the credential decides whether the page's cookies ride, and what this
|
|
181
|
+
* stated is replaced: `"include"` under `cookie`, and `"omit"` otherwise.
|
|
182
|
+
*/
|
|
183
|
+
readonly next?: RequestTransform | undefined;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const DEFAULT_ORIGINS = ["https://tiles.mountaya.com"] as const;
|
|
187
|
+
|
|
188
|
+
/** The members of a {@link MapCredential} that become a header, and the prefix each carries. */
|
|
189
|
+
const credentialPrefixes = {
|
|
190
|
+
publishableKey: "pk_",
|
|
191
|
+
sessionToken: "sess_",
|
|
192
|
+
shareToken: "share_",
|
|
193
|
+
} as const;
|
|
194
|
+
|
|
195
|
+
/** The prefix of a secret key, which never belongs in a map's credential. */
|
|
196
|
+
const SECRET_KEY_PREFIX = "sk_";
|
|
197
|
+
|
|
198
|
+
/** Matches the whitespace a runtime's `fetch` takes off either end of a header's value. */
|
|
199
|
+
const edgeWhitespacePattern = /^[\t\n\r ]+|[\t\n\r ]+$/g;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Matches a value a request header carries: printable ASCII alone, U+0020 to U+007E, as every
|
|
203
|
+
* Mountaya SDK holds a header (the contract's SPEC §1, in `mountaya/schemas`). A tab, a line
|
|
204
|
+
* break and every other control character are none, at either end too, and so is a character past
|
|
205
|
+
* ASCII, a letter of Latin-1 such as `é` included.
|
|
206
|
+
*/
|
|
207
|
+
const printableAsciiPattern = /^[\x20-\x7e]*$/;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* headerValueRefusal answers why a value cannot be sent as a credential header, or undefined
|
|
211
|
+
* where it can: the client's own local checks, held here because a map's requests never pass
|
|
212
|
+
* through the client. A value that is empty or whitespace alone is a missing credential; one
|
|
213
|
+
* holding a character outside printable ASCII is one no
|
|
214
|
+
* header carries; and one without its member's prefix is a value in the wrong place, a secret
|
|
215
|
+
* key in a publishable key's above all, which would otherwise ride every tile request a page
|
|
216
|
+
* makes. The value itself is never quoted: it may be a key.
|
|
217
|
+
*/
|
|
218
|
+
const headerValueRefusal = (
|
|
219
|
+
member: keyof typeof credentialPrefixes | "language",
|
|
220
|
+
value: unknown,
|
|
221
|
+
): string | undefined => {
|
|
222
|
+
if (typeof value !== "string") {
|
|
223
|
+
return `is ${value === null ? "null" : `a value of type ${typeof value}`}, not a string`;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const trimmed = value.replace(edgeWhitespacePattern, "");
|
|
227
|
+
if (trimmed === "") {
|
|
228
|
+
return value === "" ? "is an empty string" : "is whitespace alone";
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (!printableAsciiPattern.test(value)) {
|
|
232
|
+
return "holds a character no request header carries: a request header carries printable ASCII alone, so a line break, a tab or another control character, at either end too, or a character past ASCII such as a letter of Latin-1, is none";
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (member === "language") {
|
|
236
|
+
return undefined;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (member === "publishableKey" && value.startsWith(SECRET_KEY_PREFIX)) {
|
|
240
|
+
return "is a secret key, which must never reach a browser: anyone can read it out of the page. Pass the publishable key, and mint session tokens with the secret key on your server";
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const prefix = credentialPrefixes[member];
|
|
244
|
+
|
|
245
|
+
return value.startsWith(prefix) ? undefined : `must start with "${prefix}"`;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* assertMapCredential refuses a credential a map cannot send, before any request is made: each
|
|
250
|
+
* of its keys and tokens is held to {@link headerValueRefusal}, and a session token held as a
|
|
251
|
+
* function is held to it where a claimed request reads it. `path` is where the caller wrote the
|
|
252
|
+
* credential (`""` for the options themselves, `"credential."` for a map's option), and
|
|
253
|
+
* `context` the call it was handed to.
|
|
254
|
+
*
|
|
255
|
+
* @throws `MountayaElementsError` naming the member and what is wrong with it, never its value.
|
|
256
|
+
*/
|
|
257
|
+
export const assertMapCredential = (
|
|
258
|
+
credential: MapCredential,
|
|
259
|
+
path: string,
|
|
260
|
+
context: string,
|
|
261
|
+
): void => {
|
|
262
|
+
for (const member of ["publishableKey", "sessionToken", "shareToken"] as const) {
|
|
263
|
+
// Read as unknown: the option types each member, and a JavaScript caller hands in what that
|
|
264
|
+
// type rules out.
|
|
265
|
+
const value: unknown = credential[member];
|
|
266
|
+
if (value === undefined || (member === "sessionToken" && typeof value === "function")) {
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const refusal = headerValueRefusal(member, value);
|
|
271
|
+
if (refusal !== undefined) {
|
|
272
|
+
throw new MountayaElementsError(`${context}: ${path}${member} ${refusal}.`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* PAGE_STAND_IN is the base a relative URL is parsed against where no page says what it is
|
|
279
|
+
* relative to.
|
|
280
|
+
*
|
|
281
|
+
* Its origin never leaves this module: a place read against it holds `null` for its origin.
|
|
282
|
+
* The `.invalid` top-level domain is reserved and resolves nowhere.
|
|
283
|
+
*/
|
|
284
|
+
const PAGE_STAND_IN = "http://page.invalid";
|
|
285
|
+
|
|
286
|
+
/** The schemes a claim holds: what a tile, a sprite or a glyph is fetched over. */
|
|
287
|
+
const CLAIMED_PROTOCOLS: readonly string[] = ["http:", "https:"];
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* A URL as a claim reads it: an origin and the path under it, both in the URL parser's spelling.
|
|
291
|
+
*
|
|
292
|
+
* `origin` is `null` for the page's own origin, which a relative URL names without spelling it.
|
|
293
|
+
*/
|
|
294
|
+
interface Place {
|
|
295
|
+
readonly origin: string | null;
|
|
296
|
+
readonly path: string;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* A request's URL as a claim reads it, with the absolute URL a page resolved it to.
|
|
301
|
+
*
|
|
302
|
+
* `resolved` is undefined for a request the page reads as it is written, which leaves as
|
|
303
|
+
* written, and for a relative one read where no page resolves it.
|
|
304
|
+
*/
|
|
305
|
+
interface RequestPlace extends Place {
|
|
306
|
+
readonly resolved: string | undefined;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/** A page as a claim reads it: the origin that is its own, and where a relative URL leads. */
|
|
310
|
+
interface Page {
|
|
311
|
+
/**
|
|
312
|
+
* The origin of the page's address, which a `<base>` element does not move, or `null` where
|
|
313
|
+
* that address names none: a document at `about:blank` or under `file:`.
|
|
314
|
+
*/
|
|
315
|
+
readonly origin: string | null;
|
|
316
|
+
/**
|
|
317
|
+
* The address the browser resolves a relative URL against on the thread the transform runs
|
|
318
|
+
* on, or undefined where the page's address is none the parser reads.
|
|
319
|
+
*/
|
|
320
|
+
readonly base: string | undefined;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/** parsed reads a URL, against a base where one is given, or answers undefined where it is none. */
|
|
324
|
+
const parsed = (url: string, base?: string): URL | undefined => {
|
|
325
|
+
try {
|
|
326
|
+
return new URL(url, base);
|
|
327
|
+
} catch {
|
|
328
|
+
return undefined;
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* pageOf returns the page the transform runs in, or undefined where there is none and so nothing
|
|
334
|
+
* resolves a relative URL: Node.
|
|
335
|
+
*
|
|
336
|
+
* The base is the document's base URL where a document exists, which a `<base>` element moves
|
|
337
|
+
* and a frame at `about:blank` takes from its parent, and the page's address otherwise: in a
|
|
338
|
+
* worker, the worker's own address, which is what its `fetch` resolves against.
|
|
339
|
+
*/
|
|
340
|
+
const pageOf = (): Page | undefined => {
|
|
341
|
+
if (typeof location === "undefined") {
|
|
342
|
+
return undefined;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const address = parsed(location.href);
|
|
346
|
+
const base = (typeof document === "undefined" ? undefined : parsed(document.baseURI)) ?? address;
|
|
347
|
+
|
|
348
|
+
return {
|
|
349
|
+
base: base?.href,
|
|
350
|
+
origin:
|
|
351
|
+
address !== undefined && CLAIMED_PROTOCOLS.includes(address.protocol) ? address.origin : null,
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
/** withoutTrailingSlash writes a path as a prefix is compared: `/tiles/` is `/tiles`, `/` is `""`. */
|
|
356
|
+
const withoutTrailingSlash = (path: string): string => path.replace(/\/+$/, "");
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* isUnder reports whether a path is a base path or lies under it at a segment boundary, so
|
|
360
|
+
* `/tiles` holds `/tiles` and `/tiles/1` and never `/tiles-private`. The base is written
|
|
361
|
+
* without its trailing slash, and the empty one holds every path.
|
|
362
|
+
*/
|
|
363
|
+
const isUnder = (path: string, base: string): boolean =>
|
|
364
|
+
base === "" || path === base || path.startsWith(`${base}/`);
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* placeOf reads a request's URL as the browser sends it: resolved against the page's base, its
|
|
368
|
+
* dot segments resolved, its origin in the parser's spelling.
|
|
369
|
+
*
|
|
370
|
+
* On a page the base has the last word, for a URL the parser reads alone too: one that names
|
|
371
|
+
* the page's scheme and no host, `https:/tiles/1` on an `https` page, parses alone as a host and
|
|
372
|
+
* is sent as a path on the page's own. A URL the base changes nothing of leaves as written.
|
|
373
|
+
*
|
|
374
|
+
* It answers undefined for a URL no claim holds: one the parser refuses, one fetched over
|
|
375
|
+
* neither `http` nor `https` (`data:`, `blob:`, `file:`), a relative one the page's base cannot
|
|
376
|
+
* resolve, and, where no page gives it a scheme, one that opens with two slashes and so names
|
|
377
|
+
* another host.
|
|
378
|
+
*/
|
|
379
|
+
const placeOf = (url: string, page: Page | undefined): RequestPlace | undefined => {
|
|
380
|
+
const absolute = parsed(url);
|
|
381
|
+
|
|
382
|
+
if (page !== undefined) {
|
|
383
|
+
const sent = page.base === undefined ? absolute : parsed(url, page.base);
|
|
384
|
+
|
|
385
|
+
return sent !== undefined && CLAIMED_PROTOCOLS.includes(sent.protocol)
|
|
386
|
+
? {
|
|
387
|
+
origin: sent.origin,
|
|
388
|
+
path: sent.pathname,
|
|
389
|
+
resolved: absolute?.href === sent.href ? undefined : sent.href,
|
|
390
|
+
}
|
|
391
|
+
: undefined;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
if (absolute !== undefined) {
|
|
395
|
+
return CLAIMED_PROTOCOLS.includes(absolute.protocol)
|
|
396
|
+
? { origin: absolute.origin, path: absolute.pathname, resolved: undefined }
|
|
397
|
+
: undefined;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const relative = parsed(url, PAGE_STAND_IN);
|
|
401
|
+
|
|
402
|
+
return relative !== undefined && relative.origin === PAGE_STAND_IN
|
|
403
|
+
? { origin: null, path: relative.pathname, resolved: undefined }
|
|
404
|
+
: undefined;
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* refuseEntry builds the refusal of a value that names no place. The value is quoted unless it
|
|
409
|
+
* holds an `@`, before which a password may stand.
|
|
410
|
+
*
|
|
411
|
+
* The value is `unknown` because it was refused: a JavaScript caller hands in what the option's
|
|
412
|
+
* type rules out.
|
|
413
|
+
*/
|
|
414
|
+
const refuseEntry = (name: string, value: unknown, expected: string): MountayaElementsError => {
|
|
415
|
+
if (typeof value !== "string") {
|
|
416
|
+
return new MountayaElementsError(
|
|
417
|
+
`createTransformRequest: ${name} is ${value === null ? "null" : typeof value}, not a string; pass ${expected}.`,
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
return new MountayaElementsError(
|
|
422
|
+
value.includes("@")
|
|
423
|
+
? `createTransformRequest: ${name} holds an "@" and is not quoted, since a password may stand before it; pass ${expected}.`
|
|
424
|
+
: `createTransformRequest: ${name} is ${JSON.stringify(value)}; pass ${expected}.`,
|
|
425
|
+
);
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
/** What an entry of `origins` or `baseUrls` may be, as a refusal words it. */
|
|
429
|
+
const ENTRY_FORMS =
|
|
430
|
+
'an http or https URL with no username or password, a path starting with one "/" on the page\'s own origin, or "" for that origin whole';
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* entryPlace reads one entry of `origins` or `baseUrls` into the place it claims.
|
|
434
|
+
*
|
|
435
|
+
* The entry is read as `unknown`: the option types it a string, and a JavaScript caller hands in
|
|
436
|
+
* what that type rules out.
|
|
437
|
+
*
|
|
438
|
+
* @throws `MountayaElementsError` for an entry that is no string, a URL the parser refuses or one
|
|
439
|
+
* over another scheme, a URL that names a username or a password, and a path that opens with
|
|
440
|
+
* two slashes or resolves to them, which names another host.
|
|
441
|
+
*/
|
|
442
|
+
const entryPlace = (name: string, entry: unknown): Place => {
|
|
443
|
+
if (typeof entry !== "string") {
|
|
444
|
+
throw refuseEntry(name, entry, ENTRY_FORMS);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if (entry === "" || entry.startsWith("/")) {
|
|
448
|
+
const relative = parsed(entry, PAGE_STAND_IN);
|
|
449
|
+
if (relative === undefined || relative.origin !== PAGE_STAND_IN) {
|
|
450
|
+
throw refuseEntry(name, entry, ENTRY_FORMS);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
return { origin: null, path: withoutTrailingSlash(relative.pathname) };
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const absolute = parsed(entry);
|
|
457
|
+
if (
|
|
458
|
+
absolute === undefined ||
|
|
459
|
+
!CLAIMED_PROTOCOLS.includes(absolute.protocol) ||
|
|
460
|
+
absolute.username !== "" ||
|
|
461
|
+
absolute.password !== ""
|
|
462
|
+
) {
|
|
463
|
+
throw refuseEntry(name, entry, ENTRY_FORMS);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
return { origin: absolute.origin, path: withoutTrailingSlash(absolute.pathname) };
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* scopedPathFrom reads `scoped.pathPrefix` into the path a claimed request is compared with.
|
|
471
|
+
* The prefix is read as `unknown`, for the reason {@link entryPlace} reads an entry so.
|
|
472
|
+
*
|
|
473
|
+
* @throws `MountayaElementsError` for a prefix that is no string, or one that names a host.
|
|
474
|
+
*/
|
|
475
|
+
const scopedPathFrom = (prefix: unknown): string => {
|
|
476
|
+
const expected = 'a path under the claimed base, such as "/v1/itineraries/abc"';
|
|
477
|
+
if (typeof prefix !== "string") {
|
|
478
|
+
throw refuseEntry("scoped.pathPrefix", prefix, expected);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
const relative = parsed(prefix, PAGE_STAND_IN);
|
|
482
|
+
if (relative === undefined || relative.origin !== PAGE_STAND_IN) {
|
|
483
|
+
throw refuseEntry("scoped.pathPrefix", prefix, expected);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
return withoutTrailingSlash(relative.pathname);
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
/** What one credential contributes to a claimed request. */
|
|
490
|
+
interface Attachment {
|
|
491
|
+
readonly headers: Record<string, string>;
|
|
492
|
+
readonly withCookie: boolean;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* A claimed request: its path under the entry that claims it, and the absolute URL it leaves
|
|
497
|
+
* as where a page resolved a relative one.
|
|
498
|
+
*/
|
|
499
|
+
interface Claim {
|
|
500
|
+
readonly path: string;
|
|
501
|
+
readonly resolved: string | undefined;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* thrownAs words what a function threw, for a refusal to quote: an error's own message, a string
|
|
506
|
+
* as it is, and the type of anything else.
|
|
507
|
+
*
|
|
508
|
+
* Nothing is converted to a string. A value with no string conversion, one whose conversion
|
|
509
|
+
* throws and an error whose message throws when read would each replace the refusal with an
|
|
510
|
+
* error of their own, so each is named by its type, which reading never throws.
|
|
511
|
+
*
|
|
512
|
+
* What was thrown is `unknown` by nature: a function throws any value.
|
|
513
|
+
*/
|
|
514
|
+
const thrownAs = (thrown: unknown): string => {
|
|
515
|
+
if (typeof thrown === "string") {
|
|
516
|
+
return `the string ${JSON.stringify(thrown)}`;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
try {
|
|
520
|
+
if (thrown instanceof Error) {
|
|
521
|
+
// Read once: a getter may answer differently the second time.
|
|
522
|
+
const { message } = thrown;
|
|
523
|
+
if (typeof message === "string") {
|
|
524
|
+
return `an error, ${JSON.stringify(message)}`;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
} catch {
|
|
528
|
+
// The value throws when it is read: its type is what is left to say.
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
return thrown === null ? "null" : `a value of type ${typeof thrown}`;
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* sessionTokenFrom calls a session token's function for one claimed request.
|
|
536
|
+
*
|
|
537
|
+
* The answer is `unknown` until it is read: a JavaScript caller's function answers what the
|
|
538
|
+
* option's type rules out, and a header would carry it as text.
|
|
539
|
+
*
|
|
540
|
+
* @throws `MountayaElementsError` where the function throws, with what it threw as the `cause`,
|
|
541
|
+
* and where it answers neither a string nor `undefined`.
|
|
542
|
+
*/
|
|
543
|
+
const sessionTokenFrom = (read: () => string | undefined): string | undefined => {
|
|
544
|
+
let answer: unknown;
|
|
545
|
+
try {
|
|
546
|
+
answer = read();
|
|
547
|
+
} catch (cause) {
|
|
548
|
+
throw new MountayaElementsError(
|
|
549
|
+
`createTransformRequest: sessionToken threw ${thrownAs(cause)}, while a claimed request read it. Return the current token, or undefined while there is none.`,
|
|
550
|
+
{ cause },
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
if (answer === undefined) {
|
|
555
|
+
return answer;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
if (typeof answer !== "string") {
|
|
559
|
+
throw new MountayaElementsError(
|
|
560
|
+
`createTransformRequest: sessionToken answered ${answer === null ? "null" : `a value of type ${typeof answer}`}; return the current token as a string, or undefined while there is none.`,
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// Held to the checks a token written as a string meets when the transform is built.
|
|
565
|
+
const refusal = headerValueRefusal("sessionToken", answer);
|
|
566
|
+
if (refusal !== undefined) {
|
|
567
|
+
throw new MountayaElementsError(
|
|
568
|
+
`createTransformRequest: the sessionToken a claimed request read ${refusal}; return the token your server minted, or undefined while there is none.`,
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
return answer;
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* attachmentFor resolves a credential into the headers and cookie flag it carries, beside the
|
|
577
|
+
* header that names the SDK, which every claimed request carries whatever its credential.
|
|
578
|
+
*
|
|
579
|
+
* A share token replaces the API key rather than accompanying it: the API, sent both, reads the
|
|
580
|
+
* key and ignores the token, so those two are an either/or and the token is the one sent. The
|
|
581
|
+
* cookie is not part of that exclusivity and rides alongside either; see MapCredential.cookie
|
|
582
|
+
* for why that matters.
|
|
583
|
+
*
|
|
584
|
+
* A session token held as a function is called here, and only where it is sent: beside a
|
|
585
|
+
* publishable key, with no share token to replace the pair.
|
|
586
|
+
*/
|
|
587
|
+
const attachmentFor = (credential: MapCredential, language?: string): Attachment => {
|
|
588
|
+
const headers: Record<string, string> = { "X-Mountaya-Client": CLIENT_HEADER_VALUE };
|
|
589
|
+
|
|
590
|
+
if (credential.shareToken !== undefined) {
|
|
591
|
+
headers["X-Share-Token"] = credential.shareToken;
|
|
592
|
+
} else if (credential.publishableKey !== undefined) {
|
|
593
|
+
headers["X-API-Key"] = credential.publishableKey;
|
|
594
|
+
|
|
595
|
+
const sessionToken =
|
|
596
|
+
typeof credential.sessionToken === "function"
|
|
597
|
+
? sessionTokenFrom(credential.sessionToken)
|
|
598
|
+
: credential.sessionToken;
|
|
599
|
+
if (sessionToken !== undefined) {
|
|
600
|
+
headers["X-Session-Token"] = sessionToken;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
if (language !== undefined) {
|
|
605
|
+
headers["Accept-Language"] = language;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
return { headers, withCookie: credential.cookie === true };
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* attachmentReaderFor returns what a credential attaches, as a reader a claimed request calls.
|
|
613
|
+
*
|
|
614
|
+
* A credential whose session token is a function is resolved on every call, so each request
|
|
615
|
+
* carries the token current when MapLibre asks for it. Any other credential cannot change
|
|
616
|
+
* between two requests, so it is resolved once, here, and every call hands back that answer.
|
|
617
|
+
*/
|
|
618
|
+
const attachmentReaderFor = (credential: MapCredential, language?: string): (() => Attachment) => {
|
|
619
|
+
if (typeof credential.sessionToken === "function") {
|
|
620
|
+
return () => attachmentFor(credential, language);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
const attachment = attachmentFor(credential, language);
|
|
624
|
+
|
|
625
|
+
return () => attachment;
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* OMIT_COOKIES is `credentials: "omit"`, under the type MapLibre gives the member.
|
|
630
|
+
*
|
|
631
|
+
* MapLibre hands the member to `fetch` as it receives it and types only the two values that
|
|
632
|
+
* send cookies somewhere. The third is asserted here, once: stating it in
|
|
633
|
+
* {@link TransformedRequest} would refuse the transform wherever a consumer hands it to MapLibre.
|
|
634
|
+
*/
|
|
635
|
+
const OMIT_COOKIES = "omit" as string as "same-origin" | "include";
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* apply merges an attachment onto a claimed request: its headers, and whether the page's cookies
|
|
639
|
+
* ride.
|
|
640
|
+
*
|
|
641
|
+
* A header the chained transform already set wins: it is the more specific statement, and
|
|
642
|
+
* an application that set `Accept-Language` per request meant it.
|
|
643
|
+
*
|
|
644
|
+
* The request always states a header beyond `accept`, the one that names the SDK, and that is
|
|
645
|
+
* what keeps a raster tile on `fetch`. MapLibre loads one through an image element when a map is
|
|
646
|
+
* built with `refreshExpiredTiles: false` and the request states no header beyond `accept`. An
|
|
647
|
+
* image element reads no `credentials`, and a request to the page's own origin then carries the
|
|
648
|
+
* page's cookies whatever the transform stated.
|
|
649
|
+
*
|
|
650
|
+
* Whether the cookies ride is the credential's to say, and what the chained transform stated is
|
|
651
|
+
* replaced: the cookie flag sends them, and without it they stay off the request, the page's own
|
|
652
|
+
* origin included. A session the cookie carries outranks a key, so a chained `"include"` beside
|
|
653
|
+
* a key would change who the request is made as.
|
|
654
|
+
*/
|
|
655
|
+
const apply = (base: TransformedRequest, attachment: Attachment): TransformedRequest => {
|
|
656
|
+
// A header's name is read without regard to case, so a name the chained transform states in
|
|
657
|
+
// another case is the same header: the attachment's entry leaves, where two keys would reach
|
|
658
|
+
// fetch as one header of two joined values.
|
|
659
|
+
const stated = new Set(Object.keys(base.headers ?? {}).map((name) => name.toLowerCase()));
|
|
660
|
+
const attached = Object.fromEntries(
|
|
661
|
+
Object.entries(attachment.headers).filter(([name]) => !stated.has(name.toLowerCase())),
|
|
662
|
+
);
|
|
663
|
+
|
|
664
|
+
return {
|
|
665
|
+
...base,
|
|
666
|
+
credentials: attachment.withCookie ? "include" : OMIT_COOKIES,
|
|
667
|
+
headers: { ...attached, ...base.headers },
|
|
668
|
+
};
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* createTransformRequest builds the function to hand MapLibre.
|
|
673
|
+
*
|
|
674
|
+
* ```ts
|
|
675
|
+
* const map = new maplibregl.Map({
|
|
676
|
+
* container,
|
|
677
|
+
* transformRequest: createTransformRequest({ publishableKey: "pk_…" }),
|
|
678
|
+
* });
|
|
679
|
+
* ```
|
|
680
|
+
*
|
|
681
|
+
* **The credential goes only to Mountaya origins.** That check is the whole security
|
|
682
|
+
* posture of this function, not a nicety. `transformRequest` is called for *every* request
|
|
683
|
+
* MapLibre makes (basemap tiles, fonts and sprites from third parties included), so a
|
|
684
|
+
* transform that attached the header unconditionally would hand a publishable key to every
|
|
685
|
+
* other host in the style. Keys are scoped and rate-limited rather than secret, but they
|
|
686
|
+
* are still yours, and a leaked one is counted against your organization's agreement.
|
|
687
|
+
*
|
|
688
|
+
* **A session token held as a function is read per request.** The transform calls it for each
|
|
689
|
+
* request it claims, for the default credential and the scoped one alike, so one transform
|
|
690
|
+
* follows a token that rotates for the map's whole life:
|
|
691
|
+
*
|
|
692
|
+
* ```ts
|
|
693
|
+
* createTransformRequest({ publishableKey: "pk_…", sessionToken: () => session.token });
|
|
694
|
+
* ```
|
|
695
|
+
*
|
|
696
|
+
* **The page's cookies ride only under the cookie flag.** Every request the transform claims
|
|
697
|
+
* states its `credentials`: `"include"` under `cookie`, and `"omit"` otherwise, so a key or a
|
|
698
|
+
* share token sent to the page's own origin is never joined by the page's session. What a
|
|
699
|
+
* transform chained through `next` stated stands on the requests this one does not claim.
|
|
700
|
+
*
|
|
701
|
+
* **A relative request leaves for the address its claim was read against.** It is resolved as
|
|
702
|
+
* the browser resolves it, and one the transform claims is handed on as that absolute URL.
|
|
703
|
+
*
|
|
704
|
+
* **Every claimed request names the SDK**, as `X-Mountaya-Client: mountaya-typescript/<version>`
|
|
705
|
+
* beside the credential, and under no credential as well; a request the transform does not
|
|
706
|
+
* claim carries nothing of it. That header is also what keeps a raster tile on `fetch`. MapLibre
|
|
707
|
+
* loads one through an image element when the map is built with `refreshExpiredTiles: false` and
|
|
708
|
+
* the request states no header beyond `accept`, and an image element sends the page's cookies to
|
|
709
|
+
* the page's own origin whatever `credentials` says.
|
|
710
|
+
*
|
|
711
|
+
* **A credential that cannot be sent is refused before any request.** A key or a token that is
|
|
712
|
+
* empty or whitespace alone, holds a character no request header carries, or does not start with
|
|
713
|
+
* its prefix (`pk_`, `sess_`, `share_`) is refused as the client refuses it, and a secret key in
|
|
714
|
+
* the publishable key's place above all: it would ride every tile request the page makes. A
|
|
715
|
+
* session token a function answers is held to the same checks at each request it is read for.
|
|
716
|
+
*
|
|
717
|
+
* @throws `MountayaElementsError` from the call itself, for an entry of `origins` or `baseUrls`
|
|
718
|
+
* or a `scoped.pathPrefix` that names no place, a key, a token or a `language` that cannot be
|
|
719
|
+
* sent, the default credential's or the scoped one's, each named and never quoted; and from
|
|
720
|
+
* the request a session token's function was read for, where that function throws (what it
|
|
721
|
+
* threw is the error's `cause`), answers neither a string nor `undefined`, or answers a token
|
|
722
|
+
* that cannot be sent.
|
|
723
|
+
*/
|
|
724
|
+
export const createTransformRequest = (options: TransformRequestOptions = {}): RequestTransform => {
|
|
725
|
+
// Every credential is held to the client's local checks before the transform exists: a map's
|
|
726
|
+
// requests never pass through the client, so this is the one place they can be.
|
|
727
|
+
assertMapCredential(options, "", "createTransformRequest");
|
|
728
|
+
if (options.scoped !== undefined) {
|
|
729
|
+
assertMapCredential(options.scoped.credential, "scoped.credential.", "createTransformRequest");
|
|
730
|
+
}
|
|
731
|
+
if (options.language !== undefined) {
|
|
732
|
+
const refusal = headerValueRefusal("language", options.language);
|
|
733
|
+
if (refusal !== undefined) {
|
|
734
|
+
throw new MountayaElementsError(
|
|
735
|
+
`createTransformRequest: language ${refusal}; pass a BCP 47 tag such as "fr", or leave it out.`,
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
// `origins` stops defaulting once `baseUrls` is given: a caller that named a base has said
|
|
741
|
+
// where its tile API is, and still sending the credential to the public host would widen the
|
|
742
|
+
// match.
|
|
743
|
+
const baseUrls = (options.baseUrls ?? []).map((entry, index) =>
|
|
744
|
+
entryPlace(`baseUrls[${index}]`, entry),
|
|
745
|
+
);
|
|
746
|
+
const origins = (options.origins ?? (baseUrls.length > 0 ? [] : DEFAULT_ORIGINS)).map(
|
|
747
|
+
(entry, index) => entryPlace(`origins[${index}]`, entry),
|
|
748
|
+
);
|
|
749
|
+
const places = [...baseUrls, ...origins];
|
|
750
|
+
|
|
751
|
+
const attachment = attachmentReaderFor(options, options.language);
|
|
752
|
+
const scoped =
|
|
753
|
+
options.scoped === undefined
|
|
754
|
+
? undefined
|
|
755
|
+
: {
|
|
756
|
+
attachment: attachmentReaderFor(options.scoped.credential, options.language),
|
|
757
|
+
path: scopedPathFrom(options.scoped.pathPrefix),
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* claimOf returns a request's path under the entry that claims it, with the absolute URL the
|
|
762
|
+
* request resolved to where it was written relative, or undefined where no entry claims it.
|
|
763
|
+
*
|
|
764
|
+
* The path is returned rather than a boolean because `scoped.pathPrefix` is a path under
|
|
765
|
+
* whichever entry claimed the request.
|
|
766
|
+
*/
|
|
767
|
+
const claimOf = (url: string): Claim | undefined => {
|
|
768
|
+
const page = pageOf();
|
|
769
|
+
const request = placeOf(url, page);
|
|
770
|
+
if (request === undefined) {
|
|
771
|
+
return undefined;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
// `null` on either side is the page's own origin. Where there is no page, two relative
|
|
775
|
+
// places still share it, and no absolute one does. On a page every request is read as an
|
|
776
|
+
// absolute place, so an entry for an origin the page cannot name claims nothing.
|
|
777
|
+
const own = page?.origin ?? null;
|
|
778
|
+
const entry = places.find(
|
|
779
|
+
(place) =>
|
|
780
|
+
(place.origin ?? own) === (request.origin ?? own) && isUnder(request.path, place.path),
|
|
781
|
+
);
|
|
782
|
+
|
|
783
|
+
return entry === undefined
|
|
784
|
+
? undefined
|
|
785
|
+
: { path: request.path.slice(entry.path.length), resolved: request.resolved };
|
|
786
|
+
};
|
|
787
|
+
|
|
788
|
+
return (url: string, resourceType?: string): TransformedRequest => {
|
|
789
|
+
const base = options.next?.(url, resourceType) ?? { url };
|
|
790
|
+
|
|
791
|
+
const claim = claimOf(base.url);
|
|
792
|
+
if (claim === undefined) {
|
|
793
|
+
return base;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
// Read now, for this request: a session token held as a function answers here. The request
|
|
797
|
+
// leaves for the address the claim was read against, so a relative one is handed on absolute.
|
|
798
|
+
return apply(
|
|
799
|
+
claim.resolved === undefined ? base : { ...base, url: claim.resolved },
|
|
800
|
+
scoped !== undefined && isUnder(claim.path, scoped.path) ? scoped.attachment() : attachment(),
|
|
801
|
+
);
|
|
802
|
+
};
|
|
803
|
+
};
|