@protobase/schema 0.28.1 → 0.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/layout.d.ts +18 -2
- package/dist/layout.js +22 -1
- package/dist/model.d.ts +30 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Rollup, RollupCount, RollupFn, RollupSource, RollupValue } from "./computed/rollup.js";
|
|
2
2
|
import { FileOptions, FileProcessor, FileProcessorInput, ImageFormat, ImageVariant, ImageVariantOptions, imageFormats } from "./files/file-options.js";
|
|
3
|
-
import { ActionInputKind, ActionInputModel, ActionModel, ActionRun, AppAddress, BadgeShape, BottomBarItemModel, BottomBarModel, CalendarView, CardFavoriteModel, CardPhotosModel, ChartGranularity, ChartModel, ChartRange, CheckedFilter, CommentsSectionModel, CompareOp, CreateModel, CustomSectionModel, DatePreset, DurationLiteral, DurationUnit, EventModel, EventOperation, ExportModel, FieldFormat, FieldModel, FieldPath, FieldType, FieldViewModel, FieldWidgetModel, FileFieldModel, FilterError, FilterErrorCode, FilterExpr, FilterLayout, FilterOf, FilterValue, FilterWidgetModel, FormModel, GalleryModel, GroupChartModel, GroupItemModel, GroupModel, HelpWhen, HistorySectionModel, JsonValue, KeyValue, LayoutItemModel, ListDisplayModel, ListDragModel, ListModel, ListQuery, Literal, MapSectionModel, MapView, NamedListModel, NavModel, NavRecentModel, NowValue, OrderByItem, ParentAccess, ParentModel, PeriodChartModel, PositionAfterModel, RecordMode, RecordWhen, RelatedColumnModel, RelatedModel, RelatedPresentation, ResourceModel, SaveFeedback, SaveSearchModel, SearchMatch, SearchResultModel, SearchesOfModel, SectionModel, SectionPresentation, ShowWhen, SignInPromptModel, SignInViewModel, SortSpec, Span, StatusTone, TabItemModel, TabModel, TimelineView, UserMenuItemModel, UserMenuModel, ViewModel } from "./model.js";
|
|
3
|
+
import { ActionInputKind, ActionInputModel, ActionModel, ActionRun, AppAddress, BadgeShape, BottomBarItemModel, BottomBarModel, CalendarView, CardFavoriteModel, CardPhotosModel, ChartGranularity, ChartModel, ChartRange, CheckedFilter, CommentsSectionModel, CompareOp, CreateModel, CustomSectionModel, DatePreset, DurationLiteral, DurationUnit, EventModel, EventOperation, ExportModel, FieldFormat, FieldModel, FieldPath, FieldType, FieldViewModel, FieldWidgetModel, FileFieldModel, FilterError, FilterErrorCode, FilterExpr, FilterLayout, FilterOf, FilterValue, FilterWidgetModel, FormModel, GalleryModel, GroupChartModel, GroupItemModel, GroupModel, HelpWhen, HistorySectionModel, JsonValue, KeyValue, LayoutItemModel, ListDisplayModel, ListDragModel, ListModel, ListQuery, Literal, MapSectionModel, MapView, NamedListModel, NavModel, NavRecentModel, NowValue, OrderByItem, ParentAccess, ParentModel, PeriodChartModel, PositionAfterModel, RecordChartModel, RecordChartRange, RecordMode, RecordWhen, RelatedColumnModel, RelatedModel, RelatedPresentation, ResourceModel, SaveFeedback, SaveSearchModel, SearchMatch, SearchResultModel, SearchesOfModel, SectionModel, SectionPresentation, ShowWhen, SignInPromptModel, SignInViewModel, SortSpec, Span, StatusTone, TabItemModel, TabModel, TimelineView, UserMenuItemModel, UserMenuModel, ViewModel } from "./model.js";
|
|
4
4
|
import { AccessAction, AccessContext, AccessFn, AccessResult, AccessUser, FieldAccess, FieldRule } from "./access/types.js";
|
|
5
5
|
import { AnyField, Constraint, Field, FieldMeta, FieldTypeDef } from "./field.js";
|
|
6
6
|
import { RelationField } from "./relation-field.js";
|
|
@@ -43,4 +43,4 @@ import { AccessSource, ResolveOptions, ResolvedAccess, RowFilterOperation, acces
|
|
|
43
43
|
import { restrictModel } from "./access/restrict.js";
|
|
44
44
|
import "./access/index.js";
|
|
45
45
|
import { AssistantAction, AssistantActionRequest, AssistantCardPart, AssistantDiff, AssistantEvent, AssistantMessage, AssistantMessageRequest, AssistantPart, AssistantState, AssistantStep, AssistantStepState, AssistantTablePart, AssistantTextPart, AssistantTone, AssistantWidgetPart } from "./assistant/protocol.js";
|
|
46
|
-
export { type Access, type AccessAction, type AccessContext, type AccessFn, type AccessResult, type AccessSource, type AccessUser, type ActionInputKind, type ActionInputModel, type ActionModel, type ActionRun, type AnyField, type AppAddress, type AssistantAction, type AssistantActionRequest, type AssistantCardPart, type AssistantDiff, type AssistantEvent, type AssistantMessage, type AssistantMessageRequest, type AssistantPart, type AssistantState, type AssistantStep, type AssistantStepState, type AssistantTablePart, type AssistantTextPart, type AssistantTone, type AssistantWidgetPart, type BadgeShape, type BottomBarItemModel, type BottomBarModel, type BottomBarNames, type BottomBarSource, type CalendarView, type Capability, type CapabilityAction, type CapabilityLimit, type CapabilityScope, type CardFavoriteModel, type CardPhotosModel, type ChartGranularity, type ChartInput, type ChartModel, type ChartRange, type CheckResult, type CheckedFilter, type CommentsSectionModel, type CompareOp, type ComponentRef, type Constraint, type CreateModel, type CreatedOptions, type CustomSectionModel, type DatePreset, type DeletedOptions, type DurationLiteral, type DurationUnit, type EvaluateOptions, type EventActor, type EventContext, type EventHelpers, type EventMatch, type EventModel, type EventOperation, type EventSpec, type ExportModel, type Field, type FieldAccess, type FieldFormat, type FieldMeta, type FieldModel, type FieldPath, type FieldRefValue, type FieldRefs, type FieldRule, type FieldType, type FieldTypeDef, type FieldView, type FieldViewModel, type FieldViews, type FieldWidgetModel, type FieldsInput, type FileField, type FileFieldModel, type FileOptions, type FileProcessor, type FileProcessorInput, type FilterError, type FilterErrorCode, type FilterExpr, type FilterLayout, type FilterLimits, type FilterOf, type FilterParse, type FilterValue, type FilterWidgetModel, type FormAddress, type FormInput, type FormModel, type GalleryModel, type Grant, type GroupChartInput, type GroupChartModel, type GroupItemModel, type GroupModel, type HeldCapability, type HelpWhen, type HistorySectionModel, type ImageFormat, type ImageVariant, type ImageVariantOptions, type InferRecord, type Issue, type JsonValue, type KeyOf, type KeyRefs, type KeyType, type KeyValue, type LayoutItemModel, type ListColumn, type ListDisplayModel, type ListDragModel, type ListModel, type ListQuery, type Literal, type MapSectionModel, type MapView, type NamedListModel, type NavModel, type NavRecentModel, type NowValue, type OrderByCheck, type OrderByItem, type OrderByParse, type ParentAccess, type ParentModel, type PeriodChartInput, type PeriodChartModel, type PositionAfterModel, type RecordKey, type RecordMode, type RecordOf, type RecordWhen, type Ref, type Refs, type RelatedColumnModel, type RelatedModel, type RelatedPresentation, type RelationField, type ResolveOptions, type ResolvedAccess, type ResourceBuilder, type ResourceModel, type RoleEntry, type RoleLimit, type Roles, type RolesOptions, type Rollup, type RollupCount, type RollupFn, type RollupSource, type RollupValue, type RowFilterOperation, type Rule, type SaveFeedback, type SaveSearchModel, type SearchMatch, type SearchRef, type SearchRefs, type SearchResultModel, type SearchesOfModel, type SectionModel, type SectionPresentation, type ShowWhen, type SignInAddress, type SignInPromptModel, type SignInStep, type SignInViewModel, type SortSpec, type Span, type StatusTone, type TabItemModel, type TabModel, type TimelineView, type UndeletedOptions, type UpdatedOptions, type UserMenuItemModel, type UserMenuModel, type UserMenuSource, type Validator, type ViewBuilder, type ViewModel, type ViewProps, accessWarnings, addressWords, anonymousRole, appPath, bottomBar, bottomBarErrors, checkFilter, checkOrderBy, checkRecord, createWhere, defineRoles, enumLabel, evaluateFilter, f, fieldRef, fieldsUsedBy, fitsKeyType, formPath, formRoute, imageFormats, isRecordCondition, keyTypes, layout as l, maxBottomBarItems, parseFilter, parseOrderBy, pickView, printFilter, printOrderBy, readAppPath, readFormAddress, readSignInAddress, resolveAccess, resource, restrictModel, rule, signInParams, signInPath, signInRoute, signInSteps, userMenu, view, where };
|
|
46
|
+
export { type Access, type AccessAction, type AccessContext, type AccessFn, type AccessResult, type AccessSource, type AccessUser, type ActionInputKind, type ActionInputModel, type ActionModel, type ActionRun, type AnyField, type AppAddress, type AssistantAction, type AssistantActionRequest, type AssistantCardPart, type AssistantDiff, type AssistantEvent, type AssistantMessage, type AssistantMessageRequest, type AssistantPart, type AssistantState, type AssistantStep, type AssistantStepState, type AssistantTablePart, type AssistantTextPart, type AssistantTone, type AssistantWidgetPart, type BadgeShape, type BottomBarItemModel, type BottomBarModel, type BottomBarNames, type BottomBarSource, type CalendarView, type Capability, type CapabilityAction, type CapabilityLimit, type CapabilityScope, type CardFavoriteModel, type CardPhotosModel, type ChartGranularity, type ChartInput, type ChartModel, type ChartRange, type CheckResult, type CheckedFilter, type CommentsSectionModel, type CompareOp, type ComponentRef, type Constraint, type CreateModel, type CreatedOptions, type CustomSectionModel, type DatePreset, type DeletedOptions, type DurationLiteral, type DurationUnit, type EvaluateOptions, type EventActor, type EventContext, type EventHelpers, type EventMatch, type EventModel, type EventOperation, type EventSpec, type ExportModel, type Field, type FieldAccess, type FieldFormat, type FieldMeta, type FieldModel, type FieldPath, type FieldRefValue, type FieldRefs, type FieldRule, type FieldType, type FieldTypeDef, type FieldView, type FieldViewModel, type FieldViews, type FieldWidgetModel, type FieldsInput, type FileField, type FileFieldModel, type FileOptions, type FileProcessor, type FileProcessorInput, type FilterError, type FilterErrorCode, type FilterExpr, type FilterLayout, type FilterLimits, type FilterOf, type FilterParse, type FilterValue, type FilterWidgetModel, type FormAddress, type FormInput, type FormModel, type GalleryModel, type Grant, type GroupChartInput, type GroupChartModel, type GroupItemModel, type GroupModel, type HeldCapability, type HelpWhen, type HistorySectionModel, type ImageFormat, type ImageVariant, type ImageVariantOptions, type InferRecord, type Issue, type JsonValue, type KeyOf, type KeyRefs, type KeyType, type KeyValue, type LayoutItemModel, type ListColumn, type ListDisplayModel, type ListDragModel, type ListModel, type ListQuery, type Literal, type MapSectionModel, type MapView, type NamedListModel, type NavModel, type NavRecentModel, type NowValue, type OrderByCheck, type OrderByItem, type OrderByParse, type ParentAccess, type ParentModel, type PeriodChartInput, type PeriodChartModel, type PositionAfterModel, type RecordChartModel, type RecordChartRange, type RecordKey, type RecordMode, type RecordOf, type RecordWhen, type Ref, type Refs, type RelatedColumnModel, type RelatedModel, type RelatedPresentation, type RelationField, type ResolveOptions, type ResolvedAccess, type ResourceBuilder, type ResourceModel, type RoleEntry, type RoleLimit, type Roles, type RolesOptions, type Rollup, type RollupCount, type RollupFn, type RollupSource, type RollupValue, type RowFilterOperation, type Rule, type SaveFeedback, type SaveSearchModel, type SearchMatch, type SearchRef, type SearchRefs, type SearchResultModel, type SearchesOfModel, type SectionModel, type SectionPresentation, type ShowWhen, type SignInAddress, type SignInPromptModel, type SignInStep, type SignInViewModel, type SortSpec, type Span, type StatusTone, type TabItemModel, type TabModel, type TimelineView, type UndeletedOptions, type UpdatedOptions, type UserMenuItemModel, type UserMenuModel, type UserMenuSource, type Validator, type ViewBuilder, type ViewModel, type ViewProps, accessWarnings, addressWords, anonymousRole, appPath, bottomBar, bottomBarErrors, checkFilter, checkOrderBy, checkRecord, createWhere, defineRoles, enumLabel, evaluateFilter, f, fieldRef, fieldsUsedBy, fitsKeyType, formPath, formRoute, imageFormats, isRecordCondition, keyTypes, layout as l, maxBottomBarItems, parseFilter, parseOrderBy, pickView, printFilter, printOrderBy, readAppPath, readFormAddress, readSignInAddress, resolveAccess, resource, restrictModel, rule, signInParams, signInPath, signInRoute, signInSteps, userMenu, view, where };
|
package/dist/layout.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CardPhotosModel, HelpWhen, LayoutItemModel, RecordWhen, RelatedModel, SectionPresentation, ShowWhen } from "./model.js";
|
|
1
|
+
import { CardPhotosModel, HelpWhen, LayoutItemModel, RecordChartRange, RecordWhen, RelatedModel, SectionPresentation, ShowWhen } from "./model.js";
|
|
2
2
|
import { Ref } from "./refs.js";
|
|
3
3
|
import { ComponentRef, ViewProps } from "./view-displays.js";
|
|
4
4
|
//#region src/layout.d.ts
|
|
@@ -61,7 +61,7 @@ export declare const layout: {
|
|
|
61
61
|
}) => LayoutItemModel;
|
|
62
62
|
/**
|
|
63
63
|
* A tab of the record page holding main-column items: sections, groups, related tables, custom components, maps,
|
|
64
|
-
* galleries, history and comments. A view's tabs stand together and show as one strip, the first tab open unless the
|
|
64
|
+
* charts, galleries, history and comments. A view's tabs stand together and show as one strip, the first tab open unless the
|
|
65
65
|
* address names another; items before and after them show on every tab. Throws on a sidebar item or another tab. See
|
|
66
66
|
* [Tabs](website/src/content/docs/reference/ui-config.mdx#tabs).
|
|
67
67
|
*/
|
|
@@ -80,6 +80,22 @@ export declare const layout: {
|
|
|
80
80
|
sidebar?: boolean;
|
|
81
81
|
when?: ShowWhen;
|
|
82
82
|
}) => LayoutItemModel;
|
|
83
|
+
/**
|
|
84
|
+
* Line graphs of numeric fields of the records of `resource` that point at this one through `field`, such as a
|
|
85
|
+
* machine's metric samples, over their timestamp `at`: per minute over the last hour, per 5 minutes over the last day
|
|
86
|
+
* and per hour over the last week, the average or the maximum of each bucket, opening on `range` (default `1h`). A
|
|
87
|
+
* bucket without a sample is a gap. Throws without a series. See
|
|
88
|
+
* [Charts of related records](website/src/content/docs/reference/ui-config.mdx#charts-of-related-records).
|
|
89
|
+
*/
|
|
90
|
+
chart: (title: string, o: {
|
|
91
|
+
resource: string;
|
|
92
|
+
field: string;
|
|
93
|
+
at: string;
|
|
94
|
+
series: string[];
|
|
95
|
+
range?: RecordChartRange;
|
|
96
|
+
help?: string;
|
|
97
|
+
when?: ShowWhen;
|
|
98
|
+
}) => LayoutItemModel;
|
|
83
99
|
/**
|
|
84
100
|
* The record's changes, newest first: who made each, when, and the fields before and after, only those the user may
|
|
85
101
|
* read. `limit` changes show before Show more (default 10). Needs `.history()` on the resource; a view without a
|
package/dist/layout.js
CHANGED
|
@@ -77,7 +77,7 @@ const layout = {
|
|
|
77
77
|
},
|
|
78
78
|
/**
|
|
79
79
|
* A tab of the record page holding main-column items: sections, groups, related tables, custom components, maps,
|
|
80
|
-
* galleries, history and comments. A view's tabs stand together and show as one strip, the first tab open unless the
|
|
80
|
+
* charts, galleries, history and comments. A view's tabs stand together and show as one strip, the first tab open unless the
|
|
81
81
|
* address names another; items before and after them show on every tab. Throws on a sidebar item or another tab. See
|
|
82
82
|
* [Tabs](website/src/content/docs/reference/ui-config.mdx#tabs).
|
|
83
83
|
*/
|
|
@@ -111,6 +111,27 @@ const layout = {
|
|
|
111
111
|
...o.when !== void 0 && { when: o.when }
|
|
112
112
|
}),
|
|
113
113
|
/**
|
|
114
|
+
* Line graphs of numeric fields of the records of `resource` that point at this one through `field`, such as a
|
|
115
|
+
* machine's metric samples, over their timestamp `at`: per minute over the last hour, per 5 minutes over the last day
|
|
116
|
+
* and per hour over the last week, the average or the maximum of each bucket, opening on `range` (default `1h`). A
|
|
117
|
+
* bucket without a sample is a gap. Throws without a series. See
|
|
118
|
+
* [Charts of related records](website/src/content/docs/reference/ui-config.mdx#charts-of-related-records).
|
|
119
|
+
*/
|
|
120
|
+
chart: (title, o) => {
|
|
121
|
+
if (o.series.length === 0) throw new Error(`l.chart "${title}" needs at least one series`);
|
|
122
|
+
return {
|
|
123
|
+
kind: "chart",
|
|
124
|
+
title,
|
|
125
|
+
resource: o.resource,
|
|
126
|
+
field: o.field,
|
|
127
|
+
at: o.at,
|
|
128
|
+
series: [...o.series],
|
|
129
|
+
...o.range !== void 0 && { range: o.range },
|
|
130
|
+
...o.help !== void 0 && { help: o.help },
|
|
131
|
+
...o.when !== void 0 && { when: o.when }
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
/**
|
|
114
135
|
* The record's changes, newest first: who made each, when, and the fields before and after, only those the user may
|
|
115
136
|
* read. `limit` changes show before Show more (default 10). Needs `.history()` on the resource; a view without a
|
|
116
137
|
* layout shows it last by itself. See [Record history](website/src/content/docs/reference/history.mdx).
|
package/dist/model.d.ts
CHANGED
|
@@ -806,6 +806,34 @@ export type MapSectionModel = {
|
|
|
806
806
|
/** Whether it shows on the form, the read view or both. */
|
|
807
807
|
when?: ShowWhen;
|
|
808
808
|
};
|
|
809
|
+
/** How far back a record chart reaches, ending now: the last hour, day or week. */
|
|
810
|
+
export type RecordChartRange = '1h' | '24h' | '7d';
|
|
811
|
+
/**
|
|
812
|
+
* Line graphs of numeric fields of the records of `resource` that point at the record through `field`, over their
|
|
813
|
+
* timestamp `at`: the average or the maximum of each per minute over the last hour, per 5 minutes over the last day
|
|
814
|
+
* and per hour over the last week, read through the aggregate API with the caller's access. A bucket without a sample
|
|
815
|
+
* is a gap. See [Charts of related records](website/src/content/docs/reference/ui-config.mdx#charts-of-related-records).
|
|
816
|
+
*/
|
|
817
|
+
export type RecordChartModel = {
|
|
818
|
+
/** A chart of related records. */
|
|
819
|
+
kind: 'chart';
|
|
820
|
+
/** The section's title. */
|
|
821
|
+
title: string;
|
|
822
|
+
/** The resource whose records it charts. */
|
|
823
|
+
resource: string;
|
|
824
|
+
/** The filterable relation on `resource` that holds this record's key. */
|
|
825
|
+
field: string;
|
|
826
|
+
/** The filterable timestamp field of `resource` the records are placed by. */
|
|
827
|
+
at: string;
|
|
828
|
+
/** The numeric fields of `resource` it draws, one line each. */
|
|
829
|
+
series: string[];
|
|
830
|
+
/** The range it opens on; `1h` when omitted. */
|
|
831
|
+
range?: RecordChartRange;
|
|
832
|
+
/** A line under the title. */
|
|
833
|
+
help?: string;
|
|
834
|
+
/** Whether it shows on the form, the read view or both. */
|
|
835
|
+
when?: ShowWhen;
|
|
836
|
+
};
|
|
809
837
|
/**
|
|
810
838
|
* The record's changes, newest first, with who made each and the fields before and after: only fields the caller may
|
|
811
839
|
* read. Needs `.history()` on the resource. See [Record history](website/src/content/docs/reference/history.mdx).
|
|
@@ -862,7 +890,7 @@ export type LayoutItemModel = SectionModel | {
|
|
|
862
890
|
fields: string[];
|
|
863
891
|
/** Whether it shows on the form, the read view or both, or a condition on the saved record that it shows while it holds. */
|
|
864
892
|
when?: RecordWhen;
|
|
865
|
-
} | RelatedModel | GroupModel | CustomSectionModel | MapSectionModel | GalleryModel | HistorySectionModel | CommentsSectionModel | TabModel;
|
|
893
|
+
} | RelatedModel | GroupModel | CustomSectionModel | MapSectionModel | RecordChartModel | GalleryModel | HistorySectionModel | CommentsSectionModel | TabModel;
|
|
866
894
|
/** A titled group of sections and related tables on the record page, closed until opened with `collapsed`; see [Groups](website/src/content/docs/reference/ui-config.mdx#groups). */
|
|
867
895
|
export type GroupModel = {
|
|
868
896
|
/** A group of sections and related tables. */
|
|
@@ -888,7 +916,7 @@ export type TabModel = {
|
|
|
888
916
|
items: TabItemModel[];
|
|
889
917
|
};
|
|
890
918
|
/** An item a tab may hold: any of the main column. */
|
|
891
|
-
export type TabItemModel = SectionModel | RelatedModel | GroupModel | CustomSectionModel | MapSectionModel | GalleryModel | HistorySectionModel | CommentsSectionModel;
|
|
919
|
+
export type TabItemModel = SectionModel | RelatedModel | GroupModel | CustomSectionModel | MapSectionModel | RecordChartModel | GalleryModel | HistorySectionModel | CommentsSectionModel;
|
|
892
920
|
/**
|
|
893
921
|
* A record's photos as tiles in the main column under `title`, one large and the next few smaller, opening a lightbox
|
|
894
922
|
* that steps through them all: first the record's own file field `image`, then the `image` of the records of
|