wt-front-shared 19.0.45 → 19.2.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/auto-form/index.d.ts +5 -0
- package/{lib/core/components/auto-form → auto-form/lib}/auto-form.module.d.ts +22 -28
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-cheditor/form-field-cheditor.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-date/form-field-date.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-file/form-field-file.component.d.ts +8 -8
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-file-show/form-field-file-show.component.d.ts +4 -4
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-files/form-field-files.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-files-show/form-field-files-show.component.d.ts +4 -4
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-input/form-field-input.component.d.ts +3 -3
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-input-show/form-field-input-show.component.d.ts +3 -3
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-json-show/form-field-json-show.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-rating/form-field-rating.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-select/form-field-select.component.d.ts +5 -5
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-select-show/form-field-select-show.component.d.ts +4 -4
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-slide-toggle/form-field-slide-toggle.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-slide-toggle-show/form-field-slide-toggle-show.component.d.ts +3 -3
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-string-list-input/form-field-string-list-input.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-tags/form-field-tags.component.d.ts +4 -4
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-textarea-show/form-field-textarea-show.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/components/form-message-box/form-message-box.component.d.ts +2 -2
- package/{lib/core/components/auto-form → auto-form/lib}/containers/auto-form-main/auto-form-main.component.d.ts +10 -10
- package/{lib/core/components/auto-form → auto-form/lib}/containers/auto-form-show/auto-form-show.component.d.ts +5 -5
- package/{lib/core/components/auto-form → auto-form/lib}/containers/auto-form-show-field/auto-form-show-field.component.d.ts +5 -5
- package/{lib/core/components/auto-form → auto-form/lib}/containers/form-field/form-field.component.d.ts +5 -5
- package/{lib/core/components/auto-form → auto-form/lib}/containers/publish-messages/publish-messages.component.d.ts +6 -6
- package/{lib/core → auto-form/lib}/dialogs/form-dialog/form-dialog.component.d.ts +13 -13
- package/auto-form/public-api.d.ts +3 -0
- package/entities/README.md +46 -0
- package/entities/index.d.ts +5 -0
- package/entities/lib/guards/entity-sections.guard.d.ts +11 -0
- package/entities/lib/guards/route-wait.service.d.ts +10 -0
- package/entities/lib/services/entities-adapter.service.d.ts +72 -0
- package/entities/lib/services/entities-api.service.d.ts +13 -0
- package/entities/lib/services/entities-events.service.d.ts +9 -0
- package/entities/lib/services/entities-sections.service.d.ts +42 -0
- package/entities/lib/settings/code-editor.component.d.ts +24 -0
- package/entities/lib/settings/code-lint.util.d.ts +11 -0
- package/entities/lib/settings/entities-settings.component.d.ts +27 -0
- package/entities/lib/settings/entities-settings.facade.d.ts +23 -0
- package/entities/lib/settings/entities-settings.models.d.ts +99 -0
- package/entities/lib/settings/entities-settings.util.d.ts +122 -0
- package/entities/lib/settings/entity-form.component.d.ts +256 -0
- package/entities/lib/settings/entity-plan-dialog.component.d.ts +15 -0
- package/entities/lib/state/entities.actions.d.ts +35 -0
- package/entities/lib/state/entities.effects.d.ts +34 -0
- package/entities/lib/state/entities.facade.d.ts +17 -0
- package/entities/lib/state/entities.models.d.ts +157 -0
- package/entities/lib/state/entities.reducer.d.ts +13 -0
- package/entities/lib/state/entities.selectors.d.ts +15 -0
- package/entities/lib/tokens.d.ts +8 -0
- package/entities/lib/ui/confirm-dialog.component.d.ts +13 -0
- package/entities/lib/ui/empty-state.component.d.ts +8 -0
- package/entities/lib/ui/index.d.ts +5 -0
- package/entities/lib/ui/inline-alert.component.d.ts +11 -0
- package/entities/lib/ui/page-header.component.d.ts +8 -0
- package/entities/lib/ui/status-chip.component.d.ts +8 -0
- package/entities/public-api.d.ts +19 -0
- package/fesm2022/wt-front-shared-auto-form.mjs +2781 -0
- package/fesm2022/wt-front-shared-auto-form.mjs.map +1 -0
- package/fesm2022/wt-front-shared-entities.mjs +2850 -0
- package/fesm2022/wt-front-shared-entities.mjs.map +1 -0
- package/fesm2022/wt-front-shared-panel-ui.mjs +2056 -0
- package/fesm2022/wt-front-shared-panel-ui.mjs.map +1 -0
- package/fesm2022/wt-front-shared-static-data.mjs +5058 -0
- package/fesm2022/wt-front-shared-static-data.mjs.map +1 -0
- package/fesm2022/wt-front-shared.mjs +829 -10491
- package/fesm2022/wt-front-shared.mjs.map +1 -1
- package/lib/core/+state/router/router.effects.d.ts +1 -1
- package/lib/core/+state/static-data/static-data.actions.d.ts +1 -1
- package/lib/core/+state/static-data/static-data.facade.d.ts +1 -1
- package/lib/core/animations/appearFromLeftWithDelay.d.ts +10 -1
- package/lib/core/components/external-services/external-service.models.d.ts +3 -0
- package/lib/core/components/index.d.ts +7 -47
- package/lib/core/components/star-rating/star-rating.component.d.ts +2 -2
- package/lib/core/dialogs/dialogs.module.d.ts +7 -9
- package/lib/core/{components/auto-form → forms-shared}/interfaces/form-field-others.d.ts +1 -1
- package/lib/core/interceptors/headers.interceptor.d.ts +4 -3
- package/lib/core/services/auto-form/auto-form.service.d.ts +2 -2
- package/lib/core/services/base-auto-form/base-auto-form.service.d.ts +3 -3
- package/lib/core/{components/static-data → static-data-shared}/interfaces/static-data.interface.d.ts +1 -1
- package/lib/core/{components/static-data → static-data-shared}/services/static-data.service.service.d.ts +3 -3
- package/lib/core/utils/deep-equal.d.ts +6 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/models/config/app-config.d.ts +2 -1
- package/lib/models/endpoints/static-data/board-settings-request.d.ts +1 -1
- package/lib/models/endpoints/static-data/preset-settings-request.d.ts +1 -1
- package/lib/models/endpoints/static-data/static-data-get-list/request/static-data-get-list-request-config.d.ts +1 -1
- package/package.json +39 -2
- package/panel-ui/index.d.ts +5 -0
- package/{lib/core/components → panel-ui/lib}/files-upload/constants.d.ts +1 -1
- package/{lib/core/components → panel-ui/lib}/files-upload/file-list-card/file-list-card.component.d.ts +6 -6
- package/{lib/core/components → panel-ui/lib}/files-upload/files-upload/files-upload.component.d.ts +5 -5
- package/{lib/core/components → panel-ui/lib}/files-upload/files-upload-list-images/files-upload-list-images.component.d.ts +3 -3
- package/{lib/core/components → panel-ui/lib}/files-upload/files-upload.module.d.ts +2 -3
- package/{lib/core/components → panel-ui/lib}/files-upload/table-files-uploading/table-files-uploading.component.d.ts +4 -4
- package/{lib/core/components → panel-ui/lib}/form-field-error/form-field-error.component.d.ts +2 -2
- package/{lib/core/components → panel-ui/lib}/form-field-publish-error/form-field-publish-error.component.d.ts +3 -3
- package/{lib/core/components → panel-ui/lib}/panel/panel.component.d.ts +1 -1
- package/{lib/core/components → panel-ui/lib}/panel/panel.module.d.ts +1 -1
- package/{lib/core/components → panel-ui/lib}/profile/profile.component.d.ts +3 -3
- package/{lib/core/components → panel-ui/lib}/site-helper/site-helper.component.d.ts +3 -3
- package/{lib/core/components → panel-ui/lib}/tag-cloud/tag-cloud.component.d.ts +1 -1
- package/{lib/core/components → panel-ui/lib}/tag-cloud/tag-cloud.module.d.ts +1 -1
- package/panel-ui/public-api.d.ts +30 -0
- package/public-api.d.ts +10 -3
- package/static-data/index.d.ts +5 -0
- package/{lib/core/components/static-data → static-data/lib}/boards/board-edit-dialog.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/boards/board-filter.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/boards/board-settings-dialog.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/boards/boards.facade.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/boards/index.d.ts +0 -1
- package/{lib/core/components/static-data → static-data/lib}/boards/kanban.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/components/field-settings-dialog/field-settings-dialog.component.d.ts +4 -4
- package/{lib/core/components/static-data → static-data/lib}/components/filtering-dialog/filtering-dialog.component.d.ts +5 -5
- package/{lib/core/components/static-data → static-data/lib}/components/filtering-form/filtering-form.component.d.ts +6 -6
- package/{lib/core/components/static-data → static-data/lib}/components/list-sub-entities/list-sub-entities.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/components/static-data-create-new-dynamic-form-dialog/static-data-create-new-dynamic-form-dialog.component.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/components/static-data-create-new-item-dialog/static-data-create-new-item-dialog.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/components/static-data-filter-options/static-data-filter-options.component.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/components/static-data-list-filtering/static-data-list-filtering.component.d.ts +5 -5
- package/{lib/core/components/static-data → static-data/lib}/components/static-data-list-items/static-data-list-items.component.d.ts +12 -10
- package/{lib/core/components/static-data → static-data/lib}/components/view-static-data-details-dialog/view-static-data-details-dialog.component.d.ts +2 -2
- package/{lib/core/components/static-data → static-data/lib}/containers/static-data-details/static-data-details.component.d.ts +28 -27
- package/{lib/core/components/static-data → static-data/lib}/containers/static-data-items/column-filter.component.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/containers/static-data-items/static-data-items.component.d.ts +5 -5
- package/{lib/core/components/static-data → static-data/lib}/containers/static-data-list/static-data-list.component.d.ts +6 -5
- package/{lib/core/components/static-data → static-data/lib}/containers/static-data-view/static-data-view.component.d.ts +10 -10
- package/{lib/core/components/static-data → static-data/lib}/presets/index.d.ts +0 -1
- package/{lib/core/components/static-data → static-data/lib}/presets/presets.component.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/presets/presets.facade.d.ts +1 -1
- package/{lib/core/components/static-data → static-data/lib}/presets/save-preset-dialog.component.d.ts +1 -1
- package/static-data/lib/static-data.module.d.ts +40 -0
- package/static-data/public-api.d.ts +8 -0
- package/lib/core/components/button/index.d.ts +0 -2
- package/lib/core/components/static-data/static-data.module.d.ts +0 -46
- /package/{lib/core/components/auto-form → auto-form/lib}/components/form-field-spinner/form-field-spinner.component.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/constants/auto-form-show-value.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/constants/errors.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/auto-form.interfaces.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/dynamic-form-question-type.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/field-type.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/form-field-format.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/form-field-option.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/form-field.d.ts +0 -0
- /package/lib/core/{components/auto-form → forms-shared}/interfaces/input-type.d.ts +0 -0
- /package/lib/core/{components/static-data → static-data-shared}/interfaces/component-input-data.interface.d.ts +0 -0
- /package/lib/core/{components/static-data/boards → static-data-shared/models}/board.models.d.ts +0 -0
- /package/lib/core/{components/static-data/presets → static-data-shared/models}/preset.models.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/access-denied/access-denied.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/access-denied/access-denied.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/chips-input/chips-input.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/chips-input/chips-input.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/form-field-error/form-field-error.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/form-field-publish-error/form-field-publish-error.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/header/header.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/header/header.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/input-tags/input-tags.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/input-tags/input-tags.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/panel-header/panel-header.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/panel-header/panel-header.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/profile/profile.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/site-helper/configs/publication-error-tour.config.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/site-helper/configs/unpublish-tour.config.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/site-helper/interfaces/config.interfaces.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/site-helper/site-helper.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/smart-progress-bar/smart-progress-bar.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/smart-progress-bar/smart-progress-bar.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/sticky-sidebar/sticky-sidebar.directive.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/sticky-sidebar/sticky-sidebar.module.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/table-menu/table-menu.component.d.ts +0 -0
- /package/{lib/core/components → panel-ui/lib}/table-menu/table-menu.module.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/components/static-data-create-new-dialog/static-data-create-new-dialog.component.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/components/static-data-list-items/column-preferences.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/components/static-data-list-items/group-nested-items.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/components/static-data-list-items/visible-nested-rows.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/containers/static-data-items/column-resize.directive.d.ts +0 -0
- /package/{lib/core/components/static-data → static-data/lib}/static-data-routing.module.d.ts +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { IFormField, StaticDataSection } from 'wt-front-shared';
|
|
2
|
+
import { EntityDefinition, EntityFieldDefinition } from '../state/entities.models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** Physical table / Sequelize model name of a UI entity (mirrors the server's tableNameFor). */
|
|
5
|
+
export declare const entityTableName: (key: string) => string;
|
|
6
|
+
export interface EntityListColumn {
|
|
7
|
+
field: string;
|
|
8
|
+
title: string;
|
|
9
|
+
type: string;
|
|
10
|
+
format?: string;
|
|
11
|
+
relationTarget?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface EntityFilterConfig {
|
|
14
|
+
field: string;
|
|
15
|
+
title: string;
|
|
16
|
+
kind: 'search' | 'select' | 'boolean' | 'date';
|
|
17
|
+
loadOptionFromStore?: string;
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface EntityListConfig {
|
|
21
|
+
fieldsOnListPage: string[];
|
|
22
|
+
columns: EntityListColumn[];
|
|
23
|
+
filters: EntityFilterConfig[];
|
|
24
|
+
search: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface EntitySectionConfig {
|
|
27
|
+
key: string;
|
|
28
|
+
title: string;
|
|
29
|
+
fields: IFormField[];
|
|
30
|
+
preLoadSections: string[];
|
|
31
|
+
options: {
|
|
32
|
+
fieldsOnListPage: string[];
|
|
33
|
+
search: boolean;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** Resolves a relation target (UI or code entity) from the entities store; optional everywhere (without it the target key is used as is). */
|
|
37
|
+
export type EntityLookup = (key: string) => EntityDefinition | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* activeOnly relation mapper: drops inactive records but keeps `keepIds` (the currently chosen value).
|
|
40
|
+
* The shared select passes only `items` today, so the chosen inactive value is kept in the form value but not rendered until the
|
|
41
|
+
* select forwards the current value as the 2nd argument (UNVERIFIED in wt-front-shared, see implementation log W6).
|
|
42
|
+
*/
|
|
43
|
+
export type RelationItemsMapper = (items: any[], keepIds?: ReadonlyArray<unknown>) => {
|
|
44
|
+
id: number;
|
|
45
|
+
name: string;
|
|
46
|
+
}[];
|
|
47
|
+
export declare class EntityAdapterService {
|
|
48
|
+
storeKey(entityKey: string): string;
|
|
49
|
+
/** Static-data slug of a relation target: UI entity = key; code entity = url slug of its hand-written service (`slug`), else the key. */
|
|
50
|
+
targetSlug(target: string, lookup?: EntityLookup): string;
|
|
51
|
+
/** Fields ordered by group order (ungrouped first), then field.order, then original position. */
|
|
52
|
+
orderedFields(def: EntityDefinition): EntityFieldDefinition[];
|
|
53
|
+
toFormFields(def: EntityDefinition, lookup?: EntityLookup): IFormField[];
|
|
54
|
+
toFormField(f: EntityFieldDefinition, groupTitle?: {
|
|
55
|
+
[k: string]: string;
|
|
56
|
+
}, lookup?: EntityLookup, entityKey?: string): IFormField;
|
|
57
|
+
listConfig(def: EntityDefinition, lookup?: EntityLookup): EntityListConfig;
|
|
58
|
+
/** `<target>(paging:{perPage:-1})` entries so relation pickers have options in the store. */
|
|
59
|
+
preLoadSections(def: EntityDefinition, lookup?: EntityLookup): string[];
|
|
60
|
+
toSection(def: EntityDefinition, lookup?: EntityLookup): EntitySectionConfig;
|
|
61
|
+
/**
|
|
62
|
+
* SD-009 T11: the section object the static-data pages (list, create/edit form, boards, presets) read from
|
|
63
|
+
* `AppConfig.staticDataMapping[<entity key>]`. System columns: id (list), isActive (editable toggle, default true, list column).
|
|
64
|
+
* Boards and presets are on: both are generic per content type (`/api/static-data/<key>/boards|presets`).
|
|
65
|
+
*/
|
|
66
|
+
toStaticDataSection(def: EntityDefinition, lookup?: EntityLookup): StaticDataSection;
|
|
67
|
+
private toColumn;
|
|
68
|
+
private toShowIf;
|
|
69
|
+
private applyRelation;
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntityAdapterService, never>;
|
|
71
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EntityAdapterService>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { AppConfig } from 'wt-front-shared';
|
|
4
|
+
import { EntityDefinition } from '../state/entities.models';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class EntitiesApiService {
|
|
7
|
+
private http;
|
|
8
|
+
private config;
|
|
9
|
+
constructor(http: HttpClient, config: AppConfig);
|
|
10
|
+
list(): Observable<EntityDefinition[]>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntitiesApiService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EntitiesApiService>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Subject } from 'rxjs';
|
|
2
|
+
import { EntityEventPayload } from '../state/entities.models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class EntitiesEventsService {
|
|
5
|
+
readonly events$: Subject<EntityEventPayload>;
|
|
6
|
+
publish(payload: EntityEventPayload): void;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntitiesEventsService, never>;
|
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EntitiesEventsService>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { AppConfig, AuthenticationService } from 'wt-front-shared';
|
|
3
|
+
import { EntitiesFacade } from '../state/entities.facade';
|
|
4
|
+
import { EntityDefinition } from '../state/entities.models';
|
|
5
|
+
import { EntityAdapterService } from './entities-adapter.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare const ENTITIES_CACHE_KEY = "sd-entities-cache";
|
|
8
|
+
/**
|
|
9
|
+
* SD-009 T11: registers UI-managed entities as static-data sections at runtime.
|
|
10
|
+
*
|
|
11
|
+
* The static-data pages (list, create/edit/view, boards, presets, filters, pickers that list all types) read the section from
|
|
12
|
+
* `AppConfig.staticDataMapping[<contentType>]` lazily at route/component activation, and relation pickers read the list from the
|
|
13
|
+
* NgRx static-data reducer under the dynamic key `staticData.list.<key>` (reducer maps are keyed by content type, nothing to
|
|
14
|
+
* register there). So an active UI entity is made a section by adding its adapter output to those two maps; a disabled/removed one is
|
|
15
|
+
* removed again. Hand-written (code) sections are never touched: a key that exists in the config and was not registered here is skipped.
|
|
16
|
+
*/
|
|
17
|
+
export declare class EntitySectionsService implements OnDestroy {
|
|
18
|
+
private readonly adapter;
|
|
19
|
+
private readonly facade;
|
|
20
|
+
private readonly config;
|
|
21
|
+
private readonly auth?;
|
|
22
|
+
private readonly registered;
|
|
23
|
+
private sub?;
|
|
24
|
+
constructor(adapter: EntityAdapterService, facade: EntitiesFacade | null, config: AppConfig | null, auth?: AuthenticationService | null);
|
|
25
|
+
/** Subscribes to the entities store (idempotent). */
|
|
26
|
+
start(): void;
|
|
27
|
+
private cacheUser;
|
|
28
|
+
private restoreCache;
|
|
29
|
+
private saveCache;
|
|
30
|
+
ngOnDestroy(): void;
|
|
31
|
+
/** Keys of the sections this service registered. */
|
|
32
|
+
get keys(): string[];
|
|
33
|
+
/**
|
|
34
|
+
* Reconciles the maps with the store content: active UI entities are (re)registered, everything registered earlier that is no
|
|
35
|
+
* longer an active UI entity is removed (soft-disabled entities disappear from sections and from all-type pickers).
|
|
36
|
+
*/
|
|
37
|
+
sync(all: EntityDefinition[]): void;
|
|
38
|
+
/** `AppConfig.staticData` is keyed by camelCase names (businessDivisions); the kebab key is converted the same way. */
|
|
39
|
+
staticDataConfigKey(key: string): string;
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntitySectionsService, [null, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
41
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EntitySectionsService>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ElementRef, OnChanges, OnDestroy, SimpleChanges, AfterViewInit } from '@angular/core';
|
|
2
|
+
import { CodeDiagnostic, CodeLang } from './entities-settings.models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* CodeMirror 6 wrapper. `diagnostics` (local JS parse or server TS check, computed by the parent) are drawn inline;
|
|
6
|
+
* `valueChange` emits on every edit. The code is never executed.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CodeEditorComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|
9
|
+
value: import("@angular/core").InputSignal<string>;
|
|
10
|
+
lang: import("@angular/core").InputSignal<CodeLang>;
|
|
11
|
+
readOnly: import("@angular/core").InputSignal<boolean>;
|
|
12
|
+
diagnostics: import("@angular/core").InputSignal<CodeDiagnostic[]>;
|
|
13
|
+
ariaLabel: import("@angular/core").InputSignal<string>;
|
|
14
|
+
valueChange: import("@angular/core").OutputEmitterRef<string>;
|
|
15
|
+
host: ElementRef<HTMLElement>;
|
|
16
|
+
private view?;
|
|
17
|
+
private readonly editable;
|
|
18
|
+
ngAfterViewInit(): void;
|
|
19
|
+
ngOnChanges(ch: SimpleChanges): void;
|
|
20
|
+
ngOnDestroy(): void;
|
|
21
|
+
private applyDiagnostics;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CodeEditorComponent, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CodeEditorComponent, "shared-ent-code-editor", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "lang": { "alias": "lang"; "required": false; "isSignal": true; }; "readOnly": { "alias": "readOnly"; "required": false; "isSignal": true; }; "diagnostics": { "alias": "diagnostics"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CodeDiagnostic } from './entities-settings.models';
|
|
2
|
+
/**
|
|
3
|
+
* Instant syntax check for a JS snippet (function body) using the CodeMirror/lezer parser.
|
|
4
|
+
* Parse only: nothing is evaluated (no eval / new Function). TS snippets go through POST /check-code.
|
|
5
|
+
*/
|
|
6
|
+
export declare function localJsDiagnostics(source: string, limit?: number): CodeDiagnostic[];
|
|
7
|
+
/** Offsets for a diagnostic inside `source` (used by the editor to draw the underline). */
|
|
8
|
+
export declare function diagnosticRange(source: string, d: CodeDiagnostic): {
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { SettingsEntity } from './entities-settings.models';
|
|
3
|
+
import { entityStatusLabel } from './entities-settings.util';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export type EntitiesListState = 'loading' | 'ready' | 'empty' | 'error' | 'forbidden';
|
|
6
|
+
export declare class EntitiesSettingsComponent implements OnInit {
|
|
7
|
+
private readonly facade;
|
|
8
|
+
private readonly dialog;
|
|
9
|
+
private readonly toast;
|
|
10
|
+
private readonly router;
|
|
11
|
+
private readonly cdr;
|
|
12
|
+
readonly columns: string[];
|
|
13
|
+
state: EntitiesListState;
|
|
14
|
+
entities: SettingsEntity[];
|
|
15
|
+
search: string;
|
|
16
|
+
busyKeys: Set<string>;
|
|
17
|
+
readonly statusLabel: typeof entityStatusLabel;
|
|
18
|
+
ngOnInit(): void;
|
|
19
|
+
get filtered(): SettingsEntity[];
|
|
20
|
+
load(): void;
|
|
21
|
+
create(): void;
|
|
22
|
+
open(e: SettingsEntity): void;
|
|
23
|
+
statusTone(e: SettingsEntity): 'neutral' | 'success' | 'warning';
|
|
24
|
+
disable(e: SettingsEntity): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntitiesSettingsComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EntitiesSettingsComponent, "shared-entities-settings", never, {}, {}, never, never, true, never>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { AppConfig } from 'wt-front-shared';
|
|
4
|
+
import { CodeDiagnostic, CodeLang, EntityPlan, SavedEntity, SchemaLogPage, SettingsEntity } from './entities-settings.models';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/** The only HTTP layer of the entities settings UI (`/api/settings/entities`, admin only). */
|
|
7
|
+
export declare class EntitiesSettingsFacade {
|
|
8
|
+
private readonly http;
|
|
9
|
+
private readonly baseUrl;
|
|
10
|
+
private readonly opts;
|
|
11
|
+
constructor(http: HttpClient, config?: AppConfig | null);
|
|
12
|
+
list(): Observable<SettingsEntity[]>;
|
|
13
|
+
/** Dry run: POST /plan (new definition) or POST /:id/plan. Returns DDL statements + destructive flag. */
|
|
14
|
+
plan(id: number | null, body: any): Observable<EntityPlan>;
|
|
15
|
+
/** 201 `{data, activation?}`: `activation.status==='failed'` = saved but not live yet (see savedFromResponse). */
|
|
16
|
+
create(body: any, confirmDestructive?: boolean): Observable<SavedEntity>;
|
|
17
|
+
update(id: number, body: any, confirmDestructive?: boolean): Observable<SavedEntity>;
|
|
18
|
+
remove(id: number, version?: number | null): Observable<SavedEntity>;
|
|
19
|
+
checkCode(lang: CodeLang, source: string): Observable<CodeDiagnostic[]>;
|
|
20
|
+
schemaLog(id: number, limit?: number, offset?: number): Observable<SchemaLogPage>;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntitiesSettingsFacade, [null, { optional: true; }]>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EntitiesSettingsFacade>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { EntitySectionOptions, EntityDefinition, EntityFieldCondition, EntityFieldDefinition, EntityFieldOptions, EntityFieldRelation, EntityFieldType, EntityGroup } from '../state/entities.models';
|
|
2
|
+
export type { EntitySectionOptions, EntityDefinition, EntityFieldCondition, EntityFieldDefinition, EntityFieldOptions, EntityFieldRelation, EntityFieldType, EntityGroup };
|
|
3
|
+
export type CodeLang = 'js' | 'ts';
|
|
4
|
+
export type HookName = 'beforeCreate' | 'afterCreate' | 'beforeUpdate' | 'afterUpdate' | 'beforeDelete' | 'afterDelete';
|
|
5
|
+
export type SnippetKind = 'calculated' | 'validators' | 'hooks';
|
|
6
|
+
export interface EntityCode {
|
|
7
|
+
lang: CodeLang;
|
|
8
|
+
calculated: Record<string, string>;
|
|
9
|
+
validators: Record<string, string>;
|
|
10
|
+
hooks: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
/** Definition as returned by the settings API (code is present for UI entities only). */
|
|
13
|
+
export interface SettingsEntity extends EntityDefinition {
|
|
14
|
+
code?: Partial<EntityCode> | null;
|
|
15
|
+
updatedAt?: string | null;
|
|
16
|
+
createdAt?: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface DraftField extends EntityFieldDefinition {
|
|
19
|
+
/** stable id for trackBy (never sent) */
|
|
20
|
+
uid: string;
|
|
21
|
+
position?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface EntityDraft {
|
|
24
|
+
id: number | null;
|
|
25
|
+
key: string;
|
|
26
|
+
title: string;
|
|
27
|
+
version: number | null;
|
|
28
|
+
isActive: boolean;
|
|
29
|
+
groups: EntityGroup[];
|
|
30
|
+
fields: DraftField[];
|
|
31
|
+
code: EntityCode;
|
|
32
|
+
/** section settings (definition.options) */
|
|
33
|
+
options: EntitySectionOptions;
|
|
34
|
+
}
|
|
35
|
+
export interface CodeDiagnostic {
|
|
36
|
+
line: number;
|
|
37
|
+
column: number;
|
|
38
|
+
endLine?: number;
|
|
39
|
+
endColumn?: number;
|
|
40
|
+
message: string;
|
|
41
|
+
severity?: 'error' | 'warning';
|
|
42
|
+
}
|
|
43
|
+
/** One editable snippet (calculated field, validator or hook). */
|
|
44
|
+
export interface SnippetRef {
|
|
45
|
+
kind: SnippetKind;
|
|
46
|
+
name: string;
|
|
47
|
+
}
|
|
48
|
+
export interface PlanStatement {
|
|
49
|
+
sql: string;
|
|
50
|
+
destructive?: boolean;
|
|
51
|
+
kind?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface DestructiveItem {
|
|
54
|
+
kind?: string;
|
|
55
|
+
field?: string;
|
|
56
|
+
column?: string;
|
|
57
|
+
message?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface EntityPlan {
|
|
60
|
+
statements: PlanStatement[];
|
|
61
|
+
destructive: boolean;
|
|
62
|
+
destructiveItems: DestructiveItem[];
|
|
63
|
+
}
|
|
64
|
+
/** Post-commit step (generate/load/rights/WS) result returned next to `data` by POST/PUT/DELETE (sd-api entity-save.service). */
|
|
65
|
+
export interface EntityActivation {
|
|
66
|
+
status: 'ok' | 'failed';
|
|
67
|
+
code?: string;
|
|
68
|
+
stage?: string;
|
|
69
|
+
message?: string;
|
|
70
|
+
}
|
|
71
|
+
/** Saved definition + the optional activation result of the same response. */
|
|
72
|
+
export type SavedEntity = SettingsEntity & {
|
|
73
|
+
activation?: EntityActivation;
|
|
74
|
+
};
|
|
75
|
+
export interface SchemaLogItem {
|
|
76
|
+
id: number;
|
|
77
|
+
entityKey: string;
|
|
78
|
+
entityVersion: number | null;
|
|
79
|
+
statement: string;
|
|
80
|
+
destructive: boolean;
|
|
81
|
+
actor: string | number | null;
|
|
82
|
+
result: string;
|
|
83
|
+
error?: string | null;
|
|
84
|
+
createdAt: string;
|
|
85
|
+
}
|
|
86
|
+
export interface SchemaLogPage {
|
|
87
|
+
total: number;
|
|
88
|
+
items: SchemaLogItem[];
|
|
89
|
+
}
|
|
90
|
+
export interface ServerValidationError {
|
|
91
|
+
path: string;
|
|
92
|
+
code: string;
|
|
93
|
+
message?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface PlanDialogData {
|
|
96
|
+
plan: EntityPlan;
|
|
97
|
+
entityKey: string;
|
|
98
|
+
isNew: boolean;
|
|
99
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { CodeDiagnostic, CodeLang, DraftField, EntityActivation, EntityCode, EntityDraft, EntityFieldType, EntityPlan, EntitySectionOptions, HookName, PlanStatement, SavedEntity, ServerValidationError, SettingsEntity, SnippetKind, SnippetRef } from './entities-settings.models';
|
|
2
|
+
export declare const KEY_RE: RegExp;
|
|
3
|
+
export declare const FIELD_KEY_RE: RegExp;
|
|
4
|
+
export declare const GROUP_KEY_RE: RegExp;
|
|
5
|
+
export declare const COLUMN_RE: RegExp;
|
|
6
|
+
export declare const SYSTEM_FIELDS: string[];
|
|
7
|
+
export declare const HOOK_NAMES: readonly ["beforeCreate", "afterCreate", "beforeUpdate", "afterUpdate", "beforeDelete", "afterDelete"];
|
|
8
|
+
export interface HookParam {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
}
|
|
12
|
+
export interface HookMeta {
|
|
13
|
+
title: string;
|
|
14
|
+
params: HookParam[];
|
|
15
|
+
/** what the function result means */
|
|
16
|
+
returns: string;
|
|
17
|
+
/** body inserted when the event is added */
|
|
18
|
+
template: string;
|
|
19
|
+
}
|
|
20
|
+
/** Parameters mirror sd-api libs/entity-codegen.js HOOK_PARAMS (same order); keep both in sync. */
|
|
21
|
+
export declare const HOOK_META: Record<HookName, HookMeta>;
|
|
22
|
+
/** Field-level code. Parameters mirror sd-api libs/entity-codegen.js CALCULATED_PARAMS / VALIDATOR_PARAMS. */
|
|
23
|
+
export declare const FIELD_CODE_META: Record<'calculated' | 'validators', HookMeta>;
|
|
24
|
+
export declare function codeMetaOf(s: SnippetRef): HookMeta | null;
|
|
25
|
+
/** Function header shown above the editor: `async function name(params) {`. */
|
|
26
|
+
export declare function snippetSignature(s: SnippetRef): string;
|
|
27
|
+
/** `async function beforeCreate(db, di, data, user, req) {` header shown above the editor. */
|
|
28
|
+
export declare function hookSignature(name: string): string;
|
|
29
|
+
export declare const MAX_FIELDS = 100;
|
|
30
|
+
export declare const MAX_GROUPS = 20;
|
|
31
|
+
export declare const FIELD_TYPES: {
|
|
32
|
+
value: EntityFieldType;
|
|
33
|
+
label: string;
|
|
34
|
+
}[];
|
|
35
|
+
export declare const SHOW_IF_OPS: {
|
|
36
|
+
value: string;
|
|
37
|
+
label: string;
|
|
38
|
+
}[];
|
|
39
|
+
export declare function fieldTypeLabel(type: string): string;
|
|
40
|
+
export declare const isRelationType: (type: string | undefined) => boolean;
|
|
41
|
+
/** Physical table name preview (server computes the real one). */
|
|
42
|
+
export declare function tableNamePreview(key: string): string;
|
|
43
|
+
export declare const nextUid: () => string;
|
|
44
|
+
export declare function emptyCode(lang?: CodeLang): EntityCode;
|
|
45
|
+
export declare function emptyField(position?: number): DraftField;
|
|
46
|
+
export declare function emptyDraft(): EntityDraft;
|
|
47
|
+
/** Definition from the API -> editable draft (deep copy). */
|
|
48
|
+
export declare function draftFromEntity(e: SettingsEntity): EntityDraft;
|
|
49
|
+
/** Form-engine validators a field can have (names of ValidatorsType / AsyncValidators); `custom` is code and lives in "Валидатор" (code editor). */
|
|
50
|
+
export declare const SYNC_VALIDATOR_OPTIONS: {
|
|
51
|
+
value: string;
|
|
52
|
+
title: string;
|
|
53
|
+
types: string[];
|
|
54
|
+
}[];
|
|
55
|
+
export declare const ASYNC_VALIDATOR_OPTIONS: {
|
|
56
|
+
value: string;
|
|
57
|
+
title: string;
|
|
58
|
+
}[];
|
|
59
|
+
/** Section settings -> payload: only known keys, empty values dropped, booleans that equal the default (off) dropped. */
|
|
60
|
+
export declare function cleanSectionOptions(o: EntitySectionOptions | undefined): EntitySectionOptions;
|
|
61
|
+
/** Draft -> request body (definition JSON per the Story data contract). */
|
|
62
|
+
export declare function buildPayload(d: EntityDraft): any;
|
|
63
|
+
/** Section settings checks (field references must exist, block widths 1..12). Keys are `options.*` like the server paths. */
|
|
64
|
+
export declare function validateSectionOptionsDraft(d: EntityDraft): Record<string, string>;
|
|
65
|
+
/** Instant client-side checks. Returns RU messages keyed by path-like id. */
|
|
66
|
+
export declare function validateDraft(d: EntityDraft, isNew: boolean): Record<string, string>;
|
|
67
|
+
export declare function moveItem<T>(list: T[], from: number, to: number): T[];
|
|
68
|
+
/** Remove references to a deleted/renamed group from fields. */
|
|
69
|
+
export declare function dropGroup(d: EntityDraft, groupKey: string): void;
|
|
70
|
+
/** Field-level code (calculated value / validator) is stored under the field key. */
|
|
71
|
+
export declare function hasFieldCode(d: EntityDraft, kind: 'calculated' | 'validators', key: string): boolean;
|
|
72
|
+
/** Field key renamed: its calculated/validator code follows the field (unless the new key already has code). */
|
|
73
|
+
export declare function renameFieldCode(d: EntityDraft, from: string, to: string): string[];
|
|
74
|
+
/** Field removed: drop its calculated/validator code. */
|
|
75
|
+
export declare function dropFieldCode(d: EntityDraft, key: string): void;
|
|
76
|
+
/** Snippet list: all stored snippets (any kind). */
|
|
77
|
+
export declare function listSnippets(code: EntityCode): SnippetRef[];
|
|
78
|
+
export declare const snippetId: (s: SnippetRef) => string;
|
|
79
|
+
export declare function snippetLabel(s: SnippetRef): string;
|
|
80
|
+
/** Snippets in `code` that point to a field that no longer exists. */
|
|
81
|
+
export declare function orphanSnippets(d: EntityDraft): SnippetRef[];
|
|
82
|
+
export declare function hasBlockingDiagnostics(diags: Record<string, CodeDiagnostic[]>): boolean;
|
|
83
|
+
export declare function diagnosticText(d: CodeDiagnostic): string;
|
|
84
|
+
export declare function planFromResponse(raw: any): EntityPlan;
|
|
85
|
+
/** Response `{data, activation?}` of POST/PUT/DELETE -> entity with the optional activation result. */
|
|
86
|
+
export declare function savedFromResponse(raw: any): SavedEntity;
|
|
87
|
+
export declare const isActivationFailed: (a: EntityActivation | undefined | null) => boolean;
|
|
88
|
+
export declare const ACTIVATION_FAILED_HINT = "\u041E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u043E, \u043D\u043E \u0441\u0443\u0449\u043D\u043E\u0441\u0442\u044C \u043F\u043E\u043A\u0430 \u043D\u0435 \u0430\u043A\u0442\u0438\u0432\u043D\u0430 \u043D\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 (\u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u044F \u0438\u043B\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043C\u043E\u0434\u0435\u043B\u0438 \u043D\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043B\u0438\u0441\u044C). \u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u00AB\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435\u00BB \u0438\u043B\u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435; \u0441\u0435\u0440\u0432\u0435\u0440 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u044E \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438, \u043E\u0448\u0438\u0431\u043A\u0430 \u0437\u0430\u043F\u0438\u0441\u0430\u043D\u0430 \u0432 \u0436\u0443\u0440\u043D\u0430\u043B\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.";
|
|
89
|
+
export declare function destructiveItemText(it: {
|
|
90
|
+
kind?: string;
|
|
91
|
+
field?: string;
|
|
92
|
+
column?: string;
|
|
93
|
+
message?: string;
|
|
94
|
+
}): string;
|
|
95
|
+
export declare function isStatementDestructive(s: PlanStatement): boolean;
|
|
96
|
+
export declare function entitiesErrorCode(err: any): string;
|
|
97
|
+
export declare function entitiesErrorMessage(err: any): string;
|
|
98
|
+
export declare const isVersionConflict: (err: any) => boolean;
|
|
99
|
+
export declare const isForbidden: (err: any) => boolean;
|
|
100
|
+
export declare function serverValidationErrors(err: any): ServerValidationError[];
|
|
101
|
+
export declare function serverDiagnostics(err: any): CodeDiagnostic[];
|
|
102
|
+
export declare function serverDestructiveItems(err: any): any[];
|
|
103
|
+
/** Map server validation errors by path (`fields[1].key`) for inline display. */
|
|
104
|
+
export declare function errorsByPath(list: ServerValidationError[]): Record<string, string>;
|
|
105
|
+
export declare function entityStatusLabel(e: {
|
|
106
|
+
isActive: boolean;
|
|
107
|
+
source: string;
|
|
108
|
+
}): string;
|
|
109
|
+
export declare function filterEntities<T extends {
|
|
110
|
+
title: string;
|
|
111
|
+
key: string;
|
|
112
|
+
}>(list: T[], query: string): T[];
|
|
113
|
+
/** Default value editor helpers (text <-> typed value). */
|
|
114
|
+
export declare function defaultToText(v: any): string;
|
|
115
|
+
export declare function parseDefault(type: string, raw: string): any;
|
|
116
|
+
export declare function showIfValueText(c: {
|
|
117
|
+
op?: string;
|
|
118
|
+
value?: any;
|
|
119
|
+
} | undefined): string;
|
|
120
|
+
export declare function parseShowIfValue(op: string | undefined, text: string): any;
|
|
121
|
+
/** Hooks not yet used + fields not yet used for the given snippet kind. */
|
|
122
|
+
export declare function availableSnippetNames(d: EntityDraft, kind: SnippetKind): string[];
|