@gameap/debug 0.3.0 → 0.3.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/package.json +2 -2
- package/public/mockServiceWorker.js +1 -1
- package/src/main.ts +15 -0
- package/src/mocks/README.md +1 -0
- package/src/mocks/handlers.ts +80 -0
- package/src/mocks/translations-en.json +42 -1
- package/src/mocks/translations-ru.json +42 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gameap/debug",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Debug harness for GameAP plugin development with mock API",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"build": "vue-tsc && vite build",
|
|
9
9
|
"preview": "vite preview",
|
|
10
10
|
"msw:init": "npx msw init ../../public --save",
|
|
11
|
-
"sync:translations": "cp
|
|
11
|
+
"sync:translations": "cp ../../../../internal/i18n/en.json src/mocks/translations-en.json && cp ../../../../internal/i18n/ru.json src/mocks/translations-ru.json"
|
|
12
12
|
},
|
|
13
13
|
"bin": {
|
|
14
14
|
"gameap-debug": "./bin/cli.js"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - Please do NOT modify this file.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
const PACKAGE_VERSION = '2.12.
|
|
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: {
|
package/src/mocks/README.md
CHANGED
|
@@ -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
|
package/src/mocks/handlers.ts
CHANGED
|
@@ -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 }) => {
|
|
@@ -365,11 +365,52 @@
|
|
|
365
365
|
"plugins": "Plugins",
|
|
366
366
|
"title_list": "Plugin List",
|
|
367
367
|
"installed": "Installed",
|
|
368
|
+
"store": "Store",
|
|
369
|
+
"updates_available": "Updates Available",
|
|
370
|
+
"already_installed": "Installed",
|
|
368
371
|
"name": "Plugin name",
|
|
372
|
+
"version": "Version",
|
|
373
|
+
"installed_version": "Installed Version",
|
|
374
|
+
"latest_version": "Latest Version",
|
|
375
|
+
"author": "Author",
|
|
376
|
+
"category": "Category",
|
|
377
|
+
"description": "Description",
|
|
378
|
+
"summary": "Summary",
|
|
379
|
+
"license": "License",
|
|
380
|
+
"repository": "Repository",
|
|
381
|
+
"plugin_page": "Plugin Page",
|
|
382
|
+
"min_gameap_version": "Min GameAP Version",
|
|
383
|
+
"min_plugin_api": "Min Plugin API",
|
|
384
|
+
"downloads": "Downloads",
|
|
385
|
+
"rating": "Rating",
|
|
386
|
+
"reviews": "reviews",
|
|
387
|
+
"changelog": "Changelog",
|
|
388
|
+
"published_at": "Published",
|
|
389
|
+
"status": "Status",
|
|
390
|
+
"status_active": "Active",
|
|
391
|
+
"status_disabled": "Disabled",
|
|
392
|
+
"status_error": "Error",
|
|
393
|
+
"status_updating": "Updating",
|
|
369
394
|
"install": "Install",
|
|
370
395
|
"update": "Update",
|
|
396
|
+
"uninstall": "Uninstall",
|
|
397
|
+
"view": "View",
|
|
398
|
+
"select_version": "Select Version",
|
|
399
|
+
"no_plugins": "No plugins found",
|
|
400
|
+
"filter_by_category": "Filter by category",
|
|
401
|
+
"filter_by_label": "Filter by label",
|
|
402
|
+
"search_plugins": "Search plugins...",
|
|
403
|
+
"install_confirm_msg": "Are you sure you want to install this plugin?",
|
|
404
|
+
"update_confirm_msg": "Are you sure you want to update this plugin?",
|
|
405
|
+
"uninstall_confirm_msg": "Are you sure you want to uninstall this plugin?",
|
|
371
406
|
"install_success_msg": "Plugin installed successfully",
|
|
372
|
-
"
|
|
407
|
+
"update_success_msg": "Plugin updated successfully",
|
|
408
|
+
"uninstall_success_msg": "Plugin uninstalled successfully",
|
|
409
|
+
"purchase": "Purchase",
|
|
410
|
+
"subscription_required": "Subscription Required",
|
|
411
|
+
"subscription_info": "This plugin requires an active subscription to install.",
|
|
412
|
+
"subscription_expires": "Subscription expires",
|
|
413
|
+
"get_subscription": "Get Subscription"
|
|
373
414
|
},
|
|
374
415
|
"navbar": {
|
|
375
416
|
"main": "Home",
|
|
@@ -366,11 +366,52 @@
|
|
|
366
366
|
"plugins": "Плагины",
|
|
367
367
|
"title_list": "Список плагинов",
|
|
368
368
|
"installed": "Установленные",
|
|
369
|
+
"store": "Магазин",
|
|
370
|
+
"updates_available": "Доступны обновления",
|
|
371
|
+
"already_installed": "Установлен",
|
|
369
372
|
"name": "Имя плагина",
|
|
373
|
+
"version": "Версия",
|
|
374
|
+
"installed_version": "Установленная версия",
|
|
375
|
+
"latest_version": "Последняя версия",
|
|
376
|
+
"author": "Автор",
|
|
377
|
+
"category": "Категория",
|
|
378
|
+
"description": "Описание",
|
|
379
|
+
"summary": "Краткое описание",
|
|
380
|
+
"license": "Лицензия",
|
|
381
|
+
"repository": "Репозиторий",
|
|
382
|
+
"plugin_page": "Страница плагина",
|
|
383
|
+
"min_gameap_version": "Мин. версия GameAP",
|
|
384
|
+
"min_plugin_api": "Мин. версия API плагинов",
|
|
385
|
+
"downloads": "Загрузки",
|
|
386
|
+
"rating": "Рейтинг",
|
|
387
|
+
"reviews": "отзывов",
|
|
388
|
+
"changelog": "Список изменений",
|
|
389
|
+
"published_at": "Опубликован",
|
|
390
|
+
"status": "Статус",
|
|
391
|
+
"status_active": "Активен",
|
|
392
|
+
"status_disabled": "Отключён",
|
|
393
|
+
"status_error": "Ошибка",
|
|
394
|
+
"status_updating": "Обновляется",
|
|
370
395
|
"install": "Установить",
|
|
371
396
|
"update": "Обновить",
|
|
397
|
+
"uninstall": "Удалить",
|
|
398
|
+
"view": "Просмотр",
|
|
399
|
+
"select_version": "Выберите версию",
|
|
400
|
+
"no_plugins": "Плагины не найдены",
|
|
401
|
+
"filter_by_category": "Фильтр по категории",
|
|
402
|
+
"filter_by_label": "Фильтр по метке",
|
|
403
|
+
"search_plugins": "Поиск плагинов...",
|
|
404
|
+
"install_confirm_msg": "Вы уверены, что хотите установить этот плагин?",
|
|
405
|
+
"update_confirm_msg": "Вы уверены, что хотите обновить этот плагин?",
|
|
406
|
+
"uninstall_confirm_msg": "Вы уверены, что хотите удалить этот плагин?",
|
|
372
407
|
"install_success_msg": "Плагин успешно установлен",
|
|
373
|
-
"
|
|
408
|
+
"update_success_msg": "Плагин успешно обновлён",
|
|
409
|
+
"uninstall_success_msg": "Плагин успешно удалён",
|
|
410
|
+
"purchase": "Приобрести",
|
|
411
|
+
"subscription_required": "Требуется подписка",
|
|
412
|
+
"subscription_info": "Для установки этого плагина требуется активная подписка.",
|
|
413
|
+
"subscription_expires": "Подписка истекает",
|
|
414
|
+
"get_subscription": "Оформить подписку"
|
|
374
415
|
},
|
|
375
416
|
"navbar": {
|
|
376
417
|
"main": "Главная",
|