@schibsted/account-sdk-browser 6.0.0-alpha.1 → 6.0.0-alpha.11
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 +55 -280
- package/dist/account-sdk.d.ts +22 -0
- package/dist/account.d.ts +179 -0
- package/dist/cache.d.ts +65 -0
- package/dist/compatibility/index.d.ts +2 -0
- package/dist/compatibility/install-legacy-compatibility.d.ts +10 -0
- package/dist/compatibility/legacy-identity.d.ts +29 -0
- package/dist/compatibility/legacy-monetization.d.ts +9 -0
- package/dist/compatibility/types.d.ts +40 -0
- package/dist/compatibility/warnings.d.ts +3 -0
- package/dist/compatibility.js +167 -0
- package/dist/compatibility.js.map +1 -0
- package/dist/config.d.ts +86 -0
- package/dist/globals.d.ts +11 -0
- package/dist/has-access-response.d.ts +2 -0
- package/dist/identity.d.ts +302 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +782 -0
- package/dist/index.js.map +1 -0
- package/dist/monetization.d.ts +39 -0
- package/{src → dist}/object.d.ts +4 -9
- package/dist/popup.d.ts +9 -0
- package/dist/resolve-browser-window-X5jXljW9.js +55 -0
- package/dist/resolve-browser-window-X5jXljW9.js.map +1 -0
- package/dist/resolve-browser-window.d.ts +1 -0
- package/dist/rest-client.d.ts +102 -0
- package/dist/rest-clients.d.ts +10 -0
- package/dist/sdk-error.d.ts +29 -0
- package/dist/session-response.d.ts +54 -0
- package/dist/session-state.d.ts +13 -0
- package/{src/spidTalk.d.ts → dist/spid-talk.d.ts} +4 -6
- package/dist/types/account.d.ts +48 -0
- package/dist/types/common.d.ts +28 -0
- package/dist/types/identity.d.ts +23 -0
- package/dist/types/login.d.ts +125 -0
- package/dist/types/monetization.d.ts +26 -0
- package/dist/types/session.d.ts +146 -0
- package/dist/url.d.ts +8 -0
- package/dist/validate.d.ts +50 -0
- package/dist/version.d.ts +2 -0
- package/package.json +34 -25
- package/src/account-sdk.ts +92 -0
- package/src/account.ts +337 -0
- package/src/{cache.js → cache.ts} +53 -38
- package/src/compatibility/index.ts +10 -0
- package/src/compatibility/install-legacy-compatibility.ts +144 -0
- package/src/compatibility/legacy-identity.ts +220 -0
- package/src/compatibility/legacy-monetization.ts +30 -0
- package/src/compatibility/types.ts +76 -0
- package/src/compatibility/warnings.ts +28 -0
- package/src/{config.js → config.ts} +7 -32
- package/src/globals.ts +8 -0
- package/src/has-access-response.ts +35 -0
- package/src/identity.ts +1026 -0
- package/src/index.ts +40 -0
- package/src/monetization.ts +128 -0
- package/src/{object.js → object.ts} +9 -16
- package/src/popup.ts +74 -0
- package/src/resolve-browser-window.ts +11 -0
- package/src/rest-client.ts +253 -0
- package/src/rest-clients.ts +30 -0
- package/src/sdk-error.ts +61 -0
- package/src/session-response.ts +100 -0
- package/src/session-state.ts +20 -0
- package/src/{spidTalk.js → spid-talk.ts} +10 -12
- package/src/types/account.ts +55 -0
- package/src/types/common.ts +32 -0
- package/src/types/identity.ts +26 -0
- package/src/types/login.ts +150 -0
- package/src/types/monetization.ts +29 -0
- package/src/types/session.ts +169 -0
- package/src/{url.js → url.ts} +6 -10
- package/src/{validate.js → validate.ts} +27 -43
- package/src/{version.js → version.ts} +1 -2
- package/identity.d.ts +0 -1
- package/identity.js +0 -5
- package/index.d.ts +0 -4
- package/index.js +0 -9
- package/monetization.d.ts +0 -1
- package/monetization.js +0 -5
- package/payment.d.ts +0 -1
- package/payment.js +0 -5
- package/src/RESTClient.d.ts +0 -89
- package/src/RESTClient.js +0 -193
- package/src/SDKError.d.ts +0 -16
- package/src/SDKError.js +0 -55
- package/src/cache.d.ts +0 -64
- package/src/config.d.ts +0 -34
- package/src/global-registry.js +0 -20
- package/src/identity.d.ts +0 -679
- package/src/identity.js +0 -1154
- package/src/monetization.d.ts +0 -80
- package/src/monetization.js +0 -172
- package/src/payment.d.ts +0 -115
- package/src/payment.js +0 -211
- package/src/popup.d.ts +0 -10
- package/src/popup.js +0 -59
- package/src/url.d.ts +0 -10
- package/src/validate.d.ts +0 -64
- package/src/version.d.ts +0 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Account } from '../account.js';
|
|
2
|
+
import { LoginOptions } from '../types/login.js';
|
|
3
|
+
import { LegacyIdentity, LegacyLogoutListener } from './types.js';
|
|
4
|
+
export declare class LegacyIdentityAdapter implements LegacyIdentity {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(account: Account, clientId: string);
|
|
7
|
+
get clientId(): string;
|
|
8
|
+
get _session(): LegacyIdentity['_session'];
|
|
9
|
+
hasSession(): ReturnType<Account['hasSession']>;
|
|
10
|
+
isLoggedIn(): ReturnType<Account['isLoggedIn']>;
|
|
11
|
+
isConnected(): ReturnType<Account['isConnected']>;
|
|
12
|
+
getUser(): ReturnType<Account['getUser']>;
|
|
13
|
+
getUserId(): ReturnType<Account['getUserId']>;
|
|
14
|
+
getExternalId(...args: Parameters<Account['getExternalId']>): ReturnType<Account['getExternalId']>;
|
|
15
|
+
getUserUuid(): ReturnType<Account['getUserUuid']>;
|
|
16
|
+
getUserSDRN(): ReturnType<Account['getUserSDRN']>;
|
|
17
|
+
getUserContextData(): ReturnType<Account['getUserContextData']>;
|
|
18
|
+
getSpId(): ReturnType<Account['getSpId']>;
|
|
19
|
+
login(...args: Parameters<Account['login']>): ReturnType<Account['login']>;
|
|
20
|
+
logout(...args: Parameters<Account['logout']>): ReturnType<Account['logout']>;
|
|
21
|
+
loginUrl(options: LoginOptions): string;
|
|
22
|
+
loginUrl(state: string, acrValues?: string, scope?: string, redirectUri?: string, loginHint?: string, tag?: string, teaser?: string, maxAge?: number | string): string;
|
|
23
|
+
logoutUrl(...args: Parameters<Account['logoutUrl']>): ReturnType<Account['logoutUrl']>;
|
|
24
|
+
accountUrl(...args: Parameters<Account['accountUrl']>): ReturnType<Account['accountUrl']>;
|
|
25
|
+
showSimplifiedLoginWidget(...args: Parameters<Account['showSimplifiedLoginWidget']>): ReturnType<Account['showSimplifiedLoginWidget']>;
|
|
26
|
+
clearCachedUserSession(): ReturnType<Account['clearCachedUserSession']>;
|
|
27
|
+
on(event: 'logout', listener: LegacyLogoutListener, context?: unknown): this;
|
|
28
|
+
off(event: 'logout', listener?: LegacyLogoutListener): this;
|
|
29
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Account } from '../account.js';
|
|
2
|
+
import { SessionUserId } from '../types/session.js';
|
|
3
|
+
import { LegacyMonetization } from './types.js';
|
|
4
|
+
export declare class LegacyMonetizationAdapter implements LegacyMonetization {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(account: Account);
|
|
7
|
+
hasAccess(productIds: string[], _userId: SessionUserId): ReturnType<Account['hasAccess']>;
|
|
8
|
+
clearCachedAccessResult(productIds: string[], userId: SessionUserId): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Account } from '../account.js';
|
|
2
|
+
import { LoginOptions } from '../types/login.js';
|
|
3
|
+
import { SessionObjectResponse, SessionUserId } from '../types/session.js';
|
|
4
|
+
export type LegacyLogoutListener = (session?: SessionObjectResponse) => void;
|
|
5
|
+
type LegacyIdentityMethods = Pick<Account, 'hasSession' | 'isLoggedIn' | 'isConnected' | 'getUser' | 'getUserId' | 'getExternalId' | 'getUserUuid' | 'getUserSDRN' | 'getUserContextData' | 'getSpId' | 'login' | 'logout' | 'logoutUrl' | 'accountUrl' | 'showSimplifiedLoginWidget' | 'clearCachedUserSession'>;
|
|
6
|
+
export type LegacyIdentity = LegacyIdentityMethods & {
|
|
7
|
+
/** @deprecated Use `account.loginUrl(options)`. Removed in v7. */
|
|
8
|
+
loginUrl(options: LoginOptions): string;
|
|
9
|
+
/** @deprecated Pass an options object to `account.loginUrl()`. Removed in v7. */
|
|
10
|
+
loginUrl(state: string, acrValues?: string, scope?: string, redirectUri?: string, loginHint?: string, tag?: string, teaser?: string, maxAge?: number | string): string;
|
|
11
|
+
/** @deprecated Read the client id from application configuration. Removed in v7. */
|
|
12
|
+
readonly clientId: string;
|
|
13
|
+
/** @deprecated Use the Account session methods and events. Removed in v7. */
|
|
14
|
+
readonly _session: SessionObjectResponse;
|
|
15
|
+
/** @deprecated Only the legacy `logout` event is bridged. Removed in v7. */
|
|
16
|
+
on(event: 'logout', listener: LegacyLogoutListener, context?: unknown): LegacyIdentity;
|
|
17
|
+
/** @deprecated Only the legacy `logout` event is bridged. Removed in v7. */
|
|
18
|
+
off(event: 'logout', listener?: LegacyLogoutListener): LegacyIdentity;
|
|
19
|
+
};
|
|
20
|
+
export interface LegacyMonetization {
|
|
21
|
+
hasAccess(productIds: string[], userId: SessionUserId): ReturnType<Account['hasAccess']>;
|
|
22
|
+
clearCachedAccessResult(productIds: string[], userId: SessionUserId): void;
|
|
23
|
+
}
|
|
24
|
+
export type LegacyCompatibilityOptions = {
|
|
25
|
+
/** Client id exposed on the legacy Identity adapter for Sourcepoint compatibility. */
|
|
26
|
+
clientId: string;
|
|
27
|
+
/** Window on which the legacy globals and ready events should be installed. */
|
|
28
|
+
window?: Window;
|
|
29
|
+
};
|
|
30
|
+
declare global {
|
|
31
|
+
interface Window {
|
|
32
|
+
/** @deprecated Use `window.schAccount`. Removed in v7. */
|
|
33
|
+
schIdentity?: LegacyIdentity;
|
|
34
|
+
/** @deprecated Use `window.schAccount`. Removed in v7. */
|
|
35
|
+
Identity?: LegacyIdentity;
|
|
36
|
+
/** @deprecated Use `window.schAccount`. Removed in v7. */
|
|
37
|
+
schMonetization?: LegacyMonetization;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { d as e, n as t, o as n, r, t as i } from "./resolve-browser-window-X5jXljW9.js";
|
|
2
|
+
//#region src/compatibility/warnings.ts
|
|
3
|
+
var a = "[Account SDK compatibility]", o = !1, s = () => {
|
|
4
|
+
o || (o = !0, console.warn(`${a} The legacy compatibility layer is enabled. Migrate application code to the Account API. This compatibility layer will be removed in v7.`));
|
|
5
|
+
}, c = (e, t) => {
|
|
6
|
+
console.warn(`${a} ${e} is deprecated. Use ${t} instead. It will be removed in v7.`);
|
|
7
|
+
}, l = () => {
|
|
8
|
+
console.warn(`${a} schMonetization.hasAccess() ignores the legacy userId argument. Account.hasAccess() resolves the logged-in user automatically. It will be removed in v7.`);
|
|
9
|
+
}, u = class {
|
|
10
|
+
#e;
|
|
11
|
+
#t;
|
|
12
|
+
#n;
|
|
13
|
+
#r = [];
|
|
14
|
+
constructor(n, r) {
|
|
15
|
+
this.#e = n, this.#t = r;
|
|
16
|
+
let i = t.get(n);
|
|
17
|
+
if (!i) throw new e("Legacy compatibility requires an Account from the same SDK build");
|
|
18
|
+
this.#n = i, i.beforeUpdate = (e, t) => {
|
|
19
|
+
"userId" in e && e.userId && !("userId" in t && t.userId) && this.#o(t);
|
|
20
|
+
}, this.#e.on("logoutRequested", () => this.#o());
|
|
21
|
+
}
|
|
22
|
+
get clientId() {
|
|
23
|
+
return c("schIdentity.clientId", "the application Account configuration"), this.#t;
|
|
24
|
+
}
|
|
25
|
+
get _session() {
|
|
26
|
+
return c("schIdentity._session", "account.hasSession()"), this.#n.getSession();
|
|
27
|
+
}
|
|
28
|
+
hasSession() {
|
|
29
|
+
return this.#i("hasSession"), this.#e.hasSession();
|
|
30
|
+
}
|
|
31
|
+
isLoggedIn() {
|
|
32
|
+
return this.#i("isLoggedIn"), this.#e.isLoggedIn();
|
|
33
|
+
}
|
|
34
|
+
isConnected() {
|
|
35
|
+
return this.#i("isConnected"), this.#e.isConnected();
|
|
36
|
+
}
|
|
37
|
+
getUser() {
|
|
38
|
+
return this.#i("getUser"), this.#e.getUser();
|
|
39
|
+
}
|
|
40
|
+
getUserId() {
|
|
41
|
+
return this.#i("getUserId"), this.#e.getUserId();
|
|
42
|
+
}
|
|
43
|
+
getExternalId(...e) {
|
|
44
|
+
return this.#i("getExternalId"), this.#e.getExternalId(...e);
|
|
45
|
+
}
|
|
46
|
+
getUserUuid() {
|
|
47
|
+
return this.#i("getUserUuid"), this.#e.getUserUuid();
|
|
48
|
+
}
|
|
49
|
+
getUserSDRN() {
|
|
50
|
+
return this.#i("getUserSDRN"), this.#e.getUserSDRN();
|
|
51
|
+
}
|
|
52
|
+
getUserContextData() {
|
|
53
|
+
return this.#i("getUserContextData"), this.#e.getUserContextData();
|
|
54
|
+
}
|
|
55
|
+
getSpId() {
|
|
56
|
+
return this.#i("getSpId"), this.#e.getSpId();
|
|
57
|
+
}
|
|
58
|
+
login(...e) {
|
|
59
|
+
return this.#i("login"), this.#e.login(...e);
|
|
60
|
+
}
|
|
61
|
+
logout(...e) {
|
|
62
|
+
return this.#i("logout"), this.#e.logout(...e);
|
|
63
|
+
}
|
|
64
|
+
loginUrl(e, t, n, r, i, a, o, s) {
|
|
65
|
+
return this.#i("loginUrl"), typeof e == "string" ? this.#e.loginUrl({
|
|
66
|
+
state: e,
|
|
67
|
+
acrValues: t,
|
|
68
|
+
scope: n || void 0,
|
|
69
|
+
redirectUri: r || void 0,
|
|
70
|
+
loginHint: i || void 0,
|
|
71
|
+
tag: a || void 0,
|
|
72
|
+
teaser: o || void 0,
|
|
73
|
+
maxAge: Number.isNaN(Number(s)) ? void 0 : s
|
|
74
|
+
}) : this.#e.loginUrl(e);
|
|
75
|
+
}
|
|
76
|
+
logoutUrl(...e) {
|
|
77
|
+
return this.#i("logoutUrl"), this.#e.logoutUrl(...e);
|
|
78
|
+
}
|
|
79
|
+
accountUrl(...e) {
|
|
80
|
+
return this.#i("accountUrl"), this.#e.accountUrl(...e);
|
|
81
|
+
}
|
|
82
|
+
showSimplifiedLoginWidget(...e) {
|
|
83
|
+
return this.#i("showSimplifiedLoginWidget"), this.#e.showSimplifiedLoginWidget(...e);
|
|
84
|
+
}
|
|
85
|
+
clearCachedUserSession() {
|
|
86
|
+
return this.#i("clearCachedUserSession"), this.#e.clearCachedUserSession();
|
|
87
|
+
}
|
|
88
|
+
on(e, t, n) {
|
|
89
|
+
return c("schIdentity.on('logout')", "account.on('logoutRequested') and account.on('sessionUpdated')"), this.#a(e), this.#r.push({
|
|
90
|
+
listener: t,
|
|
91
|
+
context: n
|
|
92
|
+
}), this;
|
|
93
|
+
}
|
|
94
|
+
off(e, t) {
|
|
95
|
+
return c("schIdentity.off('logout')", "account.off('logoutRequested') and account.off('sessionUpdated')"), this.#a(e), this.#r = t ? this.#r.filter((e) => e.listener !== t) : [], this;
|
|
96
|
+
}
|
|
97
|
+
#i(e) {
|
|
98
|
+
c(`schIdentity.${e}()`, `account.${e}()`);
|
|
99
|
+
}
|
|
100
|
+
#a(t) {
|
|
101
|
+
if (t !== "logout") throw new e(`Account SDK legacy compatibility does not support the Identity "${t}" event`);
|
|
102
|
+
}
|
|
103
|
+
#o(...e) {
|
|
104
|
+
for (let { listener: t, context: n } of [...this.#r]) try {
|
|
105
|
+
t.apply(n, e);
|
|
106
|
+
} catch (e) {
|
|
107
|
+
console.error("[Account SDK compatibility] Legacy logout listener failed", e);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}, d = class {
|
|
111
|
+
#e;
|
|
112
|
+
constructor(e) {
|
|
113
|
+
this.#e = e;
|
|
114
|
+
}
|
|
115
|
+
hasAccess(e, t) {
|
|
116
|
+
return c("schMonetization.hasAccess()", "account.hasAccess()"), l(), this.#e.hasAccess(e);
|
|
117
|
+
}
|
|
118
|
+
clearCachedAccessResult(e, t) {
|
|
119
|
+
c("schMonetization.clearCachedAccessResult()", "account.clearCachedAccessResult()"), this.#e.clearCachedAccessResult(e, t);
|
|
120
|
+
}
|
|
121
|
+
}, f = "schAccount:ready", p = "schIdentity:ready", m = "schMonetization:ready", h = /* @__PURE__ */ new WeakSet(), g = () => new e("Account SDK legacy compatibility is not available in this browser context"), _ = () => new e(`Account SDK legacy compatibility received ${f} without window.schAccount`), v = (t) => new e(`Account SDK legacy compatibility cannot define window.${t} because it already exists`), y = (e) => {
|
|
122
|
+
for (let t of [
|
|
123
|
+
"schIdentity",
|
|
124
|
+
"Identity",
|
|
125
|
+
"schMonetization"
|
|
126
|
+
]) {
|
|
127
|
+
let n = Object.getOwnPropertyDescriptor(e, t), r = n?.configurable && "value" in n && n.value == null;
|
|
128
|
+
if (n && !r) throw v(t);
|
|
129
|
+
}
|
|
130
|
+
}, b = (e, t, n) => ({
|
|
131
|
+
configurable: !0,
|
|
132
|
+
enumerable: !0,
|
|
133
|
+
get: t,
|
|
134
|
+
set: (t) => {
|
|
135
|
+
if (t !== n) throw v(e);
|
|
136
|
+
c(`window.${e}`, "window.schAccount");
|
|
137
|
+
}
|
|
138
|
+
}), x = (e, t, n) => {
|
|
139
|
+
e.dispatchEvent(new CustomEvent(t, { detail: { instance: n } }));
|
|
140
|
+
}, S = (e, t, n) => {
|
|
141
|
+
y(e);
|
|
142
|
+
let r = new u(t, n), i = new d(t);
|
|
143
|
+
Object.defineProperties(e, {
|
|
144
|
+
schIdentity: b("schIdentity", () => (c("window.schIdentity", "window.schAccount"), r), r),
|
|
145
|
+
Identity: b("Identity", () => (c("window.Identity", "window.schAccount"), r), r),
|
|
146
|
+
schMonetization: b("schMonetization", () => (c("window.schMonetization", "window.schAccount"), i), i)
|
|
147
|
+
}), x(e, p, r), x(e, m, i);
|
|
148
|
+
};
|
|
149
|
+
function C(e) {
|
|
150
|
+
r(n(e?.clientId), "Account SDK legacy compatibility requires a clientId");
|
|
151
|
+
let t = i(e.window);
|
|
152
|
+
if (!t) throw g();
|
|
153
|
+
if (s(), !h.has(t)) {
|
|
154
|
+
if (y(t), h.add(t), t.schAccount) {
|
|
155
|
+
S(t, t.schAccount, e.clientId);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
t.addEventListener(f, () => {
|
|
159
|
+
if (!t.schAccount) throw _();
|
|
160
|
+
S(t, t.schAccount, e.clientId);
|
|
161
|
+
}, { once: !0 });
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
export { C as enableLegacyCompatibility };
|
|
166
|
+
|
|
167
|
+
//# sourceMappingURL=compatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compatibility.js","names":["#account","#clientId","#sessionState","#emitLegacyLogout","#warn","#assertLogoutEvent","#logoutListeners","#account"],"sources":["../src/compatibility/warnings.ts","../src/compatibility/legacy-identity.ts","../src/compatibility/legacy-monetization.ts","../src/compatibility/install-legacy-compatibility.ts"],"sourcesContent":["/* Copyright 2026 Schibsted Products & Technology AS. Licensed under the terms of the MIT license.\n * See LICENSE.md in the project root.\n */\n\nconst PREFIX = '[Account SDK compatibility]';\nlet compatibilityWarningEmitted = false;\n\nexport const warnCompatibilityEnabled = (): void => {\n if (compatibilityWarningEmitted) {\n return;\n }\n compatibilityWarningEmitted = true;\n console.warn(\n `${PREFIX} The legacy compatibility layer is enabled. Migrate application code to the Account API. This compatibility layer will be removed in v7.`,\n );\n};\n\nexport const warnLegacyUsage = (legacyApi: string, replacement: string): void => {\n console.warn(\n `${PREFIX} ${legacyApi} is deprecated. Use ${replacement} instead. It will be removed in v7.`,\n );\n};\n\nexport const warnIgnoredHasAccessUserId = (): void => {\n console.warn(\n `${PREFIX} schMonetization.hasAccess() ignores the legacy userId argument. Account.hasAccess() resolves the logged-in user automatically. It will be removed in v7.`,\n );\n};\n","/* Copyright 2026 Schibsted Products & Technology AS. Licensed under the terms of the MIT license.\n * See LICENSE.md in the project root.\n */\n\nimport type { Account } from '../account.js';\nimport SDKError from '../sdk-error.js';\nimport { type SessionState, sessionStates } from '../session-state.js';\nimport type { LoginOptions } from '../types/login.js';\nimport type { SessionObjectResponse } from '../types/session.js';\nimport type { LegacyIdentity, LegacyLogoutListener } from './types.js';\nimport { warnLegacyUsage } from './warnings.js';\n\nexport class LegacyIdentityAdapter implements LegacyIdentity {\n readonly #account: Account;\n readonly #clientId: string;\n readonly #sessionState: SessionState;\n #logoutListeners: { listener: LegacyLogoutListener; context?: unknown }[] = [];\n\n constructor(account: Account, clientId: string) {\n this.#account = account;\n this.#clientId = clientId;\n\n const sessionState = sessionStates.get(account);\n if (!sessionState) {\n throw new SDKError('Legacy compatibility requires an Account from the same SDK build');\n }\n this.#sessionState = sessionState;\n // v5 notified logout listeners before replacing _session, on every session result.\n sessionState.beforeUpdate = (previous, current) => {\n if (\n 'userId' in previous &&\n previous.userId &&\n !('userId' in current && current.userId)\n ) {\n this.#emitLegacyLogout(current);\n }\n };\n this.#account.on('logoutRequested', () => this.#emitLegacyLogout());\n }\n\n get clientId(): string {\n warnLegacyUsage('schIdentity.clientId', 'the application Account configuration');\n return this.#clientId;\n }\n\n get _session(): LegacyIdentity['_session'] {\n warnLegacyUsage('schIdentity._session', 'account.hasSession()');\n return this.#sessionState.getSession();\n }\n\n hasSession(): ReturnType<Account['hasSession']> {\n this.#warn('hasSession');\n return this.#account.hasSession();\n }\n\n isLoggedIn(): ReturnType<Account['isLoggedIn']> {\n this.#warn('isLoggedIn');\n return this.#account.isLoggedIn();\n }\n\n isConnected(): ReturnType<Account['isConnected']> {\n this.#warn('isConnected');\n return this.#account.isConnected();\n }\n\n getUser(): ReturnType<Account['getUser']> {\n this.#warn('getUser');\n return this.#account.getUser();\n }\n\n getUserId(): ReturnType<Account['getUserId']> {\n this.#warn('getUserId');\n return this.#account.getUserId();\n }\n\n getExternalId(\n ...args: Parameters<Account['getExternalId']>\n ): ReturnType<Account['getExternalId']> {\n this.#warn('getExternalId');\n return this.#account.getExternalId(...args);\n }\n\n getUserUuid(): ReturnType<Account['getUserUuid']> {\n this.#warn('getUserUuid');\n return this.#account.getUserUuid();\n }\n\n getUserSDRN(): ReturnType<Account['getUserSDRN']> {\n this.#warn('getUserSDRN');\n return this.#account.getUserSDRN();\n }\n\n getUserContextData(): ReturnType<Account['getUserContextData']> {\n this.#warn('getUserContextData');\n return this.#account.getUserContextData();\n }\n\n getSpId(): ReturnType<Account['getSpId']> {\n this.#warn('getSpId');\n return this.#account.getSpId();\n }\n\n login(...args: Parameters<Account['login']>): ReturnType<Account['login']> {\n this.#warn('login');\n return this.#account.login(...args);\n }\n\n logout(...args: Parameters<Account['logout']>): ReturnType<Account['logout']> {\n this.#warn('logout');\n return this.#account.logout(...args);\n }\n\n loginUrl(options: LoginOptions): string;\n loginUrl(\n state: string,\n acrValues?: string,\n scope?: string,\n redirectUri?: string,\n loginHint?: string,\n tag?: string,\n teaser?: string,\n maxAge?: number | string,\n ): string;\n loginUrl(\n options: LoginOptions | string,\n acrValues?: string,\n scope?: string,\n redirectUri?: string,\n loginHint?: string,\n tag?: string,\n teaser?: string,\n maxAge?: number | string,\n ): string {\n this.#warn('loginUrl');\n if (typeof options !== 'string') {\n return this.#account.loginUrl(options);\n }\n\n // v5 treated empty positional values as omitted, except for numeric maxAge (including 0).\n return this.#account.loginUrl({\n state: options,\n acrValues,\n scope: scope || undefined,\n redirectUri: redirectUri || undefined,\n loginHint: loginHint || undefined,\n tag: tag || undefined,\n teaser: teaser || undefined,\n maxAge: Number.isNaN(Number(maxAge)) ? undefined : maxAge,\n });\n }\n\n logoutUrl(...args: Parameters<Account['logoutUrl']>): ReturnType<Account['logoutUrl']> {\n this.#warn('logoutUrl');\n return this.#account.logoutUrl(...args);\n }\n\n accountUrl(...args: Parameters<Account['accountUrl']>): ReturnType<Account['accountUrl']> {\n this.#warn('accountUrl');\n return this.#account.accountUrl(...args);\n }\n\n showSimplifiedLoginWidget(\n ...args: Parameters<Account['showSimplifiedLoginWidget']>\n ): ReturnType<Account['showSimplifiedLoginWidget']> {\n this.#warn('showSimplifiedLoginWidget');\n return this.#account.showSimplifiedLoginWidget(...args);\n }\n\n clearCachedUserSession(): ReturnType<Account['clearCachedUserSession']> {\n this.#warn('clearCachedUserSession');\n return this.#account.clearCachedUserSession();\n }\n\n on(event: 'logout', listener: LegacyLogoutListener, context?: unknown): this {\n warnLegacyUsage(\n \"schIdentity.on('logout')\",\n \"account.on('logoutRequested') and account.on('sessionUpdated')\",\n );\n this.#assertLogoutEvent(event);\n\n this.#logoutListeners.push({ listener, context });\n return this;\n }\n\n off(event: 'logout', listener?: LegacyLogoutListener): this {\n warnLegacyUsage(\n \"schIdentity.off('logout')\",\n \"account.off('logoutRequested') and account.off('sessionUpdated')\",\n );\n this.#assertLogoutEvent(event);\n\n this.#logoutListeners = listener\n ? this.#logoutListeners.filter((registered) => registered.listener !== listener)\n : [];\n return this;\n }\n\n #warn(method: keyof LegacyIdentity): void {\n warnLegacyUsage(`schIdentity.${method}()`, `account.${method}()`);\n }\n\n #assertLogoutEvent(event: string): void {\n if (event !== 'logout') {\n throw new SDKError(\n `Account SDK legacy compatibility does not support the Identity \"${event}\" event`,\n );\n }\n }\n\n #emitLegacyLogout(...args: [] | [SessionObjectResponse]): void {\n for (const { listener, context } of [...this.#logoutListeners]) {\n try {\n listener.apply(context, args);\n } catch (error) {\n // A legacy consumer must not prevent Account from updating its session.\n console.error('[Account SDK compatibility] Legacy logout listener failed', error);\n }\n }\n }\n}\n","/* Copyright 2026 Schibsted Products & Technology AS. Licensed under the terms of the MIT license.\n * See LICENSE.md in the project root.\n */\n\nimport type { Account } from '../account.js';\nimport type { SessionUserId } from '../types/session.js';\nimport type { LegacyMonetization } from './types.js';\nimport { warnIgnoredHasAccessUserId, warnLegacyUsage } from './warnings.js';\n\nexport class LegacyMonetizationAdapter implements LegacyMonetization {\n readonly #account: Account;\n\n constructor(account: Account) {\n this.#account = account;\n }\n\n hasAccess(productIds: string[], _userId: SessionUserId): ReturnType<Account['hasAccess']> {\n warnLegacyUsage('schMonetization.hasAccess()', 'account.hasAccess()');\n warnIgnoredHasAccessUserId();\n return this.#account.hasAccess(productIds);\n }\n\n clearCachedAccessResult(productIds: string[], userId: SessionUserId): void {\n warnLegacyUsage(\n 'schMonetization.clearCachedAccessResult()',\n 'account.clearCachedAccessResult()',\n );\n this.#account.clearCachedAccessResult(productIds, userId);\n }\n}\n","/* Copyright 2026 Schibsted Products & Technology AS. Licensed under the terms of the MIT license.\n * See LICENSE.md in the project root.\n */\n\nimport type { Account } from '../account.js';\nimport { resolveBrowserWindow } from '../resolve-browser-window.js';\nimport SDKError from '../sdk-error.js';\nimport { assert, isNonEmptyString } from '../validate.js';\nimport { LegacyIdentityAdapter } from './legacy-identity.js';\nimport { LegacyMonetizationAdapter } from './legacy-monetization.js';\nimport type { LegacyCompatibilityOptions } from './types.js';\nimport { warnCompatibilityEnabled, warnLegacyUsage } from './warnings.js';\n\nconst ACCOUNT_READY_EVENT = 'schAccount:ready';\nconst IDENTITY_READY_EVENT = 'schIdentity:ready';\nconst MONETIZATION_READY_EVENT = 'schMonetization:ready';\n\nconst enabledWindows = new WeakSet<Window>();\n\nconst createUnavailableError = (): SDKError =>\n new SDKError('Account SDK legacy compatibility is not available in this browser context');\n\nconst createMissingAccountError = (): SDKError =>\n new SDKError(\n `Account SDK legacy compatibility received ${ACCOUNT_READY_EVENT} without window.schAccount`,\n );\n\nconst createGlobalConflictError = (globalName: string): SDKError =>\n new SDKError(\n `Account SDK legacy compatibility cannot define window.${globalName} because it already exists`,\n );\n\nconst assertLegacyGlobalsAvailable = (browserWindow: Window): void => {\n for (const globalName of ['schIdentity', 'Identity', 'schMonetization']) {\n const descriptor = Object.getOwnPropertyDescriptor(browserWindow, globalName);\n const emptyPlaceholder =\n descriptor?.configurable && 'value' in descriptor && descriptor.value == null;\n if (descriptor && !emptyPlaceholder) {\n throw createGlobalConflictError(globalName);\n }\n }\n};\n\nconst legacyGlobalDescriptor = <Instance>(\n globalName: string,\n getter: () => Instance,\n instance: Instance,\n): PropertyDescriptor => ({\n configurable: true,\n enumerable: true,\n get: getter,\n set: (value: Instance) => {\n // Some hosts still assign window.Identity = window.schIdentity after initialization.\n if (value !== instance) {\n throw createGlobalConflictError(globalName);\n }\n warnLegacyUsage(`window.${globalName}`, 'window.schAccount');\n },\n});\n\nconst dispatchReadyEvent = <Instance>(\n browserWindow: Window,\n eventName: string,\n instance: Instance,\n): void => {\n browserWindow.dispatchEvent(new CustomEvent(eventName, { detail: { instance } }));\n};\n\nconst installLegacyGlobals = (browserWindow: Window, account: Account, clientId: string): void => {\n assertLegacyGlobalsAvailable(browserWindow);\n\n const identityShim = new LegacyIdentityAdapter(account, clientId);\n const monetizationShim = new LegacyMonetizationAdapter(account);\n const identityGetter = () => {\n warnLegacyUsage('window.schIdentity', 'window.schAccount');\n return identityShim;\n };\n const monetizationGetter = () => {\n warnLegacyUsage('window.schMonetization', 'window.schAccount');\n return monetizationShim;\n };\n const legacyIdentityGetter = () => {\n warnLegacyUsage('window.Identity', 'window.schAccount');\n return identityShim;\n };\n\n Object.defineProperties(browserWindow, {\n schIdentity: legacyGlobalDescriptor('schIdentity', identityGetter, identityShim),\n Identity: legacyGlobalDescriptor('Identity', legacyIdentityGetter, identityShim),\n schMonetization: legacyGlobalDescriptor(\n 'schMonetization',\n monetizationGetter,\n monetizationShim,\n ),\n });\n\n dispatchReadyEvent(browserWindow, IDENTITY_READY_EVENT, identityShim);\n dispatchReadyEvent(browserWindow, MONETIZATION_READY_EVENT, monetizationShim);\n};\n\n/**\n * Enables the temporary v5 global and ready-event compatibility layer for Account SDK v6.\n *\n * Call this before `createAccountSdk()` when a dependency still expects v5 globals. If Account\n * already exists, the legacy shims are installed immediately.\n *\n * @deprecated Migrate dependencies to the Account API. This entrypoint will be removed in v7.\n */\nexport function enableLegacyCompatibility(options: LegacyCompatibilityOptions): void {\n assert(\n isNonEmptyString(options?.clientId),\n 'Account SDK legacy compatibility requires a clientId',\n );\n const browserWindow = resolveBrowserWindow(options.window);\n if (!browserWindow) {\n throw createUnavailableError();\n }\n\n warnCompatibilityEnabled();\n\n if (enabledWindows.has(browserWindow)) {\n return;\n }\n\n assertLegacyGlobalsAvailable(browserWindow);\n\n enabledWindows.add(browserWindow);\n\n if (browserWindow.schAccount) {\n installLegacyGlobals(browserWindow, browserWindow.schAccount, options.clientId);\n return;\n }\n\n browserWindow.addEventListener(\n ACCOUNT_READY_EVENT,\n () => {\n if (!browserWindow.schAccount) {\n throw createMissingAccountError();\n }\n installLegacyGlobals(browserWindow, browserWindow.schAccount, options.clientId);\n },\n { once: true },\n );\n}\n"],"mappings":";;AAIA,IAAM,IAAS,+B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;CAGjC,MAAyB,GAErB,GAAe,IAAI,CAAa,GAQpC;MAJA,EAA6B,CAAa,GAE1C,EAAe,IAAI,CAAa,GAE5B,EAAc,YAAY;GAC1B,EAAqB,GAAe,EAAc,YAAY,EAAQ,QAAQ;GAC9E;EACJ;EAEA,EAAc,iBACV,SACM;GACF,IAAI,CAAC,EAAc,YACf,MAAM,EAA0B;GAEpC,EAAqB,GAAe,EAAc,YAAY,EAAQ,QAAQ;EAClF,GACA,EAAE,MAAM,GAAK,CACjB;CAXA;AAYJ"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core configuration used by the SDK.
|
|
3
|
+
* - `ENDPOINTS.SPiD` — SPiD endpoints per environment
|
|
4
|
+
* - `ENDPOINTS.BFF` — Endpoints used with new GDPR-compliant web flows
|
|
5
|
+
* - `ENDPOINTS.SESSION_SERVICE` — Endpoints to check global user session data
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
declare const config: {
|
|
9
|
+
readonly ENDPOINTS: {
|
|
10
|
+
readonly SPiD: {
|
|
11
|
+
readonly LOCAL: "http://id.localhost";
|
|
12
|
+
readonly DEV: "https://identity-dev.schibsted.com";
|
|
13
|
+
readonly PRE: "https://identity-pre.schibsted.com";
|
|
14
|
+
readonly PRO: "https://login.schibsted.com";
|
|
15
|
+
readonly PRO_NO: "https://payment.schibsted.no";
|
|
16
|
+
readonly PRO_FI: "https://login.schibsted.fi";
|
|
17
|
+
readonly PRO_DK: "https://login.schibsted.dk";
|
|
18
|
+
};
|
|
19
|
+
readonly BFF: {
|
|
20
|
+
readonly LOCAL: "http://id.localhost/authn/";
|
|
21
|
+
readonly DEV: "https://identity-dev.schibsted.com/authn/";
|
|
22
|
+
readonly PRE: "https://identity-pre.schibsted.com/authn/";
|
|
23
|
+
readonly PRO: "https://login.schibsted.com/authn/";
|
|
24
|
+
readonly PRO_NO: "https://payment.schibsted.no/authn/";
|
|
25
|
+
readonly PRO_FI: "https://login.schibsted.fi/authn/";
|
|
26
|
+
readonly PRO_DK: "https://login.schibsted.dk/authn/";
|
|
27
|
+
};
|
|
28
|
+
readonly SESSION_SERVICE: {
|
|
29
|
+
readonly LOCAL: "http://session-service.id.localhost";
|
|
30
|
+
readonly DEV: "https://session-service.identity-dev.schibsted.com";
|
|
31
|
+
readonly PRE: "https://session-service.identity-pre.schibsted.com";
|
|
32
|
+
readonly PRO: "https://session-service.login.schibsted.com";
|
|
33
|
+
readonly PRO_NO: "https://session-service.payment.schibsted.no";
|
|
34
|
+
readonly PRO_FI: "https://session-service.login.schibsted.fi";
|
|
35
|
+
readonly PRO_DK: "https://session-service.login.schibsted.dk";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly NAMESPACE: {
|
|
39
|
+
readonly LOCAL: "id.localhost";
|
|
40
|
+
readonly DEV: "schibsted.com";
|
|
41
|
+
readonly PRE: "schibsted.com";
|
|
42
|
+
readonly PRO: "schibsted.com";
|
|
43
|
+
readonly PRO_NO: "spid.no";
|
|
44
|
+
readonly PRO_FI: "schibsted.fi";
|
|
45
|
+
readonly PRO_DK: "schibsted.dk";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export default config;
|
|
49
|
+
export declare const ENDPOINTS: {
|
|
50
|
+
readonly SPiD: {
|
|
51
|
+
readonly LOCAL: "http://id.localhost";
|
|
52
|
+
readonly DEV: "https://identity-dev.schibsted.com";
|
|
53
|
+
readonly PRE: "https://identity-pre.schibsted.com";
|
|
54
|
+
readonly PRO: "https://login.schibsted.com";
|
|
55
|
+
readonly PRO_NO: "https://payment.schibsted.no";
|
|
56
|
+
readonly PRO_FI: "https://login.schibsted.fi";
|
|
57
|
+
readonly PRO_DK: "https://login.schibsted.dk";
|
|
58
|
+
};
|
|
59
|
+
readonly BFF: {
|
|
60
|
+
readonly LOCAL: "http://id.localhost/authn/";
|
|
61
|
+
readonly DEV: "https://identity-dev.schibsted.com/authn/";
|
|
62
|
+
readonly PRE: "https://identity-pre.schibsted.com/authn/";
|
|
63
|
+
readonly PRO: "https://login.schibsted.com/authn/";
|
|
64
|
+
readonly PRO_NO: "https://payment.schibsted.no/authn/";
|
|
65
|
+
readonly PRO_FI: "https://login.schibsted.fi/authn/";
|
|
66
|
+
readonly PRO_DK: "https://login.schibsted.dk/authn/";
|
|
67
|
+
};
|
|
68
|
+
readonly SESSION_SERVICE: {
|
|
69
|
+
readonly LOCAL: "http://session-service.id.localhost";
|
|
70
|
+
readonly DEV: "https://session-service.identity-dev.schibsted.com";
|
|
71
|
+
readonly PRE: "https://session-service.identity-pre.schibsted.com";
|
|
72
|
+
readonly PRO: "https://session-service.login.schibsted.com";
|
|
73
|
+
readonly PRO_NO: "https://session-service.payment.schibsted.no";
|
|
74
|
+
readonly PRO_FI: "https://session-service.login.schibsted.fi";
|
|
75
|
+
readonly PRO_DK: "https://session-service.login.schibsted.dk";
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare const NAMESPACE: {
|
|
79
|
+
readonly LOCAL: "id.localhost";
|
|
80
|
+
readonly DEV: "schibsted.com";
|
|
81
|
+
readonly PRE: "schibsted.com";
|
|
82
|
+
readonly PRO: "schibsted.com";
|
|
83
|
+
readonly PRO_NO: "spid.no";
|
|
84
|
+
readonly PRO_FI: "schibsted.fi";
|
|
85
|
+
readonly PRO_DK: "schibsted.dk";
|
|
86
|
+
};
|