wcz-test 6.23.2 → 6.24.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.
Files changed (300) hide show
  1. package/dist/_virtual/___vite-browser-external.js +7 -0
  2. package/dist/_virtual/___vite-browser-external.js.map +1 -0
  3. package/dist/_virtual/__vite-browser-external.js +5 -0
  4. package/dist/_virtual/__vite-browser-external.js.map +1 -0
  5. package/dist/_virtual/_commonjsHelpers.js +37 -0
  6. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  7. package/dist/_virtual/index.js +8 -0
  8. package/dist/_virtual/index.js.map +1 -0
  9. package/dist/_virtual/index2.js +5 -0
  10. package/dist/_virtual/index2.js.map +1 -0
  11. package/dist/_virtual/index3.js +5 -0
  12. package/dist/_virtual/index3.js.map +1 -0
  13. package/dist/_virtual/index4.js +5 -0
  14. package/dist/_virtual/index4.js.map +1 -0
  15. package/dist/_virtual/index5.js +5 -0
  16. package/dist/_virtual/index5.js.map +1 -0
  17. package/dist/_virtual/index6.js +5 -0
  18. package/dist/_virtual/index6.js.map +1 -0
  19. package/dist/_virtual/re.js +5 -0
  20. package/dist/_virtual/re.js.map +1 -0
  21. package/dist/components/core/AppTitle.js +1 -1
  22. package/dist/components/core/AppTitle.js.map +1 -1
  23. package/dist/components/core/Fullscreen.js +2 -2
  24. package/dist/components/core/Fullscreen.js.map +1 -1
  25. package/dist/components/core/Layout.js +7 -8
  26. package/dist/components/core/Layout.js.map +1 -1
  27. package/dist/components/core/ToolbarAccount.js +123 -143
  28. package/dist/components/core/ToolbarAccount.js.map +1 -1
  29. package/dist/components/core/TypographyWithIcon.js +2 -2
  30. package/dist/components/core/TypographyWithIcon.js.map +1 -1
  31. package/dist/components/core/navigation/NavigationList.js +2 -2
  32. package/dist/components/core/navigation/NavigationList.js.map +1 -1
  33. package/dist/components/core/navigation/NavigationListItem.js +6 -6
  34. package/dist/components/core/navigation/NavigationListItem.js.map +1 -1
  35. package/dist/components/data-grid/EditableColumnHeader.js +1 -1
  36. package/dist/components/data-grid/EditableColumnHeader.js.map +1 -1
  37. package/dist/components/file/Dropzone.js +2 -2
  38. package/dist/components/file/Dropzone.js.map +1 -1
  39. package/dist/components/file/FileViewer.js +2 -2
  40. package/dist/components/file/FileViewer.js.map +1 -1
  41. package/dist/components/file/fileViewer/FileViewerGrid.js +1 -1
  42. package/dist/components/file/fileViewer/FileViewerGrid.js.map +1 -1
  43. package/dist/components/router/RouterError.js +2 -2
  44. package/dist/components/router/RouterError.js.map +1 -1
  45. package/dist/components/router/RouterNotFound.js +2 -2
  46. package/dist/components/router/RouterNotFound.js.map +1 -1
  47. package/dist/env.d.ts +5 -2
  48. package/dist/env.js +11 -7
  49. package/dist/env.js.map +1 -1
  50. package/dist/exports/hooks.d.ts +0 -1
  51. package/dist/exports/index.d.ts +1 -0
  52. package/dist/exports/models.d.ts +1 -0
  53. package/dist/exports/queries.d.ts +1 -1
  54. package/dist/exports/server.d.ts +3 -0
  55. package/dist/hooks.js +0 -2
  56. package/dist/hooks.js.map +1 -1
  57. package/dist/index.js +2 -0
  58. package/dist/index.js.map +1 -1
  59. package/dist/lib/auth/api.d.ts +3 -0
  60. package/dist/lib/auth/api.js +97 -0
  61. package/dist/lib/auth/api.js.map +1 -0
  62. package/dist/lib/auth/entra.d.ts +2 -0
  63. package/dist/lib/auth/entra.js +13 -0
  64. package/dist/lib/auth/entra.js.map +1 -0
  65. package/dist/lib/auth/graph.d.ts +17 -0
  66. package/dist/lib/auth/graph.js +72 -0
  67. package/dist/lib/auth/graph.js.map +1 -0
  68. package/dist/lib/auth/session.d.ts +24 -0
  69. package/dist/lib/auth/session.js +76 -0
  70. package/dist/lib/auth/session.js.map +1 -0
  71. package/dist/lib/queryClient.d.ts +2 -0
  72. package/dist/lib/queryClient.js +6 -0
  73. package/dist/lib/queryClient.js.map +1 -0
  74. package/dist/lib/utils.js.map +1 -1
  75. package/dist/middleware/auth.d.ts +13 -4
  76. package/dist/models/User.d.ts +8 -3
  77. package/dist/models/User.js +18 -0
  78. package/dist/models/User.js.map +1 -0
  79. package/dist/node_modules/@oslojs/binary/dist/bits.js +7 -0
  80. package/dist/node_modules/@oslojs/binary/dist/bits.js.map +1 -0
  81. package/dist/node_modules/@oslojs/binary/dist/uint.js +80 -0
  82. package/dist/node_modules/@oslojs/binary/dist/uint.js.map +1 -0
  83. package/dist/node_modules/@oslojs/crypto/dist/sha2/sha256.js +182 -0
  84. package/dist/node_modules/@oslojs/crypto/dist/sha2/sha256.js.map +1 -0
  85. package/dist/node_modules/@oslojs/crypto/dist/sha2/sha512.js +83 -0
  86. package/dist/node_modules/@oslojs/crypto/dist/sha2/sha512.js.map +1 -0
  87. package/dist/node_modules/@oslojs/encoding/dist/base32.js +11 -0
  88. package/dist/node_modules/@oslojs/encoding/dist/base32.js.map +1 -0
  89. package/dist/node_modules/@oslojs/encoding/dist/base64.js +46 -0
  90. package/dist/node_modules/@oslojs/encoding/dist/base64.js.map +1 -0
  91. package/dist/node_modules/@oslojs/jwt/dist/index.js +28 -0
  92. package/dist/node_modules/@oslojs/jwt/dist/index.js.map +1 -0
  93. package/dist/node_modules/@oslojs/jwt/node_modules/@oslojs/encoding/dist/base32.js +11 -0
  94. package/dist/node_modules/@oslojs/jwt/node_modules/@oslojs/encoding/dist/base32.js.map +1 -0
  95. package/dist/node_modules/@oslojs/jwt/node_modules/@oslojs/encoding/dist/base64.js +126 -0
  96. package/dist/node_modules/@oslojs/jwt/node_modules/@oslojs/encoding/dist/base64.js.map +1 -0
  97. package/dist/node_modules/arctic/dist/client.js +12 -0
  98. package/dist/node_modules/arctic/dist/client.js.map +1 -0
  99. package/dist/node_modules/arctic/dist/oauth2.js +76 -0
  100. package/dist/node_modules/arctic/dist/oauth2.js.map +1 -0
  101. package/dist/node_modules/arctic/dist/oidc.js +14 -0
  102. package/dist/node_modules/arctic/dist/oidc.js.map +1 -0
  103. package/dist/node_modules/arctic/dist/providers/microsoft-entra-id.js +73 -0
  104. package/dist/node_modules/arctic/dist/providers/microsoft-entra-id.js.map +1 -0
  105. package/dist/node_modules/arctic/dist/request.js +149 -0
  106. package/dist/node_modules/arctic/dist/request.js.map +1 -0
  107. package/dist/node_modules/arctic/dist/utils.js +25 -0
  108. package/dist/node_modules/arctic/dist/utils.js.map +1 -0
  109. package/dist/node_modules/base64-js/index.js +103 -0
  110. package/dist/node_modules/base64-js/index.js.map +1 -0
  111. package/dist/node_modules/buffer/index.js +1598 -0
  112. package/dist/node_modules/buffer/index.js.map +1 -0
  113. package/dist/node_modules/buffer-equal-constant-time/index.js +39 -0
  114. package/dist/node_modules/buffer-equal-constant-time/index.js.map +1 -0
  115. package/dist/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js +140 -0
  116. package/dist/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js.map +1 -0
  117. package/dist/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js +28 -0
  118. package/dist/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js.map +1 -0
  119. package/dist/node_modules/ieee754/index.js +88 -0
  120. package/dist/node_modules/ieee754/index.js.map +1 -0
  121. package/dist/node_modules/jsonwebtoken/decode.js +38 -0
  122. package/dist/node_modules/jsonwebtoken/decode.js.map +1 -0
  123. package/dist/node_modules/jsonwebtoken/index.js +25 -0
  124. package/dist/node_modules/jsonwebtoken/index.js.map +1 -0
  125. package/dist/node_modules/jsonwebtoken/lib/JsonWebTokenError.js +23 -0
  126. package/dist/node_modules/jsonwebtoken/lib/JsonWebTokenError.js.map +1 -0
  127. package/dist/node_modules/jsonwebtoken/lib/NotBeforeError.js +21 -0
  128. package/dist/node_modules/jsonwebtoken/lib/NotBeforeError.js.map +1 -0
  129. package/dist/node_modules/jsonwebtoken/lib/TokenExpiredError.js +21 -0
  130. package/dist/node_modules/jsonwebtoken/lib/TokenExpiredError.js.map +1 -0
  131. package/dist/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js +14 -0
  132. package/dist/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js.map +1 -0
  133. package/dist/node_modules/jsonwebtoken/lib/psSupported.js +14 -0
  134. package/dist/node_modules/jsonwebtoken/lib/psSupported.js.map +1 -0
  135. package/dist/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js +14 -0
  136. package/dist/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js.map +1 -0
  137. package/dist/node_modules/jsonwebtoken/lib/timespan.js +27 -0
  138. package/dist/node_modules/jsonwebtoken/lib/timespan.js.map +1 -0
  139. package/dist/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js +60 -0
  140. package/dist/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js.map +1 -0
  141. package/dist/node_modules/jsonwebtoken/node_modules/semver/classes/comparator.js +123 -0
  142. package/dist/node_modules/jsonwebtoken/node_modules/semver/classes/comparator.js.map +1 -0
  143. package/dist/node_modules/jsonwebtoken/node_modules/semver/classes/range.js +388 -0
  144. package/dist/node_modules/jsonwebtoken/node_modules/semver/classes/range.js.map +1 -0
  145. package/dist/node_modules/jsonwebtoken/node_modules/semver/classes/semver.js +288 -0
  146. package/dist/node_modules/jsonwebtoken/node_modules/semver/classes/semver.js.map +1 -0
  147. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/clean.js +18 -0
  148. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/clean.js.map +1 -0
  149. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/cmp.js +60 -0
  150. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/cmp.js.map +1 -0
  151. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/coerce.js +53 -0
  152. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/coerce.js.map +1 -0
  153. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/compare-build.js +19 -0
  154. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/compare-build.js.map +1 -0
  155. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/compare-loose.js +15 -0
  156. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/compare-loose.js.map +1 -0
  157. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/compare.js +15 -0
  158. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/compare.js.map +1 -0
  159. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/diff.js +49 -0
  160. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/diff.js.map +1 -0
  161. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/eq.js +15 -0
  162. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/eq.js.map +1 -0
  163. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/gt.js +15 -0
  164. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/gt.js.map +1 -0
  165. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/gte.js +15 -0
  166. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/gte.js.map +1 -0
  167. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/inc.js +29 -0
  168. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/inc.js.map +1 -0
  169. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/lt.js +15 -0
  170. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/lt.js.map +1 -0
  171. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/lte.js +15 -0
  172. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/lte.js.map +1 -0
  173. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/major.js +15 -0
  174. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/major.js.map +1 -0
  175. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/minor.js +15 -0
  176. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/minor.js.map +1 -0
  177. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/neq.js +15 -0
  178. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/neq.js.map +1 -0
  179. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/parse.js +27 -0
  180. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/parse.js.map +1 -0
  181. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/patch.js +15 -0
  182. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/patch.js.map +1 -0
  183. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/prerelease.js +18 -0
  184. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/prerelease.js.map +1 -0
  185. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/rcompare.js +15 -0
  186. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/rcompare.js.map +1 -0
  187. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/rsort.js +15 -0
  188. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/rsort.js.map +1 -0
  189. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/satisfies.js +22 -0
  190. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/satisfies.js.map +1 -0
  191. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/sort.js +15 -0
  192. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/sort.js.map +1 -0
  193. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/valid.js +18 -0
  194. package/dist/node_modules/jsonwebtoken/node_modules/semver/functions/valid.js.map +1 -0
  195. package/dist/node_modules/jsonwebtoken/node_modules/semver/index.js +140 -0
  196. package/dist/node_modules/jsonwebtoken/node_modules/semver/index.js.map +1 -0
  197. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/constants.js +36 -0
  198. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/constants.js.map +1 -0
  199. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/debug.js +14 -0
  200. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/debug.js.map +1 -0
  201. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/identifiers.js +29 -0
  202. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/identifiers.js.map +1 -0
  203. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/lrucache.js +42 -0
  204. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/lrucache.js.map +1 -0
  205. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/parse-options.js +23 -0
  206. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/parse-options.js.map +1 -0
  207. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/re.js +96 -0
  208. package/dist/node_modules/jsonwebtoken/node_modules/semver/internal/re.js.map +1 -0
  209. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/gtr.js +15 -0
  210. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/gtr.js.map +1 -0
  211. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/intersects.js +19 -0
  212. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/intersects.js.map +1 -0
  213. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/ltr.js +15 -0
  214. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/ltr.js.map +1 -0
  215. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/max-satisfying.js +35 -0
  216. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/max-satisfying.js.map +1 -0
  217. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/min-satisfying.js +35 -0
  218. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/min-satisfying.js.map +1 -0
  219. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/min-version.js +66 -0
  220. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/min-version.js.map +1 -0
  221. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/outside.js +81 -0
  222. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/outside.js.map +1 -0
  223. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/simplify.js +56 -0
  224. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/simplify.js.map +1 -0
  225. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/subset.js +170 -0
  226. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/subset.js.map +1 -0
  227. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/to-comparators.js +15 -0
  228. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/to-comparators.js.map +1 -0
  229. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/valid.js +21 -0
  230. package/dist/node_modules/jsonwebtoken/node_modules/semver/ranges/valid.js.map +1 -0
  231. package/dist/node_modules/jsonwebtoken/sign.js +242 -0
  232. package/dist/node_modules/jsonwebtoken/sign.js.map +1 -0
  233. package/dist/node_modules/jsonwebtoken/verify.js +229 -0
  234. package/dist/node_modules/jsonwebtoken/verify.js.map +1 -0
  235. package/dist/node_modules/jwa/index.js +233 -0
  236. package/dist/node_modules/jwa/index.js.map +1 -0
  237. package/dist/node_modules/jws/index.js +40 -0
  238. package/dist/node_modules/jws/index.js.map +1 -0
  239. package/dist/node_modules/jws/lib/data-stream.js +55 -0
  240. package/dist/node_modules/jws/lib/data-stream.js.map +1 -0
  241. package/dist/node_modules/jws/lib/sign-stream.js +85 -0
  242. package/dist/node_modules/jws/lib/sign-stream.js.map +1 -0
  243. package/dist/node_modules/jws/lib/tostring.js +20 -0
  244. package/dist/node_modules/jws/lib/tostring.js.map +1 -0
  245. package/dist/node_modules/jws/lib/verify-stream.js +125 -0
  246. package/dist/node_modules/jws/lib/verify-stream.js.map +1 -0
  247. package/dist/node_modules/lodash.includes/index.js +181 -0
  248. package/dist/node_modules/lodash.includes/index.js.map +1 -0
  249. package/dist/node_modules/lodash.isboolean/index.js +21 -0
  250. package/dist/node_modules/lodash.isboolean/index.js.map +1 -0
  251. package/dist/node_modules/lodash.isinteger/index.js +67 -0
  252. package/dist/node_modules/lodash.isinteger/index.js.map +1 -0
  253. package/dist/node_modules/lodash.isnumber/index.js +21 -0
  254. package/dist/node_modules/lodash.isnumber/index.js.map +1 -0
  255. package/dist/node_modules/lodash.isplainobject/index.js +48 -0
  256. package/dist/node_modules/lodash.isplainobject/index.js.map +1 -0
  257. package/dist/node_modules/lodash.isstring/index.js +22 -0
  258. package/dist/node_modules/lodash.isstring/index.js.map +1 -0
  259. package/dist/node_modules/lodash.once/index.js +84 -0
  260. package/dist/node_modules/lodash.once/index.js.map +1 -0
  261. package/dist/node_modules/ms/index.js +121 -0
  262. package/dist/node_modules/ms/index.js.map +1 -0
  263. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +1 -1
  264. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -1
  265. package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +1 -1
  266. package/dist/node_modules/react/cjs/react-jsx-runtime.production.js.map +1 -1
  267. package/dist/node_modules/safe-buffer/index.js +66 -0
  268. package/dist/node_modules/safe-buffer/index.js.map +1 -0
  269. package/dist/providers/LayoutProvider.js +2 -9
  270. package/dist/providers/LayoutProvider.js.map +1 -1
  271. package/dist/queries/ApprovalHooks.d.ts +24 -1
  272. package/dist/queries/ApprovalHooks.js +114 -31
  273. package/dist/queries/ApprovalHooks.js.map +1 -1
  274. package/dist/queries/FileHooks.js +53 -26
  275. package/dist/queries/FileHooks.js.map +1 -1
  276. package/dist/queries/PeopleSoftHooks.js +68 -26
  277. package/dist/queries/PeopleSoftHooks.js.map +1 -1
  278. package/dist/queries.js +3 -9
  279. package/dist/server.js +5 -1
  280. package/dist/server.js.map +1 -1
  281. package/package.json +14 -14
  282. package/dist/contexts/UserContext.d.ts +0 -7
  283. package/dist/contexts/UserContext.js +0 -6
  284. package/dist/contexts/UserContext.js.map +0 -1
  285. package/dist/hooks/UseHook.d.ts +0 -2
  286. package/dist/hooks/UseHook.js +0 -12
  287. package/dist/hooks/UseHook.js.map +0 -1
  288. package/dist/lib/auth/client.d.ts +0 -13
  289. package/dist/lib/auth/client.js +0 -63
  290. package/dist/lib/auth/client.js.map +0 -1
  291. package/dist/lib/auth/server.d.ts +0 -9
  292. package/dist/providers/UserProvider.d.ts +0 -4
  293. package/dist/providers/UserProvider.js +0 -94
  294. package/dist/providers/UserProvider.js.map +0 -1
  295. package/dist/queries/Approval.d.ts +0 -585
  296. package/dist/queries/Approval.js +0 -91
  297. package/dist/queries/Approval.js.map +0 -1
  298. package/dist/queries/UserHooks.d.ts +0 -11
  299. package/dist/queries/UserHooks.js +0 -157
  300. package/dist/queries/UserHooks.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sources":["../../../../node_modules/arctic/dist/client.js"],"sourcesContent":["import { encodeBasicCredentials, sendTokenRevocationRequest } from \"./request.js\";\nimport { createS256CodeChallenge } from \"./oauth2.js\";\nimport { createOAuth2Request, sendTokenRequest } from \"./request.js\";\nexport class OAuth2Client {\n clientId;\n clientPassword;\n redirectURI;\n constructor(clientId, clientPassword, redirectURI) {\n this.clientId = clientId;\n this.clientPassword = clientPassword;\n this.redirectURI = redirectURI;\n }\n createAuthorizationURL(authorizationEndpoint, state, scopes) {\n const url = new URL(authorizationEndpoint);\n url.searchParams.set(\"response_type\", \"code\");\n url.searchParams.set(\"client_id\", this.clientId);\n if (this.redirectURI !== null) {\n url.searchParams.set(\"redirect_uri\", this.redirectURI);\n }\n url.searchParams.set(\"state\", state);\n if (scopes.length > 0) {\n url.searchParams.set(\"scope\", scopes.join(\" \"));\n }\n return url;\n }\n createAuthorizationURLWithPKCE(authorizationEndpoint, state, codeChallengeMethod, codeVerifier, scopes) {\n const url = new URL(authorizationEndpoint);\n url.searchParams.set(\"response_type\", \"code\");\n url.searchParams.set(\"client_id\", this.clientId);\n if (this.redirectURI !== null) {\n url.searchParams.set(\"redirect_uri\", this.redirectURI);\n }\n url.searchParams.set(\"state\", state);\n if (codeChallengeMethod === CodeChallengeMethod.S256) {\n const codeChallenge = createS256CodeChallenge(codeVerifier);\n url.searchParams.set(\"code_challenge_method\", \"S256\");\n url.searchParams.set(\"code_challenge\", codeChallenge);\n }\n else if (codeChallengeMethod === CodeChallengeMethod.Plain) {\n url.searchParams.set(\"code_challenge_method\", \"plain\");\n url.searchParams.set(\"code_challenge\", codeVerifier);\n }\n if (scopes.length > 0) {\n url.searchParams.set(\"scope\", scopes.join(\" \"));\n }\n return url;\n }\n async validateAuthorizationCode(tokenEndpoint, code, codeVerifier) {\n const body = new URLSearchParams();\n body.set(\"grant_type\", \"authorization_code\");\n body.set(\"code\", code);\n if (this.redirectURI !== null) {\n body.set(\"redirect_uri\", this.redirectURI);\n }\n if (codeVerifier !== null) {\n body.set(\"code_verifier\", codeVerifier);\n }\n if (this.clientPassword === null) {\n body.set(\"client_id\", this.clientId);\n }\n const request = createOAuth2Request(tokenEndpoint, body);\n if (this.clientPassword !== null) {\n const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientPassword);\n request.headers.set(\"Authorization\", `Basic ${encodedCredentials}`);\n }\n const tokens = await sendTokenRequest(request);\n return tokens;\n }\n async refreshAccessToken(tokenEndpoint, refreshToken, scopes) {\n const body = new URLSearchParams();\n body.set(\"grant_type\", \"refresh_token\");\n body.set(\"refresh_token\", refreshToken);\n if (this.clientPassword === null) {\n body.set(\"client_id\", this.clientId);\n }\n if (scopes.length > 0) {\n body.set(\"scope\", scopes.join(\" \"));\n }\n const request = createOAuth2Request(tokenEndpoint, body);\n if (this.clientPassword !== null) {\n const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientPassword);\n request.headers.set(\"Authorization\", `Basic ${encodedCredentials}`);\n }\n const tokens = await sendTokenRequest(request);\n return tokens;\n }\n async revokeToken(tokenRevocationEndpoint, token) {\n const body = new URLSearchParams();\n body.set(\"token\", token);\n if (this.clientPassword === null) {\n body.set(\"client_id\", this.clientId);\n }\n const request = createOAuth2Request(tokenRevocationEndpoint, body);\n if (this.clientPassword !== null) {\n const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientPassword);\n request.headers.set(\"Authorization\", `Basic ${encodedCredentials}`);\n }\n await sendTokenRevocationRequest(request);\n }\n}\nexport var CodeChallengeMethod;\n(function (CodeChallengeMethod) {\n CodeChallengeMethod[CodeChallengeMethod[\"S256\"] = 0] = \"S256\";\n CodeChallengeMethod[CodeChallengeMethod[\"Plain\"] = 1] = \"Plain\";\n})(CodeChallengeMethod || (CodeChallengeMethod = {}));\n"],"names":["CodeChallengeMethod"],"mappings":";;;AAoGU,IAAC;AAAA,CACV,SAAUA,sBAAqB;AAC5B,EAAAA,qBAAoBA,qBAAoB,MAAM,IAAI,CAAC,IAAI;AACvD,EAAAA,qBAAoBA,qBAAoB,OAAO,IAAI,CAAC,IAAI;AAC5D,GAAG,wBAAwB,sBAAsB,CAAA,EAAG;","x_google_ignoreList":[0]}
