@zintrust/core 0.7.3 → 0.7.8

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 (38) hide show
  1. package/package.json +1 -1
  2. package/src/auth/LoginFlow.d.ts +7 -1
  3. package/src/auth/LoginFlow.d.ts.map +1 -1
  4. package/src/auth/LoginFlow.js +100 -2
  5. package/src/cli/OptionalCliExtensions.d.ts.map +1 -1
  6. package/src/cli/OptionalCliExtensions.js +13 -1
  7. package/src/cli/commands/RoutesCommand.d.ts.map +1 -1
  8. package/src/cli/commands/RoutesCommand.js +39 -2
  9. package/src/cli/commands/schedule/ScheduleCliSupport.d.ts.map +1 -1
  10. package/src/cli/commands/schedule/ScheduleCliSupport.js +52 -11
  11. package/src/cli/scaffolding/ProjectScaffolder.d.ts.map +1 -1
  12. package/src/cli/scaffolding/ProjectScaffolder.js +45 -6
  13. package/src/cli/utils/spawn.d.ts.map +1 -1
  14. package/src/cli/utils/spawn.js +19 -13
  15. package/src/config/env.d.ts +2 -0
  16. package/src/config/env.d.ts.map +1 -1
  17. package/src/config/env.js +2 -0
  18. package/src/config/logger.d.ts +10 -12
  19. package/src/config/logger.d.ts.map +1 -1
  20. package/src/config/logger.js +6 -3
  21. package/src/http/Request.d.ts +1 -0
  22. package/src/http/Request.d.ts.map +1 -1
  23. package/src/http/Request.js +3 -0
  24. package/src/index.d.ts +2 -1
  25. package/src/index.d.ts.map +1 -1
  26. package/src/index.js +4 -3
  27. package/src/middleware/BulletproofAuthMiddleware.d.ts.map +1 -1
  28. package/src/middleware/BulletproofAuthMiddleware.js +7 -1
  29. package/src/proxy/ProxyServerUtils.d.ts.map +1 -1
  30. package/src/proxy/ProxyServerUtils.js +6 -2
  31. package/src/runtime/useFileLoader.d.ts +5 -0
  32. package/src/runtime/useFileLoader.d.ts.map +1 -1
  33. package/src/runtime/useFileLoader.js +58 -37
  34. package/src/security/BulletproofDeviceStore.d.ts +18 -0
  35. package/src/security/BulletproofDeviceStore.d.ts.map +1 -0
  36. package/src/security/BulletproofDeviceStore.js +132 -0
  37. package/src/templates/project/basic/app/Controllers/AuthController.ts.tpl +23 -9
  38. package/src/templates/project/basic/database/migrations/20260419000000_create_bulletproof_devices_table.ts.tpl +36 -0
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Migration: CreateBulletproofDevicesTable
3
+ * Creates the core-backed device store used by Bulletproof authentication.
4
+ */
5
+ import type { Blueprint, IDatabase } from '@zintrust/core';
6
+ import { MigrationSchema } from '@zintrust/core';
7
+
8
+ export interface Migration {
9
+ up(db: IDatabase): Promise<void>;
10
+ down(db: IDatabase): Promise<void>;
11
+ }
12
+
13
+ export const migration: Migration = {
14
+ async up(db: IDatabase): Promise<void> {
15
+ const schema = MigrationSchema.create(db);
16
+
17
+ await schema.create('zintrust_bulletproof_devices', (table: Blueprint) => {
18
+ table.id();
19
+ table.string('user_id', 191).nullable();
20
+ table.string('device_id', 191).unique();
21
+ table.text('signing_secret');
22
+ table.text('user_agent').nullable();
23
+ table.timestamp('last_seen_at').notNullable().default('CURRENT_TIMESTAMP');
24
+ table.timestamp('created_at').notNullable().default('CURRENT_TIMESTAMP');
25
+ table.timestamp('updated_at').notNullable().default('CURRENT_TIMESTAMP');
26
+
27
+ table.index(['user_id']);
28
+ table.index(['last_seen_at']);
29
+ });
30
+ },
31
+
32
+ async down(db: IDatabase): Promise<void> {
33
+ const schema = MigrationSchema.create(db);
34
+ await schema.dropIfExists('zintrust_bulletproof_devices');
35
+ },
36
+ };