@questpie/admin 3.0.3 → 3.0.4
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 +34 -5
- package/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +4 -1
- package/dist/client/builder/types/action-types.d.mts +31 -3
- package/dist/client/builder/types/collection-types.d.mts +140 -0
- package/dist/client/builder/types/ui-config.d.mts +16 -2
- package/dist/client/builder/types/views.d.mts +57 -0
- package/dist/client/builder/types/widget-types.d.mts +5 -0
- package/dist/client/components/actions/action-button.mjs +137 -199
- package/dist/client/components/actions/action-dialog.mjs +198 -156
- package/dist/client/components/actions/confirmation-dialog.mjs +2 -2
- package/dist/client/components/actions/header-actions.mjs +52 -53
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/auth/auth-loading.mjs +41 -18
- package/dist/client/components/blocks/block-fields-renderer.mjs +64 -28
- package/dist/client/components/blocks/block-insert-button.mjs +4 -4
- package/dist/client/components/blocks/block-item.mjs +2 -2
- package/dist/client/components/blocks/block-library-sidebar.mjs +2 -2
- package/dist/client/components/component-renderer.mjs +1 -1
- package/dist/client/components/fields/array-field.mjs +14 -14
- package/dist/client/components/fields/asset-preview-field.mjs +1 -1
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +84 -104
- package/dist/client/components/fields/json-field.mjs +2 -2
- package/dist/client/components/fields/object-array-field.mjs +22 -22
- package/dist/client/components/fields/object-field.mjs +5 -5
- package/dist/client/components/fields/relation/displays/cards-display.mjs +16 -9
- package/dist/client/components/fields/relation/displays/chips-display.mjs +15 -12
- package/dist/client/components/fields/relation/displays/grid-display.mjs +15 -11
- package/dist/client/components/fields/relation/displays/list-display.mjs +33 -20
- package/dist/client/components/fields/relation/displays/table-display.mjs +62 -93
- package/dist/client/components/fields/relation/relation-items-display.mjs +1 -1
- package/dist/client/components/fields/relation-picker.mjs +7 -6
- package/dist/client/components/fields/relation-select.mjs +71 -47
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +392 -82
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +54 -23
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +24 -50
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +66 -0
- package/dist/client/components/fields/rich-text-editor/index.d.mts +38 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +637 -376
- package/dist/client/components/fields/rich-text-editor/link-utils.mjs +26 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +10 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +27 -6
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +464 -346
- package/dist/client/components/fields/rich-text-editor/types.d.mts +77 -0
- package/dist/client/components/fields/upload-field.mjs +45 -49
- package/dist/client/components/filter-builder/columns-tab.mjs +69 -62
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +473 -308
- package/dist/client/components/filter-builder/filters-tab.mjs +109 -82
- package/dist/client/components/filter-builder/saved-views-tab.mjs +300 -198
- package/dist/client/components/history-sidebar.mjs +850 -340
- package/dist/client/components/layout/field-layout-renderer.mjs +6 -5
- package/dist/client/components/locale-switcher.mjs +8 -8
- package/dist/client/components/media/media-grid.mjs +12 -9
- package/dist/client/components/media/media-picker-dialog.mjs +242 -230
- package/dist/client/components/preview/live-preview-mode.mjs +1 -1
- package/dist/client/components/primitives/asset-preview.mjs +37 -22
- package/dist/client/components/primitives/date-input.mjs +212 -249
- package/dist/client/components/primitives/dropzone.mjs +192 -159
- package/dist/client/components/primitives/field-select-control.mjs +93 -0
- package/dist/client/components/primitives/select-multi.mjs +251 -230
- package/dist/client/components/primitives/select-single.mjs +345 -290
- package/dist/client/components/primitives/time-input.mjs +2 -2
- package/dist/client/components/sheets/resource-sheet.mjs +2 -0
- package/dist/client/components/ui/accordion.mjs +4 -4
- package/dist/client/components/ui/alert.mjs +3 -3
- package/dist/client/components/ui/badge.mjs +4 -4
- package/dist/client/components/ui/button.mjs +47 -37
- package/dist/client/components/ui/card.mjs +2 -2
- package/dist/client/components/ui/checkbox.mjs +1 -1
- package/dist/client/components/ui/command.mjs +5 -5
- package/dist/client/components/ui/dialog.mjs +3 -3
- package/dist/client/components/ui/drawer.mjs +1 -1
- package/dist/client/components/ui/dropdown-menu.mjs +157 -15
- package/dist/client/components/ui/empty-state.mjs +88 -59
- package/dist/client/components/ui/field.mjs +2 -2
- package/dist/client/components/ui/input-group.mjs +3 -3
- package/dist/client/components/ui/input.mjs +1 -1
- package/dist/client/components/ui/kbd.mjs +1 -1
- package/dist/client/components/ui/label.mjs +1 -1
- package/dist/client/components/ui/popover.mjs +19 -11
- package/dist/client/components/ui/scroll-fade.mjs +170 -0
- package/dist/client/components/ui/search-input.mjs +1 -1
- package/dist/client/components/ui/select.mjs +129 -27
- package/dist/client/components/ui/sheet.mjs +54 -34
- package/dist/client/components/ui/sidebar.mjs +15 -14
- package/dist/client/components/ui/skeleton.mjs +28 -12
- package/dist/client/components/ui/switch.mjs +2 -2
- package/dist/client/components/ui/table.mjs +82 -74
- package/dist/client/components/ui/tabs.mjs +26 -31
- package/dist/client/components/ui/textarea.mjs +1 -1
- package/dist/client/components/ui/tooltip.mjs +1 -1
- package/dist/client/components/widgets/chart-widget.mjs +134 -96
- package/dist/client/components/widgets/progress-widget.mjs +59 -34
- package/dist/client/components/widgets/quick-actions-widget.mjs +184 -113
- package/dist/client/components/widgets/recent-items-widget.mjs +144 -102
- package/dist/client/components/widgets/stats-widget.mjs +91 -72
- package/dist/client/components/widgets/table-widget.mjs +159 -246
- package/dist/client/components/widgets/timeline-widget.mjs +66 -43
- package/dist/client/components/widgets/value-widget.mjs +261 -152
- package/dist/client/components/widgets/widget-empty-state.mjs +88 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +53 -20
- package/dist/client/contexts/focus-context.d.mts +2 -2
- package/dist/client/hooks/use-action.mjs +63 -55
- package/dist/client/hooks/use-audit-history.mjs +1 -65
- package/dist/client/hooks/use-collection-validation.mjs +36 -23
- package/dist/client/hooks/use-collection.mjs +96 -1
- package/dist/client/hooks/use-saved-views.mjs +70 -49
- package/dist/client/hooks/use-server-actions.mjs +59 -40
- package/dist/client/hooks/use-server-validation.mjs +156 -41
- package/dist/client/hooks/use-server-widget-data.mjs +1 -1
- package/dist/client/hooks/use-setup-status.d.mts +3 -3
- package/dist/client/hooks/use-setup-status.mjs +2 -2
- package/dist/client/hooks/use-transition-stage.mjs +2 -10
- package/dist/client/hooks/use-validation-error-map.mjs +31 -13
- package/dist/client/hooks/use-view-state.mjs +238 -174
- package/dist/client/i18n/date-locale.mjs +33 -0
- package/dist/client/i18n/hooks.mjs +17 -1
- package/dist/client/lib/utils.mjs +3 -2
- 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/preview/preview-field.mjs +2 -2
- package/dist/client/runtime/provider.mjs +8 -1
- package/dist/client/runtime/translations-provider.mjs +1 -1
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/styles/base.css +1022 -0
- package/dist/client/styles/index.css +3 -589
- package/dist/client/utils/auto-expand-fields.mjs +4 -2
- package/dist/client/utils/keyboard-shortcuts.mjs +26 -0
- package/dist/client/utils/use-lazy-component.mjs +80 -0
- package/dist/client/views/auth/auth-layout.d.mts +18 -11
- package/dist/client/views/auth/auth-layout.mjs +291 -80
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/forgot-password-form.mjs +2 -2
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +1 -1
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.mjs +2 -2
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/collection/auto-form-fields.mjs +11 -9
- package/dist/client/views/collection/bulk-action-toolbar.mjs +173 -138
- package/dist/client/views/collection/cells/complex-cells.mjs +22 -22
- package/dist/client/views/collection/cells/primitive-cells.mjs +1 -1
- package/dist/client/views/collection/cells/relation-cells.mjs +147 -129
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +224 -278
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +64 -36
- package/dist/client/views/collection/cells/upload-cells.mjs +199 -9
- package/dist/client/views/collection/columns/build-columns.mjs +29 -9
- package/dist/client/views/collection/columns/column-defaults.mjs +2 -2
- package/dist/client/views/collection/field-renderer.mjs +50 -89
- package/dist/client/views/collection/form-view.mjs +237 -227
- package/dist/client/views/collection/table-view.mjs +1162 -229
- package/dist/client/views/collection/view-skeletons.mjs +222 -79
- package/dist/client/views/common/global-search.mjs +29 -18
- package/dist/client/views/dashboard/dashboard-grid.mjs +678 -501
- package/dist/client/views/dashboard/dashboard-widget.mjs +6 -3
- package/dist/client/views/dashboard/widget-card.mjs +23 -14
- package/dist/client/views/globals/global-form-view.mjs +634 -589
- package/dist/client/views/layout/admin-layout-provider.mjs +67 -70
- package/dist/client/views/layout/admin-layout.d.mts +3 -6
- package/dist/client/views/layout/admin-layout.mjs +149 -172
- package/dist/client/views/layout/admin-router.mjs +747 -544
- package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
- package/dist/client/views/layout/admin-sidebar.mjs +751 -591
- package/dist/client/views/layout/admin-theme.d.mts +10 -0
- package/dist/client/views/layout/admin-theme.mjs +84 -0
- package/dist/client/views/layout/admin-view-layout.mjs +161 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/accept-invite-page.mjs +49 -26
- 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/forgot-password-page.mjs +2 -19
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.mjs +2 -19
- package/dist/client/views/pages/login-page.d.mts +1 -1
- package/dist/client/views/pages/login-page.mjs +4 -21
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.mjs +3 -20
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +3 -20
- package/dist/client.d.mts +6 -2
- package/dist/client.mjs +2 -1
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/index.d.mts +6 -2
- package/dist/index.mjs +2 -1
- package/dist/server/augmentation/dashboard.d.mts +67 -3
- package/dist/server/augmentation/form-layout.d.mts +21 -0
- package/dist/server/augmentation/index.d.mts +1 -1
- package/dist/server/codegen/admin-client-template.mjs +4 -0
- package/dist/server/fields/blocks.d.mts +1 -1
- package/dist/server/fields/blocks.mjs +12 -0
- package/dist/server/fields/rich-text.d.mts +1 -1
- package/dist/server/fields/rich-text.mjs +8 -0
- package/dist/server/i18n/index.mjs +17 -1
- package/dist/server/i18n/messages/cs.mjs +23 -0
- package/dist/server/i18n/messages/de.mjs +23 -0
- package/dist/server/i18n/messages/en.mjs +64 -1
- package/dist/server/i18n/messages/es.mjs +23 -0
- package/dist/server/i18n/messages/fr.mjs +23 -0
- package/dist/server/i18n/messages/pl.mjs +23 -0
- package/dist/server/i18n/messages/pt.mjs +23 -0
- package/dist/server/i18n/messages/sk.mjs +83 -1
- package/dist/server/modules/admin/block/introspection.mjs +4 -1
- package/dist/server/modules/admin/block/prefetch.mjs +12 -2
- package/dist/server/modules/admin/collections/account.d.mts +50 -50
- package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
- 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 +68 -68
- package/dist/server/modules/admin/collections/assets.d.mts +20 -20
- package/dist/server/modules/admin/collections/assets.mjs +0 -1
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +12 -0
- package/dist/server/modules/admin/collections/user.mjs +40 -9
- package/dist/server/modules/admin/collections/verification.d.mts +2 -2
- package/dist/server/modules/admin/dto/admin-config.dto.mjs +2 -0
- package/dist/server/modules/admin/factories.mjs +7 -18
- package/dist/server/modules/admin/index.d.mts +1 -1
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/admin-config.mjs +34 -16
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/execute-action.mjs +33 -0
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/setup.d.mts +10 -10
- package/dist/server/modules/admin/routes/setup.mjs +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/translations.mjs +5 -1
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +1 -1
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
- package/dist/server/modules/audit/.generated/module.d.mts +1 -1
- package/dist/server/modules/audit/.generated/module.mjs +1 -1
- package/dist/server/modules/audit/collections/audit-log.d.mts +2 -2
- package/dist/server/modules/audit/collections/audit-log.mjs +1 -1
- package/dist/server/modules/audit/config/app.mjs +99 -42
- package/dist/server/modules/audit/jobs/audit-cleanup.mjs +1 -1
- package/dist/server/plugin.mjs +4 -2
- package/dist/server/proxy-factories.d.mts +4 -3
- package/dist/server/proxy-factories.mjs +34 -8
- package/dist/shared/types/saved-views.types.d.mts +2 -0
- package/package.json +6 -4
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +0 -85
- package/dist/client/components/ui/spinner.mjs +0 -52
- package/dist/client/components/ui/toolbar.mjs +0 -136
- package/dist/client/contexts/breadcrumb-context.mjs +0 -60
- package/dist/client/views/layout/admin-topbar.mjs +0 -236
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
1
|
+
import * as questpie_shared42 from "questpie/shared";
|
|
2
|
+
import * as questpie373 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_core106 from "drizzle-orm/pg-core";
|
|
6
|
+
import * as drizzle_orm65 from "drizzle-orm";
|
|
7
7
|
|
|
8
8
|
//#region src/server/modules/admin/collections/session.d.ts
|
|
9
|
-
declare const _default:
|
|
10
|
-
readonly text: typeof
|
|
11
|
-
readonly textarea: typeof
|
|
12
|
-
readonly email: typeof
|
|
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
|
|
23
|
-
readonly json: typeof
|
|
24
|
-
readonly from: typeof
|
|
9
|
+
declare const _default: questpie373.CollectionBuilder<questpie_shared42.Override<questpie373.EmptyCollectionState<"session", undefined, {
|
|
10
|
+
readonly text: typeof questpie373.text;
|
|
11
|
+
readonly textarea: typeof questpie373.textarea;
|
|
12
|
+
readonly email: typeof questpie_src_server_modules_core_fields_email_js8.email;
|
|
13
|
+
readonly url: typeof questpie373.url;
|
|
14
|
+
readonly number: typeof questpie373.number;
|
|
15
|
+
readonly boolean: typeof questpie373.boolean;
|
|
16
|
+
readonly date: typeof questpie373.date;
|
|
17
|
+
readonly datetime: typeof questpie373.datetime;
|
|
18
|
+
readonly time: typeof questpie373.time;
|
|
19
|
+
readonly select: typeof questpie373.select;
|
|
20
|
+
readonly upload: typeof questpie373.upload;
|
|
21
|
+
readonly relation: typeof questpie373.relation;
|
|
22
|
+
readonly object: typeof questpie373.object;
|
|
23
|
+
readonly json: typeof questpie_src_server_modules_core_fields_json_js8.json;
|
|
24
|
+
readonly from: typeof questpie373.from;
|
|
25
25
|
}>, {
|
|
26
26
|
name: "session";
|
|
27
27
|
fields: Record<string, any> & {
|
|
28
|
-
readonly userId:
|
|
29
|
-
readonly token:
|
|
30
|
-
readonly expiresAt:
|
|
31
|
-
readonly ipAddress:
|
|
32
|
-
readonly userAgent:
|
|
33
|
-
readonly impersonatedBy:
|
|
28
|
+
readonly userId: drizzle_orm65.NotNull<drizzle_orm_pg_core106.PgVarcharBuilder<[string, ...string[]]>>;
|
|
29
|
+
readonly token: drizzle_orm65.NotNull<drizzle_orm_pg_core106.PgVarcharBuilder<[string, ...string[]]>>;
|
|
30
|
+
readonly expiresAt: drizzle_orm65.NotNull<drizzle_orm_pg_core106.PgTimestampBuilder>;
|
|
31
|
+
readonly ipAddress: drizzle_orm_pg_core106.PgVarcharBuilder<[string, ...string[]]>;
|
|
32
|
+
readonly userAgent: drizzle_orm_pg_core106.PgVarcharBuilder<[string, ...string[]]>;
|
|
33
|
+
readonly impersonatedBy: drizzle_orm_pg_core106.PgVarcharBuilder<[string, ...string[]]>;
|
|
34
34
|
};
|
|
35
35
|
virtuals: undefined;
|
|
36
|
-
relations: Record<string,
|
|
36
|
+
relations: Record<string, questpie373.RelationConfig>;
|
|
37
37
|
indexes: Record<string, any>;
|
|
38
38
|
title: "token";
|
|
39
|
-
options:
|
|
39
|
+
options: questpie373.CollectionOptions & {
|
|
40
40
|
timestamps: true;
|
|
41
41
|
};
|
|
42
42
|
hooks: Record<string, any>;
|
|
43
43
|
access: Record<string, any>;
|
|
44
44
|
searchable: undefined;
|
|
45
45
|
fieldDefinitions: {
|
|
46
|
-
readonly userId:
|
|
46
|
+
readonly userId: questpie373.FieldWithMethods<Omit<questpie373.TextFieldState, "notNull" | "column"> & {
|
|
47
47
|
notNull: true;
|
|
48
|
-
column:
|
|
49
|
-
},
|
|
50
|
-
readonly token:
|
|
48
|
+
column: drizzle_orm65.NotNull<drizzle_orm_pg_core106.PgVarcharBuilder<[string, ...string[]]>>;
|
|
49
|
+
}, questpie373.TextFieldMethods>;
|
|
50
|
+
readonly token: questpie373.FieldWithMethods<Omit<questpie373.TextFieldState, "notNull" | "column"> & {
|
|
51
51
|
notNull: true;
|
|
52
|
-
column:
|
|
53
|
-
},
|
|
54
|
-
readonly expiresAt:
|
|
52
|
+
column: drizzle_orm65.NotNull<drizzle_orm_pg_core106.PgVarcharBuilder<[string, ...string[]]>>;
|
|
53
|
+
}, questpie373.TextFieldMethods>;
|
|
54
|
+
readonly expiresAt: questpie373.FieldWithMethods<Omit<questpie373.DatetimeFieldState, "notNull" | "column"> & {
|
|
55
55
|
notNull: true;
|
|
56
|
-
column:
|
|
57
|
-
},
|
|
58
|
-
readonly ipAddress:
|
|
59
|
-
readonly userAgent:
|
|
60
|
-
readonly impersonatedBy:
|
|
56
|
+
column: drizzle_orm65.NotNull<drizzle_orm_pg_core106.PgTimestampBuilder>;
|
|
57
|
+
}, questpie373.DatetimeFieldMethods>;
|
|
58
|
+
readonly ipAddress: questpie373.FieldWithMethods<questpie373.TextFieldState, questpie373.TextFieldMethods>;
|
|
59
|
+
readonly userAgent: questpie373.FieldWithMethods<questpie373.TextFieldState, questpie373.TextFieldMethods>;
|
|
60
|
+
readonly impersonatedBy: questpie373.FieldWithMethods<questpie373.TextFieldState, questpie373.TextFieldMethods>;
|
|
61
61
|
};
|
|
62
62
|
upload: undefined;
|
|
63
63
|
output: {};
|
|
@@ -2,6 +2,7 @@ import * as questpie_shared44 from "questpie/shared";
|
|
|
2
2
|
import * as questpie434 from "questpie";
|
|
3
3
|
import * as drizzle_orm_pg_core121 from "drizzle-orm/pg-core";
|
|
4
4
|
import * as drizzle_orm77 from "drizzle-orm";
|
|
5
|
+
import * as questpie_src_server_fields_operators_builtin_js7 from "questpie/src/server/fields/operators/builtin.js";
|
|
5
6
|
|
|
6
7
|
//#region src/server/modules/admin/collections/user.d.ts
|
|
7
8
|
|
|
@@ -41,6 +42,7 @@ declare const adminUserCollection: questpie434.CollectionBuilder<questpie_shared
|
|
|
41
42
|
readonly email: drizzle_orm77.NotNull<drizzle_orm_pg_core121.PgVarcharBuilder<[string, ...string[]]>>;
|
|
42
43
|
readonly emailVerified: drizzle_orm77.NotNull<drizzle_orm_pg_core121.PgBooleanBuilder>;
|
|
43
44
|
readonly image: drizzle_orm_pg_core121.PgVarcharBuilder<[string, ...string[]]>;
|
|
45
|
+
readonly avatar: drizzle_orm_pg_core121.PgVarcharBuilder<[string, ...string[]]>;
|
|
44
46
|
readonly role: drizzle_orm_pg_core121.PgVarcharBuilder<[string, ...string[]]>;
|
|
45
47
|
readonly banned: drizzle_orm77.HasDefault<drizzle_orm_pg_core121.PgBooleanBuilder>;
|
|
46
48
|
readonly banReason: drizzle_orm_pg_core121.PgVarcharBuilder<[string, ...string[]]>;
|
|
@@ -70,6 +72,16 @@ declare const adminUserCollection: questpie434.CollectionBuilder<questpie_shared
|
|
|
70
72
|
column: drizzle_orm77.NotNull<drizzle_orm_pg_core121.PgBooleanBuilder>;
|
|
71
73
|
}>;
|
|
72
74
|
readonly image: questpie434.FieldWithMethods<questpie434.UrlFieldState, questpie434.UrlFieldMethods>;
|
|
75
|
+
readonly avatar: questpie434.Field<questpie434.DefaultFieldState & {
|
|
76
|
+
type: "upload";
|
|
77
|
+
data: string;
|
|
78
|
+
column: drizzle_orm_pg_core121.PgVarcharBuilder<[string, ...string[]]>;
|
|
79
|
+
operators: typeof questpie_src_server_fields_operators_builtin_js7.belongsToOps;
|
|
80
|
+
relationTo: "assets";
|
|
81
|
+
relationKind: "one";
|
|
82
|
+
} & {
|
|
83
|
+
label: questpie_shared44.I18nText;
|
|
84
|
+
}>;
|
|
73
85
|
readonly role: questpie434.FieldWithMethods<questpie434.TextFieldState, questpie434.TextFieldMethods>;
|
|
74
86
|
readonly banned: questpie434.Field<Omit<questpie434.BooleanFieldState, "column" | "hasDefault"> & {
|
|
75
87
|
hasDefault: true;
|
|
@@ -21,6 +21,7 @@ const adminUserCollection = collection$1("user").merge(starterModule.collections
|
|
|
21
21
|
group: "administration"
|
|
22
22
|
})).list(({ v, f, a }) => v.collectionTable({
|
|
23
23
|
columns: [
|
|
24
|
+
f.avatar,
|
|
24
25
|
f.name,
|
|
25
26
|
f.email,
|
|
26
27
|
f.role,
|
|
@@ -36,14 +37,13 @@ const adminUserCollection = collection$1("user").merge(starterModule.collections
|
|
|
36
37
|
primary: [],
|
|
37
38
|
secondary: []
|
|
38
39
|
},
|
|
39
|
-
row: [a.delete],
|
|
40
40
|
bulk: [a.deleteMany]
|
|
41
41
|
}
|
|
42
42
|
})).form(({ v, f }) => v.collectionForm({
|
|
43
43
|
sidebar: {
|
|
44
44
|
position: "right",
|
|
45
45
|
fields: [
|
|
46
|
-
f.
|
|
46
|
+
f.avatar,
|
|
47
47
|
f.role,
|
|
48
48
|
f.emailVerified
|
|
49
49
|
]
|
|
@@ -99,11 +99,36 @@ const adminUserCollection = collection$1("user").merge(starterModule.collections
|
|
|
99
99
|
description: { key: "defaults.users.actions.createUser.description" },
|
|
100
100
|
submitLabel: { key: "defaults.users.actions.createUser.submit" },
|
|
101
101
|
fields: {
|
|
102
|
-
name: f.text().label({ key: "defaults.users.fields.name.label" }).
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
name: f.text().label({ key: "defaults.users.fields.name.label" }).description({
|
|
103
|
+
en: "Shown in the admin panel and account profile.",
|
|
104
|
+
sk: "Zobrazí sa v administrácii a profile účtu."
|
|
105
|
+
}).required().set("admin", {
|
|
106
|
+
placeholder: {
|
|
107
|
+
key: "defaults.users.fields.name.placeholder",
|
|
108
|
+
fallback: "Enter the user's full name"
|
|
109
|
+
},
|
|
110
|
+
autoComplete: "name"
|
|
111
|
+
}),
|
|
112
|
+
email: f.email().label({ key: "defaults.users.fields.email.label" }).description({
|
|
113
|
+
en: "The address this user will use to sign in.",
|
|
114
|
+
sk: "Adresa, ktorú bude používateľ používať na prihlásenie."
|
|
115
|
+
}).required().set("admin", {
|
|
116
|
+
placeholder: {
|
|
117
|
+
en: "name@example.com",
|
|
118
|
+
sk: "meno@example.com"
|
|
119
|
+
},
|
|
120
|
+
autoComplete: "email"
|
|
121
|
+
}),
|
|
122
|
+
password: f.text().label({ key: "defaults.users.actions.createUser.fields.password.label" }).description({
|
|
123
|
+
en: "Share this password securely with the new user.",
|
|
124
|
+
sk: "Toto heslo bezpečne odovzdajte novému používateľovi."
|
|
125
|
+
}).required().set("admin", {
|
|
105
126
|
type: "password",
|
|
106
|
-
autoComplete: "new-password"
|
|
127
|
+
autoComplete: "new-password",
|
|
128
|
+
placeholder: {
|
|
129
|
+
key: "defaults.users.actions.createUser.fields.password.placeholder",
|
|
130
|
+
fallback: "Enter a temporary password"
|
|
131
|
+
}
|
|
107
132
|
}),
|
|
108
133
|
role: f.select([{
|
|
109
134
|
value: "admin",
|
|
@@ -111,7 +136,13 @@ const adminUserCollection = collection$1("user").merge(starterModule.collections
|
|
|
111
136
|
}, {
|
|
112
137
|
value: "user",
|
|
113
138
|
label: { key: "defaults.users.fields.role.options.user" }
|
|
114
|
-
}]).label({ key: "defaults.users.fields.role.label" }).
|
|
139
|
+
}]).label({ key: "defaults.users.fields.role.label" }).description({
|
|
140
|
+
en: "Admins can manage the whole admin area; users have limited access.",
|
|
141
|
+
sk: "Administrátori môžu spravovať celú administráciu; používatelia majú obmedzený prístup."
|
|
142
|
+
}).default("user").set("admin", { placeholder: {
|
|
143
|
+
en: "Select a role",
|
|
144
|
+
sk: "Vyberte rolu"
|
|
145
|
+
} })
|
|
115
146
|
}
|
|
116
147
|
},
|
|
117
148
|
handler: async ({ data, auth, session }) => {
|
|
@@ -156,11 +187,11 @@ const adminUserCollection = collection$1("user").merge(starterModule.collections
|
|
|
156
187
|
description: { key: "defaults.users.actions.resetPassword.description" },
|
|
157
188
|
submitLabel: { key: "defaults.users.actions.resetPassword.submit" },
|
|
158
189
|
fields: {
|
|
159
|
-
newPassword: f.text().label({ key: "defaults.users.actions.resetPassword.fields.newPassword.label" }).required().admin
|
|
190
|
+
newPassword: f.text().label({ key: "defaults.users.actions.resetPassword.fields.newPassword.label" }).required().set("admin", {
|
|
160
191
|
type: "password",
|
|
161
192
|
autoComplete: "new-password"
|
|
162
193
|
}),
|
|
163
|
-
confirmPassword: f.text().label({ key: "defaults.users.actions.resetPassword.fields.confirmPassword.label" }).required().admin
|
|
194
|
+
confirmPassword: f.text().label({ key: "defaults.users.actions.resetPassword.fields.confirmPassword.label" }).required().set("admin", {
|
|
164
195
|
type: "password",
|
|
165
196
|
autoComplete: "new-password"
|
|
166
197
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as questpie_shared43 from "questpie/shared";
|
|
2
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
3
|
import * as questpie_src_server_modules_core_fields_email_js9 from "questpie/src/server/modules/core/fields/email.js";
|
|
6
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_core115 from "drizzle-orm/pg-core";
|
|
6
|
+
import * as drizzle_orm71 from "drizzle-orm";
|
|
7
7
|
|
|
8
8
|
//#region src/server/modules/admin/collections/verification.d.ts
|
|
9
9
|
declare const _default: questpie408.CollectionBuilder<questpie_shared43.Override<questpie408.EmptyCollectionState<"verification", undefined, {
|
|
@@ -80,6 +80,8 @@ const dashboardConfigSchema = z.object({
|
|
|
80
80
|
title: z.record(z.string(), z.string()).optional(),
|
|
81
81
|
description: z.record(z.string(), z.string()).optional(),
|
|
82
82
|
columns: z.number().optional(),
|
|
83
|
+
rowHeight: z.union([z.number(), z.string()]).optional(),
|
|
84
|
+
gap: z.number().optional(),
|
|
83
85
|
realtime: z.boolean().optional(),
|
|
84
86
|
actions: z.array(z.any()).optional(),
|
|
85
87
|
items: z.array(z.record(z.string(), z.any())).optional()
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createActionCallbackProxy } from "../../proxy-factories.mjs";
|
|
1
2
|
import { CollectionBuilder } from "questpie";
|
|
2
3
|
|
|
3
4
|
//#region src/server/modules/admin/factories.ts
|
|
@@ -46,30 +47,18 @@ function _chainable(def) {
|
|
|
46
47
|
return new Proxy(def, { get: (target, prop) => {
|
|
47
48
|
if (typeof prop !== "string") return Reflect.get(target, prop);
|
|
48
49
|
if (prop in target) return target[prop];
|
|
50
|
+
if (prop === "set") return (key, value) => _chainable({
|
|
51
|
+
...target,
|
|
52
|
+
[key]: value
|
|
53
|
+
});
|
|
49
54
|
return (...args) => _chainable({
|
|
50
55
|
...target,
|
|
51
56
|
[prop]: args.length === 0 ? true : args[0]
|
|
52
57
|
});
|
|
53
58
|
} });
|
|
54
59
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
* Supports both `a.save()` (builtin) and `a.headerAction({...})` (custom).
|
|
58
|
-
*/
|
|
59
|
-
const _actionBuilderProxy = new Proxy({}, { get: (_, prop) => {
|
|
60
|
-
if (typeof prop !== "string") return void 0;
|
|
61
|
-
return (...args) => {
|
|
62
|
-
if (args.length === 0) return prop;
|
|
63
|
-
return {
|
|
64
|
-
id: prop,
|
|
65
|
-
...args[0]
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
} });
|
|
69
|
-
const _simpleActionProxy = new Proxy({ custom: (name, config) => ({
|
|
70
|
-
id: name,
|
|
71
|
-
...config
|
|
72
|
-
}) }, { get: (target, prop) => target[prop] ?? String(prop) });
|
|
60
|
+
const _actionBuilderProxy = createActionCallbackProxy();
|
|
61
|
+
const _simpleActionProxy = createActionCallbackProxy();
|
|
73
62
|
const _collExt = {
|
|
74
63
|
admin: {
|
|
75
64
|
stateKey: "admin",
|
|
@@ -928,7 +928,7 @@ declare const adminModule: {
|
|
|
928
928
|
$Infer: {
|
|
929
929
|
body: {
|
|
930
930
|
permissions: {
|
|
931
|
-
readonly user?: ("delete" | "
|
|
931
|
+
readonly user?: ("delete" | "create" | "update" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "get")[] | undefined;
|
|
932
932
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
933
933
|
};
|
|
934
934
|
} & {
|
|
@@ -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 questpie458 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 };
|
|
@@ -316,32 +316,42 @@ function mergeDashboardContributions(contributions) {
|
|
|
316
316
|
let title;
|
|
317
317
|
let description;
|
|
318
318
|
let columns;
|
|
319
|
+
let rowHeight;
|
|
320
|
+
let gap;
|
|
319
321
|
let realtime;
|
|
320
322
|
const allActions = [];
|
|
321
323
|
const sectionOrder = [];
|
|
322
324
|
const sectionDefs = /* @__PURE__ */ new Map();
|
|
323
325
|
const sectionItems = /* @__PURE__ */ new Map();
|
|
326
|
+
const directItems = [];
|
|
324
327
|
for (const contrib of contributions) {
|
|
325
328
|
if (contrib.title !== void 0) title = contrib.title;
|
|
326
329
|
if (contrib.description !== void 0) description = contrib.description;
|
|
327
330
|
if (contrib.columns !== void 0) columns = contrib.columns;
|
|
331
|
+
if (contrib.rowHeight !== void 0) rowHeight = contrib.rowHeight;
|
|
332
|
+
if (contrib.gap !== void 0) gap = contrib.gap;
|
|
328
333
|
if (contrib.realtime !== void 0) realtime = contrib.realtime;
|
|
329
334
|
if (contrib.actions) allActions.push(...contrib.actions);
|
|
330
335
|
if (contrib.sections) for (const sec of contrib.sections) {
|
|
336
|
+
const { id: _id, ...sectionMeta } = sec;
|
|
331
337
|
const existingIdx = sectionOrder.indexOf(sec.id);
|
|
332
338
|
if (existingIdx !== -1) sectionOrder.splice(existingIdx, 1);
|
|
333
339
|
sectionOrder.push(sec.id);
|
|
334
340
|
sectionDefs.set(sec.id, {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
columns: sec.columns ?? sectionDefs.get(sec.id)?.columns
|
|
341
|
+
...sectionDefs.get(sec.id) ?? {},
|
|
342
|
+
...sectionMeta
|
|
338
343
|
});
|
|
339
344
|
}
|
|
340
345
|
if (contrib.items) for (const item of contrib.items) {
|
|
341
|
-
const
|
|
346
|
+
const record = item;
|
|
347
|
+
const sid = record.sectionId;
|
|
348
|
+
if (!sid) {
|
|
349
|
+
directItems.push(item);
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
342
352
|
if (!sectionItems.has(sid)) sectionItems.set(sid, []);
|
|
343
353
|
const items = sectionItems.get(sid) ?? [];
|
|
344
|
-
if (
|
|
354
|
+
if (record.position === "start") items.unshift(item);
|
|
345
355
|
else items.push(item);
|
|
346
356
|
sectionItems.set(sid, items);
|
|
347
357
|
if (!sectionDefs.has(sid)) {
|
|
@@ -350,15 +360,15 @@ function mergeDashboardContributions(contributions) {
|
|
|
350
360
|
}
|
|
351
361
|
}
|
|
352
362
|
}
|
|
353
|
-
const dashboardItems = [];
|
|
363
|
+
const dashboardItems = [...directItems];
|
|
354
364
|
for (const sectionId of sectionOrder) {
|
|
355
365
|
const def = sectionDefs.get(sectionId);
|
|
356
366
|
const items = sectionItems.get(sectionId) ?? [];
|
|
357
367
|
if (items.length > 0 || def?.label) dashboardItems.push({
|
|
358
368
|
type: "section",
|
|
359
|
-
|
|
369
|
+
id: sectionId,
|
|
370
|
+
...def,
|
|
360
371
|
layout: def?.layout ?? "grid",
|
|
361
|
-
columns: def?.columns,
|
|
362
372
|
items: items.map(({ sectionId: _sid, position: _pos, ...rest }) => rest)
|
|
363
373
|
});
|
|
364
374
|
}
|
|
@@ -366,6 +376,8 @@ function mergeDashboardContributions(contributions) {
|
|
|
366
376
|
title,
|
|
367
377
|
description,
|
|
368
378
|
columns,
|
|
379
|
+
rowHeight,
|
|
380
|
+
gap,
|
|
369
381
|
realtime,
|
|
370
382
|
actions: allActions.length > 0 ? allActions : void 0,
|
|
371
383
|
items: dashboardItems.length > 0 ? dashboardItems : void 0
|
|
@@ -425,17 +437,20 @@ async function processDashboardItems(items, accessibleCollections, accessCtx) {
|
|
|
425
437
|
}
|
|
426
438
|
if (item.type === "tabs") {
|
|
427
439
|
const rawTabs = rec.tabs || [];
|
|
428
|
-
const
|
|
440
|
+
const visibleTabs = (await Promise.all(rawTabs.map(async (tab) => {
|
|
429
441
|
const filtered = await processDashboardItems(tab.items || [], accessibleCollections, accessCtx);
|
|
430
442
|
return {
|
|
431
443
|
...tab,
|
|
432
444
|
items: filtered
|
|
433
445
|
};
|
|
434
|
-
}));
|
|
435
|
-
|
|
436
|
-
...item
|
|
437
|
-
|
|
438
|
-
|
|
446
|
+
}))).filter((tab) => tab.items.length > 0);
|
|
447
|
+
if (visibleTabs.length > 0) {
|
|
448
|
+
const { variant: _variant, ...serializableTabs } = item;
|
|
449
|
+
result.push({
|
|
450
|
+
...serializableTabs,
|
|
451
|
+
tabs: visibleTabs
|
|
452
|
+
});
|
|
453
|
+
}
|
|
439
454
|
continue;
|
|
440
455
|
}
|
|
441
456
|
const widget = rec;
|
|
@@ -453,10 +468,13 @@ async function processDashboardItems(items, accessibleCollections, accessCtx) {
|
|
|
453
468
|
if (action.action?.type === "create") return accessibleCollections.has(action.action.collection);
|
|
454
469
|
return true;
|
|
455
470
|
});
|
|
456
|
-
const { loader: loader$1, access: access$1, ...serializable$1 } = widget;
|
|
471
|
+
const { loader: loader$1, access: access$1, filterFn: filterFn$1, ...serializable$1 } = widget;
|
|
472
|
+
if (loader$1) serializable$1.hasLoader = true;
|
|
473
|
+
if (serializable$1.label && !serializable$1.title) serializable$1.title = serializable$1.label;
|
|
457
474
|
result.push({
|
|
458
475
|
...serializable$1,
|
|
459
|
-
actions
|
|
476
|
+
actions,
|
|
477
|
+
quickActions: serializable$1.quickActions ?? actions
|
|
460
478
|
});
|
|
461
479
|
continue;
|
|
462
480
|
}
|
|
@@ -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 questpie69 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: questpie69.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, questpie69.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: questpie69.JsonRouteDefinition<{
|
|
72
72
|
collection: string;
|
|
73
|
-
}, any,
|
|
73
|
+
}, any, questpie69.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: questpie69.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, questpie69.JsonRouteParams>;
|
|
87
|
+
getActionsConfig: questpie69.JsonRouteDefinition<{
|
|
88
88
|
collection: string;
|
|
89
|
-
}, any,
|
|
89
|
+
}, any, questpie69.JsonRouteParams>;
|
|
90
90
|
};
|
|
91
91
|
//#endregion
|
|
92
92
|
export { ExecuteActionRequest, ExecuteActionResponse, actionFunctions, executeAction, executeActionFn, getActionsConfig, getActionsConfigFn };
|
|
@@ -43,6 +43,10 @@ function getActionsConfig(app, collectionSlug) {
|
|
|
43
43
|
};
|
|
44
44
|
const customWithoutHandlers = (actionsConfig.custom || []).map((action) => {
|
|
45
45
|
const { handler, ...rest } = action;
|
|
46
|
+
if (rest.form?.fields) rest.form = {
|
|
47
|
+
...rest.form,
|
|
48
|
+
fields: serializeActionFormFields(rest.form.fields)
|
|
49
|
+
};
|
|
46
50
|
return rest;
|
|
47
51
|
});
|
|
48
52
|
return {
|
|
@@ -58,6 +62,35 @@ function getActionsConfig(app, collectionSlug) {
|
|
|
58
62
|
custom: customWithoutHandlers
|
|
59
63
|
};
|
|
60
64
|
}
|
|
65
|
+
function serializeActionFormFields(fields) {
|
|
66
|
+
const result = {};
|
|
67
|
+
for (const [fieldName, field$1] of Object.entries(fields)) {
|
|
68
|
+
if (!field$1 || typeof field$1 !== "object") {
|
|
69
|
+
result[fieldName] = field$1;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (typeof field$1.getMetadata === "function") {
|
|
73
|
+
const metadata = field$1.getMetadata();
|
|
74
|
+
const state = field$1._state ?? {};
|
|
75
|
+
const adminMeta = (metadata.meta && typeof metadata.meta === "object" ? metadata.meta : void 0) ?? (state.admin && typeof state.admin === "object" ? state.admin : void 0) ?? (state.extensions?.admin && typeof state.extensions.admin === "object" ? state.extensions.admin : void 0);
|
|
76
|
+
const options = {};
|
|
77
|
+
if (metadata.options) options.options = metadata.options;
|
|
78
|
+
if (metadata.multiple !== void 0) options.multiple = metadata.multiple;
|
|
79
|
+
if (adminMeta) Object.assign(options, adminMeta);
|
|
80
|
+
result[fieldName] = {
|
|
81
|
+
type: metadata.type ?? field$1.getType?.() ?? "text",
|
|
82
|
+
label: metadata.label,
|
|
83
|
+
description: metadata.description,
|
|
84
|
+
required: metadata.required ?? false,
|
|
85
|
+
default: state.defaultValue,
|
|
86
|
+
options
|
|
87
|
+
};
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
result[fieldName] = field$1;
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
61
94
|
/**
|
|
62
95
|
* Execute a collection action.
|
|
63
96
|
* Handles both built-in actions and custom actions.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as questpie462 from "questpie";
|
|
2
2
|
|
|
3
3
|
//#region src/server/modules/admin/routes/locales.d.ts
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ import * as questpie460 from "questpie";
|
|
|
12
12
|
* Bundle of locale-related functions.
|
|
13
13
|
*/
|
|
14
14
|
declare const localeFunctions: {
|
|
15
|
-
readonly getContentLocales:
|
|
15
|
+
readonly getContentLocales: questpie462.JsonRouteDefinition<Record<string, never> | undefined, any, questpie462.JsonRouteParams>;
|
|
16
16
|
};
|
|
17
17
|
//#endregion
|
|
18
18
|
export { localeFunctions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as questpie97 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: questpie97.JsonRouteDefinition<{
|
|
25
25
|
path: string;
|
|
26
26
|
ttlMs?: number | undefined;
|
|
27
|
-
}, any,
|
|
28
|
-
verifyPreviewToken:
|
|
27
|
+
}, any, questpie97.JsonRouteParams>;
|
|
28
|
+
verifyPreviewToken: questpie97.JsonRouteDefinition<{
|
|
29
29
|
token: string;
|
|
30
|
-
}, any,
|
|
30
|
+
}, any, questpie97.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: questpie97.JsonRouteDefinition<{
|
|
67
67
|
collection: string;
|
|
68
68
|
record: Record<string, unknown>;
|
|
69
69
|
locale?: string | undefined;
|
|
70
|
-
}, any,
|
|
71
|
-
mintPreviewToken:
|
|
70
|
+
}, any, questpie97.JsonRouteParams>;
|
|
71
|
+
mintPreviewToken: questpie97.JsonRouteDefinition<{
|
|
72
72
|
path: string;
|
|
73
73
|
ttlMs?: number | undefined;
|
|
74
|
-
}, any,
|
|
75
|
-
verifyPreviewToken:
|
|
74
|
+
}, any, questpie97.JsonRouteParams>;
|
|
75
|
+
verifyPreviewToken: questpie97.JsonRouteDefinition<{
|
|
76
76
|
token: string;
|
|
77
|
-
}, any,
|
|
77
|
+
}, any, questpie97.JsonRouteParams>;
|
|
78
78
|
};
|
|
79
79
|
//#endregion
|
|
80
80
|
export { PreviewTokenPayload, createPreviewFunctions, createPreviewTokenVerifier, previewFunctions, verifyPreviewTokenDirect };
|