@@ -0,0 +1,76 @@
1
+ import "../../@oslojs/encoding/dist/base32.js";
2
+ import { encodeBase64urlNoPadding } from "../../@oslojs/encoding/dist/base64.js";
3
+ import { sha256 } from "../../@oslojs/crypto/dist/sha2/sha256.js";
4
+ import "../../@oslojs/crypto/dist/sha2/sha512.js";
5
+ class OAuth2Tokens {
6
+ data;
7
+ constructor(data) {
8
+ this.data = data;
9
+ }
10
+ tokenType() {
11
+ if ("token_type" in this.data && typeof this.data.token_type === "string") {
12
+ return this.data.token_type;
13
+ }
14
+ throw new Error("Missing or invalid 'token_type' field");
15
+ }
16
+ accessToken() {
17
+ if ("access_token" in this.data && typeof this.data.access_token === "string") {
18
+ return this.data.access_token;
19
+ }
20
+ throw new Error("Missing or invalid 'access_token' field");
21
+ }
22
+ accessTokenExpiresInSeconds() {
23
+ if ("expires_in" in this.data && typeof this.data.expires_in === "number") {
24
+ return this.data.expires_in;
25
+ }
26
+ throw new Error("Missing or invalid 'expires_in' field");
27
+ }
28
+ accessTokenExpiresAt() {
29
+ return new Date(Date.now() + this.accessTokenExpiresInSeconds() * 1e3);
30
+ }
31
+ hasRefreshToken() {
32
+ return "refresh_token" in this.data && typeof this.data.refresh_token === "string";
33
+ }
34
+ refreshToken() {
35
+ if ("refresh_token" in this.data && typeof this.data.refresh_token === "string") {
36
+ return this.data.refresh_token;
37
+ }
38
+ throw new Error("Missing or invalid 'refresh_token' field");
39
+ }
40
+ hasScopes() {
41
+ return "scope" in this.data && typeof this.data.scope === "string";
42
+ }
43
+ scopes() {
44
+ if ("scope" in this.data && typeof this.data.scope === "string") {
45
+ return this.data.scope.split(" ");
46
+ }
47
+ throw new Error("Missing or invalid 'scope' field");
48
+ }
49
+ idToken() {
50
+ if ("id_token" in this.data && typeof this.data.id_token === "string") {
51
+ return this.data.id_token;
52
+ }
53
+ throw new Error("Missing or invalid field 'id_token'");
54
+ }
55
+ }
56
+ function createS256CodeChallenge(codeVerifier) {
57
+ const codeChallengeBytes = sha256(new TextEncoder().encode(codeVerifier));
58
+ return encodeBase64urlNoPadding(codeChallengeBytes);
59
+ }
60
+ function generateCodeVerifier() {
61
+ const randomValues = new Uint8Array(32);
62
+ crypto.getRandomValues(randomValues);
63
+ return encodeBase64urlNoPadding(randomValues);
64
+ }
65
+ function generateState() {
66
+ const randomValues = new Uint8Array(32);
67
+ crypto.getRandomValues(randomValues);
68
+ return encodeBase64urlNoPadding(randomValues);
69
+ }
70
+ export {
71
+ OAuth2Tokens,
72
+ createS256CodeChallenge,
73
+ generateCodeVerifier,
74
+ generateState
75
+ };
76
+ //# sourceMappingURL=oauth2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth2.js","sources":["../../../../node_modules/arctic/dist/oauth2.js"],"sourcesContent":["import * as encoding from \"@oslojs/encoding\";\nimport * as sha2 from \"@oslojs/crypto/sha2\";\nexport class OAuth2Tokens {\n data;\n constructor(data) {\n this.data = data;\n }\n tokenType() {\n if (\"token_type\" in this.data && typeof this.data.token_type === \"string\") {\n return this.data.token_type;\n }\n throw new Error(\"Missing or invalid 'token_type' field\");\n }\n accessToken() {\n if (\"access_token\" in this.data && typeof this.data.access_token === \"string\") {\n return this.data.access_token;\n }\n throw new Error(\"Missing or invalid 'access_token' field\");\n }\n accessTokenExpiresInSeconds() {\n if (\"expires_in\" in this.data && typeof this.data.expires_in === \"number\") {\n return this.data.expires_in;\n }\n throw new Error(\"Missing or invalid 'expires_in' field\");\n }\n accessTokenExpiresAt() {\n return new Date(Date.now() + this.accessTokenExpiresInSeconds() * 1000);\n }\n hasRefreshToken() {\n return \"refresh_token\" in this.data && typeof this.data.refresh_token === \"string\";\n }\n refreshToken() {\n if (\"refresh_token\" in this.data && typeof this.data.refresh_token === \"string\") {\n return this.data.refresh_token;\n }\n throw new Error(\"Missing or invalid 'refresh_token' field\");\n }\n hasScopes() {\n return \"scope\" in this.data && typeof this.data.scope === \"string\";\n }\n scopes() {\n if (\"scope\" in this.data && typeof this.data.scope === \"string\") {\n return this.data.scope.split(\" \");\n }\n throw new Error(\"Missing or invalid 'scope' field\");\n }\n idToken() {\n if (\"id_token\" in this.data && typeof this.data.id_token === \"string\") {\n return this.data.id_token;\n }\n throw new Error(\"Missing or invalid field 'id_token'\");\n }\n}\nexport function createS256CodeChallenge(codeVerifier) {\n const codeChallengeBytes = sha2.sha256(new TextEncoder().encode(codeVerifier));\n return encoding.encodeBase64urlNoPadding(codeChallengeBytes);\n}\nexport function generateCodeVerifier() {\n const randomValues = new Uint8Array(32);\n crypto.getRandomValues(randomValues);\n return encoding.encodeBase64urlNoPadding(randomValues);\n}\nexport function generateState() {\n const randomValues = new Uint8Array(32);\n crypto.getRandomValues(randomValues);\n return encoding.encodeBase64urlNoPadding(randomValues);\n}\n"],"names":["sha2.sha256","encoding.encodeBase64urlNoPadding"],"mappings":";;;;AAEO,MAAM,aAAa;AAAA,EACtB;AAAA,EACA,YAAY,MAAM;AACd,SAAK,OAAO;AAAA,EAChB;AAAA,EACA,YAAY;AACR,QAAI,gBAAgB,KAAK,QAAQ,OAAO,KAAK,KAAK,eAAe,UAAU;AACvE,aAAO,KAAK,KAAK;AAAA,IACrB;AACA,UAAM,IAAI,MAAM,uCAAuC;AAAA,EAC3D;AAAA,EACA,cAAc;AACV,QAAI,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QAAM,eAAe,IAAI,WAAW,EAAE;AACtC,SAAO,gBAAgB,YAAY;AACnC,SAAOA,yBAAkC,YAAY;AACzD;AACO,SAAS,gBAAgB;AAC5B,QAAM,eAAe,IAAI,WAAW,EAAE;AACtC,SAAO,gBAAgB,YAAY;AACnC,SAAOA,yBAAkC,YAAY;AACzD;","x_google_ignoreList":[0]}
@@ -0,0 +1,14 @@
1
+ import { decodeJWT } from "../../@oslojs/jwt/dist/index.js";
2
+ function decodeIdToken(idToken) {
3
+ try {
4
+ return decodeJWT(idToken);
5
+ } catch (e) {
6
+ throw new Error("Invalid ID token", {
7
+ cause: e
8
+ });
9
+ }
10
+ }
11
+ export {
12
+ decodeIdToken
13
+ };
14
+ //# sourceMappingURL=oidc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oidc.js","sources":["../../../../node_modules/arctic/dist/oidc.js"],"sourcesContent":["import * as jwt from \"@oslojs/jwt\";\nexport function decodeIdToken(idToken) {\n try {\n return jwt.decodeJWT(idToken);\n }\n catch (e) {\n throw new Error(\"Invalid ID token\", {\n cause: e\n });\n }\n}\n"],"names":["jwt.decodeJWT"],"mappings":";AACO,SAAS,cAAc,SAAS;AACnC,MAAI;AACA,WAAOA,UAAc,OAAO;AAAA,EAChC,SACO,GAAG;AACN,UAAM,IAAI,MAAM,oBAAoB;AAAA,MAChC,OAAO;AAAA,IACnB,CAAS;AAAA,EACL;AACJ;","x_google_ignoreList":[0]}
@@ -0,0 +1,73 @@
1
+ import { createS256CodeChallenge } from "../oauth2.js";
2
+ import { joinURIAndPath, createOAuth2Request, encodeBasicCredentials, sendTokenRequest } from "../request.js";
3
+ class MicrosoftEntraId {
4
+ authorizationEndpoint;
5
+ tokenEndpoint;
6
+ clientId;
7
+ clientSecret;
8
+ redirectURI;
9
+ constructor(tenant, clientId, clientSecret, redirectURI) {
10
+ this.authorizationEndpoint = joinURIAndPath("https://login.microsoftonline.com", tenant, "/oauth2/v2.0/authorize");
11
+ this.tokenEndpoint = joinURIAndPath("https://login.microsoftonline.com", tenant, "/oauth2/v2.0/token");
12
+ this.clientId = clientId;
13
+ this.clientSecret = clientSecret;
14
+ this.redirectURI = redirectURI;
15
+ }
16
+ createAuthorizationURL(state, codeVerifier, scopes) {
17
+ const url = new URL(this.authorizationEndpoint);
18
+ url.searchParams.set("response_type", "code");
19
+ url.searchParams.set("client_id", this.clientId);
20
+ url.searchParams.set("redirect_uri", this.redirectURI);
21
+ url.searchParams.set("state", state);
22
+ const codeChallenge = createS256CodeChallenge(codeVerifier);
23
+ url.searchParams.set("code_challenge_method", "S256");
24
+ url.searchParams.set("code_challenge", codeChallenge);
25
+ if (scopes.length > 0) {
26
+ url.searchParams.set("scope", scopes.join(" "));
27
+ }
28
+ return url;
29
+ }
30
+ async validateAuthorizationCode(code, codeVerifier) {
31
+ const body = new URLSearchParams();
32
+ body.set("grant_type", "authorization_code");
33
+ body.set("code", code);
34
+ body.set("redirect_uri", this.redirectURI);
35
+ body.set("code_verifier", codeVerifier);
36
+ if (this.clientSecret === null) {
37
+ body.set("client_id", this.clientId);
38
+ }
39
+ const request = createOAuth2Request(this.tokenEndpoint, body);
40
+ if (this.clientSecret !== null) {
41
+ const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientSecret);
42
+ request.headers.set("Authorization", `Basic ${encodedCredentials}`);
43
+ } else {
44
+ request.headers.set("Origin", "arctic");
45
+ }
46
+ const tokens = await sendTokenRequest(request);
47
+ return tokens;
48
+ }
49
+ async refreshAccessToken(refreshToken, scopes) {
50
+ const body = new URLSearchParams();
51
+ body.set("grant_type", "refresh_token");
52
+ body.set("refresh_token", refreshToken);
53
+ if (this.clientSecret === null) {
54
+ body.set("client_id", this.clientId);
55
+ }
56
+ if (scopes.length > 0) {
57
+ body.set("scope", scopes.join(" "));
58
+ }
59
+ const request = createOAuth2Request(this.tokenEndpoint, body);
60
+ if (this.clientSecret !== null) {
61
+ const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientSecret);
62
+ request.headers.set("Authorization", `Basic ${encodedCredentials}`);
63
+ } else {
64
+ request.headers.set("Origin", "arctic");
65
+ }
66
+ const tokens = await sendTokenRequest(request);
67
+ return tokens;
68
+ }
69
+ }
70
+ export {
71
+ MicrosoftEntraId
72
+ };
73
+ //# sourceMappingURL=microsoft-entra-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"microsoft-entra-id.js","sources":["../../../../../node_modules/arctic/dist/providers/microsoft-entra-id.js"],"sourcesContent":["import { createS256CodeChallenge } from \"../oauth2.js\";\nimport { createOAuth2Request, encodeBasicCredentials, joinURIAndPath, sendTokenRequest } from \"../request.js\";\nexport class MicrosoftEntraId {\n authorizationEndpoint;\n tokenEndpoint;\n clientId;\n clientSecret;\n redirectURI;\n constructor(tenant, clientId, clientSecret, redirectURI) {\n this.authorizationEndpoint = joinURIAndPath(\"https://login.microsoftonline.com\", tenant, \"/oauth2/v2.0/authorize\");\n this.tokenEndpoint = joinURIAndPath(\"https://login.microsoftonline.com\", tenant, \"/oauth2/v2.0/token\");\n this.clientId = clientId;\n this.clientSecret = clientSecret;\n this.redirectURI = redirectURI;\n }\n createAuthorizationURL(state, codeVerifier, scopes) {\n const url = new URL(this.authorizationEndpoint);\n url.searchParams.set(\"response_type\", \"code\");\n url.searchParams.set(\"client_id\", this.clientId);\n url.searchParams.set(\"redirect_uri\", this.redirectURI);\n url.searchParams.set(\"state\", state);\n const codeChallenge = createS256CodeChallenge(codeVerifier);\n url.searchParams.set(\"code_challenge_method\", \"S256\");\n url.searchParams.set(\"code_challenge\", codeChallenge);\n if (scopes.length > 0) {\n url.searchParams.set(\"scope\", scopes.join(\" \"));\n }\n return url;\n }\n async validateAuthorizationCode(code, codeVerifier) {\n const body = new URLSearchParams();\n body.set(\"grant_type\", \"authorization_code\");\n body.set(\"code\", code);\n body.set(\"redirect_uri\", this.redirectURI);\n body.set(\"code_verifier\", codeVerifier);\n if (this.clientSecret === null) {\n body.set(\"client_id\", this.clientId);\n }\n const request = createOAuth2Request(this.tokenEndpoint, body);\n if (this.clientSecret !== null) {\n const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientSecret);\n request.headers.set(\"Authorization\", `Basic ${encodedCredentials}`);\n }\n else {\n // Origin header required for public clients. Value can be anything.\n request.headers.set(\"Origin\", \"arctic\");\n }\n const tokens = await sendTokenRequest(request);\n return tokens;\n }\n async refreshAccessToken(refreshToken, scopes) {\n const body = new URLSearchParams();\n body.set(\"grant_type\", \"refresh_token\");\n body.set(\"refresh_token\", refreshToken);\n if (this.clientSecret === null) {\n body.set(\"client_id\", this.clientId);\n }\n if (scopes.length > 0) {\n body.set(\"scope\", scopes.join(\" \"));\n }\n const request = createOAuth2Request(this.tokenEndpoint, body);\n if (this.clientSecret !== null) {\n const encodedCredentials = encodeBasicCredentials(this.clientId, this.clientSecret);\n request.headers.set(\"Authorization\", `Basic ${encodedCredentials}`);\n }\n else {\n // Origin header required for public clients. Value can be anything.\n request.headers.set(\"Origin\", \"arctic\");\n }\n const tokens = await sendTokenRequest(request);\n return tokens;\n }\n}\n"],"names":[],"mappings":";;AAEO,MAAM,iBAAiB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,QAAQ,UAAU,cAAc,aAAa;AACrD,SAAK,wBAAwB,eAAe,qCAAqC,QAAQ,wBAAwB;AACjH,SAAK,gBAAgB,eAAe,qCAAqC,QAAQ,oBAAoB;AACrG,SAAK,WAAW;AAChB,SAAK,eAAe;AACpB,SAAK,cAAc;AAAA,EACvB;AAAA,EACA,uBAAuB,OAAO,cAAc,QAAQ;AAChD,UAAM,MAAM,IAAI,IAAI,KAAK,qBAAqB;AAC9C,QAAI,aAAa,IAAI,iBAAiB,MAAM;AAC5C,QAAI,aAAa,IAAI,aAAa,KAAK,QAAQ;AAC/C,QAAI,aAAa,IAAI,gBAAgB,KAAK,WAAW;AACrD,QAAI,aAAa,IAAI,SAAS,KAAK;AACnC,UAAM,gBAAgB,wBAAwB,YAAY;AA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Y;AAClF,cAAQ,QAAQ,IAAI,iBAAiB,SAAS,kBAAkB,EAAE;AAAA,IACtE,OACK;AAED,cAAQ,QAAQ,IAAI,UAAU,QAAQ;AAAA,IAC1C;AACA,UAAM,SAAS,MAAM,iBAAiB,OAAO;AAC7C,WAAO;AAAA,EACX;AACJ;","x_google_ignoreList":[0]}
@@ -0,0 +1,149 @@
1
+ import "../../@oslojs/encoding/dist/base32.js";
2
+ import { encodeBase64 } from "../../@oslojs/encoding/dist/base64.js";
3
+ import { OAuth2Tokens } from "./oauth2.js";
4
+ import { trimRight, trimLeft } from "./utils.js";
5
+ function joinURIAndPath(base, ...path) {
6
+ let joined = trimRight(base, "/");
7
+ for (const part of path) {
8
+ joined = trimRight(joined, "/") + "/" + trimLeft(part, "/");
9
+ }
10
+ return joined;
11
+ }
12
+ function createOAuth2Request(endpoint, body) {
13
+ const bodyBytes = new TextEncoder().encode(body.toString());
14
+ const request = new Request(endpoint, {
15
+ method: "POST",
16
+ body: bodyBytes
17
+ });
18
+ request.headers.set("Content-Type", "application/x-www-form-urlencoded");
19
+ request.headers.set("Accept", "application/json");
20
+ request.headers.set("User-Agent", "arctic");
21
+ request.headers.set("Content-Length", bodyBytes.byteLength.toString());
22
+ return request;
23
+ }
24
+ function encodeBasicCredentials(username, password) {
25
+ const bytes = new TextEncoder().encode(`${username}:${password}`);
26
+ return encodeBase64(bytes);
27
+ }
28
+ async function sendTokenRequest(request) {
29
+ let response;
30
+ try {
31
+ response = await fetch(request);
32
+ } catch (e) {
33
+ throw new ArcticFetchError(e);
34
+ }
35
+ if (response.status === 400 || response.status === 401) {
36
+ let data;
37
+ try {
38
+ data = await response.json();
39
+ } catch {
40
+ throw new UnexpectedResponseError(response.status);
41
+ }
42
+ if (typeof data !== "object" || data === null) {
43
+ throw new UnexpectedErrorResponseBodyError(response.status, data);
44
+ }
45
+ let error;
46
+ try {
47
+ error = createOAuth2RequestError(data);
48
+ } catch {
49
+ throw new UnexpectedErrorResponseBodyError(response.status, data);
50
+ }
51
+ throw error;
52
+ }
53
+ if (response.status === 200) {
54
+ let data;
55
+ try {
56
+ data = await response.json();
57
+ } catch {
58
+ throw new UnexpectedResponseError(response.status);
59
+ }
60
+ if (typeof data !== "object" || data === null) {
61
+ throw new UnexpectedErrorResponseBodyError(response.status, data);
62
+ }
63
+ const tokens = new OAuth2Tokens(data);
64
+ return tokens;
65
+ }
66
+ if (response.body !== null) {
67
+ await response.body.cancel();
68
+ }
69
+ throw new UnexpectedResponseError(response.status);
70
+ }
71
+ function createOAuth2RequestError(result) {
72
+ let code;
73
+ if ("error" in result && typeof result.error === "string") {
74
+ code = result.error;
75
+ } else {
76
+ throw new Error("Invalid error response");
77
+ }
78
+ let description = null;
79
+ let uri = null;
80
+ let state = null;
81
+ if ("error_description" in result) {
82
+ if (typeof result.error_description !== "string") {
83
+ throw new Error("Invalid data");
84
+ }
85
+ description = result.error_description;
86
+ }
87
+ if ("error_uri" in result) {
88
+ if (typeof result.error_uri !== "string") {
89
+ throw new Error("Invalid data");
90
+ }
91
+ uri = result.error_uri;
92
+ }
93
+ if ("state" in result) {
94
+ if (typeof result.state !== "string") {
95
+ throw new Error("Invalid data");
96
+ }
97
+ state = result.state;
98
+ }
99
+ const error = new OAuth2RequestError(code, description, uri, state);
100
+ return error;
101
+ }
102
+ class ArcticFetchError extends Error {
103
+ constructor(cause) {
104
+ super("Failed to send request", {
105
+ cause
106
+ });
107
+ }
108
+ }
109
+ class OAuth2RequestError extends Error {
110
+ code;
111
+ description;
112
+ uri;
113
+ state;
114
+ constructor(code, description, uri, state) {
115
+ super(`OAuth request error: ${code}`);
116
+ this.code = code;
117
+ this.description = description;
118
+ this.uri = uri;
119
+ this.state = state;
120
+ }
121
+ }
122
+ class UnexpectedResponseError extends Error {
123
+ status;
124
+ constructor(responseStatus) {
125
+ super("Unexpected error response");
126
+ this.status = responseStatus;
127
+ }
128
+ }
129
+ class UnexpectedErrorResponseBodyError extends Error {
130
+ status;
131
+ data;
132
+ constructor(status, data) {
133
+ super("Unexpected error response body");
134
+ this.status = status;
135
+ this.data = data;
136
+ }
137
+ }
138
+ export {
139
+ ArcticFetchError,
140
+ OAuth2RequestError,
141
+ UnexpectedErrorResponseBodyError,
142
+ UnexpectedResponseError,
143
+ createOAuth2Request,
144
+ createOAuth2RequestError,
145
+ encodeBasicCredentials,
146
+ joinURIAndPath,
147
+ sendTokenRequest
148
+ };
149
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sources":["../../../../node_modules/arctic/dist/request.js"],"sourcesContent":["import * as encoding from \"@oslojs/encoding\";\nimport { OAuth2Tokens } from \"./oauth2.js\";\nimport { trimLeft, trimRight } from \"./utils.js\";\nexport function joinURIAndPath(base, ...path) {\n let joined = trimRight(base, \"/\");\n for (const part of path) {\n joined = trimRight(joined, \"/\") + \"/\" + trimLeft(part, \"/\");\n }\n return joined;\n}\nexport function createOAuth2Request(endpoint, body) {\n const bodyBytes = new TextEncoder().encode(body.toString());\n const request = new Request(endpoint, {\n method: \"POST\",\n body: bodyBytes\n });\n request.headers.set(\"Content-Type\", \"application/x-www-form-urlencoded\");\n request.headers.set(\"Accept\", \"application/json\");\n // Required by GitHub, and probably by others as well\n request.headers.set(\"User-Agent\", \"arctic\");\n // Required by Reddit\n request.headers.set(\"Content-Length\", bodyBytes.byteLength.toString());\n return request;\n}\nexport function encodeBasicCredentials(username, password) {\n const bytes = new TextEncoder().encode(`${username}:${password}`);\n return encoding.encodeBase64(bytes);\n}\nexport async function sendTokenRequest(request) {\n let response;\n try {\n response = await fetch(request);\n }\n catch (e) {\n throw new ArcticFetchError(e);\n }\n if (response.status === 400 || response.status === 401) {\n let data;\n try {\n data = await response.json();\n }\n catch {\n throw new UnexpectedResponseError(response.status);\n }\n if (typeof data !== \"object\" || data === null) {\n throw new UnexpectedErrorResponseBodyError(response.status, data);\n }\n let error;\n try {\n error = createOAuth2RequestError(data);\n }\n catch {\n throw new UnexpectedErrorResponseBodyError(response.status, data);\n }\n throw error;\n }\n if (response.status === 200) {\n let data;\n try {\n data = await response.json();\n }\n catch {\n throw new UnexpectedResponseError(response.status);\n }\n if (typeof data !== \"object\" || data === null) {\n throw new UnexpectedErrorResponseBodyError(response.status, data);\n }\n const tokens = new OAuth2Tokens(data);\n return tokens;\n }\n if (response.body !== null) {\n await response.body.cancel();\n }\n throw new UnexpectedResponseError(response.status);\n}\nexport async function sendTokenRevocationRequest(request) {\n let response;\n try {\n response = await fetch(request);\n }\n catch (e) {\n throw new ArcticFetchError(e);\n }\n if (response.status === 400 || response.status === 401) {\n let data;\n try {\n data = await response.json();\n }\n catch {\n throw new UnexpectedErrorResponseBodyError(response.status, null);\n }\n if (typeof data !== \"object\" || data === null) {\n throw new UnexpectedErrorResponseBodyError(response.status, data);\n }\n let error;\n try {\n error = createOAuth2RequestError(data);\n }\n catch {\n throw new UnexpectedErrorResponseBodyError(response.status, data);\n }\n throw error;\n }\n if (response.status === 200) {\n if (response.body !== null) {\n await response.body.cancel();\n }\n return;\n }\n if (response.body !== null) {\n await response.body.cancel();\n }\n throw new UnexpectedResponseError(response.status);\n}\nexport function createOAuth2RequestError(result) {\n let code;\n if (\"error\" in result && typeof result.error === \"string\") {\n code = result.error;\n }\n else {\n throw new Error(\"Invalid error response\");\n }\n let description = null;\n let uri = null;\n let state = null;\n if (\"error_description\" in result) {\n if (typeof result.error_description !== \"string\") {\n throw new Error(\"Invalid data\");\n }\n description = result.error_description;\n }\n if (\"error_uri\" in result) {\n if (typeof result.error_uri !== \"string\") {\n throw new Error(\"Invalid data\");\n }\n uri = result.error_uri;\n }\n if (\"state\" in result) {\n if (typeof result.state !== \"string\") {\n throw new Error(\"Invalid data\");\n }\n state = result.state;\n }\n const error = new OAuth2RequestError(code, description, uri, state);\n return error;\n}\nexport class ArcticFetchError extends Error {\n constructor(cause) {\n super(\"Failed to send request\", {\n cause\n });\n }\n}\nexport class OAuth2RequestError extends Error {\n code;\n description;\n uri;\n state;\n constructor(code, description, uri, state) {\n super(`OAuth request error: ${code}`);\n this.code = code;\n this.description = description;\n this.uri = uri;\n this.state = state;\n }\n}\nexport class UnexpectedResponseError extends Error {\n status;\n constructor(responseStatus) {\n super(\"Unexpected error response\");\n this.status = responseStatus;\n }\n}\nexport class UnexpectedErrorResponseBodyError extends Error {\n status;\n data;\n constructor(status, data) {\n super(\"Unexpected error response body\");\n this.status = status;\n this.data = data;\n }\n}\n"],"names":["encoding.encodeBase64"],"mappings":";;;;AAGO,SAAS,eAAe,SAAS,MAAM;AAC1C,MAAI,SAAS,UAAU,MAAM,GAAG;AAChC,aAAW,QAAQ,MAAM;AACrB,aAAS,UAAU,QAAQ,GAAG,IAAI,MAAM,SAAS,MAAM,GAAG;AAAA,EAC9D;AACA,SAAO;AACX;AACO,SAAS,oBAAoB,UAAU,MAAM;AAChD,QAAM,YAAY,IAAI,YAAW,EAAG,OAAO,KAAK,UAAU;AAC1D,QAAM,UAAU,IAAI,QAAQ,UAAU;AAAA,IAClC,QAAQ;AAAA,IACR,MAAM;AAAA,EACd,CAAK;AACD,UAAQ,QAAQ,IAAI,gBAAgB,mCAAmC;AACvE,UAAQ,QAAQ,IAAI,UAAU,kBAAkB;AAEhD,UAAQ,QAAQ,IAAI,cAAc,QAAQ;AAE1C,UAAQ,QAAQ,IAAI,kBAAkB,UAAU,WAAW,UAAU;AACrE,SAAO;AACX;AACO,SAAS,uBAAuB,UAAU,UAAU;AACvD,QAAM,QAAQ,IAAI,YAAW,EAAG,OAAO,GAAG,QAAQ,IAAI,QAAQ,EAAE;AAChE,SAAOA,aAAsB,KAAK;AACtC;AACO,eAAe,iBAAiB,SAAS;AAC5C,MAAI;AACJ,MAAI;AACA,eAAW,MAAM,MAAM,OAAO;AAAA,EAClC,SACO,GAAG;AACN,UAAM,IAAI,iBAAiB,CAAC;AAAA,EAChC;AACA,MAAI,SAAS,WAAW,OAAO,SAAS,WAAW,KAAK;AACpD,QAAI;AACJ,QAAI;AACA,aAAO,MAAM,SAAS,KAAI;AA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AAI,WAAW,QAAQ;AACnB,QAAI,OAAO,OAAO,UAAU,UAAU;AAClC,YAAM,IAAI,MAAM,cAAc;AAAA,IAClC;AACA,YAAQ,OAAO;AAAA,EACnB;AACA,QAAM,QAAQ,IAAI,mBAAmB,MAAM,aAAa,KAAK,KAAK;AAClE,SAAO;AACX;AACO,MAAM,yBAAyB,MAAM;AAAA,EACxC,YAAY,OAAO;AACf,UAAM,0BAA0B;AAAA,MAC5B;AAAA,IACZ,CAAS;AAAA,EACL;AACJ;AACO,MAAM,2BAA2B,MAAM;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,MAAM,aAAa,KAAK,OAAO;AACvC,UAAM,wBAAwB,IAAI,EAAE;AACpC,SAAK,OAAO;AACZ,SAAK,cAAc;AACnB,SAAK,MAAM;AACX,SAAK,QAAQ;AAAA,EACjB;AACJ;AACO,MAAM,gCAAgC,MAAM;AAAA,EAC/C;AAAA,EACA,YAAY,gBAAgB;AACxB,UAAM,2BAA2B;AACjC,SAAK,SAAS;AAAA,EAClB;AACJ;AACO,MAAM,yCAAyC,MAAM;AAAA,EACxD;AAAA,EACA;AAAA,EACA,YAAY,QAAQ,MAAM;AACtB,UAAM,gCAAgC;AACtC,SAAK,SAAS;AACd,SAAK,OAAO;AAAA,EAChB;AACJ;","x_google_ignoreList":[0]}
@@ -0,0 +1,25 @@
1
+ function trimLeft(s, character) {
2
+ if (character.length !== 1) {
3
+ throw new TypeError("Invalid character string");
4
+ }
5
+ let start = 0;
6
+ while (start < s.length && s[start] === character) {
7
+ start++;
8
+ }
9
+ return s.slice(start);
10
+ }
11
+ function trimRight(s, character) {
12
+ if (character.length !== 1) {
13
+ throw new TypeError("Invalid character string");
14
+ }
15
+ let end = s.length;
16
+ while (end > 0 && s[end - 1] === character) {
17
+ end--;
18
+ }
19
+ return s.slice(0, end);
20
+ }
21
+ export {
22
+ trimLeft,
23
+ trimRight
24
+ };
25
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../../../node_modules/arctic/dist/utils.js"],"sourcesContent":["export function trimLeft(s, character) {\n if (character.length !== 1) {\n throw new TypeError(\"Invalid character string\");\n }\n let start = 0;\n while (start < s.length && s[start] === character) {\n start++;\n }\n return s.slice(start);\n}\nexport function trimRight(s, character) {\n if (character.length !== 1) {\n throw new TypeError(\"Invalid character string\");\n }\n let end = s.length;\n while (end > 0 && s[end - 1] === character) {\n end--;\n }\n return s.slice(0, end);\n}\n"],"names":[],"mappings":"AAAO,SAAS,SAAS,GAAG,WAAW;AACnC,MAAI,UAAU,WAAW,GAAG;AACxB,UAAM,IAAI,UAAU,0BAA0B;AAAA,EAClD;AACA,MAAI,QAAQ;AACZ,SAAO,QAAQ,EAAE,UAAU,EAAE,KAAK,MAAM,WAAW;AAC/C;AAAA,EACJ;AACA,SAAO,EAAE,MAAM,KAAK;AACxB;AACO,SAAS,UAAU,GAAG,WAAW;AACpC,MAAI,UAAU,WAAW,GAAG;AACxB,UAAM,IAAI,UAAU,0BAA0B;AAAA,EAClD;AACA,MAAI,MAAM,EAAE;AACZ,SAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,WAAW;AACxC;AAAA,EACJ;AACA,SAAO,EAAE,MAAM,GAAG,GAAG;AACzB;","x_google_ignoreList":[0]}
@@ -0,0 +1,103 @@
1
+ import { __exports as base64Js } from "../../_virtual/index5.js";
2
+ var hasRequiredBase64Js;
3
+ function requireBase64Js() {
4
+ if (hasRequiredBase64Js) return base64Js;
5
+ hasRequiredBase64Js = 1;
6
+ base64Js.byteLength = byteLength;
7
+ base64Js.toByteArray = toByteArray;
8
+ base64Js.fromByteArray = fromByteArray;
9
+ var lookup = [];
10
+ var revLookup = [];
11
+ var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
12
+ var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
13
+ for (var i = 0, len = code.length; i < len; ++i) {
14
+ lookup[i] = code[i];
15
+ revLookup[code.charCodeAt(i)] = i;
16
+ }
17
+ revLookup["-".charCodeAt(0)] = 62;
18
+ revLookup["_".charCodeAt(0)] = 63;
19
+ function getLens(b64) {
20
+ var len2 = b64.length;
21
+ if (len2 % 4 > 0) {
22
+ throw new Error("Invalid string. Length must be a multiple of 4");
23
+ }
24
+ var validLen = b64.indexOf("=");
25
+ if (validLen === -1) validLen = len2;
26
+ var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;
27
+ return [validLen, placeHoldersLen];
28
+ }
29
+ function byteLength(b64) {
30
+ var lens = getLens(b64);
31
+ var validLen = lens[0];
32
+ var placeHoldersLen = lens[1];
33
+ return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
34
+ }
35
+ function _byteLength(b64, validLen, placeHoldersLen) {
36
+ return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
37
+ }
38
+ function toByteArray(b64) {
39
+ var tmp;
40
+ var lens = getLens(b64);
41
+ var validLen = lens[0];
42
+ var placeHoldersLen = lens[1];
43
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
44
+ var curByte = 0;
45
+ var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen;
46
+ var i2;
47
+ for (i2 = 0; i2 < len2; i2 += 4) {
48
+ tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)];
49
+ arr[curByte++] = tmp >> 16 & 255;
50
+ arr[curByte++] = tmp >> 8 & 255;
51
+ arr[curByte++] = tmp & 255;
52
+ }
53
+ if (placeHoldersLen === 2) {
54
+ tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4;
55
+ arr[curByte++] = tmp & 255;
56
+ }
57
+ if (placeHoldersLen === 1) {
58
+ tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2;
59
+ arr[curByte++] = tmp >> 8 & 255;
60
+ arr[curByte++] = tmp & 255;
61
+ }
62
+ return arr;
63
+ }
64
+ function tripletToBase64(num) {
65
+ return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
66
+ }
67
+ function encodeChunk(uint8, start, end) {
68
+ var tmp;
69
+ var output = [];
70
+ for (var i2 = start; i2 < end; i2 += 3) {
71
+ tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255);
72
+ output.push(tripletToBase64(tmp));
73
+ }
74
+ return output.join("");
75
+ }
76
+ function fromByteArray(uint8) {
77
+ var tmp;
78
+ var len2 = uint8.length;
79
+ var extraBytes = len2 % 3;
80
+ var parts = [];
81
+ var maxChunkLength = 16383;
82
+ for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) {
83
+ parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength));
84
+ }
85
+ if (extraBytes === 1) {
86
+ tmp = uint8[len2 - 1];
87
+ parts.push(
88
+ lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="
89
+ );
90
+ } else if (extraBytes === 2) {
91
+ tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];
92
+ parts.push(
93
+ lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="
94
+ );
95
+ }
96
+ return parts.join("");
97
+ }
98
+ return base64Js;
99
+ }
100
+ export {
101
+ requireBase64Js as __require
102
+ };
103
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../node_modules/base64-js/index.js"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\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