@fibery/schema 8.4.0 → 10.0.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.
@@ -0,0 +1,2 @@
1
+ export declare class NotDefinedGetError extends Error {
2
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotDefinedGetError = void 0;
4
+ class NotDefinedGetError extends Error {
5
+ }
6
+ exports.NotDefinedGetError = NotDefinedGetError;
@@ -0,0 +1,22 @@
1
+ import { FieldObject, FieldObjectParams } from "./field-object";
2
+ import { Schema } from "./schema";
3
+ import { TypeObject, TypeObjectParams } from "./type-object";
4
+ export type Factory = {
5
+ makeSchema: (rawSchema: Record<string, unknown>, options?: {
6
+ shouldRemoveDeletedTypesAndFields: boolean;
7
+ }) => Schema;
8
+ makeTypeObject: (params: Omit<TypeObjectParams, "factory">) => TypeObject;
9
+ makeTypeObjectsById: (typeObjects: TypeObject[]) => Record<string, TypeObject>;
10
+ makeTypeObjectsByName: (typeObjects: TypeObject[]) => Record<string, TypeObject>;
11
+ makeFieldObject: (params: FieldObjectParams) => FieldObject;
12
+ makeFieldObjectsById: (params: {
13
+ type: string;
14
+ fieldObjects: FieldObject[];
15
+ }) => Record<string, FieldObject>;
16
+ makeFieldObjectsByName: (params: {
17
+ type: string;
18
+ fieldObjects: FieldObject[];
19
+ }) => Record<string, FieldObject>;
20
+ };
21
+ export declare const factory: Factory;
22
+ export declare const protectiveFactory: Factory;
@@ -0,0 +1,45 @@
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.protectiveFactory = exports.factory = void 0;
7
+ const lodash_1 = __importDefault(require("lodash"));
8
+ const field_object_1 = require("./field-object");
9
+ const schema_1 = require("./schema");
10
+ const type_object_1 = require("./type-object");
11
+ const utils_1 = require("./utils");
12
+ exports.factory = {
13
+ makeSchema: (rawSchema, options = { shouldRemoveDeletedTypesAndFields: true }) => new schema_1.Schema({
14
+ rawSchema: options.shouldRemoveDeletedTypesAndFields
15
+ ? (0, utils_1.removeDeletedTypesAndFields)(rawSchema)
16
+ : rawSchema,
17
+ factory: exports.factory,
18
+ }),
19
+ makeTypeObject: (args) => new type_object_1.TypeObject({ ...args, factory: exports.factory }),
20
+ makeTypeObjectsById: (typeObjects) => lodash_1.default.keyBy(typeObjects, (x) => x.id),
21
+ makeTypeObjectsByName: (typeObjects) => lodash_1.default.keyBy(typeObjects, (x) => x.name),
22
+ makeFieldObject: (args) => new field_object_1.FieldObject(args),
23
+ makeFieldObjectsById: ({ fieldObjects }) => lodash_1.default.keyBy(fieldObjects, (x) => x.id),
24
+ makeFieldObjectsByName: ({ fieldObjects }) => lodash_1.default.keyBy(fieldObjects, (x) => x.name),
25
+ };
26
+ exports.protectiveFactory = {
27
+ makeSchema: (rawSchema, options = { shouldRemoveDeletedTypesAndFields: true }) => (0, utils_1.withOnlyDefinedGets)(new schema_1.Schema({
28
+ rawSchema: options.shouldRemoveDeletedTypesAndFields
29
+ ? (0, utils_1.removeDeletedTypesAndFields)(rawSchema)
30
+ : rawSchema,
31
+ factory: exports.protectiveFactory,
32
+ }), `schema`),
33
+ makeTypeObject: (args) => {
34
+ const typeObject = new type_object_1.TypeObject({ ...args, factory: exports.protectiveFactory });
35
+ return (0, utils_1.withOnlyDefinedGets)(typeObject, `schema.typeObjectsByName["${typeObject.name}"]`);
36
+ },
37
+ makeTypeObjectsById: (typeObjects) => (0, utils_1.withOnlyDefinedGets)(lodash_1.default.keyBy(typeObjects, (x) => x.id), "schema.typeObjectsById"),
38
+ makeTypeObjectsByName: (typeObjects) => (0, utils_1.withOnlyDefinedGets)(lodash_1.default.keyBy(typeObjects, (x) => x.name), "schema.typeObjectsByName"),
39
+ makeFieldObject: (args) => {
40
+ const fieldObject = new field_object_1.FieldObject(args);
41
+ return (0, utils_1.withOnlyDefinedGets)(fieldObject, `schema.typeObjectsByName["${fieldObject.holderType}"].fieldObjectsByName["${fieldObject.name}"]`);
42
+ },
43
+ makeFieldObjectsById: ({ type, fieldObjects }) => (0, utils_1.withOnlyDefinedGets)(lodash_1.default.keyBy(fieldObjects, (x) => x.id), `schema.typeObjectsByName["${type}"].fieldObjectsById`),
44
+ makeFieldObjectsByName: ({ type, fieldObjects }) => (0, utils_1.withOnlyDefinedGets)(lodash_1.default.keyBy(fieldObjects, (x) => x.name), `schema.typeObjectsByName["${type}"].fieldObjectsByName`),
45
+ };
@@ -0,0 +1,84 @@
1
+ import { TypeObject } from "./type-object";
2
+ export type Cardinality = ":cardinality/one-to-one" | ":cardinality/one-to-many" | ":cardinality/many-to-many" | ":cardinality/many-to-one";
3
+ export type RawFieldObject = {
4
+ "fibery/id": string;
5
+ "fibery/name": string;
6
+ "fibery/type": string;
7
+ "fibery/description"?: string;
8
+ "fibery/deleted?"?: boolean;
9
+ "fibery/meta": {
10
+ "fibery/collection?"?: boolean;
11
+ "ui/title?"?: boolean;
12
+ "fibery/id?"?: boolean;
13
+ "fibery/public-id?"?: boolean;
14
+ "fibery/readonly?"?: boolean;
15
+ "formula/formula?"?: boolean;
16
+ "formula/disabled?"?: boolean;
17
+ "formula/disable-reason"?: string;
18
+ "formula/formula"?: unknown;
19
+ "formula/lookup?"?: boolean;
20
+ "link-rule/link-rule?"?: boolean;
21
+ "link-rule/link-rule"?: unknown;
22
+ "link-rule/disabled?"?: boolean;
23
+ "link-rule/disable-reason"?: string;
24
+ "fibery/relation"?: string;
25
+ "fibery/default-value"?: unknown;
26
+ "ui/object-editor-order"?: number;
27
+ "fibery/required?"?: boolean;
28
+ "ui/hidden?"?: boolean;
29
+ "ui/disable-link-existing-items"?: boolean;
30
+ "fibery/multi-relation"?: string;
31
+ };
32
+ };
33
+ export type FieldObjectParams = {
34
+ rawFieldObject: RawFieldObject;
35
+ holderType: string;
36
+ resolveTypeObject: (type: string) => TypeObject;
37
+ version: string;
38
+ resolveMultiRelatedFieldObjects: (multiRelation: string) => FieldObject[];
39
+ };
40
+ export declare class FieldObject {
41
+ name: string;
42
+ description: string | null;
43
+ id: string;
44
+ type: string;
45
+ rawMeta: Record<string, unknown>;
46
+ holderType: string;
47
+ isCollection: boolean;
48
+ isTitle: boolean;
49
+ isId: boolean;
50
+ isPublicId: boolean;
51
+ isReadOnly: boolean;
52
+ isFormula: boolean;
53
+ isFormulaDisabled: boolean;
54
+ formulaDisableReason: string | null;
55
+ formula: unknown | null;
56
+ isLookup: boolean;
57
+ hasLinkRule: boolean;
58
+ linkRule: unknown | null;
59
+ isLinkRuleDisabled: boolean;
60
+ linkRuleDisableReason: string | null;
61
+ relation: string | null;
62
+ multiRelation: string | null;
63
+ defaultValue: unknown | null;
64
+ objectEditorOrder: number;
65
+ isRequired: boolean;
66
+ isHidden: boolean;
67
+ isDeleted: boolean;
68
+ disableLinkExistingItems: boolean;
69
+ version: string;
70
+ typeObject: TypeObject;
71
+ mixinTypeObject: unknown;
72
+ holderTypeObject: TypeObject;
73
+ nameParts: {
74
+ namespace: string;
75
+ name: string;
76
+ };
77
+ title: string;
78
+ multiRelatedFieldObjects: Array<FieldObject>;
79
+ constructor({ rawFieldObject, holderType, resolveTypeObject, version, resolveMultiRelatedFieldObjects, }: FieldObjectParams);
80
+ get relatedFieldObject(): FieldObject | null;
81
+ get cardinality(): Cardinality;
82
+ /** @deprecated use !typeObject.isPrimitive && cardinality === ... instead */
83
+ get kind(): ":field/basic" | ":field/reference-collection" | ":field/reference";
84
+ }
@@ -0,0 +1,208 @@
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.FieldObject = void 0;
7
+ /* eslint-disable no-use-before-define */
8
+ const lodash_1 = __importDefault(require("lodash"));
9
+ const utils_1 = require("./utils");
10
+ class FieldObject {
11
+ name;
12
+ description;
13
+ id;
14
+ type;
15
+ rawMeta;
16
+ holderType;
17
+ isCollection;
18
+ isTitle;
19
+ isId;
20
+ isPublicId;
21
+ isReadOnly;
22
+ isFormula;
23
+ isFormulaDisabled;
24
+ formulaDisableReason;
25
+ formula;
26
+ isLookup;
27
+ hasLinkRule;
28
+ linkRule;
29
+ isLinkRuleDisabled;
30
+ linkRuleDisableReason;
31
+ relation;
32
+ multiRelation;
33
+ defaultValue;
34
+ objectEditorOrder;
35
+ isRequired;
36
+ isHidden;
37
+ isDeleted;
38
+ disableLinkExistingItems;
39
+ version;
40
+ typeObject;
41
+ mixinTypeObject;
42
+ holderTypeObject;
43
+ nameParts;
44
+ title;
45
+ multiRelatedFieldObjects;
46
+ constructor({ rawFieldObject, holderType, resolveTypeObject, version, resolveMultiRelatedFieldObjects, }) {
47
+ if (!lodash_1.default.isPlainObject(rawFieldObject)) {
48
+ throw new Error("rawFieldObject arg must be plain object");
49
+ }
50
+ if (!lodash_1.default.isString(holderType)) {
51
+ throw new Error("holderType arg must be string");
52
+ }
53
+ if (!lodash_1.default.isFunction(resolveTypeObject)) {
54
+ throw new Error("resolveTypeObject arg must be function");
55
+ }
56
+ if (!lodash_1.default.isFunction(resolveMultiRelatedFieldObjects)) {
57
+ throw new Error("resolveMultiRelationFieldObjects arg must be function");
58
+ }
59
+ this.name = rawFieldObject["fibery/name"];
60
+ this.description = rawFieldObject["fibery/description"] || null;
61
+ this.id = rawFieldObject["fibery/id"];
62
+ this.type = rawFieldObject["fibery/type"];
63
+ const rawMeta = rawFieldObject["fibery/meta"] || {};
64
+ this.rawMeta = rawMeta;
65
+ this.holderType = holderType;
66
+ this.isCollection = rawMeta["fibery/collection?"] || false;
67
+ this.isTitle = rawMeta["ui/title?"] || false;
68
+ this.isId = rawMeta["fibery/id?"] || false;
69
+ this.isPublicId = rawMeta["fibery/public-id?"] || false;
70
+ this.isReadOnly = rawMeta["fibery/readonly?"] || false;
71
+ this.isFormula = rawMeta["formula/formula?"] || false;
72
+ this.isFormulaDisabled = rawMeta["formula/disabled?"] || false;
73
+ this.formulaDisableReason = rawMeta["formula/disable-reason"] || null;
74
+ this.formula = rawMeta["formula/formula"] || null;
75
+ this.isLookup = rawMeta["formula/lookup?"] || false;
76
+ this.hasLinkRule = rawMeta["link-rule/link-rule?"] || false;
77
+ this.linkRule = rawMeta["link-rule/link-rule"] || null;
78
+ this.isLinkRuleDisabled = rawMeta["link-rule/disabled?"] || false;
79
+ this.linkRuleDisableReason = rawMeta["link-rule/disable-reason"] || null;
80
+ this.relation = rawMeta["fibery/relation"] || null;
81
+ this.defaultValue = rawMeta["fibery/default-value"] || null;
82
+ this.objectEditorOrder = rawMeta["ui/object-editor-order"] || 0;
83
+ this.isRequired = rawMeta["fibery/required?"] === true;
84
+ this.isHidden = rawMeta["ui/hidden?"] === true;
85
+ this.isDeleted = rawFieldObject["fibery/deleted?"] || false;
86
+ this.disableLinkExistingItems = rawMeta["ui/disable-link-existing-items"] || false;
87
+ this.version = version;
88
+ this.multiRelation = rawMeta["fibery/multi-relation"] || null;
89
+ Object.defineProperties(this, {
90
+ typeObject: {
91
+ configurable: false,
92
+ enumerable: true,
93
+ get: lodash_1.default.once(() => resolveTypeObject(this.type)),
94
+ },
95
+ mixinTypeObject: {
96
+ configurable: false,
97
+ enumerable: true,
98
+ get: lodash_1.default.once(() => {
99
+ return this.holderTypeObject.installedMixinTypeObjects.find((mixinTypeObject) =>
100
+ // eslint-disable-next-line prefer-object-has-own
101
+ Object.prototype.hasOwnProperty.call(mixinTypeObject.fieldObjectsByName, this.name) ||
102
+ (this.name === "workflow/state" && mixinTypeObject.name === "workflow/workflow"));
103
+ }),
104
+ },
105
+ holderTypeObject: {
106
+ configurable: false,
107
+ enumerable: true,
108
+ get: lodash_1.default.once(() => {
109
+ return resolveTypeObject(holderType);
110
+ }),
111
+ },
112
+ nameParts: {
113
+ configurable: false,
114
+ enumerable: true,
115
+ get: lodash_1.default.once(() => (0, utils_1.parseType)(rawFieldObject["fibery/name"])),
116
+ },
117
+ title: {
118
+ configurable: false,
119
+ enumerable: true,
120
+ get: lodash_1.default.once(() => (0, utils_1.toNonEnumTitle)(rawFieldObject["fibery/name"])),
121
+ },
122
+ multiRelatedFieldObjects: {
123
+ configurable: false,
124
+ enumerable: true,
125
+ get: lodash_1.default.once(() => {
126
+ const { multiRelation, typeObject } = this;
127
+ if (!multiRelation || !typeObject.isEntityRef) {
128
+ return [];
129
+ }
130
+ return resolveMultiRelatedFieldObjects(multiRelation);
131
+ }),
132
+ },
133
+ });
134
+ }
135
+ get relatedFieldObject() {
136
+ const { name, relation, multiRelation, typeObject } = this;
137
+ if (!relation && !multiRelation) {
138
+ return null;
139
+ }
140
+ if (!relation && multiRelation && typeObject.isEntityRef) {
141
+ return null;
142
+ }
143
+ let relationKey;
144
+ let relationId;
145
+ if (relation) {
146
+ relationKey = "relation";
147
+ relationId = relation;
148
+ }
149
+ else {
150
+ relationId = multiRelation;
151
+ relationKey = "multiRelation";
152
+ }
153
+ const selector = this.type !== this.holderType
154
+ ? (fieldObject) => fieldObject[relationKey] === relationId
155
+ : (fieldObject) => fieldObject[relationKey] === relationId && fieldObject.name !== name;
156
+ const fieldObject = this.typeObject.fieldObjects.find(selector);
157
+ if (!fieldObject) {
158
+ throw new Error(`there no other end for ${relationKey} ${relationId}`);
159
+ }
160
+ return fieldObject;
161
+ }
162
+ get cardinality() {
163
+ const { isCollection, relatedFieldObject, typeObject } = this;
164
+ if (typeObject.isPrimitive) {
165
+ throw new Error("Only non-basic fields have cardinality");
166
+ }
167
+ if (isCollection && this.rawMeta["fibery/field-reversed-collection?"]) {
168
+ return ":cardinality/many-to-many";
169
+ }
170
+ if (!relatedFieldObject) {
171
+ return isCollection ? ":cardinality/one-to-many" : ":cardinality/many-to-one";
172
+ }
173
+ const isRelationCollection = relatedFieldObject.isCollection;
174
+ if (!isCollection && !isRelationCollection) {
175
+ return ":cardinality/one-to-one";
176
+ }
177
+ if (isCollection && !isRelationCollection) {
178
+ return ":cardinality/one-to-many";
179
+ }
180
+ if (!isCollection && isRelationCollection) {
181
+ return ":cardinality/many-to-one";
182
+ }
183
+ if (isCollection && isRelationCollection) {
184
+ return ":cardinality/many-to-many";
185
+ }
186
+ throw new Error("get cardinality invariant");
187
+ }
188
+ /** @deprecated use !typeObject.isPrimitive && cardinality === ... instead */
189
+ get kind() {
190
+ if (this.typeObject.isPrimitive) {
191
+ if (this.isCollection) {
192
+ throw new Error("basic collection is not implemented");
193
+ }
194
+ else {
195
+ return ":field/basic";
196
+ }
197
+ }
198
+ else {
199
+ if (this.isCollection) {
200
+ return ":field/reference-collection";
201
+ }
202
+ else {
203
+ return ":field/reference";
204
+ }
205
+ }
206
+ }
207
+ }
208
+ exports.FieldObject = FieldObject;
@@ -0,0 +1,2 @@
1
+ export declare const isValidIdentifier: (x: string) => boolean;
2
+ export declare const printJsPath: (keys: string[]) => string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.printJsPath = exports.isValidIdentifier = void 0;
4
+ const validIdentifierRegExp = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
5
+ const isValidIdentifier = (x) => validIdentifierRegExp.test(x);
6
+ exports.isValidIdentifier = isValidIdentifier;
7
+ const printJsPath = (keys) => keys.map((key) => ((0, exports.isValidIdentifier)(key) ? "." + key : `["${key}"]`)).join("");
8
+ exports.printJsPath = printJsPath;
@@ -0,0 +1,18 @@
1
+ import { RawTypeObject, TypeObject } from "./type-object";
2
+ import { Factory } from "./factory";
3
+ export type RawSchema = {
4
+ "fibery/id": string;
5
+ "fibery/types": RawTypeObject[];
6
+ "fibery/version": string;
7
+ };
8
+ export declare class Schema {
9
+ typeObjects: Array<TypeObject>;
10
+ typeObjectsById: Record<string, TypeObject>;
11
+ typeObjectsByName: Record<string, TypeObject>;
12
+ id: string;
13
+ version: string;
14
+ constructor({ factory, rawSchema: { "fibery/id": id, "fibery/types": rawTypeObjects, "fibery/version": version }, }: {
15
+ factory: Factory;
16
+ rawSchema: RawSchema;
17
+ });
18
+ }
@@ -0,0 +1,68 @@
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.Schema = void 0;
7
+ const lodash_1 = __importDefault(require("lodash"));
8
+ class Schema {
9
+ typeObjects;
10
+ typeObjectsById;
11
+ typeObjectsByName;
12
+ id;
13
+ version;
14
+ constructor({ factory, rawSchema: { "fibery/id": id, "fibery/types": rawTypeObjects, "fibery/version": version }, }) {
15
+ if (!Array.isArray(rawTypeObjects)) {
16
+ throw new Error("rawTypeObjects arg must be array");
17
+ }
18
+ Object.defineProperties(this, {
19
+ toJSON: {
20
+ value: () => ({ "fibery/types": rawTypeObjects, "fibery/meta": { "fibery/version": version } }),
21
+ enumerable: false,
22
+ },
23
+ });
24
+ const getTypeComponentTypeToFieldObject = lodash_1.default.once(() => {
25
+ const typeComponentTypeToFieldObject = new Map();
26
+ this.typeObjects
27
+ .flatMap((typeObject) => typeObject.fieldObjects)
28
+ .filter((fieldObject) => {
29
+ return (fieldObject.rawMeta["fibery/type-component?"] === true &&
30
+ fieldObject.typeObject.rawMeta["fibery/type-component?"] === true);
31
+ })
32
+ .forEach((fieldObject) => {
33
+ typeComponentTypeToFieldObject.set(fieldObject.type, fieldObject);
34
+ });
35
+ return typeComponentTypeToFieldObject;
36
+ });
37
+ let multiRelatedFieldsObjectsMap;
38
+ const initMultiRelatedFieldsObjectsMap = () => {
39
+ multiRelatedFieldsObjectsMap = new Map();
40
+ this.typeObjects.forEach((typeObject) => {
41
+ typeObject.fieldObjects.forEach((fieldObject) => {
42
+ if (fieldObject.multiRelation && !fieldObject.typeObject.isEntityRef) {
43
+ const store = multiRelatedFieldsObjectsMap.get(fieldObject.multiRelation) || [];
44
+ store.push(fieldObject);
45
+ multiRelatedFieldsObjectsMap.set(fieldObject.multiRelation, store);
46
+ }
47
+ });
48
+ });
49
+ };
50
+ this.typeObjects = rawTypeObjects.map((rawTypeObject) => factory.makeTypeObject({
51
+ rawTypeObject,
52
+ resolveTypeObject: (type) => this.typeObjectsByName[type] || null,
53
+ getTypeComponentTypeToFieldObject: (type) => getTypeComponentTypeToFieldObject().get(type),
54
+ resolveMultiRelatedFieldObjects: (multiRelation) => {
55
+ if (!multiRelatedFieldsObjectsMap) {
56
+ initMultiRelatedFieldsObjectsMap();
57
+ }
58
+ return multiRelatedFieldsObjectsMap.get(multiRelation) || [];
59
+ },
60
+ version,
61
+ }));
62
+ this.typeObjectsById = factory.makeTypeObjectsById(this.typeObjects);
63
+ this.typeObjectsByName = factory.makeTypeObjectsByName(this.typeObjects);
64
+ this.id = id;
65
+ this.version = version;
66
+ }
67
+ }
68
+ exports.Schema = Schema;
@@ -0,0 +1,100 @@
1
+ import { FieldObject, RawFieldObject } from "./field-object";
2
+ type SyncSource = {
3
+ appId: string;
4
+ appName: string;
5
+ id: string;
6
+ state: string;
7
+ type: string;
8
+ };
9
+ export type RawTypeObject = {
10
+ "fibery/id": string;
11
+ "fibery/name": string;
12
+ "fibery/description"?: string | null;
13
+ "fibery/deleted?"?: boolean;
14
+ "fibery/fields": RawFieldObject[];
15
+ "fibery/meta": {
16
+ "fibery/domain?"?: boolean;
17
+ "fibery/platform?"?: boolean;
18
+ "fibery/highlight?"?: boolean;
19
+ "app/mixin?"?: boolean;
20
+ "ui/mixin-icon"?: string;
21
+ "fibery/enum?"?: boolean;
22
+ "fibery/primitive?"?: boolean;
23
+ "ui/writer-mode?"?: boolean;
24
+ "ui/color"?: string;
25
+ "ui/units"?: unknown[];
26
+ "app/mixins"?: Record<string, boolean>;
27
+ "sync/source"?: SyncSource;
28
+ "fibery/secured?"?: boolean;
29
+ };
30
+ };
31
+ export type TypeObjectParams = {
32
+ rawTypeObject: RawTypeObject;
33
+ resolveTypeObject: (type: string) => TypeObject;
34
+ getTypeComponentTypeToFieldObject: (value: string) => FieldObject;
35
+ version: string;
36
+ factory: {
37
+ makeFieldObjectsByName: (params: {
38
+ type: string;
39
+ fieldObjects: FieldObject[];
40
+ }) => Record<string, FieldObject>;
41
+ makeFieldObjectsById: (params: {
42
+ type: string;
43
+ fieldObjects: FieldObject[];
44
+ }) => Record<string, FieldObject>;
45
+ makeFieldObject: (params: any) => FieldObject;
46
+ };
47
+ resolveMultiRelatedFieldObjects: (multiRelation: string) => FieldObject[];
48
+ };
49
+ export declare class TypeObject {
50
+ name: string;
51
+ description: string | null;
52
+ id: string;
53
+ rawMeta: Record<string, unknown>;
54
+ isDomain: boolean;
55
+ isPlatform: boolean;
56
+ isHighlight: boolean;
57
+ isMixin: boolean;
58
+ mixinIcon: string | null;
59
+ isEnum: boolean;
60
+ isPrimitive: boolean;
61
+ isWriterModeByDefault: boolean;
62
+ nameParts: {
63
+ namespace: string;
64
+ name: string;
65
+ };
66
+ color: string;
67
+ units: unknown | null;
68
+ installedMixins: Set<string>;
69
+ syncSource: SyncSource | null;
70
+ version: string;
71
+ installedMixinTypeObjects: TypeObject[];
72
+ title: string;
73
+ pluralTitle: string;
74
+ fieldObjects: Array<FieldObject>;
75
+ fieldObjectsById: Record<string, FieldObject>;
76
+ fieldObjectsByName: Record<string, FieldObject>;
77
+ typeComponentFieldObject: FieldObject | undefined;
78
+ isDeleted: boolean;
79
+ isEntityRef: boolean;
80
+ constructor({ rawTypeObject, resolveTypeObject, getTypeComponentTypeToFieldObject, version, factory, resolveMultiRelatedFieldObjects, }: TypeObjectParams);
81
+ _getFieldObjectShortcuts: () => {
82
+ idField: string;
83
+ idFieldObject: FieldObject;
84
+ publicIdField: string;
85
+ publicIdFieldObject: FieldObject;
86
+ titleField: string;
87
+ titleFieldObject: FieldObject;
88
+ rankField: null | string;
89
+ rankFieldObject: null | FieldObject;
90
+ };
91
+ get idField(): string;
92
+ get idFieldObject(): FieldObject;
93
+ get publicIdField(): string;
94
+ get publicIdFieldObject(): FieldObject;
95
+ get titleField(): string;
96
+ get titleFieldObject(): FieldObject;
97
+ get rankField(): string | null;
98
+ get rankFieldObject(): FieldObject | null;
99
+ }
100
+ export {};