@paroicms/internal-anywhere-lib 1.17.1 → 1.18.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/dist-cjs/parts.helper.d.ts +2 -2
- package/dist-cjs/parts.helper.js +1 -2
- package/dist-cjs/parts.helper.js.map +1 -1
- package/dist-cjs/site-schema-helpers.d.ts +12 -17
- package/dist-cjs/site-schema-helpers.js +35 -54
- package/dist-cjs/site-schema-helpers.js.map +1 -1
- package/dist-cjs/time-with-unit.helpers.js +2 -3
- package/dist-cjs/time-with-unit.helpers.js.map +1 -1
- package/dist-cjs/url-helpers.js +1 -2
- package/dist-cjs/url-helpers.js.map +1 -1
- package/dist-mjs/parts.helper.d.ts +2 -2
- package/dist-mjs/site-schema-helpers.d.ts +12 -17
- package/dist-mjs/site-schema-helpers.js +25 -41
- package/dist-mjs/site-schema-helpers.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function sortParts(listType:
|
|
1
|
+
import type { ScListType } from "@paroicms/public-anywhere-lib";
|
|
2
|
+
export declare function sortParts(listType: ScListType, list: any[]): void;
|
package/dist-cjs/parts.helper.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sortParts =
|
|
3
|
+
exports.sortParts = sortParts;
|
|
4
4
|
const data_formatters_lib_1 = require("@paroi/data-formatters-lib");
|
|
5
5
|
function sortParts(listType, list) {
|
|
6
6
|
if (listType.orderBy === "manual") {
|
|
@@ -41,7 +41,6 @@ function sortParts(listType, list) {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
exports.sortParts = sortParts;
|
|
45
44
|
function includesOrderBy(orderBy, valueToCheck) {
|
|
46
45
|
return orderBy.some((item) => item[0] === valueToCheck[0] && item[1] === valueToCheck[1]);
|
|
47
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parts.helper.js","sourceRoot":"","sources":["../src/parts.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parts.helper.js","sourceRoot":"","sources":["../src/parts.helper.ts"],"names":[],"mappings":";;AAGA,8BA+BC;AAlCD,oEAAmD;AAGnD,SAAgB,SAAS,CAAC,QAAoB,EAAE,IAAW;IACzD,IAAI,QAAQ,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACjB,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ;gBAAE,OAAO,CAAC,CAAC;YACxC,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS;gBAAE,OAAO,CAAC,CAAC,CAAC;YACxC,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS;gBAAE,OAAO,CAAC,CAAC;YACvC,OAAO,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;SAAM,IAAI,eAAe,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;QACtE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACjB,IAAI,aAAa,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC,EAAE,CAAC;gBAC7C,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;oBACpC,IAAI,IAAA,2BAAK,EAAC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAA,2BAAK,EAAC,CAAC,CAAC,MAAM,CAAC;wBAAE,OAAO,CAAC,CAAC,CAAC;oBACjD,OAAO,CAAC,CAAC;gBACX,CAAC;gBACD,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,CAAC;YAC/E,CAAC;YACD,OAAO,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC;SAAM,IAAI,eAAe,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;QACrE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACjB,IAAI,aAAa,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC,EAAE,CAAC;gBAC7C,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;oBACpC,IAAI,IAAA,2BAAK,EAAC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAA,2BAAK,EAAC,CAAC,CAAC,MAAM,CAAC;wBAAE,OAAO,CAAC,CAAC,CAAC;oBACjD,OAAO,CAAC,CAAC;gBACX,CAAC;gBACD,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,CAAC;YAC/E,CAAC;YACD,OAAO,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CACtB,OAAmC,EACnC,YAAsC;IAEtC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
1
|
+
import type { ScDocumentType, ScFTextFieldType, ScFieldType, ScLeafType, ScPartType, ScRegularDocumentType, ScRoutingPointDocumentType, ScSiteSchema } from "@paroicms/public-anywhere-lib";
|
|
2
|
+
export declare function getLeafTypeByName(siteSchema: ScSiteSchema, typeName: string): ScLeafType;
|
|
3
|
+
export declare function getDocumentTypeByName(siteSchema: ScSiteSchema, typeName: string): ScDocumentType;
|
|
4
|
+
export declare function getPartTypeByName(siteSchema: ScSiteSchema, typeName: string): ScPartType;
|
|
5
|
+
export declare function getRoutingPointDocumentTypes(siteSchema: ScSiteSchema): ScRoutingPointDocumentType[];
|
|
6
|
+
export declare function regularChildDocumentTypesOf(siteSchema: ScSiteSchema, parentTypeName: string): ScRegularDocumentType[];
|
|
7
7
|
export declare function getDocumentTypeByBoDirName({ boDirName, siteSchema, }: {
|
|
8
8
|
boDirName: string;
|
|
9
|
-
siteSchema:
|
|
10
|
-
}):
|
|
11
|
-
export declare function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare function getLeafSchema(siteSchema: SiteSchema, leafType: string): LeafSchema;
|
|
16
|
-
export declare function getMediaLimitPerDocument(siteSchema: SiteSchema, documentType: DocumentSchema): number | undefined;
|
|
17
|
-
export declare function getMediaLimitPerPart(siteSchema: SiteSchema, partType: PartSchema): number | undefined;
|
|
18
|
-
export declare function isFTextFieldType(fieldType: FieldType): fieldType is FTextFieldType;
|
|
19
|
-
export declare function documentTypeHasData(documentType: DocumentSchema): boolean;
|
|
9
|
+
siteSchema: ScSiteSchema;
|
|
10
|
+
}): ScDocumentType | undefined;
|
|
11
|
+
export declare function getMediaLimitPerDocument(siteSchema: ScSiteSchema, documentType: ScDocumentType): number | undefined;
|
|
12
|
+
export declare function getMediaLimitPerPart(siteSchema: ScSiteSchema, partType: ScPartType): number | undefined;
|
|
13
|
+
export declare function isFTextFieldType(fieldType: ScFieldType): fieldType is ScFTextFieldType;
|
|
14
|
+
export declare function documentTypeHasData(documentType: ScDocumentType): boolean;
|
|
@@ -1,61 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (!documentType)
|
|
7
|
-
throw new Error(`Unknown documentType for leafType '${leafType}'`);
|
|
8
|
-
return documentType;
|
|
9
|
-
}
|
|
10
|
-
exports.getDocumentTypeByLeafType = getDocumentTypeByLeafType;
|
|
11
|
-
function getPartTypeByLeafType(siteSchema, leafType) {
|
|
12
|
-
const partType = siteSchema.partTypes[leafType];
|
|
13
|
-
if (!partType)
|
|
14
|
-
throw new Error(`Unknown partType for leafType '${leafType}'`);
|
|
15
|
-
return partType;
|
|
16
|
-
}
|
|
17
|
-
exports.getPartTypeByLeafType = getPartTypeByLeafType;
|
|
18
|
-
function getRoutingPointDocumentTypes(siteSchema) {
|
|
19
|
-
return Object.values(siteSchema.documentTypes).filter((item) => item.kind === "routingPoint");
|
|
20
|
-
}
|
|
3
|
+
exports.getLeafTypeByName = getLeafTypeByName;
|
|
4
|
+
exports.getDocumentTypeByName = getDocumentTypeByName;
|
|
5
|
+
exports.getPartTypeByName = getPartTypeByName;
|
|
21
6
|
exports.getRoutingPointDocumentTypes = getRoutingPointDocumentTypes;
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
exports.regularChildDocumentTypesOf = regularChildDocumentTypesOf;
|
|
8
|
+
exports.getDocumentTypeByBoDirName = getDocumentTypeByBoDirName;
|
|
9
|
+
exports.getMediaLimitPerDocument = getMediaLimitPerDocument;
|
|
10
|
+
exports.getMediaLimitPerPart = getMediaLimitPerPart;
|
|
11
|
+
exports.isFTextFieldType = isFTextFieldType;
|
|
12
|
+
exports.documentTypeHasData = documentTypeHasData;
|
|
13
|
+
function getLeafTypeByName(siteSchema, typeName) {
|
|
14
|
+
const leafType = siteSchema.leafTypes[typeName];
|
|
15
|
+
if (!leafType)
|
|
16
|
+
throw new Error(`unknown leaf type '${typeName}'`);
|
|
17
|
+
return leafType;
|
|
24
18
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
for (const child of parent.children ?? []) {
|
|
30
|
-
const documentType = getDocumentTypeByLeafType(siteSchema, child);
|
|
31
|
-
if (documentType.kind !== "routingPoint") {
|
|
32
|
-
found.push(documentType);
|
|
33
|
-
}
|
|
19
|
+
function getDocumentTypeByName(siteSchema, typeName) {
|
|
20
|
+
const leafType = siteSchema.leafTypes[typeName];
|
|
21
|
+
if (!leafType || leafType.kind !== "document") {
|
|
22
|
+
throw new Error(`Unknown document type '${typeName}'`);
|
|
34
23
|
}
|
|
35
|
-
return
|
|
24
|
+
return leafType;
|
|
36
25
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
function getPartTypeByName(siteSchema, typeName) {
|
|
27
|
+
const leafType = siteSchema.leafTypes[typeName];
|
|
28
|
+
if (!leafType || leafType.kind !== "part") {
|
|
29
|
+
throw new Error(`Unknown part type '${typeName}'`);
|
|
30
|
+
}
|
|
31
|
+
return leafType;
|
|
41
32
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const foundDocumentType = Object.values(siteSchema.documentTypes).find((item) => item.children?.includes(leafType));
|
|
45
|
-
if (!foundDocumentType)
|
|
46
|
-
throw new Error(`Unknown parent documentType of leafType:'${leafType}'`);
|
|
47
|
-
return foundDocumentType;
|
|
33
|
+
function getRoutingPointDocumentTypes(siteSchema) {
|
|
34
|
+
return Object.values(siteSchema.leafTypes).filter((item) => item.kind === "document" && item.isRoutingPoint);
|
|
48
35
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return type;
|
|
36
|
+
function regularChildDocumentTypesOf(siteSchema, parentTypeName) {
|
|
37
|
+
return (getDocumentTypeByName(siteSchema, parentTypeName)
|
|
38
|
+
.children?.map((typeName) => getDocumentTypeByName(siteSchema, typeName))
|
|
39
|
+
.filter((leafType) => !leafType.isRoutingPoint) ?? []);
|
|
40
|
+
}
|
|
41
|
+
function getDocumentTypeByBoDirName({ boDirName, siteSchema, }) {
|
|
42
|
+
return Object.values(siteSchema.leafTypes).find((item) => item.kind === "document" && item.boDirName === boDirName);
|
|
57
43
|
}
|
|
58
|
-
exports.getLeafSchema = getLeafSchema;
|
|
59
44
|
function getMediaLimitPerDocument(siteSchema, documentType) {
|
|
60
45
|
const policyName = documentType.mediaPolicy;
|
|
61
46
|
if (policyName) {
|
|
@@ -65,7 +50,6 @@ function getMediaLimitPerDocument(siteSchema, documentType) {
|
|
|
65
50
|
}
|
|
66
51
|
return siteSchema.mediaPolicies.default.mediaLimitPerDocument;
|
|
67
52
|
}
|
|
68
|
-
exports.getMediaLimitPerDocument = getMediaLimitPerDocument;
|
|
69
53
|
function getMediaLimitPerPart(siteSchema, partType) {
|
|
70
54
|
const policyName = partType.mediaPolicy;
|
|
71
55
|
if (policyName) {
|
|
@@ -75,13 +59,10 @@ function getMediaLimitPerPart(siteSchema, partType) {
|
|
|
75
59
|
}
|
|
76
60
|
return siteSchema.mediaPolicies.default.mediaLimitPerPart;
|
|
77
61
|
}
|
|
78
|
-
exports.getMediaLimitPerPart = getMediaLimitPerPart;
|
|
79
62
|
function isFTextFieldType(fieldType) {
|
|
80
63
|
return fieldType.dataType === "quillDelta" || fieldType.dataType === "html";
|
|
81
64
|
}
|
|
82
|
-
exports.isFTextFieldType = isFTextFieldType;
|
|
83
65
|
function documentTypeHasData(documentType) {
|
|
84
|
-
return documentType.
|
|
66
|
+
return !documentType.isRoutingPoint || !documentType.redirectTo;
|
|
85
67
|
}
|
|
86
|
-
exports.documentTypeHasData = documentTypeHasData;
|
|
87
68
|
//# sourceMappingURL=site-schema-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-schema-helpers.js","sourceRoot":"","sources":["../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IAAI,GAAG,KAAK,SAAS;YAAE,OAAO,GAAG,CAAC;IACpC,CAAC;IACD,OAAO,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,iBAAiB,CAAC;AAC5D,CAAC;AAED,SAAgB,gBAAgB,CAAC,SAAsB;IACrD,OAAO,SAAS,CAAC,QAAQ,KAAK,YAAY,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM,CAAC;AAC9E,CAAC;AAED,SAAgB,mBAAmB,CAAC,YAA4B;IAC9D,OAAO,CAAC,YAAY,CAAC,cAAc,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;AAClE,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isSameTimeUnit = isSameTimeUnit;
|
|
4
|
+
exports.parseTimeWithUnit = parseTimeWithUnit;
|
|
4
5
|
function isSameTimeUnit(dt, timeUnit) {
|
|
5
6
|
const nowDay = new Date().toISOString().substring(0, 10);
|
|
6
7
|
const dtDay = dt.toISOString().substring(0, 10);
|
|
7
8
|
return nowDay === dtDay;
|
|
8
9
|
}
|
|
9
|
-
exports.isSameTimeUnit = isSameTimeUnit;
|
|
10
10
|
function parseTimeWithUnit(timeToIdle) {
|
|
11
11
|
if (!timeToIdle.endsWith("d"))
|
|
12
12
|
throw new Error(`invalid timeToIdle: '${timeToIdle}'`);
|
|
@@ -15,5 +15,4 @@ function parseTimeWithUnit(timeToIdle) {
|
|
|
15
15
|
delay: Number(timeToIdle.slice(0, -1)),
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
exports.parseTimeWithUnit = parseTimeWithUnit;
|
|
19
18
|
//# sourceMappingURL=time-with-unit.helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-with-unit.helpers.js","sourceRoot":"","sources":["../src/time-with-unit.helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"time-with-unit.helpers.js","sourceRoot":"","sources":["../src/time-with-unit.helpers.ts"],"names":[],"mappings":";;AAAA,wCAIC;AAOD,8CAMC;AAjBD,SAAgB,cAAc,CAAC,EAAQ,EAAE,QAAe;IACtD,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzD,MAAM,KAAK,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChD,OAAO,MAAM,KAAK,KAAK,CAAC;AAC1B,CAAC;AAOD,SAAgB,iBAAiB,CAAC,UAAkB;IAClD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,UAAU,GAAG,CAAC,CAAC;IACtF,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACvC,CAAC;AACJ,CAAC"}
|
package/dist-cjs/url-helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateSlug =
|
|
3
|
+
exports.generateSlug = generateSlug;
|
|
4
4
|
function generateSlug(str) {
|
|
5
5
|
return (str
|
|
6
6
|
.trim()
|
|
@@ -13,5 +13,4 @@ function generateSlug(str) {
|
|
|
13
13
|
.replace(/^-+/, "")
|
|
14
14
|
.toLowerCase());
|
|
15
15
|
}
|
|
16
|
-
exports.generateSlug = generateSlug;
|
|
17
16
|
//# sourceMappingURL=url-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-helpers.js","sourceRoot":"","sources":["../src/url-helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"url-helpers.js","sourceRoot":"","sources":["../src/url-helpers.ts"],"names":[],"mappings":";;AAAA,oCAaC;AAbD,SAAgB,YAAY,CAAC,GAAW;IACtC,OAAO,CACL,GAAG;SACA,IAAI,EAAE;SACN,SAAS,CAAC,KAAK,CAAC;QACjB,oEAAoE;SACnE,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,oBAAoB;SACpD,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC;SAC7B,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,WAAW,EAAE,CACjB,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function sortParts(listType:
|
|
1
|
+
import type { ScListType } from "@paroicms/public-anywhere-lib";
|
|
2
|
+
export declare function sortParts(listType: ScListType, list: any[]): void;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
1
|
+
import type { ScDocumentType, ScFTextFieldType, ScFieldType, ScLeafType, ScPartType, ScRegularDocumentType, ScRoutingPointDocumentType, ScSiteSchema } from "@paroicms/public-anywhere-lib";
|
|
2
|
+
export declare function getLeafTypeByName(siteSchema: ScSiteSchema, typeName: string): ScLeafType;
|
|
3
|
+
export declare function getDocumentTypeByName(siteSchema: ScSiteSchema, typeName: string): ScDocumentType;
|
|
4
|
+
export declare function getPartTypeByName(siteSchema: ScSiteSchema, typeName: string): ScPartType;
|
|
5
|
+
export declare function getRoutingPointDocumentTypes(siteSchema: ScSiteSchema): ScRoutingPointDocumentType[];
|
|
6
|
+
export declare function regularChildDocumentTypesOf(siteSchema: ScSiteSchema, parentTypeName: string): ScRegularDocumentType[];
|
|
7
7
|
export declare function getDocumentTypeByBoDirName({ boDirName, siteSchema, }: {
|
|
8
8
|
boDirName: string;
|
|
9
|
-
siteSchema:
|
|
10
|
-
}):
|
|
11
|
-
export declare function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare function getLeafSchema(siteSchema: SiteSchema, leafType: string): LeafSchema;
|
|
16
|
-
export declare function getMediaLimitPerDocument(siteSchema: SiteSchema, documentType: DocumentSchema): number | undefined;
|
|
17
|
-
export declare function getMediaLimitPerPart(siteSchema: SiteSchema, partType: PartSchema): number | undefined;
|
|
18
|
-
export declare function isFTextFieldType(fieldType: FieldType): fieldType is FTextFieldType;
|
|
19
|
-
export declare function documentTypeHasData(documentType: DocumentSchema): boolean;
|
|
9
|
+
siteSchema: ScSiteSchema;
|
|
10
|
+
}): ScDocumentType | undefined;
|
|
11
|
+
export declare function getMediaLimitPerDocument(siteSchema: ScSiteSchema, documentType: ScDocumentType): number | undefined;
|
|
12
|
+
export declare function getMediaLimitPerPart(siteSchema: ScSiteSchema, partType: ScPartType): number | undefined;
|
|
13
|
+
export declare function isFTextFieldType(fieldType: ScFieldType): fieldType is ScFTextFieldType;
|
|
14
|
+
export declare function documentTypeHasData(documentType: ScDocumentType): boolean;
|
|
@@ -1,49 +1,33 @@
|
|
|
1
|
-
export function
|
|
2
|
-
const
|
|
3
|
-
if (!
|
|
4
|
-
throw new Error(`
|
|
5
|
-
return
|
|
1
|
+
export function getLeafTypeByName(siteSchema, typeName) {
|
|
2
|
+
const leafType = siteSchema.leafTypes[typeName];
|
|
3
|
+
if (!leafType)
|
|
4
|
+
throw new Error(`unknown leaf type '${typeName}'`);
|
|
5
|
+
return leafType;
|
|
6
|
+
}
|
|
7
|
+
export function getDocumentTypeByName(siteSchema, typeName) {
|
|
8
|
+
const leafType = siteSchema.leafTypes[typeName];
|
|
9
|
+
if (!leafType || leafType.kind !== "document") {
|
|
10
|
+
throw new Error(`Unknown document type '${typeName}'`);
|
|
11
|
+
}
|
|
12
|
+
return leafType;
|
|
6
13
|
}
|
|
7
|
-
export function
|
|
8
|
-
const
|
|
9
|
-
if (!
|
|
10
|
-
throw new Error(`Unknown
|
|
11
|
-
|
|
14
|
+
export function getPartTypeByName(siteSchema, typeName) {
|
|
15
|
+
const leafType = siteSchema.leafTypes[typeName];
|
|
16
|
+
if (!leafType || leafType.kind !== "part") {
|
|
17
|
+
throw new Error(`Unknown part type '${typeName}'`);
|
|
18
|
+
}
|
|
19
|
+
return leafType;
|
|
12
20
|
}
|
|
13
21
|
export function getRoutingPointDocumentTypes(siteSchema) {
|
|
14
|
-
return Object.values(siteSchema.
|
|
15
|
-
}
|
|
16
|
-
export function getClassicDocumentTypes(siteSchema) {
|
|
17
|
-
return Object.values(siteSchema.documentTypes).filter((item) => item.kind === "classic");
|
|
22
|
+
return Object.values(siteSchema.leafTypes).filter((item) => item.kind === "document" && item.isRoutingPoint);
|
|
18
23
|
}
|
|
19
|
-
export function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const documentType = getDocumentTypeByLeafType(siteSchema, child);
|
|
24
|
-
if (documentType.kind !== "routingPoint") {
|
|
25
|
-
found.push(documentType);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return found;
|
|
24
|
+
export function regularChildDocumentTypesOf(siteSchema, parentTypeName) {
|
|
25
|
+
return (getDocumentTypeByName(siteSchema, parentTypeName)
|
|
26
|
+
.children?.map((typeName) => getDocumentTypeByName(siteSchema, typeName))
|
|
27
|
+
.filter((leafType) => !leafType.isRoutingPoint) ?? []);
|
|
29
28
|
}
|
|
30
29
|
export function getDocumentTypeByBoDirName({ boDirName, siteSchema, }) {
|
|
31
|
-
|
|
32
|
-
return found;
|
|
33
|
-
}
|
|
34
|
-
export function getParentDocumentTypeOf({ leafType, siteSchema, }) {
|
|
35
|
-
const foundDocumentType = Object.values(siteSchema.documentTypes).find((item) => item.children?.includes(leafType));
|
|
36
|
-
if (!foundDocumentType)
|
|
37
|
-
throw new Error(`Unknown parent documentType of leafType:'${leafType}'`);
|
|
38
|
-
return foundDocumentType;
|
|
39
|
-
}
|
|
40
|
-
export function getLeafSchema(siteSchema, leafType) {
|
|
41
|
-
if (leafType === siteSchema.site.leafType)
|
|
42
|
-
return siteSchema.site;
|
|
43
|
-
const type = siteSchema.documentTypes[leafType] ?? siteSchema.partTypes[leafType];
|
|
44
|
-
if (!type)
|
|
45
|
-
throw new Error(`unknown leaf-type '${leafType}'`);
|
|
46
|
-
return type;
|
|
30
|
+
return Object.values(siteSchema.leafTypes).find((item) => item.kind === "document" && item.boDirName === boDirName);
|
|
47
31
|
}
|
|
48
32
|
export function getMediaLimitPerDocument(siteSchema, documentType) {
|
|
49
33
|
const policyName = documentType.mediaPolicy;
|
|
@@ -67,6 +51,6 @@ export function isFTextFieldType(fieldType) {
|
|
|
67
51
|
return fieldType.dataType === "quillDelta" || fieldType.dataType === "html";
|
|
68
52
|
}
|
|
69
53
|
export function documentTypeHasData(documentType) {
|
|
70
|
-
return documentType.
|
|
54
|
+
return !documentType.isRoutingPoint || !documentType.redirectTo;
|
|
71
55
|
}
|
|
72
56
|
//# sourceMappingURL=site-schema-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-schema-helpers.js","sourceRoot":"","sources":["../src/site-schema-helpers.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"site-schema-helpers.js","sourceRoot":"","sources":["../src/site-schema-helpers.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,iBAAiB,CAAC,UAAwB,EAAE,QAAgB;IAC1E,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,GAAG,CAAC,CAAC;IAClE,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,UAAwB,EAAE,QAA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|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"description": "Front lib for Paroi CMS.",
|
|
5
5
|
"author": "Paroi Team",
|
|
6
6
|
"keywords": [
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@paroi/data-formatters-lib": "~0.4.0",
|
|
32
|
-
"@paroicms/public-anywhere-lib": "0.
|
|
32
|
+
"@paroicms/public-anywhere-lib": "0.3.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"rimraf": "~6.0.1",
|
|
36
|
-
"typescript": "~5.4
|
|
36
|
+
"typescript": "~5.5.4",
|
|
37
37
|
"vitest": "~1.5.3"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|