This commit is contained in:
Rizky
2024-01-24 07:35:44 +07:00
parent 829f1367dc
commit a63cc40afe
6 changed files with 91 additions and 80 deletions
+50 -50
View File
@@ -1,3 +1,19 @@
declare module "pkgs/api/_prasi" {
export const _: {
url: string;
api(): Promise<void>;
};
export const getApiEntry: () => any;
}
declare module "pkgs/api/_web" {
export const _: {
url: string;
api(id: string, _: string): Promise<any>;
};
}
declare module "pkgs/utils/dir" {
export const dir: (path: string) => string;
}
declare module "app/db/db" {
}
@@ -89,19 +105,6 @@ declare module "pkgs/utils/global" {
};
};
}
declare module "pkgs/server/serve-web" {
export const serveWeb: (url: URL, req: Request) => Promise<false | string[] | Response>;
export const generateIndexHtml: (base_url: string, site_id: string) => string;
}
declare module "pkgs/api/_file" {
export const _: {
url: string;
api(): Promise<Response>;
};
}
declare module "pkgs/utils/dir" {
export const dir: (path: string) => string;
}
declare module "pkgs/server/load-web" {
export const loadWeb: () => Promise<void>;
export const loadWebCache: (site_id: string, ts: number | string) => Promise<void>;
@@ -155,12 +158,21 @@ declare module "pkgs/api/_deploy" {
};
export const downloadFile: (url: string, filePath: string, progress?: (rec: number, total: number) => void) => Promise<boolean>;
}
declare module "pkgs/api/_prasi" {
declare module "pkgs/api/_upload" {
export const _: {
url: string;
api(): Promise<void>;
api(body: any): Promise<string>;
};
}
declare module "pkgs/server/serve-web" {
export const serveWeb: (url: URL, req: Request) => Promise<false | string[] | Response>;
export const generateIndexHtml: (base_url: string, site_id: string) => string;
}
declare module "pkgs/api/_file" {
export const _: {
url: string;
api(): Promise<Response>;
};
export const getApiEntry: () => any;
}
declare module "pkgs/api/_notif" {
export const _: {
@@ -190,10 +202,10 @@ declare module "pkgs/api/_notif" {
}>;
};
}
declare module "pkgs/api/_web" {
declare module "pkgs/api/_api_frm" {
export const _: {
url: string;
api(id: string, _: string): Promise<any>;
api(): Promise<void>;
};
}
declare module "pkgs/api/_proxy" {
@@ -207,31 +219,19 @@ declare module "pkgs/api/_proxy" {
}): Promise<Response>;
};
}
declare module "pkgs/api/_upload" {
export const _: {
url: string;
api(body: any): Promise<string>;
};
}
declare module "pkgs/api/_dbs" {
export const _: {
url: string;
api(dbName: any, action?: string): Promise<void>;
};
}
declare module "pkgs/api/_api_frm" {
export const _: {
url: string;
api(): Promise<void>;
};
}
declare module "app/srv/exports" {
export const _file: {
export const _web: {
name: string;
url: string;
path: string;
args: any[];
handler: Promise<typeof import("pkgs/api/_file")>;
args: string[];
handler: Promise<typeof import("pkgs/api/_web")>;
};
export const _deploy: {
name: string;
@@ -240,6 +240,13 @@ declare module "app/srv/exports" {
args: string[];
handler: Promise<typeof import("pkgs/api/_deploy")>;
};
export const _upload: {
name: string;
url: string;
path: string;
args: string[];
handler: Promise<typeof import("pkgs/api/_upload")>;
};
export const _prasi: {
name: string;
url: string;
@@ -247,6 +254,13 @@ declare module "app/srv/exports" {
args: any[];
handler: Promise<typeof import("pkgs/api/_prasi")>;
};
export const _file: {
name: string;
url: string;
path: string;
args: any[];
handler: Promise<typeof import("pkgs/api/_file")>;
};
export const _notif: {
name: string;
url: string;
@@ -254,12 +268,12 @@ declare module "app/srv/exports" {
args: string[];
handler: Promise<typeof import("pkgs/api/_notif")>;
};
export const _web: {
export const _api_frm: {
name: string;
url: string;
path: string;
args: string[];
handler: Promise<typeof import("pkgs/api/_web")>;
args: any[];
handler: Promise<typeof import("pkgs/api/_api_frm")>;
};
export const _proxy: {
name: string;
@@ -268,13 +282,6 @@ declare module "app/srv/exports" {
args: string[];
handler: Promise<typeof import("pkgs/api/_proxy")>;
};
export const _upload: {
name: string;
url: string;
path: string;
args: string[];
handler: Promise<typeof import("pkgs/api/_upload")>;
};
export const _dbs: {
name: string;
url: string;
@@ -282,11 +289,4 @@ declare module "app/srv/exports" {
args: string[];
handler: Promise<typeof import("pkgs/api/_dbs")>;
};
export const _api_frm: {
name: string;
url: string;
path: string;
args: any[];
handler: Promise<typeof import("pkgs/api/_api_frm")>;
};
}
+26 -26
View File
@@ -1,9 +1,9 @@
export const _file = {
name: "_file",
url: "/_file/**",
path: "app/srv/api/_file.ts",
args: [],
handler: import("../../pkgs/api/_file")
export const _web = {
name: "_web",
url: "/_web/:id/**",
path: "app/srv/api/_web.ts",
args: ["id","_"],
handler: import("../../pkgs/api/_web")
}
export const _deploy = {
name: "_deploy",
@@ -12,6 +12,13 @@ export const _deploy = {
args: ["action"],
handler: import("../../pkgs/api/_deploy")
}
export const _upload = {
name: "_upload",
url: "/_upload",
path: "app/srv/api/_upload.ts",
args: ["body"],
handler: import("../../pkgs/api/_upload")
}
export const _prasi = {
name: "_prasi",
url: "/_prasi/**",
@@ -19,6 +26,13 @@ export const _prasi = {
args: [],
handler: import("../../pkgs/api/_prasi")
}
export const _file = {
name: "_file",
url: "/_file/**",
path: "app/srv/api/_file.ts",
args: [],
handler: import("../../pkgs/api/_file")
}
export const _notif = {
name: "_notif",
url: "/_notif/:action/:token",
@@ -26,12 +40,12 @@ export const _notif = {
args: ["action","data"],
handler: import("../../pkgs/api/_notif")
}
export const _web = {
name: "_web",
url: "/_web/:id/**",
path: "app/srv/api/_web.ts",
args: ["id","_"],
handler: import("../../pkgs/api/_web")
export const _api_frm = {
name: "_api_frm",
url: "/_api_frm",
path: "app/srv/api/_api_frm.ts",
args: [],
handler: import("../../pkgs/api/_api_frm")
}
export const _proxy = {
name: "_proxy",
@@ -40,24 +54,10 @@ export const _proxy = {
args: ["arg"],
handler: import("../../pkgs/api/_proxy")
}
export const _upload = {
name: "_upload",
url: "/_upload",
path: "app/srv/api/_upload.ts",
args: ["body"],
handler: import("../../pkgs/api/_upload")
}
export const _dbs = {
name: "_dbs",
url: "/_dbs/:dbName/:action",
path: "app/srv/api/_dbs.ts",
args: ["dbName","action"],
handler: import("../../pkgs/api/_dbs")
}
export const _api_frm = {
name: "_api_frm",
url: "/_api_frm",
path: "app/srv/api/_api_frm.ts",
args: [],
handler: import("../../pkgs/api/_api_frm")
}