@cartanova/qgrid-cli 1.0.1 → 1.0.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/bundle/src/application/qgrid/oauth.ts +181 -0
- package/bundle/src/application/qgrid/pool.ts +132 -0
- package/bundle/src/application/qgrid/qgrid.frame.ts +275 -0
- package/bundle/src/application/qgrid/qgrid.types.ts +117 -0
- package/bundle/src/application/qgrid/worker.ts +234 -0
- package/bundle/src/application/queries.generated.ts +59 -0
- package/bundle/src/application/request-log/request-log.model.ts +155 -0
- package/bundle/src/application/request-log/request-log.types.ts +15 -0
- package/bundle/src/application/sonamu.generated.http +187 -0
- package/bundle/src/application/sonamu.generated.sso.ts +66 -0
- package/bundle/src/application/sonamu.generated.ts +135 -0
- package/bundle/src/application/token/token.model.ts +160 -0
- package/bundle/src/application/token/token.types.ts +26 -0
- package/bundle/src/i18n/en.ts +59 -0
- package/bundle/src/i18n/ko.ts +59 -0
- package/bundle/src/i18n/sd.generated.ts +384 -0
- package/bundle/src/index.ts +6 -0
- package/bundle/src/sonamu.config.ts +248 -0
- package/bundle/src/testing/fixture.ts +6 -0
- package/bundle/src/testing/global.ts +6 -0
- package/bundle/src/testing/setup-mocks.ts +44 -0
- package/bundle/src/typings/fastify.d.ts +8 -0
- package/bundle/src/typings/sonamu.d.ts +17 -0
- package/bundle/src/utils/subset-loaders.ts +11 -0
- package/package.json +2 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { PathLike } from "fs";
|
|
2
|
+
|
|
3
|
+
// import { Naite } from "sonamu";
|
|
4
|
+
import { vi } from "vitest";
|
|
5
|
+
|
|
6
|
+
// GlobalMock: fs/promises (사용 예시 - 필요시 활성화)
|
|
7
|
+
vi.mock("fs/promises", async (importOriginal) => {
|
|
8
|
+
const actual = (await importOriginal()) as typeof import("fs/promises");
|
|
9
|
+
return {
|
|
10
|
+
...actual,
|
|
11
|
+
access: vi.fn((path: PathLike, mode?: number) => {
|
|
12
|
+
// const vfs = Naite.get("mock:fs/promises:virtualFileSystem").result();
|
|
13
|
+
// if (vfs.some((v) => v === path)) {
|
|
14
|
+
// return Promise.resolve();
|
|
15
|
+
// }
|
|
16
|
+
|
|
17
|
+
return actual.access(path, mode);
|
|
18
|
+
}),
|
|
19
|
+
// mkdir: vi.fn(
|
|
20
|
+
// async (
|
|
21
|
+
// path: PathLike,
|
|
22
|
+
// options?: MakeDirectoryOptions | Mode | null,
|
|
23
|
+
// ): Promise<string | undefined> => {
|
|
24
|
+
// // Naite.t("fs:mkdir", { path, options });
|
|
25
|
+
// if (typeof options === "object" && options?.recursive) {
|
|
26
|
+
// return typeof path === "string" ? path : path.toString();
|
|
27
|
+
// }
|
|
28
|
+
// return undefined;
|
|
29
|
+
// },
|
|
30
|
+
// ),
|
|
31
|
+
// writeFile: vi.fn((path: PathLike | FileHandle, data: string | Buffer | Uint8Array) => {
|
|
32
|
+
// const filePath = typeof path === "string" ? path : path.toString();
|
|
33
|
+
|
|
34
|
+
// // Naite.t(`fs/promises:writeFile`, { path: filePath, data });
|
|
35
|
+
// }),
|
|
36
|
+
// rm: vi.fn(async (path: PathLike, options?: RmOptions) => {
|
|
37
|
+
// const filePath = typeof path === "string" ? path : path.toString();
|
|
38
|
+
|
|
39
|
+
// // Naite.t(`fs/promises:rm`, { path: filePath, options });
|
|
40
|
+
// // 실제 삭제하지 않고 기록만 함
|
|
41
|
+
// return Promise.resolve();
|
|
42
|
+
// }),
|
|
43
|
+
};
|
|
44
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** biome-ignore-all lint/correctness/noUnusedImports: d.ts */
|
|
2
|
+
|
|
3
|
+
import {} from "sonamu";
|
|
4
|
+
|
|
5
|
+
declare module "sonamu" {
|
|
6
|
+
export interface ContextExtend {
|
|
7
|
+
ip: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface GuardKeys {
|
|
11
|
+
query: true;
|
|
12
|
+
user: true;
|
|
13
|
+
admin: true;
|
|
14
|
+
// 새로운 커스텀 가드키를 추가하는 경우
|
|
15
|
+
// CustomGuardKey: true
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SubsetQuery } from "sonamu";
|
|
2
|
+
|
|
3
|
+
export function getSubsetLoaders(subsets: string[], subsetQueries: Record<string, SubsetQuery>) {
|
|
4
|
+
return subsets.reduce(
|
|
5
|
+
(acc, subset) => {
|
|
6
|
+
acc[subset] = subsetQueries[subset]?.loaders ?? [];
|
|
7
|
+
return acc;
|
|
8
|
+
},
|
|
9
|
+
{} as Record<string, SubsetQuery["loaders"]>,
|
|
10
|
+
);
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cartanova/qgrid-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/cartanova-ai/qgrid"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"node": ">=20"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
|
-
"bundle": "cd ../api && pnpm build && cd ../cli && mkdir -p bundle/public && cp -r ../api/dist ./bundle/dist && cp -r ../api/web-dist ./bundle/web-dist &&
|
|
51
|
+
"bundle": "cd ../api && pnpm build && cd ../cli && mkdir -p bundle/public && cp -r ../api/dist ./bundle/dist && cp -r ../api/web-dist ./bundle/web-dist && cp -r ../api/src ./bundle/src",
|
|
52
52
|
"build": "tsdown"
|
|
53
53
|
}
|
|
54
54
|
}
|