@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.
- package/CHANGELOG.md +22 -0
- package/dist/core/control-panel.js +8 -8
- package/dist/core/control-panel.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.js +1 -1
- package/dist/plugins/auth/auth-plugin.js.map +1 -1
- package/dist/plugins/auth/env-config.js +2 -2
- package/dist/plugins/auth/env-config.js.map +1 -1
- package/dist/plugins/frontend-app-plugin.d.ts.map +1 -1
- package/dist/plugins/frontend-app-plugin.js +5 -2
- package/dist/plugins/frontend-app-plugin.js.map +1 -1
- 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 +62 -0
- package/dist-ui-lib/components/index.d.ts +2 -1
- package/dist-ui-lib/index.js +2588 -2238
- 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 +8 -8
- 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.ts +1 -1
- package/src/plugins/auth/env-config.ts +2 -2
- package/src/plugins/frontend-app-plugin.ts +7 -2
- 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 +157 -0
- 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-BfC7mG5L.js +0 -469
- package/dist-ui/assets/index-BfC7mG5L.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;
|
|
@@ -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';
|