noho-platform 1.0.3 → 1.0.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noho-platform",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "ISC",
@@ -1,6 +0,0 @@
1
- {
2
- "token": "7bu4dSGHP5jlRAPwDxSSyyWkPWKp-SMDyWVeReSgNeE",
3
- "apiKey": "noho_mn32p0wc_0c2b22b0f50585a560589e4c",
4
- "username": "ahmed",
5
- "userId": "3f550d44-2383-45cd-bd12-96d5c16f7fb7"
6
- }
@@ -1,21 +0,0 @@
1
- {
2
- "id": "3f550d44-2383-45cd-bd12-96d5c16f7fb7_1429be93890e6120",
3
- "userId": "3f550d44-2383-45cd-bd12-96d5c16f7fb7",
4
- "route": "/ahmed/welcome",
5
- "shortRoute": "/welcome",
6
- "code": "res.send(\"<h1>Welcome to NOHO!</h1><p>Created by ahmed</p>\")",
7
- "originalCode": "res.send(\"<h1>Welcome to NOHO!</h1><p>Created by ahmed</p>\")",
8
- "analysis": {
9
- "warnings": [],
10
- "changes": []
11
- },
12
- "options": {
13
- "public": true,
14
- "allowApi": true
15
- },
16
- "stats": {
17
- "views": 0,
18
- "lastAccessed": null,
19
- "createdAt": "2026-03-23T12:04:05.614Z"
20
- }
21
- }
@@ -1,20 +0,0 @@
1
- {
2
- "id": "3444499b-de5a-4931-b802-e02a054ef0c1",
3
- "email": "test@test.com",
4
- "username": "test",
5
- "password": "ef797c8118f02dfb649607dd5d3f8c7623048c9c063d532cc95c5ed7a898a64f",
6
- "apiKey": "noho_mn32pieq_15c407b3681e9882c87cc41e",
7
- "createdAt": "2026-03-23T10:59:11.858Z",
8
- "lastLogin": null,
9
- "pages": [],
10
- "stats": {
11
- "requests": 0,
12
- "pagesCreated": 0,
13
- "lastActive": 1774263551858
14
- },
15
- "settings": {
16
- "autoFix": true,
17
- "notifications": true,
18
- "theme": "dark"
19
- }
20
- }
@@ -1,22 +0,0 @@
1
- {
2
- "id": "3f550d44-2383-45cd-bd12-96d5c16f7fb7",
3
- "email": "ahmed@test.com",
4
- "username": "ahmed",
5
- "password": "ef797c8118f02dfb649607dd5d3f8c7623048c9c063d532cc95c5ed7a898a64f",
6
- "apiKey": "noho_mn32p0wc_0c2b22b0f50585a560589e4c",
7
- "createdAt": "2026-03-23T10:58:49.165Z",
8
- "lastLogin": "2026-03-23T12:03:33.321Z",
9
- "pages": [
10
- "3f550d44-2383-45cd-bd12-96d5c16f7fb7_1429be93890e6120"
11
- ],
12
- "stats": {
13
- "requests": 0,
14
- "pagesCreated": 1,
15
- "lastActive": 1774267413323
16
- },
17
- "settings": {
18
- "autoFix": true,
19
- "notifications": true,
20
- "theme": "dark"
21
- }
22
- }
@@ -1,20 +0,0 @@
1
- {
2
- "id": "d4555ad8-9324-4ad3-a485-c234f17c2708",
3
- "email": "ali@test.com",
4
- "username": "ali",
5
- "password": "ef797c8118f02dfb649607dd5d3f8c7623048c9c063d532cc95c5ed7a898a64f",
6
- "apiKey": "noho_mn33mh72_fa58da8ba86f656cb884f1eb",
7
- "createdAt": "2026-03-23T11:24:49.935Z",
8
- "lastLogin": null,
9
- "pages": [],
10
- "stats": {
11
- "requests": 0,
12
- "pagesCreated": 0,
13
- "lastActive": 1774265089935
14
- },
15
- "settings": {
16
- "autoFix": true,
17
- "notifications": true,
18
- "theme": "dark"
19
- }
20
- }
package/test-lib.js DELETED
@@ -1,56 +0,0 @@
1
- const NOHOLibrary = require('./noho-lib');
2
-
3
- async function test() {
4
- console.log('🧪 Testing NOHO Library...\n');
5
-
6
- const lib = new NOHOLibrary({
7
- aiKey: 'test-key',
8
- dbPath: './test_data'
9
- });
10
-
11
- // انتظر التهيئة
12
- await new Promise(r => setTimeout(r, 500));
13
-
14
- try {
15
- // 1. اختبار التسجيل
16
- console.log('1️⃣ Testing register...');
17
- const user = await lib.registerUser('ahmed@test.com', '12345678', 'ahmed');
18
- console.log('✅ User created:', user.username);
19
- console.log(' API Key:', user.apiKey.substring(0, 20) + '...');
20
-
21
- // 2. اختبار تسجيل الدخول
22
- console.log('\n2️⃣ Testing login...');
23
- const login = await lib.loginUser('ahmed@test.com', '12345678');
24
- console.log('✅ Login successful, token:', login.token.substring(0, 20) + '...');
25
-
26
- // 3. اختبار إنشاء صفحة
27
- console.log('\n3️⃣ Testing create page...');
28
- const page = await lib.createPage(
29
- user.userId,
30
- '/hello',
31
- 'res.send("<h1>Hello from NOHO!</h1>")',
32
- { public: true }
33
- );
34
- console.log('✅ Page created:', page.route);
35
- console.log(' ID:', page.id);
36
-
37
- // 4. اختبار استرجاع الصفحة
38
- console.log('\n4️⃣ Testing get page...');
39
- const found = lib.getPageByRoute('/ahmed/hello');
40
- console.log('✅ Page found:', found ? 'YES' : 'NO');
41
- console.log(' Views:', found.stats.views);
42
-
43
- // 5. اختبار الإحصائيات
44
- console.log('\n5️⃣ Testing stats...');
45
- const stats = lib.getUserStats(user.userId);
46
- console.log('✅ Stats:', JSON.stringify(stats, null, 2));
47
-
48
- console.log('\n🎉 All tests passed!');
49
-
50
- } catch (error) {
51
- console.error('\n❌ Test failed:', error.message);
52
- console.error(error.stack);
53
- }
54
- }
55
-
56
- test();
@@ -1,24 +0,0 @@
1
- {
2
- "id": "a019aa48-0caf-478f-927e-266c812eae10_10022dfa5d34936d",
3
- "userId": "a019aa48-0caf-478f-927e-266c812eae10",
4
- "route": "/ahmed/hello",
5
- "shortRoute": "/hello",
6
- "code": "res.send(\"<h1>Hello from NOHO!</h1>\")",
7
- "originalCode": "res.send(\"<h1>Hello from NOHO!</h1>\")",
8
- "analysis": {
9
- "fixed": "res.send(\"<h1>Hello from NOHO!</h1>\")",
10
- "warnings": [
11
- "AI analysis failed"
12
- ],
13
- "changes": []
14
- },
15
- "options": {
16
- "public": true,
17
- "allowApi": true
18
- },
19
- "stats": {
20
- "views": 0,
21
- "lastAccessed": null,
22
- "createdAt": "2026-03-23T11:57:31.495Z"
23
- }
24
- }
@@ -1,22 +0,0 @@
1
- {
2
- "id": "a019aa48-0caf-478f-927e-266c812eae10",
3
- "email": "ahmed@test.com",
4
- "username": "ahmed",
5
- "password": "ef797c8118f02dfb649607dd5d3f8c7623048c9c063d532cc95c5ed7a898a64f",
6
- "apiKey": "noho_mn34sh7f_18e2d399a9501678df3eaf99",
7
- "createdAt": "2026-03-23T11:57:29.500Z",
8
- "lastLogin": "2026-03-23T11:57:29.510Z",
9
- "pages": [
10
- "a019aa48-0caf-478f-927e-266c812eae10_10022dfa5d34936d"
11
- ],
12
- "stats": {
13
- "requests": 0,
14
- "pagesCreated": 1,
15
- "lastActive": 1774267049510
16
- },
17
- "settings": {
18
- "autoFix": true,
19
- "notifications": true,
20
- "theme": "dark"
21
- }
22
- }