@amedia/user 0.13.34 → 0.13.36
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/user.cjs +15 -0
- package/dist/{index.js.map → user.cjs.map} +3 -3
- package/dist/{index.d.ts → user.d.ts} +12 -0
- package/dist/user.js +15 -0
- package/dist/{index.esm.js.map → user.js.map} +3 -3
- package/package.json +9 -6
- package/.codeclimate.yml +0 -8
- package/.eslintignore +0 -2
- package/.eslintrc +0 -11
- package/.prettierrc.json +0 -1
- package/@types/amedia-frontend-rpc.d.ts +0 -11
- package/@types/browserid.d.ts +0 -4
- package/build.js +0 -28
- package/checkVersion.cjs +0 -12
- package/cloudbuild.json +0 -29
- package/cop.json +0 -8
- package/dist/actions/authentication.d.ts +0 -4
- package/dist/actions/authentication.spec.d.ts +0 -1
- package/dist/actions/authorization.d.ts +0 -14
- package/dist/actions/authorization.spec.d.ts +0 -4
- package/dist/actions/preferences.d.ts +0 -9
- package/dist/actions/preferences.spec.d.ts +0 -1
- package/dist/actions/storage.d.ts +0 -7
- package/dist/actions/userData.d.ts +0 -2
- package/dist/actions/userData.spec.d.ts +0 -1
- package/dist/autologin/index.d.ts +0 -7
- package/dist/autologin/index.spec.d.ts +0 -1
- package/dist/autologin/thirdPartyCookie.d.ts +0 -3
- package/dist/autologin/thirdPartyCookie.spec.d.ts +0 -1
- package/dist/cache/engines/global.d.ts +0 -24
- package/dist/cache/engines/global.spec.d.ts +0 -1
- package/dist/cache/index.d.ts +0 -11
- package/dist/cache/index.spec.d.ts +0 -1
- package/dist/cache/types.d.ts +0 -11
- package/dist/clients/europa.d.ts +0 -24
- package/dist/clients/europa.spec.d.ts +0 -1
- package/dist/clients/jupiter.d.ts +0 -30
- package/dist/clients/jupiter.spec.d.ts +0 -1
- package/dist/clients/mercury.d.ts +0 -3
- package/dist/clients/mercury.spec.d.ts +0 -1
- package/dist/clients/mercuryLog.d.ts +0 -8
- package/dist/clients/mercuryLog.spec.d.ts +0 -1
- package/dist/clients/nebula.d.ts +0 -2
- package/dist/clients/nebula.spec.d.ts +0 -1
- package/dist/clients/pluto.d.ts +0 -4
- package/dist/clients/pluto.spec.d.ts +0 -1
- package/dist/eventHandlers/activation.d.ts +0 -15
- package/dist/eventHandlers/authentication.d.ts +0 -17
- package/dist/eventHandlers/eventMap.d.ts +0 -29
- package/dist/eventHandlers/state.d.ts +0 -1
- package/dist/eventHandlers/state.spec.d.ts +0 -1
- package/dist/eventHandlers/storage.d.ts +0 -1
- package/dist/eventHandlers/storage.spec.d.ts +0 -1
- package/dist/eventHandlers/userAttributes.d.ts +0 -1
- package/dist/eventHandlers/userAttributes.spec.d.ts +0 -1
- package/dist/exceptions/PaywallError.d.ts +0 -8
- package/dist/index-authentcation.spec.d.ts +0 -1
- package/dist/index-storage.spec.d.ts +0 -1
- package/dist/index-subscription.spec.d.ts +0 -1
- package/dist/index.esm.js +0 -15
- package/dist/index.js +0 -15
- package/dist/janitor/index.d.ts +0 -10
- package/dist/janitor/index.spec.d.ts +0 -1
- package/dist/janitor/jobs/accessCookieRefresher.d.ts +0 -1
- package/dist/janitor/jobs/accessCookieRefresher.spec.d.ts +0 -1
- package/dist/janitor/jobs/daxsubCookie.d.ts +0 -3
- package/dist/janitor/jobs/daxsubCookie.spec.d.ts +0 -1
- package/dist/janitor/jobs/removeUserStorage.d.ts +0 -1
- package/dist/janitor/jobs/removeUserStorage.spec.d.ts +0 -1
- package/dist/lib/PaywallUnlockRequest.d.ts +0 -17
- package/dist/lib/PaywallUnlockRequest.spec.d.ts +0 -1
- package/dist/lib/UserDataRequest.d.ts +0 -22
- package/dist/lib/UserDataRequest.spec.d.ts +0 -1
- package/dist/lib/cookie.d.ts +0 -9
- package/dist/lib/rpc.d.ts +0 -6
- package/dist/store/index.d.ts +0 -23
- package/dist/store/index.spec.d.ts +0 -1
- package/dist/types.d.ts +0 -22
- package/dist/utils/customEventWrapper.d.ts +0 -19
- package/dist/utils/debouncer.d.ts +0 -26
- package/dist/utils/debouncer.spec.d.ts +0 -1
- package/dist/utils/deepEquals.d.ts +0 -1
- package/dist/utils/expectBootLogs.d.ts +0 -2
- package/dist/utils/getOrUpdate.d.ts +0 -6
- package/dist/utils/getOrUpdate.spec.d.ts +0 -1
- package/dist/utils/localhostCheck.d.ts +0 -1
- package/dist/utils/location.d.ts +0 -3
- package/dist/utils/log.d.ts +0 -9
- package/dist/utils/log.spec.d.ts +0 -1
- package/dist/utils/loginState.d.ts +0 -2
- package/dist/utils/networkError.d.ts +0 -1
- package/dist/utils/queue.d.ts +0 -12
- package/dist/utils/type.d.ts +0 -6
- package/dist/utils/url.d.ts +0 -6
- package/dist/utils/url.spec.d.ts +0 -1
- package/eik.json +0 -10
- package/global.d.ts +0 -1
- package/jest.config.js +0 -7
- package/setupJest.js +0 -1
- package/src/actions/authentication.spec.ts +0 -51
- package/src/actions/authentication.ts +0 -43
- package/src/actions/authorization.spec.ts +0 -369
- package/src/actions/authorization.ts +0 -117
- package/src/actions/preferences.spec.ts +0 -41
- package/src/actions/preferences.ts +0 -41
- package/src/actions/storage.ts +0 -22
- package/src/actions/userData.spec.ts +0 -133
- package/src/actions/userData.ts +0 -68
- package/src/autologin/index.spec.ts +0 -239
- package/src/autologin/index.ts +0 -92
- package/src/autologin/thirdPartyCookie.spec.ts +0 -95
- package/src/autologin/thirdPartyCookie.ts +0 -55
- package/src/cache/engines/global.spec.ts +0 -62
- package/src/cache/engines/global.ts +0 -48
- package/src/cache/index.spec.ts +0 -130
- package/src/cache/index.ts +0 -48
- package/src/cache/types.ts +0 -12
- package/src/clients/europa.spec.ts +0 -209
- package/src/clients/europa.ts +0 -183
- package/src/clients/jupiter.spec.ts +0 -179
- package/src/clients/jupiter.ts +0 -119
- package/src/clients/mercury.spec.ts +0 -59
- package/src/clients/mercury.ts +0 -48
- package/src/clients/mercuryLog.spec.ts +0 -20
- package/src/clients/mercuryLog.ts +0 -67
- package/src/clients/nebula.spec.ts +0 -70
- package/src/clients/nebula.ts +0 -83
- package/src/clients/pluto.spec.ts +0 -165
- package/src/clients/pluto.ts +0 -118
- package/src/eventHandlers/activation.ts +0 -35
- package/src/eventHandlers/authentication.ts +0 -34
- package/src/eventHandlers/eventMap.ts +0 -34
- package/src/eventHandlers/state.spec.ts +0 -48
- package/src/eventHandlers/state.ts +0 -23
- package/src/eventHandlers/storage.spec.ts +0 -114
- package/src/eventHandlers/storage.ts +0 -45
- package/src/eventHandlers/userAttributes.spec.ts +0 -93
- package/src/eventHandlers/userAttributes.ts +0 -31
- package/src/exceptions/PaywallError.ts +0 -16
- package/src/index-authentcation.spec.ts +0 -26
- package/src/index-storage.spec.ts +0 -144
- package/src/index-subscription.spec.ts +0 -213
- package/src/index.ts +0 -59
- package/src/janitor/index.spec.ts +0 -18
- package/src/janitor/index.ts +0 -59
- package/src/janitor/jobs/accessCookieRefresher.spec.ts +0 -213
- package/src/janitor/jobs/accessCookieRefresher.ts +0 -98
- package/src/janitor/jobs/daxsubCookie.spec.ts +0 -109
- package/src/janitor/jobs/daxsubCookie.ts +0 -38
- package/src/janitor/jobs/removeUserStorage.spec.ts +0 -34
- package/src/janitor/jobs/removeUserStorage.ts +0 -12
- package/src/lib/PaywallUnlockRequest.spec.ts +0 -363
- package/src/lib/PaywallUnlockRequest.ts +0 -143
- package/src/lib/UserDataRequest.spec.ts +0 -77
- package/src/lib/UserDataRequest.ts +0 -213
- package/src/lib/cookie.ts +0 -121
- package/src/lib/rpc.ts +0 -19
- package/src/store/index.spec.ts +0 -49
- package/src/store/index.ts +0 -64
- package/src/types.ts +0 -22
- package/src/utils/customEventWrapper.ts +0 -58
- package/src/utils/debouncer.spec.ts +0 -252
- package/src/utils/debouncer.ts +0 -123
- package/src/utils/deepEquals.ts +0 -42
- package/src/utils/expectBootLogs.ts +0 -9
- package/src/utils/getOrUpdate.spec.ts +0 -166
- package/src/utils/getOrUpdate.ts +0 -66
- package/src/utils/localhostCheck.ts +0 -9
- package/src/utils/location.ts +0 -31
- package/src/utils/log.spec.ts +0 -148
- package/src/utils/log.ts +0 -124
- package/src/utils/loginState.ts +0 -24
- package/src/utils/networkError.ts +0 -11
- package/src/utils/queue.ts +0 -32
- package/src/utils/type.ts +0 -19
- package/src/utils/url.spec.ts +0 -33
- package/src/utils/url.ts +0 -35
- package/testSetup.js +0 -19
- package/tsconfig.eslint.json +0 -24
- package/tsconfig.json +0 -18
package/package.json
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amedia/user",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.36",
|
|
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)",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"main": "dist/index.
|
|
9
|
-
"module": "dist/index.
|
|
8
|
+
"main": "dist/index.cjs",
|
|
9
|
+
"module": "dist/index.js",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
-
"require": "./dist/index.
|
|
13
|
-
"import": "./dist/index.
|
|
12
|
+
"require": "./dist/index.cjs",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/*"
|
|
18
|
+
],
|
|
16
19
|
"typings": "dist/index.d.ts",
|
|
17
20
|
"scripts": {
|
|
18
21
|
"test": "jest --coverage",
|
|
19
22
|
"lint": "eslint ./src --ext .ts",
|
|
20
23
|
"build": "npm install && node build.js",
|
|
21
|
-
"typings": "tsc",
|
|
24
|
+
"typings": "tsc --noEmit",
|
|
22
25
|
"eik:package": "run-p typings lint && npm run test && npm run build && eik package",
|
|
23
26
|
"prepublishOnly": "node checkVersion.cjs && run-p typings lint && npm run test && npm run build",
|
|
24
27
|
"postpublish": "eik package"
|
package/.codeclimate.yml
DELETED
package/.eslintignore
DELETED
package/.eslintrc
DELETED
package/.prettierrc.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"@amedia/eslint-config-base/prettier.config"
|
package/@types/browserid.d.ts
DELETED
package/build.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { build } from 'esbuild';
|
|
2
|
-
import npmdts from 'npm-dts';
|
|
3
|
-
const { Generator } = npmdts;
|
|
4
|
-
|
|
5
|
-
const shared = {
|
|
6
|
-
entryPoints: ['src/index.ts'],
|
|
7
|
-
bundle: true,
|
|
8
|
-
minify: true,
|
|
9
|
-
sourcemap: true,
|
|
10
|
-
keepNames: true,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
build({
|
|
14
|
-
...shared,
|
|
15
|
-
outfile: 'dist/index.js',
|
|
16
|
-
format: 'cjs',
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
build({
|
|
20
|
-
...shared,
|
|
21
|
-
outfile: 'dist/index.esm.js',
|
|
22
|
-
format: 'esm',
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
new Generator({
|
|
26
|
-
entry: 'src/index.ts',
|
|
27
|
-
output: 'dist/index.d.ts',
|
|
28
|
-
}).generate();
|
package/checkVersion.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const pkg = require('./package.json');
|
|
2
|
-
const eik = require('./eik.json');
|
|
3
|
-
|
|
4
|
-
const FgRed = '\x1b[31m';
|
|
5
|
-
|
|
6
|
-
if (pkg.version !== eik.version) {
|
|
7
|
-
console.warn(`NPM: ${pkg.version} vs. ${eik.version} :EIK`);
|
|
8
|
-
console.error(
|
|
9
|
-
`${FgRed}NPM and EIK package versions must be identical. Exiting\n`
|
|
10
|
-
);
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
package/cloudbuild.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"steps": [
|
|
3
|
-
{
|
|
4
|
-
"name": "eu.gcr.io/amedia-core/ci/images/npm:14.13.1",
|
|
5
|
-
"args": ["install"]
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
"name": "eu.gcr.io/amedia-core/ci/images/npm:14.13.1",
|
|
9
|
-
"args": ["run", "lint"]
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"name": "eu.gcr.io/amedia-core/ci/images/npm:14.13.1",
|
|
13
|
-
"args": ["test"]
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "eu.gcr.io/amedia-core/ci/images/codeclimate-node:latest",
|
|
17
|
-
"env": [
|
|
18
|
-
"NODE_ENV=production",
|
|
19
|
-
"GIT_COMMIT_SHA=$COMMIT_SHA",
|
|
20
|
-
"GIT_BRANCH=$BRANCH_NAME",
|
|
21
|
-
"CC_TEST_REPORTER_ID=452ebe79c5e6a52d702bf1be68a94575029148333692a6d8a8abf10d6be7a4c5",
|
|
22
|
-
"COVERAGE_IN=/workspace/coverage/lcov.info",
|
|
23
|
-
"COVERAGE_OUT=/workspace/coverage/lcov.json",
|
|
24
|
-
"MODULE_PREFIX=/workspace"
|
|
25
|
-
],
|
|
26
|
-
"dir": "${_DIR}"
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
}
|
package/cop.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { UserAttributes } from '../types';
|
|
2
|
-
declare type SetCookieResponse = {
|
|
3
|
-
success: boolean;
|
|
4
|
-
accessFeatures: string[];
|
|
5
|
-
};
|
|
6
|
-
export declare const getAccess: (accessFeatures?: string[]) => Promise<Pick<UserAttributes, 'access'>>;
|
|
7
|
-
export declare const activate: (accessFeatures: string[]) => Promise<string[]>;
|
|
8
|
-
export declare const hasAccess: (currentAccessFeatures: string[], requestedAccessFeatures: string[]) => boolean;
|
|
9
|
-
export declare const setUserAccessCookie: (publicationDomain: string) => Promise<SetCookieResponse>;
|
|
10
|
-
export declare const setNonUserAccessCookie: (publicationDomain: string) => Promise<SetCookieResponse>;
|
|
11
|
-
export declare const setAccessCookies: (publicationDomain: string) => Promise<SetCookieResponse>;
|
|
12
|
-
export declare const setHasPerformedPaywallReload: (requestedUrl?: string | undefined) => void;
|
|
13
|
-
export declare const hasRecentlyPerformedPaywallReload: (requestedUrl?: string | undefined) => boolean;
|
|
14
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Record, Boolean } from 'runtypes';
|
|
2
|
-
import { UserAttributes } from '../types';
|
|
3
|
-
export declare const PrivacyPreferencesSchema: Record<{
|
|
4
|
-
allowResearchUsage: Boolean;
|
|
5
|
-
connectWithSurveys: Boolean;
|
|
6
|
-
personalizedAds: Boolean;
|
|
7
|
-
personalizedContent: Boolean;
|
|
8
|
-
}, false>;
|
|
9
|
-
export declare const getPrivacyPreferences: () => Promise<Pick<UserAttributes, 'privacyPreferences'>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare type Strategies = Array<{
|
|
2
|
-
name: string;
|
|
3
|
-
handler: () => Promise<boolean>;
|
|
4
|
-
}>;
|
|
5
|
-
export declare const AUTOLOGIN_COOKIE_TTL = 60000;
|
|
6
|
-
export declare const attemptAutoLoginJob: () => Promise<void>;
|
|
7
|
-
export declare const attemptPaywallAutoLogin: () => Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CacheEntry, Engine } from '../types';
|
|
2
|
-
declare global {
|
|
3
|
-
export var amediaUserCache: {
|
|
4
|
-
[index: string]: CacheEntry;
|
|
5
|
-
};
|
|
6
|
-
interface Window {
|
|
7
|
-
amediaUserCache?: {
|
|
8
|
-
[index: string]: CacheEntry;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
namespace NodeJS {
|
|
12
|
-
interface Global {
|
|
13
|
-
amediaUserCache?: {
|
|
14
|
-
[index: string]: CacheEntry;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export declare const get: (key: string) => Promise<CacheEntry>;
|
|
20
|
-
export declare const set: (key: string, data: unknown, expires: number) => Promise<void>;
|
|
21
|
-
export declare const remove: (key: string) => Promise<void>;
|
|
22
|
-
export declare const clear: () => Promise<void>;
|
|
23
|
-
declare const _default: Engine;
|
|
24
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/cache/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Static } from 'runtypes';
|
|
2
|
-
import { RuntypeBase } from 'runtypes/lib/runtype';
|
|
3
|
-
import { Engine } from './types';
|
|
4
|
-
export declare const setCacheEngine: (engine: Engine) => void;
|
|
5
|
-
declare const _default: {
|
|
6
|
-
get: <T extends RuntypeBase<unknown>>(key: string, validator: T) => Promise<void | Static<T>>;
|
|
7
|
-
set: (key: string, value: unknown, expires: number) => Promise<void>;
|
|
8
|
-
remove: (key: string) => Promise<void>;
|
|
9
|
-
clear: () => Promise<void>;
|
|
10
|
-
};
|
|
11
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/cache/types.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare type CacheEntry = {
|
|
2
|
-
key: string;
|
|
3
|
-
data: unknown;
|
|
4
|
-
expires: number;
|
|
5
|
-
};
|
|
6
|
-
export declare type Engine = {
|
|
7
|
-
get: (key: string) => Promise<CacheEntry | null>;
|
|
8
|
-
set: (key: string, data: unknown, expires: number) => Promise<void>;
|
|
9
|
-
remove: (key: string) => Promise<void>;
|
|
10
|
-
clear: () => Promise<void>;
|
|
11
|
-
};
|
package/dist/clients/europa.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Unknown, Dictionary } from 'runtypes';
|
|
2
|
-
export declare const EuropaSchema: Dictionary<Unknown, string>;
|
|
3
|
-
export declare const clearLocalCache: () => Promise<void>;
|
|
4
|
-
export declare const updateNamespace: (namespace: string, data: Object) => Promise<void | {}>;
|
|
5
|
-
export declare const getNamespaces: <S extends {
|
|
6
|
-
[namespace: string]: {
|
|
7
|
-
[index: string]: unknown;
|
|
8
|
-
};
|
|
9
|
-
}, Namespaces extends (keyof S)[]>(namespaces: Namespaces, options?: {
|
|
10
|
-
ignoreCache: boolean;
|
|
11
|
-
}) => Promise<Pick<S, Namespaces[number]>>;
|
|
12
|
-
export declare const saveNamespace: (namespace: string, data: Object) => Promise<Pick<{
|
|
13
|
-
[namespace: string]: {
|
|
14
|
-
[index: string]: unknown;
|
|
15
|
-
};
|
|
16
|
-
}, string>>;
|
|
17
|
-
export declare const getAllNamespaces: () => Promise<{
|
|
18
|
-
[x: string]: unknown;
|
|
19
|
-
}>;
|
|
20
|
-
export declare const deleteNamespaceKey: (namespace: string, key: string) => Promise<Pick<{
|
|
21
|
-
[namespace: string]: {
|
|
22
|
-
[index: string]: unknown;
|
|
23
|
-
};
|
|
24
|
-
}, string>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Array, Literal, Number, Record, Static, String, Union } from 'runtypes';
|
|
2
|
-
import { UserAttributes } from '../types';
|
|
3
|
-
export declare type AccessFeatures = string[];
|
|
4
|
-
export declare const CheckAccessForPaperSchema: Record<{
|
|
5
|
-
status: Literal<"success">;
|
|
6
|
-
access: Union<[Literal<"granted">, Literal<"denied">]>;
|
|
7
|
-
publication: Record<{
|
|
8
|
-
id: Number;
|
|
9
|
-
domain: String;
|
|
10
|
-
}, false>;
|
|
11
|
-
access_features: Array<String, false>;
|
|
12
|
-
}, false>;
|
|
13
|
-
export declare type CheckAccessForPaper = Static<typeof CheckAccessForPaperSchema>;
|
|
14
|
-
declare const GetVstokenSchema: Record<{
|
|
15
|
-
status: Literal<"success">;
|
|
16
|
-
cookie: String;
|
|
17
|
-
access_features: Array<String, false>;
|
|
18
|
-
}, false>;
|
|
19
|
-
export declare type GetVstoken = Static<typeof GetVstokenSchema>;
|
|
20
|
-
declare const GetNonUserAccessSchema: Record<{
|
|
21
|
-
status: Literal<"success">;
|
|
22
|
-
vstoken_cookie: String;
|
|
23
|
-
uuid: String;
|
|
24
|
-
access_features: Array<String, false>;
|
|
25
|
-
}, false>;
|
|
26
|
-
export declare type GetNonUserAccess = Static<typeof GetNonUserAccessSchema>;
|
|
27
|
-
export declare const checkForAccess: (publicationDomain: string, accessFeatures: AccessFeatures) => Promise<Pick<UserAttributes, 'access'>>;
|
|
28
|
-
export declare const getUserAccess: (publicationDomain: string) => Promise<GetVstoken>;
|
|
29
|
-
export declare const getNonUserAccess: (publicationDomain: string) => Promise<GetNonUserAccess>;
|
|
30
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare type Context = Record<string, unknown>;
|
|
2
|
-
declare const log: {
|
|
3
|
-
error: (message: string, context: Context) => void;
|
|
4
|
-
warn: (message: string, context: Context) => void;
|
|
5
|
-
info: (message: string, context: Context) => void;
|
|
6
|
-
debug: (message: string, context: Context) => void;
|
|
7
|
-
};
|
|
8
|
-
export default log;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/clients/nebula.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/clients/pluto.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { UserAttributes } from '../types';
|
|
2
|
-
export declare const resolveBadPlutoResponse: (response: Response) => Promise<void>;
|
|
3
|
-
export declare const getCurrentSession: () => Promise<UserAttributes>;
|
|
4
|
-
export declare const removeSession: (domain: string) => Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare enum ActivationEvents {
|
|
2
|
-
REQUEST_ACTIVATION = "amedia-user.activation.request-activation",
|
|
3
|
-
ON_ACTIVATION_COMPLETE = "amedia-user.activation.on-activation-complete"
|
|
4
|
-
}
|
|
5
|
-
declare global {
|
|
6
|
-
interface WindowEventMap {
|
|
7
|
-
[ActivationEvents.REQUEST_ACTIVATION]: CustomEvent<{
|
|
8
|
-
accessFeatures: string[];
|
|
9
|
-
}>;
|
|
10
|
-
[ActivationEvents.ON_ACTIVATION_COMPLETE]: CustomEvent<{
|
|
11
|
-
accessFeatures: string[];
|
|
12
|
-
}>;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export declare const listenForActivationRequests: () => void;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare enum AuthenticationEvents {
|
|
2
|
-
REQUEST_LOGIN = "amedia-user.authentication.request-login",
|
|
3
|
-
REQUEST_LOGOUT = "amedia-user.authentication.request-logout",
|
|
4
|
-
ON_LOGGED_OUT = "amedia-user.authentication.on-logged-out"
|
|
5
|
-
}
|
|
6
|
-
declare global {
|
|
7
|
-
interface WindowEventMap {
|
|
8
|
-
[AuthenticationEvents.REQUEST_LOGIN]: CustomEvent<{
|
|
9
|
-
requestedUrl: string;
|
|
10
|
-
}>;
|
|
11
|
-
[AuthenticationEvents.REQUEST_LOGOUT]: CustomEvent<{
|
|
12
|
-
onLoggedOut: () => void;
|
|
13
|
-
}>;
|
|
14
|
-
[AuthenticationEvents.ON_LOGGED_OUT]: CustomEvent;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export declare const listenForAuthenticationRequests: () => void;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { State, UserAttributes } from '../types';
|
|
2
|
-
export declare enum AmediaUserEvents {
|
|
3
|
-
REQUEST_STATE = "amedia-user.request-state",
|
|
4
|
-
REQUEST_USER_ATTRIBUTES = "amedia-user.request-user-attributes",
|
|
5
|
-
REQUEST_STORAGE_NAMESPACES = "amedia-user.request-storage-namespaces",
|
|
6
|
-
SAVE_STORAGE = "amedia-user.save-storage-namespaces",
|
|
7
|
-
UPDATE_STORAGE = "amedia-user.update-storage-namespaces",
|
|
8
|
-
ON_ATTRIBUTES_UPDATED = "amedia-user.on-user-attributes-updated",
|
|
9
|
-
ON_STATE_UPDATED = "amedia-user.on-state-updated",
|
|
10
|
-
ON_STORAGE_UPDATED = "amedia-user.on-storage-updated"
|
|
11
|
-
}
|
|
12
|
-
declare global {
|
|
13
|
-
interface WindowEventMap {
|
|
14
|
-
[AmediaUserEvents.REQUEST_STATE]: CustomEvent;
|
|
15
|
-
[AmediaUserEvents.REQUEST_USER_ATTRIBUTES]: CustomEvent<Array<keyof UserAttributes>>;
|
|
16
|
-
[AmediaUserEvents.REQUEST_STORAGE_NAMESPACES]: CustomEvent<Array<string>>;
|
|
17
|
-
[AmediaUserEvents.SAVE_STORAGE]: CustomEvent<{
|
|
18
|
-
[namespace: string]: object;
|
|
19
|
-
}>;
|
|
20
|
-
[AmediaUserEvents.UPDATE_STORAGE]: CustomEvent<{
|
|
21
|
-
[namespace: string]: object;
|
|
22
|
-
}>;
|
|
23
|
-
[AmediaUserEvents.ON_ATTRIBUTES_UPDATED]: CustomEvent<UserAttributes>;
|
|
24
|
-
[AmediaUserEvents.ON_STATE_UPDATED]: CustomEvent<State>;
|
|
25
|
-
[AmediaUserEvents.ON_STORAGE_UPDATED]: CustomEvent<{
|
|
26
|
-
[index: string]: unknown;
|
|
27
|
-
}>;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const listenForStateRequests: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const listenForStorageRequests: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const listenForUserAttributeRequests: () => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare class PaywallError extends Error {
|
|
2
|
-
static ERROR_RELOADED_NO_ACCESS: string;
|
|
3
|
-
static ERROR_ENABLING_ACCESS_FAILED: string;
|
|
4
|
-
static ERROR_NO_ACCESS_AFTER_SUCCESSFUL_ACTIVATION_WITH_REQUESTED_ACCESS_FEATURES: string;
|
|
5
|
-
code: string;
|
|
6
|
-
constructor(message: string, code: string);
|
|
7
|
-
}
|
|
8
|
-
export default PaywallError;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|