monoidentity 0.15.1 → 0.15.2
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/storage/backupcloud.d.ts +1 -1
- package/dist/utils-transport.d.ts +5 -1
- package/dist/verification/attest-proxy.disabled.d.ts +4 -0
- package/dist/verification/attest-proxy.disabled.js +35 -0
- package/dist/verification/attest-remote.js +1 -1
- package/package.json +3 -3
- package/dist/utils-bucket.d.ts +0 -7
- package/dist/utils-bucket.js +0 -7
- package/dist/verification/studentvue.d.ts +0 -6
- package/dist/verification/studentvue.js +0 -45
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Bucket } from "../utils-
|
|
1
|
+
import type { Bucket } from "../utils-transport.js";
|
|
2
2
|
export declare const backupCloud: (shouldBackup: (path: string) => boolean, bucket: Bucket) => Promise<void>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
async fetch(request) {
|
|
5
|
+
const target = request.headers.get("x-proxy-target");
|
|
6
|
+
if (!target) {
|
|
7
|
+
return new Response("Missing x-proxy-target header", { status: 400 });
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
const targetUrl = new URL(target);
|
|
12
|
+
if (
|
|
13
|
+
targetUrl.protocol != "https:" ||
|
|
14
|
+
!targetUrl.host.endsWith("-psv.edupoint.com") ||
|
|
15
|
+
targetUrl.pathname != "/Service/PXPCommunication.asmx/ProcessWebServiceRequest"
|
|
16
|
+
) {
|
|
17
|
+
throw new Error();
|
|
18
|
+
}
|
|
19
|
+
} catch {
|
|
20
|
+
return new Response("Invalid target URL", { status: 400 });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const newHeaders = new Headers(request.headers);
|
|
24
|
+
newHeaders.delete("x-proxy-target");
|
|
25
|
+
newHeaders.delete("host");
|
|
26
|
+
|
|
27
|
+
const newRequest = new Request(target, {
|
|
28
|
+
method: request.method,
|
|
29
|
+
headers: newHeaders,
|
|
30
|
+
body: request.body,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return fetch(newRequest);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/lib/verification/attest.remote.ts
|
|
2
2
|
async function attest_remote_default(arg, init) {
|
|
3
|
-
const res = await fetch("https://benignmonoserver.fly.dev/
|
|
3
|
+
const res = await fetch("https://benignmonoserver.fly.dev/attest:c5", {
|
|
4
4
|
method: "POST",
|
|
5
5
|
body: JSON.stringify(arg),
|
|
6
6
|
...init
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monoidentity",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"repository": "KTibow/monoidentity",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "KTibow"
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"@sveltejs/package": "^2.5.4",
|
|
43
43
|
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
44
44
|
"@types/wicg-file-system-access": "^2023.10.6",
|
|
45
|
-
"fast-
|
|
45
|
+
"fast-studentvue": "^2.0.1",
|
|
46
46
|
"knip": "^5.64.1",
|
|
47
|
-
"monoserve": "^3.
|
|
47
|
+
"monoserve": "^3.2.0",
|
|
48
48
|
"publint": "^0.3.13",
|
|
49
49
|
"rolldown": "1.0.0-beta.40",
|
|
50
50
|
"school-districts": "^2.0.0",
|
package/dist/utils-bucket.d.ts
DELETED
package/dist/utils-bucket.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { XMLParser } from "fast-xml-parser";
|
|
2
|
-
const build = (object) => {
|
|
3
|
-
const params = new URLSearchParams();
|
|
4
|
-
for (const [key, value] of Object.entries(object)) {
|
|
5
|
-
params.set(key, value);
|
|
6
|
-
}
|
|
7
|
-
return params;
|
|
8
|
-
};
|
|
9
|
-
const parser = new XMLParser({ ignoreAttributes: false });
|
|
10
|
-
export default async ({ base, userID, password }, name, params = {}) => {
|
|
11
|
-
const request = build({
|
|
12
|
-
userID,
|
|
13
|
-
password,
|
|
14
|
-
skipLoginLog: "true",
|
|
15
|
-
parent: "false",
|
|
16
|
-
webServiceHandleName: "PXPWebServices",
|
|
17
|
-
methodName: name,
|
|
18
|
-
paramStr: `<Parms>${Object.keys(params)
|
|
19
|
-
.map((key) => `<${key}>${params[key]}</${key}>`)
|
|
20
|
-
.join("")}</Parms>`,
|
|
21
|
-
});
|
|
22
|
-
const response = await fetch(`${base}/Service/PXPCommunication.asmx/ProcessWebServiceRequest`, {
|
|
23
|
-
method: "POST",
|
|
24
|
-
body: request,
|
|
25
|
-
headers: {
|
|
26
|
-
"content-type": "application/x-www-form-urlencoded",
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
const dataWrap = await response.text();
|
|
30
|
-
const data = dataWrap
|
|
31
|
-
.split(`<string xmlns="http://edupoint.com/webservices/">`)[1]
|
|
32
|
-
.split("</string>")[0]
|
|
33
|
-
.replace(/&/g, "&")
|
|
34
|
-
.replace(/</g, "<")
|
|
35
|
-
.replace(/>/g, ">");
|
|
36
|
-
const xml = parser.parse(data);
|
|
37
|
-
const err = xml.RT_ERROR;
|
|
38
|
-
if (err) {
|
|
39
|
-
if (err["@_ERROR_MESSAGE"].startsWith("Invalid user id or password")) {
|
|
40
|
-
throw new Error("Invalid auth");
|
|
41
|
-
}
|
|
42
|
-
throw new Error("StudentVue error");
|
|
43
|
-
}
|
|
44
|
-
return xml;
|
|
45
|
-
};
|