@gameap/debug 0.3.0 → 0.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gameap/debug",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "type": "module",
5
5
  "description": "Debug harness for GameAP plugin development with mock API",
6
6
  "scripts": {
@@ -7,7 +7,7 @@
7
7
  * - Please do NOT modify this file.
8
8
  */
9
9
 
10
- const PACKAGE_VERSION = '2.12.4'
10
+ const PACKAGE_VERSION = '2.12.7'
11
11
  const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
12
12
  const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
13
13
  const activeClientIds = new Set()
package/src/main.ts CHANGED
@@ -8,6 +8,20 @@
8
8
  // Import frontend styles (bundled in vendor directory)
9
9
  import '../vendor/frontend.css'
10
10
 
11
+ // Import and expose framework globals for the externalized @gameap/frontend package
12
+ import * as Vue from 'vue'
13
+ import * as VueRouter from 'vue-router'
14
+ import * as Pinia from 'pinia'
15
+ import axios from 'axios'
16
+ import * as naive from 'naive-ui'
17
+
18
+ // Expose globals before loading the frontend
19
+ window.Vue = Vue
20
+ window.VueRouter = VueRouter
21
+ window.Pinia = Pinia
22
+ window.axios = axios
23
+ window.naive = naive
24
+
11
25
  import {
12
26
  startMockServiceWorker,
13
27
  setPluginContent,
@@ -30,6 +44,7 @@ declare global {
30
44
  VueRouter: typeof import('vue-router')
31
45
  Pinia: typeof import('pinia')
32
46
  axios: typeof import('axios').default
47
+ naive: typeof import('naive-ui')
33
48
  gameapLang: string
34
49
  i18n: Record<string, string>
35
50
  gameapDebug: {
@@ -54,6 +54,7 @@ Each server has different capabilities (RCON, console access, file manager, etc.
54
54
  - GDaemon Tasks
55
55
  - File Manager (browse, upload, download, zip/unzip)
56
56
  - Plugins (JS/CSS loading)
57
+ - Plugin Store (categories, labels, plugins, install/update/uninstall)
57
58
  - Translations
58
59
 
59
60
  ## Usage
@@ -919,6 +919,86 @@ export const handlers = [
919
919
  })
920
920
  }),
921
921
 
922
+ // ==================== Plugin Store ====================
923
+ http.get('/api/plugin-store/categories', async () => {
924
+ await delay(debugState.networkDelay)
925
+ return HttpResponse.json([
926
+ { id: 1, slug: 'game-management', name: 'Game Management' },
927
+ { id: 2, slug: 'monitoring', name: 'Monitoring' },
928
+ { id: 3, slug: 'utilities', name: 'Utilities' },
929
+ ])
930
+ }),
931
+
932
+ http.get('/api/plugin-store/labels', async () => {
933
+ await delay(debugState.networkDelay)
934
+ return HttpResponse.json([
935
+ { id: 1, slug: 'official', name: 'Official', color: '#4f46e5' },
936
+ { id: 2, slug: 'popular', name: 'Popular', color: '#059669' },
937
+ ])
938
+ }),
939
+
940
+ http.get('/api/plugin-store/plugins', async () => {
941
+ await delay(debugState.networkDelay)
942
+ return HttpResponse.json({
943
+ data: [
944
+ {
945
+ id: 1,
946
+ slug: 'example-plugin',
947
+ name: 'Example Plugin',
948
+ description: 'An example plugin for testing',
949
+ installed: false,
950
+ installed_version: null,
951
+ latest_version: '1.0.0',
952
+ category: { slug: 'utilities', name: 'Utilities' },
953
+ labels: [{ slug: 'official', name: 'Official', color: '#4f46e5' }],
954
+ },
955
+ ],
956
+ current_page: 1,
957
+ last_page: 1,
958
+ total: 1,
959
+ })
960
+ }),
961
+
962
+ http.get('/api/plugin-store/plugins/:id', async ({ params }) => {
963
+ await delay(debugState.networkDelay)
964
+ return HttpResponse.json({
965
+ id: Number(params.id),
966
+ slug: 'example-plugin',
967
+ name: 'Example Plugin',
968
+ description: 'An example plugin for testing',
969
+ readme: '# Example Plugin\n\nThis is an example plugin.',
970
+ installed: false,
971
+ installed_version: null,
972
+ latest_version: '1.0.0',
973
+ })
974
+ }),
975
+
976
+ http.get('/api/plugin-store/plugins/:id/versions', async () => {
977
+ await delay(debugState.networkDelay)
978
+ return HttpResponse.json({
979
+ data: [
980
+ { version: '1.0.0', released_at: '2024-01-01', changelog: 'Initial release' },
981
+ ],
982
+ current_page: 1,
983
+ last_page: 1,
984
+ })
985
+ }),
986
+
987
+ http.post('/api/plugin-store/plugins/:id/install', async () => {
988
+ await delay(debugState.networkDelay)
989
+ return HttpResponse.json({ success: true })
990
+ }),
991
+
992
+ http.post('/api/plugin-store/plugins/:id/update', async () => {
993
+ await delay(debugState.networkDelay)
994
+ return HttpResponse.json({ success: true })
995
+ }),
996
+
997
+ http.delete('/api/plugin-store/plugins/:id', async () => {
998
+ await delay(debugState.networkDelay)
999
+ return HttpResponse.json({ success: true })
1000
+ }),
1001
+
922
1002
  // ==================== Language ====================
923
1003
  // Language/translations endpoint - uses actual translation files
924
1004
  http.get('/lang/:locale.json', async ({ params }) => {