@qwickapps/server 1.5.1 → 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.
- package/CHANGELOG.md +43 -0
- package/dist/core/control-panel.d.ts.map +1 -1
- package/dist/core/control-panel.js +41 -0
- package/dist/core/control-panel.js.map +1 -1
- package/dist/core/guards.d.ts.map +1 -1
- package/dist/core/guards.js +77 -0
- package/dist/core/guards.js.map +1 -1
- package/dist/core/health-manager.d.ts +4 -0
- package/dist/core/health-manager.d.ts.map +1 -1
- package/dist/core/health-manager.js +6 -1
- package/dist/core/health-manager.js.map +1 -1
- package/dist/core/plugin-registry.d.ts +55 -5
- package/dist/core/plugin-registry.d.ts.map +1 -1
- package/dist/core/plugin-registry.js +57 -19
- package/dist/core/plugin-registry.js.map +1 -1
- package/dist/core/types.d.ts +2 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/plugins/api-keys/api-keys-plugin.d.ts +46 -0
- package/dist/plugins/api-keys/api-keys-plugin.d.ts.map +1 -0
- package/dist/plugins/api-keys/api-keys-plugin.js +329 -0
- package/dist/plugins/api-keys/api-keys-plugin.js.map +1 -0
- package/dist/plugins/api-keys/index.d.ts +14 -0
- package/dist/plugins/api-keys/index.d.ts.map +1 -0
- package/dist/plugins/api-keys/index.js +17 -0
- package/dist/plugins/api-keys/index.js.map +1 -0
- package/dist/plugins/api-keys/middleware/bearer-token-auth.d.ts +74 -0
- package/dist/plugins/api-keys/middleware/bearer-token-auth.d.ts.map +1 -0
- package/dist/plugins/api-keys/middleware/bearer-token-auth.js +201 -0
- package/dist/plugins/api-keys/middleware/bearer-token-auth.js.map +1 -0
- package/dist/plugins/api-keys/middleware/index.d.ts +7 -0
- package/dist/plugins/api-keys/middleware/index.d.ts.map +1 -0
- package/dist/plugins/api-keys/middleware/index.js +7 -0
- package/dist/plugins/api-keys/middleware/index.js.map +1 -0
- package/dist/plugins/api-keys/stores/index.d.ts +7 -0
- package/dist/plugins/api-keys/stores/index.d.ts.map +1 -0
- package/dist/plugins/api-keys/stores/index.js +7 -0
- package/dist/plugins/api-keys/stores/index.js.map +1 -0
- package/dist/plugins/api-keys/stores/postgres-store.d.ts +34 -0
- package/dist/plugins/api-keys/stores/postgres-store.d.ts.map +1 -0
- package/dist/plugins/api-keys/stores/postgres-store.js +360 -0
- package/dist/plugins/api-keys/stores/postgres-store.js.map +1 -0
- package/dist/plugins/api-keys/types.d.ts +268 -0
- package/dist/plugins/api-keys/types.d.ts.map +1 -0
- package/dist/plugins/api-keys/types.js +56 -0
- package/dist/plugins/api-keys/types.js.map +1 -0
- package/dist/plugins/auth/auth-plugin.d.ts.map +1 -1
- package/dist/plugins/auth/auth-plugin.js +17 -1
- package/dist/plugins/auth/auth-plugin.js.map +1 -1
- package/dist/plugins/auth/auth-plugin.test.js +133 -0
- package/dist/plugins/auth/auth-plugin.test.js.map +1 -1
- package/dist/plugins/auth/env-config.d.ts.map +1 -1
- package/dist/plugins/auth/env-config.js +6 -2
- package/dist/plugins/auth/env-config.js.map +1 -1
- package/dist/plugins/auth/types.d.ts +10 -0
- package/dist/plugins/auth/types.d.ts.map +1 -1
- package/dist/plugins/auth/types.js.map +1 -1
- package/dist/plugins/devices/__tests__/token-utils.test.js +4 -2
- package/dist/plugins/devices/__tests__/token-utils.test.js.map +1 -1
- package/dist/plugins/frontend-app-plugin.d.ts.map +1 -1
- package/dist/plugins/frontend-app-plugin.js +21 -4
- package/dist/plugins/frontend-app-plugin.js.map +1 -1
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/qwickbrain/index.d.ts +25 -0
- package/dist/plugins/qwickbrain/index.d.ts.map +1 -0
- package/dist/plugins/qwickbrain/index.js +24 -0
- package/dist/plugins/qwickbrain/index.js.map +1 -0
- package/dist/plugins/qwickbrain/qwickbrain-plugin.d.ts +23 -0
- package/dist/plugins/qwickbrain/qwickbrain-plugin.d.ts.map +1 -0
- package/dist/plugins/qwickbrain/qwickbrain-plugin.js +528 -0
- package/dist/plugins/qwickbrain/qwickbrain-plugin.js.map +1 -0
- package/dist/plugins/qwickbrain/types.d.ts +131 -0
- package/dist/plugins/qwickbrain/types.d.ts.map +1 -0
- package/dist/plugins/qwickbrain/types.js +9 -0
- package/dist/plugins/qwickbrain/types.js.map +1 -0
- package/dist/plugins/users/__tests__/postgres-store.test.js +1 -0
- package/dist/plugins/users/__tests__/postgres-store.test.js.map +1 -1
- package/dist/plugins/users/__tests__/users-plugin.test.js +3 -0
- package/dist/plugins/users/__tests__/users-plugin.test.js.map +1 -1
- package/dist/plugins/users/stores/postgres-store.d.ts.map +1 -1
- package/dist/plugins/users/stores/postgres-store.js +59 -1
- package/dist/plugins/users/stores/postgres-store.js.map +1 -1
- package/dist/plugins/users/types.d.ts +22 -0
- package/dist/plugins/users/types.d.ts.map +1 -1
- package/dist-ui/assets/index-5nX8fM1a.js +469 -0
- package/dist-ui/assets/index-5nX8fM1a.js.map +1 -0
- package/dist-ui/index.html +1 -1
- package/dist-ui-lib/api/controlPanelApi.d.ts +68 -0
- package/dist-ui-lib/components/index.d.ts +2 -1
- package/dist-ui-lib/index.js +2642 -2281
- package/dist-ui-lib/index.js.map +1 -1
- package/dist-ui-lib/pages/APIKeysPage.d.ts +13 -0
- package/dist-ui-lib/pages/AcceptInvitationPage.d.ts +28 -0
- package/package.json +3 -2
- package/src/core/control-panel.ts +47 -0
- package/src/core/guards.ts +89 -0
- package/src/core/health-manager.ts +6 -1
- package/src/core/plugin-registry.ts +123 -25
- package/src/core/types.ts +2 -0
- package/src/index.ts +11 -0
- package/src/plugins/api-keys/api-keys-plugin.ts +397 -0
- package/src/plugins/api-keys/index.ts +49 -0
- package/src/plugins/api-keys/middleware/bearer-token-auth.ts +250 -0
- package/src/plugins/api-keys/middleware/index.ts +12 -0
- package/src/plugins/api-keys/stores/index.ts +7 -0
- package/src/plugins/api-keys/stores/postgres-store.ts +487 -0
- package/src/plugins/api-keys/types.ts +243 -0
- package/src/plugins/auth/auth-plugin.test.ts +167 -0
- package/src/plugins/auth/auth-plugin.ts +17 -1
- package/src/plugins/auth/env-config.ts +6 -2
- package/src/plugins/auth/types.ts +10 -0
- package/src/plugins/devices/__tests__/token-utils.test.ts +4 -2
- package/src/plugins/frontend-app-plugin.ts +24 -4
- package/src/plugins/index.ts +15 -0
- package/src/plugins/qwickbrain/index.ts +33 -0
- package/src/plugins/qwickbrain/qwickbrain-plugin.ts +642 -0
- package/src/plugins/qwickbrain/types.ts +146 -0
- package/src/plugins/users/__tests__/postgres-store.test.ts +1 -0
- package/src/plugins/users/__tests__/users-plugin.test.ts +3 -0
- package/src/plugins/users/stores/postgres-store.ts +69 -0
- package/src/plugins/users/types.ts +25 -0
- package/ui/src/App.tsx +6 -1
- package/ui/src/api/controlPanelApi.ts +206 -37
- package/ui/src/components/index.ts +6 -0
- package/ui/src/pages/APIKeysPage.tsx +661 -0
- package/ui/src/pages/AcceptInvitationPage.tsx +169 -0
- package/ui/src/pages/UsersPage.tsx +225 -2
- package/dist-ui/assets/index-CynOqPkb.js +0 -469
- package/dist-ui/assets/index-CynOqPkb.js.map +0 -1
package/dist-ui/index.html
CHANGED
|
@@ -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-
|
|
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;
|
|
@@ -377,6 +431,12 @@ declare class ControlPanelApi {
|
|
|
377
431
|
* Get the base URL for API requests.
|
|
378
432
|
*/
|
|
379
433
|
getBaseUrl(): string;
|
|
434
|
+
/**
|
|
435
|
+
* Internal fetch wrapper that includes credentials for Basic Auth support.
|
|
436
|
+
* Using 'same-origin' ensures the browser sends stored Basic Auth credentials
|
|
437
|
+
* without embedding them in the URL (which would cause fetch to fail).
|
|
438
|
+
*/
|
|
439
|
+
private _fetch;
|
|
380
440
|
/**
|
|
381
441
|
* Generic fetch method for API requests.
|
|
382
442
|
* Automatically prepends the base URL and /api prefix.
|
|
@@ -393,6 +453,9 @@ declare class ControlPanelApi {
|
|
|
393
453
|
search?: string;
|
|
394
454
|
}): Promise<UsersResponse>;
|
|
395
455
|
getUserById(id: string): Promise<User>;
|
|
456
|
+
inviteUser(request: InviteUserRequest): Promise<InvitationResponse>;
|
|
457
|
+
acceptInvitation(token: string): Promise<AcceptInvitationResponse>;
|
|
458
|
+
getInvitations(): Promise<UsersResponse>;
|
|
396
459
|
getBans(): Promise<BansResponse>;
|
|
397
460
|
banUser(email: string, reason: string, expiresAt?: string): Promise<void>;
|
|
398
461
|
unbanUser(email: string): Promise<void>;
|
|
@@ -460,6 +523,11 @@ declare class ControlPanelApi {
|
|
|
460
523
|
success: boolean;
|
|
461
524
|
message: string;
|
|
462
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>;
|
|
463
531
|
}
|
|
464
532
|
export declare const api: ControlPanelApi;
|
|
465
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';
|