@fibery/views 19.0.0 → 19.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/lib/src/errors.d.ts +2 -0
- package/lib/src/errors.js +6 -0
- package/lib/src/field-utils/avatar.d.ts +1 -1
- package/lib/src/field-utils/avatar.js +1 -1
- package/lib/src/field-utils/back-references.d.ts +1 -1
- package/lib/src/field-utils/comments.d.ts +1 -1
- package/lib/src/field-utils/date-time.d.ts +5 -5
- package/lib/src/field-utils/date-time.js +1 -1
- package/lib/src/field-utils/enum-value.d.ts +1 -1
- package/lib/src/field-utils/file.d.ts +1 -1
- package/lib/src/field-utils/file.js +1 -1
- package/lib/src/field-utils/icon.d.ts +1 -1
- package/lib/src/field-utils/number.d.ts +1 -1
- package/lib/src/field-utils/reference-collection.d.ts +2 -2
- package/lib/src/field-utils/reference-collection.js +4 -4
- package/lib/src/field-utils/reference.d.ts +2 -2
- package/lib/src/field-utils/reference.js +4 -4
- package/lib/src/field-utils/relation-view.d.ts +1 -1
- package/lib/src/field-utils/rich-text.d.ts +2 -2
- package/lib/src/field-utils/rich-text.js +1 -1
- package/lib/src/field-utils/text.d.ts +1 -1
- package/lib/src/field-utils/user-active.d.ts +2 -2
- package/lib/src/field-utils/user-role.d.ts +1 -1
- package/lib/src/field-utils/workflow.d.ts +2 -2
- package/lib/src/index.d.ts +30 -16
- package/lib/src/index.js +7 -2
- package/lib/src/meta-validation.d.ts +10 -0
- package/lib/src/meta-validation.js +78 -0
- package/lib/src/private/board.d.ts +15 -11
- package/lib/src/private/board.js +8 -7
- package/lib/src/private/calendar.d.ts +14 -10
- package/lib/src/private/calendar.js +4 -3
- package/lib/src/private/feed.d.ts +14 -10
- package/lib/src/private/feed.js +4 -3
- package/lib/src/private/form.d.ts +25 -3
- package/lib/src/private/form.js +3 -3
- package/lib/src/private/map.d.ts +14 -10
- package/lib/src/private/map.js +4 -3
- package/lib/src/private/smart-folder.d.ts +23 -15
- package/lib/src/private/smart-folder.js +16 -13
- package/lib/src/private/timeline.d.ts +39 -10
- package/lib/src/private/timeline.js +8 -6
- package/lib/src/private/units.d.ts +10 -6
- package/lib/src/private/units.js +32 -24
- package/lib/src/private/utils.d.ts +64 -17
- package/lib/src/private/utils.js +26 -20
- package/lib/src/truthy.d.ts +1 -0
- package/lib/src/truthy.js +7 -0
- package/lib/src/unit-definitions/avatar-collection.d.ts +1 -1
- package/lib/src/unit-definitions/avatar-collection.js +5 -10
- package/lib/src/unit-definitions/avatar-input.d.ts +1 -1
- package/lib/src/unit-definitions/avatar-input.js +1 -1
- package/lib/src/unit-definitions/avatar.d.ts +1 -1
- package/lib/src/unit-definitions/avatar.js +5 -7
- package/lib/src/unit-definitions/back-references-list.d.ts +1 -1
- package/lib/src/unit-definitions/back-references-list.js +3 -3
- package/lib/src/unit-definitions/bool-checkbox.d.ts +1 -1
- package/lib/src/unit-definitions/bool-checkbox.js +2 -2
- package/lib/src/unit-definitions/bool.d.ts +1 -1
- package/lib/src/unit-definitions/bool.js +1 -1
- package/lib/src/unit-definitions/collection-count.d.ts +1 -1
- package/lib/src/unit-definitions/collection-count.js +4 -2
- package/lib/src/unit-definitions/color-input.d.ts +1 -1
- package/lib/src/unit-definitions/color-input.js +1 -1
- package/lib/src/unit-definitions/comments-list.d.ts +1 -1
- package/lib/src/unit-definitions/comments-list.js +1 -1
- package/lib/src/unit-definitions/date-range-combobox.d.ts +1 -1
- package/lib/src/unit-definitions/date-range-combobox.js +1 -1
- package/lib/src/unit-definitions/date-range.d.ts +1 -1
- package/lib/src/unit-definitions/date-range.js +1 -1
- package/lib/src/unit-definitions/date-time-combobox.d.ts +1 -1
- package/lib/src/unit-definitions/date-time-combobox.js +2 -2
- package/lib/src/unit-definitions/date.d.ts +1 -1
- package/lib/src/unit-definitions/date.js +2 -2
- package/lib/src/unit-definitions/email-input.d.ts +1 -1
- package/lib/src/unit-definitions/email-input.js +1 -1
- package/lib/src/unit-definitions/email.d.ts +1 -1
- package/lib/src/unit-definitions/email.js +1 -1
- package/lib/src/unit-definitions/emoji.d.ts +1 -1
- package/lib/src/unit-definitions/emoji.js +1 -1
- package/lib/src/unit-definitions/file-collection-count.d.ts +1 -1
- package/lib/src/unit-definitions/file-collection-count.js +11 -9
- package/lib/src/unit-definitions/file-compact-collection.d.ts +1 -1
- package/lib/src/unit-definitions/file-compact-collection.js +11 -9
- package/lib/src/unit-definitions/file-compact-reference.d.ts +1 -1
- package/lib/src/unit-definitions/file-compact-reference.js +3 -12
- package/lib/src/unit-definitions/file-reference.d.ts +1 -1
- package/lib/src/unit-definitions/file-reference.js +8 -6
- package/lib/src/unit-definitions/files-gallery.d.ts +1 -1
- package/lib/src/unit-definitions/files-gallery.js +11 -9
- package/lib/src/unit-definitions/files-l-list-item.d.ts +1 -1
- package/lib/src/unit-definitions/files-l-list-item.js +8 -6
- package/lib/src/unit-definitions/files-l-list.d.ts +1 -1
- package/lib/src/unit-definitions/files-l-list.js +11 -9
- package/lib/src/unit-definitions/files-list-item.d.ts +1 -1
- package/lib/src/unit-definitions/files-list-item.js +8 -6
- package/lib/src/unit-definitions/files-list.d.ts +1 -1
- package/lib/src/unit-definitions/files-list.js +11 -9
- package/lib/src/unit-definitions/geometry-preview.d.ts +1 -1
- package/lib/src/unit-definitions/geometry-preview.js +1 -1
- package/lib/src/unit-definitions/icon-button.d.ts +1 -1
- package/lib/src/unit-definitions/icon-button.js +1 -1
- package/lib/src/unit-definitions/icon-input.d.ts +1 -1
- package/lib/src/unit-definitions/icon-input.js +1 -1
- package/lib/src/unit-definitions/id.d.ts +1 -1
- package/lib/src/unit-definitions/json-input.d.ts +1 -1
- package/lib/src/unit-definitions/json-input.js +1 -1
- package/lib/src/unit-definitions/location-input.d.ts +1 -1
- package/lib/src/unit-definitions/location-input.js +1 -1
- package/lib/src/unit-definitions/location.d.ts +1 -1
- package/lib/src/unit-definitions/location.js +1 -1
- package/lib/src/unit-definitions/not-found.d.ts +1 -1
- package/lib/src/unit-definitions/number-input.d.ts +1 -1
- package/lib/src/unit-definitions/number-input.js +2 -2
- package/lib/src/unit-definitions/number.d.ts +1 -1
- package/lib/src/unit-definitions/number.js +2 -4
- package/lib/src/unit-definitions/phone-input.d.ts +1 -1
- package/lib/src/unit-definitions/phone-input.js +1 -1
- package/lib/src/unit-definitions/phone.d.ts +1 -1
- package/lib/src/unit-definitions/phone.js +1 -1
- package/lib/src/unit-definitions/progress-bar.d.ts +1 -1
- package/lib/src/unit-definitions/progress-bar.js +1 -4
- package/lib/src/unit-definitions/reference-collection-combobox.d.ts +1 -1
- package/lib/src/unit-definitions/reference-collection-combobox.js +1 -1
- package/lib/src/unit-definitions/reference-collection-list.d.ts +1 -1
- package/lib/src/unit-definitions/reference-collection-list.js +1 -1
- package/lib/src/unit-definitions/reference-collection-view.d.ts +1 -1
- package/lib/src/unit-definitions/reference-collection-view.js +1 -1
- package/lib/src/unit-definitions/reference-collection.d.ts +1 -1
- package/lib/src/unit-definitions/reference-collection.js +3 -3
- package/lib/src/unit-definitions/reference-combobox.d.ts +1 -1
- package/lib/src/unit-definitions/reference-combobox.js +1 -1
- package/lib/src/unit-definitions/reference-icon.d.ts +1 -1
- package/lib/src/unit-definitions/reference-icon.js +1 -1
- package/lib/src/unit-definitions/reference.d.ts +1 -1
- package/lib/src/unit-definitions/reference.js +1 -1
- package/lib/src/unit-definitions/rich-text-document.d.ts +1 -1
- package/lib/src/unit-definitions/rich-text-document.js +2 -2
- package/lib/src/unit-definitions/rich-text-snippet.d.ts +2 -1
- package/lib/src/unit-definitions/rich-text-snippet.js +6 -11
- package/lib/src/unit-definitions/single-location-preview.d.ts +1 -1
- package/lib/src/unit-definitions/single-location-preview.js +1 -1
- package/lib/src/unit-definitions/text-input.d.ts +1 -1
- package/lib/src/unit-definitions/text-input.js +2 -2
- package/lib/src/unit-definitions/text.d.ts +1 -1
- package/lib/src/unit-definitions/text.js +2 -2
- package/lib/src/unit-definitions/title-input.d.ts +1 -1
- package/lib/src/unit-definitions/title.d.ts +1 -1
- package/lib/src/unit-definitions/type-badge-abbr.d.ts +1 -1
- package/lib/src/unit-definitions/type-badge.d.ts +1 -1
- package/lib/src/unit-definitions/type-icon.d.ts +1 -1
- package/lib/src/unit-definitions/url-input.d.ts +1 -1
- package/lib/src/unit-definitions/url-input.js +1 -1
- package/lib/src/unit-definitions/url.d.ts +1 -1
- package/lib/src/unit-definitions/url.js +1 -1
- package/lib/src/unit-definitions/user-button.d.ts +1 -1
- package/lib/src/unit-definitions/user-role-input.d.ts +1 -1
- package/lib/src/unit-definitions/user-role-input.js +1 -1
- package/lib/src/unit-definitions/user-role.d.ts +1 -1
- package/lib/src/unit-definitions/user-role.js +1 -1
- package/lib/src/unit-utils/access.d.ts +2 -2
- package/lib/src/unit-utils/can-edit-field.d.ts +2 -2
- package/lib/src/unit-utils/common.d.ts +3 -3
- package/lib/src/unit-utils/common.js +1 -1
- package/lib/src/unit-utils/enums.d.ts +2 -2
- package/lib/src/unit-utils/formatters.d.ts +2 -2
- package/lib/src/unit-utils/get-export-value.d.ts +4 -4
- package/lib/src/unit-utils/get-export-value.js +3 -3
- package/lib/src/unit-utils/get-field-label.d.ts +2 -2
- package/lib/src/unit-utils/get-unmatched-unit-label.d.ts +1 -1
- package/lib/src/unit-utils/schema.d.ts +1 -1
- package/lib/src/unit-utils/wrap-normalized-in-expression.d.ts +3 -0
- package/lib/src/unit-utils/wrap-normalized-in-expression.js +14 -0
- package/lib/src/units/board.d.ts +5 -5
- package/lib/src/units/board.js +1 -1
- package/lib/src/units/canvas/index.d.ts +4 -4
- package/lib/src/units/canvas/index.js +1 -1
- package/lib/src/units/canvas/type-badge-abbr.d.ts +1 -1
- package/lib/src/units/canvas/type-badge.d.ts +1 -1
- package/lib/src/units/default.d.ts +5 -5
- package/lib/src/units/default.js +1 -1
- package/lib/src/units/gallery.d.ts +1 -1
- package/lib/src/units/gantt.d.ts +5 -5
- package/lib/src/units/gantt.js +1 -1
- package/lib/src/units/get-unit-definitions-for-view-type.js +4 -4
- package/lib/src/units/grid.d.ts +4 -4
- package/lib/src/units/grid.js +7 -7
- package/lib/src/units/list.d.ts +5 -5
- package/lib/src/units/list.js +1 -1
- package/lib/src/units/make-factory.d.ts +4 -5
- package/lib/src/units/make-factory.js +26 -15
- package/lib/src/units/types.d.ts +5 -5
- package/package.json +18 -18
- package/lib/jest.config.cjs +0 -34
- package/lib/jest.config.d.cts +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
1
|
+
import type { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
2
|
export declare const AVATAR_MIXIN_NAME = "avatar/avatar-mixin";
|
|
3
3
|
export declare const AVATAR_EXTENSION_FIELD = "avatar/avatars";
|
|
4
4
|
export declare const isAvatarExtensionEnabledType: (typeObject: TypeObject) => boolean;
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getAvatarSelectQuery = exports.getAvatarSelect = exports.isAvatarExtensionField = exports.isAvatarExtensionEnabledType = exports.AVATAR_EXTENSION_FIELD = exports.AVATAR_MIXIN_NAME = void 0;
|
|
7
|
-
const compact_1 = __importDefault(require("lodash/compact"));
|
|
8
7
|
const select_1 = require("@fibery/query-utils/src/select");
|
|
8
|
+
const compact_1 = __importDefault(require("lodash/compact"));
|
|
9
9
|
exports.AVATAR_MIXIN_NAME = "avatar/avatar-mixin";
|
|
10
10
|
exports.AVATAR_EXTENSION_FIELD = "avatar/avatars";
|
|
11
11
|
const isAvatarExtensionEnabledType = (typeObject) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
1
|
+
import type { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
2
|
export declare const isReferenceExtensionField: (fieldObject: FieldObject) => boolean;
|
|
3
3
|
export declare const getEntityLinksListSelect: (typeObject: TypeObject) => {
|
|
4
4
|
"fibery/id": "fibery/id";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
1
|
+
import type { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
2
|
import { accessCheckKey } from "../unit-utils/access";
|
|
3
3
|
export declare const isCommentExtensionField: (fieldObject: FieldObject) => boolean;
|
|
4
4
|
export declare const getCommentsListSelect: (typeObject: TypeObject) => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const parseDate: (isoDate: MomentInput) =>
|
|
1
|
+
import type { Moment, MomentInput, unitOfTime } from "moment/moment";
|
|
2
|
+
export declare const parseDate: (isoDate: MomentInput) => Moment;
|
|
3
3
|
export declare const serializeDate: (momentDate: Moment) => string;
|
|
4
|
-
export declare const parseDateTime: (isoDateTime: MomentInput) =>
|
|
4
|
+
export declare const parseDateTime: (isoDateTime: MomentInput) => Moment;
|
|
5
5
|
export declare const serializeDateTime: (momentDate: Moment) => string;
|
|
6
6
|
export declare const parseStart: ({ value, type }: {
|
|
7
7
|
value: MomentInput;
|
|
8
8
|
type: string;
|
|
9
|
-
}) =>
|
|
9
|
+
}) => Moment;
|
|
10
10
|
export declare const parseEnd: ({ value, type, minimumDelta, }: {
|
|
11
11
|
value: MomentInput;
|
|
12
12
|
type: string;
|
|
13
13
|
minimumDelta?: [number, unitOfTime.DurationConstructor] | null;
|
|
14
|
-
}) =>
|
|
14
|
+
}) => Moment;
|
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.parseEnd = exports.parseStart = exports.serializeDateTime = exports.parseDateTime = exports.serializeDate = exports.parseDate = void 0;
|
|
7
|
-
const moment_1 = __importDefault(require("moment/moment"));
|
|
8
7
|
const errors_1 = require("@fibery/expression-utils/src/errors");
|
|
9
8
|
const utils_1 = require("@fibery/expression-utils/src/utils");
|
|
9
|
+
const moment_1 = __importDefault(require("moment/moment"));
|
|
10
10
|
const defaultDateDelta = [1, "day"];
|
|
11
11
|
const defaultDateTimeDelta = [1, "second"];
|
|
12
12
|
const parseDate = (isoDate) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
1
|
+
import type { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
2
|
import { NumberFormat } from "./number";
|
|
3
3
|
export declare const enumNumberFieldName = "Value";
|
|
4
4
|
export declare const getEnumNumberFieldName: (namespace: string) => string;
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getFilesSelect = void 0;
|
|
7
|
-
const compact_1 = __importDefault(require("lodash/compact"));
|
|
8
7
|
const select_1 = require("@fibery/query-utils/src/select");
|
|
8
|
+
const compact_1 = __importDefault(require("lodash/compact"));
|
|
9
9
|
const getFilesSelect = ({ typeObject }) => (0, select_1.toSelectMapClause)((0, compact_1.default)([
|
|
10
10
|
typeObject.idField,
|
|
11
11
|
typeObject.titleField,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldObject, TypeObject } from "@fibery/schema";
|
|
1
|
+
import type { FieldObject, TypeObject } from "@fibery/schema";
|
|
2
2
|
export declare const ICON_MIXIN_NAME = "icon/icon-mixin";
|
|
3
3
|
export declare const ICON_EXTENSION_FIELD = "icon/icon";
|
|
4
4
|
export declare const isIconExtensionEnabledType: (typeObject: TypeObject) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { QueryLimit } from "@fibery/expression-utils/src/types";
|
|
2
|
+
import type { FieldObject } from "@fibery/schema";
|
|
3
3
|
export declare const REFERENCE_COLLECTION_LIMIT = 1000;
|
|
4
4
|
export declare const makeCollectionCountExpression: (field: string | string[]) => (string | string[])[];
|
|
5
5
|
export declare const getCountKey: (field: string) => string;
|
|
@@ -4,15 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.calculateReferenceCollectionQuery = exports.getCollectionCountSelect = exports.getCountKey = exports.makeCollectionCountExpression = exports.REFERENCE_COLLECTION_LIMIT = void 0;
|
|
7
|
-
const last_1 = __importDefault(require("lodash/last"));
|
|
8
|
-
const compact_1 = __importDefault(require("lodash/compact"));
|
|
9
7
|
const select_1 = require("@fibery/query-utils/src/select");
|
|
10
|
-
const
|
|
8
|
+
const compact_1 = __importDefault(require("lodash/compact"));
|
|
9
|
+
const last_1 = __importDefault(require("lodash/last"));
|
|
11
10
|
const access_1 = require("../unit-utils/access");
|
|
11
|
+
const dynamic_keys_1 = require("../unit-utils/dynamic-keys");
|
|
12
12
|
const enums_1 = require("../unit-utils/enums");
|
|
13
13
|
const avatar_1 = require("./avatar");
|
|
14
|
-
const icon_1 = require("./icon");
|
|
15
14
|
const file_1 = require("./file");
|
|
15
|
+
const icon_1 = require("./icon");
|
|
16
16
|
exports.REFERENCE_COLLECTION_LIMIT = 1000;
|
|
17
17
|
const makeCollectionCountExpression = (field) => [
|
|
18
18
|
"q/count",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FieldExpression } from "@fibery/expression-utils";
|
|
1
|
+
import type { FieldExpression } from "@fibery/expression-utils";
|
|
3
2
|
import type { Select } from "@fibery/expression-utils/src/types";
|
|
3
|
+
import type { FieldObject, TypeObject } from "@fibery/schema";
|
|
4
4
|
export declare const getReferenceTypeSelectClause: ({ typeObject }: {
|
|
5
5
|
typeObject: TypeObject;
|
|
6
6
|
}, contextPath: FieldExpression) => Select;
|
|
@@ -4,15 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getReferenceFieldNormalizedSelectClause = exports.getReferenceTypeSelectClause = void 0;
|
|
7
|
-
const compact_1 = __importDefault(require("lodash/compact"));
|
|
8
7
|
const select_1 = require("@fibery/query-utils/src/select");
|
|
8
|
+
const compact_1 = __importDefault(require("lodash/compact"));
|
|
9
9
|
const access_1 = require("../unit-utils/access");
|
|
10
10
|
const enums_1 = require("../unit-utils/enums");
|
|
11
|
-
const workflow_1 = require("./workflow");
|
|
12
11
|
const avatar_1 = require("./avatar");
|
|
13
|
-
const user_active_1 = require("./user-active");
|
|
14
|
-
const icon_1 = require("./icon");
|
|
15
12
|
const file_1 = require("./file");
|
|
13
|
+
const icon_1 = require("./icon");
|
|
14
|
+
const user_active_1 = require("./user-active");
|
|
15
|
+
const workflow_1 = require("./workflow");
|
|
16
16
|
const getReferenceTypeSelectClause = ({ typeObject }, contextPath) => {
|
|
17
17
|
return {
|
|
18
18
|
...(0, select_1.toSelectMapClause)((0, compact_1.default)([
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FieldObject } from "@fibery/schema";
|
|
1
|
+
import type { FieldObject } from "@fibery/schema";
|
|
2
2
|
export declare const isRelationViewField: (fieldObject: FieldObject) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TypeObject } from "@fibery/schema";
|
|
2
1
|
import type { FieldExpression } from "@fibery/expression-utils/src/types";
|
|
3
|
-
import {
|
|
2
|
+
import type { TypeObject } from "@fibery/schema";
|
|
3
|
+
import type { FieldUnit } from "../units/types";
|
|
4
4
|
export declare const hasAccessToSecretKey: string;
|
|
5
5
|
export declare const getHasAccessToSecretExpr: (expression: FieldExpression) => (string | (string | import("@fibery/expression-utils/src/types").MultiFieldAccess)[])[];
|
|
6
6
|
export declare const getHasAccessToSecret: (expression: FieldExpression) => {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getHasAccessToSecret = exports.getHasAccessToSecretExpr = exports.hasAccessToSecretKey = void 0;
|
|
4
4
|
exports.getRichTextQuerySelect = getRichTextQuerySelect;
|
|
5
|
-
const select_1 = require("@fibery/query-utils/src/select");
|
|
6
5
|
const utils_1 = require("@fibery/expression-utils/src/utils");
|
|
6
|
+
const select_1 = require("@fibery/query-utils/src/select");
|
|
7
7
|
const dynamic_keys_1 = require("../unit-utils/dynamic-keys");
|
|
8
8
|
exports.hasAccessToSecretKey = (0, dynamic_keys_1.makeDynamicKey)(dynamic_keys_1.hasAccessToSecretKeyPrefix);
|
|
9
9
|
const getHasAccessToSecretExpr = (expression) => [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { FieldExpression } from "@fibery/expression-utils";
|
|
2
|
+
import type { TypeObject } from "@fibery/schema";
|
|
3
3
|
export declare const getIsUserActiveSelect: ({ typeObject, contextPath, }: {
|
|
4
4
|
typeObject: TypeObject;
|
|
5
5
|
contextPath?: FieldExpression;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { FieldExpression } from "@fibery/expression-utils";
|
|
2
|
+
import type { TypeObject } from "@fibery/schema";
|
|
3
3
|
export declare function isWorkflowType(typeObject: TypeObject): boolean;
|
|
4
4
|
export declare const getWorkflowFieldObject: (typeObject: TypeObject) => import("@fibery/schema").FieldObject | undefined;
|
|
5
5
|
export declare const getIsFinalStateSelect: ({ typeObject, contextPath, }: {
|
package/lib/src/index.d.ts
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import type { Expression } from "@fibery/expression-utils/src/types";
|
|
2
|
+
import type { FieldObject, Schema } from "@fibery/schema";
|
|
3
|
+
import type { UnitDefinitions, ViewRecord } from "./private/utils";
|
|
4
|
+
import type { Unit } from "./units/types";
|
|
5
|
+
export { deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder, replaceIdsWithNamesInSmartFolder, replaceNamesWithIdsInSmartFolder, } from "./private/smart-folder";
|
|
6
|
+
export { InvalidMetaError } from "./errors";
|
|
7
|
+
export { assertMetaValid, isMetaValid } from "./meta-validation";
|
|
8
|
+
export declare const deleteExpressionWithNotFoundFieldsOrTypesInView: (schema: Schema, view: ViewRecord, ensureAxisInvariant?: boolean) => any;
|
|
9
|
+
export declare const fixUserSelectedUnits: (schema: Schema, view: ViewRecord, { unitDefinitions, getDefaultUnitTypeForField, }: {
|
|
10
|
+
unitDefinitions: UnitDefinitions;
|
|
11
|
+
getDefaultUnitTypeForField: (fieldObject: FieldObject, allowedUnits: Unit[]) => string | undefined;
|
|
12
|
+
}) => any;
|
|
13
|
+
export declare const fixContextExpressionWithBrokenPath: (schema: Schema, view: ViewRecord, defaultContextExpression: Expression) => any;
|
|
14
|
+
/**
|
|
15
|
+
* Removes garbage from view's meta to reduce the size.
|
|
16
|
+
*/
|
|
17
|
+
export declare const collectGarbage: (schema: Schema, view: ViewRecord) => unknown;
|
|
18
|
+
export declare const replaceNamesWithIdsInView: (schema: Schema, view: ViewRecord) => any;
|
|
19
|
+
export declare const replaceIdsWithNamesInView: (schema: Schema, view: ViewRecord) => any;
|
|
20
|
+
type ViewMeta = {
|
|
21
|
+
items: {
|
|
22
|
+
query: {
|
|
23
|
+
"q/from": string;
|
|
24
|
+
};
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
export declare const getViewCardTypes: ({ "fibery/meta": { items } }: {
|
|
28
|
+
"fibery/meta": ViewMeta;
|
|
29
|
+
}) => string[];
|
|
30
|
+
export declare const migrateHideWhenEmptyToUnitsLevel: (view: ViewRecord) => any;
|
package/lib/src/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.migrateHideWhenEmptyToUnitsLevel = exports.getViewCardTypes = exports.replaceIdsWithNamesInView = exports.replaceNamesWithIdsInView = exports.collectGarbage = exports.fixContextExpressionWithBrokenPath = exports.fixUserSelectedUnits = exports.deleteExpressionWithNotFoundFieldsOrTypesInView = exports.replaceNamesWithIdsInSmartFolder = exports.replaceIdsWithNamesInSmartFolder = exports.deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder = void 0;
|
|
39
|
+
exports.migrateHideWhenEmptyToUnitsLevel = exports.getViewCardTypes = exports.replaceIdsWithNamesInView = exports.replaceNamesWithIdsInView = exports.collectGarbage = exports.fixContextExpressionWithBrokenPath = exports.fixUserSelectedUnits = exports.deleteExpressionWithNotFoundFieldsOrTypesInView = exports.isMetaValid = exports.assertMetaValid = exports.InvalidMetaError = exports.replaceNamesWithIdsInSmartFolder = exports.replaceIdsWithNamesInSmartFolder = exports.deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder = void 0;
|
|
40
40
|
const immutability_helper_1 = __importDefault(require("immutability-helper"));
|
|
41
41
|
const get_1 = __importDefault(require("lodash/get"));
|
|
42
42
|
const omit_1 = __importDefault(require("lodash/omit"));
|
|
@@ -52,6 +52,11 @@ var smart_folder_1 = require("./private/smart-folder");
|
|
|
52
52
|
Object.defineProperty(exports, "deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder", { enumerable: true, get: function () { return smart_folder_1.deleteExpressionWithNotFoundFieldsOrTypesInSmartFolder; } });
|
|
53
53
|
Object.defineProperty(exports, "replaceIdsWithNamesInSmartFolder", { enumerable: true, get: function () { return smart_folder_1.replaceIdsWithNamesInSmartFolder; } });
|
|
54
54
|
Object.defineProperty(exports, "replaceNamesWithIdsInSmartFolder", { enumerable: true, get: function () { return smart_folder_1.replaceNamesWithIdsInSmartFolder; } });
|
|
55
|
+
var errors_1 = require("./errors");
|
|
56
|
+
Object.defineProperty(exports, "InvalidMetaError", { enumerable: true, get: function () { return errors_1.InvalidMetaError; } });
|
|
57
|
+
var meta_validation_1 = require("./meta-validation");
|
|
58
|
+
Object.defineProperty(exports, "assertMetaValid", { enumerable: true, get: function () { return meta_validation_1.assertMetaValid; } });
|
|
59
|
+
Object.defineProperty(exports, "isMetaValid", { enumerable: true, get: function () { return meta_validation_1.isMetaValid; } });
|
|
55
60
|
const deleteExpressionWithNotFoundFieldsOrTypesInView = (schema, view, ensureAxisInvariant = true) => {
|
|
56
61
|
switch (view["fibery/type"]) {
|
|
57
62
|
case "board":
|
|
@@ -80,7 +85,7 @@ const deleteExpressionWithNotFoundFieldsOrTypesInView = (schema, view, ensureAxi
|
|
|
80
85
|
}
|
|
81
86
|
};
|
|
82
87
|
exports.deleteExpressionWithNotFoundFieldsOrTypesInView = deleteExpressionWithNotFoundFieldsOrTypesInView;
|
|
83
|
-
const fixUserSelectedUnits = (schema, view, { unitDefinitions, getDefaultUnitTypeForField }) => {
|
|
88
|
+
const fixUserSelectedUnits = (schema, view, { unitDefinitions, getDefaultUnitTypeForField, }) => {
|
|
84
89
|
switch (view["fibery/type"]) {
|
|
85
90
|
case "board":
|
|
86
91
|
case "gallery":
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates meta payload for the view of given type.
|
|
3
|
+
* Throws `InvalidMeta` if meta is not valid.
|
|
4
|
+
* Re-throws errors that are not InvalidMeta.
|
|
5
|
+
*/
|
|
6
|
+
export declare const assertMetaValid: (type: string, meta: unknown) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Returns true if meta is valid for given view type.
|
|
9
|
+
*/
|
|
10
|
+
export declare const isMetaValid: (type: string, meta: unknown) => boolean;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isMetaValid = exports.assertMetaValid = void 0;
|
|
7
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
8
|
+
const errors_1 = require("./errors");
|
|
9
|
+
/**
|
|
10
|
+
* Validates meta payload for the view of given type.
|
|
11
|
+
* Throws `InvalidMeta` if meta is not valid.
|
|
12
|
+
* Re-throws errors that are not InvalidMeta.
|
|
13
|
+
*/
|
|
14
|
+
const assertMetaValid = (type, meta) => {
|
|
15
|
+
(validators.get(type) ?? genericValidator)(meta);
|
|
16
|
+
};
|
|
17
|
+
exports.assertMetaValid = assertMetaValid;
|
|
18
|
+
/**
|
|
19
|
+
* Returns true if meta is valid for given view type.
|
|
20
|
+
*/
|
|
21
|
+
const isMetaValid = (type, meta) => {
|
|
22
|
+
try {
|
|
23
|
+
(0, exports.assertMetaValid)(type, meta);
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
if (err instanceof errors_1.InvalidMetaError) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
throw err;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.isMetaValid = isMetaValid;
|
|
34
|
+
const isEmptyObject = (m) => typeof m === "object" && m !== null && Object.keys(m).length === 0;
|
|
35
|
+
const genericValidator = (m) => {
|
|
36
|
+
if (m === null) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const items = (0, get_1.default)(m, "items");
|
|
40
|
+
if (!Array.isArray(items)) {
|
|
41
|
+
throw new errors_1.InvalidMetaError("expected fibery/meta.items to be an array");
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const validators = new Map([
|
|
45
|
+
[
|
|
46
|
+
"document",
|
|
47
|
+
(m) => {
|
|
48
|
+
if (m === null || m === undefined || isEmptyObject(m)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const s = (0, get_1.default)(m, "documentSecret");
|
|
52
|
+
if (typeof s !== "string") {
|
|
53
|
+
throw new errors_1.InvalidMetaError("expected fibery/meta.documentSecret to be a string");
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
["vizydrop/chart", () => { }],
|
|
58
|
+
["form", () => { }],
|
|
59
|
+
["canvas", () => { }],
|
|
60
|
+
["tlcanvas", () => { }],
|
|
61
|
+
["spreadsheet", () => { }],
|
|
62
|
+
[
|
|
63
|
+
"thread",
|
|
64
|
+
(m) => {
|
|
65
|
+
if (isEmptyObject(m)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const id = (0, get_1.default)(m, "id");
|
|
69
|
+
const typeId = (0, get_1.default)(m, "typeId");
|
|
70
|
+
if (typeof id !== "string" || typeof typeId !== "string") {
|
|
71
|
+
throw new errors_1.InvalidMetaError("expected fibery/meta.id and fibery/meta.typeId to be strings");
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
["dashboard", () => { }],
|
|
76
|
+
["embed", () => { }],
|
|
77
|
+
["page", () => { }],
|
|
78
|
+
]);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import type { Expression } from "@fibery/expression-utils/src/types";
|
|
2
|
+
import type { FieldObject, Schema } from "@fibery/schema";
|
|
3
|
+
import type { Unit } from "@fibery/views/src/units/types";
|
|
4
|
+
import type { UnitDefinitions, ViewRecord } from "./utils";
|
|
5
|
+
export declare const replaceIdsWithNamesInBoardView: (schema: Schema, view: ViewRecord) => any;
|
|
6
|
+
export declare const replaceNamesWithIdsInBoardView: (schema: Schema, view: ViewRecord) => any;
|
|
7
|
+
export declare const deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView: (schema: Schema, view: ViewRecord, ensureAxisInvariant?: boolean) => any;
|
|
8
|
+
export declare const fixUserSelectedUnitsInBoardView: (schema: Schema, view: ViewRecord, { unitDefinitions, getDefaultUnitTypeForField, }: {
|
|
9
|
+
unitDefinitions: UnitDefinitions;
|
|
10
|
+
getDefaultUnitTypeForField: (fieldObject: FieldObject, allowedUnits: Unit[]) => string | undefined;
|
|
11
|
+
}) => any;
|
|
12
|
+
export declare const fixContextExpressionWithBrokenPath: (schema: Schema, view: ViewRecord, defaultContextExpression: Expression) => any;
|
|
13
|
+
export declare const collectGarbage: (view: ViewRecord) => any;
|
|
14
|
+
export declare const enableHideWhenEmptyForCovers: (view: ViewRecord) => any;
|
|
15
|
+
export declare const enableHideWhenEmptyForCheckedEditableUnits: (view: ViewRecord) => any;
|
package/lib/src/private/board.js
CHANGED
|
@@ -11,6 +11,7 @@ const get_1 = __importDefault(require("lodash/get"));
|
|
|
11
11
|
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
12
12
|
const set_1 = __importDefault(require("lodash/set"));
|
|
13
13
|
const some_1 = __importDefault(require("lodash/some"));
|
|
14
|
+
const truthy_1 = require("../truthy");
|
|
14
15
|
const units_1 = require("./units");
|
|
15
16
|
const utils_2 = require("./utils");
|
|
16
17
|
const visitQueryExpressionHolder = (queryHolder, visitor) => {
|
|
@@ -49,11 +50,11 @@ const visitAxisUnits = (axis, fromType, visitor) => {
|
|
|
49
50
|
units: {
|
|
50
51
|
$apply: (units) => units
|
|
51
52
|
? units
|
|
52
|
-
.filter(
|
|
53
|
+
.filter(truthy_1.truthy)
|
|
53
54
|
.map((unit) => (0, utils_2.visitViewUnit)(fromType, unit, visitor))
|
|
54
|
-
.filter(
|
|
55
|
+
.filter(utils_2.isUnitExpressionValid)
|
|
55
56
|
.map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
|
|
56
|
-
.filter(
|
|
57
|
+
.filter(utils_2.skipRemove)
|
|
57
58
|
: undefined,
|
|
58
59
|
},
|
|
59
60
|
})
|
|
@@ -161,9 +162,9 @@ const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
|
|
|
161
162
|
units: {
|
|
162
163
|
$apply: (units) => units
|
|
163
164
|
? units
|
|
164
|
-
.filter(
|
|
165
|
+
.filter(truthy_1.truthy)
|
|
165
166
|
.map((unit) => (0, utils_2.visitViewUnit)(fromType, unit, visitor))
|
|
166
|
-
.filter(
|
|
167
|
+
.filter(utils_2.isUnitExpressionValid)
|
|
167
168
|
.map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
|
|
168
169
|
.filter((unit) => unit !== utils_2.REMOVE)
|
|
169
170
|
: undefined,
|
|
@@ -255,7 +256,7 @@ const deleteExpressionWithNotFoundFieldsOrTypesViewVisitor = (schema) => {
|
|
|
255
256
|
};
|
|
256
257
|
return visitor;
|
|
257
258
|
};
|
|
258
|
-
const fixUserSelectedUnitsViewVisitor = (schema, { unitDefinitions, getDefaultUnitTypeForField }) => {
|
|
259
|
+
const fixUserSelectedUnitsViewVisitor = (schema, { unitDefinitions, getDefaultUnitTypeForField, }) => {
|
|
259
260
|
return {
|
|
260
261
|
visitQueryExpression: (queryExpression) => queryExpression,
|
|
261
262
|
visitFilter: (_fromType, filter) => filter,
|
|
@@ -273,7 +274,7 @@ const deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView = (schema, v
|
|
|
273
274
|
return ensureAxisInvariant ? ensureAxisAndItemExpressionInvariant(viewNew) : viewNew;
|
|
274
275
|
};
|
|
275
276
|
exports.deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView = deleteExpressionWithNotFoundOrInvalidFieldsOrTypesInBoardView;
|
|
276
|
-
const fixUserSelectedUnitsInBoardView = (schema, view, { unitDefinitions, getDefaultUnitTypeForField }) => {
|
|
277
|
+
const fixUserSelectedUnitsInBoardView = (schema, view, { unitDefinitions, getDefaultUnitTypeForField, }) => {
|
|
277
278
|
return visitView(view, fixUserSelectedUnitsViewVisitor(schema, { unitDefinitions, getDefaultUnitTypeForField }));
|
|
278
279
|
};
|
|
279
280
|
exports.fixUserSelectedUnitsInBoardView = fixUserSelectedUnitsInBoardView;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import type { Expression } from "@fibery/expression-utils/src/types";
|
|
2
|
+
import type { FieldObject, Schema } from "@fibery/schema";
|
|
3
|
+
import type { Unit } from "@fibery/views/src/units/types";
|
|
4
|
+
import type { UnitDefinitions, ViewRecord } from "./utils";
|
|
5
|
+
export declare const replaceNamesWithIdsInCalendarView: (schema: Schema, view: ViewRecord) => any;
|
|
6
|
+
export declare const replaceIdsWithNamesInCalendarView: (schema: Schema, view: ViewRecord) => any;
|
|
7
|
+
export declare const deleteExpressionWithNotFoundFieldsOrTypesInCalendarView: (schema: Schema, view: ViewRecord) => any;
|
|
8
|
+
export declare const fixUserSelectedUnitsInCalendarView: (schema: Schema, view: ViewRecord, { unitDefinitions, getDefaultUnitTypeForField, }: {
|
|
9
|
+
unitDefinitions: UnitDefinitions;
|
|
10
|
+
getDefaultUnitTypeForField: (fieldObject: FieldObject, allowedUnits: Unit[]) => string | undefined;
|
|
11
|
+
}) => any;
|
|
12
|
+
export declare const fixContextExpressionWithBrokenPath: (schema: Schema, view: ViewRecord, defaultContextExpression: Expression) => any;
|
|
13
|
+
export declare const collectGarbage: (view: ViewRecord) => any;
|
|
14
|
+
export declare const enableHideWhenEmptyForCheckedUnits: (view: ViewRecord) => any;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.enableHideWhenEmptyForCheckedUnits = exports.collectGarbage = exports.fixContextExpressionWithBrokenPath = exports.fixUserSelectedUnitsInCalendarView = exports.deleteExpressionWithNotFoundFieldsOrTypesInCalendarView = exports.replaceIdsWithNamesInCalendarView = exports.replaceNamesWithIdsInCalendarView = void 0;
|
|
7
7
|
const immutability_helper_1 = __importDefault(require("immutability-helper"));
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
|
+
const truthy_1 = require("../truthy");
|
|
9
10
|
const units_1 = require("./units");
|
|
10
11
|
const utils_1 = require("./utils");
|
|
11
12
|
const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
|
|
@@ -34,9 +35,9 @@ const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
|
|
|
34
35
|
units: {
|
|
35
36
|
$apply: (units) => units
|
|
36
37
|
? units
|
|
37
|
-
.filter(
|
|
38
|
+
.filter(truthy_1.truthy)
|
|
38
39
|
.map((unit) => (0, utils_1.visitViewUnit)(fromType, unit, visitor))
|
|
39
|
-
.filter(
|
|
40
|
+
.filter(utils_1.isUnitExpressionValid)
|
|
40
41
|
.map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
|
|
41
42
|
.filter((unit) => unit !== utils_1.REMOVE)
|
|
42
43
|
: undefined,
|
|
@@ -84,7 +85,7 @@ const deleteExpressionWithNotFoundFieldsOrTypesInCalendarView = (schema, view) =
|
|
|
84
85
|
visitExpression: (fromType, expression) => (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInExpression)(schema, fromType, expression),
|
|
85
86
|
});
|
|
86
87
|
exports.deleteExpressionWithNotFoundFieldsOrTypesInCalendarView = deleteExpressionWithNotFoundFieldsOrTypesInCalendarView;
|
|
87
|
-
const fixUserSelectedUnitsInCalendarView = (schema, view, { unitDefinitions, getDefaultUnitTypeForField }) => {
|
|
88
|
+
const fixUserSelectedUnitsInCalendarView = (schema, view, { unitDefinitions, getDefaultUnitTypeForField, }) => {
|
|
88
89
|
return visitView(view, {
|
|
89
90
|
visitExpression: (_fromType, expression) => expression,
|
|
90
91
|
visitFilter: (_fromType, filter) => filter,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import type { Expression } from "@fibery/expression-utils/src/types";
|
|
2
|
+
import type { FieldObject, Schema } from "@fibery/schema";
|
|
3
|
+
import type { Unit } from "@fibery/views/src/units/types";
|
|
4
|
+
import type { UnitDefinitions, ViewRecord } from "./utils";
|
|
5
|
+
export declare const replaceNamesWithIdsInFeedView: (schema: Schema, view: ViewRecord) => any;
|
|
6
|
+
export declare const replaceIdsWithNamesInFeedView: (schema: Schema, view: ViewRecord) => any;
|
|
7
|
+
export declare const deleteExpressionWithNotFoundFieldsOrTypesInFeedView: (schema: Schema, view: ViewRecord) => any;
|
|
8
|
+
export declare const fixUserSelectedUnitsInFeedView: (schema: Schema, view: ViewRecord, { unitDefinitions, getDefaultUnitTypeForField, }: {
|
|
9
|
+
unitDefinitions: UnitDefinitions;
|
|
10
|
+
getDefaultUnitTypeForField: (fieldObject: FieldObject, allowedUnits: Unit[]) => string | undefined;
|
|
11
|
+
}) => any;
|
|
12
|
+
export declare const fixContextExpressionWithBrokenPath: (schema: Schema, view: ViewRecord, defaultContextExpression: Expression) => any;
|
|
13
|
+
export declare const collectGarbage: (view: ViewRecord) => any;
|
|
14
|
+
export declare const enableHideWhenEmptyForCheckedUnits: (view: ViewRecord) => any;
|
package/lib/src/private/feed.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.enableHideWhenEmptyForCheckedUnits = exports.collectGarbage = exports.fixContextExpressionWithBrokenPath = exports.fixUserSelectedUnitsInFeedView = exports.deleteExpressionWithNotFoundFieldsOrTypesInFeedView = exports.replaceIdsWithNamesInFeedView = exports.replaceNamesWithIdsInFeedView = void 0;
|
|
7
7
|
const immutability_helper_1 = __importDefault(require("immutability-helper"));
|
|
8
8
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
|
+
const truthy_1 = require("../truthy");
|
|
9
10
|
const units_1 = require("./units");
|
|
10
11
|
const utils_1 = require("./utils");
|
|
11
12
|
const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
|
|
@@ -31,9 +32,9 @@ const visitView = (view, visitor) => (0, immutability_helper_1.default)(view, {
|
|
|
31
32
|
units: {
|
|
32
33
|
$apply: (units) => units
|
|
33
34
|
? units
|
|
34
|
-
.filter(
|
|
35
|
+
.filter(truthy_1.truthy)
|
|
35
36
|
.map((unit) => (0, utils_1.visitViewUnit)(fromType, unit, visitor))
|
|
36
|
-
.filter(
|
|
37
|
+
.filter(utils_1.isUnitExpressionValid)
|
|
37
38
|
.map((unit, idx, units) => visitor.visitViewUnit ? visitor.visitViewUnit(fromType, unit, units) : unit)
|
|
38
39
|
.filter((unit) => unit !== utils_1.REMOVE)
|
|
39
40
|
: undefined,
|
|
@@ -81,7 +82,7 @@ const deleteExpressionWithNotFoundFieldsOrTypesInFeedView = (schema, view) => vi
|
|
|
81
82
|
visitExpression: (fromType, expression) => (0, utils_1.deleteExpressionWithNotFoundFieldsOrTypesInExpression)(schema, fromType, expression),
|
|
82
83
|
});
|
|
83
84
|
exports.deleteExpressionWithNotFoundFieldsOrTypesInFeedView = deleteExpressionWithNotFoundFieldsOrTypesInFeedView;
|
|
84
|
-
const fixUserSelectedUnitsInFeedView = (schema, view, { unitDefinitions, getDefaultUnitTypeForField }) => {
|
|
85
|
+
const fixUserSelectedUnitsInFeedView = (schema, view, { unitDefinitions, getDefaultUnitTypeForField, }) => {
|
|
85
86
|
return visitView(view, {
|
|
86
87
|
visitExpression: (_fromType, expression) => expression,
|
|
87
88
|
visitFilter: (_fromType, filter) => filter,
|