xmoj-script 1.1.1 → 1.1.3

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,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
- }
@@ -1,11 +0,0 @@
1
- {
2
- "folders": [
3
- {
4
- "path": ".."
5
- },
6
- {
7
- "path": "../../XMOJ-Script"
8
- }
9
- ],
10
- "settings": {}
11
- }
@@ -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
@@ -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
- }
@@ -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"