@ratio-mcp/dev-server 1.3.0 → 1.4.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/dist/index.js +0 -0
- package/dist/services/session-state.d.ts +14 -0
- package/dist/services/session-state.d.ts.map +1 -1
- package/dist/services/session-state.js +21 -1
- package/dist/services/session-state.js.map +1 -1
- package/dist/services/tool-guard.d.ts.map +1 -1
- package/dist/services/tool-guard.js +14 -17
- package/dist/services/tool-guard.js.map +1 -1
- package/dist/templates/backend/.env.example +3 -0
- package/dist/templates/backend/package.json +2 -1
- package/dist/templates/backend/src/app.module.ts +2 -0
- package/dist/templates/backend/src/oauth/oauth-callback.controller.ts +62 -0
- package/dist/templates/backend/src/oauth/oauth-callback.module.ts +10 -0
- package/dist/templates/backend/src/oauth/oauth-callback.service.ts +158 -0
- package/dist/templates/frontend/README.md +16 -0
- package/dist/templates/frontend/eslint.config.js +29 -0
- package/dist/templates/frontend/index.html +4 -4
- package/dist/templates/frontend/jsconfig.json +22 -0
- package/dist/templates/frontend/package.json +14 -11
- package/dist/templates/frontend/public/favicon.svg +1 -0
- package/dist/templates/frontend/public/icons.svg +24 -0
- package/dist/templates/frontend/src/App.css +184 -0
- package/dist/templates/frontend/src/App.jsx +121 -0
- package/dist/templates/frontend/src/assets/hero.png +0 -0
- package/dist/templates/frontend/src/assets/react.svg +1 -0
- package/dist/templates/frontend/src/assets/vite.svg +1 -0
- package/dist/templates/frontend/src/index.css +94 -31
- package/dist/templates/frontend/src/main.jsx +10 -0
- package/dist/templates/frontend/vite.config.js +19 -0
- package/dist/tools/app-management.d.ts.map +1 -1
- package/dist/tools/app-management.js +73 -13
- package/dist/tools/app-management.js.map +1 -1
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +15 -3
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/codegen.d.ts.map +1 -1
- package/dist/tools/codegen.js +111 -13
- package/dist/tools/codegen.js.map +1 -1
- package/dist/tools/gather-requirements.d.ts.map +1 -1
- package/dist/tools/gather-requirements.js +19 -19
- package/dist/tools/gather-requirements.js.map +1 -1
- package/dist/tools/get-status.d.ts.map +1 -1
- package/dist/tools/get-status.js +0 -5
- package/dist/tools/get-status.js.map +1 -1
- package/dist/tools/hookdeck.d.ts +3 -0
- package/dist/tools/hookdeck.d.ts.map +1 -0
- package/dist/tools/hookdeck.js +101 -0
- package/dist/tools/hookdeck.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +5 -3
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/lifecycle.d.ts.map +1 -1
- package/dist/tools/lifecycle.js +21 -10
- package/dist/tools/lifecycle.js.map +1 -1
- package/dist/tools/reference-data.d.ts.map +1 -1
- package/dist/tools/reference-data.js +6 -4
- package/dist/tools/reference-data.js.map +1 -1
- package/dist/tools/requirements.d.ts.map +1 -1
- package/dist/tools/requirements.js +43 -1
- package/dist/tools/requirements.js.map +1 -1
- package/dist/tools/scaffold.d.ts.map +1 -1
- package/dist/tools/scaffold.js +23 -14
- package/dist/tools/scaffold.js.map +1 -1
- package/dist/tools/submission.d.ts.map +1 -1
- package/dist/tools/submission.js +33 -18
- package/dist/tools/submission.js.map +1 -1
- package/dist/tools/webhooks.d.ts.map +1 -1
- package/dist/tools/webhooks.js +30 -6
- package/dist/tools/webhooks.js.map +1 -1
- package/package.json +15 -16
- package/dist/templates/frontend/src/App.tsx +0 -32
- package/dist/templates/frontend/src/components/Layout.tsx +0 -53
- package/dist/templates/frontend/src/context/AuthContext.tsx +0 -59
- package/dist/templates/frontend/src/main.tsx +0 -16
- package/dist/templates/frontend/src/pages/Callback.tsx +0 -53
- package/dist/templates/frontend/src/pages/Dashboard.tsx +0 -24
- package/dist/templates/frontend/src/pages/Login.tsx +0 -42
- package/dist/templates/frontend/src/services/api.ts +0 -48
- package/dist/templates/frontend/tsconfig.json +0 -21
- package/dist/templates/frontend/vite.config.ts +0 -15
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export default function Login() {
|
|
2
|
-
const clientId = import.meta.env.VITE_RATIO_CLIENT_ID || '';
|
|
3
|
-
const redirectUri = import.meta.env.VITE_RATIO_REDIRECT_URI || `${window.location.origin}/callback`;
|
|
4
|
-
const dashboardUrl = import.meta.env.VITE_RATIO_DASHBOARD_URL || 'https://dev-developers.dev.gokwik.in';
|
|
5
|
-
|
|
6
|
-
const handleLogin = () => {
|
|
7
|
-
// Redirect to Ratio OAuth consent screen
|
|
8
|
-
const authUrl = `${dashboardUrl}/oauth/authorize?client_id=${clientId}&redirect_uri=${encodeURIComponent(redirectUri)}&response_type=code`;
|
|
9
|
-
window.location.href = authUrl;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<div
|
|
14
|
-
style={{
|
|
15
|
-
display: 'flex',
|
|
16
|
-
justifyContent: 'center',
|
|
17
|
-
alignItems: 'center',
|
|
18
|
-
minHeight: '100vh',
|
|
19
|
-
background: '#f0f2f5',
|
|
20
|
-
}}
|
|
21
|
-
>
|
|
22
|
-
<div
|
|
23
|
-
style={{
|
|
24
|
-
background: '#fff',
|
|
25
|
-
padding: '3rem',
|
|
26
|
-
borderRadius: 12,
|
|
27
|
-
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
28
|
-
textAlign: 'center',
|
|
29
|
-
maxWidth: 400,
|
|
30
|
-
}}
|
|
31
|
-
>
|
|
32
|
-
<h1 style={{ marginBottom: '0.5rem' }}>Ratio App</h1>
|
|
33
|
-
<p style={{ color: '#666', marginBottom: '2rem' }}>
|
|
34
|
-
Sign in with your Ratio merchant account to continue.
|
|
35
|
-
</p>
|
|
36
|
-
<button onClick={handleLogin} style={{ width: '100%', padding: '0.75rem' }}>
|
|
37
|
-
Sign in with Ratio
|
|
38
|
-
</button>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import axios, { AxiosInstance } from 'axios';
|
|
2
|
-
|
|
3
|
-
class ApiService {
|
|
4
|
-
private client: AxiosInstance;
|
|
5
|
-
private token: string | null = null;
|
|
6
|
-
|
|
7
|
-
constructor() {
|
|
8
|
-
this.client = axios.create({
|
|
9
|
-
baseURL: import.meta.env.VITE_API_URL || 'http://localhost:3000/api',
|
|
10
|
-
headers: { 'Content-Type': 'application/json' },
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// Attach token to every request
|
|
14
|
-
this.client.interceptors.request.use((config) => {
|
|
15
|
-
if (this.token) {
|
|
16
|
-
config.headers.Authorization = `Bearer ${this.token}`;
|
|
17
|
-
}
|
|
18
|
-
return config;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
setToken(token: string | null) {
|
|
23
|
-
this.token = token;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Generic CRUD helpers — resource pages will use these
|
|
27
|
-
async get<T>(path: string, params?: Record<string, unknown>): Promise<T> {
|
|
28
|
-
const { data } = await this.client.get(path, { params });
|
|
29
|
-
return data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async post<T>(path: string, body?: unknown): Promise<T> {
|
|
33
|
-
const { data } = await this.client.post(path, body);
|
|
34
|
-
return data;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
async put<T>(path: string, body?: unknown): Promise<T> {
|
|
38
|
-
const { data } = await this.client.put(path, body);
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async delete<T>(path: string): Promise<T> {
|
|
43
|
-
const { data } = await this.client.delete(path);
|
|
44
|
-
return data;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const api = new ApiService();
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"moduleResolution": "bundler",
|
|
9
|
-
"allowImportingTsExtensions": true,
|
|
10
|
-
"resolveJsonModule": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"noEmit": true,
|
|
13
|
-
"strict": true,
|
|
14
|
-
"jsx": "react-jsx",
|
|
15
|
-
"baseUrl": ".",
|
|
16
|
-
"paths": {
|
|
17
|
-
"@/*": ["./src/*"]
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"include": ["src"]
|
|
21
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import react from '@vitejs/plugin-react';
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
plugins: [react()],
|
|
6
|
-
server: {
|
|
7
|
-
port: 5173,
|
|
8
|
-
proxy: {
|
|
9
|
-
'/api': {
|
|
10
|
-
target: 'http://localhost:3000',
|
|
11
|
-
changeOrigin: true,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
});
|