@amedia/user 0.14.60 → 0.14.62

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/dist/personas.js CHANGED
@@ -28,6 +28,7 @@ export default {
28
28
  'aib_ag_30,aib_co_38,aib_ge_01,aib_lp_08,aib_mu_3808',
29
29
  aib_ad_segments_user:
30
30
  'aib_ag_30,aib_co_38,aib_ge_01,aib_lp_08,aib_mu_3808',
31
+ altno_betatester: 'true',
31
32
  birth_year: '1983',
32
33
  birth_year_user: '1983',
33
34
  customer_grouping_number: '0',
package/dist/user.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as rt from 'runtypes';
2
2
 
3
- declare type UserAttributes = {
3
+ type UserAttributes = {
4
4
  uuid: string | null;
5
5
  name: string | null;
6
6
  trackingKey: string | null;
@@ -11,18 +11,18 @@ declare type UserAttributes = {
11
11
  access: string[];
12
12
  privacyPreferences: PrivacyPreferences | null;
13
13
  };
14
- declare type State = {
14
+ type State = {
15
15
  isLoggedIn: boolean;
16
16
  emergencyMode?: string[];
17
17
  };
18
- declare type PrivacyPreferences = {
18
+ type PrivacyPreferences = {
19
19
  allowResearchUsage: boolean;
20
20
  connectWithSurveys: boolean;
21
21
  personalizedAds: boolean;
22
22
  personalizedContent: boolean;
23
23
  };
24
24
 
25
- declare type Millis = number;
25
+ type Millis = number;
26
26
  declare class UserDataRequest<UA extends UserAttributes, S extends {
27
27
  [index: string]: unknown;
28
28
  }, Attributes extends Array<keyof UA>, Namespaces extends Array<string>, SubscribeResponse extends Record<string, unknown> & {
@@ -64,9 +64,9 @@ declare const PrimarySiteSchema: rt.Record<{
64
64
  affiliation: rt.Literal<AffiliationType.ACCESS>;
65
65
  affiliations: rt.Array<rt.Union<[rt.Literal<AffiliationType.ACCESS>, rt.Literal<AffiliationType.FAMILY>, rt.Literal<AffiliationType.SUBSCRIPTION>]>, false>;
66
66
  }, false>;
67
- declare type PrimarySite = rt.Static<typeof PrimarySiteSchema>;
67
+ type PrimarySite = rt.Static<typeof PrimarySiteSchema>;
68
68
 
69
- declare type PaywallUnlockResponse = {
69
+ type PaywallUnlockResponse = {
70
70
  isLoggedIn: boolean;
71
71
  hasAccess: boolean;
72
72
  primarySite?: null | PrimarySite;
@@ -97,7 +97,7 @@ declare class PaywallError extends Error {
97
97
  constructor(message: string, code: string);
98
98
  }
99
99
 
100
- declare type Storage = Record<string, Record<string, string>>;
100
+ type Storage = Record<string, Record<string, string>>;
101
101
  /**
102
102
  * This will, if necessary, trigger a redirect to www.aid.no and return
103
103
  * to the requestedUrl if supplied or the current url before redirecting away if not.
package/dist/user.js CHANGED
@@ -2,7 +2,8 @@ import personas from './personas.js';
2
2
 
3
3
  function isRunningOnLocalhost() {
4
4
  return (
5
- location.host === 'localhost' || /localhost.api.no$/.test(location.host)
5
+ location.hostname === 'localhost' ||
6
+ /localhost.api.no$/.test(location.hostname)
6
7
  );
7
8
  }
8
9
 
@@ -22,7 +23,8 @@ function getMockData() {
22
23
  console.warn(
23
24
  `[@amedia/user]: Unknown persona (${persona}) was selected. Falling back to 'donald'.`,
24
25
  '\n\nAvailable personas\n',
25
- availablePersonas
26
+ availablePersonas,
27
+ 'Control active persona by setting aid_persona=persona search param.'
26
28
  );
27
29
  persona = 'donald';
28
30
  }
@@ -34,7 +36,8 @@ function getMockData() {
34
36
  '\n\nOther personas available:\n',
35
37
  Object.keys(availablePersonas)
36
38
  .filter((p) => p !== persona)
37
- .reduce((p, c) => (p[c] = availablePersonas[c]) && p, {})
39
+ .reduce((p, c) => (p[c] = availablePersonas[c]) && p, {}),
40
+ 'Control active persona by setting aid_persona=persona search param.'
38
41
  );
39
42
  }
40
43
  currentPersona = persona;
@@ -143,6 +146,7 @@ export class PaywallUnlockRequest {
143
146
  }
144
147
  }
145
148
 
149
+ export const getLoginUrl = () => '/stubbed-login-url';
146
150
  export const goToLoginPage = notImplemented;
147
151
  export const logout = notImplemented;
148
152
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amedia/user",
3
- "version": "0.14.60",
3
+ "version": "0.14.62",
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)",
@@ -46,7 +46,7 @@
46
46
  "@amedia/browserid": "^1.0.17",
47
47
  "@amedia/frontend-rpc": "^0.0.12",
48
48
  "runtypes": "^6.6.0",
49
- "ts-deepmerge": "^4.0.0"
49
+ "ts-deepmerge": "^5.0.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@amedia/kragl": "^1.2.3",
@@ -54,22 +54,23 @@
54
54
  "@changesets/cli": "^2.25.2",
55
55
  "@eik/cli": "^2.0.22",
56
56
  "@eik/esbuild-plugin": "^1.1.23",
57
- "@types/jest": "^29.2.2",
58
- "concurrently": "^7.5.0",
57
+ "@types/jest": "^29.2.3",
58
+ "@types/node": "^18.11.9",
59
+ "concurrently": "^7.6.0",
59
60
  "cors": "^2.8.5",
60
- "esbuild": "0.15.13",
61
+ "esbuild": "0.15.15",
61
62
  "express": "^4.18.2",
62
63
  "jest": "^29.3.1",
63
- "jest-environment-jsdom": "^29.2.2",
64
+ "jest-environment-jsdom": "^29.3.1",
64
65
  "jest-extended": "^3.1.0",
65
66
  "jest-fetch-mock": "^3.0.3",
66
67
  "mockdate": "^3.0.5",
67
68
  "npm-run-all": "^4.1.5",
68
69
  "prettier": "^2.7.1",
69
- "rollup": "3.2.5",
70
+ "rollup": "3.3.0",
70
71
  "rollup-plugin-dts": "5.0.0",
71
72
  "ts-jest": "^29.0.3",
72
73
  "tslib": "^2.4.1",
73
- "typescript": "^4.8.4"
74
+ "typescript": "^4.9.3"
74
75
  }
75
76
  }