@amedia/user 0.8.1 → 0.10.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/.codeclimate.yml +1 -0
- package/dist/actions/authentication.d.ts +2 -1
- package/dist/actions/authorization.d.ts +5 -1
- package/dist/actions/storage.d.ts +1 -0
- package/dist/clients/europa.d.ts +16 -5
- package/dist/eventHandlers/userAttributes.d.ts +7 -1
- package/dist/exceptions/PaywallError.d.ts +7 -0
- package/dist/index.d.ts +8 -10
- package/dist/index.js +1 -1
- package/dist/lib/PaywallUnlocker.d.ts +16 -0
- package/dist/lib/PaywallUnlocker.spec.d.ts +4 -0
- package/dist/lib/User.d.ts +21 -0
- package/dist/lib/cookie.d.ts +1 -1
- package/dist/store/index.d.ts +10 -1
- package/dist/types.d.ts +4 -10
- package/dist/utils/location.d.ts +2 -0
- package/esm/user.js +6499 -0
- package/esm/user.js.map +1 -0
- package/package.json +1 -1
- package/src/actions/authentication.ts +10 -2
- package/src/actions/authorization.ts +58 -3
- package/src/actions/preferences.spec.ts +2 -2
- package/src/actions/preferences.ts +2 -2
- package/src/actions/storage.ts +8 -0
- package/src/clients/europa.spec.ts +11 -20
- package/src/clients/europa.ts +8 -12
- package/src/clients/nebula.ts +1 -1
- package/src/eventHandlers/userAttributes.ts +15 -0
- package/src/exceptions/PaywallError.ts +13 -0
- package/src/index-subscription.spec.ts +110 -39
- package/src/index.ts +7 -67
- package/src/lib/PaywallUnlocker.spec.ts +196 -0
- package/src/lib/PaywallUnlocker.ts +113 -0
- package/src/lib/User.ts +163 -0
- package/src/lib/cookie.ts +1 -1
- package/src/store/index.ts +2 -0
- package/src/types.ts +4 -9
- package/src/utils/customEventWrapper.ts +2 -2
- package/src/utils/location.ts +6 -0
package/dist/store/index.d.ts
CHANGED
|
@@ -2,10 +2,19 @@ import { State, UserAttributes } from '../types';
|
|
|
2
2
|
declare type StoreDataMap = {
|
|
3
3
|
userAttributes: UserAttributes;
|
|
4
4
|
state: State;
|
|
5
|
+
storage: {
|
|
6
|
+
[namespace: string]: {
|
|
7
|
+
[index: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
5
10
|
};
|
|
6
11
|
declare type Listener<T> = (data: T) => void;
|
|
7
12
|
declare const _default: {
|
|
8
|
-
set: (key: keyof StoreDataMap, value: UserAttributes | State
|
|
13
|
+
set: (key: keyof StoreDataMap, value: UserAttributes | State | {
|
|
14
|
+
[namespace: string]: {
|
|
15
|
+
[index: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
}) => void;
|
|
9
18
|
get: <K extends keyof StoreDataMap, T = StoreDataMap[K]>(key: K) => T | undefined;
|
|
10
19
|
on: <K_1 extends keyof StoreDataMap, T_1 = StoreDataMap[K_1]>(key: K_1, listener: Listener<T_1>) => void;
|
|
11
20
|
clear: () => void;
|
package/dist/types.d.ts
CHANGED
|
@@ -8,20 +8,14 @@ export declare type UserAttributes = {
|
|
|
8
8
|
};
|
|
9
9
|
access?: string[];
|
|
10
10
|
privacyPreferences?: PrivacyPreferences;
|
|
11
|
-
storage?: {
|
|
12
|
-
[index: string]: unknown;
|
|
13
|
-
};
|
|
14
11
|
};
|
|
15
12
|
export declare type State = {
|
|
16
13
|
isLoggedIn: boolean;
|
|
17
14
|
emergencyMode?: string[];
|
|
18
15
|
};
|
|
19
|
-
export declare type AnonymousAttributes = {
|
|
20
|
-
age: number;
|
|
21
|
-
};
|
|
22
16
|
export declare type PrivacyPreferences = {
|
|
23
|
-
allowResearchUsage:
|
|
24
|
-
connectWithSurveys:
|
|
25
|
-
personalizedAds:
|
|
26
|
-
personalizedContent:
|
|
17
|
+
allowResearchUsage: boolean;
|
|
18
|
+
connectWithSurveys: boolean;
|
|
19
|
+
personalizedAds: boolean;
|
|
20
|
+
personalizedContent: boolean;
|
|
27
21
|
};
|