@qwickapps/server 1.5.2 → 1.6.0

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 (80) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/core/control-panel.js +8 -8
  3. package/dist/core/control-panel.js.map +1 -1
  4. package/dist/plugins/api-keys/api-keys-plugin.d.ts +46 -0
  5. package/dist/plugins/api-keys/api-keys-plugin.d.ts.map +1 -0
  6. package/dist/plugins/api-keys/api-keys-plugin.js +329 -0
  7. package/dist/plugins/api-keys/api-keys-plugin.js.map +1 -0
  8. package/dist/plugins/api-keys/index.d.ts +14 -0
  9. package/dist/plugins/api-keys/index.d.ts.map +1 -0
  10. package/dist/plugins/api-keys/index.js +17 -0
  11. package/dist/plugins/api-keys/index.js.map +1 -0
  12. package/dist/plugins/api-keys/middleware/bearer-token-auth.d.ts +74 -0
  13. package/dist/plugins/api-keys/middleware/bearer-token-auth.d.ts.map +1 -0
  14. package/dist/plugins/api-keys/middleware/bearer-token-auth.js +201 -0
  15. package/dist/plugins/api-keys/middleware/bearer-token-auth.js.map +1 -0
  16. package/dist/plugins/api-keys/middleware/index.d.ts +7 -0
  17. package/dist/plugins/api-keys/middleware/index.d.ts.map +1 -0
  18. package/dist/plugins/api-keys/middleware/index.js +7 -0
  19. package/dist/plugins/api-keys/middleware/index.js.map +1 -0
  20. package/dist/plugins/api-keys/stores/index.d.ts +7 -0
  21. package/dist/plugins/api-keys/stores/index.d.ts.map +1 -0
  22. package/dist/plugins/api-keys/stores/index.js +7 -0
  23. package/dist/plugins/api-keys/stores/index.js.map +1 -0
  24. package/dist/plugins/api-keys/stores/postgres-store.d.ts +34 -0
  25. package/dist/plugins/api-keys/stores/postgres-store.d.ts.map +1 -0
  26. package/dist/plugins/api-keys/stores/postgres-store.js +360 -0
  27. package/dist/plugins/api-keys/stores/postgres-store.js.map +1 -0
  28. package/dist/plugins/api-keys/types.d.ts +268 -0
  29. package/dist/plugins/api-keys/types.d.ts.map +1 -0
  30. package/dist/plugins/api-keys/types.js +56 -0
  31. package/dist/plugins/api-keys/types.js.map +1 -0
  32. package/dist/plugins/auth/auth-plugin.js +1 -1
  33. package/dist/plugins/auth/auth-plugin.js.map +1 -1
  34. package/dist/plugins/auth/env-config.js +2 -2
  35. package/dist/plugins/auth/env-config.js.map +1 -1
  36. package/dist/plugins/frontend-app-plugin.d.ts.map +1 -1
  37. package/dist/plugins/frontend-app-plugin.js +5 -2
  38. package/dist/plugins/frontend-app-plugin.js.map +1 -1
  39. package/dist/plugins/users/__tests__/postgres-store.test.js +1 -0
  40. package/dist/plugins/users/__tests__/postgres-store.test.js.map +1 -1
  41. package/dist/plugins/users/__tests__/users-plugin.test.js +3 -0
  42. package/dist/plugins/users/__tests__/users-plugin.test.js.map +1 -1
  43. package/dist/plugins/users/stores/postgres-store.d.ts.map +1 -1
  44. package/dist/plugins/users/stores/postgres-store.js +59 -1
  45. package/dist/plugins/users/stores/postgres-store.js.map +1 -1
  46. package/dist/plugins/users/types.d.ts +22 -0
  47. package/dist/plugins/users/types.d.ts.map +1 -1
  48. package/dist-ui/assets/index-5nX8fM1a.js +469 -0
  49. package/dist-ui/assets/index-5nX8fM1a.js.map +1 -0
  50. package/dist-ui/index.html +1 -1
  51. package/dist-ui-lib/api/controlPanelApi.d.ts +62 -0
  52. package/dist-ui-lib/components/index.d.ts +2 -1
  53. package/dist-ui-lib/index.js +2588 -2238
  54. package/dist-ui-lib/index.js.map +1 -1
  55. package/dist-ui-lib/pages/APIKeysPage.d.ts +13 -0
  56. package/dist-ui-lib/pages/AcceptInvitationPage.d.ts +28 -0
  57. package/package.json +3 -2
  58. package/src/core/control-panel.ts +8 -8
  59. package/src/plugins/api-keys/api-keys-plugin.ts +397 -0
  60. package/src/plugins/api-keys/index.ts +49 -0
  61. package/src/plugins/api-keys/middleware/bearer-token-auth.ts +250 -0
  62. package/src/plugins/api-keys/middleware/index.ts +12 -0
  63. package/src/plugins/api-keys/stores/index.ts +7 -0
  64. package/src/plugins/api-keys/stores/postgres-store.ts +487 -0
  65. package/src/plugins/api-keys/types.ts +243 -0
  66. package/src/plugins/auth/auth-plugin.ts +1 -1
  67. package/src/plugins/auth/env-config.ts +2 -2
  68. package/src/plugins/frontend-app-plugin.ts +7 -2
  69. package/src/plugins/users/__tests__/postgres-store.test.ts +1 -0
  70. package/src/plugins/users/__tests__/users-plugin.test.ts +3 -0
  71. package/src/plugins/users/stores/postgres-store.ts +69 -0
  72. package/src/plugins/users/types.ts +25 -0
  73. package/ui/src/App.tsx +6 -1
  74. package/ui/src/api/controlPanelApi.ts +157 -0
  75. package/ui/src/components/index.ts +6 -0
  76. package/ui/src/pages/APIKeysPage.tsx +661 -0
  77. package/ui/src/pages/AcceptInvitationPage.tsx +169 -0
  78. package/ui/src/pages/UsersPage.tsx +225 -2
  79. package/dist-ui/assets/index-BfC7mG5L.js +0 -469
  80. package/dist-ui/assets/index-BfC7mG5L.js.map +0 -1
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Control Panel</title>
7
- <script type="module" crossorigin src="/assets/index-BfC7mG5L.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-5nX8fM1a.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-CiizQQnb.css">
9
9
  </head>
