@fewangsit/wangsvue-gsts 2.0.0-alpha.13 → 2.0.0-alpha.14
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/assets/scanner.worker-Bk2e5hSA.js.map +1 -1
- package/icon/index.d.ts +2 -1
- package/mcp/components.json +44 -35
- package/mcp/components.summary.txt +7 -4
- package/mcp/main.js +60 -60
- package/mcp/package.json +5 -5
- package/mcp/skills/api-service-generator/SKILL.md +93 -93
- package/mcp/skills/committing-changes/SKILL.md +38 -38
- package/mcp/skills/figma-datatable-generator/SKILL.md +93 -93
- package/mcp/skills/figma-to-code/SKILL.md +117 -117
- package/mcp/skills/import-validator/SKILL.md +54 -54
- package/mcp/skills/wangsvue-code-review/SKILL.md +70 -70
- package/mcp/skills/wangsvue-workflow/SKILL.md +91 -91
- package/package.json +1 -1
- package/stats.html +1 -1
- package/style.css +1 -1
- package/wangsvue-gsts.es.js +2 -2
- package/wangsvue-gsts.es.js.map +1 -1
- package/wangsvue-gsts.system.js +2 -2
- package/wangsvue-gsts.system.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.worker-Bk2e5hSA.js","sources":["../../../library/components/buttonscan/workers/scanner.worker.ts"],"sourcesContent":["interface ConnectionOption {\n onopen: (ws: WebSocket, connectionState: ConnectionState) => void;\n onmessage: (event: MessageEvent) => void;\n onerror: (error: Event) => void;\n timeout?: number;\n}\n\ninterface WorkerMessage {\n command: string;\n sessionId: string;\n scanCommand?: string;\n userId?: string;\n companyCode?: string;\n serialNumber?: string;\n jenisDevice?: string;\n}\n\ntype ConnectionState = 'established' | 'reused';\n\nlet socket: WebSocket | null = null;\nlet timeoutId: NodeJS.Timeout | null = null; // Stores timeout ID for idle socket connection\nlet currentUserId: string | undefined;\nlet currentCompanyCode: string | undefined;\nlet sessionId: string = ''; // The unique session ID for the current connection\n\nself.onmessage = (event): void => {\n const message: WorkerMessage = event.data;\n currentCompanyCode = message.companyCode;\n\n switch (message.command) {\n case 'sync':\n sync(message);\n break;\n case 'connect':\n connect(message);\n break;\n case 'scan':\n scan(message);\n break;\n case 'stopscan':\n stopScan(message);\n break;\n default:\n break;\n }\n};\n\n/**\n * Opens a WebSocket connection if not already open.\n * If the connection is open, the `onopen` callback is immediately called.\n * @returns {WebSocket} The WebSocket instance.\n */\nconst openConnection = (opt: ConnectionOption): void => {\n let connectionState: ConnectionState = 'established';\n if (socket && socket.readyState === WebSocket.OPEN) {\n // If the socket is already open, immediately call the onopen callback\n connectionState = 'reused';\n opt.onopen(socket, connectionState);\n resetTimeOut(opt.timeout);\n } else {\n // If the socket is not open or undefined, create a new connection\n socket = new WebSocket(`${import.meta.env.VITE_APP_READER_API}`);\n }\n\n // Handle successful connection\n socket.onopen = (): void => {\n sessionId =\n Math.random().toString(36).substring(2, 15) +\n Math.random().toString(36).substring(2, 15); // Generate a random session ID\n\n connectionState = 'established';\n\n if (socket) opt.onopen(socket, connectionState); // Execute the onopen callback once the connection is established\n resetTimeOut(opt.timeout);\n };\n\n socket.onmessage = (event): void => {\n opt.onmessage(event);\n resetTimeOut(opt.timeout);\n };\n\n socket.onerror = (error): void => {\n console.error('🚀 ~ Scanner Worker: openConnection ~ error:', error);\n opt.onerror(error);\n socket?.close();\n socket = null;\n if (timeoutId) clearTimeout(timeoutId);\n };\n};\n\nconst handleSocketTimeout = (): void => {\n stopScan({ userId: currentUserId });\n currentUserId = undefined;\n if (socket) socket.close();\n socket = null;\n if (timeoutId) clearTimeout(timeoutId);\n console.info('Socket connection has been closed!');\n};\n\nconst resetTimeOut = (timeout = 0): void => {\n if (timeout) {\n // Adding this conditional to disable timout, may be sometimes it need to be enable, simpli remove the condition\n if (timeoutId) clearTimeout(timeoutId);\n timeoutId = setTimeout(handleSocketTimeout, timeout); // Timed out after 3 Minutes\n }\n};\n\nconst sync = ({ userId }: WorkerMessage): void => {\n currentUserId = userId;\n\n openConnection({\n onopen: (ws: WebSocket): void => {\n ws.send(\n JSON.stringify({\n data: {\n command: 'connect',\n userId,\n sessionId,\n companyCode: currentCompanyCode,\n source: 'app',\n },\n event: 'reader',\n }),\n );\n },\n\n onmessage: (event): void => {\n postMessage({ status: 'synced', ...JSON.parse(event.data) });\n },\n\n onerror: (error): void => {\n postMessage({ status: 'sync_error', error });\n },\n });\n};\n\nconst connect = ({ userId }: WorkerMessage): void => {\n currentUserId = userId;\n\n openConnection({\n onopen: (ws: WebSocket, state): void => {\n if (state === 'established') {\n ws.send(\n JSON.stringify({\n data: {\n command: 'connect',\n userId,\n source: 'app',\n sessionId,\n companyCode: currentCompanyCode,\n },\n event: 'reader',\n }),\n );\n } else {\n postMessage({\n status: 'connection_reused',\n });\n }\n },\n\n onmessage: (event): void => {\n postMessage({\n status: 'connection_established',\n ...JSON.parse(event.data),\n });\n },\n\n onerror: (error): void => {\n postMessage({ status: 'error_connecting', error });\n },\n });\n};\n\nconst scan = ({\n scanCommand,\n userId,\n serialNumber,\n jenisDevice,\n}: WorkerMessage): void => {\n currentUserId = userId;\n\n openConnection({\n onopen: (ws: WebSocket): void => {\n ws.send(\n JSON.stringify({\n data: {\n command: scanCommand,\n userId,\n sessionId,\n companyCode: currentCompanyCode,\n source: 'app',\n serialNumber,\n jenisDevice,\n },\n event: 'reader',\n }),\n );\n\n postMessage({ status: 'scan_started' });\n },\n\n onmessage: (event): void => {\n postMessage({ status: 'scanned', ...JSON.parse(event.data) });\n },\n\n onerror: (error): void => {\n postMessage({ status: 'scan_error', error });\n },\n });\n};\n\n/**\n * Single Scan:\n * - Stop Scan will be invoked on socket timeout\n *\n * Bulk Scan:\n * - Stop Scan will also be invoked on stopScan by user interaction\n */\nconst stopScan = ({ userId }: Partial<WorkerMessage>): void => {\n if (socket && socket.readyState === WebSocket.OPEN) {\n socket.send(\n JSON.stringify({\n data: {\n command: 'stopscan',\n userId,\n source: 'app',\n sessionId,\n companyCode: currentCompanyCode,\n },\n event: 'reader',\n }),\n );\n\n postMessage({ status: 'scan_stopped' });\n console.info('Scan Process Stopped!');\n }\n};\n"],"names":["socket","timeoutId","currentUserId","currentCompanyCode","sessionId","event","message","sync","connect","scan","stopScan","openConnection","opt","connectionState","resetTimeOut","error","handleSocketTimeout","timeout","userId","ws","state","scanCommand","serialNumber","jenisDevice"],"mappings":"yBAmBA,IAAIA,EAA2B,KAC3BC,EAAmC,KACnCC,EACAC,EACAC,EAAoB,GAExB,KAAK,UAAaC,GAAgB,CAChC,MAAMC,EAAyBD,EAAM,KAGrC,OAFAF,EAAqBG,EAAQ,YAErBA,EAAQ,QAAA,CACd,IAAK,OACHC,EAAKD,CAAO,EACZ,MACF,IAAK,UACHE,EAAQF,CAAO,EACf,MACF,IAAK,OACHG,EAAKH,CAAO,EACZ,MACF,IAAK,WACHI,EAASJ,CAAO,EAChB,KAEA,CAEN,EAOA,MAAMK,EAAkBC,GAAgC,CACtD,IAAIC,EAAmC,cACnCb,GAAUA,EAAO,aAAe,UAAU,MAE5Ca,EAAkB,SAClBD,EAAI,OAAOZ,EAAQa,CAAe,EAClCC,EAAaF,EAAI,OAAO,GAGxBZ,EAAS,IAAI,UAAU,qCAAwC,EAIjEA,EAAO,OAAS,IAAY,CAC1BI,EACE,KAAK,OAAA,EAAS,SAAS,EAAE,EAAE,UAAU,EAAG,EAAE,EAC1C,KAAK,SAAS,SAAS,EAAE,EAAE,UAAU,EAAG,EAAE,EAE5CS,EAAkB,cAEdb,GAAQY,EAAI,OAAOZ,EAAQa,CAAe,EAC9CC,EAAaF,EAAI,OAAO,CAC1B,EAEAZ,EAAO,UAAaK,GAAgB,CAClCO,EAAI,UAAUP,CAAK,EACnBS,EAAaF,EAAI,OAAO,CAC1B,EAEAZ,EAAO,QAAWe,GAAgB,CAChC,QAAQ,MAAM,+CAAgDA,CAAK,EACnEH,EAAI,QAAQG,CAAK,EACjBf,GAAQ,MAAA,EACRA,EAAS,KACLC,gBAAwBA,CAAS,CACvC,CACF,EAEMe,EAAsB,IAAY,CACtCN,EAAS,CAAE,OAAQ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EhBP,EAAe,CACb,OAASQ,GAAwB,CAC/BA,EAAG,KACD,KAAK,UAAU,CACb,KAAM,CACJ,QAASE,EACT,OAAAH,EACA,UAAAd,EACA,YAAaD,EACb,OAAQ,MACR,aAAAmB,EACA,YAAAC,CAAA,EAEF,MAAO,QAAA,CACR,CAAA,EAGH,YAAY,CAAE,OAAQ,eAAgB,CACxC,EAEA,UAAYlB,GAAgB,CAC1B,YAAY,CAAE,OAAQ,UAAW,GAAG,KAAK,MAAMA,EAAM,IAAI,EAAG,CAC9D,EAEA,QAAUU,GAAgB,CACxB,YAAY,CAAE,OAAQ,aAAc,MAAAA,CAAA,CAAO,CAC7C,CAAA,CACD,CACH,EASML,EAAW,CAAC,CAAE,OAAAQ,KAA2C,CACzDlB,GAAUA,EAAO,aAAe,UAAU,OAC5CA,EAAO,KACL,KAAK,UAAU,CACb,KAAM,CACJ,QAAS,WACT,OAAAkB,EACA,OAAQ,MACR,UAAAd,EACA,YAAaD,CAAA,EAEf,MAAO,QAAA,CACR,CAAA,EAGH,YAAY,CAAE,OAAQ,eAAgB,EACtC,QAAQ,KAAK,uBAAuB,EAExC"}
|
|
1
|
+
{"version":3,"file":"scanner.worker-Bk2e5hSA.js","sources":["../../../library/components/buttonscan/workers/scanner.worker.ts"],"sourcesContent":["interface ConnectionOption {\r\n onopen: (ws: WebSocket, connectionState: ConnectionState) => void;\r\n onmessage: (event: MessageEvent) => void;\r\n onerror: (error: Event) => void;\r\n timeout?: number;\r\n}\r\n\r\ninterface WorkerMessage {\r\n command: string;\r\n sessionId: string;\r\n scanCommand?: string;\r\n userId?: string;\r\n companyCode?: string;\r\n serialNumber?: string;\r\n jenisDevice?: string;\r\n}\r\n\r\ntype ConnectionState = 'established' | 'reused';\r\n\r\nlet socket: WebSocket | null = null;\r\nlet timeoutId: NodeJS.Timeout | null = null; // Stores timeout ID for idle socket connection\r\nlet currentUserId: string | undefined;\r\nlet currentCompanyCode: string | undefined;\r\nlet sessionId: string = ''; // The unique session ID for the current connection\r\n\r\nself.onmessage = (event): void => {\r\n const message: WorkerMessage = event.data;\r\n currentCompanyCode = message.companyCode;\r\n\r\n switch (message.command) {\r\n case 'sync':\r\n sync(message);\r\n break;\r\n case 'connect':\r\n connect(message);\r\n break;\r\n case 'scan':\r\n scan(message);\r\n break;\r\n case 'stopscan':\r\n stopScan(message);\r\n break;\r\n default:\r\n break;\r\n }\r\n};\r\n\r\n/**\r\n * Opens a WebSocket connection if not already open.\r\n * If the connection is open, the `onopen` callback is immediately called.\r\n * @returns {WebSocket} The WebSocket instance.\r\n */\r\nconst openConnection = (opt: ConnectionOption): void => {\r\n let connectionState: ConnectionState = 'established';\r\n if (socket && socket.readyState === WebSocket.OPEN) {\r\n // If the socket is already open, immediately call the onopen callback\r\n connectionState = 'reused';\r\n opt.onopen(socket, connectionState);\r\n resetTimeOut(opt.timeout);\r\n } else {\r\n // If the socket is not open or undefined, create a new connection\r\n socket = new WebSocket(`${import.meta.env.VITE_APP_READER_API}`);\r\n }\r\n\r\n // Handle successful connection\r\n socket.onopen = (): void => {\r\n sessionId =\r\n Math.random().toString(36).substring(2, 15) +\r\n Math.random().toString(36).substring(2, 15); // Generate a random session ID\r\n\r\n connectionState = 'established';\r\n\r\n if (socket) opt.onopen(socket, connectionState); // Execute the onopen callback once the connection is established\r\n resetTimeOut(opt.timeout);\r\n };\r\n\r\n socket.onmessage = (event): void => {\r\n opt.onmessage(event);\r\n resetTimeOut(opt.timeout);\r\n };\r\n\r\n socket.onerror = (error): void => {\r\n console.error('🚀 ~ Scanner Worker: openConnection ~ error:', error);\r\n opt.onerror(error);\r\n socket?.close();\r\n socket = null;\r\n if (timeoutId) clearTimeout(timeoutId);\r\n };\r\n};\r\n\r\nconst handleSocketTimeout = (): void => {\r\n stopScan({ userId: currentUserId });\r\n currentUserId = undefined;\r\n if (socket) socket.close();\r\n socket = null;\r\n if (timeoutId) clearTimeout(timeoutId);\r\n console.info('Socket connection has been closed!');\r\n};\r\n\r\nconst resetTimeOut = (timeout = 0): void => {\r\n if (timeout) {\r\n // Adding this conditional to disable timout, may be sometimes it need to be enable, simpli remove the condition\r\n if (timeoutId) clearTimeout(timeoutId);\r\n timeoutId = setTimeout(handleSocketTimeout, timeout); // Timed out after 3 Minutes\r\n }\r\n};\r\n\r\nconst sync = ({ userId }: WorkerMessage): void => {\r\n currentUserId = userId;\r\n\r\n openConnection({\r\n onopen: (ws: WebSocket): void => {\r\n ws.send(\r\n JSON.stringify({\r\n data: {\r\n command: 'connect',\r\n userId,\r\n sessionId,\r\n companyCode: currentCompanyCode,\r\n source: 'app',\r\n },\r\n event: 'reader',\r\n }),\r\n );\r\n },\r\n\r\n onmessage: (event): void => {\r\n postMessage({ status: 'synced', ...JSON.parse(event.data) });\r\n },\r\n\r\n onerror: (error): void => {\r\n postMessage({ status: 'sync_error', error });\r\n },\r\n });\r\n};\r\n\r\nconst connect = ({ userId }: WorkerMessage): void => {\r\n currentUserId = userId;\r\n\r\n openConnection({\r\n onopen: (ws: WebSocket, state): void => {\r\n if (state === 'established') {\r\n ws.send(\r\n JSON.stringify({\r\n data: {\r\n command: 'connect',\r\n userId,\r\n source: 'app',\r\n sessionId,\r\n companyCode: currentCompanyCode,\r\n },\r\n event: 'reader',\r\n }),\r\n );\r\n } else {\r\n postMessage({\r\n status: 'connection_reused',\r\n });\r\n }\r\n },\r\n\r\n onmessage: (event): void => {\r\n postMessage({\r\n status: 'connection_established',\r\n ...JSON.parse(event.data),\r\n });\r\n },\r\n\r\n onerror: (error): void => {\r\n postMessage({ status: 'error_connecting', error });\r\n },\r\n });\r\n};\r\n\r\nconst scan = ({\r\n scanCommand,\r\n userId,\r\n serialNumber,\r\n jenisDevice,\r\n}: WorkerMessage): void => {\r\n currentUserId = userId;\r\n\r\n openConnection({\r\n onopen: (ws: WebSocket): void => {\r\n ws.send(\r\n JSON.stringify({\r\n data: {\r\n command: scanCommand,\r\n userId,\r\n sessionId,\r\n companyCode: currentCompanyCode,\r\n source: 'app',\r\n serialNumber,\r\n jenisDevice,\r\n },\r\n event: 'reader',\r\n }),\r\n );\r\n\r\n postMessage({ status: 'scan_started' });\r\n },\r\n\r\n onmessage: (event): void => {\r\n postMessage({ status: 'scanned', ...JSON.parse(event.data) });\r\n },\r\n\r\n onerror: (error): void => {\r\n postMessage({ status: 'scan_error', error });\r\n },\r\n });\r\n};\r\n\r\n/**\r\n * Single Scan:\r\n * - Stop Scan will be invoked on socket timeout\r\n *\r\n * Bulk Scan:\r\n * - Stop Scan will also be invoked on stopScan by user interaction\r\n */\r\nconst stopScan = ({ userId }: Partial<WorkerMessage>): void => {\r\n if (socket && socket.readyState === WebSocket.OPEN) {\r\n socket.send(\r\n JSON.stringify({\r\n data: {\r\n command: 'stopscan',\r\n userId,\r\n source: 'app',\r\n sessionId,\r\n companyCode: currentCompanyCode,\r\n },\r\n event: 'reader',\r\n }),\r\n );\r\n\r\n postMessage({ status: 'scan_stopped' });\r\n console.info('Scan Process Stopped!');\r\n }\r\n};\r\n"],"names":["socket","timeoutId","currentUserId","currentCompanyCode","sessionId","event","message","sync","connect","scan","stopScan","openConnection","opt","connectionState","resetTimeOut","error","handleSocketTimeout","timeout","userId","ws","state","scanCommand","serialNumber","jenisDevice"],"mappings":"yBAmBA,IAAIA,EAA2B,KAC3BC,EAAmC,KACnCC,EACAC,EACAC,EAAoB,GAExB,KAAK,UAAaC,GAAgB,CAChC,MAAMC,EAAyBD,EAAM,KAGrC,OAFAF,EAAqBG,EAAQ,YAErBA,EAAQ,QAAA,CACd,IAAK,OACHC,EAAKD,CAAO,EACZ,MACF,IAAK,UACHE,EAAQF,CAAO,EACf,MACF,IAAK,OACHG,EAAKH,CAAO,EACZ,MACF,IAAK,WACHI,EAASJ,CAAO,EAChB,KAEA,CAEN,EAOA,MAAMK,EAAkBC,GAAgC,CACtD,IAAIC,EAAmC,cACnCb,GAAUA,EAAO,aAAe,UAAU,MAE5Ca,EAAkB,SAClBD,EAAI,OAAOZ,EAAQa,CAAe,EAClCC,EAAaF,EAAI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,eAAgB,EACtC,QAAQ,KAAK,uBAAuB,EAExC"}
|
package/icon/index.d.ts
CHANGED
package/mcp/components.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"metadata": {
|
|
3
|
-
"generatedAt": "2026-04-25T07:
|
|
3
|
+
"generatedAt": "2026-04-25T07:37:48.093Z",
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"totalComponents": 68,
|
|
6
6
|
"packagePath": "../../packages/globalsettings-tagsamurai"
|
|
@@ -1915,39 +1915,31 @@
|
|
|
1915
1915
|
"responsive": false
|
|
1916
1916
|
},
|
|
1917
1917
|
{
|
|
1918
|
-
"id": "inputotp",
|
|
1919
|
-
"name": "
|
|
1920
|
-
"description": "
|
|
1921
|
-
"category": "
|
|
1918
|
+
"id": "inputotp-fallback",
|
|
1919
|
+
"name": "inputotp",
|
|
1920
|
+
"description": "inputotp component (fallback metadata due to parsing error)",
|
|
1921
|
+
"category": "utility",
|
|
1922
1922
|
"tags": [
|
|
1923
|
-
"
|
|
1924
|
-
"
|
|
1923
|
+
"fallback",
|
|
1924
|
+
"parsing-error"
|
|
1925
1925
|
],
|
|
1926
1926
|
"source": "unknown",
|
|
1927
1927
|
"overridesBase": false,
|
|
1928
1928
|
"overrideType": "none",
|
|
1929
|
-
"overrideSummary": "
|
|
1930
|
-
"inheritanceChain": [
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
"definitionPath": "library/components/inputotp/Inputotp.vue.d.ts",
|
|
1935
|
-
"childComponents": [],
|
|
1936
|
-
"overrideLevel": 0
|
|
1937
|
-
}
|
|
1938
|
-
],
|
|
1939
|
-
"inheritanceReport": "Base: Inputotp (library/components/inputotp/Inputotp.vue.d.ts)",
|
|
1940
|
-
"vueFilePath": "library/components/inputotp/Inputotp.vue",
|
|
1941
|
-
"definitionFilePath": "inputotp/index.d.ts",
|
|
1929
|
+
"overrideSummary": "",
|
|
1930
|
+
"inheritanceChain": [],
|
|
1931
|
+
"inheritanceReport": "",
|
|
1932
|
+
"vueFilePath": "",
|
|
1933
|
+
"definitionFilePath": "D:\\wangsitId\\wangsvue\\packages\\globalsettings-tagsamurai\\dist\\inputotp\\index.d.ts",
|
|
1942
1934
|
"importInfo": {
|
|
1943
1935
|
"packageName": "@fewangsit/wangsvue-gsts",
|
|
1944
|
-
"importPath": "import {
|
|
1936
|
+
"importPath": "import { inputotp } from '@fewangsit/wangsvue-gsts'",
|
|
1945
1937
|
"treeshakable": true
|
|
1946
1938
|
},
|
|
1947
1939
|
"examples": [],
|
|
1948
1940
|
"useCases": [],
|
|
1949
1941
|
"dependencies": [],
|
|
1950
|
-
"status": "
|
|
1942
|
+
"status": "unknown",
|
|
1951
1943
|
"accessibility": {
|
|
1952
1944
|
"ariaSupport": false,
|
|
1953
1945
|
"keyboardNavigation": false,
|
|
@@ -2899,7 +2891,8 @@
|
|
|
2899
2891
|
"Paginator",
|
|
2900
2892
|
"TagType",
|
|
2901
2893
|
"ToggleSwitch",
|
|
2902
|
-
"UserName"
|
|
2894
|
+
"UserName",
|
|
2895
|
+
"inputotp"
|
|
2903
2896
|
],
|
|
2904
2897
|
"navigation": [
|
|
2905
2898
|
"Breadcrumb",
|
|
@@ -2926,7 +2919,6 @@
|
|
|
2926
2919
|
"InputRangeNumber",
|
|
2927
2920
|
"InputText",
|
|
2928
2921
|
"InputURL",
|
|
2929
|
-
"Inputotp",
|
|
2930
2922
|
"InvisibleField",
|
|
2931
2923
|
"Textarea"
|
|
2932
2924
|
],
|
|
@@ -3254,7 +3246,7 @@
|
|
|
3254
3246
|
"inputrangenumber"
|
|
3255
3247
|
],
|
|
3256
3248
|
"inputotp": [
|
|
3257
|
-
"inputotp"
|
|
3249
|
+
"inputotp-fallback"
|
|
3258
3250
|
],
|
|
3259
3251
|
"inputpassword": [
|
|
3260
3252
|
"inputpassword"
|
|
@@ -3436,7 +3428,6 @@
|
|
|
3436
3428
|
"inputcurrency",
|
|
3437
3429
|
"inputemail",
|
|
3438
3430
|
"inputnumber",
|
|
3439
|
-
"inputotp",
|
|
3440
3431
|
"inputpassword",
|
|
3441
3432
|
"inputphonenumber",
|
|
3442
3433
|
"inputrangenumber",
|
|
@@ -3448,12 +3439,17 @@
|
|
|
3448
3439
|
"inputcurrency",
|
|
3449
3440
|
"inputemail",
|
|
3450
3441
|
"inputnumber",
|
|
3451
|
-
"inputotp",
|
|
3452
3442
|
"inputpassword",
|
|
3453
3443
|
"inputphonenumber",
|
|
3454
3444
|
"inputrangenumber",
|
|
3455
3445
|
"inputtext",
|
|
3456
3446
|
"inputurl"
|
|
3447
|
+
],
|
|
3448
|
+
"fallback": [
|
|
3449
|
+
"inputotp-fallback"
|
|
3450
|
+
],
|
|
3451
|
+
"parsing-error": [
|
|
3452
|
+
"inputotp-fallback"
|
|
3457
3453
|
]
|
|
3458
3454
|
},
|
|
3459
3455
|
"byCategory": {
|
|
@@ -3474,6 +3470,7 @@
|
|
|
3474
3470
|
"editor",
|
|
3475
3471
|
"fileupload",
|
|
3476
3472
|
"icon",
|
|
3473
|
+
"inputotp-fallback",
|
|
3477
3474
|
"litedropdown",
|
|
3478
3475
|
"multiselect",
|
|
3479
3476
|
"paginator",
|
|
@@ -3501,7 +3498,6 @@
|
|
|
3501
3498
|
"inputbadge",
|
|
3502
3499
|
"inputemail",
|
|
3503
3500
|
"inputnumber",
|
|
3504
|
-
"inputotp",
|
|
3505
3501
|
"inputpassword",
|
|
3506
3502
|
"inputphonenumber",
|
|
3507
3503
|
"inputrangenumber",
|
|
@@ -3585,7 +3581,7 @@
|
|
|
3585
3581
|
"inlinemessage",
|
|
3586
3582
|
"inputbadge",
|
|
3587
3583
|
"inputcurrency",
|
|
3588
|
-
"inputotp",
|
|
3584
|
+
"inputotp-fallback",
|
|
3589
3585
|
"invisiblefield",
|
|
3590
3586
|
"languageswitcher",
|
|
3591
3587
|
"litedropdown",
|
|
@@ -4507,7 +4503,23 @@
|
|
|
4507
4503
|
"inputemail"
|
|
4508
4504
|
],
|
|
4509
4505
|
"inputotp": [
|
|
4510
|
-
"inputotp"
|
|
4506
|
+
"inputotp-fallback"
|
|
4507
|
+
],
|
|
4508
|
+
"fallback": [
|
|
4509
|
+
"inputotp-fallback"
|
|
4510
|
+
],
|
|
4511
|
+
"metadata": [
|
|
4512
|
+
"inputotp-fallback"
|
|
4513
|
+
],
|
|
4514
|
+
"due": [
|
|
4515
|
+
"inputotp-fallback"
|
|
4516
|
+
],
|
|
4517
|
+
"parsing": [
|
|
4518
|
+
"inputotp-fallback"
|
|
4519
|
+
],
|
|
4520
|
+
"error": [
|
|
4521
|
+
"inputotp-fallback",
|
|
4522
|
+
"validatormessage"
|
|
4511
4523
|
],
|
|
4512
4524
|
"password": [
|
|
4513
4525
|
"inputpassword"
|
|
@@ -4718,18 +4730,15 @@
|
|
|
4718
4730
|
],
|
|
4719
4731
|
"validatormessage": [
|
|
4720
4732
|
"validatormessage"
|
|
4721
|
-
],
|
|
4722
|
-
"error": [
|
|
4723
|
-
"validatormessage"
|
|
4724
4733
|
]
|
|
4725
4734
|
}
|
|
4726
4735
|
},
|
|
4727
4736
|
"statistics": {
|
|
4728
4737
|
"totalComponents": 68,
|
|
4729
4738
|
"componentsByCategory": {
|
|
4730
|
-
"utility":
|
|
4739
|
+
"utility": 23,
|
|
4731
4740
|
"navigation": 3,
|
|
4732
|
-
"input":
|
|
4741
|
+
"input": 21,
|
|
4733
4742
|
"integration": 1,
|
|
4734
4743
|
"data-display": 6,
|
|
4735
4744
|
"overlay": 5,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Component Data Source Summary
|
|
2
|
-
Generated: 2026-04-25T07:
|
|
2
|
+
Generated: 2026-04-25T07:37:48.093Z
|
|
3
3
|
Version: 1.0.0
|
|
4
4
|
Total Components: 68
|
|
5
5
|
Package: ../../packages/globalsettings-tagsamurai
|
|
@@ -9,12 +9,12 @@ Statistics:
|
|
|
9
9
|
- Overrides: 7
|
|
10
10
|
- Accessible Components: 0
|
|
11
11
|
- Total Examples: 0
|
|
12
|
-
- Unresolved Components:
|
|
12
|
+
- Unresolved Components: 1
|
|
13
13
|
|
|
14
14
|
Components by Category:
|
|
15
|
-
- utility:
|
|
15
|
+
- utility: 23
|
|
16
16
|
- navigation: 3
|
|
17
|
-
- input:
|
|
17
|
+
- input: 21
|
|
18
18
|
- integration: 1
|
|
19
19
|
- data-display: 6
|
|
20
20
|
- overlay: 5
|
|
@@ -22,3 +22,6 @@ Components by Category:
|
|
|
22
22
|
- layout: 1
|
|
23
23
|
- feedback: 3
|
|
24
24
|
- localization: 2
|
|
25
|
+
|
|
26
|
+
Unresolved Components (Fallback):
|
|
27
|
+
- inputotp-fallback
|
package/mcp/main.js
CHANGED
|
@@ -9,66 +9,66 @@ import ul from "os";
|
|
|
9
9
|
import ll from "crypto";
|
|
10
10
|
import * as wt from "typescript";
|
|
11
11
|
import ea from "node:process";
|
|
12
|
-
const dl = `# Wangsvue AI Agent: Master Operating Directive
|
|
13
|
-
|
|
14
|
-
## 1. Role & Identity
|
|
15
|
-
|
|
16
|
-
You are the **Senior Wangsvue Systems Architect**. Your primary mission is to deliver production-ready Vue 3 + TypeScript code perfectly aligned with the Wangsit ecosystem
|
|
17
|
-
|
|
18
|
-
## 2. Core Principles
|
|
19
|
-
|
|
20
|
-
### 🌟 The Golden Rule
|
|
21
|
-
|
|
22
|
-
**NEVER guess.** Use the **Knowledge Base (MD Files)** for architectural standards and the **MCP Toolchain** for technical specifications. If internal training data conflicts with these sources, the provided MD files and MCP results always win
|
|
23
|
-
|
|
24
|
-
### 🔒 Total Wangsvue Exclusivity
|
|
25
|
-
|
|
26
|
-
**FORGET ANY DESIGN SYSTEM OR COMPONENT LIBRARY OUTSIDE WANGSVUE.** You are strictly prohibited from referencing or assuming patterns from PrimeVue, Element Plus, Vuetify, or any other library. You MUST ONLY use the props, slots, events, and patterns defined in the Wangsvue MCP or Knowledge Base
|
|
27
|
-
|
|
28
|
-
### 🚫 Zero Assumption Policy
|
|
29
|
-
|
|
30
|
-
**NEVER assume** a prop name, slot name, icon name, or enum value exists. If it's not in the MCP result, it doesn't exist
|
|
31
|
-
|
|
32
|
-
### ✅ MCP-First Verification
|
|
33
|
-
|
|
34
|
-
Every single line of code involving a component MUST be verified by \`analyze_component\` and \`resolve_type_definition\` first
|
|
35
|
-
|
|
36
|
-
## 3. The Two-MCP Toolchain
|
|
37
|
-
|
|
38
|
-
| MCP Tool | Purpose | Source of Truth For...
|
|
39
|
-
| :------------------ | :---------------- | :-----------------------------------------------------------------------------------
|
|
40
|
-
| **\`wangsvue-mcp\`** | **Technical API** | Component IDs, Inheritance, Import paths, and Props/Slots/Emits types (TOON format).
|
|
41
|
-
| **\`wangsvue-docs\`** | **Functional** | Real-world implementation examples, component sections, and variants.
|
|
42
|
-
|
|
43
|
-
## 4. Architectural Standards
|
|
44
|
-
|
|
45
|
-
### View Architecture
|
|
46
|
-
|
|
47
|
-
- **Lightweight Views:** Views must only import and compose from modules
|
|
48
|
-
- **Logic Separation:** Business logic, data, columns, and handlers belong in \`components/modules/\`, NOT in views
|
|
49
|
-
- **No App.vue Logic:** \`App.vue\` must only contain \`<router-view />\`, except for some case when the project not using Vue Router
|
|
50
|
-
|
|
51
|
-
### Design System Compliance
|
|
52
|
-
|
|
53
|
-
- **Trust Component Styling:** NEVER add styling to Wangsvue components. Trust the built-in design system
|
|
54
|
-
- **No Manual CSS:** Do not use generic HTML (e.g., \`div.bg-white\`) when a specialized component (e.g., \`Card\`) exists
|
|
55
|
-
- **Exact Values:** Preserve exact pixel values from design (e.g., 21px). Do not round
|
|
56
|
-
|
|
57
|
-
### Color System
|
|
58
|
-
|
|
59
|
-
- **Tailwind Tokens Only:** NEVER use CSS variables or hex colors directly
|
|
60
|
-
- **Mapping:** ALWAYS map hex codes to Tailwind tokens (e.g., \`general-50\`, \`primary-500\`) from config files
|
|
61
|
-
|
|
62
|
-
## 5. Operational Skills
|
|
63
|
-
|
|
64
|
-
Use the following skills to execute specific tasks. These skills contain the detailed step-by-step protocols
|
|
65
|
-
|
|
66
|
-
- **\`wangsvue-workflow\`**: **MANDATORY** for starting any task. Enforces the 5-step development workflow and component discovery
|
|
67
|
-
- **\`wangsvue-code-review\`**: **MANDATORY** for validating generated code against architectural principles
|
|
68
|
-
- **\`import-validator\`**: Enforces strict import protocols and type definitions
|
|
69
|
-
- **\`figma-to-code\`**: specialized logic for converting Figma/React designs to Wangsvue
|
|
70
|
-
- **\`api-service-generator\`**: Generates API services from OpenAPI specs
|
|
71
|
-
- **\`committing-changes\`**: Enforces commit message standards
|
|
12
|
+
const dl = `# Wangsvue AI Agent: Master Operating Directive\r
|
|
13
|
+
\r
|
|
14
|
+
## 1. Role & Identity\r
|
|
15
|
+
\r
|
|
16
|
+
You are the **Senior Wangsvue Systems Architect**. Your primary mission is to deliver production-ready Vue 3 + TypeScript code perfectly aligned with the Wangsit ecosystem.\r
|
|
17
|
+
\r
|
|
18
|
+
## 2. Core Principles\r
|
|
19
|
+
\r
|
|
20
|
+
### 🌟 The Golden Rule\r
|
|
21
|
+
\r
|
|
22
|
+
**NEVER guess.** Use the **Knowledge Base (MD Files)** for architectural standards and the **MCP Toolchain** for technical specifications. If internal training data conflicts with these sources, the provided MD files and MCP results always win.\r
|
|
23
|
+
\r
|
|
24
|
+
### 🔒 Total Wangsvue Exclusivity\r
|
|
25
|
+
\r
|
|
26
|
+
**FORGET ANY DESIGN SYSTEM OR COMPONENT LIBRARY OUTSIDE WANGSVUE.** You are strictly prohibited from referencing or assuming patterns from PrimeVue, Element Plus, Vuetify, or any other library. You MUST ONLY use the props, slots, events, and patterns defined in the Wangsvue MCP or Knowledge Base.\r
|
|
27
|
+
\r
|
|
28
|
+
### 🚫 Zero Assumption Policy\r
|
|
29
|
+
\r
|
|
30
|
+
**NEVER assume** a prop name, slot name, icon name, or enum value exists. If it's not in the MCP result, it doesn't exist.\r
|
|
31
|
+
\r
|
|
32
|
+
### ✅ MCP-First Verification\r
|
|
33
|
+
\r
|
|
34
|
+
Every single line of code involving a component MUST be verified by \`analyze_component\` and \`resolve_type_definition\` first.\r
|
|
35
|
+
\r
|
|
36
|
+
## 3. The Two-MCP Toolchain\r
|
|
37
|
+
\r
|
|
38
|
+
| MCP Tool | Purpose | Source of Truth For... |\r
|
|
39
|
+
| :------------------ | :---------------- | :----------------------------------------------------------------------------------- |\r
|
|
40
|
+
| **\`wangsvue-mcp\`** | **Technical API** | Component IDs, Inheritance, Import paths, and Props/Slots/Emits types (TOON format). |\r
|
|
41
|
+
| **\`wangsvue-docs\`** | **Functional** | Real-world implementation examples, component sections, and variants. |\r
|
|
42
|
+
\r
|
|
43
|
+
## 4. Architectural Standards\r
|
|
44
|
+
\r
|
|
45
|
+
### View Architecture\r
|
|
46
|
+
\r
|
|
47
|
+
- **Lightweight Views:** Views must only import and compose from modules.\r
|
|
48
|
+
- **Logic Separation:** Business logic, data, columns, and handlers belong in \`components/modules/\`, NOT in views.\r
|
|
49
|
+
- **No App.vue Logic:** \`App.vue\` must only contain \`<router-view />\`, except for some case when the project not using Vue Router.\r
|
|
50
|
+
\r
|
|
51
|
+
### Design System Compliance\r
|
|
52
|
+
\r
|
|
53
|
+
- **Trust Component Styling:** NEVER add styling to Wangsvue components. Trust the built-in design system.\r
|
|
54
|
+
- **No Manual CSS:** Do not use generic HTML (e.g., \`div.bg-white\`) when a specialized component (e.g., \`Card\`) exists.\r
|
|
55
|
+
- **Exact Values:** Preserve exact pixel values from design (e.g., 21px). Do not round.\r
|
|
56
|
+
\r
|
|
57
|
+
### Color System\r
|
|
58
|
+
\r
|
|
59
|
+
- **Tailwind Tokens Only:** NEVER use CSS variables or hex colors directly.\r
|
|
60
|
+
- **Mapping:** ALWAYS map hex codes to Tailwind tokens (e.g., \`general-50\`, \`primary-500\`) from config files.\r
|
|
61
|
+
\r
|
|
62
|
+
## 5. Operational Skills\r
|
|
63
|
+
\r
|
|
64
|
+
Use the following skills to execute specific tasks. These skills contain the detailed step-by-step protocols:\r
|
|
65
|
+
\r
|
|
66
|
+
- **\`wangsvue-workflow\`**: **MANDATORY** for starting any task. Enforces the 5-step development workflow and component discovery.\r
|
|
67
|
+
- **\`wangsvue-code-review\`**: **MANDATORY** for validating generated code against architectural principles.\r
|
|
68
|
+
- **\`import-validator\`**: Enforces strict import protocols and type definitions.\r
|
|
69
|
+
- **\`figma-to-code\`**: specialized logic for converting Figma/React designs to Wangsvue.\r
|
|
70
|
+
- **\`api-service-generator\`**: Generates API services from OpenAPI specs.\r
|
|
71
|
+
- **\`committing-changes\`**: Enforces commit message standards.\r
|
|
72
72
|
`, fl = ns(import.meta.url), ta = tr(fl), hl = "https://fewangsit.gitbook.io", pl = "https://fewangsit.gitbook.io/vue/llms.txt", ra = {
|
|
73
73
|
trae: {
|
|
74
74
|
output_dir: ".trae",
|
package/mcp/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fewangsit/wangsvue-gsts-mcp",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.13",
|
|
4
4
|
"description": "MCP Server for @fewangsit/wangsvue-gsts",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
"buildContext": {
|
|
11
11
|
"package": {
|
|
12
12
|
"name": "@fewangsit/wangsvue-gsts",
|
|
13
|
-
"version": "2.0.0-alpha.
|
|
13
|
+
"version": "2.0.0-alpha.13",
|
|
14
14
|
"description": "Global Settings Tagsamurai VueJS Component Library",
|
|
15
15
|
"repository": "https://github.com/fewangsit/wangsvue",
|
|
16
16
|
"workspace": "wangsvue-gsts"
|
|
17
17
|
},
|
|
18
18
|
"build": {
|
|
19
|
-
"timestamp": "2026-04-25T07:
|
|
19
|
+
"timestamp": "2026-04-25T07:37:50.751Z",
|
|
20
20
|
"gitInfo": {
|
|
21
|
-
"head": "
|
|
21
|
+
"head": "c174dcda518aeffe4302fe82ec82075558f23272",
|
|
22
22
|
"branch": "dev",
|
|
23
23
|
"repository": "https://github.com/fewangsit/wangsvue.git",
|
|
24
|
-
"timestamp": "2026-04-25T07:
|
|
24
|
+
"timestamp": "2026-04-25T07:37:50.260Z"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: 'api-service-generator'
|
|
3
|
-
description: 'Generates production-ready API Services, DTOs, and Response Types from OpenAPI specifications. Invoke when user provides an OpenAPI spec or asks to create API services.'
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# API Service Generator
|
|
7
|
-
|
|
8
|
-
This skill automates the creation of API services, request DTOs, and response types based on an OpenAPI (Swagger) specification, following the project's architectural standards.
|
|
9
|
-
|
|
10
|
-
## When to Use
|
|
11
|
-
|
|
12
|
-
- Invoke when the user provides an OpenAPI specification (YAML or JSON).
|
|
13
|
-
- Invoke when the user asks to "create API services" or "implement endpoints" from a spec.
|
|
14
|
-
- Invoke when updating existing services based on a new API version.
|
|
15
|
-
|
|
16
|
-
## Standards & Patterns
|
|
17
|
-
|
|
18
|
-
### 1. File Structure
|
|
19
|
-
|
|
20
|
-
- **Services**: `src/services/<serviceName>.service.ts`
|
|
21
|
-
- **Request DTOs**: `src/dto/<serviceName>.dto.ts`
|
|
22
|
-
- **Response Types**: `src/types/<serviceName>.type.ts`
|
|
23
|
-
|
|
24
|
-
### 2. Service Object
|
|
25
|
-
|
|
26
|
-
- Use **PascalCase** for the service object name (e.g., `AuthService`).
|
|
27
|
-
- Use **camelCase** for methods (e.g., `postLogin`).
|
|
28
|
-
- Methods should follow the naming: `[httpMethod][ActionName]` (e.g., `getDetail`, `postCreate`).
|
|
29
|
-
- Return type: `Promise<AxiosResponse<ResponseType>>`.
|
|
30
|
-
- Single line spacing between methods.
|
|
31
|
-
|
|
32
|
-
### 3. Instance Creation
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
import { AxiosResponse } from 'axios';
|
|
36
|
-
import createAxiosInstance from './createInstance';
|
|
37
|
-
|
|
38
|
-
const API = createAxiosInstance({
|
|
39
|
-
env: 'VITE_API_BASE_URL',
|
|
40
|
-
prefix: '/v2/iam',
|
|
41
|
-
});
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### 4. DTOs & Types
|
|
45
|
-
|
|
46
|
-
- **DTOs**: Interfaces for request bodies and query params.
|
|
47
|
-
- **Types**: Interfaces for response bodies.
|
|
48
|
-
- Use clear, descriptive noun-based names (e.g., `LoginBody`, `LoginResponse`).
|
|
49
|
-
- Use `UserProfileResponse` instead of `GetUserProfileResponse`.
|
|
50
|
-
|
|
51
|
-
## Workflow
|
|
52
|
-
|
|
53
|
-
1. **Parse the Spec**: Identify paths, methods, request schemas, and response schemas.
|
|
54
|
-
2. **Group by Module**: Group endpoints by their primary path segment (e.g., `/auth/*` -> `AuthService`).
|
|
55
|
-
3. **Generate Interfaces**:
|
|
56
|
-
- Create `src/dto/<module>.dto.ts` for all request-related interfaces.
|
|
57
|
-
- Create `src/types/<module>.type.ts` for all response-related interfaces.
|
|
58
|
-
4. **Generate Service**:
|
|
59
|
-
- Create `src/services/<module>.service.ts`.
|
|
60
|
-
- Implement methods for each endpoint in the group.
|
|
61
|
-
5. **Register Service**:
|
|
62
|
-
- Export the service from `src/main.ts` for global availability.
|
|
63
|
-
|
|
64
|
-
## Example Transformation
|
|
65
|
-
|
|
66
|
-
**Input (OpenAPI):**
|
|
67
|
-
|
|
68
|
-
```yaml
|
|
69
|
-
/auth/login:
|
|
70
|
-
post:
|
|
71
|
-
summary: Login
|
|
72
|
-
requestBody:
|
|
73
|
-
content:
|
|
74
|
-
application/json:
|
|
75
|
-
schema:
|
|
76
|
-
$ref: '#/components/schemas/LoginRequest'
|
|
77
|
-
responses:
|
|
78
|
-
'200':
|
|
79
|
-
content:
|
|
80
|
-
application/json:
|
|
81
|
-
schema:
|
|
82
|
-
$ref: '#/components/schemas/LoginResponse'
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**Output (Service):**
|
|
86
|
-
|
|
87
|
-
```typescript
|
|
88
|
-
const AuthService = {
|
|
89
|
-
postLogin: (body: LoginRequest): Promise<AxiosResponse<LoginResponse>> => {
|
|
90
|
-
return API.post('/auth/login', body);
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: 'api-service-generator'
|
|
3
|
+
description: 'Generates production-ready API Services, DTOs, and Response Types from OpenAPI specifications. Invoke when user provides an OpenAPI spec or asks to create API services.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# API Service Generator
|
|
7
|
+
|
|
8
|
+
This skill automates the creation of API services, request DTOs, and response types based on an OpenAPI (Swagger) specification, following the project's architectural standards.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- Invoke when the user provides an OpenAPI specification (YAML or JSON).
|
|
13
|
+
- Invoke when the user asks to "create API services" or "implement endpoints" from a spec.
|
|
14
|
+
- Invoke when updating existing services based on a new API version.
|
|
15
|
+
|
|
16
|
+
## Standards & Patterns
|
|
17
|
+
|
|
18
|
+
### 1. File Structure
|
|
19
|
+
|
|
20
|
+
- **Services**: `src/services/<serviceName>.service.ts`
|
|
21
|
+
- **Request DTOs**: `src/dto/<serviceName>.dto.ts`
|
|
22
|
+
- **Response Types**: `src/types/<serviceName>.type.ts`
|
|
23
|
+
|
|
24
|
+
### 2. Service Object
|
|
25
|
+
|
|
26
|
+
- Use **PascalCase** for the service object name (e.g., `AuthService`).
|
|
27
|
+
- Use **camelCase** for methods (e.g., `postLogin`).
|
|
28
|
+
- Methods should follow the naming: `[httpMethod][ActionName]` (e.g., `getDetail`, `postCreate`).
|
|
29
|
+
- Return type: `Promise<AxiosResponse<ResponseType>>`.
|
|
30
|
+
- Single line spacing between methods.
|
|
31
|
+
|
|
32
|
+
### 3. Instance Creation
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { AxiosResponse } from 'axios';
|
|
36
|
+
import createAxiosInstance from './createInstance';
|
|
37
|
+
|
|
38
|
+
const API = createAxiosInstance({
|
|
39
|
+
env: 'VITE_API_BASE_URL',
|
|
40
|
+
prefix: '/v2/iam',
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 4. DTOs & Types
|
|
45
|
+
|
|
46
|
+
- **DTOs**: Interfaces for request bodies and query params.
|
|
47
|
+
- **Types**: Interfaces for response bodies.
|
|
48
|
+
- Use clear, descriptive noun-based names (e.g., `LoginBody`, `LoginResponse`).
|
|
49
|
+
- Use `UserProfileResponse` instead of `GetUserProfileResponse`.
|
|
50
|
+
|
|
51
|
+
## Workflow
|
|
52
|
+
|
|
53
|
+
1. **Parse the Spec**: Identify paths, methods, request schemas, and response schemas.
|
|
54
|
+
2. **Group by Module**: Group endpoints by their primary path segment (e.g., `/auth/*` -> `AuthService`).
|
|
55
|
+
3. **Generate Interfaces**:
|
|
56
|
+
- Create `src/dto/<module>.dto.ts` for all request-related interfaces.
|
|
57
|
+
- Create `src/types/<module>.type.ts` for all response-related interfaces.
|
|
58
|
+
4. **Generate Service**:
|
|
59
|
+
- Create `src/services/<module>.service.ts`.
|
|
60
|
+
- Implement methods for each endpoint in the group.
|
|
61
|
+
5. **Register Service**:
|
|
62
|
+
- Export the service from `src/main.ts` for global availability.
|
|
63
|
+
|
|
64
|
+
## Example Transformation
|
|
65
|
+
|
|
66
|
+
**Input (OpenAPI):**
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
/auth/login:
|
|
70
|
+
post:
|
|
71
|
+
summary: Login
|
|
72
|
+
requestBody:
|
|
73
|
+
content:
|
|
74
|
+
application/json:
|
|
75
|
+
schema:
|
|
76
|
+
$ref: '#/components/schemas/LoginRequest'
|
|
77
|
+
responses:
|
|
78
|
+
'200':
|
|
79
|
+
content:
|
|
80
|
+
application/json:
|
|
81
|
+
schema:
|
|
82
|
+
$ref: '#/components/schemas/LoginResponse'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Output (Service):**
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
const AuthService = {
|
|
89
|
+
postLogin: (body: LoginRequest): Promise<AxiosResponse<LoginResponse>> => {
|
|
90
|
+
return API.post('/auth/login', body);
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
```
|