@inrupt/solid-client-authn-browser 1.11.9-alpha.0 → 1.11.9-alpha.3

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 (262) hide show
  1. package/dist/index.es.js +4 -352
  2. package/dist/index.es.js.map +1 -0
  3. package/dist/index.js +12 -360
  4. package/dist/index.js.map +1 -1
  5. package/dist/solid-client-authn.bundle.js +14 -363
  6. package/dist/solid-client-authn.bundle.js.map +1 -0
  7. package/package.json +8 -5
  8. package/.eslintrc.js +0 -16
  9. package/NOTICE +0 -5
  10. package/coverage/clover.xml +0 -547
  11. package/coverage/coverage-final.json +0 -28
  12. package/coverage/lcov-report/base.css +0 -224
  13. package/coverage/lcov-report/block-navigation.js +0 -87
  14. package/coverage/lcov-report/favicon.png +0 -0
  15. package/coverage/lcov-report/index.html +0 -266
  16. package/coverage/lcov-report/prettify.css +0 -1
  17. package/coverage/lcov-report/prettify.js +0 -2
  18. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  19. package/coverage/lcov-report/sorter.js +0 -196
  20. package/coverage/lcov-report/src/ClientAuthentication.ts.html +0 -631
  21. package/coverage/lcov-report/src/Session.ts.html +0 -1435
  22. package/coverage/lcov-report/src/constant.ts.html +0 -163
  23. package/coverage/lcov-report/src/defaultSession.ts.html +0 -460
  24. package/coverage/lcov-report/src/dependencies.ts.html +0 -400
  25. package/coverage/lcov-report/src/iframe.ts.html +0 -394
  26. package/coverage/lcov-report/src/index.browser.ts.html +0 -157
  27. package/coverage/lcov-report/src/index.html +0 -206
  28. package/coverage/lcov-report/src/login/AggregateLoginHandler.ts.html +0 -226
  29. package/coverage/lcov-report/src/login/index.html +0 -116
  30. package/coverage/lcov-report/src/login/oidc/AggregateOidcHandler.ts.html +0 -226
  31. package/coverage/lcov-report/src/login/oidc/ClientRegistrar.ts.html +0 -415
  32. package/coverage/lcov-report/src/login/oidc/IssuerConfigFetcher.ts.html +0 -646
  33. package/coverage/lcov-report/src/login/oidc/OidcLoginHandler.ts.html +0 -436
  34. package/coverage/lcov-report/src/login/oidc/Redirector.ts.html +0 -229
  35. package/coverage/lcov-report/src/login/oidc/index.html +0 -176
  36. package/coverage/lcov-report/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts.html +0 -478
  37. package/coverage/lcov-report/src/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.ts.html +0 -319
  38. package/coverage/lcov-report/src/login/oidc/oidcHandlers/index.html +0 -131
  39. package/coverage/lcov-report/src/login/oidc/redirectHandler/AggregateRedirectHandler.ts.html +0 -226
  40. package/coverage/lcov-report/src/login/oidc/redirectHandler/AuthCodeRedirectHandler.ts.html +0 -667
  41. package/coverage/lcov-report/src/login/oidc/redirectHandler/ErrorOidcHandler.ts.html +0 -283
  42. package/coverage/lcov-report/src/login/oidc/redirectHandler/FallbackRedirectHandler.ts.html +0 -265
  43. package/coverage/lcov-report/src/login/oidc/redirectHandler/index.html +0 -161
  44. package/coverage/lcov-report/src/login/oidc/refresh/TokenRefresher.ts.html +0 -385
  45. package/coverage/lcov-report/src/login/oidc/refresh/index.html +0 -116
  46. package/coverage/lcov-report/src/login/webid/WebIdLoginHandler.ts.html +0 -250
  47. package/coverage/lcov-report/src/login/webid/index.html +0 -116
  48. package/coverage/lcov-report/src/logout/GeneralLogoutHandler.ts.html +0 -220
  49. package/coverage/lcov-report/src/logout/index.html +0 -116
  50. package/coverage/lcov-report/src/sessionInfo/SessionInfoManager.ts.html +0 -775
  51. package/coverage/lcov-report/src/sessionInfo/index.html +0 -116
  52. package/coverage/lcov-report/src/storage/BrowserStorage.ts.html +0 -229
  53. package/coverage/lcov-report/src/storage/StorageUtility.ts.html +0 -214
  54. package/coverage/lcov-report/src/storage/index.html +0 -131
  55. package/coverage/lcov-report/src/util/UuidGenerator.ts.html +0 -226
  56. package/coverage/lcov-report/src/util/index.html +0 -131
  57. package/coverage/lcov-report/src/util/urlPath.ts.html +0 -208
  58. package/coverage/lcov.info +0 -1001
  59. package/dist/ClientAuthentication.js +0 -64
  60. package/dist/ClientAuthentication.js.map +0 -1
  61. package/dist/Session.js +0 -165
  62. package/dist/Session.js.map +0 -1
  63. package/dist/constant.js +0 -7
  64. package/dist/constant.js.map +0 -1
  65. package/dist/defaultSession.js +0 -48
  66. package/dist/defaultSession.js.map +0 -1
  67. package/dist/dependencies.js +0 -41
  68. package/dist/dependencies.js.map +0 -1
  69. package/dist/iframe.js +0 -43
  70. package/dist/iframe.js.map +0 -1
  71. package/dist/index.browser.d.ts +0 -1
  72. package/dist/index.browser.js +0 -28
  73. package/dist/index.browser.js.map +0 -1
  74. package/dist/login/AggregateLoginHandler.js +0 -10
  75. package/dist/login/AggregateLoginHandler.js.map +0 -1
  76. package/dist/login/oidc/AggregateOidcHandler.js +0 -10
  77. package/dist/login/oidc/AggregateOidcHandler.js.map +0 -1
  78. package/dist/login/oidc/ClientRegistrar.js +0 -51
  79. package/dist/login/oidc/ClientRegistrar.js.map +0 -1
  80. package/dist/login/oidc/IssuerConfigFetcher.js +0 -124
  81. package/dist/login/oidc/IssuerConfigFetcher.js.map +0 -1
  82. package/dist/login/oidc/OidcLoginHandler.js +0 -40
  83. package/dist/login/oidc/OidcLoginHandler.js.map +0 -1
  84. package/dist/login/oidc/Redirector.js +0 -21
  85. package/dist/login/oidc/Redirector.js.map +0 -1
  86. package/dist/login/oidc/__mocks__/IOidcOptions.d.ts +0 -2
  87. package/dist/login/oidc/__mocks__/IOidcOptions.js +0 -25
  88. package/dist/login/oidc/__mocks__/IOidcOptions.js.map +0 -1
  89. package/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.js +0 -56
  90. package/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.js.map +0 -1
  91. package/dist/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.js +0 -47
  92. package/dist/login/oidc/oidcHandlers/OidcHandlerCanHandleTest.js.map +0 -1
  93. package/dist/login/oidc/redirectHandler/AggregateRedirectHandler.js +0 -10
  94. package/dist/login/oidc/redirectHandler/AggregateRedirectHandler.js.map +0 -1
  95. package/dist/login/oidc/redirectHandler/AuthCodeRedirectHandler.js +0 -92
  96. package/dist/login/oidc/redirectHandler/AuthCodeRedirectHandler.js.map +0 -1
  97. package/dist/login/oidc/redirectHandler/ErrorOidcHandler.js +0 -26
  98. package/dist/login/oidc/redirectHandler/ErrorOidcHandler.js.map +0 -1
  99. package/dist/login/oidc/redirectHandler/FallbackRedirectHandler.js +0 -20
  100. package/dist/login/oidc/redirectHandler/FallbackRedirectHandler.js.map +0 -1
  101. package/dist/login/oidc/refresh/TokenRefresher.js +0 -31
  102. package/dist/login/oidc/refresh/TokenRefresher.js.map +0 -1
  103. package/dist/login/webid/WebIdLoginHandler.js +0 -12
  104. package/dist/login/webid/WebIdLoginHandler.js.map +0 -1
  105. package/dist/logout/GeneralLogoutHandler.js +0 -15
  106. package/dist/logout/GeneralLogoutHandler.js.map +0 -1
  107. package/dist/sessionInfo/SessionInfoManager.js +0 -95
  108. package/dist/sessionInfo/SessionInfoManager.js.map +0 -1
  109. package/dist/solid-client-authn.bundle.js.LICENSE.txt +0 -17
  110. package/dist/storage/BrowserStorage.js +0 -18
  111. package/dist/storage/BrowserStorage.js.map +0 -1
  112. package/dist/storage/StorageUtility.js +0 -10
  113. package/dist/storage/StorageUtility.js.map +0 -1
  114. package/dist/util/UuidGenerator.js +0 -10
  115. package/dist/util/UuidGenerator.js.map +0 -1
  116. package/dist/util/urlPath.js +0 -11
  117. package/dist/util/urlPath.js.map +0 -1
  118. package/docs/api/Makefile +0 -76
  119. package/docs/api/README.md +0 -46
  120. package/docs/api/build/docs-assets/README.md +0 -183
  121. package/docs/api/build/docs-assets/_static/css/inrupt.css +0 -349
  122. package/docs/api/build/docs-assets/_templates/breadcrumb-navigation.html +0 -10
  123. package/docs/api/build/docs-assets/_templates/copyright.html +0 -3
  124. package/docs/api/build/docs-assets/_templates/docs-sidebar.html +0 -32
  125. package/docs/api/build/docs-assets/_templates/docs-version-selector.html +0 -21
  126. package/docs/api/build/docs-assets/_templates/jira-feedback.html +0 -21
  127. package/docs/api/build/docs-assets/_templates/layout.html +0 -34
  128. package/docs/api/build/docs-assets/_templates/matomo.html +0 -18
  129. package/docs/api/build/docs-assets/_templates/navbar-logo.html +0 -5
  130. package/docs/api/build/docs-assets/_templates/navbar-nav.html +0 -44
  131. package/docs/api/build/docs-assets/_templates/prev-next.html +0 -19
  132. package/docs/api/build/docs-assets/_templates/versioned-canonical.html +0 -8
  133. package/docs/api/build/docs-assets/themes/inrupt/theme.conf +0 -18
  134. package/docs/api/build/doctrees/classes/ConfigurationError.doctree +0 -0
  135. package/docs/api/build/doctrees/classes/InMemoryStorage.doctree +0 -0
  136. package/docs/api/build/doctrees/classes/NotImplementedError.doctree +0 -0
  137. package/docs/api/build/doctrees/classes/Session.doctree +0 -0
  138. package/docs/api/build/doctrees/environment.pickle +0 -0
  139. package/docs/api/build/doctrees/functions.doctree +0 -0
  140. package/docs/api/build/doctrees/index.doctree +0 -0
  141. package/docs/api/build/doctrees/interfaces/ILoginInputOptions.doctree +0 -0
  142. package/docs/api/build/doctrees/interfaces/ISessionInfo.doctree +0 -0
  143. package/docs/api/build/doctrees/interfaces/ISessionOptions.doctree +0 -0
  144. package/docs/api/build/doctrees/interfaces/IStorage.doctree +0 -0
  145. package/docs/api/build/html/.buildinfo +0 -4
  146. package/docs/api/build/html/_static/basic.css +0 -905
  147. package/docs/api/build/html/_static/css/blank.css +0 -2
  148. package/docs/api/build/html/_static/css/index.ff1ffe594081f20da1ef19478df9384b.css +0 -6
  149. package/docs/api/build/html/_static/css/inrupt.css +0 -349
  150. package/docs/api/build/html/_static/css/theme.css +0 -120
  151. package/docs/api/build/html/_static/doctools.js +0 -323
  152. package/docs/api/build/html/_static/documentation_options.js +0 -12
  153. package/docs/api/build/html/_static/file.png +0 -0
  154. package/docs/api/build/html/_static/jquery-3.5.1.js +0 -10872
  155. package/docs/api/build/html/_static/jquery.js +0 -2
  156. package/docs/api/build/html/_static/js/index.be7d3bbb2ef33a8344ce.js +0 -32
  157. package/docs/api/build/html/_static/language_data.js +0 -297
  158. package/docs/api/build/html/_static/minus.png +0 -0
  159. package/docs/api/build/html/_static/plus.png +0 -0
  160. package/docs/api/build/html/_static/pygments.css +0 -74
  161. package/docs/api/build/html/_static/searchtools.js +0 -529
  162. package/docs/api/build/html/_static/underscore-1.13.1.js +0 -2042
  163. package/docs/api/build/html/_static/underscore.js +0 -6
  164. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/LICENSE.txt +0 -34
  165. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/css/all.min.css +0 -5
  166. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.eot +0 -0
  167. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.svg +0 -3570
  168. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.ttf +0 -0
  169. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff +0 -0
  170. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2 +0 -0
  171. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.eot +0 -0
  172. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.svg +0 -803
  173. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.ttf +0 -0
  174. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.woff +0 -0
  175. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-regular-400.woff2 +0 -0
  176. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.eot +0 -0
  177. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.svg +0 -4938
  178. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.ttf +0 -0
  179. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff +0 -0
  180. package/docs/api/build/html/_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2 +0 -0
  181. package/docs/api/build/html/_static/webpack-macros.html +0 -25
  182. package/docs/api/build/html/classes/ConfigurationError.html +0 -726
  183. package/docs/api/build/html/classes/InMemoryStorage.html +0 -636
  184. package/docs/api/build/html/classes/NotImplementedError.html +0 -726
  185. package/docs/api/build/html/classes/Session.html +0 -2428
  186. package/docs/api/build/html/functions.html +0 -834
  187. package/docs/api/build/html/genindex.html +0 -311
  188. package/docs/api/build/html/index.html +0 -342
  189. package/docs/api/build/html/interfaces/ILoginInputOptions.html +0 -595
  190. package/docs/api/build/html/interfaces/ISessionInfo.html +0 -481
  191. package/docs/api/build/html/interfaces/ISessionOptions.html +0 -463
  192. package/docs/api/build/html/interfaces/IStorage.html +0 -531
  193. package/docs/api/build/html/objects.inv +0 -0
  194. package/docs/api/build/html/search.html +0 -340
  195. package/docs/api/build/html/searchindex.js +0 -1
  196. package/docs/api/build/source/classes/ConfigurationError.md +0 -159
  197. package/docs/api/build/source/classes/InMemoryStorage.md +0 -112
  198. package/docs/api/build/source/classes/NotImplementedError.md +0 -159
  199. package/docs/api/build/source/classes/Session.md +0 -907
  200. package/docs/api/build/source/functions.md +0 -235
  201. package/docs/api/build/source/index.rst +0 -13
  202. package/docs/api/build/source/interfaces/ILoginInputOptions.md +0 -109
  203. package/docs/api/build/source/interfaces/ISessionInfo.md +0 -63
  204. package/docs/api/build/source/interfaces/ISessionOptions.md +0 -60
  205. package/docs/api/build/source/interfaces/IStorage.md +0 -76
  206. package/docs/api/conf.py +0 -135
  207. package/docs/api/redirects.txt +0 -41
  208. package/docs/api/requirements.txt +0 -5
  209. package/docs/api/source/api/.nojekyll +0 -1
  210. package/docs/api/source/api/classes/ConfigurationError.md +0 -163
  211. package/docs/api/source/api/classes/InMemoryStorage.md +0 -112
  212. package/docs/api/source/api/classes/NotImplementedError.md +0 -163
  213. package/docs/api/source/api/classes/Session.md +0 -1426
  214. package/docs/api/source/api/index.md +0 -251
  215. package/docs/api/source/api/interfaces/ILoginInputOptions.md +0 -109
  216. package/docs/api/source/api/interfaces/ISessionInfo.md +0 -63
  217. package/docs/api/source/api/interfaces/ISessionOptions.md +0 -60
  218. package/docs/api/source/api/interfaces/IStorage.md +0 -76
  219. package/docs/api/source/functions.md +0 -3
  220. package/docs/api/source/index.rst +0 -13
  221. package/examples/demoAuthentiationMonitor/index.js +0 -34
  222. package/examples/demoAuthentiationMonitor/package-lock.json +0 -916
  223. package/examples/demoAuthentiationMonitor/package.json +0 -15
  224. package/examples/demoClientApp/.babelrc +0 -3
  225. package/examples/demoClientApp/package-lock.json +0 -11710
  226. package/examples/demoClientApp/package.json +0 -37
  227. package/examples/demoClientApp/src/DemoClientApp.js +0 -686
  228. package/examples/demoClientApp/src/index.html +0 -142
  229. package/examples/demoClientApp/src/index.js +0 -26
  230. package/examples/demoClientApp/webpack.config.js +0 -39
  231. package/examples/single/bundle/.babelrc +0 -3
  232. package/examples/single/bundle/README.md +0 -11
  233. package/examples/single/bundle/client-app-profile.ttl +0 -10
  234. package/examples/single/bundle/package-lock.json +0 -11196
  235. package/examples/single/bundle/package.json +0 -31
  236. package/examples/single/bundle/src/App.js +0 -123
  237. package/examples/single/bundle/src/index.html +0 -10
  238. package/examples/single/bundle/src/index.js +0 -26
  239. package/examples/single/bundle/webpack.config.js +0 -33
  240. package/examples/single/script/README.md +0 -11
  241. package/examples/single/script/index.html +0 -36
  242. package/examples/single/script/package-lock.json +0 -1293
  243. package/examples/single/script/package.json +0 -20
  244. package/examples/single/script/server.ts +0 -18
  245. package/jest.config.js +0 -10
  246. package/licenses.csv +0 -147
  247. package/rollup.config.js +0 -57
  248. package/sampleFlows/SolidAuthClientArchitecture.png +0 -0
  249. package/sampleFlows/authorization-code-with-pkce.png +0 -0
  250. package/sampleFlows/authorization-code-with-pkce.seqdiag +0 -46
  251. package/sampleFlows/authorization-code.png +0 -0
  252. package/sampleFlows/authorization-code.seqdiag +0 -50
  253. package/sampleFlows/client-credentials.png +0 -0
  254. package/sampleFlows/client-credentials.seqdiag +0 -38
  255. package/sampleFlows/legacy-implicit-flow.png +0 -0
  256. package/sampleFlows/legacy-implicit-flow.seqdiag +0 -43
  257. package/sampleFlows/self-signed.png +0 -0
  258. package/sampleFlows/self-signed.seqdiag +0 -49
  259. package/sampleFlows/signatory-access-control.seqdiag +0 -36
  260. package/sampleFlows/signatory-access-control.svg +0 -1
  261. package/tsconfig.eslint.json +0 -6
  262. package/tsconfig.json +0 -17
