@fibery/schema 10.2.0 → 10.2.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.
@@ -68,7 +68,7 @@ export declare class FieldObject {
68
68
  disableLinkExistingItems: boolean;
69
69
  version: string;
70
70
  typeObject: TypeObject;
71
- mixinTypeObject: unknown;
71
+ mixinTypeObject: TypeObject | undefined;
72
72
  holderTypeObject: TypeObject;
73
73
  nameParts: {
74
74
  namespace: string;
@@ -97,9 +97,7 @@ class FieldObject {
97
97
  configurable: false,
98
98
  enumerable: true,
99
99
  get: lodash_1.default.once(() => {
100
- return this.holderTypeObject.installedMixinTypeObjects.find((mixinTypeObject) =>
101
- // eslint-disable-next-line prefer-object-has-own
102
- Object.prototype.hasOwnProperty.call(mixinTypeObject.fieldObjectsByName, this.name) ||
100
+ return this.holderTypeObject.installedMixinTypeObjects.find((mixinTypeObject) => Object.hasOwn(mixinTypeObject.fieldObjectsByName, this.name) ||
103
101
  (this.name === "workflow/state" && mixinTypeObject.name === "workflow/workflow"));
104
102
  }),
105
103
  },
@@ -1,5 +1,5 @@
1
- import { FieldObject, RawFieldObject } from "./field-object";
2
- type SyncSource = {
1
+ import { FieldObject, FieldObjectParams, RawFieldObject } from "./field-object";
2
+ export type SyncSource = {
3
3
  appId: string;
4
4
  appName: string;
5
5
  id: string;
@@ -42,7 +42,7 @@ export type TypeObjectParams = {
42
42
  type: string;
43
43
  fieldObjects: FieldObject[];
44
44
  }) => Record<string, FieldObject>;
45
- makeFieldObject: (params: any) => FieldObject;
45
+ makeFieldObject: (params: FieldObjectParams) => FieldObject;
46
46
  };
47
47
  resolveMultiRelatedFieldObjects: (multiRelation: string) => FieldObject[];
48
48
  };
@@ -98,4 +98,3 @@ export declare class TypeObject {
98
98
  get rankField(): string | null;
99
99
  get rankFieldObject(): FieldObject | null;
100
100
  }
101
- export {};
@@ -6,7 +6,7 @@ export declare const capitalizeFirstChar: (input: string) => string;
6
6
  export declare const toTypeOrFieldNamePartTitle: (str: string) => string;
7
7
  export declare const toTypeOrFieldTitle: (str: string) => string;
8
8
  export declare const toPascalCase: (lispCasedString?: string) => string;
9
- export declare const toNonEnumTitle: (str: string) => string;
9
+ export declare const toNonEnumTitle: (strName: string) => string;
10
10
  export declare const parseEnumType: (type: string) => {
11
11
  templateName: string;
12
12
  templateNamespace: string;
@@ -45,13 +45,7 @@ export declare const removeDeletedTypesAndFields: (rawSchema: RawSchema) => {
45
45
  "ui/color"?: string | undefined;
46
46
  "ui/units"?: unknown[] | undefined;
47
47
  "app/mixins"?: Record<string, boolean> | undefined;
48
- "sync/source"?: {
49
- appId: string;
50
- appName: string;
51
- id: string;
52
- state: string;
53
- type: string;
54
- } | undefined;
48
+ "sync/source"?: import("./type-object").SyncSource | undefined;
55
49
  "fibery/secured?"?: boolean | undefined;
56
50
  };
57
51
  }[];
package/lib/src/utils.js CHANGED
@@ -96,7 +96,12 @@ const isObsoleteTitle = (str) => {
96
96
  return name.toLowerCase() === name && !hasTildes(name);
97
97
  };
98
98
  const hasTildes = (str) => str.includes("~");
99
- const toNonEnumTitle = (str) => {
99
+ const nameOverrides = {
100
+ "fibery/type": "fibery/Database",
101
+ "fibery/app": "fibery/Space",
102
+ };
103
+ const toNonEnumTitle = (strName) => {
104
+ const str = nameOverrides[strName] || strName;
100
105
  return isObsoleteTitle(str) ? (0, exports.toPascalCase)(str) : (0, exports.toTypeOrFieldTitle)(str);
101
106
  };
102
107
  exports.toNonEnumTitle = toNonEnumTitle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibery/schema",
3
- "version": "10.2.0",
3
+ "version": "10.2.2",
4
4
  "description": "Fibery schema utils",
5
5
  "main": "./lib/index.js",
6
6
  "files": [