@questpie/admin 3.5.3 → 3.5.5
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/README.md +8 -0
- package/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/builder/index.d.mts +1 -1
- package/dist/client/builder/types/collection-types.d.mts +80 -5
- package/dist/client/builder/types/common.d.mts +5 -0
- package/dist/client/builder/types/field-types.d.mts +41 -1
- package/dist/client/builder/view/view.d.mts +3 -2
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/fields/boolean-field.mjs +2 -1
- package/dist/client/components/fields/date-field.mjs +2 -1
- package/dist/client/components/fields/datetime-field.mjs +2 -1
- package/dist/client/components/fields/email-field.mjs +2 -1
- package/dist/client/components/fields/field-utils.d.mts +11 -0
- package/dist/client/components/fields/field-utils.mjs +3 -1
- package/dist/client/components/fields/field-wrapper.mjs +3 -3
- package/dist/client/components/fields/number-field.mjs +2 -1
- package/dist/client/components/fields/object-field.mjs +2 -1
- package/dist/client/components/fields/relation/displays/types.mjs +3 -3
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +2 -1
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +6 -2
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +2 -1
- package/dist/client/components/fields/rich-text-editor/index.d.mts +3 -2
- package/dist/client/components/fields/rich-text-editor/index.mjs +4 -3
- package/dist/client/components/fields/select-field.mjs +2 -1
- package/dist/client/components/fields/text-field.mjs +2 -1
- package/dist/client/components/fields/textarea-field.mjs +2 -1
- package/dist/client/components/fields/time-field.mjs +2 -1
- package/dist/client/components/layout/field-layout-renderer.mjs +4 -4
- package/dist/client/components/media/media-grid.mjs +2 -1
- package/dist/client/components/primitives/asset-preview.mjs +4 -2
- package/dist/client/components/primitives/dropzone.d.mts +100 -0
- package/dist/client/components/primitives/field-select-control.mjs +2 -1
- package/dist/client/components/ui/button.d.mts +23 -0
- package/dist/client/components/ui/button.mjs +2 -2
- package/dist/client/components/ui/dropdown-menu.d.mts +49 -0
- package/dist/client/components/ui/dropdown-menu.mjs +22 -1
- package/dist/client/components/ui/popover.mjs +1 -1
- package/dist/client/components/ui/search-input.d.mts +56 -0
- package/dist/client/components/ui/select.mjs +2 -2
- package/dist/client/components/ui/sheet.d.mts +40 -0
- package/dist/client/components/ui/table.d.mts +49 -0
- package/dist/client/components/ui/table.mjs +15 -1
- package/dist/client/components/ui/tooltip.d.mts +21 -0
- package/dist/client/contexts/focus-context.d.mts +2 -2
- package/dist/client/hooks/use-admin-config.mjs +20 -1
- package/dist/client/hooks/use-autosave.mjs +91 -0
- package/dist/client/hooks/use-collection.mjs +65 -23
- package/dist/client/hooks/use-upload.d.mts +40 -0
- package/dist/client/hooks/use-upload.mjs +4 -2
- package/dist/client/i18n/hooks.d.mts +20 -0
- package/dist/client/lib/utils.d.mts +6 -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/preview/preview-field.d.mts +4 -4
- package/dist/client/runtime/provider.mjs +22 -3
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/styles/base.css +22 -18
- package/dist/client/utils/asset-url.mjs +27 -0
- 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/forgot-password-form.d.mts +2 -2
- 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/auth/setup-form.d.mts +2 -2
- package/dist/client/views/collection/auto-form-fields.mjs +4 -4
- package/dist/client/views/collection/cells/shared/asset-thumbnail.d.mts +7 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +3 -2
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs +3 -2
- package/dist/client/views/collection/cells/upload-cells.mjs +2 -1
- package/dist/client/views/collection/document-view.d.mts +30 -0
- package/dist/client/views/collection/document-view.mjs +377 -0
- package/dist/client/views/collection/field-context.mjs +3 -2
- package/dist/client/views/collection/field-renderer.mjs +2 -2
- package/dist/client/views/collection/form-view.mjs +14 -80
- package/dist/client/views/collection/list-view.mjs +19 -15
- package/dist/client/views/collection/table-view.mjs +1 -1
- package/dist/client/views/layout/admin-layout-provider.mjs +4 -3
- package/dist/client/views/layout/admin-layout.mjs +107 -20
- package/dist/client/views/layout/admin-router.mjs +19 -3
- package/dist/client/views/layout/admin-sidebar.mjs +50 -6
- package/dist/client/views/layout/admin-view-layout.d.mts +36 -0
- 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/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client.d.mts +17 -2
- package/dist/client.mjs +16 -1
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/factories.d.mts +2 -2
- package/dist/factories.mjs +2 -2
- package/dist/index.d.mts +17 -3
- package/dist/index.mjs +16 -1
- package/dist/server/augmentation/actions.d.mts +5 -0
- package/dist/server/augmentation/form-layout.d.mts +5 -0
- package/dist/server/augmentation/views.d.mts +4 -1
- package/dist/server/fields/blocks.mjs +4 -1
- package/dist/server/fields/reactive-runtime.mjs +3 -0
- package/dist/server/modules/admin/.generated/module.d.mts +1 -1
- package/dist/server/modules/admin/auth-helpers.mjs +7 -1
- package/dist/server/modules/admin/block/introspection.mjs +28 -4
- package/dist/server/modules/admin/block/prefetch.d.mts +11 -0
- package/dist/server/modules/admin/block/prefetch.mjs +108 -27
- package/dist/server/modules/admin/client/.generated/module.d.mts +68 -67
- package/dist/server/modules/admin/client/.generated/module.mjs +2 -0
- package/dist/server/modules/admin/client/views/collection-document.d.mts +6 -0
- package/dist/server/modules/admin/client/views/collection-document.mjs +10 -0
- package/dist/server/modules/admin/collections/account.d.mts +46 -46
- package/dist/server/modules/admin/collections/admin-locks.d.mts +57 -57
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +42 -42
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +50 -50
- package/dist/server/modules/admin/collections/apikey.d.mts +79 -71
- package/dist/server/modules/admin/collections/assets.d.mts +42 -42
- package/dist/server/modules/admin/collections/session.d.mts +45 -45
- package/dist/server/modules/admin/collections/user.d.mts +66 -66
- package/dist/server/modules/admin/collections/verification.d.mts +39 -39
- package/dist/server/modules/admin/dto/admin-config.dto.mjs +34 -4
- package/dist/server/modules/admin/factories.mjs +4 -34
- package/dist/server/modules/admin/routes/admin-config.d.mts +3 -2
- package/dist/server/modules/admin/routes/admin-config.mjs +18 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/execute-action.mjs +10 -4
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/locales.mjs +1 -1
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/preview.mjs +6 -5
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/reactive.mjs +2 -2
- package/dist/server/modules/admin/routes/route-helpers.mjs +1 -1
- package/dist/server/modules/admin/routes/setup.d.mts +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin/routes/widget-data.mjs +1 -1
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
- package/dist/server/plugin.mjs +8 -3
- package/dist/server/proxy-factories.d.mts +8 -1
- package/dist/server/proxy-factories.mjs +33 -1
- package/package.json +4 -4
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
1
|
+
import * as questpie_shared51 from "questpie/shared";
|
|
2
|
+
import * as questpie374 from "questpie";
|
|
3
|
+
import * as questpie_src_server_modules_core_fields_email_js8 from "questpie/src/server/modules/core/fields/email.js";
|
|
4
|
+
import * as questpie_src_server_modules_core_fields_json_js8 from "questpie/src/server/modules/core/fields/json.js";
|
|
5
|
+
import * as drizzle_orm_pg_core113 from "drizzle-orm/pg-core";
|
|
6
|
+
import * as drizzle_orm66 from "drizzle-orm";
|
|
7
|
+
import * as questpie_src_server_collection_builder_types_js13 from "questpie/src/server/collection/builder/types.js";
|
|
8
8
|
|
|
9
9
|
//#region src/server/modules/admin/collections/session.d.ts
|
|
10
|
-
declare const _default:
|
|
11
|
-
readonly text: typeof
|
|
12
|
-
readonly textarea: typeof
|
|
13
|
-
readonly email: typeof
|
|
14
|
-
readonly url: typeof
|
|
15
|
-
readonly number: typeof
|
|
16
|
-
readonly boolean: typeof
|
|
17
|
-
readonly date: typeof
|
|
18
|
-
readonly datetime: typeof
|
|
19
|
-
readonly time: typeof
|
|
20
|
-
readonly select: typeof
|
|
21
|
-
readonly upload: typeof
|
|
22
|
-
readonly relation: typeof
|
|
23
|
-
readonly object: typeof
|
|
24
|
-
readonly json: typeof
|
|
25
|
-
readonly from: typeof
|
|
10
|
+
declare const _default: questpie374.CollectionBuilder<questpie_shared51.Override<questpie374.EmptyCollectionState<"session", undefined, {
|
|
11
|
+
readonly text: typeof questpie374.text;
|
|
12
|
+
readonly textarea: typeof questpie374.textarea;
|
|
13
|
+
readonly email: typeof questpie_src_server_modules_core_fields_email_js8.email;
|
|
14
|
+
readonly url: typeof questpie374.url;
|
|
15
|
+
readonly number: typeof questpie374.number;
|
|
16
|
+
readonly boolean: typeof questpie374.boolean;
|
|
17
|
+
readonly date: typeof questpie374.date;
|
|
18
|
+
readonly datetime: typeof questpie374.datetime;
|
|
19
|
+
readonly time: typeof questpie374.time;
|
|
20
|
+
readonly select: typeof questpie374.select;
|
|
21
|
+
readonly upload: typeof questpie374.upload;
|
|
22
|
+
readonly relation: typeof questpie374.relation;
|
|
23
|
+
readonly object: typeof questpie374.object;
|
|
24
|
+
readonly json: typeof questpie_src_server_modules_core_fields_json_js8.json;
|
|
25
|
+
readonly from: typeof questpie374.from;
|
|
26
26
|
}>, {
|
|
27
27
|
name: "session";
|
|
28
28
|
fields: Record<string, any> & {
|
|
29
|
-
readonly userId:
|
|
30
|
-
readonly token:
|
|
31
|
-
readonly expiresAt:
|
|
32
|
-
readonly ipAddress:
|
|
33
|
-
readonly userAgent:
|
|
34
|
-
readonly impersonatedBy:
|
|
29
|
+
readonly userId: drizzle_orm66.NotNull<drizzle_orm_pg_core113.PgVarcharBuilder<[string, ...string[]]>>;
|
|
30
|
+
readonly token: drizzle_orm66.NotNull<drizzle_orm_pg_core113.PgVarcharBuilder<[string, ...string[]]>>;
|
|
31
|
+
readonly expiresAt: drizzle_orm66.NotNull<drizzle_orm_pg_core113.PgTimestampBuilder>;
|
|
32
|
+
readonly ipAddress: drizzle_orm_pg_core113.PgVarcharBuilder<[string, ...string[]]>;
|
|
33
|
+
readonly userAgent: drizzle_orm_pg_core113.PgVarcharBuilder<[string, ...string[]]>;
|
|
34
|
+
readonly impersonatedBy: drizzle_orm_pg_core113.PgVarcharBuilder<[string, ...string[]]>;
|
|
35
35
|
};
|
|
36
36
|
virtuals: undefined;
|
|
37
|
-
relations: Record<string,
|
|
37
|
+
relations: Record<string, questpie374.RelationConfig>;
|
|
38
38
|
indexes: Record<string, any>;
|
|
39
39
|
title: "userId";
|
|
40
|
-
options:
|
|
40
|
+
options: questpie374.CollectionOptions & {
|
|
41
41
|
timestamps: true;
|
|
42
42
|
};
|
|
43
|
-
hooks:
|
|
44
|
-
access:
|
|
43
|
+
hooks: questpie_src_server_collection_builder_types_js13.CollectionHooksStorage;
|
|
44
|
+
access: questpie_src_server_collection_builder_types_js13.CollectionAccessStorage;
|
|
45
45
|
searchable: undefined;
|
|
46
46
|
fieldDefinitions: {
|
|
47
|
-
readonly userId:
|
|
47
|
+
readonly userId: questpie374.FieldWithMethods<Omit<questpie374.TextFieldState, "notNull" | "column"> & {
|
|
48
48
|
notNull: true;
|
|
49
|
-
column:
|
|
50
|
-
},
|
|
51
|
-
readonly token:
|
|
49
|
+
column: drizzle_orm66.NotNull<drizzle_orm_pg_core113.PgVarcharBuilder<[string, ...string[]]>>;
|
|
50
|
+
}, questpie374.TextFieldMethods>;
|
|
51
|
+
readonly token: questpie374.FieldWithMethods<Omit<questpie374.TextFieldState, "notNull" | "column"> & {
|
|
52
52
|
notNull: true;
|
|
53
|
-
column:
|
|
54
|
-
},
|
|
55
|
-
readonly expiresAt:
|
|
53
|
+
column: drizzle_orm66.NotNull<drizzle_orm_pg_core113.PgVarcharBuilder<[string, ...string[]]>>;
|
|
54
|
+
}, questpie374.TextFieldMethods>;
|
|
55
|
+
readonly expiresAt: questpie374.FieldWithMethods<Omit<questpie374.DatetimeFieldState, "notNull" | "column"> & {
|
|
56
56
|
notNull: true;
|
|
57
|
-
column:
|
|
58
|
-
},
|
|
59
|
-
readonly ipAddress:
|
|
60
|
-
readonly userAgent:
|
|
61
|
-
readonly impersonatedBy:
|
|
57
|
+
column: drizzle_orm66.NotNull<drizzle_orm_pg_core113.PgTimestampBuilder>;
|
|
58
|
+
}, questpie374.DatetimeFieldMethods>;
|
|
59
|
+
readonly ipAddress: questpie374.FieldWithMethods<questpie374.TextFieldState, questpie374.TextFieldMethods>;
|
|
60
|
+
readonly userAgent: questpie374.FieldWithMethods<questpie374.TextFieldState, questpie374.TextFieldMethods>;
|
|
61
|
+
readonly impersonatedBy: questpie374.FieldWithMethods<questpie374.TextFieldState, questpie374.TextFieldMethods>;
|
|
62
62
|
};
|
|
63
63
|
upload: undefined;
|
|
64
64
|
output: {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
1
|
+
import * as questpie_shared53 from "questpie/shared";
|
|
2
|
+
import * as questpie437 from "questpie";
|
|
3
|
+
import * as drizzle_orm_pg_core128 from "drizzle-orm/pg-core";
|
|
4
|
+
import * as drizzle_orm78 from "drizzle-orm";
|
|
5
|
+
import * as questpie_src_server_collection_builder_types_js17 from "questpie/src/server/collection/builder/types.js";
|
|
6
|
+
import * as questpie_src_server_fields_operators_builtin_js11 from "questpie/src/server/fields/operators/builtin.js";
|
|
7
7
|
|
|
8
8
|
//#region src/server/modules/admin/collections/user.d.ts
|
|
9
9
|
|
|
@@ -19,7 +19,7 @@ import * as questpie_src_server_fields_operators_builtin_js7 from "questpie/src/
|
|
|
19
19
|
* @see account.ts for explanation of the collection().merge().set() pattern.
|
|
20
20
|
* stateKey mapping: admin=".admin()", adminList=".list()", adminForm=".form()", adminActions=".actions()"
|
|
21
21
|
*/
|
|
22
|
-
declare const adminUserCollection:
|
|
22
|
+
declare const adminUserCollection: questpie437.CollectionBuilder<questpie_shared53.Override<{
|
|
23
23
|
name: "user";
|
|
24
24
|
fields: Record<string, never>;
|
|
25
25
|
localized: [];
|
|
@@ -39,123 +39,123 @@ declare const adminUserCollection: questpie296.CollectionBuilder<questpie_shared
|
|
|
39
39
|
}, {
|
|
40
40
|
name: "user";
|
|
41
41
|
fields: Record<string, never> & {
|
|
42
|
-
readonly name:
|
|
43
|
-
readonly email:
|
|
44
|
-
readonly emailVerified:
|
|
45
|
-
readonly image:
|
|
46
|
-
readonly avatar:
|
|
47
|
-
readonly role:
|
|
48
|
-
readonly banned:
|
|
49
|
-
readonly banReason:
|
|
50
|
-
readonly banExpires:
|
|
42
|
+
readonly name: drizzle_orm78.NotNull<drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>>;
|
|
43
|
+
readonly email: drizzle_orm78.NotNull<drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>>;
|
|
44
|
+
readonly emailVerified: drizzle_orm78.NotNull<drizzle_orm_pg_core128.PgBooleanBuilder>;
|
|
45
|
+
readonly image: drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>;
|
|
46
|
+
readonly avatar: drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>;
|
|
47
|
+
readonly role: drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>;
|
|
48
|
+
readonly banned: drizzle_orm78.HasDefault<drizzle_orm_pg_core128.PgBooleanBuilder>;
|
|
49
|
+
readonly banReason: drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>;
|
|
50
|
+
readonly banExpires: drizzle_orm_pg_core128.PgTimestampBuilder;
|
|
51
51
|
};
|
|
52
52
|
virtuals: undefined;
|
|
53
|
-
relations: Record<string, never> & Record<string,
|
|
53
|
+
relations: Record<string, never> & Record<string, questpie437.RelationConfig>;
|
|
54
54
|
indexes: Record<string, never> & Record<string, any>;
|
|
55
55
|
title: "name";
|
|
56
56
|
options: Record<string, never> & {
|
|
57
57
|
timestamps: true;
|
|
58
58
|
};
|
|
59
|
-
hooks:
|
|
60
|
-
access:
|
|
59
|
+
hooks: questpie_src_server_collection_builder_types_js17.CollectionHooksStorage;
|
|
60
|
+
access: questpie_src_server_collection_builder_types_js17.CollectionAccessStorage;
|
|
61
61
|
searchable: undefined;
|
|
62
62
|
fieldDefinitions: {
|
|
63
|
-
readonly name:
|
|
63
|
+
readonly name: questpie437.Field<Omit<questpie437.DefaultFieldState & {
|
|
64
64
|
type: "text";
|
|
65
65
|
data: string;
|
|
66
|
-
column:
|
|
67
|
-
operators: typeof
|
|
66
|
+
column: drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>;
|
|
67
|
+
operators: typeof questpie_src_server_fields_operators_builtin_js11.stringOps;
|
|
68
68
|
} & {
|
|
69
|
-
label:
|
|
69
|
+
label: questpie_shared53.I18nText;
|
|
70
70
|
}, "notNull" | "column"> & {
|
|
71
71
|
notNull: true;
|
|
72
|
-
column:
|
|
72
|
+
column: drizzle_orm78.NotNull<drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>>;
|
|
73
73
|
}>;
|
|
74
|
-
readonly email:
|
|
74
|
+
readonly email: questpie437.Field<Omit<questpie437.DefaultFieldState & {
|
|
75
75
|
type: "email";
|
|
76
76
|
data: string;
|
|
77
|
-
column:
|
|
78
|
-
operators: typeof
|
|
77
|
+
column: drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>;
|
|
78
|
+
operators: typeof questpie_src_server_fields_operators_builtin_js11.emailOps;
|
|
79
79
|
} & {
|
|
80
|
-
label:
|
|
80
|
+
label: questpie_shared53.I18nText;
|
|
81
81
|
} & {
|
|
82
|
-
description:
|
|
82
|
+
description: questpie_shared53.I18nText;
|
|
83
83
|
}, "notNull" | "column"> & {
|
|
84
84
|
notNull: true;
|
|
85
|
-
column:
|
|
85
|
+
column: drizzle_orm78.NotNull<drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>>;
|
|
86
86
|
}>;
|
|
87
|
-
readonly emailVerified:
|
|
87
|
+
readonly emailVerified: questpie437.Field<Omit<questpie437.DefaultFieldState & {
|
|
88
88
|
type: "boolean";
|
|
89
89
|
data: boolean;
|
|
90
|
-
column:
|
|
91
|
-
operators: typeof
|
|
90
|
+
column: drizzle_orm_pg_core128.PgBooleanBuilder;
|
|
91
|
+
operators: typeof questpie_src_server_fields_operators_builtin_js11.booleanOps;
|
|
92
92
|
} & {
|
|
93
|
-
label:
|
|
93
|
+
label: questpie_shared53.I18nText;
|
|
94
94
|
} & {
|
|
95
|
-
description:
|
|
95
|
+
description: questpie_shared53.I18nText;
|
|
96
96
|
}, "notNull" | "column"> & {
|
|
97
97
|
notNull: true;
|
|
98
|
-
column:
|
|
98
|
+
column: drizzle_orm78.NotNull<drizzle_orm_pg_core128.PgBooleanBuilder>;
|
|
99
99
|
}>;
|
|
100
|
-
readonly image:
|
|
100
|
+
readonly image: questpie437.FieldWithMethods<questpie437.DefaultFieldState & {
|
|
101
101
|
type: "url";
|
|
102
102
|
data: string;
|
|
103
|
-
column:
|
|
104
|
-
operators: typeof
|
|
103
|
+
column: drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>;
|
|
104
|
+
operators: typeof questpie_src_server_fields_operators_builtin_js11.urlOps;
|
|
105
105
|
} & {
|
|
106
|
-
label:
|
|
107
|
-
},
|
|
108
|
-
readonly avatar:
|
|
106
|
+
label: questpie_shared53.I18nText;
|
|
107
|
+
}, questpie437.UrlFieldMethods>;
|
|
108
|
+
readonly avatar: questpie437.Field<questpie437.DefaultFieldState & {
|
|
109
109
|
type: "upload";
|
|
110
110
|
data: string;
|
|
111
|
-
column:
|
|
112
|
-
operators: typeof
|
|
111
|
+
column: drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>;
|
|
112
|
+
operators: typeof questpie_src_server_fields_operators_builtin_js11.belongsToOps;
|
|
113
113
|
relationTo: "assets";
|
|
114
114
|
relationKind: "one";
|
|
115
115
|
} & {
|
|
116
|
-
label:
|
|
116
|
+
label: questpie_shared53.I18nText;
|
|
117
117
|
}>;
|
|
118
|
-
readonly role:
|
|
118
|
+
readonly role: questpie437.Field<questpie437.DefaultFieldState & {
|
|
119
119
|
type: "select";
|
|
120
120
|
data: "admin" | "user";
|
|
121
|
-
column:
|
|
122
|
-
operators: typeof
|
|
121
|
+
column: drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>;
|
|
122
|
+
operators: typeof questpie_src_server_fields_operators_builtin_js11.selectSingleOps;
|
|
123
123
|
} & {
|
|
124
|
-
label:
|
|
124
|
+
label: questpie_shared53.I18nText;
|
|
125
125
|
} & {
|
|
126
|
-
description:
|
|
126
|
+
description: questpie_shared53.I18nText;
|
|
127
127
|
}>;
|
|
128
|
-
readonly banned:
|
|
128
|
+
readonly banned: questpie437.Field<Omit<questpie437.DefaultFieldState & {
|
|
129
129
|
type: "boolean";
|
|
130
130
|
data: boolean;
|
|
131
|
-
column:
|
|
132
|
-
operators: typeof
|
|
131
|
+
column: drizzle_orm_pg_core128.PgBooleanBuilder;
|
|
132
|
+
operators: typeof questpie_src_server_fields_operators_builtin_js11.booleanOps;
|
|
133
133
|
} & {
|
|
134
|
-
label:
|
|
134
|
+
label: questpie_shared53.I18nText;
|
|
135
135
|
} & {
|
|
136
|
-
description:
|
|
136
|
+
description: questpie_shared53.I18nText;
|
|
137
137
|
}, "column" | "hasDefault"> & {
|
|
138
138
|
hasDefault: true;
|
|
139
|
-
column:
|
|
139
|
+
column: drizzle_orm78.HasDefault<drizzle_orm_pg_core128.PgBooleanBuilder>;
|
|
140
140
|
}>;
|
|
141
|
-
readonly banReason:
|
|
141
|
+
readonly banReason: questpie437.Field<questpie437.DefaultFieldState & {
|
|
142
142
|
type: "text";
|
|
143
143
|
data: string;
|
|
144
|
-
column:
|
|
145
|
-
operators: typeof
|
|
144
|
+
column: drizzle_orm_pg_core128.PgVarcharBuilder<[string, ...string[]]>;
|
|
145
|
+
operators: typeof questpie_src_server_fields_operators_builtin_js11.stringOps;
|
|
146
146
|
} & {
|
|
147
|
-
label:
|
|
147
|
+
label: questpie_shared53.I18nText;
|
|
148
148
|
}>;
|
|
149
|
-
readonly banExpires:
|
|
149
|
+
readonly banExpires: questpie437.FieldWithMethods<questpie437.DefaultFieldState & {
|
|
150
150
|
type: "datetime";
|
|
151
151
|
data: Date;
|
|
152
|
-
column:
|
|
153
|
-
operators: typeof
|
|
152
|
+
column: drizzle_orm_pg_core128.PgTimestampBuilder;
|
|
153
|
+
operators: typeof questpie_src_server_fields_operators_builtin_js11.dateOps;
|
|
154
154
|
} & {
|
|
155
|
-
label:
|
|
155
|
+
label: questpie_shared53.I18nText;
|
|
156
156
|
} & {
|
|
157
|
-
description:
|
|
158
|
-
},
|
|
157
|
+
description: questpie_shared53.I18nText;
|
|
158
|
+
}, questpie437.DatetimeFieldMethods>;
|
|
159
159
|
};
|
|
160
160
|
upload: undefined;
|
|
161
161
|
output: {};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
1
|
+
import * as questpie_shared52 from "questpie/shared";
|
|
2
|
+
import * as questpie409 from "questpie";
|
|
3
|
+
import * as questpie_src_server_modules_core_fields_email_js9 from "questpie/src/server/modules/core/fields/email.js";
|
|
4
|
+
import * as questpie_src_server_modules_core_fields_json_js9 from "questpie/src/server/modules/core/fields/json.js";
|
|
5
|
+
import * as drizzle_orm_pg_core122 from "drizzle-orm/pg-core";
|
|
6
|
+
import * as drizzle_orm72 from "drizzle-orm";
|
|
7
|
+
import * as questpie_src_server_collection_builder_types_js15 from "questpie/src/server/collection/builder/types.js";
|
|
8
8
|
|
|
9
9
|
//#region src/server/modules/admin/collections/verification.d.ts
|
|
10
|
-
declare const _default:
|
|
11
|
-
readonly text: typeof
|
|
12
|
-
readonly textarea: typeof
|
|
13
|
-
readonly email: typeof
|
|
14
|
-
readonly url: typeof
|
|
15
|
-
readonly number: typeof
|
|
16
|
-
readonly boolean: typeof
|
|
17
|
-
readonly date: typeof
|
|
18
|
-
readonly datetime: typeof
|
|
19
|
-
readonly time: typeof
|
|
20
|
-
readonly select: typeof
|
|
21
|
-
readonly upload: typeof
|
|
22
|
-
readonly relation: typeof
|
|
23
|
-
readonly object: typeof
|
|
24
|
-
readonly json: typeof
|
|
25
|
-
readonly from: typeof
|
|
10
|
+
declare const _default: questpie409.CollectionBuilder<questpie_shared52.Override<questpie409.EmptyCollectionState<"verification", undefined, {
|
|
11
|
+
readonly text: typeof questpie409.text;
|
|
12
|
+
readonly textarea: typeof questpie409.textarea;
|
|
13
|
+
readonly email: typeof questpie_src_server_modules_core_fields_email_js9.email;
|
|
14
|
+
readonly url: typeof questpie409.url;
|
|
15
|
+
readonly number: typeof questpie409.number;
|
|
16
|
+
readonly boolean: typeof questpie409.boolean;
|
|
17
|
+
readonly date: typeof questpie409.date;
|
|
18
|
+
readonly datetime: typeof questpie409.datetime;
|
|
19
|
+
readonly time: typeof questpie409.time;
|
|
20
|
+
readonly select: typeof questpie409.select;
|
|
21
|
+
readonly upload: typeof questpie409.upload;
|
|
22
|
+
readonly relation: typeof questpie409.relation;
|
|
23
|
+
readonly object: typeof questpie409.object;
|
|
24
|
+
readonly json: typeof questpie_src_server_modules_core_fields_json_js9.json;
|
|
25
|
+
readonly from: typeof questpie409.from;
|
|
26
26
|
}>, {
|
|
27
27
|
name: "verification";
|
|
28
28
|
fields: Record<string, any> & {
|
|
29
|
-
readonly identifier:
|
|
30
|
-
readonly value:
|
|
31
|
-
readonly expiresAt:
|
|
29
|
+
readonly identifier: drizzle_orm72.NotNull<drizzle_orm_pg_core122.PgVarcharBuilder<[string, ...string[]]>>;
|
|
30
|
+
readonly value: drizzle_orm72.NotNull<drizzle_orm_pg_core122.PgVarcharBuilder<[string, ...string[]]>>;
|
|
31
|
+
readonly expiresAt: drizzle_orm72.NotNull<drizzle_orm_pg_core122.PgTimestampBuilder>;
|
|
32
32
|
};
|
|
33
33
|
virtuals: undefined;
|
|
34
|
-
relations: Record<string,
|
|
34
|
+
relations: Record<string, questpie409.RelationConfig>;
|
|
35
35
|
indexes: Record<string, any>;
|
|
36
36
|
title: "identifier";
|
|
37
|
-
options:
|
|
37
|
+
options: questpie409.CollectionOptions & {
|
|
38
38
|
timestamps: true;
|
|
39
39
|
};
|
|
40
|
-
hooks:
|
|
41
|
-
access:
|
|
40
|
+
hooks: questpie_src_server_collection_builder_types_js15.CollectionHooksStorage;
|
|
41
|
+
access: questpie_src_server_collection_builder_types_js15.CollectionAccessStorage;
|
|
42
42
|
searchable: undefined;
|
|
43
43
|
fieldDefinitions: {
|
|
44
|
-
readonly identifier:
|
|
44
|
+
readonly identifier: questpie409.FieldWithMethods<Omit<questpie409.TextFieldState, "notNull" | "column"> & {
|
|
45
45
|
notNull: true;
|
|
46
|
-
column:
|
|
47
|
-
},
|
|
48
|
-
readonly value:
|
|
46
|
+
column: drizzle_orm72.NotNull<drizzle_orm_pg_core122.PgVarcharBuilder<[string, ...string[]]>>;
|
|
47
|
+
}, questpie409.TextFieldMethods>;
|
|
48
|
+
readonly value: questpie409.FieldWithMethods<Omit<questpie409.TextFieldState, "notNull" | "column"> & {
|
|
49
49
|
notNull: true;
|
|
50
|
-
column:
|
|
51
|
-
},
|
|
52
|
-
readonly expiresAt:
|
|
50
|
+
column: drizzle_orm72.NotNull<drizzle_orm_pg_core122.PgVarcharBuilder<[string, ...string[]]>>;
|
|
51
|
+
}, questpie409.TextFieldMethods>;
|
|
52
|
+
readonly expiresAt: questpie409.FieldWithMethods<Omit<questpie409.DatetimeFieldState, "notNull" | "column"> & {
|
|
53
53
|
notNull: true;
|
|
54
|
-
column:
|
|
55
|
-
},
|
|
54
|
+
column: drizzle_orm72.NotNull<drizzle_orm_pg_core122.PgTimestampBuilder>;
|
|
55
|
+
}, questpie409.DatetimeFieldMethods>;
|
|
56
56
|
};
|
|
57
57
|
upload: undefined;
|
|
58
58
|
output: {};
|
|
@@ -12,9 +12,18 @@ import { z } from "zod";
|
|
|
12
12
|
* They mirror the server augmentation types but are pure data
|
|
13
13
|
* (no functions, no callbacks, no non-serializable fields).
|
|
14
14
|
*/
|
|
15
|
+
function containsFunction(value, seen = /* @__PURE__ */ new WeakSet()) {
|
|
16
|
+
if (typeof value === "function") return true;
|
|
17
|
+
if (!value || typeof value !== "object") return false;
|
|
18
|
+
if (seen.has(value)) return false;
|
|
19
|
+
seen.add(value);
|
|
20
|
+
if (Array.isArray(value)) return value.some((item) => containsFunction(item, seen));
|
|
21
|
+
return Object.values(value).some((item) => containsFunction(item, seen));
|
|
22
|
+
}
|
|
23
|
+
const serializableUnknownSchema = z.unknown().refine((value) => !containsFunction(value), { message: "Functions cannot be serialized in admin config DTOs" });
|
|
15
24
|
const componentReferenceSchema = z.object({
|
|
16
25
|
type: z.string(),
|
|
17
|
-
props: z.record(z.string(),
|
|
26
|
+
props: z.record(z.string(), serializableUnknownSchema).optional()
|
|
18
27
|
});
|
|
19
28
|
const sidebarItemSchema = z.discriminatedUnion("type", [
|
|
20
29
|
z.object({
|
|
@@ -99,8 +108,8 @@ const dashboardConfigSchema = z.object({
|
|
|
99
108
|
rowHeight: z.union([z.number(), z.string()]).optional(),
|
|
100
109
|
gap: z.number().optional(),
|
|
101
110
|
realtime: z.boolean().optional(),
|
|
102
|
-
actions: z.array(
|
|
103
|
-
items: z.array(z.record(z.string(),
|
|
111
|
+
actions: z.array(serializableUnknownSchema).optional(),
|
|
112
|
+
items: z.array(z.record(z.string(), serializableUnknownSchema)).optional()
|
|
104
113
|
});
|
|
105
114
|
const brandLogoSchema = z.union([
|
|
106
115
|
z.string(),
|
|
@@ -120,6 +129,27 @@ const brandingConfigSchema = z.object({
|
|
|
120
129
|
tagline: i18nTextSchema.optional(),
|
|
121
130
|
favicon: z.string().optional()
|
|
122
131
|
});
|
|
132
|
+
const blockAdminSchema = z.object({
|
|
133
|
+
label: serializableUnknownSchema.optional(),
|
|
134
|
+
description: serializableUnknownSchema.optional(),
|
|
135
|
+
icon: componentReferenceSchema.optional(),
|
|
136
|
+
category: z.object({
|
|
137
|
+
label: serializableUnknownSchema,
|
|
138
|
+
icon: componentReferenceSchema.optional(),
|
|
139
|
+
order: z.number().optional()
|
|
140
|
+
}).optional(),
|
|
141
|
+
order: z.number().optional(),
|
|
142
|
+
hidden: z.boolean().optional()
|
|
143
|
+
});
|
|
144
|
+
const blockSchema = z.object({
|
|
145
|
+
name: z.string(),
|
|
146
|
+
admin: blockAdminSchema.optional(),
|
|
147
|
+
allowChildren: z.boolean().optional(),
|
|
148
|
+
maxChildren: z.number().optional(),
|
|
149
|
+
hasPrefetch: z.boolean(),
|
|
150
|
+
fields: z.record(z.string(), serializableUnknownSchema),
|
|
151
|
+
form: z.object({ fields: z.array(serializableUnknownSchema) }).optional()
|
|
152
|
+
});
|
|
123
153
|
/**
|
|
124
154
|
* Zod schema for the complete AdminConfigDTO.
|
|
125
155
|
* Can be used as the outputSchema for the getAdminConfig route.
|
|
@@ -129,7 +159,7 @@ const adminConfigDTOSchema = z.object({
|
|
|
129
159
|
sidebar: sidebarConfigSchema.optional(),
|
|
130
160
|
shell: adminShellConfigSchema.optional(),
|
|
131
161
|
branding: brandingConfigSchema.optional(),
|
|
132
|
-
blocks: z.record(z.string(),
|
|
162
|
+
blocks: z.record(z.string(), blockSchema).optional(),
|
|
133
163
|
collections: z.record(z.string(), collectionMetaSchema).optional(),
|
|
134
164
|
globals: z.record(z.string(), collectionMetaSchema).optional(),
|
|
135
165
|
uploads: uploadsConfigSchema.optional()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createActionCallbackProxy } from "../../proxy-factories.mjs";
|
|
1
|
+
import { createActionCallbackProxy, createActionFieldBuilderProxy } from "../../proxy-factories.mjs";
|
|
2
2
|
import { CollectionBuilder } from "questpie";
|
|
3
3
|
|
|
4
4
|
//#region src/server/modules/admin/factories.ts
|
|
@@ -26,37 +26,6 @@ const _componentProxy = new Proxy({}, { get: (_, prop) => (...args) => ({
|
|
|
26
26
|
props: typeof args[0] === "string" ? { name: args[0] } : args[0] ?? {}
|
|
27
27
|
}) });
|
|
28
28
|
const _fieldRefProxy = new Proxy({}, { get: (_, prop) => String(prop) });
|
|
29
|
-
/**
|
|
30
|
-
* Field builder proxy for actions context.
|
|
31
|
-
* Supports `f.text().required().label({...})` chaining.
|
|
32
|
-
* Each method call returns a new proxy with accumulated properties.
|
|
33
|
-
*/
|
|
34
|
-
function _createFieldBuilderProxy() {
|
|
35
|
-
return new Proxy({}, { get: (_, prop) => {
|
|
36
|
-
if (typeof prop !== "string") return void 0;
|
|
37
|
-
return (...args) => {
|
|
38
|
-
const def = { type: prop };
|
|
39
|
-
if (Array.isArray(args[0])) def.options = args[0];
|
|
40
|
-
else if (args[0] && typeof args[0] === "object") Object.assign(def, args[0]);
|
|
41
|
-
else if (args[0] !== void 0) def.value = args[0];
|
|
42
|
-
return _chainable(def);
|
|
43
|
-
};
|
|
44
|
-
} });
|
|
45
|
-
}
|
|
46
|
-
function _chainable(def) {
|
|
47
|
-
return new Proxy(def, { get: (target, prop) => {
|
|
48
|
-
if (typeof prop !== "string") return Reflect.get(target, prop);
|
|
49
|
-
if (prop in target) return target[prop];
|
|
50
|
-
if (prop === "set") return (key, value) => _chainable({
|
|
51
|
-
...target,
|
|
52
|
-
[key]: value
|
|
53
|
-
});
|
|
54
|
-
return (...args) => _chainable({
|
|
55
|
-
...target,
|
|
56
|
-
[prop]: args.length === 0 ? true : args[0]
|
|
57
|
-
});
|
|
58
|
-
} });
|
|
59
|
-
}
|
|
60
29
|
const _actionBuilderProxy = createActionCallbackProxy();
|
|
61
30
|
const _simpleActionProxy = createActionCallbackProxy();
|
|
62
31
|
const _collExt = {
|
|
@@ -81,7 +50,8 @@ const _collExt = {
|
|
|
81
50
|
collectionTable: "collection-table"
|
|
82
51
|
}),
|
|
83
52
|
f: _fieldRefProxy,
|
|
84
|
-
a: _simpleActionProxy
|
|
53
|
+
a: _simpleActionProxy,
|
|
54
|
+
c: _componentProxy
|
|
85
55
|
}) : configOrFn
|
|
86
56
|
};
|
|
87
57
|
}
|
|
@@ -112,7 +82,7 @@ const _collExt = {
|
|
|
112
82
|
if (typeof configOrFn === "function") return configOrFn({
|
|
113
83
|
a: _actionBuilderProxy,
|
|
114
84
|
c: _componentProxy,
|
|
115
|
-
f:
|
|
85
|
+
f: createActionFieldBuilderProxy()
|
|
116
86
|
});
|
|
117
87
|
return configOrFn;
|
|
118
88
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as questpie459 from "questpie";
|
|
2
2
|
|
|
3
3
|
//#region src/server/modules/admin/routes/admin-config.d.ts
|
|
4
4
|
|
|
@@ -7,7 +7,8 @@ import * as questpie259 from "questpie";
|
|
|
7
7
|
* Registered via module routes and exposed through the fetch handler.
|
|
8
8
|
*/
|
|
9
9
|
declare const adminConfigFunctions: {
|
|
10
|
-
readonly getAdminConfig:
|
|
10
|
+
readonly getAdminConfig: questpie459.JsonRouteDefinition<Record<string, never> | undefined, any, questpie459.JsonRouteParams>;
|
|
11
|
+
readonly getPublicAdminConfig: questpie459.JsonRouteDefinition<Record<string, never> | undefined, any, questpie459.JsonRouteParams>;
|
|
11
12
|
};
|
|
12
13
|
//#endregion
|
|
13
14
|
export { adminConfigFunctions };
|
|
@@ -514,6 +514,11 @@ async function processDashboardItems(items, accessibleCollections, accessCtx) {
|
|
|
514
514
|
}
|
|
515
515
|
const getAdminConfigSchema = z.object({}).optional();
|
|
516
516
|
const getAdminConfigOutputSchema = adminConfigDTOSchema;
|
|
517
|
+
function buildPublicAdminConfig(adminCfg) {
|
|
518
|
+
const response = {};
|
|
519
|
+
if (adminCfg.branding) response.branding = adminCfg.branding;
|
|
520
|
+
return stripUndefinedDeep(response);
|
|
521
|
+
}
|
|
517
522
|
/**
|
|
518
523
|
* Get admin configuration including dashboard, sidebar, blocks,
|
|
519
524
|
* and collection/global metadata.
|
|
@@ -535,7 +540,7 @@ const getAdminConfigOutputSchema = adminConfigDTOSchema;
|
|
|
535
540
|
* const config = await client.routes.getAdminConfig({});
|
|
536
541
|
* ```
|
|
537
542
|
*/
|
|
538
|
-
const getAdminConfig = route().post().access((ctx) =>
|
|
543
|
+
const getAdminConfig = route().post().access((ctx) => ctx.session?.user?.role === "admin").schema(getAdminConfigSchema).outputSchema(getAdminConfigOutputSchema).handler(async (ctx) => {
|
|
539
544
|
const app = getApp(ctx);
|
|
540
545
|
const appState = getAppState(app);
|
|
541
546
|
const adminCfg = getAdminConfig$1(app);
|
|
@@ -590,10 +595,21 @@ const getAdminConfig = route().post().access((ctx) => !!ctx.session).schema(getA
|
|
|
590
595
|
return stripUndefinedDeep(response);
|
|
591
596
|
});
|
|
592
597
|
/**
|
|
598
|
+
* Get public admin bootstrap configuration for unauthenticated auth pages.
|
|
599
|
+
*
|
|
600
|
+
* This intentionally exposes only branding. Full admin config, sidebar,
|
|
601
|
+
* dashboard, blocks, upload collections, and resource metadata stay behind
|
|
602
|
+
* getAdminConfig's admin-session guard.
|
|
603
|
+
*/
|
|
604
|
+
const getPublicAdminConfig = route().post().access(true).schema(getAdminConfigSchema).outputSchema(getAdminConfigOutputSchema).handler(async (ctx) => buildPublicAdminConfig(getAdminConfig$1(getApp(ctx))));
|
|
605
|
+
/**
|
|
593
606
|
* Admin config route handlers.
|
|
594
607
|
* Registered via module routes and exposed through the fetch handler.
|
|
595
608
|
*/
|
|
596
|
-
const adminConfigFunctions = {
|
|
609
|
+
const adminConfigFunctions = {
|
|
610
|
+
getAdminConfig,
|
|
611
|
+
getPublicAdminConfig
|
|
612
|
+
};
|
|
597
613
|
|
|
598
614
|
//#endregion
|
|
599
615
|
export { adminConfigFunctions };
|