Skip to content

Commit 0510eac

Browse files
committed
feat: update API endpoints and improve mock server handling
1 parent d936436 commit 0510eac

File tree

8 files changed

+16
-8
lines changed

8 files changed

+16
-8
lines changed

apps/console/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" id="favicon" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>ObjectStack Console - ObjectUI</title>
8+
<script>
9+
window.process = window.process || { env: { NODE_ENV: 'development' }, version: '', platform: 'browser' };
10+
</script>
811
</head>
912
<body>
1013
<div id="root"></div>

apps/console/vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import path from 'path';
44

55
// https://vitejs.dev/config/
66
export default defineConfig({
7+
define: {
8+
'process.env': {},
9+
'process.platform': '"browser"',
10+
'process.version': '"0.0.0"',
11+
},
712
plugins: [react()],
813
resolve: {
914
extensions: ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json'],

examples/crm/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async function startServer() {
4848

4949
// 5. Console Plugin
5050
const consolePlugin = new ConsolePlugin();
51-
kernel.use(consolePlugin);
51+
await kernel.use(consolePlugin);
5252

5353
// Bootstrap
5454
await kernel.bootstrap();

packages/plugin-aggrid/QUICKSTART.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Your ObjectStack backend should provide:
143143

144144
1. **Metadata Endpoint**: Returns object schema with field definitions
145145
```typescript
146-
GET /api/meta/objects/{objectName}
146+
GET /api/v1/metadata/object/{objectName}
147147
```
148148

149149
2. **Data Endpoint**: Returns paginated data

packages/plugin-calendar/src/ObjectCalendar.msw.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const handlers = [
4646
}),
4747

4848
// Metadata Query
49-
http.get(`${BASE_URL}/api/v1/meta/object/events`, () => {
49+
http.get(`${BASE_URL}/api/v1/metadata/object/events`, () => {
5050
return HttpResponse.json({ fields: {} });
5151
})
5252
];

packages/plugin-form/src/ObjectForm.msw.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ const handlers = [
4545
return HttpResponse.json({ status: 'ok', version: '1.0.0' });
4646
}),
4747

48-
// Mock Schema Fetch: GET /api/v1/meta/object/:name
49-
http.get(`${BASE_URL}/api/v1/meta/object/:name`, ({ params }) => {
48+
// Mock Schema Fetch: GET /api/v1/metadata/object/:name
49+
http.get(`${BASE_URL}/api/v1/metadata/object/:name`, ({ params }) => {
5050
const { name } = params;
5151
if (name === 'contact') {
5252
return HttpResponse.json(mockSchema);

packages/plugin-grid/src/ObjectGrid.msw.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ const handlers = [
4747
return HttpResponse.json({ status: 'ok', version: '1.0.0' });
4848
}),
4949

50-
// Schema: /api/v1/meta/object/:name
51-
http.get(`${BASE_URL}/api/v1/meta/object/contact`, () => {
50+
// Schema: /api/v1/metadata/object/:name
51+
http.get(`${BASE_URL}/api/v1/metadata/object/contact`, () => {
5252
return HttpResponse.json(mockSchema);
5353
}),
5454

packages/types/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,4 +644,4 @@ export type {
644644
* const component: UI.Component = { type: 'button', label: 'Click me' };
645645
* ```
646646
*/
647-
export type { Data, UI, System, AI, API, Auth, Hub, Automation, Permission, Shared, QA } from '@objectstack/spec';
647+
export type { Data, UI, System, AI, API, Hub, Automation, Shared, QA } from '@objectstack/spec';

0 commit comments

Comments
 (0)