usage-board 4.0.2 → 5.0.0
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/dist/index.mjs +40 -22
- package/dist/public/_nuxt/3inMrCcs.js +146 -0
- package/dist/public/_nuxt/5M1aAlPv.js +6 -0
- package/dist/public/_nuxt/{DaoeXHW_.js → BHGcQrYH.js} +2 -2
- package/dist/public/_nuxt/{BJWBp9U3.js → BgVTqBr9.js} +1 -1
- package/dist/public/_nuxt/{BOTUKIyR.js → BhTZzeJU.js} +1 -1
- package/dist/public/_nuxt/{CJv0IWZB.js → BlxNEZ3W.js} +1 -1
- package/dist/public/_nuxt/BwYRMC0_.js +1 -0
- package/dist/public/_nuxt/C3BLG0Zo.js +21 -0
- package/dist/public/_nuxt/{BVD8FQXV.js → C8lAAJpL.js} +1 -1
- package/dist/public/_nuxt/Cxd8QZxF.js +261 -0
- package/dist/public/_nuxt/DXeNXt_b.js +1 -0
- package/dist/public/_nuxt/DavRiQHq.js +25 -0
- package/dist/public/_nuxt/{nv0LjcWu.js → DfL4oXhq.js} +3 -3
- package/dist/public/_nuxt/{CJECfsOP.js → DjKivtvZ.js} +1 -1
- package/dist/public/_nuxt/{tDg_nW46.js → OPi16VNs.js} +1 -1
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/eff380a6-8407-4f41-af1f-39f3ae1dface.json +1 -0
- package/dist/public/_nuxt/{entry.DnkKc-6G.css → entry.BYVbC6M5.css} +1 -1
- package/dist/public/_nuxt/error-404.ABvo6GrV.css +1 -0
- package/dist/public/_nuxt/error-500.CaR7LJUF.css +1 -0
- package/dist/public/pricing-data/fast-multiplier-overrides.json +12 -0
- package/dist/public/pricing-data/litellm-pricing.json +43714 -0
- package/dist/public/pricing-data/models-dev-pricing.json +178004 -0
- package/dist/server/chunks/_/analysis-handlers.mjs +54 -0
- package/dist/server/chunks/_/pagination.mjs +16 -0
- package/dist/server/chunks/build/client.precomputed.mjs +1 -1
- package/dist/server/chunks/nitro/nitro.mjs +5813 -6791
- package/dist/server/chunks/routes/api/analysis/agent/session.json.mjs +13 -3
- package/dist/server/chunks/routes/api/analysis/agent/token.json.mjs +13 -3
- package/dist/server/chunks/routes/api/analysis/cache.json.mjs +12 -3
- package/dist/server/chunks/routes/api/analysis/hot-project.json.mjs +12 -3
- package/dist/server/chunks/routes/api/analysis/live-state.json.mjs +32 -0
- package/dist/server/chunks/routes/api/analysis/model.json.mjs +12 -3
- package/dist/server/chunks/routes/api/analysis/overview-cards.json.mjs +12 -3
- package/dist/server/chunks/routes/api/analysis/session.json.mjs +12 -3
- package/dist/server/chunks/routes/api/analysis/token/daily.json.mjs +13 -3
- package/dist/server/chunks/routes/api/analysis/token/today-hourly.json.mjs +12 -3
- package/dist/server/chunks/routes/api/analysis/token.json.mjs +12 -3
- package/dist/server/chunks/routes/api/projects/_project/modules.get.mjs +14 -6
- package/dist/server/chunks/routes/api/projects/catalog.get.mjs +12 -4
- package/dist/server/chunks/routes/renderer.mjs +11 -3
- package/dist/server/chunks/routes/ws.mjs +64 -71
- package/dist/server/index.mjs +11 -3
- package/dist/server/node_modules/@clack/core/dist/index.mjs +17 -0
- package/dist/server/node_modules/@clack/core/package.json +63 -0
- package/dist/server/node_modules/@clack/prompts/dist/index.mjs +145 -0
- package/dist/server/node_modules/@clack/prompts/package.json +68 -0
- package/dist/server/node_modules/dayjs/dayjs.min.js +1 -0
- package/dist/server/node_modules/dayjs/package.json +85 -0
- package/dist/server/node_modules/dayjs/plugin/utc.js +1 -0
- package/dist/server/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/dist/server/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/dist/server/node_modules/fast-string-truncated-width/package.json +35 -0
- package/dist/server/node_modules/fast-string-width/dist/index.js +14 -0
- package/dist/server/node_modules/fast-string-width/package.json +34 -0
- package/dist/server/node_modules/fast-wrap-ansi/lib/main.js +218 -0
- package/dist/server/node_modules/fast-wrap-ansi/package.json +51 -0
- package/dist/server/node_modules/sisteransi/package.json +34 -0
- package/dist/server/node_modules/sisteransi/src/index.js +58 -0
- package/dist/server/node_modules/xdg-basedir/index.js +30 -0
- package/dist/server/node_modules/xdg-basedir/package.json +47 -0
- package/dist/server/package.json +10 -2
- package/package.json +11 -9
- package/dist/public/_nuxt/BILXBbDI.js +0 -21
- package/dist/public/_nuxt/BXbx6JCB.js +0 -1
- package/dist/public/_nuxt/BfVC-jX7.js +0 -1
- package/dist/public/_nuxt/BhIINiyq.js +0 -146
- package/dist/public/_nuxt/CXOkrwUP.js +0 -6
- package/dist/public/_nuxt/DFbWcbwl.js +0 -261
- package/dist/public/_nuxt/DjeKkZG3.js +0 -25
- package/dist/public/_nuxt/builds/meta/80f1a776-82e2-4b5c-9c07-a61063a0dd84.json +0 -1
- package/dist/public/_nuxt/error-404.CFBEg71j.css +0 -1
- package/dist/public/_nuxt/error-500.BqCnH31G.css +0 -1
- package/dist/server/chunks/routes/api/payload.json.mjs +0 -26
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { d as defineRequiredAgentAnalysisHandler
|
|
1
|
+
import { d as defineRequiredAgentAnalysisHandler } from '../../../../_/analysis-handlers.mjs';
|
|
2
|
+
import { g as getPaginationQuery } from '../../../../_/pagination.mjs';
|
|
3
|
+
import { p as paginateItems } from '../../../../nitro/nitro.mjs';
|
|
2
4
|
import 'node:http';
|
|
3
5
|
import 'node:https';
|
|
4
6
|
import 'node:events';
|
|
@@ -6,12 +8,20 @@ import 'node:buffer';
|
|
|
6
8
|
import 'node:fs';
|
|
7
9
|
import 'node:path';
|
|
8
10
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
11
|
import 'glob';
|
|
12
|
+
import 'dayjs';
|
|
13
|
+
import 'dayjs/plugin/utc.js';
|
|
14
|
+
import '@lonewolfyx/utils';
|
|
15
|
+
import 'node:sqlite';
|
|
16
|
+
import 'node:fs/promises';
|
|
17
|
+
import '@clack/prompts';
|
|
12
18
|
import 'chokidar';
|
|
13
19
|
import 'node:os';
|
|
14
20
|
import 'path-type';
|
|
21
|
+
import 'os';
|
|
22
|
+
import 'path';
|
|
23
|
+
import 'fs';
|
|
24
|
+
import 'xdg-basedir';
|
|
15
25
|
import 'node:url';
|
|
16
26
|
import '@iconify/utils';
|
|
17
27
|
import 'consola';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { d as defineRequiredAgentAnalysisHandler,
|
|
1
|
+
import { d as defineRequiredAgentAnalysisHandler, g as getRequiredAnalysisAgentTokenType } from '../../../../_/analysis-handlers.mjs';
|
|
2
|
+
import { g as getPaginationQuery } from '../../../../_/pagination.mjs';
|
|
3
|
+
import { p as paginateItems, A as ANALYSIS_AGENT_TOKEN_ROW_KEYS } from '../../../../nitro/nitro.mjs';
|
|
2
4
|
import 'node:http';
|
|
3
5
|
import 'node:https';
|
|
4
6
|
import 'node:events';
|
|
@@ -6,12 +8,20 @@ import 'node:buffer';
|
|
|
6
8
|
import 'node:fs';
|
|
7
9
|
import 'node:path';
|
|
8
10
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
11
|
import 'glob';
|
|
12
|
+
import 'dayjs';
|
|
13
|
+
import 'dayjs/plugin/utc.js';
|
|
14
|
+
import '@lonewolfyx/utils';
|
|
15
|
+
import 'node:sqlite';
|
|
16
|
+
import 'node:fs/promises';
|
|
17
|
+
import '@clack/prompts';
|
|
12
18
|
import 'chokidar';
|
|
13
19
|
import 'node:os';
|
|
14
20
|
import 'path-type';
|
|
21
|
+
import 'os';
|
|
22
|
+
import 'path';
|
|
23
|
+
import 'fs';
|
|
24
|
+
import 'xdg-basedir';
|
|
15
25
|
import 'node:url';
|
|
16
26
|
import '@iconify/utils';
|
|
17
27
|
import 'consola';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as defineHomeAnalysisHandler } from '../../../_/analysis-handlers.mjs';
|
|
2
|
+
import '../../../nitro/nitro.mjs';
|
|
2
3
|
import 'node:http';
|
|
3
4
|
import 'node:https';
|
|
4
5
|
import 'node:events';
|
|
@@ -6,12 +7,20 @@ import 'node:buffer';
|
|
|
6
7
|
import 'node:fs';
|
|
7
8
|
import 'node:path';
|
|
8
9
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
10
|
import 'glob';
|
|
11
|
+
import 'dayjs';
|
|
12
|
+
import 'dayjs/plugin/utc.js';
|
|
13
|
+
import '@lonewolfyx/utils';
|
|
14
|
+
import 'node:sqlite';
|
|
15
|
+
import 'node:fs/promises';
|
|
16
|
+
import '@clack/prompts';
|
|
12
17
|
import 'chokidar';
|
|
13
18
|
import 'node:os';
|
|
14
19
|
import 'path-type';
|
|
20
|
+
import 'os';
|
|
21
|
+
import 'path';
|
|
22
|
+
import 'fs';
|
|
23
|
+
import 'xdg-basedir';
|
|
15
24
|
import 'node:url';
|
|
16
25
|
import '@iconify/utils';
|
|
17
26
|
import 'consola';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as defineScopedAnalysisHandler } from '../../../_/analysis-handlers.mjs';
|
|
2
|
+
import '../../../nitro/nitro.mjs';
|
|
2
3
|
import 'node:http';
|
|
3
4
|
import 'node:https';
|
|
4
5
|
import 'node:events';
|
|
@@ -6,12 +7,20 @@ import 'node:buffer';
|
|
|
6
7
|
import 'node:fs';
|
|
7
8
|
import 'node:path';
|
|
8
9
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
10
|
import 'glob';
|
|
11
|
+
import 'dayjs';
|
|
12
|
+
import 'dayjs/plugin/utc.js';
|
|
13
|
+
import '@lonewolfyx/utils';
|
|
14
|
+
import 'node:sqlite';
|
|
15
|
+
import 'node:fs/promises';
|
|
16
|
+
import '@clack/prompts';
|
|
12
17
|
import 'chokidar';
|
|
13
18
|
import 'node:os';
|
|
14
19
|
import 'path-type';
|
|
20
|
+
import 'os';
|
|
21
|
+
import 'path';
|
|
22
|
+
import 'fs';
|
|
23
|
+
import 'xdg-basedir';
|
|
15
24
|
import 'node:url';
|
|
16
25
|
import '@iconify/utils';
|
|
17
26
|
import 'consola';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { d as defineEventHandler } from '../../../nitro/nitro.mjs';
|
|
2
|
+
import { c as getAnalysisRuntime } from '../../../_/analysis-handlers.mjs';
|
|
3
|
+
import 'node:http';
|
|
4
|
+
import 'node:https';
|
|
5
|
+
import 'node:events';
|
|
6
|
+
import 'node:buffer';
|
|
7
|
+
import 'node:fs';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import 'node:crypto';
|
|
10
|
+
import 'glob';
|
|
11
|
+
import 'dayjs';
|
|
12
|
+
import 'dayjs/plugin/utc.js';
|
|
13
|
+
import '@lonewolfyx/utils';
|
|
14
|
+
import 'node:sqlite';
|
|
15
|
+
import 'node:fs/promises';
|
|
16
|
+
import '@clack/prompts';
|
|
17
|
+
import 'chokidar';
|
|
18
|
+
import 'node:os';
|
|
19
|
+
import 'path-type';
|
|
20
|
+
import 'os';
|
|
21
|
+
import 'path';
|
|
22
|
+
import 'fs';
|
|
23
|
+
import 'xdg-basedir';
|
|
24
|
+
import 'node:url';
|
|
25
|
+
import '@iconify/utils';
|
|
26
|
+
import 'consola';
|
|
27
|
+
|
|
28
|
+
const liveState_json = defineEventHandler(async (event) => {
|
|
29
|
+
return await (await getAnalysisRuntime()).getLiveState();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { liveState_json as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as defineScopedAnalysisHandler } from '../../../_/analysis-handlers.mjs';
|
|
2
|
+
import '../../../nitro/nitro.mjs';
|
|
2
3
|
import 'node:http';
|
|
3
4
|
import 'node:https';
|
|
4
5
|
import 'node:events';
|
|
@@ -6,12 +7,20 @@ import 'node:buffer';
|
|
|
6
7
|
import 'node:fs';
|
|
7
8
|
import 'node:path';
|
|
8
9
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
10
|
import 'glob';
|
|
11
|
+
import 'dayjs';
|
|
12
|
+
import 'dayjs/plugin/utc.js';
|
|
13
|
+
import '@lonewolfyx/utils';
|
|
14
|
+
import 'node:sqlite';
|
|
15
|
+
import 'node:fs/promises';
|
|
16
|
+
import '@clack/prompts';
|
|
12
17
|
import 'chokidar';
|
|
13
18
|
import 'node:os';
|
|
14
19
|
import 'path-type';
|
|
20
|
+
import 'os';
|
|
21
|
+
import 'path';
|
|
22
|
+
import 'fs';
|
|
23
|
+
import 'xdg-basedir';
|
|
15
24
|
import 'node:url';
|
|
16
25
|
import '@iconify/utils';
|
|
17
26
|
import 'consola';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as defineScopedAnalysisHandler } from '../../../_/analysis-handlers.mjs';
|
|
2
|
+
import { b as buildOverviewCardsWithTodayTokenBreakdown } from '../../../nitro/nitro.mjs';
|
|
2
3
|
import 'node:http';
|
|
3
4
|
import 'node:https';
|
|
4
5
|
import 'node:events';
|
|
@@ -6,12 +7,20 @@ import 'node:buffer';
|
|
|
6
7
|
import 'node:fs';
|
|
7
8
|
import 'node:path';
|
|
8
9
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
10
|
import 'glob';
|
|
11
|
+
import 'dayjs';
|
|
12
|
+
import 'dayjs/plugin/utc.js';
|
|
13
|
+
import '@lonewolfyx/utils';
|
|
14
|
+
import 'node:sqlite';
|
|
15
|
+
import 'node:fs/promises';
|
|
16
|
+
import '@clack/prompts';
|
|
12
17
|
import 'chokidar';
|
|
13
18
|
import 'node:os';
|
|
14
19
|
import 'path-type';
|
|
20
|
+
import 'os';
|
|
21
|
+
import 'path';
|
|
22
|
+
import 'fs';
|
|
23
|
+
import 'xdg-basedir';
|
|
15
24
|
import 'node:url';
|
|
16
25
|
import '@iconify/utils';
|
|
17
26
|
import 'consola';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as defineHomeAnalysisHandler } from '../../../_/analysis-handlers.mjs';
|
|
2
|
+
import '../../../nitro/nitro.mjs';
|
|
2
3
|
import 'node:http';
|
|
3
4
|
import 'node:https';
|
|
4
5
|
import 'node:events';
|
|
@@ -6,12 +7,20 @@ import 'node:buffer';
|
|
|
6
7
|
import 'node:fs';
|
|
7
8
|
import 'node:path';
|
|
8
9
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
10
|
import 'glob';
|
|
11
|
+
import 'dayjs';
|
|
12
|
+
import 'dayjs/plugin/utc.js';
|
|
13
|
+
import '@lonewolfyx/utils';
|
|
14
|
+
import 'node:sqlite';
|
|
15
|
+
import 'node:fs/promises';
|
|
16
|
+
import '@clack/prompts';
|
|
12
17
|
import 'chokidar';
|
|
13
18
|
import 'node:os';
|
|
14
19
|
import 'path-type';
|
|
20
|
+
import 'os';
|
|
21
|
+
import 'path';
|
|
22
|
+
import 'fs';
|
|
23
|
+
import 'xdg-basedir';
|
|
15
24
|
import 'node:url';
|
|
16
25
|
import '@iconify/utils';
|
|
17
26
|
import 'consola';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as defineHomeAnalysisHandler } from '../../../../_/analysis-handlers.mjs';
|
|
2
|
+
import { g as getPaginationQuery } from '../../../../_/pagination.mjs';
|
|
3
|
+
import { p as paginateItems } from '../../../../nitro/nitro.mjs';
|
|
2
4
|
import 'node:http';
|
|
3
5
|
import 'node:https';
|
|
4
6
|
import 'node:events';
|
|
@@ -6,12 +8,20 @@ import 'node:buffer';
|
|
|
6
8
|
import 'node:fs';
|
|
7
9
|
import 'node:path';
|
|
8
10
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
11
|
import 'glob';
|
|
12
|
+
import 'dayjs';
|
|
13
|
+
import 'dayjs/plugin/utc.js';
|
|
14
|
+
import '@lonewolfyx/utils';
|
|
15
|
+
import 'node:sqlite';
|
|
16
|
+
import 'node:fs/promises';
|
|
17
|
+
import '@clack/prompts';
|
|
12
18
|
import 'chokidar';
|
|
13
19
|
import 'node:os';
|
|
14
20
|
import 'path-type';
|
|
21
|
+
import 'os';
|
|
22
|
+
import 'path';
|
|
23
|
+
import 'fs';
|
|
24
|
+
import 'xdg-basedir';
|
|
15
25
|
import 'node:url';
|
|
16
26
|
import '@iconify/utils';
|
|
17
27
|
import 'consola';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as defineHomeAnalysisHandler } from '../../../../_/analysis-handlers.mjs';
|
|
2
|
+
import '../../../../nitro/nitro.mjs';
|
|
2
3
|
import 'node:http';
|
|
3
4
|
import 'node:https';
|
|
4
5
|
import 'node:events';
|
|
@@ -6,12 +7,20 @@ import 'node:buffer';
|
|
|
6
7
|
import 'node:fs';
|
|
7
8
|
import 'node:path';
|
|
8
9
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
10
|
import 'glob';
|
|
11
|
+
import 'dayjs';
|
|
12
|
+
import 'dayjs/plugin/utc.js';
|
|
13
|
+
import '@lonewolfyx/utils';
|
|
14
|
+
import 'node:sqlite';
|
|
15
|
+
import 'node:fs/promises';
|
|
16
|
+
import '@clack/prompts';
|
|
12
17
|
import 'chokidar';
|
|
13
18
|
import 'node:os';
|
|
14
19
|
import 'path-type';
|
|
20
|
+
import 'os';
|
|
21
|
+
import 'path';
|
|
22
|
+
import 'fs';
|
|
23
|
+
import 'xdg-basedir';
|
|
15
24
|
import 'node:url';
|
|
16
25
|
import '@iconify/utils';
|
|
17
26
|
import 'consola';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as defineScopedAnalysisHandler } from '../../../_/analysis-handlers.mjs';
|
|
2
|
+
import '../../../nitro/nitro.mjs';
|
|
2
3
|
import 'node:http';
|
|
3
4
|
import 'node:https';
|
|
4
5
|
import 'node:events';
|
|
@@ -6,12 +7,20 @@ import 'node:buffer';
|
|
|
6
7
|
import 'node:fs';
|
|
7
8
|
import 'node:path';
|
|
8
9
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
10
|
import 'glob';
|
|
11
|
+
import 'dayjs';
|
|
12
|
+
import 'dayjs/plugin/utc.js';
|
|
13
|
+
import '@lonewolfyx/utils';
|
|
14
|
+
import 'node:sqlite';
|
|
15
|
+
import 'node:fs/promises';
|
|
16
|
+
import '@clack/prompts';
|
|
12
17
|
import 'chokidar';
|
|
13
18
|
import 'node:os';
|
|
14
19
|
import 'path-type';
|
|
20
|
+
import 'os';
|
|
21
|
+
import 'path';
|
|
22
|
+
import 'fs';
|
|
23
|
+
import 'xdg-basedir';
|
|
15
24
|
import 'node:url';
|
|
16
25
|
import '@iconify/utils';
|
|
17
26
|
import 'consola';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as defineEventHandler, r as resolveConfig, h as getRouterParam, g as getQuery, n as normalizeStringList, a as getUsageDataRuntime, u as useRuntimeConfig } from '../../../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:events';
|
|
@@ -6,24 +6,32 @@ import 'node:buffer';
|
|
|
6
6
|
import 'node:fs';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
9
|
import 'glob';
|
|
10
|
+
import 'dayjs';
|
|
11
|
+
import 'dayjs/plugin/utc.js';
|
|
12
|
+
import '@lonewolfyx/utils';
|
|
13
|
+
import 'node:sqlite';
|
|
14
|
+
import 'node:fs/promises';
|
|
15
|
+
import '@clack/prompts';
|
|
12
16
|
import 'chokidar';
|
|
13
17
|
import 'node:os';
|
|
14
18
|
import 'path-type';
|
|
19
|
+
import 'os';
|
|
20
|
+
import 'path';
|
|
21
|
+
import 'fs';
|
|
22
|
+
import 'xdg-basedir';
|
|
15
23
|
import 'node:url';
|
|
16
24
|
import '@iconify/utils';
|
|
17
25
|
import 'consola';
|
|
18
26
|
|
|
19
27
|
const modules_get = defineEventHandler(async (event) => {
|
|
20
28
|
const runtimeConfig = useRuntimeConfig();
|
|
21
|
-
const config = resolveConfig(runtimeConfig.public);
|
|
29
|
+
const config = await resolveConfig(runtimeConfig.public);
|
|
22
30
|
const project = decodeURIComponent(getRouterParam(event, "project") || "").trim();
|
|
23
31
|
const query = getQuery(event);
|
|
24
|
-
const module =
|
|
32
|
+
const module = typeof query.module === "string" && query.module.trim() ? query.module.trim() : void 0;
|
|
25
33
|
const modules = normalizeStringList(query.modules);
|
|
26
|
-
const platform =
|
|
34
|
+
const platform = typeof query.platform === "string" && query.platform.trim() ? query.platform.trim() : void 0;
|
|
27
35
|
return getUsageDataRuntime(config).getProjectDataModules({
|
|
28
36
|
module,
|
|
29
37
|
modules,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as defineEventHandler, r as resolveConfig, a as getUsageDataRuntime, u as useRuntimeConfig } from '../../../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:events';
|
|
@@ -6,19 +6,27 @@ import 'node:buffer';
|
|
|
6
6
|
import 'node:fs';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
9
|
import 'glob';
|
|
10
|
+
import 'dayjs';
|
|
11
|
+
import 'dayjs/plugin/utc.js';
|
|
12
|
+
import '@lonewolfyx/utils';
|
|
13
|
+
import 'node:sqlite';
|
|
14
|
+
import 'node:fs/promises';
|
|
15
|
+
import '@clack/prompts';
|
|
12
16
|
import 'chokidar';
|
|
13
17
|
import 'node:os';
|
|
14
18
|
import 'path-type';
|
|
19
|
+
import 'os';
|
|
20
|
+
import 'path';
|
|
21
|
+
import 'fs';
|
|
22
|
+
import 'xdg-basedir';
|
|
15
23
|
import 'node:url';
|
|
16
24
|
import '@iconify/utils';
|
|
17
25
|
import 'consola';
|
|
18
26
|
|
|
19
27
|
const catalog_get = defineEventHandler(async () => {
|
|
20
28
|
const runtimeConfig = useRuntimeConfig();
|
|
21
|
-
const config = resolveConfig(runtimeConfig.public);
|
|
29
|
+
const config = await resolveConfig(runtimeConfig.public);
|
|
22
30
|
return getUsageDataRuntime(config).getProjectCatalog();
|
|
23
31
|
});
|
|
24
32
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRenderer, getRequestDependencies, getPreloadLinks, getPrefetchLinks } from 'vue-bundle-renderer/runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { k as buildAssetsURL, u as useRuntimeConfig, l as getResponseStatusText, m as getResponseStatus, o as defineRenderHandler, q as publicAssetsURL, g as getQuery, c as createError, s as destr, t as getRouteRules, v as joinURL, w as useNitroApp } from '../nitro/nitro.mjs';
|
|
3
3
|
import { createHead as createHead$1, propsToString, renderSSRHead } from 'unhead/server';
|
|
4
4
|
import { stringify, uneval } from 'devalue';
|
|
5
5
|
import { isRef, toValue } from 'vue';
|
|
@@ -10,12 +10,20 @@ import 'node:buffer';
|
|
|
10
10
|
import 'node:fs';
|
|
11
11
|
import 'node:path';
|
|
12
12
|
import 'node:crypto';
|
|
13
|
-
import 'node:sqlite';
|
|
14
|
-
import '@lonewolfyx/utils';
|
|
15
13
|
import 'glob';
|
|
14
|
+
import 'dayjs';
|
|
15
|
+
import 'dayjs/plugin/utc.js';
|
|
16
|
+
import '@lonewolfyx/utils';
|
|
17
|
+
import 'node:sqlite';
|
|
18
|
+
import 'node:fs/promises';
|
|
19
|
+
import '@clack/prompts';
|
|
16
20
|
import 'chokidar';
|
|
17
21
|
import 'node:os';
|
|
18
22
|
import 'path-type';
|
|
23
|
+
import 'os';
|
|
24
|
+
import 'path';
|
|
25
|
+
import 'fs';
|
|
26
|
+
import 'xdg-basedir';
|
|
19
27
|
import 'node:url';
|
|
20
28
|
import '@iconify/utils';
|
|
21
29
|
import 'consola';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as defineWebSocketHandler, u as useRuntimeConfig, r as resolveConfig, a as getUsageDataRuntime, P as PROJECT_USAGE_DATA_MODULES, j as PROJECT_USAGE_PLATFORMS, n as normalizeStringList } from '../nitro/nitro.mjs';
|
|
2
2
|
import 'node:http';
|
|
3
3
|
import 'node:https';
|
|
4
4
|
import 'node:events';
|
|
@@ -6,25 +6,41 @@ import 'node:buffer';
|
|
|
6
6
|
import 'node:fs';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import 'node:crypto';
|
|
9
|
-
import 'node:sqlite';
|
|
10
|
-
import '@lonewolfyx/utils';
|
|
11
9
|
import 'glob';
|
|
10
|
+
import 'dayjs';
|
|
11
|
+
import 'dayjs/plugin/utc.js';
|
|
12
|
+
import '@lonewolfyx/utils';
|
|
13
|
+
import 'node:sqlite';
|
|
14
|
+
import 'node:fs/promises';
|
|
15
|
+
import '@clack/prompts';
|
|
12
16
|
import 'chokidar';
|
|
13
17
|
import 'node:os';
|
|
14
18
|
import 'path-type';
|
|
19
|
+
import 'os';
|
|
20
|
+
import 'path';
|
|
21
|
+
import 'fs';
|
|
22
|
+
import 'xdg-basedir';
|
|
15
23
|
import 'node:url';
|
|
16
24
|
import '@iconify/utils';
|
|
17
25
|
import 'consola';
|
|
18
26
|
|
|
27
|
+
const MAX_PAGE_SIZE = 100;
|
|
28
|
+
const MAX_CONNECTIONS = 50;
|
|
29
|
+
const peerSubscriptions = /* @__PURE__ */ new Map();
|
|
19
30
|
const ws = defineWebSocketHandler({
|
|
20
31
|
open(peer) {
|
|
21
|
-
|
|
32
|
+
if (peerSubscriptions.size >= MAX_CONNECTIONS) {
|
|
33
|
+
peer.send(JSON.stringify({ message: "Too many connections.", type: "error" }));
|
|
34
|
+
peer.close();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
subscribePeerToUsageUpdates(peer);
|
|
22
38
|
},
|
|
23
39
|
async message(peer, message) {
|
|
24
40
|
try {
|
|
25
|
-
const request = parseProjectRequest(message);
|
|
41
|
+
const request = parseProjectRequest(message.json());
|
|
26
42
|
const runtimeConfig = useRuntimeConfig();
|
|
27
|
-
const config = resolveConfig(runtimeConfig.public);
|
|
43
|
+
const config = await resolveConfig(runtimeConfig.public);
|
|
28
44
|
const runtime = getUsageDataRuntime(config);
|
|
29
45
|
if (request.type === "project") {
|
|
30
46
|
sendData(peer, request, await runtime.getProjectCatalog());
|
|
@@ -32,92 +48,46 @@ const ws = defineWebSocketHandler({
|
|
|
32
48
|
sendData(peer, request, await runtime.getProjectDataModules(request));
|
|
33
49
|
}
|
|
34
50
|
} catch (error) {
|
|
35
|
-
|
|
51
|
+
peer.send(JSON.stringify({ message: error instanceof Error ? error.message : "Failed to handle websocket request.", type: "error" }));
|
|
36
52
|
}
|
|
37
53
|
},
|
|
38
|
-
close(peer
|
|
39
|
-
|
|
54
|
+
close(peer) {
|
|
55
|
+
unsubscribePeer(peer.id);
|
|
40
56
|
},
|
|
41
57
|
error(peer, error) {
|
|
42
58
|
console.error(`[ws] error: ${peer.id}`, error);
|
|
43
59
|
}
|
|
44
60
|
});
|
|
45
|
-
function parseProjectRequest(
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} catch {
|
|
50
|
-
return normalizeProjectRequest(parseTextRequest(text));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function sendError(peer, message) {
|
|
54
|
-
peer.send(JSON.stringify({
|
|
55
|
-
message,
|
|
56
|
-
type: "error"
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
function parseTextRequest(text) {
|
|
60
|
-
var _a, _b, _c, _d;
|
|
61
|
-
if (text === "project" || text === "project_data") {
|
|
62
|
-
return { type: text };
|
|
61
|
+
function parseProjectRequest(value) {
|
|
62
|
+
const record = value && typeof value === "object" ? value : null;
|
|
63
|
+
if (!record) {
|
|
64
|
+
throw new Error('Websocket message must be a JSON object with a "type" field.');
|
|
63
65
|
}
|
|
64
|
-
const
|
|
65
|
-
const type = params.get("type");
|
|
66
|
-
if (!type) {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
module: (_a = params.get("module")) != null ? _a : void 0,
|
|
71
|
-
modules: params.getAll("modules").flatMap((item) => {
|
|
72
|
-
var _a2;
|
|
73
|
-
return (_a2 = normalizeStringList(item)) != null ? _a2 : [];
|
|
74
|
-
}),
|
|
75
|
-
page: normalizeNumberValue(params.get("page")),
|
|
76
|
-
pageSize: normalizeNumberValue(params.get("pageSize")),
|
|
77
|
-
platform: (_b = params.get("platform")) != null ? _b : void 0,
|
|
78
|
-
project: (_c = params.get("project")) != null ? _c : void 0,
|
|
79
|
-
requestId: (_d = params.get("requestId")) != null ? _d : void 0,
|
|
80
|
-
type
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
function normalizeProjectRequest(value) {
|
|
84
|
-
var _a;
|
|
85
|
-
if (typeof value === "string") {
|
|
86
|
-
return normalizeProjectRequest(parseTextRequest(value.trim()));
|
|
87
|
-
}
|
|
88
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
89
|
-
throw new Error("Websocket message must include a supported type.");
|
|
90
|
-
}
|
|
91
|
-
const record = value;
|
|
92
|
-
const type = (_a = normalizeStringValue(record.type)) != null ? _a : "";
|
|
66
|
+
const type = typeof record.type === "string" ? record.type.trim() : "";
|
|
93
67
|
if (type === "project") {
|
|
94
68
|
return {
|
|
95
|
-
requestId:
|
|
69
|
+
requestId: typeof record.requestId === "string" ? record.requestId.trim() : "",
|
|
96
70
|
type
|
|
97
71
|
};
|
|
98
72
|
}
|
|
99
73
|
if (type === "project_data") {
|
|
74
|
+
const rawPageSize = typeof record.pageSize === "number" && Number.isFinite(record.pageSize) ? record.pageSize : void 0;
|
|
75
|
+
const pageSize = rawPageSize === void 0 ? void 0 : Math.min(Math.max(rawPageSize, 1), MAX_PAGE_SIZE);
|
|
76
|
+
const module = typeof record.module === "string" && PROJECT_USAGE_DATA_MODULES.includes(record.module) ? record.module : void 0;
|
|
77
|
+
const platform = typeof record.platform === "string" && (record.platform === "all" || PROJECT_USAGE_PLATFORMS.includes(record.platform)) ? record.platform : void 0;
|
|
100
78
|
return {
|
|
101
|
-
module
|
|
79
|
+
module,
|
|
102
80
|
modules: normalizeStringList(record.modules),
|
|
103
|
-
page:
|
|
104
|
-
pageSize
|
|
105
|
-
platform
|
|
106
|
-
project:
|
|
107
|
-
requestId:
|
|
81
|
+
page: typeof record.page === "number" && Number.isFinite(record.page) ? record.page : void 0,
|
|
82
|
+
pageSize,
|
|
83
|
+
platform,
|
|
84
|
+
project: typeof record.project === "string" ? record.project.trim() : "",
|
|
85
|
+
requestId: typeof record.requestId === "string" ? record.requestId.trim() : "",
|
|
108
86
|
type
|
|
109
87
|
};
|
|
110
88
|
}
|
|
111
89
|
throw new Error(`Unsupported websocket request type: ${type || "unknown"}.`);
|
|
112
90
|
}
|
|
113
|
-
function normalizeNumberValue(value) {
|
|
114
|
-
const stringValue = normalizeStringValue(value);
|
|
115
|
-
if (!stringValue) {
|
|
116
|
-
return void 0;
|
|
117
|
-
}
|
|
118
|
-
const numberValue = Number(stringValue);
|
|
119
|
-
return Number.isFinite(numberValue) ? numberValue : void 0;
|
|
120
|
-
}
|
|
121
91
|
function sendData(peer, request, data) {
|
|
122
92
|
if (!request.requestId) {
|
|
123
93
|
peer.send(JSON.stringify(data));
|
|
@@ -128,5 +98,28 @@ function sendData(peer, request, data) {
|
|
|
128
98
|
requestId: request.requestId
|
|
129
99
|
}));
|
|
130
100
|
}
|
|
101
|
+
async function subscribePeerToUsageUpdates(peer) {
|
|
102
|
+
unsubscribePeer(peer.id);
|
|
103
|
+
const runtimeConfig = useRuntimeConfig();
|
|
104
|
+
const config = await resolveConfig(runtimeConfig.public);
|
|
105
|
+
const runtime = getUsageDataRuntime(config);
|
|
106
|
+
const unsubscribe = runtime.subscribeToUpdates((update) => {
|
|
107
|
+
peer.send(JSON.stringify({
|
|
108
|
+
payload: {
|
|
109
|
+
affectedProjects: update.affectedProjects,
|
|
110
|
+
updatedAt: update.updatedAt,
|
|
111
|
+
updatedPlatforms: [...update.updatedPlatforms],
|
|
112
|
+
updatedSessions: update.updatedSessions
|
|
113
|
+
},
|
|
114
|
+
type: "usage_update"
|
|
115
|
+
}));
|
|
116
|
+
});
|
|
117
|
+
peerSubscriptions.set(peer.id, unsubscribe);
|
|
118
|
+
}
|
|
119
|
+
function unsubscribePeer(peerId) {
|
|
120
|
+
var _a;
|
|
121
|
+
(_a = peerSubscriptions.get(peerId)) == null ? void 0 : _a();
|
|
122
|
+
peerSubscriptions.delete(peerId);
|
|
123
|
+
}
|
|
131
124
|
|
|
132
125
|
export { ws as default };
|