@declarion/react 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/dist-lib/JsonEditor-C5NOzsey.js +71 -0
- package/dist-lib/JsonEditor-C5NOzsey.js.map +1 -0
- package/dist-lib/api/auth.d.ts +11 -0
- package/dist-lib/api/client.d.ts +3 -0
- package/dist-lib/api/data.d.ts +28 -0
- package/dist-lib/api/entities.d.ts +75 -0
- package/dist-lib/api/events.d.ts +9 -0
- package/dist-lib/api/params.d.ts +3 -0
- package/dist-lib/api/properties.d.ts +3 -0
- package/dist-lib/api/schema.d.ts +2 -0
- package/dist-lib/api/status.d.ts +2 -0
- package/dist-lib/app.d.ts +1 -0
- package/dist-lib/components/columns/ColumnPicker.d.ts +15 -0
- package/dist-lib/components/detail-layout/AssociatedBlock.d.ts +8 -0
- package/dist-lib/components/detail-layout/AssociatedToolbar.d.ts +13 -0
- package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +15 -0
- package/dist-lib/components/detail-layout/ChildrenCards.d.ts +2 -0
- package/dist-lib/components/detail-layout/ChildrenList.d.ts +2 -0
- package/dist-lib/components/detail-layout/ChildrenTable.d.ts +2 -0
- package/dist-lib/components/detail-layout/ChildrenTimeline.d.ts +2 -0
- package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +15 -0
- package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +15 -0
- package/dist-lib/components/detail-layout/FieldsBlock.d.ts +7 -0
- package/dist-lib/components/detail-layout/LayoutColumn.d.ts +9 -0
- package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +42 -0
- package/dist-lib/components/detail-layout/LayoutRow.d.ts +8 -0
- package/dist-lib/components/detail-layout/LayoutTabs.d.ts +8 -0
- package/dist-lib/components/detail-layout/PropertiesBlock.d.ts +8 -0
- package/dist-lib/components/detail-layout/QuickAddForm.d.ts +10 -0
- package/dist-lib/components/detail-layout/SectionBlock.d.ts +8 -0
- package/dist-lib/components/detail-layout/StatusesBlock.d.ts +8 -0
- package/dist-lib/components/detail-layout/TimelineComposer.d.ts +10 -0
- package/dist-lib/components/detail-layout/index.d.ts +18 -0
- package/dist-lib/components/detail-layout/useQuickAdd.d.ts +17 -0
- package/dist-lib/components/fields/BoolField.d.ts +2 -0
- package/dist-lib/components/fields/EmailField.d.ts +2 -0
- package/dist-lib/components/fields/EnumField.d.ts +2 -0
- package/dist-lib/components/fields/IntArrayField.d.ts +2 -0
- package/dist-lib/components/fields/JsonEditor.d.ts +9 -0
- package/dist-lib/components/fields/JsonField.d.ts +2 -0
- package/dist-lib/components/fields/MultilangField.d.ts +2 -0
- package/dist-lib/components/fields/MultilangTextField.d.ts +2 -0
- package/dist-lib/components/fields/NumberField.d.ts +2 -0
- package/dist-lib/components/fields/PasswordField.d.ts +2 -0
- package/dist-lib/components/fields/RefField.d.ts +2 -0
- package/dist-lib/components/fields/SecretField.d.ts +2 -0
- package/dist-lib/components/fields/StringArrayField.d.ts +2 -0
- package/dist-lib/components/fields/StringField.d.ts +2 -0
- package/dist-lib/components/fields/StructureField.d.ts +2 -0
- package/dist-lib/components/fields/TextField.d.ts +2 -0
- package/dist-lib/components/fields/TimestampField.d.ts +2 -0
- package/dist-lib/components/fields/UrlField.d.ts +2 -0
- package/dist-lib/components/fields/index.d.ts +16 -0
- package/dist-lib/components/filters/FilterChips.d.ts +16 -0
- package/dist-lib/components/filters/FilterDrawer.d.ts +27 -0
- package/dist-lib/components/layout/Layout.d.ts +1 -0
- package/dist-lib/components/layout/Sidebar.d.ts +1 -0
- package/dist-lib/components/layout/TabBar.d.ts +1 -0
- package/dist-lib/components/layout/ThemeToggle.d.ts +1 -0
- package/dist-lib/components/layout/TopBar.d.ts +1 -0
- package/dist-lib/components/pages/AdminCatalogPage.d.ts +1 -0
- package/dist-lib/components/pages/LoginPage.d.ts +1 -0
- package/dist-lib/components/pages/NotFoundPage.d.ts +1 -0
- package/dist-lib/components/pages/SSOCallbackPage.d.ts +1 -0
- package/dist-lib/components/pages/SignupPage.d.ts +1 -0
- package/dist-lib/components/pages/SmartDetailPage.d.ts +5 -0
- package/dist-lib/components/pages/SmartListPage.d.ts +5 -0
- package/dist-lib/components/pages/SmartRecordListPage.d.ts +5 -0
- package/dist-lib/components/shared/ActionButton.d.ts +24 -0
- package/dist-lib/components/shared/ActionConfirmDialog.d.ts +10 -0
- package/dist-lib/components/shared/ActionDialog.d.ts +22 -0
- package/dist-lib/components/shared/ActionResultDialog.d.ts +18 -0
- package/dist-lib/components/shared/AssociationTabs.d.ts +9 -0
- package/dist-lib/components/shared/BatchActionProgress.d.ts +18 -0
- package/dist-lib/components/shared/ConfirmDialog.d.ts +11 -0
- package/dist-lib/components/shared/DynamicIcon.d.ts +6 -0
- package/dist-lib/components/shared/EmptyState.d.ts +9 -0
- package/dist-lib/components/shared/ErrorBoundary.d.ts +22 -0
- package/dist-lib/components/shared/LoadingSkeleton.d.ts +5 -0
- package/dist-lib/components/shared/PageHeader.d.ts +8 -0
- package/dist-lib/components/shared/RowActionItem.d.ts +11 -0
- package/dist-lib/components/shared/StatusGroupsDisplay.d.ts +11 -0
- package/dist-lib/components/ui/alert-dialog.d.ts +14 -0
- package/dist-lib/components/ui/badge.d.ts +9 -0
- package/dist-lib/components/ui/button.d.ts +11 -0
- package/dist-lib/components/ui/card.d.ts +8 -0
- package/dist-lib/components/ui/dialog.d.ts +13 -0
- package/dist-lib/components/ui/dropdown-menu.d.ts +24 -0
- package/dist-lib/components/ui/input.d.ts +3 -0
- package/dist-lib/components/ui/label.d.ts +5 -0
- package/dist-lib/components/ui/select.d.ts +13 -0
- package/dist-lib/components/ui/separator.d.ts +4 -0
- package/dist-lib/components/ui/skeleton.d.ts +2 -0
- package/dist-lib/components/ui/table.d.ts +10 -0
- package/dist-lib/components/ui/textarea.d.ts +3 -0
- package/dist-lib/components/views/ViewSwitcher.d.ts +27 -0
- package/dist-lib/hooks/useAssociatedData.d.ts +10 -0
- package/dist-lib/hooks/useAuth.d.ts +21 -0
- package/dist-lib/hooks/useChildrenData.d.ts +3 -0
- package/dist-lib/hooks/useColumns.d.ts +13 -0
- package/dist-lib/hooks/useDebounce.d.ts +1 -0
- package/dist-lib/hooks/useEntity.d.ts +2 -0
- package/dist-lib/hooks/useEntityData.d.ts +2 -0
- package/dist-lib/hooks/useEntityItem.d.ts +2 -0
- package/dist-lib/hooks/useFilters.d.ts +11 -0
- package/dist-lib/hooks/useMutations.d.ts +13 -0
- package/dist-lib/hooks/useObjectStatus.d.ts +5 -0
- package/dist-lib/hooks/useParams.d.ts +2 -0
- package/dist-lib/hooks/useProperties.d.ts +5 -0
- package/dist-lib/hooks/useSSE.d.ts +1 -0
- package/dist-lib/hooks/useSchema.d.ts +1 -0
- package/dist-lib/hooks/useScreen.d.ts +2 -0
- package/dist-lib/hooks/useTabNavigate.d.ts +8 -0
- package/dist-lib/hooks/useViews.d.ts +6 -0
- package/dist-lib/index.d.ts +37 -0
- package/dist-lib/index.js +8424 -0
- package/dist-lib/index.js.map +1 -0
- package/dist-lib/lib/actions.d.ts +43 -0
- package/dist-lib/lib/child-config.d.ts +23 -0
- package/dist-lib/lib/children-validation.d.ts +3 -0
- package/dist-lib/lib/filters.d.ts +42 -0
- package/dist-lib/lib/quick-add.d.ts +2 -0
- package/dist-lib/lib/size-value.d.ts +16 -0
- package/dist-lib/lib/theme-utils.d.ts +3 -0
- package/dist-lib/lib/timestamp.d.ts +8 -0
- package/dist-lib/lib/utils.d.ts +2 -0
- package/dist-lib/main.d.ts +1 -0
- package/dist-lib/stores/auth.d.ts +15 -0
- package/dist-lib/stores/screen-registry.d.ts +3 -0
- package/dist-lib/stores/tabs.d.ts +21 -0
- package/dist-lib/stores/theme.d.ts +10 -0
- package/dist-lib/types/api.d.ts +178 -0
- package/dist-lib/types/schema.d.ts +380 -0
- package/package.json +85 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Action, ActionCondition, Schema } from "@/types/schema";
|
|
2
|
+
/**
|
|
3
|
+
* Evaluates action conditions against row data.
|
|
4
|
+
* Returns true if the action is available (all conditions pass).
|
|
5
|
+
* An action with no conditions is always available.
|
|
6
|
+
*/
|
|
7
|
+
export declare function evaluateConditions(conditions: ActionCondition[] | undefined, row: Record<string, unknown>): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Returns actions from an entity that match a given visibility placement.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getActionsByVisibility(actions: Record<string, Action> | undefined, visibility: string): Array<{
|
|
12
|
+
code: string;
|
|
13
|
+
action: Action;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Returns actions bound to a screen. When the screen defines explicit action/row_action
|
|
17
|
+
* codes, only those are returned (resolved from entity.actions first, then global actions).
|
|
18
|
+
* When no screen binding exists, falls back to visibility-based filtering.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getScreenActions(entityActions: Record<string, Action> | undefined, screenActionCodes: string[] | undefined, fallbackVisibility: string, globalActions?: Record<string, Action>): Array<{
|
|
21
|
+
code: string;
|
|
22
|
+
action: Action;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Checks if an action has parameters that need user input.
|
|
26
|
+
*/
|
|
27
|
+
export declare function actionHasParams(action: Action): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Builds the full dot-qualified action code for API calls.
|
|
30
|
+
*/
|
|
31
|
+
export declare function fullActionCode(entityCode: string | undefined, actionCode: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if an action is an association navigation action.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isAssociationAction(action: Action): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Finds the list screen route for a given entity code.
|
|
38
|
+
* Returns the screen route and display info, or undefined if no list screen exists.
|
|
39
|
+
*/
|
|
40
|
+
export declare function findListScreenForEntity(schema: Schema | undefined, entityCode: string): {
|
|
41
|
+
route: string;
|
|
42
|
+
icon: string;
|
|
43
|
+
} | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ChildDisplayMode, ChildQuickAdd, ChildRelation, CardsConfig, Entity, LayoutNode, LocalizedString, TimelineConfig } from "@/types/schema";
|
|
2
|
+
export interface ResolvedChildConfig {
|
|
3
|
+
entity: string;
|
|
4
|
+
foreign_key: string | string[];
|
|
5
|
+
name: LocalizedString;
|
|
6
|
+
icon: string;
|
|
7
|
+
mode: ChildDisplayMode;
|
|
8
|
+
columns: string[];
|
|
9
|
+
sort: string;
|
|
10
|
+
limit: number;
|
|
11
|
+
timeline?: TimelineConfig;
|
|
12
|
+
cards?: CardsConfig;
|
|
13
|
+
quick_add?: ChildQuickAdd;
|
|
14
|
+
editable: boolean;
|
|
15
|
+
position_field?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function resolveChildConfig(relation: ChildRelation, childEntity: Entity, screenNode?: LayoutNode): ResolvedChildConfig;
|
|
18
|
+
export declare function inferSort(entity: Entity): string;
|
|
19
|
+
export declare function inferColumns(entity: Entity, fk: string | string[]): string[];
|
|
20
|
+
export declare function inferTimelineFields(tc: TimelineConfig, entity: Entity): TimelineConfig;
|
|
21
|
+
export declare function findPrimaryKey(entity: Entity): string | undefined;
|
|
22
|
+
export declare function findPrimaryKeys(entity: Entity): string[];
|
|
23
|
+
export declare function findChildRelation(parentEntity: Entity, childCode: string): ChildRelation | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Schema } from "@/types/schema";
|
|
2
|
+
import type { PendingChildRow } from "@/components/detail-layout/LayoutRenderer";
|
|
3
|
+
export declare function validatePendingChildren(pendingChildren: Record<string, PendingChildRow[]> | undefined, schema: Schema | undefined): Record<string, Record<string, string[]>>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter system types and utilities.
|
|
3
|
+
* One JSON format everywhere: API, URL, DB, frontend state.
|
|
4
|
+
*/
|
|
5
|
+
/** A single node in the recursive filter tree. */
|
|
6
|
+
export interface FilterNode {
|
|
7
|
+
/** Field condition */
|
|
8
|
+
field?: string;
|
|
9
|
+
op?: FilterOp;
|
|
10
|
+
value?: unknown;
|
|
11
|
+
/** OR group: each inner array is AND-ed, groups are OR-ed */
|
|
12
|
+
or?: FilterNode[][];
|
|
13
|
+
/** Explicit AND group (rarely needed, top-level is implicit AND) */
|
|
14
|
+
and?: FilterNode[];
|
|
15
|
+
}
|
|
16
|
+
/** All supported filter operator codes. */
|
|
17
|
+
export type FilterOp = "eq" | "not_eq" | "gt" | "gte" | "lt" | "lte" | "in" | "not_in" | "between" | "contains" | "starts_with" | "is_empty" | "is_not_empty" | "today" | "this_week" | "this_month" | "last_7_days" | "last_30_days" | "last_hour" | "last_24_hours";
|
|
18
|
+
/** Operators that don't take a value. */
|
|
19
|
+
export declare const NO_VALUE_OPS: Set<FilterOp>;
|
|
20
|
+
/** Human-friendly display names for operators. */
|
|
21
|
+
export declare const OP_LABELS: Record<FilterOp, string>;
|
|
22
|
+
/** Parse filters from URL search params (JSON `filters` param). */
|
|
23
|
+
export declare function parseFiltersFromURL(searchParams: URLSearchParams): FilterNode[];
|
|
24
|
+
/** Write filters to URL search params. */
|
|
25
|
+
export declare function setFiltersInURL(filters: FilterNode[], searchParams: URLSearchParams): void;
|
|
26
|
+
/**
|
|
27
|
+
* Convert FilterNode array to API query params.
|
|
28
|
+
* Uses the JSON `filters` param for the API request.
|
|
29
|
+
*/
|
|
30
|
+
export declare function filtersToApiParams(filters: FilterNode[]): URLSearchParams;
|
|
31
|
+
/** Check if the filter tree has any OR groups (needs Level 2 UI). */
|
|
32
|
+
export declare function hasOrGroups(nodes: FilterNode[]): boolean;
|
|
33
|
+
/** Extract flat field conditions from a FilterNode array (ignoring OR/AND structure). */
|
|
34
|
+
export declare function flatFieldConditions(nodes: FilterNode[]): FilterNode[];
|
|
35
|
+
/** Count active field conditions in the filter tree. */
|
|
36
|
+
export declare function countActiveFilters(nodes: FilterNode[]): number;
|
|
37
|
+
/** Format a filter node for chip display. */
|
|
38
|
+
export declare function formatFilterChip(node: FilterNode): string;
|
|
39
|
+
/** Create a simple equality filter node. */
|
|
40
|
+
export declare function eqFilter(field: string, value: string): FilterNode;
|
|
41
|
+
/** Remove a filter node by field name, recursing into OR/AND groups. */
|
|
42
|
+
export declare function removeFilter(nodes: FilterNode[], field: string): FilterNode[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare function buildQuickAddPayload(fieldValues: Record<string, unknown>, defaults: Record<string, unknown> | undefined, foreignKey: string | string[], parentId: string | string[]): Record<string, unknown>;
|
|
2
|
+
export declare function isQuickAddReady(fieldValues: Record<string, unknown>, requiredFields: string[]): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SizeValue } from "@/types/schema";
|
|
2
|
+
export type ParsedSizeValue = {
|
|
3
|
+
kind: "weight";
|
|
4
|
+
value: number;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "px";
|
|
7
|
+
value: number;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "auto";
|
|
10
|
+
} | {
|
|
11
|
+
kind: "fill";
|
|
12
|
+
};
|
|
13
|
+
export declare function parseSizeValue(raw: SizeValue | undefined): ParsedSizeValue | null;
|
|
14
|
+
export declare function isValidSizeValue(raw: SizeValue | undefined): boolean;
|
|
15
|
+
export declare function sizeValueToCSS(parsed: ParsedSizeValue): string;
|
|
16
|
+
export declare function normalizeSizeValue(raw: SizeValue | undefined, defaultValue: ParsedSizeValue): ParsedSizeValue;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format an offset-aware timestamp string (e.g. "2026-03-27T14:30:00+03:00")
|
|
3
|
+
* for display WITHOUT browser-local timezone conversion. The server returns
|
|
4
|
+
* timestamps already converted to the target timezone - we display as-is.
|
|
5
|
+
*
|
|
6
|
+
* Falls back to browser-local formatting for bare datetime strings.
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatOffsetTimestamp(raw: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./globals.css";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AuthUser, Tenant } from "@/types/api";
|
|
2
|
+
interface AuthState {
|
|
3
|
+
user: AuthUser | null;
|
|
4
|
+
isAuthenticated: boolean;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
activeTenant: Tenant | null;
|
|
7
|
+
tenants: Tenant[];
|
|
8
|
+
initialize: () => Promise<void>;
|
|
9
|
+
setUser: (user: AuthUser, tenant?: Tenant) => void;
|
|
10
|
+
setTenants: (tenants: Tenant[]) => void;
|
|
11
|
+
setActiveTenant: (tenant: Tenant) => void;
|
|
12
|
+
logout: () => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare const useAuthStore: import("zustand").UseBoundStore<import("zustand").StoreApi<AuthState>>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface TabItem {
|
|
2
|
+
id: string;
|
|
3
|
+
pathname: string;
|
|
4
|
+
search: string;
|
|
5
|
+
title: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
closable: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface TabState {
|
|
10
|
+
tabs: TabItem[];
|
|
11
|
+
activeTabId: string | null;
|
|
12
|
+
openTab: (tab: Omit<TabItem, "id">) => string;
|
|
13
|
+
closeTab: (id: string) => void;
|
|
14
|
+
switchTab: (id: string) => void;
|
|
15
|
+
reorderTabs: (activeId: string, overId: string) => void;
|
|
16
|
+
findTabByPathname: (pathname: string) => TabItem | undefined;
|
|
17
|
+
updateTabTitle: (id: string, title: string) => void;
|
|
18
|
+
updateTabSearch: (id: string, search: string) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const useTabStore: import("zustand").UseBoundStore<import("zustand").StoreApi<TabState>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type ThemeTokens = Record<string, string>;
|
|
2
|
+
interface ThemeState {
|
|
3
|
+
selectedTheme: string;
|
|
4
|
+
effectiveTheme: string;
|
|
5
|
+
availableThemes: Record<string, ThemeTokens>;
|
|
6
|
+
setTheme: (name: string) => void;
|
|
7
|
+
setAvailableThemes: (themes: Record<string, ThemeTokens>) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const useThemeStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ThemeState>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import type { LocalizedString } from "./schema";
|
|
2
|
+
export interface ListMeta {
|
|
3
|
+
total: number;
|
|
4
|
+
page: number;
|
|
5
|
+
per_page: number;
|
|
6
|
+
total_pages: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ListResponse<T = Record<string, unknown>> {
|
|
9
|
+
data: T[];
|
|
10
|
+
meta: ListMeta;
|
|
11
|
+
$refs?: Record<string, Record<string, Record<string, unknown>>>;
|
|
12
|
+
}
|
|
13
|
+
export interface DataResponse<T = Record<string, unknown>> {
|
|
14
|
+
data: T;
|
|
15
|
+
}
|
|
16
|
+
export interface ApiErrorBody {
|
|
17
|
+
error: {
|
|
18
|
+
message: string;
|
|
19
|
+
code: string;
|
|
20
|
+
field?: string;
|
|
21
|
+
};
|
|
22
|
+
/** Bulk operation item index (present on validation errors for array requests). */
|
|
23
|
+
index?: number;
|
|
24
|
+
}
|
|
25
|
+
export declare class ApiError extends Error {
|
|
26
|
+
status: number;
|
|
27
|
+
code: string;
|
|
28
|
+
/** Bulk operation item index (present on validation errors for array requests). */
|
|
29
|
+
index?: number;
|
|
30
|
+
constructor(status: number, message: string, code: string, index?: number);
|
|
31
|
+
}
|
|
32
|
+
export interface Tenant {
|
|
33
|
+
id: string;
|
|
34
|
+
code: string;
|
|
35
|
+
name: string;
|
|
36
|
+
role: string;
|
|
37
|
+
}
|
|
38
|
+
export interface AuthUser {
|
|
39
|
+
id: string;
|
|
40
|
+
email: string;
|
|
41
|
+
display_name: string;
|
|
42
|
+
is_active: boolean;
|
|
43
|
+
roles: string[];
|
|
44
|
+
permissions?: string[];
|
|
45
|
+
tenant?: Tenant;
|
|
46
|
+
created_at: string;
|
|
47
|
+
updated_at: string;
|
|
48
|
+
}
|
|
49
|
+
export interface LoginResponse {
|
|
50
|
+
expires_at: string;
|
|
51
|
+
user: AuthUser;
|
|
52
|
+
tenant?: Tenant;
|
|
53
|
+
}
|
|
54
|
+
export interface CheckSetupResponse {
|
|
55
|
+
needs_setup: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface StatusInfo {
|
|
58
|
+
group_code: string;
|
|
59
|
+
status_code: string;
|
|
60
|
+
status_name: LocalizedString;
|
|
61
|
+
color?: string;
|
|
62
|
+
set_by?: string;
|
|
63
|
+
set_at: string;
|
|
64
|
+
note?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface PropertyValue {
|
|
67
|
+
property_code: string;
|
|
68
|
+
name: LocalizedString;
|
|
69
|
+
type: string;
|
|
70
|
+
value: unknown;
|
|
71
|
+
}
|
|
72
|
+
export interface PublicParam {
|
|
73
|
+
code: string;
|
|
74
|
+
name: LocalizedString;
|
|
75
|
+
type: string;
|
|
76
|
+
category: string;
|
|
77
|
+
description?: LocalizedString;
|
|
78
|
+
value: unknown;
|
|
79
|
+
}
|
|
80
|
+
export interface ResolvedParam {
|
|
81
|
+
code: string;
|
|
82
|
+
name: LocalizedString;
|
|
83
|
+
type: string;
|
|
84
|
+
category?: string;
|
|
85
|
+
description?: LocalizedString;
|
|
86
|
+
value: unknown;
|
|
87
|
+
source: "object" | "user" | "role" | "tenant" | "env" | "yaml" | "none";
|
|
88
|
+
}
|
|
89
|
+
export interface ParamOverride {
|
|
90
|
+
param_code: string;
|
|
91
|
+
value: unknown;
|
|
92
|
+
}
|
|
93
|
+
export interface SSOProvider {
|
|
94
|
+
name: string;
|
|
95
|
+
slug: string;
|
|
96
|
+
}
|
|
97
|
+
export interface ListParams {
|
|
98
|
+
page?: number;
|
|
99
|
+
per_page?: number;
|
|
100
|
+
sort?: string;
|
|
101
|
+
search?: string;
|
|
102
|
+
/** JSON filter nodes (recursive AND/OR tree). */
|
|
103
|
+
filters?: FilterNodeParam[];
|
|
104
|
+
include_deleted?: boolean;
|
|
105
|
+
expand?: string[];
|
|
106
|
+
screen?: string;
|
|
107
|
+
}
|
|
108
|
+
/** Minimal filter node type for API params (matches backend FilterNode). */
|
|
109
|
+
export interface FilterNodeParam {
|
|
110
|
+
field?: string;
|
|
111
|
+
op?: string;
|
|
112
|
+
value?: unknown;
|
|
113
|
+
or?: FilterNodeParam[][];
|
|
114
|
+
and?: FilterNodeParam[];
|
|
115
|
+
}
|
|
116
|
+
/** Cursor-based pagination metadata returned by v2 List. */
|
|
117
|
+
export interface V2Meta {
|
|
118
|
+
total: number;
|
|
119
|
+
limit: number;
|
|
120
|
+
has_more: boolean;
|
|
121
|
+
cursor?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Refs map: keyed by entity code (or $-prefixed virtual entity code),
|
|
125
|
+
* then by record ID, then field values.
|
|
126
|
+
* Example: { company: { "uuid-1": { id: "uuid-1", name: "Acme" } } }
|
|
127
|
+
*/
|
|
128
|
+
export type Refs = Record<string, Record<string, Record<string, unknown>>>;
|
|
129
|
+
/** Per-row status instance. */
|
|
130
|
+
export interface V2StatusInstance {
|
|
131
|
+
group_code: string;
|
|
132
|
+
status_code: string;
|
|
133
|
+
status_name?: Record<string, string>;
|
|
134
|
+
color?: string;
|
|
135
|
+
set_at?: string;
|
|
136
|
+
set_by?: string;
|
|
137
|
+
note?: string;
|
|
138
|
+
}
|
|
139
|
+
/** Per-row property instance. */
|
|
140
|
+
export interface V2PropertyInstance {
|
|
141
|
+
property_code: string;
|
|
142
|
+
value: unknown;
|
|
143
|
+
updated_at?: string;
|
|
144
|
+
updated_by?: string;
|
|
145
|
+
}
|
|
146
|
+
/** Per-row parameter override. */
|
|
147
|
+
export interface V2ParamInstance {
|
|
148
|
+
param_code: string;
|
|
149
|
+
value: unknown;
|
|
150
|
+
}
|
|
151
|
+
/** v2 List response with cursor pagination and response-level $refs. */
|
|
152
|
+
export interface V2ListResponse<T = Record<string, unknown>> {
|
|
153
|
+
data: T[];
|
|
154
|
+
meta: V2Meta;
|
|
155
|
+
$refs?: Refs;
|
|
156
|
+
}
|
|
157
|
+
/** v2 List query parameters. */
|
|
158
|
+
export interface V2ListParams {
|
|
159
|
+
select?: string[];
|
|
160
|
+
expand?: string[];
|
|
161
|
+
sort?: string;
|
|
162
|
+
search?: string;
|
|
163
|
+
filters?: FilterNodeParam[];
|
|
164
|
+
limit?: number;
|
|
165
|
+
after?: string;
|
|
166
|
+
include_deleted?: boolean;
|
|
167
|
+
}
|
|
168
|
+
/** Per-field resolved display unit codes. */
|
|
169
|
+
export type Units = Record<string, string>;
|
|
170
|
+
/** A row enriched with $-prefixed sub-resources (as returned by Get or write responses). */
|
|
171
|
+
export interface EnrichedRow extends Record<string, unknown> {
|
|
172
|
+
$refs?: Refs;
|
|
173
|
+
$statuses?: V2StatusInstance[];
|
|
174
|
+
$properties?: V2PropertyInstance[];
|
|
175
|
+
$params?: V2ParamInstance[];
|
|
176
|
+
$children?: Record<string, Record<string, unknown>[]>;
|
|
177
|
+
$units?: Units;
|
|
178
|
+
}
|