nucleus-core-ts 0.8.0 → 0.8.2

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(_0x2178c2,_0x20b0ef){var _0x5bd4f1=_0x2d0e,_0x39f448=_0x2178c2();while(!![]){try{var _0x26cb73=-parseInt(_0x5bd4f1(0xd9))/0x1+parseInt(_0x5bd4f1(0xda))/0x2*(-parseInt(_0x5bd4f1(0xd6))/0x3)+parseInt(_0x5bd4f1(0xd2))/0x4+parseInt(_0x5bd4f1(0xd5))/0x5+parseInt(_0x5bd4f1(0xd4))/0x6*(-parseInt(_0x5bd4f1(0xd3))/0x7)+-parseInt(_0x5bd4f1(0xd1))/0x8+-parseInt(_0x5bd4f1(0xd7))/0x9*(-parseInt(_0x5bd4f1(0xd8))/0xa);if(_0x26cb73===_0x20b0ef)break;else _0x39f448['push'](_0x39f448['shift']());}catch(_0x225291){_0x39f448['push'](_0x39f448['shift']());}}}(_0x5cad,0xdfe40));import{a as _0x446417,b as _0x2496f0,c as _0x4b6a00,d as _0x4bbeaa,e as _0x343a71,f as _0x1e6010,n as _0x8c7229}from'./index-tv67j5qd.js';import'./index-0yyw12k6.js';export{_0x343a71 as generateSystemTableEndpoints,_0x4b6a00 as generateEndpointsFromConfig,_0x4bbeaa as generateAuthEndpoints,_0x1e6010 as generateAllEndpoints,_0x8c7229 as createServerFactory,_0x446417 as createApiHook,_0x2496f0 as AUTH_ENDPOINT_CONFIGS};function _0x2d0e(_0x4fe3e2,_0x459558){_0x4fe3e2=_0x4fe3e2-0xd1;var _0x5cadfb=_0x5cad();var _0x2d0e45=_0x5cadfb[_0x4fe3e2];if(_0x2d0e['wIcOJo']===undefined){var _0x4c68f3=function(_0x361687){var _0x50ea2e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x446417='',_0x2496f0='';for(var _0x4b6a00=0x0,_0x4bbeaa,_0x343a71,_0x1e6010=0x0;_0x343a71=_0x361687['charAt'](_0x1e6010++);~_0x343a71&&(_0x4bbeaa=_0x4b6a00%0x4?_0x4bbeaa*0x40+_0x343a71:_0x343a71,_0x4b6a00++%0x4)?_0x446417+=String['fromCharCode'](0xff&_0x4bbeaa>>(-0x2*_0x4b6a00&0x6)):0x0){_0x343a71=_0x50ea2e['indexOf'](_0x343a71);}for(var _0x8c7229=0x0,_0x569444=_0x446417['length'];_0x8c7229<_0x569444;_0x8c7229++){_0x2496f0+='%'+('00'+_0x446417['charCodeAt'](_0x8c7229)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2496f0);};_0x2d0e['yxsYbs']=_0x4c68f3,_0x2d0e['LAhVdI']={},_0x2d0e['wIcOJo']=!![];}var _0x45b07d=_0x5cadfb[0x0],_0x5050b1=_0x4fe3e2+_0x45b07d,_0x4a2007=_0x2d0e['LAhVdI'][_0x5050b1];return!_0x4a2007?(_0x2d0e45=_0x2d0e['yxsYbs'](_0x2d0e45),_0x2d0e['LAhVdI'][_0x5050b1]=_0x2d0e45):_0x2d0e45=_0x4a2007,_0x2d0e45;}function _0x5cad(){var _0x12ab32=['mJGXodm2DevOzhjN','nda3ndDRAK1cEuK','mte4mMrytMrWyW','oduWmdm4mgTjCe9oEa','mZqYufHVq2n2','mJu0mZGYntDQCxreBLa','mtbzqwHbq1G','mJu0nJK3v0ngD1bs','mtCXotHuDKfODKS','mtaZodu4ntzzB2n3tLG'];_0x5cad=function(){return _0x12ab32;};return _0x5cad();}
@@ -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