@teamphnx/sduiapi 0.1.5 → 0.1.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../src/utils/parsers.ts"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../src/utils/parsers.ts"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYjE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG5D;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,mBAAmB,SAAI,GAAG,MAAM,CAM1E"}
|
package/dist/utils/parsers.js
CHANGED
|
@@ -5,7 +5,12 @@ export function extractMetaRefreshUrl(html) {
|
|
|
5
5
|
if (!match?.[1]) {
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
// The content attribute can carry tokens after the URL: SDUI's bridge page
|
|
9
|
+
// sends `content='0; url=https://...&code_challenge=XYZ target=_top'`.
|
|
10
|
+
// Keeping " target=_top" corrupted the PKCE code_challenge and WebUntis
|
|
11
|
+
// rejected the authorize request. A URL never contains raw whitespace.
|
|
12
|
+
const url = match[1].replaceAll('&', '&').trim().split(/\s+/)[0];
|
|
13
|
+
return url || null;
|
|
9
14
|
}
|
|
10
15
|
export function extractCsrfToken(html) {
|
|
11
16
|
const match = CSRF_TOKEN_PATTERN.exec(html);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../src/utils/parsers.ts"],"names":[],"mappings":"AAAA,MAAM,wBAAwB,GAC1B,iFAA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AC1B,CAAC;IAED,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC;AACxD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamphnx/sduiapi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "TypeScript SDUI API client with WebUntis authentication",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sdui"
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"build": "tsc -p tsconfig.json",
|
|
37
37
|
"check": "tsc --noEmit -p tsconfig.json",
|
|
38
38
|
"dev": "npm run build",
|
|
39
|
+
"prepack": "npm run build",
|
|
39
40
|
"test": "vitest run",
|
|
40
41
|
"test:watch": "vitest",
|
|
41
42
|
"test:live": "vitest run --config vitest.live.config.ts"
|
package/dist/src/index.d.ts
DELETED
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}
|
package/dist/src/index.js
DELETED
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC"}
|