10
10
  <body>
@@ -73,10 +73,14 @@ export interface LogSource {
73
73
  type: 'file' | 'api';
74
74
  available: boolean;
75
75
  }
76
+ export type UserStatus = 'invited' | 'active' | 'suspended';
76
77
  export interface User {
77
78
  id: string;
78
79
  email: string;
79
80
  name?: string;
81
+ status: UserStatus;
82
+ invitation_token?: string;
83
+ invitation_expires_at?: string;
80
84
  created_at?: string;
81
85
  updated_at?: string;
82
86
  last_login?: string;
@@ -88,6 +92,26 @@ export interface UsersResponse {
88
92
  page: number;
89
93
  limit: number;
90
94
  }
95
+ export interface InviteUserRequest {
96
+ email: string;
97
+ name?: string;
98
+ role?: string;
99
+ metadata?: Record<string, unknown>;
100
+ expiresInDays?: number;
101
+ }
102
+ export interface InvitationResponse {
103
+ user: User;
104
+ token: string;
105
+ inviteLink: string;
106
+ expiresAt: string;
107
+ }
108
+ export interface AcceptInvitationRequest {
109
+ token: string;
110
+ }
111
+ export interface AcceptInvitationResponse {
112
+ success: boolean;
113
+ user: User;
114
+ }
91
115
  export interface Ban {
92
116
  id: string;
93
117
  user_id?: string;
@@ -101,6 +125,36 @@ export interface BansResponse {
101
125
  bans: Ban[];
102
126
  total: number;
103
127
  }
128
+ export interface ApiKey {
129
+ id: string;
130
+ name: string;
131
+ key_prefix: string;
132
+ key_type: 'm2m' | 'pat';
133
+ scopes: Array<'read' | 'write' | 'admin'>;
134
+ last_used_at: string | null;
135
+ expires_at: string | null;
136
+ is_active: boolean;
137
+ created_at: string;
138
+ updated_at: string;
139
+ }
140
+ export interface ApiKeyWithPlaintext extends ApiKey {
141
+ key: string;
142
+ }
143
+ export interface ApiKeysResponse {
144
+ keys: ApiKey[];
145
+ }
146
+ export interface CreateApiKeyRequest {
147
+ name: string;
148
+ key_type: 'm2m' | 'pat';
149
+ scopes: Array<'read' | 'write' | 'admin'>;
150
+ expires_at?: string;
151
+ }
152
+ export interface UpdateApiKeyRequest {
153
+ name?: string;
154
+ scopes?: Array<'read' | 'write' | 'admin'>;
155
+ expires_at?: string;
156
+ is_active?: boolean;
157
+ }
104
158
  export interface EntitlementDefinition {
105
159
  id: string;
106
160
  name: string;
@@ -399,6 +453,9 @@ declare class ControlPanelApi {
399
453
  search?: string;
400
454
  }): Promise<UsersResponse>;
401
455
  getUserById(id: string): Promise<User>;
456
+ inviteUser(request: InviteUserRequest): Promise<InvitationResponse>;
457
+ acceptInvitation(token: string): Promise<AcceptInvitationResponse>;
458
+ getInvitations(): Promise<UsersResponse>;
402
459
  getBans(): Promise<BansResponse>;
403
460
  banUser(email: string, reason: string, expiresAt?: string): Promise<void>;
404
461
  unbanUser(email: string): Promise<void>;
@@ -466,6 +523,11 @@ declare class ControlPanelApi {
466
523
  success: boolean;
467
524
  message: string;
468
525
  }>;
526
+ getApiKeys(): Promise<ApiKeysResponse>;
527
+ createApiKey(request: CreateApiKeyRequest): Promise<ApiKeyWithPlaintext>;
528
+ getApiKey(keyId: string): Promise<ApiKey>;
529
+ updateApiKey(keyId: string, updates: UpdateApiKeyRequest): Promise<ApiKey>;
530
+ deleteApiKey(keyId: string): Promise<void>;
469
531
  }
470
532
  export declare const api: ControlPanelApi;
471
533
  export {};
@@ -13,6 +13,7 @@ export { SystemPage } from '../pages/SystemPage';
13
13
  export { NotFoundPage } from '../pages/NotFoundPage';
14
14
  export { UsersPage, type UsersPageProps } from '../pages/UsersPage';
15
15
  export { EntitlementsPage, type EntitlementsPageProps } from '../pages/EntitlementsPage';
16
+ export { AcceptInvitationPage, type AcceptInvitationPageProps } from '../pages/AcceptInvitationPage';
16
17
  export { DashboardWidgetProvider, useDashboardWidgets, useRegisterWidget, DashboardWidgetRenderer, type DashboardWidget, type DashboardWidgetProviderProps, WidgetComponentRegistryProvider, useWidgetComponentRegistry, PluginWidgetRenderer, getBuiltInWidgetComponents, ServiceHealthWidget, type WidgetComponent, type WidgetComponentRegistryProviderProps, } from '../dashboard';
17
18
  export { api } from '../api/controlPanelApi';
18
- export type { HealthCheck, HealthResponse, InfoResponse, DiagnosticsResponse, ConfigResponse, LogEntry, LogsResponse, LogSource, User, UsersResponse, Ban, BansResponse, EntitlementDefinition, EntitlementResult, EntitlementSourceInfo, EntitlementsStatus, PluginFeatures, } from '../api/controlPanelApi';
19
+ export type { HealthCheck, HealthResponse, InfoResponse, DiagnosticsResponse, ConfigResponse, LogEntry, LogsResponse, LogSource, UserStatus, User, UsersResponse, InviteUserRequest, InvitationResponse, AcceptInvitationRequest, AcceptInvitationResponse, Ban, BansResponse, EntitlementDefinition, EntitlementResult, EntitlementSourceInfo, EntitlementsStatus, PluginFeatures, } from '../api/controlPanelApi';