nucleus-core-ts 0.8.0 → 0.8.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.
Files changed (33) hide show
  1. package/README.md +84 -14
  2. package/dist/client.js +1 -1
  3. package/dist/dist/index.d.ts +3 -3
  4. package/dist/fe/index.js +1 -1
  5. package/dist/index-0yyw12k6.js +1 -1
  6. package/dist/index-tv67j5qd.js +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/infra/scripts/nucleus-init.d.ts +3 -0
  9. package/dist/infra/templates/backend/src/index.d.ts +2 -0
  10. package/dist/infra/templates/frontend/app/change-password/page.d.ts +2 -0
  11. package/dist/infra/templates/frontend/app/devices/page.d.ts +2 -0
  12. package/dist/infra/templates/frontend/app/forgot-password/page.d.ts +2 -0
  13. package/dist/infra/templates/frontend/app/layout.d.ts +7 -0
  14. package/dist/infra/templates/frontend/app/login/page.d.ts +2 -0
  15. package/dist/infra/templates/frontend/app/page.d.ts +2 -0
  16. package/dist/infra/templates/frontend/app/profile/page.d.ts +2 -0
  17. package/dist/infra/templates/frontend/app/register/page.d.ts +2 -0
  18. package/dist/infra/templates/frontend/app/reset-password/page.d.ts +2 -0
  19. package/dist/infra/templates/frontend/app/set-password/page.d.ts +2 -0
  20. package/dist/infra/templates/frontend/app/verify-email/page.d.ts +2 -0
  21. package/dist/infra/templates/frontend/app/verify-magic-link/page.d.ts +2 -0
  22. package/dist/infra/templates/frontend/lib/api/endpoints.d.ts +10 -0
  23. package/dist/infra/templates/frontend/lib/api/factory.d.ts +2 -0
  24. package/dist/infra/templates/frontend/lib/api/hook.d.ts +4 -0
  25. package/dist/infra/templates/frontend/next.config.d.ts +4 -0
  26. package/dist/infra/templates/frontend/postcss.config.d.mts +7 -0
  27. package/dist/infra/templates/frontend/server.d.ts +4 -0
  28. package/dist/src/Client/Proxy/index.js +1 -1
  29. package/dist/src/types.d.ts +1 -1
  30. package/package.json +2 -2
  31. package/schemas/config.nucleus.json +1027 -1009
  32. package/schemas/nucleus.tables.schema.json +20 -18
  33. package/schemas/table.schema.json +529 -497
package/README.md CHANGED
@@ -134,33 +134,103 @@ import { ... } from "nucleus-core-ts/proxy";
134
134
 
135
135
  ## Configuration
136
136
 
137
- Create a `nucleus.config.json` in your project root:
137
+ Create a `config.nucleus.json` in your project root:
138
138
 
