dolphin-server-modules 1.5.4 → 1.5.6
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/README.md +197 -125
- package/dist/adapters/mongoose/index.d.ts +4 -1
- package/dist/adapters/mongoose/index.js +54 -6
- package/dist/adapters/mongoose/index.js.map +1 -1
- package/dist/adapters/mongoose/index.test.js +60 -16
- package/dist/adapters/mongoose/index.test.js.map +1 -1
- package/dist/adapters/mongoose/integration.test.d.ts +5 -0
- package/dist/adapters/mongoose/integration.test.js +252 -0
- package/dist/adapters/mongoose/integration.test.js.map +1 -0
- package/dist/curd/crud.d.ts +7 -30
- package/dist/curd/crud.js +115 -163
- package/dist/curd/crud.js.map +1 -1
- package/dist/curd/crud.test.js +71 -128
- package/dist/curd/crud.test.js.map +1 -1
- package/dist/demo-server.d.ts +1 -0
- package/dist/demo-server.js +221 -0
- package/dist/demo-server.js.map +1 -0
- package/dist/djson/djson.test.d.ts +1 -0
- package/dist/djson/djson.test.js +235 -0
- package/dist/djson/djson.test.js.map +1 -0
- package/dist/router/router.test.d.ts +1 -0
- package/dist/router/router.test.js +47 -0
- package/dist/router/router.test.js.map +1 -0
- package/dist/swagger/swagger.test.d.ts +1 -0
- package/dist/swagger/swagger.test.js +40 -0
- package/dist/swagger/swagger.test.js.map +1 -0
- package/package.json +72 -70
package/dist/curd/crud.test.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// curd/crud.test.ts
|
|
3
4
|
const crud_1 = require("./crud");
|
|
4
|
-
|
|
5
|
+
// Simple in-memory adapter for testing
|
|
6
|
+
class TestAdapter {
|
|
5
7
|
data = {};
|
|
6
|
-
async createUser() { return {}; }
|
|
7
|
-
async findUserByEmail() { return {}; }
|
|
8
|
-
async findUserById() { return {}; }
|
|
9
|
-
async updateUser() { return {}; }
|
|
10
|
-
async saveRefreshToken() { }
|
|
11
|
-
async findRefreshToken() { }
|
|
12
|
-
async deleteRefreshToken() { }
|
|
13
8
|
async create(collection, doc) {
|
|
14
9
|
if (!this.data[collection])
|
|
15
10
|
this.data[collection] = [];
|
|
@@ -17,147 +12,95 @@ class MockDB {
|
|
|
17
12
|
return doc;
|
|
18
13
|
}
|
|
19
14
|
async read(collection, query) {
|
|
20
|
-
|
|
15
|
+
const items = this.data[collection] || [];
|
|
16
|
+
if (!query || Object.keys(query).length === 0)
|
|
17
|
+
return items;
|
|
18
|
+
return items.filter((item) => {
|
|
19
|
+
for (const [key, val] of Object.entries(query)) {
|
|
20
|
+
if (key === 'id' && item.id !== val)
|
|
21
|
+
return false;
|
|
22
|
+
if (key === '_id' && item.id !== val)
|
|
23
|
+
return false;
|
|
24
|
+
if (item[key] !== val)
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
});
|
|
21
29
|
}
|
|
22
30
|
async update(collection, query, data) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const items = this.data[collection] || [];
|
|
32
|
+
for (let i = 0; i < items.length; i++) {
|
|
33
|
+
if (query.id && items[i].id === query.id) {
|
|
34
|
+
this.data[collection][i] = { ...items[i], ...data };
|
|
35
|
+
return this.data[collection][i];
|
|
36
|
+
}
|
|
37
|
+
if (query._id && items[i].id === query._id) {
|
|
38
|
+
this.data[collection][i] = { ...items[i], ...data };
|
|
39
|
+
return this.data[collection][i];
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
|
-
return
|
|
42
|
+
return null;
|
|
35
43
|
}
|
|
36
44
|
async delete(collection, query) {
|
|
37
45
|
if (!this.data[collection])
|
|
38
46
|
return null;
|
|
39
|
-
// Just simple mock for id match or flush
|
|
40
47
|
if (query.id) {
|
|
41
|
-
this.data[collection] = this.data[collection].filter(d => d.id !== query.id
|
|
48
|
+
this.data[collection] = this.data[collection].filter((d) => d.id !== query.id);
|
|
49
|
+
return { deleted: true };
|
|
50
|
+
}
|
|
51
|
+
if (query._id) {
|
|
52
|
+
this.data[collection] = this.data[collection].filter((d) => d.id !== query._id);
|
|
53
|
+
return { deleted: true };
|
|
42
54
|
}
|
|
43
|
-
|
|
55
|
+
if (Object.keys(query).length === 0) {
|
|
44
56
|
this.data[collection] = [];
|
|
57
|
+
return { deleted: true };
|
|
45
58
|
}
|
|
46
|
-
return
|
|
59
|
+
return null;
|
|
47
60
|
}
|
|
61
|
+
// Required methods for DatabaseAdapter interface
|
|
62
|
+
async createUser() { return {}; }
|
|
63
|
+
async findUserByEmail() { return null; }
|
|
64
|
+
async findUserById() { return null; }
|
|
65
|
+
async updateUser() { return {}; }
|
|
66
|
+
async saveRefreshToken() { }
|
|
67
|
+
async findRefreshToken() { return null; }
|
|
68
|
+
async deleteRefreshToken() { }
|
|
48
69
|
}
|
|
49
|
-
describe('CRUD
|
|
50
|
-
let
|
|
51
|
-
beforeEach(() => {
|
|
52
|
-
db = new MockDB();
|
|
53
|
-
});
|
|
54
|
-
it('creates and reads documents with softdelete enabled', async () => {
|
|
55
|
-
const crud = (0, crud_1.createCRUD)(db, { softDelete: true, enforceOwnership: false });
|
|
56
|
-
const user = 'user_1';
|
|
57
|
-
const doc1 = await crud.create('posts', { title: 'Hello', rating: 5 }, user);
|
|
58
|
-
expect(doc1.title).toBe('Hello');
|
|
59
|
-
expect(doc1.userId).toBe(user);
|
|
60
|
-
const doc2 = await crud.create('posts', { title: 'World', rating: 4 }, user);
|
|
61
|
-
let list = await crud.read('posts');
|
|
62
|
-
expect(list.length).toBe(2);
|
|
63
|
-
// Delete one
|
|
64
|
-
await crud.deleteOne('posts', doc1.id);
|
|
65
|
-
list = await crud.read('posts');
|
|
66
|
-
expect(list.length).toBe(1); // One is soft deleted
|
|
67
|
-
// Restore
|
|
68
|
-
await crud.restore('posts', doc1.id);
|
|
69
|
-
list = await crud.read('posts');
|
|
70
|
-
expect(list.length).toBe(2); // Restored
|
|
71
|
-
});
|
|
72
|
-
it('applies complex filters correctly', async () => {
|
|
73
|
-
const crud = (0, crud_1.createCRUD)(db, { enforceOwnership: false });
|
|
74
|
-
await crud.createMany('items', [
|
|
75
|
-
{ category: 'A', price: 10 },
|
|
76
|
-
{ category: 'A', price: 20 },
|
|
77
|
-
{ category: 'B', price: 15 },
|
|
78
|
-
{ category: 'B', price: 5 }
|
|
79
|
-
]);
|
|
80
|
-
const res1 = await crud.read('items', { category: { $in: ['A'] } });
|
|
81
|
-
expect(res1.length).toBe(2);
|
|
82
|
-
const res2 = await crud.read('items', { price: { $gt: 10 } });
|
|
83
|
-
expect(res2.length).toBe(2);
|
|
84
|
-
const res3 = await crud.read('items', {
|
|
85
|
-
$or: [
|
|
86
|
-
{ price: { $lte: 5 } },
|
|
87
|
-
{ category: 'A' }
|
|
88
|
-
]
|
|
89
|
-
});
|
|
90
|
-
expect(res3.length).toBe(3); // A items + price<=5
|
|
91
|
-
});
|
|
92
|
-
it('supports pagination and sorting', async () => {
|
|
93
|
-
const crud = (0, crud_1.createCRUD)(db, { enforceOwnership: false });
|
|
94
|
-
await crud.createMany('scores', [
|
|
95
|
-
{ p: 10 }, { p: 50 }, { p: 20 }, { p: 30 }
|
|
96
|
-
]);
|
|
97
|
-
const page1 = await crud.paginate('scores', {}, 1, 2);
|
|
98
|
-
expect(page1.items.length).toBe(2);
|
|
99
|
-
expect(page1.total).toBe(4);
|
|
100
|
-
expect(page1.totalPages).toBe(2);
|
|
101
|
-
expect(page1.hasNext).toBe(true);
|
|
102
|
-
const sorted = await crud.read('scores', {}, { sort: { p: 'desc' } });
|
|
103
|
-
expect(sorted[0].p).toBe(50);
|
|
104
|
-
expect(sorted[3].p).toBe(10);
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
describe('CRUD Controller', () => {
|
|
70
|
+
describe('CRUD Tests', () => {
|
|
71
|
+
let crud;
|
|
108
72
|
let db;
|
|
109
73
|
beforeEach(() => {
|
|
110
|
-
db = new
|
|
74
|
+
db = new TestAdapter();
|
|
75
|
+
crud = (0, crud_1.createCRUD)(db, { softDelete: false, enforceOwnership: false });
|
|
111
76
|
});
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
req: { user: { id: 'user_1' } },
|
|
117
|
-
json: jest.fn(),
|
|
118
|
-
status: jest.fn().mockReturnThis(),
|
|
119
|
-
...overrides
|
|
77
|
+
it('should create item', async () => {
|
|
78
|
+
const item = await crud.create('products', { name: 'Test', price: 100 });
|
|
79
|
+
expect(item.id).toBeDefined();
|
|
80
|
+
expect(item.name).toBe('Test');
|
|
120
81
|
});
|
|
121
|
-
it('
|
|
122
|
-
|
|
123
|
-
await
|
|
124
|
-
await
|
|
125
|
-
|
|
126
|
-
const model = { adapter, collection: 'posts' };
|
|
127
|
-
const controller = require('./crud').createCrudController(model);
|
|
128
|
-
const ctx = mockCtx({ query: { title: 'A' } });
|
|
129
|
-
await controller.getAll(ctx);
|
|
130
|
-
expect(ctx.json).toHaveBeenCalledWith(expect.arrayContaining([expect.objectContaining({ title: 'A' })]));
|
|
131
|
-
expect(ctx.json.mock.calls[0][0].length).toBe(1);
|
|
82
|
+
it('should read items', async () => {
|
|
83
|
+
await crud.create('products', { name: 'Product 1' });
|
|
84
|
+
await crud.create('products', { name: 'Product 2' });
|
|
85
|
+
const items = await crud.read('products');
|
|
86
|
+
expect(items).toHaveLength(2);
|
|
132
87
|
});
|
|
133
|
-
it('
|
|
134
|
-
const
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
const ctx = mockCtx({ body: { name: 'New Item' } });
|
|
138
|
-
await controller.create(ctx);
|
|
139
|
-
expect(ctx.status).toHaveBeenCalledWith(201);
|
|
140
|
-
expect(ctx.json).toHaveBeenCalledWith(expect.objectContaining({ name: 'New Item', userId: 'user_1' }));
|
|
88
|
+
it('should update item', async () => {
|
|
89
|
+
const created = await crud.create('products', { name: 'Old' });
|
|
90
|
+
const updated = await crud.updateOne('products', created.id, { name: 'New' });
|
|
91
|
+
expect(updated?.name).toBe('New');
|
|
141
92
|
});
|
|
142
|
-
it('
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
await controller.getOne(ctx);
|
|
148
|
-
expect(ctx.status).toHaveBeenCalledWith(404);
|
|
149
|
-
expect(ctx.json).toHaveBeenCalledWith({ error: 'Not Found' });
|
|
93
|
+
it('should delete item', async () => {
|
|
94
|
+
const created = await crud.create('products', { name: 'Delete Me' });
|
|
95
|
+
await crud.deleteOne('products', created.id);
|
|
96
|
+
const items = await crud.read('products');
|
|
97
|
+
expect(items).toHaveLength(0);
|
|
150
98
|
});
|
|
151
|
-
it('
|
|
152
|
-
const
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const ctx = mockCtx({ params: { id: '123' } });
|
|
157
|
-
await controller.delete(ctx);
|
|
158
|
-
expect(ctx.json).toHaveBeenCalledWith(expect.objectContaining({ success: true }));
|
|
159
|
-
const remaining = await adapter.read('items', { id: '123' });
|
|
160
|
-
expect(remaining.length).toBe(0);
|
|
99
|
+
it('should read one item by id', async () => {
|
|
100
|
+
const created = await crud.create('products', { name: 'Find Me' });
|
|
101
|
+
const found = await crud.readOne('products', created.id);
|
|
102
|
+
expect(found).toBeDefined();
|
|
103
|
+
expect(found.name).toBe('Find Me');
|
|
161
104
|
});
|
|
162
105
|
});
|
|
163
106
|
//# sourceMappingURL=crud.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crud.test.js","sourceRoot":"","sources":["../../curd/crud.test.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"crud.test.js","sourceRoot":"","sources":["../../curd/crud.test.ts"],"names":[],"mappings":";;AAAA,oBAAoB;AACpB,iCAAoC;AAEpC,uCAAuC;AACvC,MAAM,WAAW;IACP,IAAI,GAA0B,EAAE,CAAC;IAEzC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,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAE7C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QACnE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAEzD,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
const mongodb_memory_server_1 = require("mongodb-memory-server");
|
|
38
|
+
const server_1 = require("./server/server");
|
|
39
|
+
const crud_1 = require("./curd/crud");
|
|
40
|
+
const mongoose_2 = require("./adapters/mongoose");
|
|
41
|
+
// ===== Mongoose Models =====
|
|
42
|
+
const ProductSchema = new mongoose_1.Schema({
|
|
43
|
+
id: { type: String },
|
|
44
|
+
name: { type: String, required: true },
|
|
45
|
+
price: { type: Number },
|
|
46
|
+
category: { type: String },
|
|
47
|
+
userId: { type: String },
|
|
48
|
+
createdAt: { type: String },
|
|
49
|
+
updatedAt: { type: String },
|
|
50
|
+
}, { timestamps: false });
|
|
51
|
+
const UserSchema = new mongoose_1.Schema({ email: String, password: String });
|
|
52
|
+
const RefreshTokenSchema = new mongoose_1.Schema({ token: String, userId: String });
|
|
53
|
+
const Product = mongoose_1.default.model('Product', ProductSchema);
|
|
54
|
+
const User = mongoose_1.default.model('User', UserSchema);
|
|
55
|
+
const RefreshToken = mongoose_1.default.model('RefreshToken', RefreshTokenSchema);
|
|
56
|
+
async function bootstrap() {
|
|
57
|
+
// 1. Start in-process MongoDB (real Mongoose engine, no external server needed)
|
|
58
|
+
console.log('⏳ MongoDB इन्जिन start गर्दै...');
|
|
59
|
+
const mongod = await mongodb_memory_server_1.MongoMemoryServer.create();
|
|
60
|
+
const uri = mongod.getUri();
|
|
61
|
+
await mongoose_1.default.connect(uri);
|
|
62
|
+
console.log('✅ MongoDB connected:', uri);
|
|
63
|
+
// 2. Build real Mongoose adapter
|
|
64
|
+
const mongoAdapter = (0, mongoose_2.createMongooseAdapter)({
|
|
65
|
+
User,
|
|
66
|
+
RefreshToken,
|
|
67
|
+
models: { Product },
|
|
68
|
+
leanByDefault: true,
|
|
69
|
+
softDelete: false,
|
|
70
|
+
});
|
|
71
|
+
// 3. CRUD service — enforceOwnership: false (auth नचाहिने)
|
|
72
|
+
const service = (0, crud_1.createCRUD)(mongoAdapter, { enforceOwnership: false });
|
|
73
|
+
const COLLECTION = 'Product';
|
|
74
|
+
// 4. Dolphin server
|
|
75
|
+
const app = (0, server_1.createDolphinServer)();
|
|
76
|
+
// ===== CORRECT ROUTE MAPPINGS =====
|
|
77
|
+
// GET all products
|
|
78
|
+
app.get('/products', async (ctx) => {
|
|
79
|
+
const { limit, offset, ...filters } = ctx.query;
|
|
80
|
+
const results = await service.read(COLLECTION, filters, {
|
|
81
|
+
limit: limit ? parseInt(limit) : undefined,
|
|
82
|
+
offset: offset ? parseInt(offset) : undefined,
|
|
83
|
+
});
|
|
84
|
+
ctx.json(results);
|
|
85
|
+
});
|
|
86
|
+
// GET single product by ID
|
|
87
|
+
app.get('/products/:id', async (ctx) => {
|
|
88
|
+
const result = await service.readOne(COLLECTION, ctx.params.id);
|
|
89
|
+
if (!result)
|
|
90
|
+
return ctx.status(404).json({ error: 'Product not found' });
|
|
91
|
+
ctx.json(result);
|
|
92
|
+
});
|
|
93
|
+
// POST create product
|
|
94
|
+
app.post('/products', async (ctx) => {
|
|
95
|
+
const result = await service.create(COLLECTION, ctx.body);
|
|
96
|
+
ctx.status(201).json(result);
|
|
97
|
+
});
|
|
98
|
+
// PUT update product by ID
|
|
99
|
+
app.put('/products/:id', async (ctx) => {
|
|
100
|
+
const result = await service.updateOne(COLLECTION, ctx.params.id, ctx.body);
|
|
101
|
+
if (!result)
|
|
102
|
+
return ctx.status(404).json({ error: 'Product not found' });
|
|
103
|
+
ctx.json(result);
|
|
104
|
+
});
|
|
105
|
+
// DELETE product by ID
|
|
106
|
+
app.delete('/products/:id', async (ctx) => {
|
|
107
|
+
const result = await service.deleteOne(COLLECTION, ctx.params.id);
|
|
108
|
+
if (!result)
|
|
109
|
+
return ctx.status(404).json({ error: 'Product not found' });
|
|
110
|
+
ctx.json({ success: true, deleted: result });
|
|
111
|
+
});
|
|
112
|
+
// ===== Utility Routes =====
|
|
113
|
+
app.get('/api/health', (ctx) => {
|
|
114
|
+
ctx.json({
|
|
115
|
+
status: 'ok',
|
|
116
|
+
db: mongoose_1.default.connection.readyState === 1 ? 'connected' : 'disconnected',
|
|
117
|
+
uptime: process.uptime(),
|
|
118
|
+
timestamp: new Date().toISOString(),
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
app.post('/api/echo', (ctx) => {
|
|
122
|
+
ctx.json({ echo: ctx.body, received_at: new Date().toISOString() });
|
|
123
|
+
});
|
|
124
|
+
app.get('/api/info', (ctx) => {
|
|
125
|
+
ctx.json({
|
|
126
|
+
name: 'Dolphin Framework',
|
|
127
|
+
version: '1.5.5',
|
|
128
|
+
adapter: 'Real Mongoose (mongodb-memory-server)',
|
|
129
|
+
mongoUri: uri,
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
app.get('/', (ctx) => {
|
|
133
|
+
ctx.html(`<!DOCTYPE html>
|
|
134
|
+
<html lang="en">
|
|
135
|
+
<head>
|
|
136
|
+
<meta charset="UTF-8">
|
|
137
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
138
|
+
<title>Dolphin Framework — Mongoose</title>
|
|
139
|
+
<style>
|
|
140
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
141
|
+
body {
|
|
142
|
+
font-family: 'Segoe UI', system-ui, sans-serif;
|
|
143
|
+
background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
|
|
144
|
+
min-height: 100vh; color: #fff; padding: 2rem;
|
|
145
|
+
}
|
|
146
|
+
.container { max-width: 860px; margin: 0 auto; }
|
|
147
|
+
.header { text-align: center; margin-bottom: 2.5rem; }
|
|
148
|
+
.logo { font-size: 4rem; }
|
|
149
|
+
h1 { font-size: 2.3rem; font-weight: 700; margin: 0.5rem 0; }
|
|
150
|
+
.tagline { color: #a0c4d8; font-size: 1rem; }
|
|
151
|
+
.badge {
|
|
152
|
+
display: inline-block; background: rgba(255,255,255,0.1);
|
|
153
|
+
border: 1px solid rgba(255,255,255,0.2); padding: 0.25rem 0.75rem;
|
|
154
|
+
border-radius: 999px; font-size: 0.82rem; margin: 0.2rem;
|
|
155
|
+
}
|
|
156
|
+
.green { border-color: #4ade80; color: #4ade80; }
|
|
157
|
+
.section { margin-bottom: 2rem; }
|
|
158
|
+
.section h2 { font-size: 1rem; color: #7ecfff; margin-bottom: 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.4rem; }
|
|
159
|
+
.ep {
|
|
160
|
+
display: flex; align-items: center; gap: 0.8rem;
|
|
161
|
+
padding: 0.6rem 1rem; background: rgba(255,255,255,0.05);
|
|
162
|
+
border-radius: 8px; margin-bottom: 0.4rem; font-size: 0.87rem;
|
|
163
|
+
}
|
|
164
|
+
.method {
|
|
165
|
+
font-weight: bold; font-size: 0.72rem; padding: 0.2rem 0.45rem;
|
|
166
|
+
border-radius: 4px; min-width: 55px; text-align: center; flex-shrink: 0;
|
|
167
|
+
}
|
|
168
|
+
.get { background: #1a6b3f; color: #4ade80; }
|
|
169
|
+
.post { background: #1a3b6b; color: #60a5fa; }
|
|
170
|
+
.put { background: #5c3a00; color: #fbbf24; }
|
|
171
|
+
.del { background: #6b1a1a; color: #f87171; }
|
|
172
|
+
code { background: rgba(255,255,255,0.1); padding: 0.1rem 0.4rem; border-radius: 3px; font-family: monospace; }
|
|
173
|
+
.note { font-size: 0.8rem; color: #7a9fb0; margin-top: 0.5rem; }
|
|
174
|
+
</style>
|
|
175
|
+
</head>
|
|
176
|
+
<body>
|
|
177
|
+
<div class="container">
|
|
178
|
+
<div class="header">
|
|
179
|
+
<div class="logo">🐬</div>
|
|
180
|
+
<h1>Dolphin Framework</h1>
|
|
181
|
+
<p class="tagline">Real Mongoose Adapter · MongoDB Engine · CRUD Verified</p>
|
|
182
|
+
<div style="margin-top:1rem;">
|
|
183
|
+
<span class="badge green">✅ MongoDB Connected</span>
|
|
184
|
+
<span class="badge">Mongoose ORM</span>
|
|
185
|
+
<span class="badge">enforceOwnership: false</span>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<div class="section">
|
|
190
|
+
<h2>Products CRUD API (Real Mongoose)</h2>
|
|
191
|
+
<div class="ep"><span class="method get">GET</span><code>/products</code><span>सबै products ल्याउनु</span></div>
|
|
192
|
+
<div class="ep"><span class="method get">GET</span><code>/products/:id</code><span>ID बाट एउटा product ल्याउनु</span></div>
|
|
193
|
+
<div class="ep"><span class="method post">POST</span><code>/products</code><span>नयाँ product बनाउनु (body: JSON)</span></div>
|
|
194
|
+
<div class="ep"><span class="method put">PUT</span><code>/products/:id</code><span>ID बाट product update गर्नु</span></div>
|
|
195
|
+
<div class="ep"><span class="method del">DELETE</span><code>/products/:id</code><span>ID बाट product मेटाउनु</span></div>
|
|
196
|
+
<p class="note">* mongodb-memory-server — Real Mongoose engine, server restart भएमा data reset हुन्छ</p>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<div class="section">
|
|
200
|
+
<h2>Utility Endpoints</h2>
|
|
201
|
+
<div class="ep"><span class="method get">GET</span><code>/api/health</code><span>Health + DB status</span></div>
|
|
202
|
+
<div class="ep"><span class="method get">GET</span><code>/api/info</code><span>Framework + adapter info</span></div>
|
|
203
|
+
<div class="ep"><span class="method post">POST</span><code>/api/echo</code><span>Request body echo</span></div>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
</body>
|
|
207
|
+
</html>`);
|
|
208
|
+
});
|
|
209
|
+
// 5. Start server
|
|
210
|
+
const PORT = 5000;
|
|
211
|
+
app.listen(PORT, () => {
|
|
212
|
+
console.log(`🐬 Dolphin + Real Mongoose running at http://0.0.0.0:${PORT}`);
|
|
213
|
+
console.log(` MongoDB URI: ${uri}`);
|
|
214
|
+
console.log(` CRUD: GET/POST /products | GET/PUT/DELETE /products/:id`);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
bootstrap().catch(err => {
|
|
218
|
+
console.error('❌ Bootstrap failed:', err);
|
|
219
|
+
process.exit(1);
|
|
220
|
+
});
|
|
221
|
+
//# sourceMappingURL=demo-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo-server.js","sourceRoot":"","sources":["../demo-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA4C;AAC5C,iEAA0D;AAC1D,4CAAsD;AACtD,sCAAyC;AACzC,kDAA4D;AAE5D,8BAA8B;AAC9B,MAAM,aAAa,GAAG,IAAI,iBAAM,CAAC;IAC/B,EAAE,EAAS,EAAE,IAAI,EAAE,MAAM,EAAE;IAC3B,IAAI,EAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC3C,KAAK,EAAM,EAAE,IAAI,EAAE,MAAM,EAAE;IAC3B,QAAQ,EAAG,EAAE,IAAI,EAAE,MAAM,EAAE;IAC3B,MAAM,EAAK,EAAE,IAAI,EAAE,MAAM,EAAE;IAC3B,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,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