@questpie/admin 3.0.9 → 3.1.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/dist/augmentation.d.mts +39 -0
- package/dist/client/builder/types/field-types.d.mts +10 -14
- package/dist/client/components/fields/relation-picker.mjs +2 -2
- package/dist/client/components/fields/relation-select.mjs +3 -3
- package/dist/client/hooks/use-reactive-prop.mjs +308 -0
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/preview-banner.d.mts +2 -2
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/auth-layout.d.mts +3 -3
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/collection/field-renderer.mjs +59 -134
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/login-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/server/augmentation/form-layout.d.mts +48 -4
- package/dist/server/augmentation/index.d.mts +1 -1
- package/dist/server/augmentation.d.mts +1 -1
- package/dist/server/modules/admin/collections/admin-locks.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
- package/dist/server/modules/admin/collections/apikey.d.mts +64 -64
- package/dist/server/modules/admin/collections/assets.d.mts +20 -20
- package/dist/server/modules/admin/collections/session.d.mts +38 -38
- package/dist/server/modules/admin/collections/user.d.mts +32 -32
- package/dist/server/modules/admin/collections/verification.d.mts +32 -32
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/reactive.d.mts +13 -11
- package/dist/server/modules/admin/routes/reactive.mjs +75 -11
- package/dist/server/modules/admin/routes/setup.d.mts +7 -7
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +23 -23
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
1
|
+
import * as questpie_shared43 from "questpie/shared";
|
|
2
|
+
import * as questpie408 from "questpie";
|
|
3
|
+
import * as drizzle_orm_pg_core115 from "drizzle-orm/pg-core";
|
|
4
|
+
import * as drizzle_orm71 from "drizzle-orm";
|
|
5
5
|
import * as questpie_src_server_fields_operators_builtin_js7 from "questpie/src/server/fields/operators/builtin.js";
|
|
6
6
|
|
|
7
7
|
//#region src/server/modules/admin/collections/user.d.ts
|
|
@@ -18,7 +18,7 @@ import * as questpie_src_server_fields_operators_builtin_js7 from "questpie/src/
|
|
|
18
18
|
* @see account.ts for explanation of the collection().merge().set() pattern.
|
|
19
19
|
* stateKey mapping: admin=".admin()", adminList=".list()", adminForm=".form()", adminActions=".actions()"
|
|
20
20
|
*/
|
|
21
|
-
declare const adminUserCollection:
|
|
21
|
+
declare const adminUserCollection: questpie408.CollectionBuilder<questpie_shared43.Override<{
|
|
22
22
|
name: "user";
|
|
23
23
|
fields: Record<string, never>;
|
|
24
24
|
localized: [];
|
|
@@ -38,18 +38,18 @@ declare const adminUserCollection: questpie326.CollectionBuilder<questpie_shared
|
|
|
38
38
|
}, {
|
|
39
39
|
name: "user";
|
|
40
40
|
fields: Record<string, never> & {
|
|
41
|
-
readonly name:
|
|
42
|
-
readonly email:
|
|
43
|
-
readonly emailVerified:
|
|
44
|
-
readonly image:
|
|
45
|
-
readonly avatar:
|
|
46
|
-
readonly role:
|
|
47
|
-
readonly banned:
|
|
48
|
-
readonly banReason:
|
|
49
|
-
readonly banExpires:
|
|
41
|
+
readonly name: drizzle_orm71.NotNull<drizzle_orm_pg_core115.PgVarcharBuilder<[string, ...string[]]>>;
|
|
42
|
+
readonly email: drizzle_orm71.NotNull<drizzle_orm_pg_core115.PgVarcharBuilder<[string, ...string[]]>>;
|
|
43
|
+
readonly emailVerified: drizzle_orm71.NotNull<drizzle_orm_pg_core115.PgBooleanBuilder>;
|
|
44
|
+
readonly image: drizzle_orm_pg_core115.PgVarcharBuilder<[string, ...string[]]>;
|
|
45
|
+
readonly avatar: drizzle_orm_pg_core115.PgVarcharBuilder<[string, ...string[]]>;
|
|
46
|
+
readonly role: drizzle_orm_pg_core115.PgVarcharBuilder<[string, ...string[]]>;
|
|
47
|
+
readonly banned: drizzle_orm71.HasDefault<drizzle_orm_pg_core115.PgBooleanBuilder>;
|
|
48
|
+
readonly banReason: drizzle_orm_pg_core115.PgVarcharBuilder<[string, ...string[]]>;
|
|
49
|
+
readonly banExpires: drizzle_orm_pg_core115.PgTimestampBuilder;
|
|
50
50
|
};
|
|
51
51
|
virtuals: undefined;
|
|
52
|
-
relations: Record<string, never> & Record<string,
|
|
52
|
+
relations: Record<string, never> & Record<string, questpie408.RelationConfig>;
|
|
53
53
|
indexes: Record<string, never> & Record<string, any>;
|
|
54
54
|
title: "name";
|
|
55
55
|
options: Record<string, never> & {
|
|
@@ -59,36 +59,36 @@ declare const adminUserCollection: questpie326.CollectionBuilder<questpie_shared
|
|
|
59
59
|
access: Record<string, any>;
|
|
60
60
|
searchable: undefined;
|
|
61
61
|
fieldDefinitions: {
|
|
62
|
-
readonly name:
|
|
62
|
+
readonly name: questpie408.FieldWithMethods<Omit<questpie408.TextFieldState, "notNull" | "column"> & {
|
|
63
63
|
notNull: true;
|
|
64
|
-
column:
|
|
65
|
-
},
|
|
66
|
-
readonly email:
|
|
64
|
+
column: drizzle_orm71.NotNull<drizzle_orm_pg_core115.PgVarcharBuilder<[string, ...string[]]>>;
|
|
65
|
+
}, questpie408.TextFieldMethods>;
|
|
66
|
+
readonly email: questpie408.FieldWithMethods<Omit<questpie408.EmailFieldState, "notNull" | "column"> & {
|
|
67
67
|
notNull: true;
|
|
68
|
-
column:
|
|
69
|
-
},
|
|
70
|
-
readonly emailVerified:
|
|
68
|
+
column: drizzle_orm71.NotNull<drizzle_orm_pg_core115.PgVarcharBuilder<[string, ...string[]]>>;
|
|
69
|
+
}, questpie408.EmailFieldMethods>;
|
|
70
|
+
readonly emailVerified: questpie408.Field<Omit<questpie408.BooleanFieldState, "notNull" | "column"> & {
|
|
71
71
|
notNull: true;
|
|
72
|
-
column:
|
|
72
|
+
column: drizzle_orm71.NotNull<drizzle_orm_pg_core115.PgBooleanBuilder>;
|
|
73
73
|
}>;
|
|
74
|
-
readonly image:
|
|
75
|
-
readonly avatar:
|
|
74
|
+
readonly image: questpie408.FieldWithMethods<questpie408.UrlFieldState, questpie408.UrlFieldMethods>;
|
|
75
|
+
readonly avatar: questpie408.Field<questpie408.DefaultFieldState & {
|
|
76
76
|
type: "upload";
|
|
77
77
|
data: string;
|
|
78
|
-
column:
|
|
78
|
+
column: drizzle_orm_pg_core115.PgVarcharBuilder<[string, ...string[]]>;
|
|
79
79
|
operators: typeof questpie_src_server_fields_operators_builtin_js7.belongsToOps;
|
|
80
80
|
relationTo: "assets";
|
|
81
81
|
relationKind: "one";
|
|
82
82
|
} & {
|
|
83
|
-
label:
|
|
83
|
+
label: questpie_shared43.I18nText;
|
|
84
84
|
}>;
|
|
85
|
-
readonly role:
|
|
86
|
-
readonly banned:
|
|
85
|
+
readonly role: questpie408.FieldWithMethods<questpie408.TextFieldState, questpie408.TextFieldMethods>;
|
|
86
|
+
readonly banned: questpie408.Field<Omit<questpie408.BooleanFieldState, "column" | "hasDefault"> & {
|
|
87
87
|
hasDefault: true;
|
|
88
|
-
column:
|
|
88
|
+
column: drizzle_orm71.HasDefault<drizzle_orm_pg_core115.PgBooleanBuilder>;
|
|
89
89
|
}>;
|
|
90
|
-
readonly banReason:
|
|
91
|
-
readonly banExpires:
|
|
90
|
+
readonly banReason: questpie408.FieldWithMethods<questpie408.TextFieldState, questpie408.TextFieldMethods>;
|
|
91
|
+
readonly banExpires: questpie408.FieldWithMethods<questpie408.DatetimeFieldState, questpie408.DatetimeFieldMethods>;
|
|
92
92
|
};
|
|
93
93
|
upload: undefined;
|
|
94
94
|
output: {};
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as questpie_shared45 from "questpie/shared";
|
|
2
|
+
import * as questpie434 from "questpie";
|
|
3
3
|
import * as questpie_src_server_modules_core_fields_email_js9 from "questpie/src/server/modules/core/fields/email.js";
|
|
4
4
|
import * as questpie_src_server_modules_core_fields_json_js9 from "questpie/src/server/modules/core/fields/json.js";
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
5
|
+
import * as drizzle_orm_pg_core129 from "drizzle-orm/pg-core";
|
|
6
|
+
import * as drizzle_orm79 from "drizzle-orm";
|
|
7
7
|
|
|
8
8
|
//#region src/server/modules/admin/collections/verification.d.ts
|
|
9
|
-
declare const _default:
|
|
10
|
-
readonly text: typeof
|
|
11
|
-
readonly textarea: typeof
|
|
9
|
+
declare const _default: questpie434.CollectionBuilder<questpie_shared45.Override<questpie434.EmptyCollectionState<"verification", undefined, {
|
|
10
|
+
readonly text: typeof questpie434.text;
|
|
11
|
+
readonly textarea: typeof questpie434.textarea;
|
|
12
12
|
readonly email: typeof questpie_src_server_modules_core_fields_email_js9.email;
|
|
13
|
-
readonly url: typeof
|
|
14
|
-
readonly number: typeof
|
|
15
|
-
readonly boolean: typeof
|
|
16
|
-
readonly date: typeof
|
|
17
|
-
readonly datetime: typeof
|
|
18
|
-
readonly time: typeof
|
|
19
|
-
readonly select: typeof
|
|
20
|
-
readonly upload: typeof
|
|
21
|
-
readonly relation: typeof
|
|
22
|
-
readonly object: typeof
|
|
13
|
+
readonly url: typeof questpie434.url;
|
|
14
|
+
readonly number: typeof questpie434.number;
|
|
15
|
+
readonly boolean: typeof questpie434.boolean;
|
|
16
|
+
readonly date: typeof questpie434.date;
|
|
17
|
+
readonly datetime: typeof questpie434.datetime;
|
|
18
|
+
readonly time: typeof questpie434.time;
|
|
19
|
+
readonly select: typeof questpie434.select;
|
|
20
|
+
readonly upload: typeof questpie434.upload;
|
|
21
|
+
readonly relation: typeof questpie434.relation;
|
|
22
|
+
readonly object: typeof questpie434.object;
|
|
23
23
|
readonly json: typeof questpie_src_server_modules_core_fields_json_js9.json;
|
|
24
|
-
readonly from: typeof
|
|
24
|
+
readonly from: typeof questpie434.from;
|
|
25
25
|
}>, {
|
|
26
26
|
name: "verification";
|
|
27
27
|
fields: Record<string, any> & {
|
|
28
|
-
readonly identifier:
|
|
29
|
-
readonly value:
|
|
30
|
-
readonly expiresAt:
|
|
28
|
+
readonly identifier: drizzle_orm79.NotNull<drizzle_orm_pg_core129.PgVarcharBuilder<[string, ...string[]]>>;
|
|
29
|
+
readonly value: drizzle_orm79.NotNull<drizzle_orm_pg_core129.PgVarcharBuilder<[string, ...string[]]>>;
|
|
30
|
+
readonly expiresAt: drizzle_orm79.NotNull<drizzle_orm_pg_core129.PgTimestampBuilder>;
|
|
31
31
|
};
|
|
32
32
|
virtuals: undefined;
|
|
33
|
-
relations: Record<string,
|
|
33
|
+
relations: Record<string, questpie434.RelationConfig>;
|
|
34
34
|
indexes: Record<string, any>;
|
|
35
35
|
title: "identifier";
|
|
36
|
-
options:
|
|
36
|
+
options: questpie434.CollectionOptions & {
|
|
37
37
|
timestamps: true;
|
|
38
38
|
};
|
|
39
39
|
hooks: Record<string, any>;
|
|
40
40
|
access: Record<string, any>;
|
|
41
41
|
searchable: undefined;
|
|
42
42
|
fieldDefinitions: {
|
|
43
|
-
readonly identifier:
|
|
43
|
+
readonly identifier: questpie434.FieldWithMethods<Omit<questpie434.TextFieldState, "notNull" | "column"> & {
|
|
44
44
|
notNull: true;
|
|
45
|
-
column:
|
|
46
|
-
},
|
|
47
|
-
readonly value:
|
|
45
|
+
column: drizzle_orm79.NotNull<drizzle_orm_pg_core129.PgVarcharBuilder<[string, ...string[]]>>;
|
|
46
|
+
}, questpie434.TextFieldMethods>;
|
|
47
|
+
readonly value: questpie434.FieldWithMethods<Omit<questpie434.TextFieldState, "notNull" | "column"> & {
|
|
48
48
|
notNull: true;
|
|
49
|
-
column:
|
|
50
|
-
},
|
|
51
|
-
readonly expiresAt:
|
|
49
|
+
column: drizzle_orm79.NotNull<drizzle_orm_pg_core129.PgVarcharBuilder<[string, ...string[]]>>;
|
|
50
|
+
}, questpie434.TextFieldMethods>;
|
|
51
|
+
readonly expiresAt: questpie434.FieldWithMethods<Omit<questpie434.DatetimeFieldState, "notNull" | "column"> & {
|
|
52
52
|
notNull: true;
|
|
53
|
-
column:
|
|
54
|
-
},
|
|
53
|
+
column: drizzle_orm79.NotNull<drizzle_orm_pg_core129.PgTimestampBuilder>;
|
|
54
|
+
}, questpie434.DatetimeFieldMethods>;
|
|
55
55
|
};
|
|
56
56
|
upload: undefined;
|
|
57
57
|
output: {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as questpie460 from "questpie";
|
|
2
2
|
|
|
3
3
|
//#region src/server/modules/admin/routes/admin-config.d.ts
|
|
4
4
|
|
|
@@ -22,7 +22,7 @@ import * as questpie289 from "questpie";
|
|
|
22
22
|
* Registered via module routes and exposed through the fetch handler.
|
|
23
23
|
*/
|
|
24
24
|
declare const adminConfigFunctions: {
|
|
25
|
-
readonly getAdminConfig:
|
|
25
|
+
readonly getAdminConfig: questpie460.JsonRouteDefinition<Record<string, never> | undefined, any, questpie460.JsonRouteParams>;
|
|
26
26
|
};
|
|
27
27
|
//#endregion
|
|
28
28
|
export { adminConfigFunctions };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ServerActionDefinition, ServerActionResult } from "../../../augmentation/actions.mjs";
|
|
2
2
|
import "../../../augmentation.mjs";
|
|
3
3
|
import { App } from "./route-helpers.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as questpie139 from "questpie";
|
|
5
5
|
|
|
6
6
|
//#region src/server/modules/admin/routes/execute-action.d.ts
|
|
7
7
|
|
|
@@ -56,37 +56,37 @@ declare function executeAction(app: App, request: ExecuteActionRequest, session?
|
|
|
56
56
|
* });
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
|
-
declare const executeActionFn:
|
|
59
|
+
declare const executeActionFn: questpie139.JsonRouteDefinition<{
|
|
60
60
|
collection: string;
|
|
61
61
|
actionId: string;
|
|
62
62
|
itemId?: string | undefined;
|
|
63
63
|
itemIds?: string[] | undefined;
|
|
64
64
|
data?: Record<string, unknown> | undefined;
|
|
65
65
|
locale?: string | undefined;
|
|
66
|
-
}, any,
|
|
66
|
+
}, any, questpie139.JsonRouteParams>;
|
|
67
67
|
/**
|
|
68
68
|
* Get actions configuration for a collection.
|
|
69
69
|
* Returns action definitions without handlers for client rendering.
|
|
70
70
|
*/
|
|
71
|
-
declare const getActionsConfigFn:
|
|
71
|
+
declare const getActionsConfigFn: questpie139.JsonRouteDefinition<{
|
|
72
72
|
collection: string;
|
|
73
|
-
}, any,
|
|
73
|
+
}, any, questpie139.JsonRouteParams>;
|
|
74
74
|
/**
|
|
75
75
|
* QUESTPIE functions for action execution.
|
|
76
76
|
* These are registered on the `adminModule`.
|
|
77
77
|
*/
|
|
78
78
|
declare const actionFunctions: {
|
|
79
|
-
executeAction:
|
|
79
|
+
executeAction: questpie139.JsonRouteDefinition<{
|
|
80
80
|
collection: string;
|
|
81
81
|
actionId: string;
|
|
82
82
|
itemId?: string | undefined;
|
|
83
83
|
itemIds?: string[] | undefined;
|
|
84
84
|
data?: Record<string, unknown> | undefined;
|
|
85
85
|
locale?: string | undefined;
|
|
86
|
-
}, any,
|
|
87
|
-
getActionsConfig:
|
|
86
|
+
}, any, questpie139.JsonRouteParams>;
|
|
87
|
+
getActionsConfig: questpie139.JsonRouteDefinition<{
|
|
88
88
|
collection: string;
|
|
89
|
-
}, any,
|
|
89
|
+
}, any, questpie139.JsonRouteParams>;
|
|
90
90
|
};
|
|
91
91
|
//#endregion
|
|
92
92
|
export { ExecuteActionRequest, ExecuteActionResponse, actionFunctions, executeAction, executeActionFn, getActionsConfig, getActionsConfigFn };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as questpie113 from "questpie";
|
|
2
2
|
|
|
3
3
|
//#region src/server/modules/admin/routes/preview.d.ts
|
|
4
4
|
|
|
@@ -21,13 +21,13 @@ interface PreviewTokenPayload {
|
|
|
21
21
|
* @returns Object with preview functions
|
|
22
22
|
*/
|
|
23
23
|
declare function createPreviewFunctions(secret: string): {
|
|
24
|
-
mintPreviewToken:
|
|
24
|
+
mintPreviewToken: questpie113.JsonRouteDefinition<{
|
|
25
25
|
path: string;
|
|
26
26
|
ttlMs?: number | undefined;
|
|
27
|
-
}, any,
|
|
28
|
-
verifyPreviewToken:
|
|
27
|
+
}, any, questpie113.JsonRouteParams>;
|
|
28
|
+
verifyPreviewToken: questpie113.JsonRouteDefinition<{
|
|
29
29
|
token: string;
|
|
30
|
-
}, any,
|
|
30
|
+
}, any, questpie113.JsonRouteParams>;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
33
|
* Verify a preview token without RPC.
|
|
@@ -63,18 +63,18 @@ declare function createPreviewTokenVerifier(secret?: string): (token: string) =>
|
|
|
63
63
|
* Used by the `adminModule` to register preview RPC functions.
|
|
64
64
|
*/
|
|
65
65
|
declare const previewFunctions: {
|
|
66
|
-
getPreviewUrl:
|
|
66
|
+
getPreviewUrl: questpie113.JsonRouteDefinition<{
|
|
67
67
|
collection: string;
|
|
68
68
|
record: Record<string, unknown>;
|
|
69
69
|
locale?: string | undefined;
|
|
70
|
-
}, any,
|
|
71
|
-
mintPreviewToken:
|
|
70
|
+
}, any, questpie113.JsonRouteParams>;
|
|
71
|
+
mintPreviewToken: questpie113.JsonRouteDefinition<{
|
|
72
72
|
path: string;
|
|
73
73
|
ttlMs?: number | undefined;
|
|
74
|
-
}, any,
|
|
75
|
-
verifyPreviewToken:
|
|
74
|
+
}, any, questpie113.JsonRouteParams>;
|
|
75
|
+
verifyPreviewToken: questpie113.JsonRouteDefinition<{
|
|
76
76
|
token: string;
|
|
77
|
-
}, any,
|
|
77
|
+
}, any, questpie113.JsonRouteParams>;
|
|
78
78
|
};
|
|
79
79
|
//#endregion
|
|
80
80
|
export { PreviewTokenPayload, createPreviewFunctions, createPreviewTokenVerifier, previewFunctions, verifyPreviewTokenDirect };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as questpie123 from "questpie";
|
|
2
2
|
|
|
3
3
|
//#region src/server/modules/admin/routes/reactive.d.ts
|
|
4
4
|
|
|
@@ -13,12 +13,13 @@ import * as questpie135 from "questpie";
|
|
|
13
13
|
* Batch reactive endpoint.
|
|
14
14
|
* Executes multiple reactive handlers in a single request.
|
|
15
15
|
*/
|
|
16
|
-
declare const batchReactive:
|
|
16
|
+
declare const batchReactive: questpie123.JsonRouteDefinition<{
|
|
17
17
|
collection: string;
|
|
18
18
|
type: "collection" | "global";
|
|
19
19
|
requests: {
|
|
20
20
|
field: string;
|
|
21
|
-
type: "hidden" | "readOnly" | "disabled" | "compute";
|
|
21
|
+
type: "hidden" | "readOnly" | "disabled" | "compute" | "prop";
|
|
22
|
+
propPath?: string | undefined;
|
|
22
23
|
formData?: Record<string, unknown> | undefined;
|
|
23
24
|
siblingData?: Record<string, unknown> | null | undefined;
|
|
24
25
|
prevData?: Record<string, unknown> | null | undefined;
|
|
@@ -26,12 +27,12 @@ declare const batchReactive: questpie135.JsonRouteDefinition<{
|
|
|
26
27
|
}[];
|
|
27
28
|
formData?: Record<string, unknown> | undefined;
|
|
28
29
|
prevData?: Record<string, unknown> | null | undefined;
|
|
29
|
-
}, any,
|
|
30
|
+
}, any, questpie123.JsonRouteParams>;
|
|
30
31
|
/**
|
|
31
32
|
* Dynamic options endpoint.
|
|
32
33
|
* Fetches options for select/relation fields with search and pagination.
|
|
33
34
|
*/
|
|
34
|
-
declare const fieldOptions:
|
|
35
|
+
declare const fieldOptions: questpie123.JsonRouteDefinition<{
|
|
35
36
|
collection: string;
|
|
36
37
|
type: "collection" | "global";
|
|
37
38
|
field: string;
|
|
@@ -40,17 +41,18 @@ declare const fieldOptions: questpie135.JsonRouteDefinition<{
|
|
|
40
41
|
page: number;
|
|
41
42
|
limit: number;
|
|
42
43
|
siblingData?: Record<string, unknown> | null | undefined;
|
|
43
|
-
}, any,
|
|
44
|
+
}, any, questpie123.JsonRouteParams>;
|
|
44
45
|
/**
|
|
45
46
|
* Reactive functions bundle.
|
|
46
47
|
*/
|
|
47
48
|
declare const reactiveFunctions: {
|
|
48
|
-
readonly batchReactive:
|
|
49
|
+
readonly batchReactive: questpie123.JsonRouteDefinition<{
|
|
49
50
|
collection: string;
|
|
50
51
|
type: "collection" | "global";
|
|
51
52
|
requests: {
|
|
52
53
|
field: string;
|
|
53
|
-
type: "hidden" | "readOnly" | "disabled" | "compute";
|
|
54
|
+
type: "hidden" | "readOnly" | "disabled" | "compute" | "prop";
|
|
55
|
+
propPath?: string | undefined;
|
|
54
56
|
formData?: Record<string, unknown> | undefined;
|
|
55
57
|
siblingData?: Record<string, unknown> | null | undefined;
|
|
56
58
|
prevData?: Record<string, unknown> | null | undefined;
|
|
@@ -58,8 +60,8 @@ declare const reactiveFunctions: {
|
|
|
58
60
|
}[];
|
|
59
61
|
formData?: Record<string, unknown> | undefined;
|
|
60
62
|
prevData?: Record<string, unknown> | null | undefined;
|
|
61
|
-
}, any,
|
|
62
|
-
readonly fieldOptions:
|
|
63
|
+
}, any, questpie123.JsonRouteParams>;
|
|
64
|
+
readonly fieldOptions: questpie123.JsonRouteDefinition<{
|
|
63
65
|
collection: string;
|
|
64
66
|
type: "collection" | "global";
|
|
65
67
|
field: string;
|
|
@@ -68,7 +70,7 @@ declare const reactiveFunctions: {
|
|
|
68
70
|
page: number;
|
|
69
71
|
limit: number;
|
|
70
72
|
siblingData?: Record<string, unknown> | null | undefined;
|
|
71
|
-
}, any,
|
|
73
|
+
}, any, questpie123.JsonRouteParams>;
|
|
72
74
|
};
|
|
73
75
|
//#endregion
|
|
74
76
|
export { batchReactive, fieldOptions, reactiveFunctions };
|
|
@@ -179,6 +179,49 @@ function getReactiveHandler(app, entityName, fieldPath, handlerType, type = "col
|
|
|
179
179
|
return null;
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
|
+
* Coerce a `function | { handler }` config-like value to the underlying
|
|
183
|
+
* handler function. Returns `null` for static values.
|
|
184
|
+
*/
|
|
185
|
+
function unwrapHandler(value) {
|
|
186
|
+
if (typeof value === "function") return value;
|
|
187
|
+
if (value !== null && typeof value === "object" && "handler" in value && typeof value.handler === "function") return value.handler;
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Get a reactive prop handler. Resolution chain (first hit wins):
|
|
192
|
+
*
|
|
193
|
+
* 1. **Layout-level** `state.adminForm.fields[*].props[propPath]`
|
|
194
|
+
* (per-instance `.form()` override)
|
|
195
|
+
* 2. **Field-level** `state.fieldDefinitions[fieldPath]._state.extensions.admin[propPath]`
|
|
196
|
+
* (default attached to the field via `f.<x>().admin({ ... })`)
|
|
197
|
+
*
|
|
198
|
+
* The wire-side counterpart is the `ReactivePropPlaceholder` introspection
|
|
199
|
+
* emits for function values in either location.
|
|
200
|
+
*/
|
|
201
|
+
function getReactivePropHandler(app, entityName, fieldPath, propPath, type = "collection") {
|
|
202
|
+
const formConfig = getEntity(app, entityName, type).state.adminForm;
|
|
203
|
+
const fieldEntry = findReactiveFieldEntry(formConfig, fieldPath);
|
|
204
|
+
if (fieldEntry) {
|
|
205
|
+
const props = fieldEntry.props;
|
|
206
|
+
if (props && typeof props === "object") {
|
|
207
|
+
const layoutHandler = unwrapHandler(props[propPath]);
|
|
208
|
+
if (layoutHandler) return layoutHandler;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
let fieldDef;
|
|
212
|
+
try {
|
|
213
|
+
fieldDef = getFieldDefinition(app, entityName, fieldPath, type);
|
|
214
|
+
} catch {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
const adminMeta = fieldDef._state?.extensions?.admin;
|
|
218
|
+
if (adminMeta && typeof adminMeta === "object") {
|
|
219
|
+
const fieldHandler = unwrapHandler(adminMeta[propPath]);
|
|
220
|
+
if (fieldHandler) return fieldHandler;
|
|
221
|
+
}
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
182
225
|
* Get options handler from field config.
|
|
183
226
|
*/
|
|
184
227
|
function getOptionsHandler(fieldDef) {
|
|
@@ -196,8 +239,10 @@ const reactiveRequestSchema = z.object({
|
|
|
196
239
|
"hidden",
|
|
197
240
|
"readOnly",
|
|
198
241
|
"disabled",
|
|
199
|
-
"compute"
|
|
242
|
+
"compute",
|
|
243
|
+
"prop"
|
|
200
244
|
]),
|
|
245
|
+
propPath: z.string().optional(),
|
|
201
246
|
formData: z.record(z.string(), z.unknown()).optional(),
|
|
202
247
|
siblingData: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
203
248
|
prevData: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
@@ -222,8 +267,10 @@ const reactiveResultSchema = z.object({
|
|
|
222
267
|
"hidden",
|
|
223
268
|
"readOnly",
|
|
224
269
|
"disabled",
|
|
225
|
-
"compute"
|
|
270
|
+
"compute",
|
|
271
|
+
"prop"
|
|
226
272
|
]),
|
|
273
|
+
propPath: z.string().optional(),
|
|
227
274
|
value: z.unknown(),
|
|
228
275
|
error: z.string().optional()
|
|
229
276
|
});
|
|
@@ -264,27 +311,44 @@ const batchReactive = route().post().schema(batchReactiveInputSchema).outputSche
|
|
|
264
311
|
const { collection: entityName, type: entityType, requests, formData: sharedFormData, prevData: sharedPrevData } = ctx.input;
|
|
265
312
|
const serverCtx = buildServerContext(ctx);
|
|
266
313
|
return { results: await Promise.all(requests.map(async (request) => {
|
|
267
|
-
const { field: field$1, type, formData, siblingData, prevData, prevSiblingData } = request;
|
|
314
|
+
const { field: field$1, type, propPath, formData, siblingData, prevData, prevSiblingData } = request;
|
|
268
315
|
const resolvedFormData = formData ?? sharedFormData ?? {};
|
|
269
316
|
const resolvedPrevData = prevData ?? sharedPrevData ?? null;
|
|
270
317
|
try {
|
|
271
318
|
getFieldDefinition(app, entityName, field$1, entityType);
|
|
272
|
-
|
|
273
|
-
if (
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
319
|
+
let handler;
|
|
320
|
+
if (type === "prop") {
|
|
321
|
+
if (!propPath) return {
|
|
322
|
+
field: field$1,
|
|
323
|
+
type,
|
|
324
|
+
value: void 0,
|
|
325
|
+
error: "propPath is required when type === 'prop'"
|
|
326
|
+
};
|
|
327
|
+
handler = getReactivePropHandler(app, entityName, field$1, propPath, entityType);
|
|
328
|
+
} else handler = getReactiveHandler(app, entityName, field$1, type, entityType);
|
|
329
|
+
if (!handler) {
|
|
330
|
+
const what = type === "prop" ? `prop '${propPath}'` : `${type} handler`;
|
|
331
|
+
return {
|
|
332
|
+
field: field$1,
|
|
333
|
+
type,
|
|
334
|
+
...propPath ? { propPath } : {},
|
|
335
|
+
value: void 0,
|
|
336
|
+
error: `No ${what} found for field '${field$1}'`
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
const reactiveCtx = buildReactiveContext(resolvedFormData, siblingData, resolvedPrevData, prevSiblingData, serverCtx);
|
|
340
|
+
const value = await handler(reactiveCtx);
|
|
279
341
|
return {
|
|
280
342
|
field: field$1,
|
|
281
343
|
type,
|
|
282
|
-
|
|
344
|
+
...propPath ? { propPath } : {},
|
|
345
|
+
value
|
|
283
346
|
};
|
|
284
347
|
} catch (error) {
|
|
285
348
|
return {
|
|
286
349
|
field: field$1,
|
|
287
350
|
type,
|
|
351
|
+
...propPath ? { propPath } : {},
|
|
288
352
|
value: void 0,
|
|
289
353
|
error: error instanceof Error ? error.message : String(error)
|
|
290
354
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as questpie131 from "questpie";
|
|
2
2
|
|
|
3
3
|
//#region src/server/modules/admin/routes/setup.d.ts
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ import * as questpie143 from "questpie";
|
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
declare const isSetupRequired:
|
|
23
|
+
declare const isSetupRequired: questpie131.JsonRouteDefinition<Record<string, never>, any, questpie131.JsonRouteParams>;
|
|
24
24
|
/**
|
|
25
25
|
* Create the first admin user in the system.
|
|
26
26
|
* This function only works when no admin users exist (setup mode).
|
|
@@ -43,21 +43,21 @@ declare const isSetupRequired: questpie143.JsonRouteDefinition<Record<string, ne
|
|
|
43
43
|
* }
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
|
-
declare const createFirstAdmin:
|
|
46
|
+
declare const createFirstAdmin: questpie131.JsonRouteDefinition<{
|
|
47
47
|
email: string;
|
|
48
48
|
password: string;
|
|
49
49
|
name: string;
|
|
50
|
-
}, any,
|
|
50
|
+
}, any, questpie131.JsonRouteParams>;
|
|
51
51
|
/**
|
|
52
52
|
* Bundle of setup-related functions.
|
|
53
53
|
*/
|
|
54
54
|
declare const setupFunctions: {
|
|
55
|
-
readonly isSetupRequired:
|
|
56
|
-
readonly createFirstAdmin:
|
|
55
|
+
readonly isSetupRequired: questpie131.JsonRouteDefinition<Record<string, never>, any, questpie131.JsonRouteParams>;
|
|
56
|
+
readonly createFirstAdmin: questpie131.JsonRouteDefinition<{
|
|
57
57
|
email: string;
|
|
58
58
|
password: string;
|
|
59
59
|
name: string;
|
|
60
|
-
}, any,
|
|
60
|
+
}, any, questpie131.JsonRouteParams>;
|
|
61
61
|
};
|
|
62
62
|
//#endregion
|
|
63
63
|
export { createFirstAdmin, isSetupRequired, setupFunctions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as questpie147 from "questpie";
|
|
2
2
|
|
|
3
3
|
//#region src/server/modules/admin/routes/widget-data.d.ts
|
|
4
4
|
|
|
@@ -20,13 +20,13 @@ import * as questpie131 from "questpie";
|
|
|
20
20
|
* const data = await client.routes.fetchWidgetData({ widgetId: "my-widget" });
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
declare const fetchWidgetData:
|
|
23
|
+
declare const fetchWidgetData: questpie147.JsonRouteDefinition<{
|
|
24
24
|
widgetId: string;
|
|
25
|
-
}, any,
|
|
25
|
+
}, any, questpie147.JsonRouteParams>;
|
|
26
26
|
declare const widgetDataFunctions: {
|
|
27
|
-
readonly fetchWidgetData:
|
|
27
|
+
readonly fetchWidgetData: questpie147.JsonRouteDefinition<{
|
|
28
28
|
widgetId: string;
|
|
29
|
-
}, any,
|
|
29
|
+
}, any, questpie147.JsonRouteParams>;
|
|
30
30
|
};
|
|
31
31
|
//#endregion
|
|
32
32
|
export { fetchWidgetData, widgetDataFunctions };
|