@@ -1,1426 +0,0 @@
1
- [@inrupt/solid-client-authn-browser](../index.md) / Session
2
-
3
- # Class: Session
4
-
5
- A [Session](Session.md) object represents a user's session on an application. The session holds state, as it stores information enabling acces to private resources after login for instance.
6
-
7
- ## Hierarchy
8
-
9
- - `EventEmitter`
10
-
11
- ↳ **`Session`**
12
-
13
- ## Table of contents
14
-
15
- ### Constructors
16
-
17
- - [constructor](Session.md#constructor)
18
-
19
- ### Properties
20
-
21
- - [clientAuthentication](Session.md#clientauthentication)
22
- - [info](Session.md#info)
23
- - [tmpFetchWithCookies](Session.md#tmpfetchwithcookies)
24
- - [tokenRequestInProgress](Session.md#tokenrequestinprogress)
25
- - [captureRejectionSymbol](Session.md#capturerejectionsymbol)
26
- - [captureRejections](Session.md#capturerejections)
27
- - [defaultMaxListeners](Session.md#defaultmaxlisteners)
28
- - [errorMonitor](Session.md#errormonitor)
29
-
30
- ### Methods
31
-
32
- - [addListener](Session.md#addlistener)
33
- - [emit](Session.md#emit)
34
- - [eventNames](Session.md#eventnames)
35
- - [fetch](Session.md#fetch)
36
- - [getMaxListeners](Session.md#getmaxlisteners)
37
- - [handleIncomingRedirect](Session.md#handleincomingredirect)
38
- - [listenerCount](Session.md#listenercount)
39
- - [listeners](Session.md#listeners)
40
- - [login](Session.md#login)
41
- - [logout](Session.md#logout)
42
- - [off](Session.md#off)
43
- - [on](Session.md#on)
44
- - [onError](Session.md#onerror)
45
- - [onLogin](Session.md#onlogin)
46
- - [onLogout](Session.md#onlogout)
47
- - [onSessionExpiration](Session.md#onsessionexpiration)
48
- - [onSessionRestore](Session.md#onsessionrestore)
49
- - [once](Session.md#once)
50
- - [prependListener](Session.md#prependlistener)
51
- - [prependOnceListener](Session.md#prependoncelistener)
52
- - [rawListeners](Session.md#rawlisteners)
53
- - [removeAllListeners](Session.md#removealllisteners)
54
- - [removeListener](Session.md#removelistener)
55
- - [setMaxListeners](Session.md#setmaxlisteners)
56
- - [setSessionInfo](Session.md#setsessioninfo)
57
- - [getEventListeners](Session.md#geteventlisteners)
58
- - [listenerCount](Session.md#listenercount)
59
- - [on](Session.md#on)
60
- - [once](Session.md#once)
61
- - [setMaxListeners](Session.md#setmaxlisteners)
62
-
63
- ## Constructors
64
-
65
- ### constructor
66
-
67
- • **new Session**(`sessionOptions?`, `sessionId?`)
68
-
69
- Session object constructor. Typically called as follows:
70
-
71
- ```typescript
72
- const session = new Session();
73
- ```
74
-
75
- See also [getDefaultSession](https://docs.inrupt.com/developer-tools/api/javascript/solid-client-authn-browser/functions.html#getdefaultsession).
76
-
77
- #### Parameters
78
-
79
- | Name | Type | Description |
80
- | :------ | :------ | :------ |
81
- | `sessionOptions` | `Partial`<[`ISessionOptions`](../interfaces/ISessionOptions.md)\> | The options enabling the correct instantiation of the session. Either both storages or clientAuthentication are required. For more information, see [ISessionOptions](../interfaces/ISessionOptions.md). |
82
- | `sessionId?` | `string` | A string uniquely identifying the session. |
83
-
84
- #### Overrides
85
-
86
- EventEmitter.constructor
87
-
88
- #### Defined in
89
-
90
- [browser/src/Session.ts:171](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L171)
91
-
92
- ## Properties
93
-
94
- ### clientAuthentication
95
-
96
- • `Private` **clientAuthentication**: `default`
97
-
98
- #### Defined in
99
-
100
- [browser/src/Session.ts:149](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L149)
101
-
102
- ___
103
-
104
- ### info
105
-
106
- • `Readonly` **info**: [`ISessionInfo`](../interfaces/ISessionInfo.md)
107
-
108
- Information regarding the current session.
109
-
110
- #### Defined in
111
-
112
- [browser/src/Session.ts:147](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L147)
113
-
114
- ___
115
-
116
- ### tmpFetchWithCookies
117
-
118
- • `Private` **tmpFetchWithCookies**: `boolean` = `false`
119
-
120
- #### Defined in
121
-
122
- [browser/src/Session.ts:154](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L154)
123
-
124
- ___
125
-
126
- ### tokenRequestInProgress
127
-
128
- • `Private` **tokenRequestInProgress**: `boolean` = `false`
129
-
130
- #### Defined in
131
-
132
- [browser/src/Session.ts:151](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L151)
133
-
134
- ___
135
-
136
- ### captureRejectionSymbol
137
-
138
- ▪ `Static` `Readonly` **captureRejectionSymbol**: typeof [`captureRejectionSymbol`](Session.md#capturerejectionsymbol)
139
-
140
- #### Inherited from
141
-
142
- EventEmitter.captureRejectionSymbol
143
-
144
- #### Defined in
145
-
146
- browser/node_modules/@types/node/events.d.ts:301
147
-
148
- ___
149
-
150
- ### captureRejections
151
-
152
- ▪ `Static` **captureRejections**: `boolean`
153
-
154
- Sets or gets the default captureRejection value for all emitters.
155
-
156
- #### Inherited from
157
-
158
- EventEmitter.captureRejections
159
-
160
- #### Defined in
161
-
162
- browser/node_modules/@types/node/events.d.ts:306
163
-
164
- ___
165
-
166
- ### defaultMaxListeners
167
-
168
- ▪ `Static` **defaultMaxListeners**: `number`
169
-
170
- #### Inherited from
171
-
172
- EventEmitter.defaultMaxListeners
173
-
174
- #### Defined in
175
-
176
- browser/node_modules/@types/node/events.d.ts:307
177
-
178
- ___
179
-
180
- ### errorMonitor
181
-
182
- ▪ `Static` `Readonly` **errorMonitor**: typeof [`errorMonitor`](Session.md#errormonitor)
183
-
184
- This symbol shall be used to install a listener for only monitoring `'error'`
185
- events. Listeners installed using this symbol are called before the regular
186
- `'error'` listeners are called.
187
-
188
- Installing a listener using this symbol does not change the behavior once an
189
- `'error'` event is emitted, therefore the process will still crash if no
190
- regular `'error'` listener is installed.
191
-
192
- #### Inherited from
193
-
194
- EventEmitter.errorMonitor
195
-
196
- #### Defined in
197
-
198
- browser/node_modules/@types/node/events.d.ts:300
199
-
200
- ## Methods
201
-
202
- ### addListener
203
-
204
- ▸ **addListener**(`eventName`, `listener`): [`Session`](Session.md)
205
-
206
- Alias for `emitter.on(eventName, listener)`.
207
-
208
- **`since`** v0.1.26
209
-
210
- #### Parameters
211
-
212
- | Name | Type |
213
- | :------ | :------ |
214
- | `eventName` | `string` \| `symbol` |
215
- | `listener` | (...`args`: `any`[]) => `void` |
216
-
217
- #### Returns
218
-
219
- [`Session`](Session.md)
220
-
221
- #### Inherited from
222
-
223
- EventEmitter.addListener
224
-
225
- #### Defined in
226
-
227
- browser/node_modules/@types/node/events.d.ts:327
228
-
229
- ___
230
-
231
- ### emit
232
-
233
- ▸ **emit**(`eventName`, ...`args`): `boolean`
234
-
235
- Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments
236
- to each.
237
-
238
- Returns `true` if the event had listeners, `false` otherwise.
239
-
240
- ```js
241
- const EventEmitter = require('events');
242
- const myEmitter = new EventEmitter();
243
-
244
- // First listener
245
- myEmitter.on('event', function firstListener() {
246
- console.log('Helloooo! first listener');
247
- });
248
- // Second listener
249
- myEmitter.on('event', function secondListener(arg1, arg2) {
250
- console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
251
- });
252
- // Third listener
253
- myEmitter.on('event', function thirdListener(...args) {
254
- const parameters = args.join(', ');
255
- console.log(`event with parameters ${parameters} in third listener`);
256
- });
257
-
258
- console.log(myEmitter.listeners('event'));
259
-
260
- myEmitter.emit('event', 1, 2, 3, 4, 5);
261
-
262
- // Prints:
263
- // [
264
- // [Function: firstListener],
265
- // [Function: secondListener],
266
- // [Function: thirdListener]
267
- // ]
268
- // Helloooo! first listener
269
- // event with parameters 1, 2 in second listener
270
- // event with parameters 1, 2, 3, 4, 5 in third listener
271
- ```
272
-
273
- **`since`** v0.1.26
274
-
275
- #### Parameters
276
-
277
- | Name | Type |
278
- | :------ | :------ |
279
- | `eventName` | `string` \| `symbol` |
280
- | `...args` | `any`[] |
281
-
282
- #### Returns
283
-
284
- `boolean`
285
-
286
- #### Inherited from
287
-
288
- EventEmitter.emit
289
-
290
- #### Defined in
291
-
292
- browser/node_modules/@types/node/events.d.ts:583
293
-
294
- ___
295
-
296
- ### eventNames
297
-
298
- ▸ **eventNames**(): (`string` \| `symbol`)[]
299
-
300
- Returns an array listing the events for which the emitter has registered
301
- listeners. The values in the array are strings or `Symbol`s.
302
-
303
- ```js
304
- const EventEmitter = require('events');
305
- const myEE = new EventEmitter();
306
- myEE.on('foo', () => {});
307
- myEE.on('bar', () => {});
308
-
309
- const sym = Symbol('symbol');
310
- myEE.on(sym, () => {});
311
-
312
- console.log(myEE.eventNames());
313
- // Prints: [ 'foo', 'bar', Symbol(symbol) ]
314
- ```
315
-
316
- **`since`** v6.0.0
317
-
318
- #### Returns
319
-
320
- (`string` \| `symbol`)[]
321
-
322
- #### Inherited from
323
-
324
- EventEmitter.eventNames
325
-
326
- #### Defined in
327
-
328
- browser/node_modules/@types/node/events.d.ts:642
329
-
330
- ___
331
-
332
- ### fetch
333
-
334
- ▸ **fetch**(`url`, `init?`): `Promise`<`Response`\>
335
-
336
- Fetches data using available login information. If the user is not logged in, this will behave as a regular `fetch`. The signature of this method is identical to the [canonical `fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).
337
-
338
- #### Parameters
339
-
340
- | Name | Type | Description |
341
- | :------ | :------ | :------ |
342
- | `url` | `RequestInfo` | The URL from which data should be fetched. |
343
- | `init?` | `RequestInit` | Optional parameters customizing the request, by specifying an HTTP method, headers, a body, etc. Follows the [WHATWG Fetch Standard](https://fetch.spec.whatwg.org/). |
344
-
345
- #### Returns
346
-
347
- `Promise`<`Response`\>
348
-
349
- #### Defined in
350
-
351
- [browser/src/Session.ts:263](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L263)
352
-
353
- ___
354
-
355
- ### getMaxListeners
356
-
357
- ▸ **getMaxListeners**(): `number`
358
-
359
- Returns the current max listener value for the `EventEmitter` which is either
360
- set by `emitter.setMaxListeners(n)` or defaults to [defaultMaxListeners](Session.md#defaultmaxlisteners).
361
-
362
- **`since`** v1.0.0
363
-
364
- #### Returns
365
-
366
- `number`
367
-
368
- #### Inherited from
369
-
370
- EventEmitter.getMaxListeners
371
-
372
- #### Defined in
373
-
374
- browser/node_modules/@types/node/events.d.ts:499
375
-
376
- ___
377
-
378
- ### handleIncomingRedirect
379
-
380
- ▸ **handleIncomingRedirect**(`inputOptions?`): `Promise`<`undefined` \| [`ISessionInfo`](../interfaces/ISessionInfo.md)\>
381
-
382
- Completes the login process by processing the information provided by the
383
- Solid identity provider through redirect.
384
-
385
- #### Parameters
386
-
387
- | Name | Type |
388
- | :------ | :------ |
389
- | `inputOptions` | `string` \| `IHandleIncomingRedirectOptions` |
390
-
391
- #### Returns
392
-
393
- `Promise`<`undefined` \| [`ISessionInfo`](../interfaces/ISessionInfo.md)\>
394
-
395
- #### Defined in
396
-
397
- [browser/src/Session.ts:290](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L290)
398
-
399
- ___
400
-
401
- ### listenerCount
402
-
403
- ▸ **listenerCount**(`eventName`): `number`
404
-
405
- Returns the number of listeners listening to the event named `eventName`.
406
-
407
- **`since`** v3.2.0
408
-
409
- #### Parameters
410
-
411
- | Name | Type | Description |
412
- | :------ | :------ | :------ |
413
- | `eventName` | `string` \| `symbol` | The name of the event being listened for |
414
-
415
- #### Returns
416
-
417
- `number`
418
-
419
- #### Inherited from
420
-
421
- EventEmitter.listenerCount
422
-
423
- #### Defined in
424
-
425
- browser/node_modules/@types/node/events.d.ts:589
426
-
427
- ___
428
-
429
- ### listeners
430
-
431
- ▸ **listeners**(`eventName`): `Function`[]
432
-
433
- Returns a copy of the array of listeners for the event named `eventName`.
434
-
435
- ```js
436
- server.on('connection', (stream) => {
437
- console.log('someone connected!');
438
- });
439
- console.log(util.inspect(server.listeners('connection')));
440
- // Prints: [ [Function] ]
441
- ```
442
-
443
- **`since`** v0.1.26
444
-
445
- #### Parameters
446
-
447
- | Name | Type |
448
- | :------ | :------ |
449
- | `eventName` | `string` \| `symbol` |
450
-
451
- #### Returns
452
-
453
- `Function`[]
454
-
455
- #### Inherited from
456
-
457
- EventEmitter.listeners
458
-
459
- #### Defined in
460
-
461
- browser/node_modules/@types/node/events.d.ts:512
462
-
463
- ___
464
-
465
- ### login
466
-
467
- ▸ **login**(`options`): `Promise`<`void`\>
468
-
469
- Triggers the login process. Note that this method will redirect the user away from your app.
470
-
471
- #### Parameters
472
-
473
- | Name | Type | Description |
474
- | :------ | :------ | :------ |
475
- | `options` | [`ILoginInputOptions`](../interfaces/ILoginInputOptions.md) | Parameter to customize the login behaviour. In particular, two options are mandatory: `options.oidcIssuer`, the user's identity provider, and `options.redirectUrl`, the URL to which the user will be redirected after logging in their identity provider. |
476
-
477
- #### Returns
478
-
479
- `Promise`<`void`\>
480
-
481
- This method should redirect the user away from the app: it does not return anything. The login process is completed by [`handleIncomingRedirect`](Session.md#handleincomingredirect).
482
-
483
- #### Defined in
484
-
485
- [browser/src/Session.ts:240](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L240)
486
-
487
- ___
488
-
489
- ### logout
490
-
491
- ▸ **logout**(): `Promise`<`void`\>
492
-
493
- Logs the user out of the application. This does not log the user out of their Solid identity provider, and should not redirect the user away.
494
-
495
- #### Returns
496
-
497
- `Promise`<`void`\>
498
-
499
- #### Defined in
500
-
501
- [browser/src/Session.ts:277](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L277)
502
-
503
- ___
504
-
505
- ### off
506
-
507
- ▸ **off**(`eventName`, `listener`): [`Session`](Session.md)
508
-
509
- Alias for `emitter.removeListener()`.
510
-
511
- **`since`** v10.0.0
512
-
513
- #### Parameters
514
-
515
- | Name | Type |
516
- | :------ | :------ |
517
- | `eventName` | `string` \| `symbol` |
518
- | `listener` | (...`args`: `any`[]) => `void` |
519
-
520
- #### Returns
521
-
522
- [`Session`](Session.md)
523
-
524
- #### Inherited from
525
-
526
- EventEmitter.off
527
-
528
- #### Defined in
529
-
530
- browser/node_modules/@types/node/events.d.ts:472
531
-
532
- ___
533
-
534
- ### on
535
-
536
- ▸ **on**(`eventName`, `listener`): [`Session`](Session.md)
537
-
538
- Adds the `listener` function to the end of the listeners array for the
539
- event named `eventName`. No checks are made to see if the `listener` has
540
- already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple
541
- times.
542
-
543
- ```js
544
- server.on('connection', (stream) => {
545
- console.log('someone connected!');
546
- });
547
- ```
548
-
549
- Returns a reference to the `EventEmitter`, so that calls can be chained.
550
-
551
- By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the
552
- event listener to the beginning of the listeners array.
553
-
554
- ```js
555
- const myEE = new EventEmitter();
556
- myEE.on('foo', () => console.log('a'));
557
- myEE.prependListener('foo', () => console.log('b'));
558
- myEE.emit('foo');
559
- // Prints:
560
- // b
561
- // a
562
- ```
563
-
564
- **`since`** v0.1.101
565
-
566
- #### Parameters
567
-
568
- | Name | Type | Description |
569
- | :------ | :------ | :------ |
570
- | `eventName` | `string` \| `symbol` | The name of the event. |
571
- | `listener` | (...`args`: `any`[]) => `void` | The callback function |
572
-
573
- #### Returns
574
-
575
- [`Session`](Session.md)
576
-
577
- #### Inherited from
578
-
579
- EventEmitter.on
580
-
581
- #### Defined in
582
-
583
- browser/node_modules/@types/node/events.d.ts:358
584
-
585
- ___
586
-
587
- ### onError
588
-
589
- ▸ **onError**(`callback`): `void`
590
-
591
- Register a callback function to be called when a user logs out:
592
-
593
- **`since`** 1.11.0
594
-
595
- #### Parameters
596
-
597
- | Name | Type | Description |
598
- | :------ | :------ | :------ |
599
- | `callback` | (`error`: ``null`` \| `string`, `errorDescription?`: ``null`` \| `string`) => `unknown` | The function called when an error occurs. |
600
-
601
- #### Returns
602
-
603
- `void`
604
-
605
- #### Defined in
606
-
607
- [browser/src/Session.ts:463](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L463)
608
-
609
- ___
610
-
611
- ### onLogin
612
-
613
- ▸ **onLogin**(`callback`): `void`
614
-
615
- Register a callback function to be called when a user completes login.
616
-
617
- The callback is called when [handleIncomingRedirect](Session.md#handleincomingredirect) completes successfully.
618
-
619
- #### Parameters
620
-
621
- | Name | Type | Description |
622
- | :------ | :------ | :------ |
623
- | `callback` | () => `unknown` | The function called when a user completes login. |
624
-
625
- #### Returns
626
-
627
- `void`
628
-
629
- #### Defined in
630
-
631
- [browser/src/Session.ts:444](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L444)
632
-
633
- ___
634
-
635
- ### onLogout
636
-
637
- ▸ **onLogout**(`callback`): `void`
638
-
639
- Register a callback function to be called when a user logs out:
640
-
641
- #### Parameters
642
-
643
- | Name | Type | Description |
644
- | :------ | :------ | :------ |
645
- | `callback` | () => `unknown` | The function called when a user completes logout. |
646
-
647
- #### Returns
648
-
649
- `void`
650
-
651
- #### Defined in
652
-
653
- [browser/src/Session.ts:453](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L453)
654
-
655
- ___
656
-
657
- ### onSessionExpiration
658
-
659
- ▸ **onSessionExpiration**(`callback`): `void`
660
-
661
- Register a callback that runs when the session expires and can no longer
662
- make authenticated requests, but following a user logout.
663
-
664
- **`since`** 1.11.0
665
-
666
- #### Parameters
667
-
668
- | Name | Type | Description |
669
- | :------ | :------ | :------ |
670
- | `callback` | () => `unknown` | The function that runs on session expiration. |
671
-
672
- #### Returns
673
-
674
- `void`
675
-
676
- #### Defined in
677
-
678
- [browser/src/Session.ts:490](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L490)
679
-
680
- ___
681
-
682
- ### onSessionRestore
683
-
684
- ▸ **onSessionRestore**(`callback`): `void`
685
-
686
- Register a callback function to be called when a session is restored.
687
-
688
- Note: the callback will be called with the saved value of the 'current URL'
689
- at the time the session was restored.
690
-
691
- #### Parameters
692
-
693
- | Name | Type | Description |
694
- | :------ | :------ | :------ |
695
- | `callback` | (`currentUrl`: `string`) => `unknown` | The function called when a user's already logged-in session is restored, e.g., after a silent authentication is completed after a page refresh. |
696
-
697
- #### Returns
698
-
699
- `void`
700
-
701
- #### Defined in
702
-
703
- [browser/src/Session.ts:480](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L480)
704
-
705
- ___
706
-
707
- ### once
708
-
709
- ▸ **once**(`eventName`, `listener`): [`Session`](Session.md)
710
-
711
- Adds a **one-time**`listener` function for the event named `eventName`. The
712
- next time `eventName` is triggered, this listener is removed and then invoked.
713
-
714
- ```js
715
- server.once('connection', (stream) => {
716
- console.log('Ah, we have our first user!');
717
- });
718
- ```
719
-
720
- Returns a reference to the `EventEmitter`, so that calls can be chained.
721
-
722
- By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the
723
- event listener to the beginning of the listeners array.
724
-
725
- ```js
726
- const myEE = new EventEmitter();
727
- myEE.once('foo', () => console.log('a'));
728
- myEE.prependOnceListener('foo', () => console.log('b'));
729
- myEE.emit('foo');
730
- // Prints:
731
- // b
732
- // a
733
- ```
734
-
735
- **`since`** v0.3.0
736
-
737
- #### Parameters
738
-
739
- | Name | Type | Description |
740
- | :------ | :------ | :------ |
741
- | `eventName` | `string` \| `symbol` | The name of the event. |
742
- | `listener` | (...`args`: `any`[]) => `void` | The callback function |
743
-
744
- #### Returns
745
-
746
- [`Session`](Session.md)
747
-
748
- #### Inherited from
749
-
750
- EventEmitter.once
751
-
752
- #### Defined in
753
-
754
- browser/node_modules/@types/node/events.d.ts:387
755
-
756
- ___
757
-
758
- ### prependListener
759
-
760
- ▸ **prependListener**(`eventName`, `listener`): [`Session`](Session.md)
761
-
762
- Adds the `listener` function to the _beginning_ of the listeners array for the
763
- event named `eventName`. No checks are made to see if the `listener` has
764
- already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple
765
- times.
766
-
767
- ```js
768
- server.prependListener('connection', (stream) => {
769
- console.log('someone connected!');
770
- });
771
- ```
772
-
773
- Returns a reference to the `EventEmitter`, so that calls can be chained.
774
-
775
- **`since`** v6.0.0
776
-
777
- #### Parameters
778
-
779
- | Name | Type | Description |
780
- | :------ | :------ | :------ |
781
- | `eventName` | `string` \| `symbol` | The name of the event. |
782
- | `listener` | (...`args`: `any`[]) => `void` | The callback function |
783
-
784
- #### Returns
785
-
786
- [`Session`](Session.md)
787
-
788
- #### Inherited from
789
-
790
- EventEmitter.prependListener
791
-
792
- #### Defined in
793
-
794
- browser/node_modules/@types/node/events.d.ts:607
795
-
796
- ___
797
-
798
- ### prependOnceListener
799
-
800
- ▸ **prependOnceListener**(`eventName`, `listener`): [`Session`](Session.md)
801
-
802
- Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
803
- listener is removed, and then invoked.
804
-
805
- ```js
806
- server.prependOnceListener('connection', (stream) => {
807
- console.log('Ah, we have our first user!');
808
- });
809
- ```
810
-
811
- Returns a reference to the `EventEmitter`, so that calls can be chained.
812
-
813
- **`since`** v6.0.0
814
-
815
- #### Parameters
816
-
817
- | Name | Type | Description |
818
- | :------ | :------ | :------ |
819
- | `eventName` | `string` \| `symbol` | The name of the event. |
820
- | `listener` | (...`args`: `any`[]) => `void` | The callback function |
821
-
822
- #### Returns
823
-
824
- [`Session`](Session.md)
825
-
826
- #### Inherited from
827
-
828
- EventEmitter.prependOnceListener
829
-
830
- #### Defined in
831
-
832
- browser/node_modules/@types/node/events.d.ts:623
833
-
834
- ___
835
-
836
- ### rawListeners
837
-
838
- ▸ **rawListeners**(`eventName`): `Function`[]
839
-
840
- Returns a copy of the array of listeners for the event named `eventName`,
841
- including any wrappers (such as those created by `.once()`).
842
-
843
- ```js
844
- const emitter = new EventEmitter();
845
- emitter.once('log', () => console.log('log once'));
846
-
847
- // Returns a new Array with a function `onceWrapper` which has a property
848
- // `listener` which contains the original listener bound above
849
- const listeners = emitter.rawListeners('log');
850
- const logFnWrapper = listeners[0];
851
-
852
- // Logs "log once" to the console and does not unbind the `once` event
853
- logFnWrapper.listener();
854
-
855
- // Logs "log once" to the console and removes the listener
856
- logFnWrapper();
857
-
858
- emitter.on('log', () => console.log('log persistently'));
859
- // Will return a new Array with a single function bound by `.on()` above
860
- const newListeners = emitter.rawListeners('log');
861
-
862
- // Logs "log persistently" twice
863
- newListeners[0]();
864
- emitter.emit('log');
865
- ```
866
-
867
- **`since`** v9.4.0
868
-
869
- #### Parameters
870
-
871
- | Name | Type |
872
- | :------ | :------ |
873
- | `eventName` | `string` \| `symbol` |
874
-
875
- #### Returns
876
-
877
- `Function`[]
878
-
879
- #### Inherited from
880
-
881
- EventEmitter.rawListeners
882
-
883
- #### Defined in
884
-
885
- browser/node_modules/@types/node/events.d.ts:542
886
-
887
- ___
888
-
889
- ### removeAllListeners
890
-
891
- ▸ **removeAllListeners**(`event?`): [`Session`](Session.md)
892
-
893
- Removes all listeners, or those of the specified `eventName`.
894
-
895
- It is bad practice to remove listeners added elsewhere in the code,
896
- particularly when the `EventEmitter` instance was created by some other
897
- component or module (e.g. sockets or file streams).
898
-
899
- Returns a reference to the `EventEmitter`, so that calls can be chained.
900
-
901
- **`since`** v0.1.26
902
-
903
- #### Parameters
904
-
905
- | Name | Type |
906
- | :------ | :------ |
907
- | `event?` | `string` \| `symbol` |
908
-
909
- #### Returns
910
-
911
- [`Session`](Session.md)
912
-
913
- #### Inherited from
914
-
915
- EventEmitter.removeAllListeners
916
-
917
- #### Defined in
918
-
919
- browser/node_modules/@types/node/events.d.ts:483
920
-
921
- ___
922
-
923
- ### removeListener
924
-
925
- ▸ **removeListener**(`eventName`, `listener`): [`Session`](Session.md)
926
-
927
- Removes the specified `listener` from the listener array for the event named`eventName`.
928
-
929
- ```js
930
- const callback = (stream) => {
931
- console.log('someone connected!');
932
- };
933
- server.on('connection', callback);
934
- // ...
935
- server.removeListener('connection', callback);
936
- ```
937
-
938
- `removeListener()` will remove, at most, one instance of a listener from the
939
- listener array. If any single listener has been added multiple times to the
940
- listener array for the specified `eventName`, then `removeListener()` must be
941
- called multiple times to remove each instance.
942
-
943
- Once an event is emitted, all listeners attached to it at the
944
- time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
945
- not remove them from`emit()` in progress. Subsequent events behave as expected.
946
-
947
- ```js
948
- const myEmitter = new MyEmitter();
949
-
950
- const callbackA = () => {
951
- console.log('A');
952
- myEmitter.removeListener('event', callbackB);
953
- };
954
-
955
- const callbackB = () => {
956
- console.log('B');
957
- };
958
-
959
- myEmitter.on('event', callbackA);
960
-
961
- myEmitter.on('event', callbackB);
962
-
963
- // callbackA removes listener callbackB but it will still be called.
964
- // Internal listener array at time of emit [callbackA, callbackB]
965
- myEmitter.emit('event');
966
- // Prints:
967
- // A
968
- // B
969
-
970
- // callbackB is now removed.
971
- // Internal listener array [callbackA]
972
- myEmitter.emit('event');
973
- // Prints:
974
- // A
975
- ```
976
-
977
- Because listeners are managed using an internal array, calling this will
978
- change the position indices of any listener registered _after_ the listener
979
- being removed. This will not impact the order in which listeners are called,
980
- but it means that any copies of the listener array as returned by
981
- the `emitter.listeners()` method will need to be recreated.
982
-
983
- When a single function has been added as a handler multiple times for a single
984
- event (as in the example below), `removeListener()` will remove the most
985
- recently added instance. In the example the `once('ping')`listener is removed:
986
-
987
- ```js
988
- const ee = new EventEmitter();
989
-
990
- function pong() {
991
- console.log('pong');
992
- }
993
-
994
- ee.on('ping', pong);
995
- ee.once('ping', pong);
996
- ee.removeListener('ping', pong);
997
-
998
- ee.emit('ping');
999
- ee.emit('ping');
1000
- ```
1001
-
1002
- Returns a reference to the `EventEmitter`, so that calls can be chained.
1003
-
1004
- **`since`** v0.1.26
1005
-
1006
- #### Parameters
1007
-
1008
- | Name | Type |
1009
- | :------ | :------ |
1010
- | `eventName` | `string` \| `symbol` |
1011
- | `listener` | (...`args`: `any`[]) => `void` |
1012
-
1013
- #### Returns
1014
-
1015
- [`Session`](Session.md)
1016
-
1017
- #### Inherited from
1018
-
1019
- EventEmitter.removeListener
1020
-
1021
- #### Defined in
1022
-
1023
- browser/node_modules/@types/node/events.d.ts:467
1024
-
1025
- ___
1026
-
1027
- ### setMaxListeners
1028
-
1029
- ▸ **setMaxListeners**(`n`): [`Session`](Session.md)
1030
-
1031
- By default `EventEmitter`s will print a warning if more than `10` listeners are
1032
- added for a particular event. This is a useful default that helps finding
1033
- memory leaks. The `emitter.setMaxListeners()` method allows the limit to be
1034
- modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
1035
-
1036
- Returns a reference to the `EventEmitter`, so that calls can be chained.
1037
-
1038
- **`since`** v0.3.5
1039
-
1040
- #### Parameters
1041
-
1042
- | Name | Type |
1043
- | :------ | :------ |
1044
- | `n` | `number` |
1045
-
1046
- #### Returns
1047
-
1048
- [`Session`](Session.md)
1049
-
1050
- #### Inherited from
1051
-
1052
- EventEmitter.setMaxListeners
1053
-
1054
- #### Defined in
1055
-
1056
- browser/node_modules/@types/node/events.d.ts:493
1057
-
1058
- ___
1059
-
1060
- ### setSessionInfo
1061
-
1062
- ▸ `Private` **setSessionInfo**(`sessionInfo`): `void`
1063
-
1064
- #### Parameters
1065
-
1066
- | Name | Type |
1067
- | :------ | :------ |
1068
- | `sessionInfo` | [`ISessionInfo`](../interfaces/ISessionInfo.md) & { `isLoggedIn`: ``true`` } |
1069
-
1070
- #### Returns
1071
-
1072
- `void`
1073
-
1074
- #### Defined in
1075
-
1076
- [browser/src/Session.ts:494](https://github.com/inrupt/solid-client-authn-js/blob/9b3ed957/packages/browser/src/Session.ts#L494)
1077
-
1078
- ___
1079
-
1080
- ### getEventListeners
1081
-
1082
- ▸ `Static` **getEventListeners**(`emitter`, `name`): `Function`[]
1083
-
1084
- Returns a copy of the array of listeners for the event named `eventName`.
1085
-
1086
- For `EventEmitter`s this behaves exactly the same as calling `.listeners` on
1087
- the emitter.
1088
-
1089
- For `EventTarget`s this is the only way to get the event listeners for the
1090
- event target. This is useful for debugging and diagnostic purposes.
1091
-
1092
- ```js
1093
- const { getEventListeners, EventEmitter } = require('events');
1094
-
1095
- {
1096
- const ee = new EventEmitter();
1097
- const listener = () => console.log('Events are fun');
1098
- ee.on('foo', listener);
1099
- getEventListeners(ee, 'foo'); // [listener]
1100
- }
1101
- {
1102
- const et = new EventTarget();
1103
- const listener = () => console.log('Events are fun');
1104
- et.addEventListener('foo', listener);
1105
- getEventListeners(et, 'foo'); // [listener]
1106
- }
1107
- ```
1108
-
1109
- **`since`** v15.2.0, v14.17.0
1110
-
1111
- #### Parameters
1112
-
1113
- | Name | Type |
1114
- | :------ | :------ |
1115
- | `emitter` | `DOMEventTarget` \| `EventEmitter` |
1116
- | `name` | `string` \| `symbol` |
1117
-
1118
- #### Returns
1119
-
1120
- `Function`[]
1121
-
1122
- #### Inherited from
1123
-
1124
- EventEmitter.getEventListeners
1125
-
1126
- #### Defined in
1127
-
1128
- browser/node_modules/@types/node/events.d.ts:270
1129
-
1130
- ___
1131
-
1132
- ### listenerCount
1133
-
1134
- ▸ `Static` **listenerCount**(`emitter`, `eventName`): `number`
1135
-
1136
- A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
1137
-
1138
- ```js
1139
- const { EventEmitter, listenerCount } = require('events');
1140
- const myEmitter = new EventEmitter();
1141
- myEmitter.on('event', () => {});
1142
- myEmitter.on('event', () => {});
1143
- console.log(listenerCount(myEmitter, 'event'));
1144
- // Prints: 2
1145
- ```
1146
-
1147
- **`since`** v0.9.12
1148
-
1149
- **`deprecated`** Since v3.2.0 - Use `listenerCount` instead.
1150
-
1151
- #### Parameters
1152
-
1153
- | Name | Type | Description |
1154
- | :------ | :------ | :------ |
1155
- | `emitter` | `EventEmitter` | The emitter to query |
1156
- | `eventName` | `string` \| `symbol` | The event name |
1157
-
1158
- #### Returns
1159
-
1160
- `number`
1161
-
1162
- #### Inherited from
1163
-
1164
- EventEmitter.listenerCount
1165
-
1166
- #### Defined in
1167
-
1168
- browser/node_modules/@types/node/events.d.ts:242
1169
-
1170
- ___
1171
-
1172
- ### on
1173
-
1174
- ▸ `Static` **on**(`emitter`, `eventName`, `options?`): `AsyncIterableIterator`<`any`\>
1175
-
1176
- ```js
1177
- const { on, EventEmitter } = require('events');
1178
-
1179
- (async () => {
1180
- const ee = new EventEmitter();
1181
-
1182
- // Emit later on
1183
- process.nextTick(() => {
1184
- ee.emit('foo', 'bar');
1185
- ee.emit('foo', 42);
1186
- });
1187
-
1188
- for await (const event of on(ee, 'foo')) {
1189
- // The execution of this inner block is synchronous and it
1190
- // processes one event at a time (even with await). Do not use
1191
- // if concurrent execution is required.
1192
- console.log(event); // prints ['bar'] [42]
1193
- }
1194
- // Unreachable here
1195
- })();
1196
- ```
1197
-
1198
- Returns an `AsyncIterator` that iterates `eventName` events. It will throw
1199
- if the `EventEmitter` emits `'error'`. It removes all listeners when
1200
- exiting the loop. The `value` returned by each iteration is an array
1201
- composed of the emitted event arguments.
1202
-
1203
- An `AbortSignal` can be used to cancel waiting on events:
1204
-
1205
- ```js
1206
- const { on, EventEmitter } = require('events');
1207
- const ac = new AbortController();
1208
-
1209
- (async () => {
1210
- const ee = new EventEmitter();
1211
-
1212
- // Emit later on
1213
- process.nextTick(() => {
1214
- ee.emit('foo', 'bar');
1215
- ee.emit('foo', 42);
1216
- });
1217
-
1218
- for await (const event of on(ee, 'foo', { signal: ac.signal })) {
1219
- // The execution of this inner block is synchronous and it
1220
- // processes one event at a time (even with await). Do not use
1221
- // if concurrent execution is required.
1222
- console.log(event); // prints ['bar'] [42]
1223
- }
1224
- // Unreachable here
1225
- })();
1226
-
1227
- process.nextTick(() => ac.abort());
1228
- ```
1229
-
1230
- **`since`** v13.6.0, v12.16.0
1231
-
1232
- #### Parameters
1233
-
1234
- | Name | Type | Description |
1235
- | :------ | :------ | :------ |
1236
- | `emitter` | `EventEmitter` | - |
1237
- | `eventName` | `string` | The name of the event being listened for |
1238
- | `options?` | `StaticEventEmitterOptions` | - |
1239
-
1240
- #### Returns
1241
-
1242
- `AsyncIterableIterator`<`any`\>
1243
-
1244
- that iterates `eventName` events emitted by the `emitter`
1245
-
1246
- #### Inherited from
1247
-
1248
- EventEmitter.on
1249
-
1250
- #### Defined in
1251
-
1252
- browser/node_modules/@types/node/events.d.ts:221
1253
-
1254
- ___
1255
-
1256
- ### once
1257
-
1258
- ▸ `Static` **once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\>
1259
-
1260
- Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given
1261
- event or that is rejected if the `EventEmitter` emits `'error'` while waiting.
1262
- The `Promise` will resolve with an array of all the arguments emitted to the
1263
- given event.
1264
-
1265
- This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event
1266
- semantics and does not listen to the `'error'` event.
1267
-
1268
- ```js
1269
- const { once, EventEmitter } = require('events');
1270
-
1271
- async function run() {
1272
- const ee = new EventEmitter();
1273
-
1274
- process.nextTick(() => {
1275
- ee.emit('myevent', 42);
1276
- });
1277
-
1278
- const [value] = await once(ee, 'myevent');
1279
- console.log(value);
1280
-
1281
- const err = new Error('kaboom');
1282
- process.nextTick(() => {
1283
- ee.emit('error', err);
1284
- });
1285
-
1286
- try {
1287
- await once(ee, 'myevent');
1288
- } catch (err) {
1289
- console.log('error happened', err);
1290
- }
1291
- }
1292
-
1293
- run();
1294
- ```
1295
-
1296
- The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the
1297
- '`error'` event itself, then it is treated as any other kind of event without
1298
- special handling:
1299
-
1300
- ```js
1301
- const { EventEmitter, once } = require('events');
1302
-
1303
- const ee = new EventEmitter();
1304
-
1305
- once(ee, 'error')
1306
- .then(([err]) => console.log('ok', err.message))
1307
- .catch((err) => console.log('error', err.message));
1308
-
1309
- ee.emit('error', new Error('boom'));
1310
-
1311
- // Prints: ok boom
1312
- ```
1313
-
1314
- An `AbortSignal` can be used to cancel waiting for the event:
1315
-
1316
- ```js
1317
- const { EventEmitter, once } = require('events');
1318
-
1319
- const ee = new EventEmitter();
1320
- const ac = new AbortController();
1321
-
1322
- async function foo(emitter, event, signal) {
1323
- try {
1324
- await once(emitter, event, { signal });
1325
- console.log('event emitted!');
1326
- } catch (error) {
1327
- if (error.name === 'AbortError') {
1328
- console.error('Waiting for the event was canceled!');
1329
- } else {
1330
- console.error('There was an error', error.message);
1331
- }
1332
- }
1333
- }
1334
-
1335
- foo(ee, 'foo', ac.signal);
1336
- ac.abort(); // Abort waiting for the event
1337
- ee.emit('foo'); // Prints: Waiting for the event was canceled!
1338
- ```
1339
-
1340
- **`since`** v11.13.0, v10.16.0
1341
-
1342
- #### Parameters
1343
-
1344
- | Name | Type |
1345
- | :------ | :------ |
1346
- | `emitter` | `NodeEventTarget` |
1347
- | `eventName` | `string` \| `symbol` |
1348
- | `options?` | `StaticEventEmitterOptions` |
1349
-
1350
- #### Returns
1351
-
1352
- `Promise`<`any`[]\>
1353
-
1354
- #### Inherited from
1355
-
1356
- EventEmitter.once
1357
-
1358
- #### Defined in
1359
-
1360
- browser/node_modules/@types/node/events.d.ts:157
1361
-
1362
- ▸ `Static` **once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\>
1363
-
1364
- #### Parameters
1365
-
1366
- | Name | Type |
1367
- | :------ | :------ |
1368
- | `emitter` | `DOMEventTarget` |
1369
- | `eventName` | `string` |
1370
- | `options?` | `StaticEventEmitterOptions` |
1371
-
1372
- #### Returns
1373
-
1374
- `Promise`<`any`[]\>
1375
-
1376
- #### Inherited from
1377
-
1378
- EventEmitter.once
1379
-
1380
- #### Defined in
1381
-
1382
- browser/node_modules/@types/node/events.d.ts:162
1383
-
1384
- ___
1385
-
1386
- ### setMaxListeners
1387
-
1388
- ▸ `Static` **setMaxListeners**(`n?`, ...`eventTargets`): `void`
1389
-
1390
- By default `EventEmitter`s will print a warning if more than `10` listeners are
1391
- added for a particular event. This is a useful default that helps finding
1392
- memory leaks. The `EventEmitter.setMaxListeners()` method allows the default limit to be
1393
- modified (if eventTargets is empty) or modify the limit specified in every `EventTarget` | `EventEmitter` passed as arguments.
1394
- The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
1395
-
1396
- ```js
1397
- EventEmitter.setMaxListeners(20);
1398
- // Equivalent to
1399
- EventEmitter.defaultMaxListeners = 20;
1400
-
1401
- const eventTarget = new EventTarget();
1402
- // Only way to increase limit for `EventTarget` instances
1403
- // as these doesn't expose its own `setMaxListeners` method
1404
- EventEmitter.setMaxListeners(20, eventTarget);
1405
- ```
1406
-
1407
- **`since`** v15.3.0, v14.17.0
1408
-
1409
- #### Parameters
1410
-
1411
- | Name | Type |
1412
- | :------ | :------ |
1413
- | `n?` | `number` |
1414
- | `...eventTargets` | (`DOMEventTarget` \| `EventEmitter`)[] |
1415
-
1416
- #### Returns
1417
-
1418
- `void`
1419
-
1420
- #### Inherited from
1421
-
1422
- EventEmitter.setMaxListeners
1423
-
1424
- #### Defined in
1425
-
1426
- browser/node_modules/@types/node/events.d.ts:290