@fibery/schema 10.2.18 → 10.3.1

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.
@@ -1,225 +0,0 @@
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
- const _1 = require("@fibery/helpers/src/_");
8
- const isFunction_1 = __importDefault(require("lodash/isFunction"));
9
- const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
10
- const isString_1 = __importDefault(require("lodash/isString"));
11
- const utils_1 = require("./utils");
12
- class FieldObject {
13
- name;
14
- description;
15
- id;
16
- type;
17
- rawMeta;
18
- holderType;
19
- isCollection;
20
- isTitle;
21
- isId;
22
- isPublicId;
23
- isReadOnly;
24
- isFormula;
25
- isFormulaDisabled;
26
- formulaDisableReason;
27
- formula;
28
- isLookup;
29
- hasLinkRule;
30
- linkRule;
31
- isLinkRuleDisabled;
32
- linkRuleDisableReason;
33
- relation;
34
- multiRelation;
35
- defaultValue;
36
- objectEditorOrder;
37
- isRequired;
38
- isHidden;
39
- isDeleted;
40
- disableLinkExistingItems;
41
- version;
42
- typeObject;
43
- mixinTypeObject;
44
- holderTypeObject;
45
- nameParts;
46
- title;
47
- multiRelatedFieldObjects;
48
- isMultiField;
49
- isDependency;
50
- isDependencyStart;
51
- constructor({ rawFieldObject, holderType, resolveTypeObject, version, resolveMultiRelatedFieldObjects, }) {
52
- if (!(0, isPlainObject_1.default)(rawFieldObject)) {
53
- throw new Error("rawFieldObject arg must be plain object");
54
- }
55
- if (!(0, isString_1.default)(holderType)) {
56
- throw new Error("holderType arg must be string");
57
- }
58
- if (!(0, isFunction_1.default)(resolveTypeObject)) {
59
- throw new Error("resolveTypeObject arg must be function");
60
- }
61
- if (!(0, isFunction_1.default)(resolveMultiRelatedFieldObjects)) {
62
- throw new Error("resolveMultiRelationFieldObjects arg must be function");
63
- }
64
- this.name = rawFieldObject["fibery/name"];
65
- this.description = rawFieldObject["fibery/description"] || null;
66
- this.id = rawFieldObject["fibery/id"];
67
- this.type = rawFieldObject["fibery/type"];
68
- const rawMeta = rawFieldObject["fibery/meta"] || {};
69
- this.rawMeta = rawMeta;
70
- this.holderType = holderType;
71
- this.isCollection = rawMeta["fibery/collection?"] || false;
72
- this.isTitle = rawMeta["ui/title?"] || false;
73
- this.isId = rawMeta["fibery/id?"] || false;
74
- this.isPublicId = rawMeta["fibery/public-id?"] || false;
75
- this.isReadOnly = rawMeta["fibery/readonly?"] || false;
76
- this.isFormula = rawMeta["formula/formula?"] || false;
77
- this.isFormulaDisabled = rawMeta["formula/disabled?"] || false;
78
- this.formulaDisableReason = rawMeta["formula/disable-reason"] || null;
79
- this.formula = rawMeta["formula/formula"] || null;
80
- this.isLookup = rawMeta["formula/lookup?"] || false;
81
- this.hasLinkRule = rawMeta["link-rule/link-rule?"] || false;
82
- this.linkRule = rawMeta["link-rule/link-rule"] || null;
83
- this.isLinkRuleDisabled = rawMeta["link-rule/disabled?"] || false;
84
- this.linkRuleDisableReason = rawMeta["link-rule/disable-reason"] || null;
85
- this.relation = rawMeta["fibery/relation"] || null;
86
- this.defaultValue = rawMeta["fibery/default-value"] ?? null;
87
- this.objectEditorOrder = rawMeta["ui/object-editor-order"] || 0;
88
- this.isRequired = rawMeta["fibery/required?"] === true;
89
- this.isHidden = rawMeta["ui/hidden?"] === true;
90
- this.isDeleted = rawFieldObject["fibery/deleted?"] || false;
91
- this.disableLinkExistingItems = rawMeta["ui/disable-link-existing-items"] || false;
92
- this.version = version;
93
- this.multiRelation = rawMeta["fibery/multi-relation"] || null;
94
- this.isDependency = rawMeta["fibery/dependency?"] || false;
95
- this.isDependencyStart = rawMeta["fibery/dependency-start?"] || false;
96
- Object.defineProperties(this, {
97
- typeObject: {
98
- configurable: false,
99
- enumerable: true,
100
- get: (0, _1.once)(() => resolveTypeObject(this.type)),
101
- },
102
- mixinTypeObject: {
103
- configurable: false,
104
- enumerable: true,
105
- get: (0, _1.once)(() => {
106
- return this.holderTypeObject.installedMixinTypeObjects.find((mixinTypeObject) => Object.hasOwn(mixinTypeObject.fieldObjectsByName, this.name) ||
107
- (this.name === "workflow/state" && mixinTypeObject.name === "workflow/workflow"));
108
- }),
109
- },
110
- holderTypeObject: {
111
- configurable: false,
112
- enumerable: true,
113
- get: (0, _1.once)(() => {
114
- return resolveTypeObject(holderType);
115
- }),
116
- },
117
- nameParts: {
118
- configurable: false,
119
- enumerable: true,
120
- get: (0, _1.once)(() => (0, utils_1.parseType)(rawFieldObject["fibery/name"])),
121
- },
122
- title: {
123
- configurable: false,
124
- enumerable: true,
125
- get: (0, _1.once)(() => {
126
- if (this.name === "fibery/role" && this.holderType === "fibery/user") {
127
- return "User Role";
128
- }
129
- return (0, utils_1.toNonEnumTitle)(rawFieldObject["fibery/name"]);
130
- }),
131
- },
132
- multiRelatedFieldObjects: {
133
- configurable: false,
134
- enumerable: true,
135
- get: (0, _1.once)(() => {
136
- const { multiRelation, typeObject } = this;
137
- if (!multiRelation || !typeObject.isEntityRef) {
138
- return [];
139
- }
140
- return resolveMultiRelatedFieldObjects(multiRelation);
141
- }),
142
- },
143
- isMultiField: {
144
- configurable: false,
145
- enumerable: true,
146
- get: (0, _1.once)(() => {
147
- return this.typeObject.isEntityRef;
148
- }),
149
- },
150
- });
151
- }
152
- get relatedFieldObject() {
153
- const { name, relation, multiRelation, typeObject } = this;
154
- if (!relation && !multiRelation) {
155
- return null;
156
- }
157
- if (!relation && multiRelation && typeObject.isEntityRef) {
158
- return null;
159
- }
160
- let relationKey;
161
- let relationId;
162
- if (relation) {
163
- relationKey = "relation";
164
- relationId = relation;
165
- }
166
- else {
167
- relationId = multiRelation;
168
- relationKey = "multiRelation";
169
- }
170
- const selector = this.type !== this.holderType
171
- ? (fieldObject) => fieldObject[relationKey] === relationId
172
- : (fieldObject) => fieldObject[relationKey] === relationId && fieldObject.name !== name;
173
- const fieldObject = this.typeObject.fieldObjects.find(selector);
174
- if (!fieldObject) {
175
- throw new Error(`there no other end for ${relationKey} ${relationId}`);
176
- }
177
- return fieldObject;
178
- }
179
- get cardinality() {
180
- const { isCollection, relatedFieldObject, typeObject } = this;
181
- if (typeObject.isPrimitive) {
182
- throw new Error("Only non-basic fields have cardinality");
183
- }
184
- if (isCollection && this.rawMeta["fibery/field-reversed-collection?"]) {
185
- return ":cardinality/many-to-many";
186
- }
187
- if (!relatedFieldObject) {
188
- return isCollection ? ":cardinality/one-to-many" : ":cardinality/many-to-one";
189
- }
190
- const isRelationCollection = relatedFieldObject.isCollection;
191
- if (!isCollection && !isRelationCollection) {
192
- return ":cardinality/one-to-one";
193
- }
194
- if (isCollection && !isRelationCollection) {
195
- return ":cardinality/one-to-many";
196
- }
197
- if (!isCollection && isRelationCollection) {
198
- return ":cardinality/many-to-one";
199
- }
200
- if (isCollection && isRelationCollection) {
201
- return ":cardinality/many-to-many";
202
- }
203
- throw new Error("get cardinality invariant");
204
- }
205
- /** @deprecated use !typeObject.isPrimitive && cardinality === ... instead */
206
- get kind() {
207
- if (this.typeObject.isPrimitive) {
208
- if (this.isCollection) {
209
- throw new Error("basic collection is not implemented");
210
- }
211
- else {
212
- return ":field/basic";
213
- }
214
- }
215
- else {
216
- if (this.isCollection) {
217
- return ":field/reference-collection";
218
- }
219
- else {
220
- return ":field/reference";
221
- }
222
- }
223
- }
224
- }
225
- exports.FieldObject = FieldObject;
@@ -1,2 +0,0 @@
1
- export declare const isValidIdentifier: (x: string) => boolean;
2
- export declare const printJsPath: (keys: string[]) => string;
@@ -1,8 +0,0 @@
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;
@@ -1,18 +0,0 @@
1
- import type { Factory } from "./factory";
2
- import type { RawTypeObject, TypeObject } from "./type-object";
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
- }
package/lib/src/schema.js DELETED
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Schema = void 0;
4
- const _1 = require("@fibery/helpers/src/_");
5
- class Schema {
6
- typeObjects;
7
- typeObjectsById;
8
- typeObjectsByName;
9
- id;
10
- version;
11
- constructor({ factory, rawSchema: { "fibery/id": id, "fibery/types": rawTypeObjects, "fibery/version": version }, }) {
12
- if (!Array.isArray(rawTypeObjects)) {
13
- throw new Error("rawTypeObjects arg must be array");
14
- }
15
- Object.defineProperties(this, {
16
- toJSON: {
17
- value: () => ({ "fibery/types": rawTypeObjects, "fibery/meta": { "fibery/version": version } }),
18
- enumerable: false,
19
- },
20
- });
21
- const getTypeComponentTypeToFieldObject = (0, _1.once)(() => {
22
- const typeComponentTypeToFieldObject = new Map();
23
- this.typeObjects
24
- .flatMap((typeObject) => typeObject.fieldObjects)
25
- .filter((fieldObject) => {
26
- return (fieldObject.rawMeta["fibery/type-component?"] === true &&
27
- fieldObject.typeObject.rawMeta["fibery/type-component?"] === true);
28
- })
29
- .forEach((fieldObject) => {
30
- typeComponentTypeToFieldObject.set(fieldObject.type, fieldObject);
31
- });
32
- return typeComponentTypeToFieldObject;
33
- });
34
- let multiRelatedFieldsObjectsMap;
35
- const initMultiRelatedFieldsObjectsMap = () => {
36
- multiRelatedFieldsObjectsMap = new Map();
37
- this.typeObjects.forEach((typeObject) => {
38
- typeObject.fieldObjects.forEach((fieldObject) => {
39
- if (fieldObject.multiRelation && !fieldObject.typeObject.isEntityRef) {
40
- const store = multiRelatedFieldsObjectsMap.get(fieldObject.multiRelation) || [];
41
- store.push(fieldObject);
42
- multiRelatedFieldsObjectsMap.set(fieldObject.multiRelation, store);
43
- }
44
- });
45
- });
46
- };
47
- this.typeObjects = rawTypeObjects.map((rawTypeObject) => factory.makeTypeObject({
48
- rawTypeObject,
49
- resolveTypeObject: (type) => this.typeObjectsByName[type] || null,
50
- getTypeComponentTypeToFieldObject: (type) => getTypeComponentTypeToFieldObject().get(type),
51
- resolveMultiRelatedFieldObjects: (multiRelation) => {
52
- if (!multiRelatedFieldsObjectsMap) {
53
- initMultiRelatedFieldsObjectsMap();
54
- }
55
- return multiRelatedFieldsObjectsMap.get(multiRelation) || [];
56
- },
57
- version,
58
- }));
59
- this.typeObjectsById = factory.makeTypeObjectsById(this.typeObjects);
60
- this.typeObjectsByName = factory.makeTypeObjectsByName(this.typeObjects);
61
- this.id = id;
62
- this.version = version;
63
- }
64
- }
65
- exports.Schema = Schema;
@@ -1,101 +0,0 @@
1
- import type { IdField, PublicIdField, RankField, TitleField } from "./field-keys";
2
- import type { FieldObject, FieldObjectParams, RawFieldObject } from "./field-object";
3
- export type SyncSource = {
4
- appId: string;
5
- appName: string;
6
- id: string;
7
- state: string;
8
- type: string;
9
- };
10
- export type RawTypeObject = {
11
- "fibery/id": string;
12
- "fibery/name": string;
13
- "fibery/description"?: string | null;
14
- "fibery/deleted?"?: boolean;
15
- "fibery/fields": RawFieldObject[];
16
- "fibery/meta": {
17
- "fibery/domain?"?: boolean;
18
- "fibery/platform?"?: boolean;
19
- "fibery/highlight?"?: boolean;
20
- "app/mixin?"?: boolean;
21
- "ui/mixin-icon"?: string;
22
- "fibery/enum?"?: boolean;
23
- "fibery/primitive?"?: boolean;
24
- "ui/writer-mode?"?: boolean;
25
- "ui/color"?: string;
26
- "ui/units"?: unknown[];
27
- "app/mixins"?: Record<string, boolean>;
28
- "sync/source"?: SyncSource;
29
- "fibery/secured?"?: boolean;
30
- };
31
- };
32
- export type TypeObjectParams = {
33
- rawTypeObject: RawTypeObject;
34
- resolveTypeObject: (type: string) => TypeObject;
35
- getTypeComponentTypeToFieldObject: (value: string) => FieldObject;
36
- version: string;
37
- factory: {
38
- makeFieldObjectsByName: (params: {
39
- type: string;
40
- fieldObjects: FieldObject[];
41
- }) => Record<string, FieldObject>;
42
- makeFieldObjectsById: (params: {
43
- type: string;
44
- fieldObjects: FieldObject[];
45
- }) => Record<string, FieldObject>;
46
- makeFieldObject: (params: FieldObjectParams) => FieldObject;
47
- };
48
- resolveMultiRelatedFieldObjects: (multiRelation: string) => FieldObject[];
49
- };
50
- export declare class TypeObject {
51
- name: string;
52
- description: string | null;
53
- id: string;
54
- rawMeta: Record<string, unknown>;
55
- isDomain: boolean;
56
- isPlatform: boolean;
57
- isHighlight: boolean;
58
- isMixin: boolean;
59
- mixinIcon: string | null;
60
- isEnum: boolean;
61
- isPrimitive: boolean;
62
- isWriterModeByDefault: boolean;
63
- nameParts: {
64
- namespace: string;
65
- name: string;
66
- };
67
- color: string;
68
- units: unknown | null;
69
- installedMixins: Set<string>;
70
- syncSource: SyncSource | null;
71
- version: string;
72
- installedMixinTypeObjects: TypeObject[];
73
- title: string;
74
- pluralTitle: string;
75
- singularTitle: string;
76
- fieldObjects: Array<FieldObject>;
77
- fieldObjectsById: Record<string, FieldObject>;
78
- fieldObjectsByName: Record<string, FieldObject>;
79
- typeComponentFieldObject: FieldObject | undefined;
80
- isDeleted: boolean;
81
- isEntityRef: boolean;
82
- constructor({ rawTypeObject, resolveTypeObject, getTypeComponentTypeToFieldObject, version, factory, resolveMultiRelatedFieldObjects, }: TypeObjectParams);
83
- _getFieldObjectShortcuts: () => {
84
- idField: IdField;
85
- idFieldObject: FieldObject;
86
- publicIdField: PublicIdField;
87
- publicIdFieldObject: FieldObject;
88
- titleField: TitleField;
89
- titleFieldObject: FieldObject;
90
- rankField: RankField | null;
91
- rankFieldObject: FieldObject | null;
92
- };
93
- get idField(): IdField;
94
- get idFieldObject(): FieldObject;
95
- get publicIdField(): PublicIdField;
96
- get publicIdFieldObject(): FieldObject;
97
- get titleField(): TitleField;
98
- get titleFieldObject(): FieldObject;
99
- get rankField(): RankField | null;
100
- get rankFieldObject(): FieldObject | null;
101
- }
@@ -1,199 +0,0 @@
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.TypeObject = void 0;
7
- const _1 = require("@fibery/helpers/src/_");
8
- const pluralize_1 = require("@fibery/pluralize");
9
- const isFunction_1 = __importDefault(require("lodash/isFunction"));
10
- const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
11
- const utils_1 = require("./utils");
12
- class TypeObject {
13
- name;
14
- description;
15
- id;
16
- rawMeta;
17
- isDomain;
18
- isPlatform;
19
- isHighlight;
20
- isMixin;
21
- mixinIcon;
22
- isEnum;
23
- isPrimitive;
24
- isWriterModeByDefault;
25
- nameParts;
26
- color;
27
- units;
28
- installedMixins;
29
- syncSource;
30
- version;
31
- installedMixinTypeObjects;
32
- title;
33
- pluralTitle;
34
- singularTitle;
35
- fieldObjects;
36
- fieldObjectsById;
37
- fieldObjectsByName;
38
- typeComponentFieldObject;
39
- isDeleted;
40
- isEntityRef;
41
- constructor({ rawTypeObject, resolveTypeObject, getTypeComponentTypeToFieldObject, version, factory, resolveMultiRelatedFieldObjects, }) {
42
- if (!(0, isPlainObject_1.default)(rawTypeObject)) {
43
- throw new Error("rawTypeObject arg must be plain object");
44
- }
45
- if (!(0, isFunction_1.default)(resolveTypeObject)) {
46
- throw new Error("resolveTypeObject arg must be function");
47
- }
48
- this.name = rawTypeObject["fibery/name"];
49
- this.description = rawTypeObject["fibery/description"] || null;
50
- this.id = rawTypeObject["fibery/id"];
51
- const rawMeta = rawTypeObject["fibery/meta"] || {};
52
- this.rawMeta = rawMeta;
53
- this.isDomain = rawMeta["fibery/domain?"] || false;
54
- this.isPlatform = rawMeta["fibery/platform?"] || false;
55
- this.isHighlight = rawMeta["fibery/highlight?"] || false;
56
- this.isMixin = rawMeta["app/mixin?"] || false;
57
- this.mixinIcon = rawMeta["ui/mixin-icon"] || null;
58
- this.isEnum = rawMeta["fibery/enum?"] || false;
59
- this.isPrimitive = rawMeta["fibery/primitive?"] || false;
60
- this.isWriterModeByDefault = rawMeta["ui/writer-mode?"] || false;
61
- this.isDeleted = rawTypeObject["fibery/deleted?"] || false;
62
- this.nameParts = (0, utils_1.parseType)(this.name);
63
- this.color = rawMeta["ui/color"] || "#4978D4";
64
- this.units = rawMeta["ui/units"] || null;
65
- this.installedMixins = new Set(Object.keys(rawMeta["app/mixins"] || {}));
66
- this.syncSource = rawMeta["sync/source"] || null;
67
- this.version = version;
68
- this.isEntityRef = rawTypeObject["fibery/name"] === "fibery/entity-ref";
69
- const fieldObjectsByNameOnceGetter = (0, _1.once)(() => {
70
- return factory.makeFieldObjectsByName({
71
- type: this.name,
72
- fieldObjects: this.fieldObjects,
73
- });
74
- });
75
- const fieldObjectsGetter = (0, _1.once)(() => rawTypeObject["fibery/fields"].map((rawFieldObject) => {
76
- return factory.makeFieldObject({
77
- rawFieldObject,
78
- holderType: this.name,
79
- resolveTypeObject,
80
- version,
81
- resolveMultiRelatedFieldObjects,
82
- });
83
- }));
84
- Object.defineProperties(this, {
85
- toJSON: {
86
- value() {
87
- if (process.env.NODE_ENV === "test") {
88
- return `<schema.typeObjectsByName["${rawTypeObject["fibery/name"]}"]>`;
89
- }
90
- return rawTypeObject;
91
- },
92
- enumerable: false,
93
- },
94
- fieldObjects: {
95
- configurable: false,
96
- enumerable: true,
97
- get: fieldObjectsGetter,
98
- },
99
- typeComponentFieldObject: {
100
- configurable: false,
101
- enumerable: true,
102
- get: () => {
103
- return getTypeComponentTypeToFieldObject(this.name);
104
- },
105
- },
106
- fieldObjectsById: {
107
- configurable: false,
108
- enumerable: true,
109
- get: (0, _1.once)(() => {
110
- return factory.makeFieldObjectsById({
111
- type: this.name,
112
- fieldObjects: this.fieldObjects,
113
- });
114
- }),
115
- },
116
- fieldObjectsByName: {
117
- configurable: false,
118
- enumerable: true,
119
- get: fieldObjectsByNameOnceGetter,
120
- },
121
- installedMixinTypeObjects: {
122
- configurable: false,
123
- enumerable: true,
124
- get: (0, _1.once)(() => [...this.installedMixins].map(resolveTypeObject).filter((typeObject) => typeObject)),
125
- },
126
- title: {
127
- configurable: false,
128
- enumerable: true,
129
- get: (0, _1.once)(() => (0, utils_1.toTitle)(this.name)),
130
- },
131
- pluralTitle: {
132
- configurable: false,
133
- enumerable: true,
134
- get: (0, _1.once)(() => pluralize_1.pluralize.plural((0, utils_1.toTitle)(this.name))),
135
- },
136
- singularTitle: {
137
- configurable: false,
138
- enumerable: true,
139
- get: (0, _1.once)(() => pluralize_1.pluralize.singular((0, utils_1.toTitle)(this.name))),
140
- },
141
- });
142
- }
143
- _getFieldObjectShortcuts = (0, _1.once)(() => {
144
- const hasRank = this.installedMixins.has("fibery/rank-mixin");
145
- return this.fieldObjects.reduce((result, fieldObject) => {
146
- if (fieldObject.isId) {
147
- result.idField = fieldObject.name;
148
- result.idFieldObject = fieldObject;
149
- }
150
- else if (fieldObject.isPublicId) {
151
- result.publicIdField = fieldObject.name;
152
- result.publicIdFieldObject = fieldObject;
153
- }
154
- else if (fieldObject.isTitle) {
155
- result.titleField = fieldObject.name;
156
- result.titleFieldObject = fieldObject;
157
- }
158
- else if (hasRank && fieldObject.name === "fibery/rank") {
159
- result.rankField = fieldObject.name;
160
- result.rankFieldObject = fieldObject;
161
- }
162
- return result;
163
- }, {
164
- idField: null,
165
- idFieldObject: null,
166
- publicIdField: null,
167
- publicIdFieldObject: null,
168
- titleField: null,
169
- titleFieldObject: null,
170
- rankField: null,
171
- rankFieldObject: null,
172
- });
173
- });
174
- get idField() {
175
- return this._getFieldObjectShortcuts().idField;
176
- }
177
- get idFieldObject() {
178
- return this._getFieldObjectShortcuts().idFieldObject;
179
- }
180
- get publicIdField() {
181
- return this._getFieldObjectShortcuts().publicIdField;
182
- }
183
- get publicIdFieldObject() {
184
- return this._getFieldObjectShortcuts().publicIdFieldObject;
185
- }
186
- get titleField() {
187
- return this._getFieldObjectShortcuts().titleField;
188
- }
189
- get titleFieldObject() {
190
- return this._getFieldObjectShortcuts().titleFieldObject;
191
- }
192
- get rankField() {
193
- return this._getFieldObjectShortcuts().rankField;
194
- }
195
- get rankFieldObject() {
196
- return this._getFieldObjectShortcuts().rankFieldObject;
197
- }
198
- }
199
- exports.TypeObject = TypeObject;
@@ -1,57 +0,0 @@
1
- import type { RawSchema } from "./schema";
2
- import type { TypeObject } from "./type-object";
3
- export declare const withOnlyDefinedGets: (target: any, targetKind?: string) => any;
4
- export declare const capitalizeFirstChar: (input: string) => string;
5
- export declare const toTypeOrFieldNamePartTitle: (str: string | null | undefined) => string;
6
- export declare const toTypeOrFieldTitle: (str: string | null | undefined) => string;
7
- export declare const toPascalCase: (lispCasedString?: string) => string;
8
- export declare const toNonEnumTitle: (strName: string) => string;
9
- export declare const parseEnumType: (type: string) => {
10
- templateName: string;
11
- templateNamespace: string;
12
- targetName: string;
13
- targetNamespace: string;
14
- };
15
- export declare const toTitle: (typeOrAttr: string) => string;
16
- export declare const parseType: ((arg: string) => {
17
- namespace: string;
18
- name: string;
19
- }) & import("@fibery/helpers/src/_").MemoizedFunction<string, {
20
- namespace: string;
21
- name: string;
22
- }>;
23
- export declare const makeEnumTypeNamePart: ({ holderType, enumName }: {
24
- holderType: string;
25
- enumName: string;
26
- }) => string;
27
- export declare const attachEnumNamespace: ({ enumNamespace, typeNamePart }: {
28
- enumNamespace: string;
29
- typeNamePart: string;
30
- }) => string;
31
- export declare const removeDeletedTypesAndFields: (rawSchema: RawSchema) => {
32
- "fibery/types": {
33
- "fibery/fields": import("./field-object").RawFieldObject[];
34
- "fibery/id": string;
35
- "fibery/name": string;
36
- "fibery/description"?: string | null;
37
- "fibery/deleted?"?: boolean;
38
- "fibery/meta": {
39
- "fibery/domain?"?: boolean;
40
- "fibery/platform?"?: boolean;
41
- "fibery/highlight?"?: boolean;
42
- "app/mixin?"?: boolean;
43
- "ui/mixin-icon"?: string;
44
- "fibery/enum?"?: boolean;
45
- "fibery/primitive?"?: boolean;
46
- "ui/writer-mode?"?: boolean;
47
- "ui/color"?: string;
48
- "ui/units"?: unknown[];
49
- "app/mixins"?: Record<string, boolean>;
50
- "sync/source"?: import("./type-object").SyncSource;
51
- "fibery/secured?"?: boolean;
52
- };
53
- }[];
54
- "fibery/id": string;
55
- "fibery/version": string;
56
- };
57
- export declare const getTypeObjectTitle: (typeObject: TypeObject, form?: "singular" | "plural") => string;