139
139
  ```json
140
140
  {
141
+ "$schema": "node_modules/nucleus-core-ts/schemas/config.nucleus.json",
142
+ "appId": "my-app",
143
+ "mode": "development",
144
+
141
145
  "database": {
142
- "host": "localhost",
143
- "port": 5432,
144
- "database": "myapp",
145
- "user": "postgres",
146
- "password": "secret"
146
+ "url": "DATABASE_URL",
147
+ "type": "postgres",
148
+ "isMultiTenant": false,
149
+ "schemas": ["main"]
147
150
  },
151
+
148
152
  "redis": {
149
- "host": "localhost",
150
- "port": 6379
153
+ "url": "REDIS_URL"
151
154
  },
152
- "auth": {
153
- "jwtSecret": "your-secret-key",
154
- "accessTokenExpiry": "15m",
155
- "refreshTokenExpiry": "7d"
155
+
156
+ "authentication": {
157
+ "enabled": true,
158
+ "accessToken": {
159
+ "secret": "JWT_SECRET",
160
+ "expiresIn": "15m",
161
+ "algorithm": "HS256"
162
+ },
163
+ "refreshToken": {
164
+ "secret": "JWT_REFRESH_SECRET",
165
+ "expiresIn": "7d"
166
+ },
167
+ "login": { "enabled": true },
168
+ "register": { "enabled": true },
169
+ "logout": { "enabled": true },
170
+ "sessions": {
171
+ "enabled": true,
172
+ "maxActiveSessions": 5,
173
+ "allowMultipleDevices": true
174
+ }
175
+ },
176
+
177
+ "authorization": {
178
+ "enabled": true,
179
+ "autoSeedClaims": true,
180
+ "godminEmail": "admin@example.com"
181
+ },
182
+
183
+ "rateLimit": {
184
+ "enabled": true,
185
+ "strategy": "sliding-window",
186
+ "authRoutes": {
187
+ "login": { "window": "1m", "max": 5 },
188
+ "register": { "window": "1h", "max": 10 }
189
+ }
156
190
  },
191
+
157
192
  "monitoring": {
158
193
  "enabled": true,
159
- "metricsInterval": 60000
160
- }
194
+ "system": {
195
+ "enabled": true,
196
+ "collectInterval": "30s",
197
+ "metrics": { "cpu": true, "memory": true, "disk": true }
198
+ },
199
+ "alerts": {
200
+ "enabled": true,
201
+ "thresholds": {
202
+ "cpuPercent": 80,
203
+ "memoryPercent": 85
204
+ }
205
+ }
206
+ },
207
+
208
+ "storage": {
209
+ "enabled": true,
210
+ "basePath": "./uploads",
211
+ "maxFileSizeBytes": 10485760,
212
+ "cdn": { "enabled": true }
213
+ },
214
+
215
+ "entities": []
161
216
  }
162
217
  ```
163
218
 
219
+ ### Config Options
220
+
221
+ | Section | Description |
222
+ |---------|-------------|
223
+ | **database** | PostgreSQL connection, multi-tenant support |
224
+ | **redis** | Redis connection, Dapr integration |
225
+ | **authentication** | JWT tokens, sessions, login/register/logout routes |
226
+ | **authorization** | Role-based access, auto claim generation |
227
+ | **rateLimit** | Request throttling per route/user/IP |
228
+ | **monitoring** | System metrics, alerts, streaming endpoints |
229
+ | **storage** | File uploads, CDN serving |
230
+ | **notification** | Email & platform notifications |
231
+ | **verification** | Approval workflows with signatures |
232
+ | **audit** | Action logging per operation type |
233
+
164
234
  ## License
165
235
 
166
236
  This is proprietary software. See [LICENSE](./LICENSE) for details.
