@amedia/user 0.14.93 → 0.14.95

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/README.md CHANGED
@@ -190,7 +190,7 @@ new UserDataRequest()
190
190
  console.log(e.partialData);
191
191
  // Maybe you're able to render your app in a reduced state (using partialData).
192
192
  }
193
- };
193
+ });
194
194
  ```
195
195
 
196
196
  If you're running a background task and don't mind waiting longer than default (10 seconds), you may set a longer timeout in fetch:
@@ -226,6 +226,10 @@ If you need to ensure the latest data is available, you may request a data refre
226
226
 
227
227
  This action will log the user out of aID. The logout is global, meaning it will log the session out of all sites and aid.no. After logout has completed the promise will resolve, giving your app the opportunity to reset state / reload the page etc.
228
228
 
229
+ ### `aidUrls: Record<string, URL>`
230
+
231
+ Get various, environment aware, URLs to pages often linked to from other apps. This includes pages like the aID profile page, Terms of Service, Privacy Statement, Privacy Preferences, Family Sharing and the like.
232
+
229
233
  ### DEPRECATED: `~updateStorage(storage: Storage): void~`
230
234
 
231
235
  [See: Writing-to-storage-namespaces](#writing-to-storage-namespaces)
package/dist/user.d.ts CHANGED
@@ -59,7 +59,7 @@ declare class UserDataRequest<TUserAttributes extends UserAttributes, TStorage e
59
59
  private restartFetchTimeout;
60
60
  private unsubscribe;
61
61
  private processUserAttributesEvent;
62
- private processStorageEvent;
62
+ private processStorageEventDetail;
63
63
  private setupLocalCache;
64
64
  }
65
65
 
@@ -130,5 +130,14 @@ declare const updateStorage: (storage: Storage) => void;
130
130
  */
131
131
  declare const saveStorage: (storage: Storage) => void;
132
132
  declare const requestDataRefresh: () => void;
133
+ declare const aidUrls: {
134
+ mainPage: URL;
135
+ privacyStatement: URL;
136
+ privacyPreferences: URL;
137
+ termsOfService: URL;
138
+ family: URL;
139
+ profile: URL;
140
+ sites: URL;
141
+ };
133
142
 
134
- export { FetchTimeoutError, PaywallError, PaywallUnlockRequest, PaywallUnlockResponse, PrivacyPreferences, State, UserAttributes, UserDataRequest, getLoginUrl, goToLoginPage, logout, requestDataRefresh, saveStorage, updateStorage };
143
+ export { FetchTimeoutError, PaywallError, PaywallUnlockRequest, PaywallUnlockResponse, PrivacyPreferences, State, UserAttributes, UserDataRequest, aidUrls, getLoginUrl, goToLoginPage, logout, requestDataRefresh, saveStorage, updateStorage };
package/dist/user.js CHANGED
@@ -173,6 +173,17 @@ export const logout = notImplemented;
173
173
  export const updateStorage = notImplemented;
174
174
  export const saveStorage = notImplemented;
175
175
 
176
+ const baseUrl = `https://www.aid.no.localhost.api.no/aid`;
177
+ export const aidUrls = {
178
+ mainPage: new URL(baseUrl),
179
+ privacyStatement: new URL(`${baseUrl}/personvern`),
180
+ privacyPreferences: new URL(`${baseUrl}/personvern/oversikt`),
181
+ termsOfService: new URL(`${baseUrl}/brukervilkar`),
182
+ family: new URL(`${baseUrl}/familie`),
183
+ profile: new URL(`${baseUrl}/profil`),
184
+ sites: new URL(`${baseUrl}/nettsteder`),
185
+ };
186
+
176
187
  if (!isRunningOnLocalhost()) {
177
188
  throw new Error('You must use @amedia/user through Eik. Please read docs');
178
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amedia/user",
3
- "version": "0.14.93",
3
+ "version": "0.14.95",
4
4
  "description": "Client lib for working with aID user and associated data",
5
5
  "repository": "https://github.com/amedia/amedia-user-js",
6
6
  "author": "Amedia Utvikling (ID og data)",
@@ -52,12 +52,12 @@
52
52
  "@amedia/kragl": "^1.2.3",
53
53
  "@changesets/changelog-github": "^0.4.8",
54
54
  "@changesets/cli": "^2.26.0",
55
- "@eik/esbuild-plugin": "^1.1.28",
55
+ "@eik/esbuild-plugin": "^1.1.29",
56
56
  "@types/jest": "^29.4.0",
57
- "@types/node": "^18.11.18",
57
+ "@types/node": "^18.13.0",
58
58
  "concurrently": "^7.6.0",
59
59
  "cors": "^2.8.5",
60
- "esbuild": "0.17.5",
60
+ "esbuild": "0.17.6",
61
61
  "express": "^4.18.2",
62
62
  "jest": "^29.4.1",
63
63
  "jest-environment-jsdom": "^29.4.1",
@@ -66,7 +66,7 @@
66
66
  "mockdate": "^3.0.5",
67
67
  "npm-run-all": "^4.1.5",
68
68
  "prettier": "^2.8.3",
69
- "rollup": "3.12.1",
69
+ "rollup": "3.14.0",
70
70
  "rollup-plugin-dts": "5.1.1",
71
71
  "ts-jest": "^29.0.5",
72
72
  "tslib": "^2.5.0",