@amedia/user 0.14.152 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,603 @@
1
+ # @amedia/user
2
+
3
+ ## 0.14.152
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1122](https://github.com/amedia/amedia-user-js/pull/1122) [`c176ed1`](https://github.com/amedia/amedia-user-js/commit/c176ed14fbc1c8ebc485b96a8c6217511e690efe) Thanks [@emilhauk](https://github.com/emilhauk)! - Temporarily allow for non-standard domain structures like stage.site.dk and non www-sites like stage.dk
8
+
9
+ ## 0.14.151
10
+
11
+ ### Patch Changes
12
+
13
+ - [#1111](https://github.com/amedia/amedia-user-js/pull/1111) [`15337ae`](https://github.com/amedia/amedia-user-js/commit/15337ae354b5f0c11ef1f8d34ce5113eee6ee769) Thanks [@emilhauk](https://github.com/emilhauk)! - Set license and author data pending public package
14
+
15
+ ## 0.14.150
16
+
17
+ ### Patch Changes
18
+
19
+ - [#1106](https://github.com/amedia/amedia-user-js/pull/1106) [`769bd75`](https://github.com/amedia/amedia-user-js/commit/769bd7573eaa91e7d7b346461993efcb9759c6f8) Thanks [@mortenlocka](https://github.com/mortenlocka)! - Deprecate privacy preferences
20
+
21
+ ## 0.14.149
22
+
23
+ ### Patch Changes
24
+
25
+ - [#1102](https://github.com/amedia/amedia-user-js/pull/1102) [`be926be`](https://github.com/amedia/amedia-user-js/commit/be926be88ec948f16350c5092a4c280d0df23059) Thanks [@emilhauk](https://github.com/emilhauk)! - Temp selection of clientId based on domain tld
26
+
27
+ ## 0.14.148
28
+
29
+ ### Patch Changes
30
+
31
+ - [`afbc442`](https://github.com/amedia/amedia-user-js/commit/afbc44209331765a8e0eba6a85495557eba2cfc9) Thanks [@emilhauk](https://github.com/emilhauk)! - Migrate to standard of /problem/, not /problems/ in problem json types
32
+
33
+ ## 0.14.147
34
+
35
+ ### Patch Changes
36
+
37
+ - [#1084](https://github.com/amedia/amedia-user-js/pull/1084) [`a8de93a`](https://github.com/amedia/amedia-user-js/commit/a8de93a60a2d981c5e9aa88d0191805691d30330) Thanks [@emilhauk](https://github.com/emilhauk)! - Replace legacy express library for fastify (used as server for npm run dev)
38
+
39
+ - [#1084](https://github.com/amedia/amedia-user-js/pull/1084) [`a8de93a`](https://github.com/amedia/amedia-user-js/commit/a8de93a60a2d981c5e9aa88d0191805691d30330) Thanks [@emilhauk](https://github.com/emilhauk)! - Add circuit breaker, preventing broken requests for this page load
40
+
41
+ ## 0.14.146
42
+
43
+ ### Patch Changes
44
+
45
+ - [#1077](https://github.com/amedia/amedia-user-js/pull/1077) [`85e0f44`](https://github.com/amedia/amedia-user-js/commit/85e0f44054ee35e734d2f26daa982a6911048d32) Thanks [@emilhauk](https://github.com/emilhauk)! - Replace runtypes with valibot. Also tried the new zod/v4-mini, but the bundle size ended up exceeding 290KB
46
+
47
+ - [#1081](https://github.com/amedia/amedia-user-js/pull/1081) [`856f9e0`](https://github.com/amedia/amedia-user-js/commit/856f9e01a03f283f258bcdc9dbd72f7da4ba0458) Thanks [@emilhauk](https://github.com/emilhauk)! - Mute network error logging for autologin
48
+
49
+ ## 0.14.145
50
+
51
+ ### Patch Changes
52
+
53
+ - [#1070](https://github.com/amedia/amedia-user-js/pull/1070) [`54a9fbe`](https://github.com/amedia/amedia-user-js/commit/54a9fbebc368ffe5b3a02ad50a8f5369aa0276e2) Thanks [@emilhauk](https://github.com/emilhauk)! - Get current access from /aid/api/access (stop chatting with juno)
54
+
55
+ ## 0.14.144
56
+
57
+ ### Patch Changes
58
+
59
+ - [`91e59ca`](https://github.com/amedia/amedia-user-js/commit/91e59caca7b153668cb8ab4d5ef497b5232b4638) Thanks [@emilhauk](https://github.com/emilhauk)! - Expose session_tracking_key
60
+
61
+ ## 0.14.143
62
+
63
+ ### Patch Changes
64
+
65
+ - [#1056](https://github.com/amedia/amedia-user-js/pull/1056) [`8f454a4`](https://github.com/amedia/amedia-user-js/commit/8f454a4f5793e0683f67940d24173285f026e00a) Thanks [@emilhauk](https://github.com/emilhauk)! - Added pollForAccess to be used when you're waiting for expected access to be applied
66
+
67
+ ## 0.14.142
68
+
69
+ ### Patch Changes
70
+
71
+ - [#1041](https://github.com/amedia/amedia-user-js/pull/1041) [`f12f302`](https://github.com/amedia/amedia-user-js/commit/f12f302209a5fbdd5c785fff5afe1e2c1a9e13e3) Thanks [@emilhauk](https://github.com/emilhauk)! - Remove legacy storage
72
+
73
+ - [#1043](https://github.com/amedia/amedia-user-js/pull/1043) [`e55f48d`](https://github.com/amedia/amedia-user-js/commit/e55f48d83373b4c618869f699b3451897f140b89) Thanks [@mortenlocka](https://github.com/mortenlocka)! - Use storage from Eris proxy.
74
+
75
+ ## 0.14.141
76
+
77
+ ### Patch Changes
78
+
79
+ - [#1037](https://github.com/amedia/amedia-user-js/pull/1037) [`8981c30`](https://github.com/amedia/amedia-user-js/commit/8981c304b01a21bca62a73c1997210b4b203bdee) Thanks [@emilhauk](https://github.com/emilhauk)! - Get user access to other domain from UserV3 (directly from neptune)
80
+
81
+ ## 0.14.140
82
+
83
+ ### Patch Changes
84
+
85
+ - [#1034](https://github.com/amedia/amedia-user-js/pull/1034) [`ce43dca`](https://github.com/amedia/amedia-user-js/commit/ce43dcac4c9e756aaec0f2a3e3367421e9b6477a) Thanks [@emilhauk](https://github.com/emilhauk)! - Read current user access from /aid/api/users/self
86
+
87
+ ## 0.14.139
88
+
89
+ ### Patch Changes
90
+
91
+ - [#1033](https://github.com/amedia/amedia-user-js/pull/1033) [`d49c6fc`](https://github.com/amedia/amedia-user-js/commit/d49c6fcc889895e111643981e4ece5f9251a9f46) Thanks [@emilhauk](https://github.com/emilhauk)! - Stop logging FedCM failed
92
+
93
+ - [#1032](https://github.com/amedia/amedia-user-js/pull/1032) [`f368e3d`](https://github.com/amedia/amedia-user-js/commit/f368e3dfbfaf9d7e57e6cb2b48b60c4769c02f1f) Thanks [@emilhauk](https://github.com/emilhauk)! - Stop refreshing VSTOKEN-cookie
94
+
95
+ - [`3efba98`](https://github.com/amedia/amedia-user-js/commit/3efba98a095d29b77f58b374954896e354bd1d2c) Thanks [@emilhauk](https://github.com/emilhauk)! - Support reading emergency-mode from meta[name=amedia:emergency-mode]
96
+
97
+ - [#1027](https://github.com/amedia/amedia-user-js/pull/1027) [`7dfcbcc`](https://github.com/amedia/amedia-user-js/commit/7dfcbcc08bccede10e071e0e610694ef2069b783) Thanks [@emilhauk](https://github.com/emilhauk)! - Improve emergency mode handling
98
+
99
+ - [#1030](https://github.com/amedia/amedia-user-js/pull/1030) [`c0e8464`](https://github.com/amedia/amedia-user-js/commit/c0e84644404cb7d2383925b994f27684ab52f562) Thanks [@emilhauk](https://github.com/emilhauk)! - Cleanup Jupiter client
100
+
101
+ ## 0.14.138
102
+
103
+ ### Patch Changes
104
+
105
+ - [#1024](https://github.com/amedia/amedia-user-js/pull/1024) [`19767c7`](https://github.com/amedia/amedia-user-js/commit/19767c7230f5ae6f390463cbd2d46cd3f251a6c5) Thanks [@emilhauk](https://github.com/emilhauk)! - Fix timing of when to perform autologin
106
+
107
+ The previous change introduced a bug where we ended up attempting third
108
+ party cookie autologin before the check for first party login state were
109
+ completed.
110
+
111
+ ## 0.14.137
112
+
113
+ ### Patch Changes
114
+
115
+ - [#1019](https://github.com/amedia/amedia-user-js/pull/1019) [`27d985c`](https://github.com/amedia/amedia-user-js/commit/27d985c6a03e602e2bcf113c5e98d3732cc3c192) Thanks [@emilhauk](https://github.com/emilhauk)! - Prevent duplicate autologin attempts
116
+
117
+ ## 0.14.136
118
+
119
+ ### Patch Changes
120
+
121
+ - [#1014](https://github.com/amedia/amedia-user-js/pull/1014) [`13cfe28`](https://github.com/amedia/amedia-user-js/commit/13cfe28052d9c68c386226ad35bd0bd157d73d0a) Thanks [@emilhauk](https://github.com/emilhauk)! - Use /aid/api/users to reach UserV3
122
+
123
+ - [`9c9a8f9`](https://github.com/amedia/amedia-user-js/commit/9c9a8f982b461166296d1652449ab882fe8b2e6d) Thanks [@emilhauk](https://github.com/emilhauk)! - Fix: privacy policy URL
124
+
125
+ ## 0.14.135
126
+
127
+ ### Patch Changes
128
+
129
+ - [#1009](https://github.com/amedia/amedia-user-js/pull/1009) [`0407bb0`](https://github.com/amedia/amedia-user-js/commit/0407bb05d1fe79d8742fa83e5d360c7305f2b34d) Thanks [@emilhauk](https://github.com/emilhauk)! - Use UserV3 when checking if third-party-cookie is enabled
130
+
131
+ - [#1009](https://github.com/amedia/amedia-user-js/pull/1009) [`8ec4b28`](https://github.com/amedia/amedia-user-js/commit/8ec4b28da76c9ccb4c22c7e07c530e195622e4d6) Thanks [@emilhauk](https://github.com/emilhauk)! - Spring cleaning
132
+
133
+ ## 0.14.134
134
+
135
+ ### Patch Changes
136
+
137
+ - [#1008](https://github.com/amedia/amedia-user-js/pull/1008) [`77a9819`](https://github.com/amedia/amedia-user-js/commit/77a9819d6483fb2b98c2f0b0f9d3b3821bbdc883) Thanks [@hennikul](https://github.com/hennikul)! - Add nonce to FedCM Finalize so it can be verified
138
+
139
+ ## 0.14.133
140
+
141
+ ### Patch Changes
142
+
143
+ - [`bfe8fb6`](https://github.com/amedia/amedia-user-js/commit/bfe8fb62536167f2c6ecbde6e05211cbf0885933) Thanks [@emilhauk](https://github.com/emilhauk)! - Use /aid/logout for logout
144
+
145
+ ## 0.14.132
146
+
147
+ ### Patch Changes
148
+
149
+ - [#1000](https://github.com/amedia/amedia-user-js/pull/1000) [`1f798d5`](https://github.com/amedia/amedia-user-js/commit/1f798d56ac499ca0b06d7df0e06b0f1352b49ac2) Thanks [@emilhauk](https://github.com/emilhauk)! - All sites should now use /aid/login/auto for autologin
150
+
151
+ ## 0.14.131
152
+
153
+ ### Patch Changes
154
+
155
+ - [#998](https://github.com/amedia/amedia-user-js/pull/998) [`e00568c`](https://github.com/amedia/amedia-user-js/commit/e00568c22ff0593be3791376411b912e2a3c21ad) Thanks [@emilhauk](https://github.com/emilhauk)! - Some sites now use Eris for autologin. (E.g. https://www.telen.no/aid/login/auto)
156
+
157
+ - [#998](https://github.com/amedia/amedia-user-js/pull/998) [`a6ef40f`](https://github.com/amedia/amedia-user-js/commit/a6ef40fd5bb52e7fd48f2635182975d094cb70fe) Thanks [@emilhauk](https://github.com/emilhauk)! - All sites now use Eris for login (E.g. https://www.avisnavn.no/aid/login/)
158
+
159
+ ## 0.14.130
160
+
161
+ ### Patch Changes
162
+
163
+ - [#995](https://github.com/amedia/amedia-user-js/pull/995) [`1da791b`](https://github.com/amedia/amedia-user-js/commit/1da791b036b0e1d0631fd601760420e5452d65cd) Thanks [@emilhauk](https://github.com/emilhauk)! - Extend eris usage for multiple sites
164
+
165
+ ## 0.14.129
166
+
167
+ ### Patch Changes
168
+
169
+ - [`cd72ee2`](https://github.com/amedia/amedia-user-js/commit/cd72ee2a286e6fbeffaa5c42b12728f1208ca961) Thanks [@emilhauk](https://github.com/emilhauk)! - Package bump
170
+
171
+ - [#994](https://github.com/amedia/amedia-user-js/pull/994) [`4899a14`](https://github.com/amedia/amedia-user-js/commit/4899a14b4ed3bbee49e8f0e2167a24aee053489b) Thanks [@emilhauk](https://github.com/emilhauk)! - Use eris on www.tangotidende.no
172
+
173
+ ## 0.14.128
174
+
175
+ ### Patch Changes
176
+
177
+ - [`e632da9`](https://github.com/amedia/amedia-user-js/commit/e632da95ec29c6ddd67ff9647e359ddc88888bb0) Thanks [@emilhauk](https://github.com/emilhauk)! - Change backend for fedcm
178
+
179
+ ## 0.14.127
180
+
181
+ ### Patch Changes
182
+
183
+ - [#874](https://github.com/amedia/amedia-user-js/pull/874) [`d36c088`](https://github.com/amedia/amedia-user-js/commit/d36c088404fd08964a843f670207687d2a0651fd) Thanks [@emilhauk](https://github.com/emilhauk)! - Track paywall unlock attempt
184
+
185
+ - [`d5c0479`](https://github.com/amedia/amedia-user-js/commit/d5c04794c36ef51412d962e93e9d1bae61bbeb18) Thanks [@emilhauk](https://github.com/emilhauk)! - We don't need this check anymore. Found a way to avoid loading @amedia/user instead
186
+
187
+ - [#884](https://github.com/amedia/amedia-user-js/pull/884) [`65a581f`](https://github.com/amedia/amedia-user-js/commit/65a581fd908a9f7736782663c9e34715555f1eb3) Thanks [@emilhauk](https://github.com/emilhauk)! - Harden access to sessionStorage and localStorage
188
+
189
+ - [`d81016e`](https://github.com/amedia/amedia-user-js/commit/d81016e66de599606e1f33fae18a20e0c7921e9a) Thanks [@emilhauk](https://github.com/emilhauk)! - Dump dependencies
190
+
191
+ - [#874](https://github.com/amedia/amedia-user-js/pull/874) [`080cd5e`](https://github.com/amedia/amedia-user-js/commit/080cd5e1e6e4e30faa91aeb0caa35b7e7c1cb759) Thanks [@emilhauk](https://github.com/emilhauk)! - Keep track of CMP dialog open state
192
+
193
+ ## 0.14.126
194
+
195
+ ### Patch Changes
196
+
197
+ - [`f4a3e9e`](https://github.com/amedia/amedia-user-js/commit/f4a3e9e4cfb7e90646b84bdec91ce944c684d8d8) Thanks [@emilhauk](https://github.com/emilhauk)! - Exempt aid.no from FedCM (and other login recovery mechanics).
198
+
199
+ ## 0.14.125
200
+
201
+ ### Patch Changes
202
+
203
+ - [#865](https://github.com/amedia/amedia-user-js/pull/865) [`be16528`](https://github.com/amedia/amedia-user-js/commit/be165288eeb50ff337bfb8c0b91322f10e9db8f6) Thanks [@emilhauk](https://github.com/emilhauk)! - Bump packages
204
+
205
+ - [#865](https://github.com/amedia/amedia-user-js/pull/865) [`be16528`](https://github.com/amedia/amedia-user-js/commit/be165288eeb50ff337bfb8c0b91322f10e9db8f6) Thanks [@emilhauk](https://github.com/emilhauk)! - Enable FedCM for all sites
206
+
207
+ ## 0.14.124
208
+
209
+ ### Patch Changes
210
+
211
+ - [#830](https://github.com/amedia/amedia-user-js/pull/830) [`4befe31`](https://github.com/amedia/amedia-user-js/commit/4befe31724e317f919f046860d8519eee8783a40) Thanks [@emilhauk](https://github.com/emilhauk)! - Remove daxsub cookie
212
+
213
+ - [#839](https://github.com/amedia/amedia-user-js/pull/839) [`5d164fc`](https://github.com/amedia/amedia-user-js/commit/5d164fc4a304146c6248df12f987ae2d1b90948b) Thanks [@emilhauk](https://github.com/emilhauk)! - Don't include subscription activatation as a part of PaywallUnlockRequest anymore
214
+
215
+ - [#836](https://github.com/amedia/amedia-user-js/pull/836) [`f2b0ffc`](https://github.com/amedia/amedia-user-js/commit/f2b0ffc26003080b29c58254f03ecca169c4c78f) Thanks [@emilhauk](https://github.com/emilhauk)! - Fetch access and privacy_preferences from UserV3
216
+
217
+ - [`08eac13`](https://github.com/amedia/amedia-user-js/commit/08eac13843c1b20e4cf2de61a95a18894d3e7d05) Thanks [@emilhauk](https://github.com/emilhauk)! - Upgrade deepmerge to new major
218
+
219
+ - [#841](https://github.com/amedia/amedia-user-js/pull/841) [`035bad5`](https://github.com/amedia/amedia-user-js/commit/035bad5fd0db4016b290391a5bfab766b7b0a0d7) Thanks [@emilhauk](https://github.com/emilhauk)! - Shamo will handle primary site requests from now on
220
+
221
+ - [#834](https://github.com/amedia/amedia-user-js/pull/834) [`fa01508`](https://github.com/amedia/amedia-user-js/commit/fa015084c8caee2f30ceae196df9c96e3deaaec8) Thanks [@emilhauk](https://github.com/emilhauk)! - Resolve autologin before resolving login state
222
+
223
+ ## 0.14.123
224
+
225
+ ### Patch Changes
226
+
227
+ - [#827](https://github.com/amedia/amedia-user-js/pull/827) [`dd93829`](https://github.com/amedia/amedia-user-js/commit/dd93829486bc6fb13fe7de9cfe941bceba172ece) Thanks [@emilhauk](https://github.com/emilhauk)! - Add FedCM support
228
+
229
+ ## 0.14.122
230
+
231
+ ### Patch Changes
232
+
233
+ - [`e888b1d`](https://github.com/amedia/amedia-user-js/commit/e888b1d4caa444ad092fd4247eb5f0f1389f443a) Thanks [@emilhauk](https://github.com/emilhauk)! - No more default access feature
234
+
235
+ ## 0.14.121
236
+
237
+ ### Patch Changes
238
+
239
+ - [`089408d`](https://github.com/amedia/amedia-user-js/commit/089408deb8e8c183b5937848a241212906e42e27) Thanks [@emilhauk](https://github.com/emilhauk)! - Attempt extra build
240
+
241
+ ## 0.14.120
242
+
243
+ ### Patch Changes
244
+
245
+ - [#808](https://github.com/amedia/amedia-user-js/pull/808) [`37ce890`](https://github.com/amedia/amedia-user-js/commit/37ce8908b985530bb1bdbe5425c34ddeb88262b7) Thanks [@emilhauk](https://github.com/emilhauk)! - Revert cache strategy
246
+
247
+ ## 0.14.119
248
+
249
+ ### Patch Changes
250
+
251
+ - [`dabcd75`](https://github.com/amedia/amedia-user-js/commit/dabcd75e78fb31469e2bda4d571e11a5547949fd) Thanks [@emilhauk](https://github.com/emilhauk)! - Always pass along context
252
+
253
+ ## 0.14.118
254
+
255
+ ### Patch Changes
256
+
257
+ - [`7a7b8ee`](https://github.com/amedia/amedia-user-js/commit/7a7b8eea03422c346d34197e4eb5c9e30897ec07) Thanks [@emilhauk](https://github.com/emilhauk)! - Don't write bad data back to cache
258
+
259
+ ## 0.14.117
260
+
261
+ ### Patch Changes
262
+
263
+ - [`6ff3043`](https://github.com/amedia/amedia-user-js/commit/6ff30433d4ef169f41ad70ce8536e6c6be53a10d) Thanks [@emilhauk](https://github.com/emilhauk)! - Fix issue where we didn't clear cache on our way to login
264
+
265
+ ## 0.14.116
266
+
267
+ ### Patch Changes
268
+
269
+ - [#785](https://github.com/amedia/amedia-user-js/pull/785) [`bdda771`](https://github.com/amedia/amedia-user-js/commit/bdda771737667900da64c6385954ec1aa314ab34) Thanks [@emilhauk](https://github.com/emilhauk)! - Return expired cache, but hint at need to re-fetch
270
+
271
+ - [#785](https://github.com/amedia/amedia-user-js/pull/785) [`bdda771`](https://github.com/amedia/amedia-user-js/commit/bdda771737667900da64c6385954ec1aa314ab34) Thanks [@emilhauk](https://github.com/emilhauk)! - Add debug logging behind flag
272
+
273
+ ## 0.14.115
274
+
275
+ ### Patch Changes
276
+
277
+ - [`484a9c7`](https://github.com/amedia/amedia-user-js/commit/484a9c78347858165316985c269b1e8402042e13) Thanks [@emilhauk](https://github.com/emilhauk)! - Check for data explicitly in cache
278
+
279
+ ## 0.14.114
280
+
281
+ ### Patch Changes
282
+
283
+ - [#775](https://github.com/amedia/amedia-user-js/pull/775) [`9d9678f`](https://github.com/amedia/amedia-user-js/commit/9d9678f3dff027697bba91c47a80a6a6d3d90098) Thanks [@emilhauk](https://github.com/emilhauk)! - Added cache to session storage to speed up initial respon whilst fetching in the background
284
+
285
+ ## 0.14.113
286
+
287
+ ### Patch Changes
288
+
289
+ - [#730](https://github.com/amedia/amedia-user-js/pull/730) [`6ec2a02`](https://github.com/amedia/amedia-user-js/commit/6ec2a02899c632dee6d89743161fb9d7d922dbbb) Thanks [@emilhauk](https://github.com/emilhauk)! - Avoid duplicate calls to europa on resume
290
+
291
+ ## 0.14.112
292
+
293
+ ### Patch Changes
294
+
295
+ - [#723](https://github.com/amedia/amedia-user-js/pull/723) [`067cefb`](https://github.com/amedia/amedia-user-js/commit/067cefb88760db603203374f1aefaf0894161dc8) Thanks [@emilhauk](https://github.com/emilhauk)! - Don't save against europa unless namespace has actually changed
296
+
297
+ ## 0.14.111
298
+
299
+ ### Patch Changes
300
+
301
+ - [#717](https://github.com/amedia/amedia-user-js/pull/717) [`24e40ef`](https://github.com/amedia/amedia-user-js/commit/24e40efdf6d9ff2ee92722f59e8d95db2fd438ba) Thanks [@emilhauk](https://github.com/emilhauk)! - Rely on validation errors from europa
302
+
303
+ ## 0.14.110
304
+
305
+ ### Patch Changes
306
+
307
+ - [`0bffe73`](https://github.com/amedia/amedia-user-js/commit/0bffe73bddaf54286d06d8d69c9c3c11e9d11d4d) Thanks [@emilhauk](https://github.com/emilhauk)! - Bump dependencies. Add nix-support
308
+
309
+ ## 0.14.109
310
+
311
+ ### Patch Changes
312
+
313
+ - [#595](https://github.com/amedia/amedia-user-js/pull/595) [`0d28499`](https://github.com/amedia/amedia-user-js/commit/0d284992b3ed298d057c01664bc394006a64266c) Thanks [@emilhauk](https://github.com/emilhauk)! - Don't perfom fetch when we know we recently identified emergency mode
314
+
315
+ ## 0.14.108
316
+
317
+ ### Patch Changes
318
+
319
+ - [#590](https://github.com/amedia/amedia-user-js/pull/590) [`2b27a8e`](https://github.com/amedia/amedia-user-js/commit/2b27a8e62468f3508a14f68aef3fed046b9375ba) Thanks [@emilhauk](https://github.com/emilhauk)! - When daxsub fais in emergency mode. No reason to complain about it
320
+
321
+ - [#592](https://github.com/amedia/amedia-user-js/pull/592) [`63d7953`](https://github.com/amedia/amedia-user-js/commit/63d795324289e68104a5d46f02615fcca76062c4) Thanks [@emilhauk](https://github.com/emilhauk)! - Test logging actual raw body when schema-verification fails
322
+
323
+ ## 0.14.107
324
+
325
+ ### Patch Changes
326
+
327
+ - [#583](https://github.com/amedia/amedia-user-js/pull/583) [`6fe2355`](https://github.com/amedia/amedia-user-js/commit/6fe2355e861f9961b31fb50fbc4cf9fadc7ef23e) Thanks [@emilhauk](https://github.com/emilhauk)! - Don't perform autoload when in either aid og paywall emergency modes
328
+
329
+ - [#583](https://github.com/amedia/amedia-user-js/pull/583) [`0933d94`](https://github.com/amedia/amedia-user-js/commit/0933d94a724bc3456db8a5ef76d56d2609f9548b) Thanks [@emilhauk](https://github.com/emilhauk)! - Improve testing around retry prevention when in emergency mode
330
+
331
+ - [#583](https://github.com/amedia/amedia-user-js/pull/583) [`6fe2355`](https://github.com/amedia/amedia-user-js/commit/6fe2355e861f9961b31fb50fbc4cf9fadc7ef23e) Thanks [@emilhauk](https://github.com/emilhauk)! - Throw EmergencyModeError immediatly after discovering relevant emergency mode. Don't time out"
332
+
333
+ ## 0.14.106
334
+
335
+ ### Patch Changes
336
+
337
+ - [`ca3d8bb`](https://github.com/amedia/amedia-user-js/commit/ca3d8bb959cc275c9d9a651719bb15125096a34a) Thanks [@emilhauk](https://github.com/emilhauk)! - Don't log in emergency mode
338
+
339
+ ## 0.14.105
340
+
341
+ ### Patch Changes
342
+
343
+ - [`2b36631`](https://github.com/amedia/amedia-user-js/commit/2b36631dd4bc8f77a10ab2c6d9ae1503a8a64339) Thanks [@emilhauk](https://github.com/emilhauk)! - Allow for VSTOKEN2 to be missing and not resolvable
344
+
345
+ ## 0.14.104
346
+
347
+ ### Patch Changes
348
+
349
+ - [`8955f15`](https://github.com/amedia/amedia-user-js/commit/8955f15ed51d87555b4edbae40d2a7b31efe5698) Thanks [@emilhauk](https://github.com/emilhauk)! - Typo customer not company
350
+
351
+ - [`c5e119a`](https://github.com/amedia/amedia-user-js/commit/c5e119af24cf6e052307079bb8b3e5ee324214f4) Thanks [@emilhauk](https://github.com/emilhauk)! - Update dependencies
352
+
353
+ ## 0.14.103
354
+
355
+ ### Patch Changes
356
+
357
+ - [`af9cf69`](https://github.com/amedia/amedia-user-js/commit/af9cf6980febbc0bd953b46c422a5276b3268116) Thanks [@emilhauk](https://github.com/emilhauk)! - Bump dependencies
358
+
359
+ - [#524](https://github.com/amedia/amedia-user-js/pull/524) [`5201bd3`](https://github.com/amedia/amedia-user-js/commit/5201bd3efd0b93867ab9b38eeec09f3cf90ff40b) Thanks [@emilhauk](https://github.com/emilhauk)! - Add nonUserAccess to mock
360
+
361
+ ## 0.14.102
362
+
363
+ ### Patch Changes
364
+
365
+ - [`1c3146f`](https://github.com/amedia/amedia-user-js/commit/1c3146fd703df2a5215a3bb81a36185169768ea9) Thanks [@emilhauk](https://github.com/emilhauk)! - Stop warning log on failed user attribute call
366
+
367
+ ## 0.14.101
368
+
369
+ ### Patch Changes
370
+
371
+ - [#507](https://github.com/amedia/amedia-user-js/pull/507) [`9bce088`](https://github.com/amedia/amedia-user-js/commit/9bce088c96891ca5701cff79a875fe20fc0281f9) Thanks [@mfolkeseth](https://github.com/mfolkeseth)! - Add plussalt access feature to Donald
372
+
373
+ ## 0.14.100
374
+
375
+ ### Patch Changes
376
+
377
+ - [#504](https://github.com/amedia/amedia-user-js/pull/504) [`6c6c1d2`](https://github.com/amedia/amedia-user-js/commit/6c6c1d2e509be14a251caf6656df1a08f0dea816) Thanks [@emilhauk](https://github.com/emilhauk)! - Attempt to fetch and set VSTOKEN2-cookie if not present when checking for non-user access
378
+
379
+ ## 0.14.99
380
+
381
+ ### Patch Changes
382
+
383
+ - [#501](https://github.com/amedia/amedia-user-js/pull/501) [`042243a`](https://github.com/amedia/amedia-user-js/commit/042243a95579793daaac88668bf767dd135f5960) Thanks [@emilhauk](https://github.com/emilhauk)! - Add withNonUserAccess() to UserDataRequest
384
+
385
+ ## 0.14.98
386
+
387
+ ### Patch Changes
388
+
389
+ - [#495](https://github.com/amedia/amedia-user-js/pull/495) [`c45b43e`](https://github.com/amedia/amedia-user-js/commit/c45b43e0512681b02d14591eb6644bcb0a6127bf) Thanks [@emilhauk](https://github.com/emilhauk)! - Remove navigation hack
390
+
391
+ ## 0.14.97
392
+
393
+ ### Patch Changes
394
+
395
+ - [`784e585`](https://github.com/amedia/amedia-user-js/commit/784e5857c1c6625bff020501c61f28de712e3892) Thanks [@emilhauk](https://github.com/emilhauk)! - SiteAccessRequest
396
+
397
+ ## 0.14.96
398
+
399
+ ### Patch Changes
400
+
401
+ - [#484](https://github.com/amedia/amedia-user-js/pull/484) [`90bb6e8`](https://github.com/amedia/amedia-user-js/commit/90bb6e8b1ce5fcfd7dfa4ddc9ab02cb6efe511ac) Thanks [@emilhauk](https://github.com/emilhauk)! - Avoid redirect trickery on aid.no domains
402
+
403
+ ## 0.14.95
404
+
405
+ ### Patch Changes
406
+
407
+ - [#462](https://github.com/amedia/amedia-user-js/pull/462) [`77c9b89`](https://github.com/amedia/amedia-user-js/commit/77c9b892c65ad794e400c8afe9a88379b2089027) Thanks [@emilhauk](https://github.com/emilhauk)! - Ensure we report on namespace changes
408
+
409
+ ## 0.14.94
410
+
411
+ ### Patch Changes
412
+
413
+ - [#457](https://github.com/amedia/amedia-user-js/pull/457) [`3420022`](https://github.com/amedia/amedia-user-js/commit/34200228f46c3580d7cbdf918a7834d74e6a6dfb) Thanks [@emilhauk](https://github.com/emilhauk)! - Add common aID URLs
414
+
415
+ ## 0.14.93
416
+
417
+ ### Patch Changes
418
+
419
+ - [#454](https://github.com/amedia/amedia-user-js/pull/454) [`f954327`](https://github.com/amedia/amedia-user-js/commit/f954327a19d3d87f0c13b394c30ddd3e8d3796a5) Thanks [@emilhauk](https://github.com/emilhauk)! - Support deleting keys from namespaces
420
+
421
+ ## 0.14.92
422
+
423
+ ### Patch Changes
424
+
425
+ - [#448](https://github.com/amedia/amedia-user-js/pull/448) [`42a0f0f`](https://github.com/amedia/amedia-user-js/commit/42a0f0f720adc42d233c7a2ff0b9ba47da126ede) Thanks [@emilhauk](https://github.com/emilhauk)! - Expose (redirect|reload)OnAccess from PaywallUnlockRequest and log intended action to console.
426
+
427
+ ## 0.14.91
428
+
429
+ ### Patch Changes
430
+
431
+ - [#444](https://github.com/amedia/amedia-user-js/pull/444) [`4d8b148`](https://github.com/amedia/amedia-user-js/commit/4d8b14827fece9640fdc4176cb811795852b4ffa) Thanks [@emilhauk](https://github.com/emilhauk)! - Introduce .withClientStorage to UserDataRequest
432
+
433
+ ## 0.14.90
434
+
435
+ ### Patch Changes
436
+
437
+ - [#437](https://github.com/amedia/amedia-user-js/pull/437) [`3351fdb`](https://github.com/amedia/amedia-user-js/commit/3351fdb91ae037b978ce12ba3ab5db315834a11e) Thanks [@emilhauk](https://github.com/emilhauk)! - Support unsubscribe
438
+
439
+ ## 0.14.89
440
+
441
+ ### Patch Changes
442
+
443
+ - [`3025a29`](https://github.com/amedia/amedia-user-js/commit/3025a2941f2fa6c33e5761719aec30edc29c57b7) Thanks [@emilhauk](https://github.com/emilhauk)! - Bump packages
444
+
445
+ ## 0.14.88
446
+
447
+ ### Patch Changes
448
+
449
+ - [#419](https://github.com/amedia/amedia-user-js/pull/419) [`07b6cb8`](https://github.com/amedia/amedia-user-js/commit/07b6cb891cff72aec59aed00c423af6e1b1c0876) Thanks [@emilhauk](https://github.com/emilhauk)! - Browser back now sends you to the correct previous page, not back into the login flow
450
+
451
+ ## 0.14.86
452
+
453
+ ### Patch Changes
454
+
455
+ - [#406](https://github.com/amedia/amedia-user-js/pull/406) [`b9b542b`](https://github.com/amedia/amedia-user-js/commit/b9b542bda839ae254167cd6e7136f2924e582323) Thanks [@emilhauk](https://github.com/emilhauk)! - Switch to log using @amedia/browserlog
456
+
457
+ ## 0.14.75
458
+
459
+ ### Patch Changes
460
+
461
+ - [#386](https://github.com/amedia/amedia-user-js/pull/386) [`eb8e097`](https://github.com/amedia/amedia-user-js/commit/eb8e0977850ed8c5b12cfcf2b5ff3bdc7e0dbf81) Thanks [@hennikul](https://github.com/hennikul)! - Use SessionStorage instead of cookie to avoid autologin redirect loops.
462
+
463
+ - [`bd05f07`](https://github.com/amedia/amedia-user-js/commit/bd05f07ceb0b51a753fafe40ecc6d89775be199f) Thanks [@emilhauk](https://github.com/emilhauk)! - Tune example for demo
464
+
465
+ ## 0.14.71
466
+
467
+ ### Patch Changes
468
+
469
+ - [`3fe927f`](https://github.com/amedia/amedia-user-js/commit/3fe927fd26be9393a225fb11c9cba42572207367) Thanks [@emilhauk](https://github.com/emilhauk)! - Less strict checking of login state (attempt at reducing fetches when actually logged out)
470
+
471
+ ## 0.14.68
472
+
473
+ ### Patch Changes
474
+
475
+ - [`e58b621`](https://github.com/amedia/amedia-user-js/commit/e58b6216c059217ab16ae541b71554d71a617762) Thanks [@emilhauk](https://github.com/emilhauk)! - Catch-all errors from native fetch
476
+
477
+ ## 0.14.67
478
+
479
+ ### Patch Changes
480
+
481
+ - [#370](https://github.com/amedia/amedia-user-js/pull/370) [`8379508`](https://github.com/amedia/amedia-user-js/commit/83795083673da3960d4a5ff611cdf36507334a34) Thanks [@emilhauk](https://github.com/emilhauk)! - Stop bothering with TypeError from fetch. We have to little programmatical control (different languages in browsers produce different messages etc) to create a meaningfully improved experience.
482
+
483
+ ## 0.14.64
484
+
485
+ ### Patch Changes
486
+
487
+ - [`0e94078`](https://github.com/amedia/amedia-user-js/commit/0e94078e2d415b448d35d46ae2ac8c0f89a941ee) Thanks [@emilhauk](https://github.com/emilhauk)! - Extend log context
488
+
489
+ ## 0.14.63
490
+
491
+ ### Patch Changes
492
+
493
+ - [#367](https://github.com/amedia/amedia-user-js/pull/367) [`6c0e596`](https://github.com/amedia/amedia-user-js/commit/6c0e596a36000918c814d1e70b44d630e575c881) Thanks [@emilhauk](https://github.com/emilhauk)! - Use our fetch-wrapper everywhere
494
+
495
+ - [#365](https://github.com/amedia/amedia-user-js/pull/365) [`fca4cc8`](https://github.com/amedia/amedia-user-js/commit/fca4cc84703985f4cb132881537dc9d5ff21b491) Thanks [@emilhauk](https://github.com/emilhauk)! - Include http status code when logging fetch server error
496
+
497
+ ## 0.14.62
498
+
499
+ ### Patch Changes
500
+
501
+ - [`8732c4f`](https://github.com/amedia/amedia-user-js/commit/8732c4fa36e78e3e173c52ca6d08464b1fb08563) Thanks [@emilhauk](https://github.com/emilhauk)! - Bump typescript 4.9.3
502
+
503
+ - [#361](https://github.com/amedia/amedia-user-js/pull/361) [`926c8cf`](https://github.com/amedia/amedia-user-js/commit/926c8cf50776ce267db1c8193ab10e69babace66) Thanks [@emilhauk](https://github.com/emilhauk)! - Never end up returning undefined from fetcher
504
+
505
+ - [#362](https://github.com/amedia/amedia-user-js/pull/362) [`70756a6`](https://github.com/amedia/amedia-user-js/commit/70756a6a4cd2af7e1b0dd421d3b341b71400d8d8) Thanks [@emilhauk](https://github.com/emilhauk)! - Don't attempt to refresh storage namespaces when we have been logged out
506
+
507
+ - [`ad33b35`](https://github.com/amedia/amedia-user-js/commit/ad33b35134b7cf9842b5f0dbfdb4b85622165ca6) Thanks [@emilhauk](https://github.com/emilhauk)! - Bump packages
508
+
509
+ - [#360](https://github.com/amedia/amedia-user-js/pull/360) [`032bf2c`](https://github.com/amedia/amedia-user-js/commit/032bf2c1db8cc8d4449e4a50dc002fcb3c9488d1) Thanks [@emilhauk](https://github.com/emilhauk)! - Add example implementation
510
+
511
+ ## 0.14.61
512
+
513
+ ### Patch Changes
514
+
515
+ - [#356](https://github.com/amedia/amedia-user-js/pull/356) [`000d4d7`](https://github.com/amedia/amedia-user-js/commit/000d4d77e2cbb65de97a1cc00fb443451b96694b) Thanks [@emilhauk](https://github.com/emilhauk)! - Bump packages, improve console guidance for mock and extend som debug logging
516
+
517
+ - [#357](https://github.com/amedia/amedia-user-js/pull/357) [`2731491`](https://github.com/amedia/amedia-user-js/commit/2731491b13c9729093e30b96eb2e52254daade04) Thanks [@aMediocreDad](https://github.com/aMediocreDad)! - Minor edits to stub mocks implementing getLoginUrl, using hostname as opposed to host, and adding altno_betatester to extra data
518
+
519
+ ## 0.14.60
520
+
521
+ ### Patch Changes
522
+
523
+ - [#351](https://github.com/amedia/amedia-user-js/pull/351) [`8d24506`](https://github.com/amedia/amedia-user-js/commit/8d24506a10a67280a579408fa8410040123a36f0) Thanks [@emilhauk](https://github.com/emilhauk)! - Add mock for @amedia/user
524
+
525
+ - [#354](https://github.com/amedia/amedia-user-js/pull/354) [`06e3d89`](https://github.com/amedia/amedia-user-js/commit/06e3d89ab9742188a80b6064b8ddb4e4b7979b11) Thanks [@emilhauk](https://github.com/emilhauk)! - Add polyfill for Promise.allSettled to support Safari 12 a while longer
526
+
527
+ ## 0.14.59
528
+
529
+ ### Patch Changes
530
+
531
+ - [#342](https://github.com/amedia/amedia-user-js/pull/342) [`2262501`](https://github.com/amedia/amedia-user-js/commit/226250126f23b2e87816b0de332937a3547354b0) Thanks [@emilhauk](https://github.com/emilhauk)! - Refactor fetch and add retry mechanism for 503-errors
532
+
533
+ ## 0.14.58
534
+
535
+ ### Patch Changes
536
+
537
+ - [`4470116`](https://github.com/amedia/amedia-user-js/commit/4470116188858baf4b11e37440b4f56d671e80e2) Thanks [@emilhauk](https://github.com/emilhauk)! - Added missing stubbed export of FetchTimeoutError to appease linting
538
+
539
+ ## 0.14.57
540
+
541
+ ### Patch Changes
542
+
543
+ - [#326](https://github.com/amedia/amedia-user-js/pull/326) [`7aad6c3`](https://github.com/amedia/amedia-user-js/commit/7aad6c3b4f71f5404fdb100425fd9c7432d7bd43) Thanks [@hennikul](https://github.com/hennikul)! - Broadcast access to Jupiter (for further broadcast to TV2)
544
+
545
+ ## 0.14.56
546
+
547
+ ### Patch Changes
548
+
549
+ - [#320](https://github.com/amedia/amedia-user-js/pull/320) [`c5230e8`](https://github.com/amedia/amedia-user-js/commit/c5230e880165bbba60b4e8698b15371ba55089b2) Thanks [@emilhauk](https://github.com/emilhauk)! - Should report no access if the user has no access features. Even if none was requested.
550
+
551
+ ## 0.14.55
552
+
553
+ ### Patch Changes
554
+
555
+ - [#318](https://github.com/amedia/amedia-user-js/pull/318) [`4bfef4c`](https://github.com/amedia/amedia-user-js/commit/4bfef4cc9b00e065231a9db3ed6c53443eb170f5) Thanks [@emilhauk](https://github.com/emilhauk)! - Handle FetchTimeoutError internally for autologin-feature
556
+
557
+ ## 0.14.54
558
+
559
+ ### Patch Changes
560
+
561
+ - [#297](https://github.com/amedia/amedia-user-js/pull/297) [`33d94d2`](https://github.com/amedia/amedia-user-js/commit/33d94d2857543c317838edb079c37047ab9b2954) Thanks [@emilhauk](https://github.com/emilhauk)! - Bump packages
562
+
563
+ ## 0.14.53
564
+
565
+ ### Patch Changes
566
+
567
+ - [#290](https://github.com/amedia/amedia-user-js/pull/290) [`5c7c8d0`](https://github.com/amedia/amedia-user-js/commit/5c7c8d08bcc91b21ca14781f58fbf976f3956902) Thanks [@emilhauk](https://github.com/emilhauk)! - Switched to Kragl
568
+
569
+ ## 0.14.52
570
+
571
+ ### Patch Changes
572
+
573
+ - [#236](https://github.com/amedia/amedia-user-js/pull/236) [`e43b0b7`](https://github.com/amedia/amedia-user-js/commit/e43b0b7bb72fb6ac3f78b2a13d55c98359719d16) Thanks [@emilhauk](https://github.com/emilhauk)! - Refresh data on window focus
574
+
575
+ ## 0.14.51
576
+
577
+ ### Patch Changes
578
+
579
+ - [#233](https://github.com/amedia/amedia-user-js/pull/233) [`943dc8a`](https://github.com/amedia/amedia-user-js/commit/943dc8a3a7bcd6eef6d5f5489c97b28e8d35ad05) Thanks [@emilhauk](https://github.com/emilhauk)! - Improve typings
580
+
581
+ ## 0.14.50
582
+
583
+ ### Patch Changes
584
+
585
+ - [`f29ba02`](https://github.com/amedia/amedia-user-js/commit/f29ba02ac27879ed92694fb5e154718ae2c1fd60) Thanks [@emilhauk](https://github.com/emilhauk)! - Eik package included
586
+
587
+ ## 0.14.49
588
+
589
+ ### Patch Changes
590
+
591
+ - [`0d90353`](https://github.com/amedia/amedia-user-js/commit/0d90353e4aa8aa3da2ed26c3151f601389e973e3) Thanks [@emilhauk](https://github.com/emilhauk)! - Updated readme to cover new deploy procedure. Bumping version to test ;)
592
+
593
+ ## 0.14.48
594
+
595
+ ### Patch Changes
596
+
597
+ - [`20424c2`](https://github.com/amedia/amedia-user-js/commit/20424c210505f0f0e741a415213aa755395c840c) Thanks [@emilhauk](https://github.com/emilhauk)! - Move eik config to package.json
598
+
599
+ ## 0.14.47
600
+
601
+ ### Patch Changes
602
+
603
+ - [`5e1ca5d`](https://github.com/amedia/amedia-user-js/commit/5e1ca5dae283e8a9b78d8b2c0cea8dafd3bdac6e) Thanks [@emilhauk](https://github.com/emilhauk)! - Use central fetcher for europa data
package/README.md CHANGED
@@ -473,13 +473,13 @@ If you're curious about calls, response times etc, there is a debug flag you can
473
473
 
474
474
  Hey, thanks! :)
475
475
 
476
- It's often nice to do development while testing on a real app. You may do so using `npm link`. When you run then `npm run build` (or `npm run dev` if you want to watch for changes and build automatically) this will expose actual code, letting you develop faster. This is because we still export user.js from the package, but replaces its content with an error if used directly.
476
+ It's often nice to do development while testing on a real app. You may do so using `npm link`. When you run then `npm run build` (or `npm run dev` if you want to watch for changes and build automatically) this will expose actual code, letting you develop faster. This is because we still export index.js from the package, but replaces its content with an error if used directly.
477
477
 
478
478
  PS: Remember to comment-out the module in import maps ;-)
479
479
 
480
480
  ## Testing live
481
481
 
482
- You can test your version live by utilizing a browser extension like Requestly or similar. Run `npm run dev` (which will build and watch for changes locally _and_ starts a webserver listening on localhost:9999). Then add a rule in the extension that replaces requests for @amedia/user/v0/user.js with http://localhost:9999/user.js. Now reload and watch your wonderful change do its thing.
482
+ You can test your version live by utilizing a browser extension like Requestly or similar. Run `npm run dev` (which will build and watch for changes locally _and_ starts a webserver listening on localhost:9999). Then add a rule in the extension that replaces requests for @amedia/user/v0/index.js with http://localhost:9999/user.js. Now reload and watch your wonderful change do its thing.
483
483
 
484
484
  ## Publishing new versions
485
485
 
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @module @amedia/user
3
+ * The meaning of this wrapper module is to provide a versioned package
4
+ * for types and documentation, while still allowing the aID to release
5
+ * non-breaking changes.
6
+ */
7
+ export * from 'https://assets.acdn.no/pkg/@amedia/user/v1/user.js';
package/package.json CHANGED
@@ -1,81 +1,34 @@
1
1
  {
2
2
  "name": "@amedia/user",
3
- "version": "0.14.152",
4
3
  "description": "Client lib for working with aID user and associated data",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/amedia/amedia-user-js.git"
8
- },
4
+ "repository": "https://github.com/amedia/amedia-user-js",
9
5
  "author": "Amedia Produkt og Teknologi AS (https://amedia.no)",
10
- "license": "MIT",
6
+ "version": "1.0.0",
11
7
  "type": "module",
12
- "module": "dist/user.js",
8
+ "types": "./index.d.ts",
13
9
  "exports": {
14
10
  ".": {
15
- "import": "./dist/user.js",
16
- "default": "./dist/user.js"
11
+ "types": "./index.d.ts",
12
+ "import": "./index.js",
13
+ "default": "./index.js"
17
14
  }
18
15
  },
19
16
  "files": [
20
- "dist/*"
17
+ "index.js",
18
+ "index.d.ts",
19
+ "README.md",
20
+ "CHANGELOG.md"
21
21
  ],
22
- "typings": "dist/user.d.ts",
23
22
  "eik": {
24
23
  "server": "https://assets.acdn.no",
25
24
  "files": {
26
- "user.js": "./dist/user.js",
27
- "user.js.map": "./dist/user.js.map",
28
- "user.d.ts": "./dist/user.d.ts"
25
+ "user.js": "../../dist/user.js",
26
+ "user.js.map": "../../dist/user.js.map",
27
+ "user.d.ts": "../../dist/user.d.ts"
29
28
  }
30
29
  },
31
30
  "scripts": {
32
- "changeset": "changeset",
33
- "release": "changeset publish",
34
- "test": "jest --coverage",
35
- "format": "kragl format",
36
- "lint": "kragl lint",
37
- "lint-fix": "kragl lint --fix",
38
- "clean-dist": "rm -rf ./dist",
39
- "build": "npm install && node --experimental-strip-types build.ts & npm run build:types",
40
- "build:types": "npx rollup -c ./types.js",
41
- "dev": "concurrently --kill-others \"node --experimental-strip-types --watch-path=./src build.ts\" \"node --experimental-strip-types server.ts \"",
42
- "typings": "tsc --noEmit --resolveJsonModule",
43
- "checkVersion": "node --experimental-json-modules checkVersion.js",
44
- "stub-npmjs-package": "find ./dist -type f ! -name '*.d.ts' -delete && cp -v stubs/* dist/.",
45
- "eik:package": "run-p typings lint && npm run test && npm run build && npx @eik/cli publish",
46
- "prepublishOnly": "run-p clean-dist typings lint && npm run test && npm run build && npm run stub-npmjs-package",
47
- "postpublish": "npm run build && npx @eik/cli publish"
48
- },
49
- "dependencies": {
50
- "@amedia/browserid": "1.1.9",
51
- "@amedia/frontend-rpc": "0.0.14",
52
- "ts-deepmerge": "7.0.3",
53
- "valibot": "1.1.0"
54
- },
55
- "devDependencies": {
56
- "@amedia/eslint-config": "4.0.7",
57
- "@amedia/kragl": "5.1.0",
58
- "@amedia/prettier-config": "2.1.1",
59
- "@changesets/changelog-github": "0.5.1",
60
- "@changesets/cli": "2.29.7",
61
- "@eik/esbuild-plugin": "2.0.5",
62
- "@fastify/cors": "^11.1.0",
63
- "@fastify/static": "^8.2.0",
64
- "@types/jest": "30.0.0",
65
- "@types/node": "24.9.1",
66
- "concurrently": "9.2.1",
67
- "esbuild": "0.25.11",
68
- "fastify": "^5.6.0",
69
- "jest": "30.2.0",
70
- "jest-environment-jsdom": "30.2.0",
71
- "jest-extended": "6.0.0",
72
- "jest-fetch-mock": "3.0.3",
73
- "mockdate": "3.0.5",
74
- "npm-run-all": "4.1.5",
75
- "rollup": "4.52.5",
76
- "rollup-plugin-dts": "6.2.3",
77
- "ts-jest": "29.4.5",
78
- "tslib": "2.8.1",
79
- "typescript": "5.9.3"
31
+ "prepublishOnly": "cp ../../README.md . && cp ../../CHANGELOG.md .",
32
+ "postpublish": "(cd ../../ && npm run build) && npx @eik/cli publish && rm README.md && rm CHANGELOG.md"
80
33
  }
81
34
  }
package/dist/personas.js DELETED
@@ -1,111 +0,0 @@
1
- export default {
2
- logged_out: {
3
- description: 'Not logged in',
4
- data: {
5
- attributes: {
6
- uuid: null,
7
- },
8
- state: {
9
- isLoggedIn: false,
10
- },
11
- storage: {},
12
- nonUserAccess: [
13
- {
14
- accessFeatures: ['newspaper'],
15
- customer: 'some_company',
16
- },
17
- ],
18
- },
19
- },
20
- donald: {
21
- description: 'Maxed out subscription',
22
- data: {
23
- attributes: {
24
- uuid: '1-13-37',
25
- name: 'Donald Duck',
26
- trackingKey: '1-13-38',
27
- avatar:
28
- 'https://g.api.no/obscura/API/dynamic/r1/aidp/ts_1x1_c_m-tr_320_320_l_f/1/static/unknown-gray.png?chk=399E5A',
29
- extraData: {
30
- age: 39,
31
- age_user: 39,
32
- agillic_person_id: 'ac2bcb3e-b73a-466a-99aa-0a75067c4c7c',
33
- agillic_person_id_user: 'ac2bcb3e-b73a-466a-99aa-0a75067c4c7c',
34
- aib_ad_segments:
35
- 'aib_ag_30,aib_co_38,aib_ge_01,aib_lp_08,aib_mu_3808',
36
- aib_ad_segments_user:
37
- 'aib_ag_30,aib_co_38,aib_ge_01,aib_lp_08,aib_mu_3808',
38
- altno_betatester: 'true',
39
- birth_year: '1983',
40
- birth_year_user: '1983',
41
- customer_grouping_number: '0',
42
- customer_grouping_number_user: '0',
43
- customer_keys: 'TE-711e12f6168e1eb4ed8514a354b3b21f2af63f43',
44
- customer_keys_user: 'TE-711e12f6168e1eb4ed8514a354b3b21f2af63f43',
45
- gender: 'M',
46
- gender_user: 'M',
47
- geo_ids: '102675-1',
48
- geo_ids_user: '102675-1',
49
- grunnkrets: '38080602',
50
- grunnkrets_user: '38080602',
51
- last_pageview_daily: '2022-11-06T07:36:08+01:00',
52
- last_pageview_daily_user: '2022-11-06T07:36:08+01:00',
53
- plussalt_subscription: 'true',
54
- plussalt_subscription_user: 'true',
55
- plussalt_top_sites:
56
- 'telema,laagen,dramti,tonsbb,rjukan,avisao,rombla,bergen,ostpos,sanfjb',
57
- plussalt_top_sites_user:
58
- 'telema,laagen,dramti,tonsbb,rjukan,avisao,rombla,bergen,ostpos,sanfjb',
59
- postcode: '3674',
60
- postcode_memento: '3684',
61
- postcode_memento_user: '3684',
62
- postcode_user: '3674',
63
- shared_account: true,
64
- shared_account_user: true,
65
- sub_category: 'etablert kunde',
66
- sub_category_user: 'etablert kunde',
67
- user_grouping_number: '30',
68
- user_grouping_number_user: '30',
69
- },
70
- access: ['newspaper', 'plussalt'],
71
- privacyPreferences: {
72
- allowResearchUsage: true,
73
- connectWithSurveys: true,
74
- personalizedAds: true,
75
- personalizedContent: true,
76
- },
77
- sessionTrackingKey: 'session-tracking-key',
78
- },
79
- state: {
80
- isLoggedIn: true,
81
- },
82
- storage: {
83
- euucp: {
84
- button_clicked: '1563131693949',
85
- viewed: '1563131686005',
86
- },
87
- privacy_preferences: {
88
- allow_research_usage: 'true',
89
- allow_research_usage_seen: '2022-01-20T10:04:35.979+01:00',
90
- allow_research_usage_set: '2020-07-06T12:24:53.050+02:00',
91
- connect_with_surveys: 'false',
92
- connect_with_surveys_seen: '2022-01-20T10:04:35.979+01:00',
93
- connect_with_surveys_set: '2020-07-06T12:25:02.348+02:00',
94
- info_popup_dismissed: '2020-05-19T14:59:29+02:00',
95
- personalized_ads: 'true',
96
- personalized_ads_seen: '2022-01-20T10:04:35.979+01:00',
97
- personalized_ads_set: '2020-07-06T12:24:50.312+02:00',
98
- personalized_content: 'true',
99
- personalized_content_seen: '2022-10-10T17:16:32.631+02:00',
100
- personalized_content_set: '2022-10-10T17:16:32.631+02:00',
101
- },
102
- },
103
- nonUserAccess: [
104
- {
105
- accessFeatures: ['newspaper'],
106
- customer: 'some_company',
107
- },
108
- ],
109
- },
110
- },
111
- };
package/dist/user.d.ts DELETED
@@ -1,189 +0,0 @@
1
- import * as v from 'valibot';
2
-
3
- type AccessFeatures = string[];
4
- type UserAttributes = {
5
- uuid: string | null;
6
- name: string | null;
7
- trackingKey: string | null;
8
- avatar: string | null;
9
- /** @deprecated use data from [@amedia/user-datapoints](https://github.com/amedia/amedia-user-datapoints) instead */
10
- extraData: {
11
- [index: string]: unknown;
12
- };
13
- access: AccessFeatures;
14
- /** @deprecated Returns false for all keys. CMP data is now used. */
15
- privacyPreferences: PrivacyPreferences | null;
16
- sessionTrackingKey: string | null;
17
- };
18
- type State = {
19
- isLoggedIn: boolean;
20
- isCircuitBreakerTripped?: boolean;
21
- emergencyMode?: string[];
22
- };
23
- /**
24
- * @deprecated This is set to false as default. CMP data is now used.
25
- */
26
- type PrivacyPreferences = {
27
- allowResearchUsage: boolean;
28
- personalizedContent: boolean;
29
- };
30
-
31
- type ClientId = string;
32
-
33
- type NamespaceList = Array<string>;
34
-
35
- type Millis = number;
36
- type UnsubscribeFn = () => void;
37
- declare class UserDataRequest<TUserAttributes extends UserAttributes, TStorage extends Record<ClientId, Record<string, string>>, TAttributes extends Array<keyof TUserAttributes>, TRequestedStorage extends Record<keyof TStorage, NamespaceList>, TSubscribeResponse extends Record<string, unknown> & {
38
- state: State;
39
- } = {
40
- state: State;
41
- }> {
42
- private requestedAttributes?;
43
- private requestedStorage?;
44
- private requestedNonUserAccess;
45
- private context;
46
- static FETCH_TIMEOUT: Millis;
47
- private static WITH_NON_USER_ACCESS;
48
- private fetchTimeoutId;
49
- private lastReceivedData?;
50
- private subscriptionEventListeners;
51
- constructor(requestedAttributes?: TAttributes, requestedStorage?: TRequestedStorage, requestedNonUserAccess?: boolean, context?: string);
52
- withContext(context: string): this;
53
- withAttributes<NewAttributes extends Array<keyof TUserAttributes>>(attributes: NewAttributes): UserDataRequest<TUserAttributes, TStorage, (TAttributes[number] & NewAttributes[number])[], TRequestedStorage, TSubscribeResponse & {
54
- attributes: Pick<TUserAttributes, TAttributes[number] & NewAttributes[number]>;
55
- }>;
56
- withStorage(namespaces: Array<string>): UserDataRequest<TUserAttributes, TStorage, TAttributes, TRequestedStorage, TSubscribeResponse & {
57
- storage: Record<string, Record<string, string>>;
58
- }>;
59
- withClientStorage(clientId: keyof TStorage, namespaces: Array<string>): UserDataRequest<TUserAttributes, TStorage, TAttributes, TRequestedStorage, TSubscribeResponse & {
60
- clientStorage: Record<ClientId, (typeof namespaces)[number]>;
61
- }>;
62
- withNonUserAccess(): UserDataRequest<TUserAttributes, TStorage, TAttributes, TRequestedStorage, TSubscribeResponse & {
63
- nonUserAccess: Array<Record<string, string>>;
64
- }>;
65
- subscribe(onData: (data: TSubscribeResponse) => void): UnsubscribeFn;
66
- fetch(options?: {
67
- timeout?: Millis;
68
- }): Promise<TSubscribeResponse>;
69
- private startFetchTimeout;
70
- private clearFetchTimeout;
71
- private restartFetchTimeout;
72
- private unsubscribe;
73
- private processUserAttributesEvent;
74
- private processStorageEventDetail;
75
- private setupLocalCache;
76
- private debugLogFetchCompleted;
77
- }
78
-
79
- declare enum AffiliationType {
80
- ACCESS = "access",
81
- FAMILY = "family",
82
- SUBSCRIPTION = "subscription"
83
- }
84
- declare const PrimarySiteSchema: v.ObjectSchema<{
85
- readonly domain: v.StringSchema<undefined>;
86
- readonly name: v.StringSchema<undefined>;
87
- readonly affiliation: v.LiteralSchema<AffiliationType.ACCESS, undefined>;
88
- readonly affiliations: v.ArraySchema<v.UnionSchema<[v.LiteralSchema<AffiliationType.ACCESS, undefined>, v.LiteralSchema<AffiliationType.FAMILY, undefined>, v.LiteralSchema<AffiliationType.SUBSCRIPTION, undefined>], undefined>, undefined>;
89
- }, undefined>;
90
- type PrimarySite = v.InferOutput<typeof PrimarySiteSchema>;
91
-
92
- type SiteAccessResponse = {
93
- isLoggedIn: boolean;
94
- hasAccess: boolean;
95
- primarySite?: null | PrimarySite;
96
- accessFeatures: string[];
97
- };
98
- declare class SiteAccessRequest {
99
- private requiredAccessFeatures;
100
- private siteDomain;
101
- constructor(requiredAccessFeatures?: Array<string>);
102
- withSiteDomain(siteDomain: string): this;
103
- /**
104
- * @deprecated Required now. Set in constructor
105
- */
106
- withAccessFeatures(accessFeatures: Array<string>): this;
107
- requestAccess(): Promise<SiteAccessResponse>;
108
- }
109
-
110
- type PaywallUnlockResponse = SiteAccessResponse;
111
- declare class PaywallUnlockRequest {
112
- private requestedAccessFeatures;
113
- private reload;
114
- private requestedUrl;
115
- constructor(requestedAccessFeatures?: string[]);
116
- /**
117
- * @deprecated Use SiteAccessRequest to check for access on another site.
118
- */
119
- withSiteDomain(siteDomain: string): this;
120
- /**
121
- * @deprecated Required now. Set in constructor
122
- */
123
- withAccessFeatures(accessFeatures: string[]): this;
124
- reloadOnAccess(): this;
125
- redirectOnAccess(requestedUrl: string): this;
126
- tryUnlock(): Promise<PaywallUnlockResponse>;
127
- }
128
-
129
- declare class FetchTimeoutError extends Error {
130
- partialData: Record<string, unknown>;
131
- constructor(message: string, partialData: Record<string, unknown>);
132
- }
133
-
134
- declare class PaywallError extends Error {
135
- static ERROR_RELOADED_NO_ACCESS: string;
136
- static ERROR_ENABLING_ACCESS_FAILED: string;
137
- static ERROR_NO_ACCESS_AFTER_SUCCESSFUL_ACTIVATION_WITH_REQUESTED_ACCESS_FEATURES: string;
138
- code: string;
139
- constructor(message: string, code: string);
140
- }
141
-
142
- declare class EmergencyModeError extends Error {
143
- activeEmergencyModes: string[];
144
- constructor(message?: string);
145
- }
146
-
147
- declare class ValidationError extends Error {
148
- readonly code: string;
149
- constructor(code: string, message: string);
150
- }
151
-
152
- declare class TimeoutError extends Error {
153
- }
154
- /**
155
- * Poll for access on current site.
156
- * Use this when you expect the reader to have gained access, but need to
157
- * be sure before telling the reader that everything's good.
158
- *
159
- * @throws EmergencyModeError if in emergency mode
160
- * @throws TimeoutError if access cannot be attained within given timeout
161
- * @throws Error if unknown error
162
- * @returns true
163
- */
164
- declare function pollForAccess(requiredAccessFeatures?: string[], timeout_millis?: number): Promise<true>;
165
-
166
- type LoginPageParams = {
167
- requestedUrl?: string;
168
- context?: string;
169
- };
170
- /**
171
- * This will, if necessary, trigger a redirect to www.aid.no and return
172
- * to the requestedUrl if supplied or the current url before redirecting away if not.
173
- * @param requestedUrl
174
- */
175
- declare const goToLoginPage: (requestedUrlOrParams?: string | LoginPageParams) => void;
176
- declare const getLoginUrl: (requestedUrlOrParams?: string | LoginPageParams) => URL;
177
- declare const logout: () => Promise<void>;
178
- declare const requestDataRefresh: () => void;
179
- declare const aidUrls: {
180
- mainPage: URL;
181
- privacyPolicy: URL;
182
- termsOfService: URL;
183
- family: URL;
184
- profile: URL;
185
- sites: URL;
186
- };
187
-
188
- export { EmergencyModeError, FetchTimeoutError, PaywallError, PaywallUnlockRequest, SiteAccessRequest, TimeoutError, UserDataRequest, ValidationError, aidUrls, getLoginUrl, goToLoginPage, logout, pollForAccess, requestDataRefresh };
189
- export type { PaywallUnlockResponse, PrivacyPreferences, SiteAccessResponse, State, UserAttributes };
package/dist/user.js DELETED
@@ -1,205 +0,0 @@
1
- import personas from './personas.js';
2
-
3
- function isRunningOnLocalhost() {
4
- return (
5
- location.hostname === 'localhost' ||
6
- /localhost.api.no$/.test(location.hostname)
7
- );
8
- }
9
-
10
- function notImplemented() {
11
- throw new Error('Not implemented in @amedia/user mock mode');
12
- }
13
-
14
- let currentPersona;
15
- function getMockData() {
16
- const availablePersonas = Object.keys(personas).reduce(
17
- (p, c) => ({ ...p, [c]: personas[c].description }),
18
- {}
19
- );
20
- let persona =
21
- new URLSearchParams(location.search).get('aid_persona') || 'donald';
22
- if (!personas[persona]) {
23
- console.warn(
24
- `[@amedia/user]: Unknown persona (${persona}) was selected. Falling back to 'donald'.`,
25
- '\n\nAvailable personas\n',
26
- availablePersonas,
27
- 'Control active persona by setting aid_persona=persona search param.'
28
- );
29
- persona = 'donald';
30
- }
31
- const mockData = personas[persona].data;
32
- if (!currentPersona || currentPersona !== persona) {
33
- console.debug(
34
- `[@amedia/user]: Running in mock-mode with as ${persona}.`,
35
- mockData,
36
- '\n\nOther personas available:\n',
37
- Object.keys(availablePersonas)
38
- .filter((p) => p !== persona)
39
- .reduce((p, c) => (p[c] = availablePersonas[c]) && p, {}),
40
- 'Control active persona by setting aid_persona=persona search param.'
41
- );
42
- }
43
- currentPersona = persona;
44
- return mockData;
45
- }
46
-
47
- export class UserDataRequest {
48
- constructor(attributes, namespaces, nonUserAccess = false) {
49
- this.attributes = attributes;
50
- this.namespaces = namespaces;
51
- this.nonUserAccess = nonUserAccess;
52
- this.setupMockData();
53
- }
54
-
55
- setupMockData() {
56
- this.mockData = getMockData();
57
- }
58
-
59
- withAttributes(attributes) {
60
- return new UserDataRequest(
61
- [...(this.attributes || []), ...attributes],
62
- this.namespaces,
63
- this.nonUserAccess
64
- );
65
- }
66
-
67
- withStorage(namespaces) {
68
- return new UserDataRequest(
69
- this.attributes,
70
- [...(this.namespaces || []), ...namespaces],
71
- this.nonUserAccess
72
- );
73
- }
74
-
75
- withNonUserAccess() {
76
- return new UserDataRequest(this.attributes, this.namespaces, true);
77
- }
78
-
79
- subscribe(onData) {
80
- onData({
81
- ...((this.attributes && {
82
- attributes: this.attributes.reduce(
83
- (attributes, attribute) => ({
84
- ...attributes,
85
- [attribute]: this.mockData.attributes[attribute],
86
- }),
87
- {}
88
- ),
89
- }) ||
90
- {}),
91
- ...(this.namespaces && {
92
- storage: this.namespaces.reduce(
93
- (namespaces, namespace) => ({
94
- ...namespaces,
95
- [namespace]: this.mockData.storage[namespace],
96
- }),
97
- {}
98
- ),
99
- }),
100
- state: this.mockData.state,
101
- ...(this.nonUserAccess && { nonUserAccess: this.mockData.nonUserAccess }),
102
- });
103
- }
104
-
105
- fetch() {
106
- return new Promise((resolve) => {
107
- this.subscribe((data) => {
108
- resolve(data);
109
- });
110
- });
111
- }
112
- }
113
-
114
- export class FetchTimeoutError extends Error {
115
- constructor() {
116
- super();
117
- notImplemented();
118
- }
119
- }
120
-
121
- export class EmergencyModeError extends Error {
122
- constructor(props) {
123
- super(props);
124
- this.activeEmergencyModes = [];
125
- notImplemented();
126
- }
127
- }
128
-
129
- export class PaywallUnlockRequest {
130
- requestedAccessFeatures = ['newspaper'];
131
-
132
- constructor() {
133
- this.persona = getMockData();
134
- }
135
-
136
- withSiteDomain(domain) {
137
- this.siteDomain = domain;
138
- return this;
139
- }
140
-
141
- withAccessFeatures(accessFeatures) {
142
- this.requestedAccessFeatures = accessFeatures;
143
- return this;
144
- }
145
-
146
- redirectOnAccess(requestedUrl) {
147
- this.requestedUrl = requestedUrl;
148
- return this;
149
- }
150
-
151
- reloadOnAccess() {
152
- this.reload = true;
153
- return this;
154
- }
155
-
156
- async tryUnlock() {
157
- if (!this.persona.state.isLoggedIn) {
158
- return { isLoggedIn: false, hasAccess: false, accessFeatures: [] };
159
- }
160
-
161
- const hasAccess = this.requestedAccessFeatures.every((raf) =>
162
- this.persona.attributes.access.includes(raf)
163
- );
164
- if (hasAccess) {
165
- if (this.reload) {
166
- console.log(
167
- "[@amedia/user PaywallUnlockRequest]: Access granted. Would've performed reload at this time."
168
- );
169
- }
170
- if (this.requestedUrl) {
171
- console.log(
172
- `[@amedia/user PaywallUnlockRequest]: Access granted. Would've performed redirect (to '${this.requestedUrl}') at this time.`
173
- );
174
- }
175
- }
176
-
177
- return {
178
- isLoggedIn: true,
179
- hasAccess,
180
- accessFeatures: this.persona.attributes.access,
181
- };
182
- }
183
- }
184
-
185
- export const getLoginUrl = () => '/stubbed-login-url';
186
- export const goToLoginPage = notImplemented;
187
- export const logout = notImplemented;
188
-
189
- export const updateStorage = notImplemented;
190
- export const saveStorage = notImplemented;
191
-
192
- const baseUrl = `https://www.aid.no.localhost.api.no/aid`;
193
- export const aidUrls = {
194
- mainPage: new URL(baseUrl),
195
- privacyStatement: new URL(`${baseUrl}/personvern`),
196
- privacyPreferences: new URL(`${baseUrl}/personvern/oversikt`),
197
- termsOfService: new URL(`${baseUrl}/brukervilkar`),
198
- family: new URL(`${baseUrl}/familie`),
199
- profile: new URL(`${baseUrl}/profil`),
200
- sites: new URL(`${baseUrl}/nettsteder`),
201
- };
202
-
203
- if (!isRunningOnLocalhost()) {
204
- throw new Error('You must use @amedia/user through Eik. Please read docs');
205
- }