@fibery/schema 10.3.2 → 11.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/errors.d.ts +2 -1
- package/lib/errors.js +2 -1
- package/lib/factory.d.ts +7 -7
- package/lib/field-object.d.ts +81 -44
- package/lib/field-object.js +187 -125
- package/lib/index.d.ts +5 -5
- package/lib/index.js +2 -2
- package/lib/relaxable.d.ts +4 -0
- package/lib/relaxable.js +10 -0
- package/lib/schema.d.ts +35 -7
- package/lib/schema.js +66 -39
- package/lib/type-object.d.ts +63 -61
- package/lib/type-object.js +226 -158
- package/lib/utils.d.ts +6 -3
- package/lib/utils.js +4 -6
- package/package.json +3 -3
package/lib/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SyncSource, TypeObject } from "./type-object.js";
|
|
2
|
-
import { RawFieldObject } from "./field-object.js";
|
|
3
2
|
import { RawSchema } from "./schema.js";
|
|
3
|
+
import { RawFieldObject } from "./field-object.js";
|
|
4
4
|
//#region src/utils.d.ts
|
|
5
5
|
declare const withOnlyDefinedGets: (target: any, targetKind?: string) => any;
|
|
6
6
|
declare const capitalizeFirstChar: (input: string) => string;
|
|
@@ -28,8 +28,6 @@ declare const attachEnumNamespace: ({ enumNamespace, typeNamePart }: {
|
|
|
28
28
|
typeNamePart: string;
|
|
29
29
|
}) => string;
|
|
30
30
|
declare const removeDeletedTypesAndFields: (rawSchema: RawSchema) => {
|
|
31
|
-
"fibery/id": string;
|
|
32
|
-
"fibery/version": string;
|
|
33
31
|
"fibery/types": {
|
|
34
32
|
"fibery/fields": RawFieldObject[];
|
|
35
33
|
"fibery/id": string;
|
|
@@ -50,8 +48,13 @@ declare const removeDeletedTypesAndFields: (rawSchema: RawSchema) => {
|
|
|
50
48
|
"app/mixins"?: Record<string, boolean>;
|
|
51
49
|
"sync/source"?: SyncSource;
|
|
52
50
|
"fibery/secured?"?: boolean;
|
|
51
|
+
"fibery/type-component?"?: boolean;
|
|
52
|
+
"ref/ref-db?"?: boolean;
|
|
53
|
+
"semantic-index/enabled"?: boolean;
|
|
53
54
|
};
|
|
54
55
|
}[];
|
|
56
|
+
"fibery/id": string;
|
|
57
|
+
"fibery/version": string;
|
|
55
58
|
};
|
|
56
59
|
declare const getTypeObjectTitle: (typeObject: TypeObject, form?: "singular" | "plural") => string;
|
|
57
60
|
//#endregion
|
package/lib/utils.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { NotDefinedGetError } from "./errors.js";
|
|
2
2
|
import { printJsPath } from "./print-utils.js";
|
|
3
3
|
import { traceError } from "@fibery/helpers/utils/trace";
|
|
4
|
-
import capitalize from "lodash/capitalize.js";
|
|
5
|
-
import flow from "lodash/flow.js";
|
|
6
|
-
import last from "lodash/last.js";
|
|
7
4
|
//#region src/utils.ts
|
|
8
5
|
const testRunnerKeys = /* @__PURE__ */ new Set([
|
|
9
6
|
"nodeType",
|
|
@@ -40,9 +37,10 @@ const capitalizeFirstChar = (input) => {
|
|
|
40
37
|
return str ? str.charAt(0).toUpperCase() + str.slice(1) : str;
|
|
41
38
|
};
|
|
42
39
|
const replaceTildes = (str) => (str || "").split("~").join(" ");
|
|
43
|
-
const toTypeOrFieldNamePartTitle =
|
|
44
|
-
const toTypeOrFieldTitle =
|
|
45
|
-
const
|
|
40
|
+
const toTypeOrFieldNamePartTitle = (str) => replaceTildes(capitalizeFirstChar(str || ""));
|
|
41
|
+
const toTypeOrFieldTitle = (str) => toTypeOrFieldNamePartTitle(getNamePart(str || ""));
|
|
42
|
+
const capitalizeWord = (str) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
43
|
+
const toPascalCase = (lispCasedString = "") => lispCasedString && (lispCasedString.split("/").at(-1) || "").split("-").map(capitalizeWord).join(" ");
|
|
46
44
|
const isObsoleteTitle = (str) => {
|
|
47
45
|
const { name } = splitKeyword(str);
|
|
48
46
|
return name.toLowerCase() === name && !hasTildes(name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/schema",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "Fibery schema utils",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"files": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"lodash": "4.17.21",
|
|
25
|
-
"@fibery/
|
|
26
|
-
"@fibery/
|
|
25
|
+
"@fibery/helpers": "3.3.1",
|
|
26
|
+
"@fibery/pluralize": "1.2.1"
|
|
27
27
|
}
|
|
28
28
|
}
|