xmoj-script 1.1.1 → 1.1.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/.github/workflows/Prerelease.yml +10 -2
- package/.github/workflows/Release.yml +10 -2
- package/README.md +4 -5
- package/SECURITY.md +3 -2
- package/Update/GetVersion.js +4 -2
- package/Update/UpdateToRelease.js +11 -6
- package/Update/UpdateVersion.js +14 -9
- package/Update.json +11 -1
- package/XMOJ.user.js +6 -1
- package/package.json +1 -1
- package/backend/.github/.config.yml +0 -21
- package/backend/.github/ISSUE_TEMPLATE/bug.yml +0 -30
- package/backend/.github/ISSUE_TEMPLATE/config.yml +0 -5
- package/backend/.github/ISSUE_TEMPLATE/feature.yml +0 -25
- package/backend/.github/dependabot.yml +0 -12
- package/backend/.github/labeler.yml +0 -14
- package/backend/LICENSE +0 -661
- package/backend/README.md +0 -3
- package/backend/Source/BBSSpider.js +0 -50
- package/backend/Source/Database.ts +0 -188
- package/backend/Source/Initial.sql +0 -95
- package/backend/Source/Output.ts +0 -14
- package/backend/Source/Process.ts +0 -1227
- package/backend/Source/Result.ts +0 -24
- package/backend/Source/XMOJ-bbs.code-workspace +0 -11
- package/backend/Source/index.ts +0 -31
- package/backend/bun.lockb +0 -0
- package/backend/package.json +0 -19
- package/backend/wrangler.toml +0 -17
package/backend/Source/Result.ts
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
export class Result {
|
2
|
-
public Success: boolean;
|
3
|
-
public Data: object;
|
4
|
-
public Message: string;
|
5
|
-
constructor(Success: boolean = false, Message: string = "Unknown error", Data: object = {}) {
|
6
|
-
this.Success = Success;
|
7
|
-
this.Message = Message;
|
8
|
-
this.Data = Data;
|
9
|
-
}
|
10
|
-
public toString(): string {
|
11
|
-
return JSON.stringify({
|
12
|
-
Success: this.Success,
|
13
|
-
Data: this.Data,
|
14
|
-
Message: this.Message
|
15
|
-
});
|
16
|
-
}
|
17
|
-
}
|
18
|
-
|
19
|
-
export const ThrowErrorIfFailed = (CurrentResult: Result): Object => {
|
20
|
-
if (CurrentResult.Success === false) {
|
21
|
-
throw CurrentResult;
|
22
|
-
}
|
23
|
-
return CurrentResult.Data;
|
24
|
-
}
|
package/backend/Source/index.ts
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
import { Process } from "./Process";
|
2
|
-
import { Database } from "./Database";
|
3
|
-
|
4
|
-
export default {
|
5
|
-
async fetch(RequestData: Request, Environment, Context) {
|
6
|
-
let Processor = new Process(RequestData, Environment);
|
7
|
-
return await Processor.Process();
|
8
|
-
},
|
9
|
-
async scheduled(Event, Environment, Context) {
|
10
|
-
let XMOJDatabase = new Database(Environment.DB);
|
11
|
-
Context.waitUntil(new Promise<void>(async (Resolve) => {
|
12
|
-
await XMOJDatabase.Delete("short_message", {
|
13
|
-
"send_time": {
|
14
|
-
"Operator": "<=",
|
15
|
-
"Value": new Date().getTime() - 1000 * 60 * 60 * 24 * 14
|
16
|
-
},
|
17
|
-
"is_read": {
|
18
|
-
"Operator": "=",
|
19
|
-
"Value": 1
|
20
|
-
}
|
21
|
-
});
|
22
|
-
await XMOJDatabase.Delete("phpsessid", {
|
23
|
-
"create_time": {
|
24
|
-
"Operator": "<=",
|
25
|
-
"Value": new Date().getTime() - 1000 * 60 * 60 * 24 * 7
|
26
|
-
}
|
27
|
-
});
|
28
|
-
Resolve();
|
29
|
-
}));
|
30
|
-
},
|
31
|
-
};
|
package/backend/bun.lockb
DELETED
Binary file
|
package/backend/package.json
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "xmoj-bbs",
|
3
|
-
"version": "1.1.0",
|
4
|
-
"private": false,
|
5
|
-
"scripts": {
|
6
|
-
"deploy": "wrangler deploy",
|
7
|
-
"start": "wrangler dev"
|
8
|
-
},
|
9
|
-
"devDependencies": {
|
10
|
-
"@cloudflare/workers-types": "^4.20230914.0",
|
11
|
-
"typescript": "^5.2.2",
|
12
|
-
"wrangler": "^3.8.0"
|
13
|
-
},
|
14
|
-
"dependencies": {
|
15
|
-
"cheerio": "^1.0.0-rc.12",
|
16
|
-
"crypto-js": "^4.1.1",
|
17
|
-
"sqlstring": "^2.3.3"
|
18
|
-
}
|
19
|
-
}
|
package/backend/wrangler.toml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
name = "xmoj-bbs"
|
2
|
-
main = "Source/index.ts"
|
3
|
-
compatibility_date = "2023-09-17"
|
4
|
-
|
5
|
-
[[d1_databases]]
|
6
|
-
binding = "DB"
|
7
|
-
database_name = "xmoj-bbs"
|
8
|
-
database_id = "f6607070-7f3b-4a9b-95a2-40ff67283362"
|
9
|
-
|
10
|
-
[triggers]
|
11
|
-
crons = ["0 0 * * *"]
|
12
|
-
|
13
|
-
[placement]
|
14
|
-
mode = "smart"
|
15
|
-
|
16
|
-
[[analytics_engine_datasets]]
|
17
|
-
binding = "logdb"
|