package/dist/client.js CHANGED
@@ -1 +1 @@
1
- (function(_0x471ab0,_0x59bb55){var _0x21c42d=_0x1dba,_0x6da842=_0x471ab0();while(!![]){try{var _0x3c6c04=-parseInt(_0x21c42d(0x1c5))/0x1+parseInt(_0x21c42d(0x1c7))/0x2+-parseInt(_0x21c42d(0x1c6))/0x3+parseInt(_0x21c42d(0x1cb))/0x4+parseInt(_0x21c42d(0x1c9))/0x5*(parseInt(_0x21c42d(0x1cd))/0x6)+parseInt(_0x21c42d(0x1ca))/0x7+parseInt(_0x21c42d(0x1cc))/0x8*(-parseInt(_0x21c42d(0x1c8))/0x9);if(_0x3c6c04===_0x59bb55)break;else _0x6da842['push'](_0x6da842['shift']());}catch(_0x27423b){_0x6da842['push'](_0x6da842['shift']());}}}(_0x36e8,0x6749e));import{a as _0x4ce071,b as _0x1d2e1b,c as _0x3d7102,d as _0x11c979,e as _0x1cd888,f as _0x39546d,n as _0x65a212}from'./index-tv67j5qd.js';import'./index-0yyw12k6.js';function _0x1dba(_0x36276c,_0xc1a590){_0x36276c=_0x36276c-0x1c5;var _0x36e8d5=_0x36e8();var _0x1dba44=_0x36e8d5[_0x36276c];if(_0x1dba['NHVNMe']===undefined){var _0x130d51=function(_0x5a6f1a){var _0x3acd59='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x4ce071='',_0x1d2e1b='';for(var _0x3d7102=0x0,_0x11c979,_0x1cd888,_0x39546d=0x0;_0x1cd888=_0x5a6f1a['charAt'](_0x39546d++);~_0x1cd888&&(_0x11c979=_0x3d7102%0x4?_0x11c979*0x40+_0x1cd888:_0x1cd888,_0x3d7102++%0x4)?_0x4ce071+=String['fromCharCode'](0xff&_0x11c979>>(-0x2*_0x3d7102&0x6)):0x0){_0x1cd888=_0x3acd59['indexOf'](_0x1cd888);}for(var _0x65a212=0x0,_0x223d63=_0x4ce071['length'];_0x65a212<_0x223d63;_0x65a212++){_0x1d2e1b+='%'+('00'+_0x4ce071['charCodeAt'](_0x65a212)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1d2e1b);};_0x1dba['pfVNlq']=_0x130d51,_0x1dba['oZAhgX']={},_0x1dba['NHVNMe']=!![];}var _0x22342d=_0x36e8d5[0x0],_0x4eb212=_0x36276c+_0x22342d,_0x3f8359=_0x1dba['oZAhgX'][_0x4eb212];return!_0x3f8359?(_0x1dba44=_0x1dba['pfVNlq'](_0x1dba44),_0x1dba['oZAhgX'][_0x4eb212]=_0x1dba44):_0x1dba44=_0x3f8359,_0x1dba44;}function _0x36e8(){var _0x1062d9=['mJm5mdm1ohr1AwTtyq','mtuZmdq0ofL1yxvmwG','nty3AevHCvfR','odvWCwnPze0','mJm2nJuWnfr0Au51rW','mJe0nJa4mfHZuLfxzG','nJq3mJHos1nKEuG','nde4mJz5wMXMBNO','mJG3mZrst2TVrwm'];_0x36e8=function(){return _0x1062d9;};return _0x36e8();}export{_0x1cd888 as generateSystemTableEndpoints,_0x3d7102 as generateEndpointsFromConfig,_0x11c979 as generateAuthEndpoints,_0x39546d as generateAllEndpoints,_0x65a212 as createServerFactory,_0x4ce071 as createApiHook,_0x1d2e1b as AUTH_ENDPOINT_CONFIGS};
1
+ function _0xc32b(_0x4c6beb,_0x1ad2cd){_0x4c6beb=_0x4c6beb-0xcc;var _0x51a6dd=_0x51a6();var _0xc32bc3=_0x51a6dd[_0x4c6beb];if(_0xc32b['MndKJl']===undefined){var _0x5c14d2=function(_0x2753a6){var _0x2a5748='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1a09df='',_0xdf14d8='';for(var _0x36f63d=0x0,_0x4faec1,_0x19d418,_0x585919=0x0;_0x19d418=_0x2753a6['charAt'](_0x585919++);~_0x19d418&&(_0x4faec1=_0x36f63d%0x4?_0x4faec1*0x40+_0x19d418:_0x19d418,_0x36f63d++%0x4)?_0x1a09df+=String['fromCharCode'](0xff&_0x4faec1>>(-0x2*_0x36f63d&0x6)):0x0){_0x19d418=_0x2a5748['indexOf'](_0x19d418);}for(var _0x12107e=0x0,_0x5bf707=_0x1a09df['length'];_0x12107e<_0x5bf707;_0x12107e++){_0xdf14d8+='%'+('00'+_0x1a09df['charCodeAt'](_0x12107e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xdf14d8);};_0xc32b['tjcdxC']=_0x5c14d2,_0xc32b['dfKkmn']={},_0xc32b['MndKJl']=!![];}var _0x37e39f=_0x51a6dd[0x0],_0x494649=_0x4c6beb+_0x37e39f,_0x3c2dcb=_0xc32b['dfKkmn'][_0x494649];return!_0x3c2dcb?(_0xc32bc3=_0xc32b['tjcdxC'](_0xc32bc3),_0xc32b['dfKkmn'][_0x494649]=_0xc32bc3):_0xc32bc3=_0x3c2dcb,_0xc32bc3;}(function(_0x5f1cfe,_0x360f9a){var _0x23a582=_0xc32b,_0x1c9408=_0x5f1cfe();while(!![]){try{var _0xbb6539=-parseInt(_0x23a582(0xd6))/0x1*(parseInt(_0x23a582(0xcc))/0x2)+-parseInt(_0x23a582(0xd5))/0x3+-parseInt(_0x23a582(0xcd))/0x4*(parseInt(_0x23a582(0xd0))/0x5)+-parseInt(_0x23a582(0xd3))/0x6*(-parseInt(_0x23a582(0xd2))/0x7)+-parseInt(_0x23a582(0xcf))/0x8+parseInt(_0x23a582(0xd4))/0x9*(-parseInt(_0x23a582(0xd1))/0xa)+parseInt(_0x23a582(0xce))/0xb;if(_0xbb6539===_0x360f9a)break;else _0x1c9408['push'](_0x1c9408['shift']());}catch(_0x448b02){_0x1c9408['push'](_0x1c9408['shift']());}}}(_0x51a6,0xec4d0));import{a as _0x1a09df,b as _0xdf14d8,c as _0x36f63d,d as _0x4faec1,e as _0x19d418,f as _0x585919,n as _0x12107e}from'./index-tv67j5qd.js';function _0x51a6(){var _0x422fdf=['ntK0ote2mtLzDfL1vhi','mJu1mdy4mhbXAKPSwq','mZq1wK14tvLy','mJbZD1nNAKi','mZvuuhH5tNC','nJKYodq0Eej2rfby','ody5ndi0m1nvv0XcyW','mJi1mtaWnwvjuNnTsG','ntKZnJy5EfvxufbH','mMvvC2DOAq','odi0odHHuMnezxm'];_0x51a6=function(){return _0x422fdf;};return _0x51a6();}import'./index-0yyw12k6.js';export{_0x19d418 as generateSystemTableEndpoints,_0x36f63d as generateEndpointsFromConfig,_0x4faec1 as generateAuthEndpoints,_0x585919 as generateAllEndpoints,_0x12107e as createServerFactory,_0x1a09df as createApiHook,_0xdf14d8 as AUTH_ENDPOINT_CONFIGS};
@@ -1,9 +1,9 @@
1
1
  import { m as xm } from "./index-tv67j5qd.js";
2
- import { e as eO } from "./index-tv67j5qd.js";
2
+ import { e as uO } from "./index-tv67j5qd.js";
3
3
  import { c as RO } from "./index-tv67j5qd.js";
4
4
  import { d as kO } from "./index-tv67j5qd.js";
5
5
  import { f as MO } from "./index-tv67j5qd.js";
6
- import { n as uO } from "./index-tv67j5qd.js";
6
+ import { n as eO } from "./index-tv67j5qd.js";
7
7
  import { a as $O } from "./index-tv67j5qd.js";
8
8
  import { l as Cm } from "./index-tv67j5qd.js";
9
9
  declare function o9(r: any): Promise<Td<"", {
@@ -36,5 +36,5 @@ declare function o9(r: any): Promise<Td<"", {
36
36
  }>>;
37
37
  import { b as AO } from "./index-tv67j5qd.js";
38
38
  import Td from "elysia";
39
- export { xm as serverFetch, eO as generateSystemTableEndpoints, RO as generateEndpointsFromConfig, kO as generateAuthEndpoints, MO as generateAllEndpoints, uO as createServerFactory, $O as createApiHook, Cm as ServerFetch, o9 as NucleusElysiaPlugin, AO as AUTH_ENDPOINT_CONFIGS };
39
+ export { xm as serverFetch, uO as generateSystemTableEndpoints, RO as generateEndpointsFromConfig, kO as generateAuthEndpoints, MO as generateAllEndpoints, eO as createServerFactory, $O as createApiHook, Cm as ServerFetch, o9 as NucleusElysiaPlugin, AO as AUTH_ENDPOINT_CONFIGS };
40
40
  //# sourceMappingURL=index.d.ts.map