@abapify/adt-playwright 0.4.0 → 0.4.1

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.
@@ -0,0 +1,91 @@
1
+ import { BrowserAuthOptions, BrowserAuthOptions as BrowserAuthOptions$1, BrowserCredentials, BrowserCredentials as BrowserCredentials$1, CookieData, testCredentials, toCookieHeader, toHeaders } from "@abapify/browser-auth";
2
+ import { AdtConfig } from "@abapify/adt-config";
3
+ import { AuthPlugin } from "@abapify/adt-auth";
4
+
5
+ //#region src/playwright-auth.d.ts
6
+ type PlaywrightCredentials = BrowserCredentials$1;
7
+ type PlaywrightAuthOptions = BrowserAuthOptions$1;
8
+ /**
9
+ * Playwright authentication object
10
+ */
11
+ declare const playwrightAuth: {
12
+ /**
13
+ * Authenticate using Playwright browser
14
+ */
15
+ authenticate(options: PlaywrightAuthOptions): Promise<PlaywrightCredentials>;
16
+ /**
17
+ * Test if credentials are still valid
18
+ */
19
+ test: typeof testCredentials;
20
+ /**
21
+ * Refresh is not reliable with Okta SSO - always return null to trigger full re-authentication
22
+ */
23
+ refresh(session: {
24
+ auth?: {
25
+ pluginOptions?: {
26
+ log?: (message: string) => void;
27
+ };
28
+ };
29
+ }): Promise<PlaywrightCredentials | null>;
30
+ };
31
+ declare const playwright: {
32
+ /**
33
+ * Authenticate using Playwright browser
34
+ */
35
+ authenticate(options: PlaywrightAuthOptions): Promise<PlaywrightCredentials>;
36
+ /**
37
+ * Test if credentials are still valid
38
+ */
39
+ test: typeof testCredentials;
40
+ /**
41
+ * Refresh is not reliable with Okta SSO - always return null to trigger full re-authentication
42
+ */
43
+ refresh(session: {
44
+ auth?: {
45
+ pluginOptions?: {
46
+ log?: (message: string) => void;
47
+ };
48
+ };
49
+ }): Promise<PlaywrightCredentials | null>;
50
+ };
51
+ //#endregion
52
+ //#region src/auth-plugin.d.ts
53
+ /**
54
+ * Playwright authentication plugin for AuthManager.
55
+ *
56
+ * Implements the standard AuthPlugin interface to integrate Playwright-based
57
+ * browser authentication with the ADT authentication system.
58
+ *
59
+ * @remarks
60
+ * This plugin:
61
+ * - Opens a browser window for SSO authentication
62
+ * - Captures session cookies after successful login
63
+ * - Converts cookies to the format expected by AuthManager
64
+ * - Does NOT support silent refresh (Okta SSO requires user interaction)
65
+ *
66
+ * @example
67
+ * ```typescript
68
+ * // Used internally by AuthManager when destination type is '@abapify/adt-playwright'
69
+ * import authPlugin from '@abapify/adt-playwright';
70
+ *
71
+ * const result = await authPlugin.authenticate({
72
+ * url: 'https://sap-system.example.com',
73
+ * headless: false,
74
+ * userDataDir: true,
75
+ * });
76
+ * ```
77
+ */
78
+ declare const authPlugin: AuthPlugin;
79
+ //#endregion
80
+ //#region src/index.d.ts
81
+ /**
82
+ * Plugin-level options applied to all destinations
83
+ */
84
+ type PlaywrightPluginOptions = BrowserAuthOptions$1;
85
+ /**
86
+ * Wrap a standard config with playwright auth for all destinations.
87
+ */
88
+ declare function withPlaywright(config: AdtConfig, options?: Partial<BrowserAuthOptions$1>): AdtConfig;
89
+ //#endregion
90
+ export { type BrowserAuthOptions, type BrowserCredentials, type CookieData, type PlaywrightAuthOptions, type PlaywrightCredentials, PlaywrightPluginOptions, authPlugin, authPlugin as default, playwright, playwrightAuth, toCookieHeader, toHeaders, withPlaywright };
91
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/playwright-auth.ts","../src/auth-plugin.ts","../src/index.ts"],"mappings":";;;;;KAeY,qBAAA,GAAwB,oBAAA;AAAA,KACxB,qBAAA,GAAwB,oBAAA;AAApC;;;AAAA,cAKa,cAAA;EALyC;AAKtD;;wBAKa,qBAAA,GACR,OAAA,CAAQ,qBAAA;EADA;;;;EAgBC;;;;IADV,IAAA;MAAS,aAAA;QAAkB,GAAA,IAAO,OAAA;MAAA;IAAA;EAAA,IAChC,OAAA,CAAQ,qBAAA;AAAA;AAAA,cAaD,UAAA;EAdT;;;wBAfS,qBAAA,GACR,OAAA,CAAQ,qBAAA;;;;;EAesB;AAanC;;;IAdI,IAAA;MAAS,aAAA;QAAkB,GAAA,IAAO,OAAA;MAAA;IAAA;EAAA,IAChC,OAAA,CAAQ,qBAAA;AAAA;;;AA1Bd;;;;;AAKA;;;;;;;;;;;;;;;;;;;;AALA,cC4DM,UAAA,EAAY,UAAA;;;AD5DlB;;;AAAA,KEQY,uBAAA,GAA0B,oBAAA;;AFHtC;;iBEkBgB,cAAA,CACd,MAAA,EAAQ,SAAA,EACR,OAAA,GAAU,OAAA,CAAQ,oBAAA,IACjB,SAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,237 @@
1
+ import { authenticate, testCredentials, toCookieHeader, toHeaders } from "@abapify/browser-auth";
2
+ import { chromium } from "playwright";
3
+
4
+ //#region src/adapter.ts
5
+ /**
6
+ * Playwright Browser Adapter
7
+ *
8
+ * Implements BrowserAdapter interface for Playwright.
9
+ * This is a thin wrapper - all auth logic is in @abapify/browser-auth.
10
+ */
11
+ /**
12
+ * Convert Playwright cookie to CookieData
13
+ */
14
+ function convertCookie(cookie) {
15
+ return {
16
+ name: cookie.name,
17
+ value: cookie.value,
18
+ domain: cookie.domain,
19
+ path: cookie.path,
20
+ expires: cookie.expires,
21
+ httpOnly: cookie.httpOnly,
22
+ secure: cookie.secure,
23
+ sameSite: cookie.sameSite
24
+ };
25
+ }
26
+ /**
27
+ * Create a Playwright browser adapter
28
+ */
29
+ function createPlaywrightAdapter() {
30
+ let context = null;
31
+ let page = null;
32
+ const responseHandlers = [];
33
+ const closeHandlers = [];
34
+ return {
35
+ async launch(options) {
36
+ const { headless, userDataDir, ignoreHTTPSErrors, userAgent } = options;
37
+ if (userDataDir) context = await chromium.launchPersistentContext(userDataDir, {
38
+ headless,
39
+ ignoreHTTPSErrors,
40
+ userAgent
41
+ });
42
+ else context = await (await chromium.launch({ headless })).newContext({
43
+ ignoreHTTPSErrors,
44
+ userAgent
45
+ });
46
+ },
47
+ async newPage() {
48
+ if (!context) throw new Error("Browser not launched");
49
+ page = await context.newPage();
50
+ page.on("response", (response) => {
51
+ const event = {
52
+ url: response.url(),
53
+ status: response.status()
54
+ };
55
+ responseHandlers.forEach((handler) => handler(event));
56
+ });
57
+ page.once("close", () => {
58
+ closeHandlers.forEach((handler) => handler());
59
+ });
60
+ },
61
+ async goto(url, options) {
62
+ if (!page) throw new Error("Page not created");
63
+ await page.goto(url, { timeout: options?.timeout ?? 3e4 }).catch(() => {});
64
+ },
65
+ async getCookies() {
66
+ if (!context) throw new Error("Browser not launched");
67
+ return (await context.cookies()).map(convertCookie);
68
+ },
69
+ async clearCookies(domain) {
70
+ if (!context) throw new Error("Browser not launched");
71
+ const toRemove = (await context.cookies()).filter((c) => c.domain.includes(domain) || domain.includes(c.domain.replace(/^\./, "")));
72
+ for (const cookie of toRemove) await context.clearCookies({
73
+ name: cookie.name,
74
+ domain: cookie.domain
75
+ });
76
+ },
77
+ async getUserAgent() {
78
+ if (!context) throw new Error("Browser not launched");
79
+ const uaPage = await context.newPage();
80
+ const userAgent = await uaPage.evaluate(() => navigator.userAgent);
81
+ await uaPage.close();
82
+ return userAgent;
83
+ },
84
+ async closePage() {
85
+ if (page) {
86
+ await page.close();
87
+ page = null;
88
+ }
89
+ },
90
+ async close() {
91
+ if (context) {
92
+ await context.close();
93
+ context = null;
94
+ }
95
+ },
96
+ onResponse(handler) {
97
+ responseHandlers.push(handler);
98
+ },
99
+ onPageClose(handler) {
100
+ closeHandlers.push(handler);
101
+ }
102
+ };
103
+ }
104
+
105
+ //#endregion
106
+ //#region src/playwright-auth.ts
107
+ /**
108
+ * Playwright Authentication Plugin
109
+ *
110
+ * Thin wrapper around @abapify/browser-auth core.
111
+ * Provides Playwright-specific browser adapter.
112
+ */
113
+ /**
114
+ * Playwright authentication object
115
+ */
116
+ const playwrightAuth = {
117
+ async authenticate(options) {
118
+ return authenticate(createPlaywrightAdapter(), options);
119
+ },
120
+ test: testCredentials,
121
+ async refresh(session) {
122
+ (session?.auth?.pluginOptions?.log ?? console.log)("🔄 Session expired, will trigger full re-authentication...");
123
+ return null;
124
+ }
125
+ };
126
+ const playwright = playwrightAuth;
127
+
128
+ //#endregion
129
+ //#region src/auth-plugin.ts
130
+ /** Default session duration when cookies don't specify expiration (8 hours) */
131
+ const DEFAULT_SESSION_DURATION_MS = 480 * 60 * 1e3;
132
+ /**
133
+ * Determines the session expiration time from cookie data.
134
+ *
135
+ * Examines all cookies and returns the earliest expiration time found.
136
+ * If no cookies have expiration set (common with session cookies),
137
+ * returns a default expiration of 8 hours from now.
138
+ *
139
+ * @param cookies - Array of cookie objects with optional expires field
140
+ * @returns The earliest expiration date, or default 8 hours from now
141
+ *
142
+ * @example
143
+ * // Cookie with expiration
144
+ * getExpiresAt([{ expires: 1732900000 }]) // Returns Date from timestamp
145
+ *
146
+ * @example
147
+ * // Session cookie (no expiration)
148
+ * getExpiresAt([{ expires: 0 }]) // Returns Date 8 hours from now
149
+ */
150
+ function getExpiresAt(cookies) {
151
+ const expirations = cookies.filter((c) => c.expires && c.expires > 0).map((c) => c.expires * 1e3);
152
+ if (expirations.length > 0) return new Date(Math.min(...expirations));
153
+ return new Date(Date.now() + DEFAULT_SESSION_DURATION_MS);
154
+ }
155
+ /**
156
+ * Playwright authentication plugin for AuthManager.
157
+ *
158
+ * Implements the standard AuthPlugin interface to integrate Playwright-based
159
+ * browser authentication with the ADT authentication system.
160
+ *
161
+ * @remarks
162
+ * This plugin:
163
+ * - Opens a browser window for SSO authentication
164
+ * - Captures session cookies after successful login
165
+ * - Converts cookies to the format expected by AuthManager
166
+ * - Does NOT support silent refresh (Okta SSO requires user interaction)
167
+ *
168
+ * @example
169
+ * ```typescript
170
+ * // Used internally by AuthManager when destination type is '@abapify/adt-playwright'
171
+ * import authPlugin from '@abapify/adt-playwright';
172
+ *
173
+ * const result = await authPlugin.authenticate({
174
+ * url: 'https://sap-system.example.com',
175
+ * headless: false,
176
+ * userDataDir: true,
177
+ * });
178
+ * ```
179
+ */
180
+ const authPlugin = {
181
+ async authenticate(options) {
182
+ const credentials = await playwrightAuth.authenticate(options);
183
+ return {
184
+ method: "cookie",
185
+ credentials: {
186
+ cookies: toCookieHeader(credentials),
187
+ expiresAt: getExpiresAt(credentials.cookies)
188
+ }
189
+ };
190
+ },
191
+ async refresh(_session) {
192
+ return null;
193
+ }
194
+ };
195
+
196
+ //#endregion
197
+ //#region src/index.ts
198
+ /**
199
+ * Create a playwright destination config
200
+ */
201
+ function createPlaywrightDestination(options) {
202
+ return {
203
+ type: "@abapify/adt-playwright",
204
+ options
205
+ };
206
+ }
207
+ /**
208
+ * Wrap a standard config with playwright auth for all destinations.
209
+ */
210
+ function withPlaywright(config, options) {
211
+ if (!config.destinations) return config;
212
+ const destinations = {};
213
+ for (const [name, dest] of Object.entries(config.destinations)) if (typeof dest === "object" && "type" in dest) if (dest.type === "@abapify/adt-playwright" || dest.type === "playwright") destinations[name] = {
214
+ type: "@abapify/adt-playwright",
215
+ options: {
216
+ ...options,
217
+ ...dest.options
218
+ }
219
+ };
220
+ else destinations[name] = dest;
221
+ else if (typeof dest === "string") destinations[name] = createPlaywrightDestination({
222
+ url: dest,
223
+ ...options
224
+ });
225
+ else destinations[name] = createPlaywrightDestination({
226
+ ...options,
227
+ ...dest
228
+ });
229
+ return {
230
+ ...config,
231
+ destinations
232
+ };
233
+ }
234
+
235
+ //#endregion
236
+ export { authPlugin, authPlugin as default, playwright, playwrightAuth, toCookieHeader, toHeaders, withPlaywright };
237
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/adapter.ts","../src/playwright-auth.ts","../src/auth-plugin.ts","../src/index.ts"],"sourcesContent":["/**\n * Playwright Browser Adapter\n *\n * Implements BrowserAdapter interface for Playwright.\n * This is a thin wrapper - all auth logic is in @abapify/browser-auth.\n */\n\nimport { chromium } from 'playwright';\nimport type { BrowserContext, Page, Cookie } from 'playwright';\nimport type {\n BrowserAdapter,\n CookieData,\n ResponseEvent,\n} from '@abapify/browser-auth';\n\n/**\n * Convert Playwright cookie to CookieData\n */\nfunction convertCookie(cookie: Cookie): CookieData {\n return {\n name: cookie.name,\n value: cookie.value,\n domain: cookie.domain,\n path: cookie.path,\n expires: cookie.expires,\n httpOnly: cookie.httpOnly,\n secure: cookie.secure,\n sameSite: cookie.sameSite as CookieData['sameSite'],\n };\n}\n\n/**\n * Create a Playwright browser adapter\n */\nexport function createPlaywrightAdapter(): BrowserAdapter {\n let context: BrowserContext | null = null;\n let page: Page | null = null;\n\n const responseHandlers: ((event: ResponseEvent) => void)[] = [];\n const closeHandlers: (() => void)[] = [];\n\n return {\n async launch(options) {\n const { headless, userDataDir, ignoreHTTPSErrors, userAgent } = options;\n\n if (userDataDir) {\n // Persistent context - stores cookies/session\n context = await chromium.launchPersistentContext(userDataDir, {\n headless,\n ignoreHTTPSErrors,\n userAgent,\n });\n } else {\n const browser = await chromium.launch({ headless });\n context = await browser.newContext({ ignoreHTTPSErrors, userAgent });\n }\n },\n\n async newPage() {\n if (!context) throw new Error('Browser not launched');\n page = await context.newPage();\n\n // Wire up event handlers\n page.on('response', (response) => {\n const event: ResponseEvent = {\n url: response.url(),\n status: response.status(),\n };\n responseHandlers.forEach((handler) => handler(event));\n });\n\n page.once('close', () => {\n closeHandlers.forEach((handler) => handler());\n });\n },\n\n async goto(url, options) {\n if (!page) throw new Error('Page not created');\n await page\n .goto(url, { timeout: options?.timeout ?? 30000 })\n // Navigation errors are intentionally ignored; caller handles auth via event listeners\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n .catch(() => {});\n },\n\n async getCookies() {\n if (!context) throw new Error('Browser not launched');\n const cookies = await context.cookies();\n return cookies.map(convertCookie);\n },\n\n async clearCookies(domain: string) {\n if (!context) throw new Error('Browser not launched');\n const cookies = await context.cookies();\n const toRemove = cookies.filter(\n (c) =>\n c.domain.includes(domain) ||\n domain.includes(c.domain.replace(/^\\./, '')),\n );\n // Clear each matching cookie individually\n for (const cookie of toRemove) {\n await context.clearCookies({\n name: cookie.name,\n domain: cookie.domain,\n });\n }\n },\n\n async getUserAgent() {\n if (!context) throw new Error('Browser not launched');\n const uaPage = await context.newPage();\n const userAgent = await uaPage.evaluate(() => navigator.userAgent);\n await uaPage.close();\n return userAgent;\n },\n\n async closePage() {\n if (page) {\n await page.close();\n page = null;\n }\n },\n\n async close() {\n if (context) {\n await context.close();\n context = null;\n }\n },\n\n onResponse(handler) {\n responseHandlers.push(handler);\n },\n\n onPageClose(handler) {\n closeHandlers.push(handler);\n },\n };\n}\n","/**\n * Playwright Authentication Plugin\n *\n * Thin wrapper around @abapify/browser-auth core.\n * Provides Playwright-specific browser adapter.\n */\n\nimport { authenticate, testCredentials } from '@abapify/browser-auth';\nimport type {\n BrowserCredentials,\n BrowserAuthOptions,\n} from '@abapify/browser-auth';\nimport { createPlaywrightAdapter } from './adapter';\n\n// Re-export types with Playwright-specific names for backwards compatibility\nexport type PlaywrightCredentials = BrowserCredentials;\nexport type PlaywrightAuthOptions = BrowserAuthOptions;\n\n/**\n * Playwright authentication object\n */\nexport const playwrightAuth = {\n /**\n * Authenticate using Playwright browser\n */\n async authenticate(\n options: PlaywrightAuthOptions,\n ): Promise<PlaywrightCredentials> {\n const adapter = createPlaywrightAdapter();\n return authenticate(adapter, options);\n },\n\n /**\n * Test if credentials are still valid\n */\n test: testCredentials,\n\n /**\n * Refresh is not reliable with Okta SSO - always return null to trigger full re-authentication\n */\n async refresh(session: {\n auth?: { pluginOptions?: { log?: (message: string) => void } };\n }): Promise<PlaywrightCredentials | null> {\n const log = session?.auth?.pluginOptions?.log as\n | ((message: string) => void)\n | undefined;\n (log ?? console.log)(\n '🔄 Session expired, will trigger full re-authentication...',\n );\n return null;\n },\n};\n\n// Re-export utilities\n// Legacy export\nexport const playwright = playwrightAuth;\nexport { toCookieHeader, toHeaders } from '@abapify/browser-auth';\n","/**\n * @fileoverview Playwright Authentication Plugin for AuthManager\n *\n * This module provides the standard auth plugin interface that AuthManager expects.\n * It wraps the Playwright-based browser authentication to return credentials in\n * the format required by the ADT authentication system.\n *\n * @module @abapify/adt-playwright/auth-plugin\n */\n\nimport type {\n AuthPlugin,\n AuthPluginResult,\n AuthPluginOptions,\n AuthSession,\n} from '@abapify/adt-auth';\nimport { playwrightAuth, toCookieHeader } from './playwright-auth';\n\n/** Default session duration when cookies don't specify expiration (8 hours) */\nconst DEFAULT_SESSION_DURATION_MS = 8 * 60 * 60 * 1000;\n\n/**\n * Determines the session expiration time from cookie data.\n *\n * Examines all cookies and returns the earliest expiration time found.\n * If no cookies have expiration set (common with session cookies),\n * returns a default expiration of 8 hours from now.\n *\n * @param cookies - Array of cookie objects with optional expires field\n * @returns The earliest expiration date, or default 8 hours from now\n *\n * @example\n * // Cookie with expiration\n * getExpiresAt([{ expires: 1732900000 }]) // Returns Date from timestamp\n *\n * @example\n * // Session cookie (no expiration)\n * getExpiresAt([{ expires: 0 }]) // Returns Date 8 hours from now\n */\nfunction getExpiresAt(cookies: { expires?: number }[]): Date {\n const expirations = cookies\n .filter((c) => c.expires && c.expires > 0)\n .map((c) => c.expires! * 1000); // Cookie expires is in seconds, convert to ms\n\n if (expirations.length > 0) {\n return new Date(Math.min(...expirations));\n }\n\n return new Date(Date.now() + DEFAULT_SESSION_DURATION_MS);\n}\n\n/**\n * Playwright authentication plugin for AuthManager.\n *\n * Implements the standard AuthPlugin interface to integrate Playwright-based\n * browser authentication with the ADT authentication system.\n *\n * @remarks\n * This plugin:\n * - Opens a browser window for SSO authentication\n * - Captures session cookies after successful login\n * - Converts cookies to the format expected by AuthManager\n * - Does NOT support silent refresh (Okta SSO requires user interaction)\n *\n * @example\n * ```typescript\n * // Used internally by AuthManager when destination type is '@abapify/adt-playwright'\n * import authPlugin from '@abapify/adt-playwright';\n *\n * const result = await authPlugin.authenticate({\n * url: 'https://sap-system.example.com',\n * headless: false,\n * userDataDir: true,\n * });\n * ```\n */\nconst authPlugin: AuthPlugin = {\n /**\n * Authenticate using Playwright browser automation.\n *\n * Opens a browser window, navigates to the SAP system, and waits for\n * the user to complete SSO authentication. Captures cookies and returns\n * them in AuthPluginResult format.\n *\n * @param options - Authentication options including URL and browser settings\n * @returns Promise resolving to credentials in AuthPluginResult format\n */\n async authenticate(options: AuthPluginOptions): Promise<AuthPluginResult> {\n const credentials = await playwrightAuth.authenticate(options);\n const cookieString = toCookieHeader(credentials);\n const expiresAt = getExpiresAt(credentials.cookies);\n\n return {\n method: 'cookie',\n credentials: {\n cookies: cookieString,\n expiresAt,\n },\n };\n },\n\n /**\n * Attempt to refresh an existing session.\n *\n * @remarks\n * Always returns null because Okta SSO sessions cannot be silently refreshed.\n * When a session expires, full re-authentication with user interaction is required.\n * The AuthManager will handle this by calling authenticate() again.\n *\n * @param _session - The existing session (unused)\n * @returns Always null, indicating refresh is not supported\n */\n async refresh(_session: AuthSession): Promise<AuthPluginResult | null> {\n return null;\n },\n};\n\nexport default authPlugin;\n","/**\n * @abapify/adt-playwright\n *\n * Playwright-based SSO authentication plugin for ADT client.\n * Uses @abapify/browser-auth core with Playwright adapter.\n */\n\nimport type { AdtConfig, Destination } from '@abapify/adt-config';\nimport type { BrowserAuthOptions } from '@abapify/browser-auth';\n\n// Re-export types\nexport type {\n PlaywrightCredentials,\n PlaywrightAuthOptions,\n} from './playwright-auth';\nexport type {\n BrowserCredentials,\n BrowserAuthOptions,\n CookieData,\n} from '@abapify/browser-auth';\n\n/**\n * Plugin-level options applied to all destinations\n */\nexport type PlaywrightPluginOptions = BrowserAuthOptions;\n\n/**\n * Create a playwright destination config\n */\nfunction createPlaywrightDestination(options: BrowserAuthOptions): Destination {\n return {\n type: '@abapify/adt-playwright',\n options,\n };\n}\n\n/**\n * Wrap a standard config with playwright auth for all destinations.\n */\nexport function withPlaywright(\n config: AdtConfig,\n options?: Partial<BrowserAuthOptions>,\n): AdtConfig {\n if (!config.destinations) {\n return config;\n }\n\n const destinations: Record<string, Destination> = {};\n\n for (const [name, dest] of Object.entries(config.destinations)) {\n if (typeof dest === 'object' && 'type' in dest) {\n if (\n dest.type === '@abapify/adt-playwright' ||\n dest.type === 'playwright'\n ) {\n destinations[name] = {\n type: '@abapify/adt-playwright',\n options: { ...options, ...(dest.options as BrowserAuthOptions) },\n };\n } else {\n destinations[name] = dest;\n }\n } else if (typeof dest === 'string') {\n destinations[name] = createPlaywrightDestination({\n url: dest,\n ...options,\n });\n } else {\n // Destination-specific options override global options\n destinations[name] = createPlaywrightDestination({\n ...options,\n ...(dest as BrowserAuthOptions),\n });\n }\n }\n\n return { ...config, destinations };\n}\n\n// Main exports\nexport {\n playwrightAuth,\n playwright,\n toCookieHeader,\n toHeaders,\n} from './playwright-auth';\n\n// AuthManager compatibility exports\nexport { default } from './auth-plugin';\nexport { default as authPlugin } from './auth-plugin';\n"],"mappings":";;;;;;;;;;;;;AAkBA,SAAS,cAAc,QAA4B;AACjD,QAAO;EACL,MAAM,OAAO;EACb,OAAO,OAAO;EACd,QAAQ,OAAO;EACf,MAAM,OAAO;EACb,SAAS,OAAO;EAChB,UAAU,OAAO;EACjB,QAAQ,OAAO;EACf,UAAU,OAAO;EAClB;;;;;AAMH,SAAgB,0BAA0C;CACxD,IAAI,UAAiC;CACrC,IAAI,OAAoB;CAExB,MAAM,mBAAuD,EAAE;CAC/D,MAAM,gBAAgC,EAAE;AAExC,QAAO;EACL,MAAM,OAAO,SAAS;GACpB,MAAM,EAAE,UAAU,aAAa,mBAAmB,cAAc;AAEhE,OAAI,YAEF,WAAU,MAAM,SAAS,wBAAwB,aAAa;IAC5D;IACA;IACA;IACD,CAAC;OAGF,WAAU,OADM,MAAM,SAAS,OAAO,EAAE,UAAU,CAAC,EAC3B,WAAW;IAAE;IAAmB;IAAW,CAAC;;EAIxE,MAAM,UAAU;AACd,OAAI,CAAC,QAAS,OAAM,IAAI,MAAM,uBAAuB;AACrD,UAAO,MAAM,QAAQ,SAAS;AAG9B,QAAK,GAAG,aAAa,aAAa;IAChC,MAAM,QAAuB;KAC3B,KAAK,SAAS,K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Aa,QAAQ,4BAA4B;EAC/C,KAAK;EACL,GAAG;EACJ,CAAC;KAGF,cAAa,QAAQ,4BAA4B;EAC/C,GAAG;EACH,GAAI;EACL,CAAC;AAIN,QAAO;EAAE,GAAG;EAAQ;EAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abapify/adt-playwright",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Playwright-based SSO authentication plugin for ADT client",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -17,9 +17,9 @@
17
17
  "README.md"
18
18
  ],
19
19
  "dependencies": {
20
- "@abapify/adt-auth": "0.4.0",
21
- "@abapify/adt-config": "0.4.0",
22
- "@abapify/browser-auth": "0.4.0",
20
+ "@abapify/adt-auth": "0.4.1",
21
+ "@abapify/adt-config": "0.4.1",
22
+ "@abapify/browser-auth": "0.4.1",
23
23
  "playwright": "^1.57.0"
24
24
  },
25
25
  "devDependencies": {