oksy 0.1.30 → 0.1.32
Sign up to get free protection for your applications and to get access to all the features.
- package/boot.js +20 -20
- package/library.js +1 -1
- package/package.json +1 -1
- package/public/assets/{index.a7675a50.js → index.2a92cdb2.js} +10 -10
- package/public/assets/index.349d5bb8.css +1 -0
- package/public/assets/{index.5b3ce61c.js → index.a31a2805.js} +3 -3
- package/public/index.html +2 -2
- package/types/src/Frontend/Controllers/PageController.d.ts +3 -2
- package/types/src/Helper/ClassImporter.d.ts +11 -0
- package/types/src/Server/BaseController.d.ts +35 -0
- package/types/src/Server/RegisterApiControllers.d.ts +4 -0
- package/types/src/library.d.ts +2 -1
- package/types/src/library.pub.d.ts +2 -1
- package/types/src/Server/Socket/PageManager.d.ts +0 -17
package/public/index.html
CHANGED
@@ -22,8 +22,8 @@
|
|
22
22
|
height: 100% !important;
|
23
23
|
}
|
24
24
|
</style>
|
25
|
-
<script type="module" crossorigin src="/assets/index.
|
26
|
-
<link rel="stylesheet" href="/assets/index.
|
25
|
+
<script type="module" crossorigin src="/assets/index.2a92cdb2.js"></script>
|
26
|
+
<link rel="stylesheet" href="/assets/index.349d5bb8.css">
|
27
27
|
</head>
|
28
28
|
<body class="tw-flex tw-flex-col tw-bg-gray-50">
|
29
29
|
<div id="app">
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import { Session, SessionManager } from './../../Server/Socket/SessionManager';
|
2
2
|
import { SqliteClient } from './../../Bootstrap/SqliteClient';
|
3
|
-
import {
|
3
|
+
import { BasePage } from 'oksy';
|
4
4
|
import { ReactiveStore } from 'src/ReactiveStore/ReactiveStore';
|
5
|
+
import { ClassImporter } from 'src/Helper/ClassImporter';
|
5
6
|
export type URL = {
|
6
7
|
path: string;
|
7
8
|
query: {
|
8
9
|
[key: string]: string;
|
9
10
|
};
|
10
11
|
};
|
11
|
-
export declare function PageController(reactiveStore: ReactiveStore, sqliteClient: SqliteClient,
|
12
|
+
export declare function PageController(reactiveStore: ReactiveStore, sqliteClient: SqliteClient, pageClassImporter: ClassImporter<typeof BasePage>, sessionManager: SessionManager, session: Session, url: URL): Promise<void | "login" | "register" | "forgot-password" | "reset-password" | "choose-workspace" | {
|
12
13
|
type: string;
|
13
14
|
status: string;
|
14
15
|
message: string;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export declare class ClassImporter<TBaseClass extends abstract new (...args: any) => any> {
|
2
|
+
private baseFolder;
|
3
|
+
private pattern;
|
4
|
+
private classes;
|
5
|
+
onAfterImport: null | (() => void);
|
6
|
+
constructor(baseFolder: string, pattern: string);
|
7
|
+
listenForChanges(): void;
|
8
|
+
importPageClasses(): Promise<void>;
|
9
|
+
getPaths(): string[];
|
10
|
+
getPageClassByIndex(index: number): new (...args: ConstructorParameters<TBaseClass>) => InstanceType<TBaseClass>;
|
11
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { SqliteClient } from 'src/Bootstrap/SqliteClient';
|
2
|
+
import { ReactiveStore } from 'src/ReactiveStore/ReactiveStore';
|
3
|
+
export declare class HttpResponse {
|
4
|
+
code: number;
|
5
|
+
body: any;
|
6
|
+
headers?: Record<string, any> | undefined;
|
7
|
+
constructor(code: number, body: any, headers?: Record<string, any> | undefined);
|
8
|
+
}
|
9
|
+
export type ApiUrl = {
|
10
|
+
path: string;
|
11
|
+
query: Record<string, string>;
|
12
|
+
fullUrl: string;
|
13
|
+
};
|
14
|
+
type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
15
|
+
type GET_OPTIONS = {
|
16
|
+
url: ApiUrl;
|
17
|
+
};
|
18
|
+
type POST_OPTIONS = GET_OPTIONS & {
|
19
|
+
json: undefined | any;
|
20
|
+
body: undefined | string;
|
21
|
+
};
|
22
|
+
export declare abstract class BaseController {
|
23
|
+
protected reactiveStore: ReactiveStore;
|
24
|
+
protected sqliteClient: SqliteClient;
|
25
|
+
constructor(reactiveStore: ReactiveStore, sqliteClient: SqliteClient);
|
26
|
+
ALL?(options: POST_OPTIONS & {
|
27
|
+
method: Method;
|
28
|
+
}): HttpResponse;
|
29
|
+
GET?(options: GET_OPTIONS): HttpResponse;
|
30
|
+
POST?(options: POST_OPTIONS): HttpResponse;
|
31
|
+
PUT?(options: POST_OPTIONS): HttpResponse;
|
32
|
+
PATCH?(options: POST_OPTIONS): HttpResponse;
|
33
|
+
DELETE?(options: POST_OPTIONS): HttpResponse;
|
34
|
+
}
|
35
|
+
export {};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { FastifyInstance } from 'fastify';
|
2
|
+
import { ReactiveStore } from './../ReactiveStore/ReactiveStore';
|
3
|
+
import { SqliteClient } from './../Bootstrap/SqliteClient';
|
4
|
+
export declare function registerApiControllers(fastifyServer: FastifyInstance, reactiveStore: ReactiveStore, sqliteClient: SqliteClient): Promise<void>;
|
package/types/src/library.d.ts
CHANGED
@@ -8,4 +8,5 @@ import { hash } from './Helper/Hash';
|
|
8
8
|
import { googleIcons, type GoogleIconType } from './Frontend/GoogleIcons';
|
9
9
|
import { IValidator } from './ReactiveStore/Validators/IValidator';
|
10
10
|
import { sort } from './Helper/Sort';
|
11
|
-
|
11
|
+
import { BaseController, HttpResponse } from './Server/BaseController';
|
12
|
+
export { Config, GlobalEntity, Entity, One, Many, BaseUser, BaseWorkspace, BaseMembership, BaseFile, BasePage, Database, seed, hash, googleIcons, GoogleIconType, IValidator, sort, isValid, Draft, BaseController, HttpResponse, };
|
@@ -7,6 +7,7 @@ import { hash } from './Helper/Hash';
|
|
7
7
|
import { googleIcons, type GoogleIconType } from './Frontend/GoogleIcons';
|
8
8
|
import { WebSocketServerClient } from './Server/Socket/WebSocketServerClient';
|
9
9
|
import { sort } from './Helper/Sort';
|
10
|
+
import { BaseController, HttpResponse } from './Server/BaseController';
|
10
11
|
import * as MODULES from './../../../../models/_generated/types.d';
|
11
12
|
declare abstract class GlobalEntity {
|
12
13
|
id: string;
|
@@ -53,4 +54,4 @@ declare class Database {
|
|
53
54
|
create<T extends MODULE_KEY>(moduleName: T): Draft<MODEL<T>>;
|
54
55
|
delete(model: any): void;
|
55
56
|
}
|
56
|
-
export { Config, GlobalEntity, Entity, One, Many, BaseUser, BaseWorkspace, BaseMembership, BaseFile, BasePage, Database, seed, hash, googleIcons, GoogleIconType, IValidator, sort, isValid, Draft, };
|
57
|
+
export { Config, GlobalEntity, Entity, One, Many, BaseUser, BaseWorkspace, BaseMembership, BaseFile, BasePage, Database, seed, hash, googleIcons, GoogleIconType, IValidator, sort, isValid, Draft, BaseController, HttpResponse, };
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { Database } from './../../ReactiveStore/ReactiveStore';
|
2
|
-
import { BasePage } from 'oksy';
|
3
|
-
import { BaseWorkspace } from 'oksy';
|
4
|
-
export type Route = {
|
5
|
-
database: null | Database;
|
6
|
-
pageClass: null | (new (...args: any[]) => BasePage);
|
7
|
-
workspace: null | BaseWorkspace;
|
8
|
-
params: Array<null | string>;
|
9
|
-
};
|
10
|
-
export declare class PageManager {
|
11
|
-
private pageClasses;
|
12
|
-
private viewsFolder;
|
13
|
-
listenForChanges(): void;
|
14
|
-
importPageClasses(): Promise<void>;
|
15
|
-
getPaths(): string[];
|
16
|
-
getPageClassByIndex(index: number): new (...args: ConstructorParameters<typeof BasePage>) => BasePage;
|
17
|
-
}
|