@websolutespa/bom-core 1.8.8 → 1.8.10
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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +13 -2
- package/dist/index.js +25 -0
- package/dist/index.mjs +20 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -450,6 +450,7 @@ type IMenuCategory = IMenuBase & {
|
|
|
450
450
|
type: 'category';
|
|
451
451
|
href: string;
|
|
452
452
|
category: IEquatable;
|
|
453
|
+
customTitle?: ILocalizable;
|
|
453
454
|
};
|
|
454
455
|
type IMenuGroup = IMenuBase & {
|
|
455
456
|
type: 'group';
|
|
@@ -470,6 +471,7 @@ type IMenuPage = IMenuBase & {
|
|
|
470
471
|
href: string;
|
|
471
472
|
page: IEquatable;
|
|
472
473
|
schema: string;
|
|
474
|
+
customTitle?: ILocalizable;
|
|
473
475
|
};
|
|
474
476
|
type IMenuCustom = Record<string, unknown> & {
|
|
475
477
|
id: IEquatable;
|
|
@@ -478,10 +480,19 @@ type IMenuCustom = Record<string, unknown> & {
|
|
|
478
480
|
type IMenuItem = IMenuCategory | IMenuGroup | IMenuLink | IMenuPage | IMenuRoute;
|
|
479
481
|
type IMenuHref = IMenuCategory | IMenuLink | IMenuPage | IMenuRoute;
|
|
480
482
|
declare function isMenuHref(item: IMenuItem): item is IMenuHref;
|
|
483
|
+
declare function isMenuCategory(item: IMenuItem): item is IMenuCategory;
|
|
484
|
+
declare function isMenuGroup(item: IMenuItem): item is IMenuGroup;
|
|
485
|
+
declare function isMenuLink(item: IMenuItem): item is IMenuLink;
|
|
486
|
+
declare function isMenuPage(item: IMenuItem): item is IMenuPage;
|
|
487
|
+
declare function isMenuRoute(item: IMenuItem): item is IMenuRoute;
|
|
481
488
|
type IMenu = {
|
|
482
489
|
id: string;
|
|
483
490
|
items: IMenuItem[];
|
|
484
491
|
};
|
|
492
|
+
type ILocalizedMenu = {
|
|
493
|
+
id: string;
|
|
494
|
+
items: ILocalized<IMenuItem>[];
|
|
495
|
+
};
|
|
485
496
|
/**
|
|
486
497
|
* this is the original menu model from cms
|
|
487
498
|
*/
|
|
@@ -537,7 +548,7 @@ type ILayout = {
|
|
|
537
548
|
locales: ILocale[];
|
|
538
549
|
market: string;
|
|
539
550
|
markets: IMarket[];
|
|
540
|
-
menu: Record<string,
|
|
551
|
+
menu: Record<string, ILocalizedMenu>;
|
|
541
552
|
topLevelHrefs: Record<string, string>;
|
|
542
553
|
topLevelRoutes: Record<string, IRouteLink>;
|
|
543
554
|
tree?: IRouteLink;
|
|
@@ -1300,4 +1311,4 @@ declare function asServerProps(props: any): any;
|
|
|
1300
1311
|
declare function awaitAll(array: any, callback: (item: any, index: number) => Promise<any>): Promise<any[]>;
|
|
1301
1312
|
declare function merge(target: any, source: any): any;
|
|
1302
1313
|
|
|
1303
|
-
export { DeepPartial, Dynamic, FetchError, FetchRequestOptions, FetchService, FindParams, FindWhereParams, IAction, IActionEmailData, IAnchor, ICategorized, ICategory, ICategoryItem, IClassName, IClassNameCollection, IClassNameValue, ICollectionDescription, IComponent, IConfig, IConsentPreference, IContextBaseParams, IContextParams, IDecoratedNav, IEmailConfig, IEndUser, IEntity, IEquatable, IFeature, IFeatureType, IImageResize, ILabel, ILayout, ILegalNotice, ILetter, ILocale, ILocaleId, ILocalizable, ILocalized, ILocalizedString, IMarket, IMedia, IMediaImage, IMediaInfo, IMediaJson, IMediaPdf, IMediaType, IMediaVideo, IMemoryStore, IMenu, IMenuBase, IMenuCategory, IMenuCustom, IMenuGroup, IMenuHref, IMenuItem, IMenuLink, IMenuPage, IMenuRoute, INamedEntity, IOption, IOverride, IOverrideReturnValue, IOverrideValue, IPackages, IPage, IPageItem, IPageRelation, IPageRelationResult, IPageUnresolvedRelation, IPagedResult, IPaginationResult, IPartial, IPreference, IPrettify, IQuerable, IRedirect, IRoute, IRouteCanonical, IRouteLink, IRouteParams, ISchema, ISerializedCollection, ISerializedStore, IServerSideContext, IServerSideSplatContext, IStaticContext, IStore, ITemplate, ITitledEntity, IUndecoratedMenu, IUndecoratedMenuBase, IUndecoratedMenuCategory, IUndecoratedMenuCustom, IUndecoratedMenuGroup, IUndecoratedMenuItem, IUndecoratedMenuLink, IUndecoratedMenuPage, IUndecoratedNav, ImageStrategy, Json, JsonService, LiteralUnion, Logger, LoggerLevel, MenuCategoryStrategy, NextApiRequestCookies, Operator, PageProps, Pagination, PreviewData, Primitive, QueryParams, RedirectReason, RequireAtLeastOne, RouteStrategy, SchemaType, ServerSidePropsContext, StaticPropsContext, User, UserRole, UserWithRoles, ValueOf, Where, WhereAndOr, WhereBase, WhereField, arrayShuffle, asCategoryId, asEntityId, asEquatable, asEquatableNumber, asEquatableString, asServerProps, asSortedOptions, awaitAll, base64ToString, camelToSnakeCase, cloneItem, collectFeatureTypes, collectFeatureTypes__, collectOptions, collectRoutes, consoleWarn, decryptImageResize, deepMerge, defaultLocale, defaultMarket, eachCategorized, eachMarketLocale, encryptImageToken, enumToList, findCategoryInCategories, findChildCategories, findRouteOfCategory, findRoutesOfCategory, getCategorySegments, getCategorySegmentsByCategory, getClassNames, getCollectionDescription, getEnv, getHost, getIsDevelopment, getIsProduction, getOrigin, getParentCategoriesById, getParentCategory, getProto, getRootCategory, getRouteHref, httpDelete, httpFetch, httpGet, httpPatch, httpPost, httpPut, isArray, isBrowser, isDevelopment, isEntity, isEquatable, isHeaders, isIncomingHttpHeaders, isLocalizedString, isMediaImage, isMediaJson, isMediaPdf, isMediaVideo, isMenuHref, isNotNullString, isNumber, isObject, isProduction, isPromise, isRelation, isReservedCollectionDescription, isStage, isString, isUndecoratedMenuCategory, isUndecoratedMenuItem, isUndecoratedMenuPage, isUndecoratedNav, isUnresolvedRelation, isValidCollectionDescription, isValidString, localize, localizeItem, localizeValue, localizedToString, merge, pascalCaseToCamelCase, pascalCaseToCharCase, pascalCaseToKebabCase, pascalCaseToSnakeCase, qsDeserialize, qsDeserializeRaw, qsSerialize, qsSerializeRaw, resolveMediaType, stringToBase64, toCamelCase, toCharCase, toDisplayName, toFindParams, toKebabCase, toPascalCase, toPluralName, toSnakeCase, toTitleCase, toValidCollectionName, unknownCaseToPascalCase, uuidv4, withSchema };
|
|
1314
|
+
export { DeepPartial, Dynamic, FetchError, FetchRequestOptions, FetchService, FindParams, FindWhereParams, IAction, IActionEmailData, IAnchor, ICategorized, ICategory, ICategoryItem, IClassName, IClassNameCollection, IClassNameValue, ICollectionDescription, IComponent, IConfig, IConsentPreference, IContextBaseParams, IContextParams, IDecoratedNav, IEmailConfig, IEndUser, IEntity, IEquatable, IFeature, IFeatureType, IImageResize, ILabel, ILayout, ILegalNotice, ILetter, ILocale, ILocaleId, ILocalizable, ILocalized, ILocalizedMenu, ILocalizedString, IMarket, IMedia, IMediaImage, IMediaInfo, IMediaJson, IMediaPdf, IMediaType, IMediaVideo, IMemoryStore, IMenu, IMenuBase, IMenuCategory, IMenuCustom, IMenuGroup, IMenuHref, IMenuItem, IMenuLink, IMenuPage, IMenuRoute, INamedEntity, IOption, IOverride, IOverrideReturnValue, IOverrideValue, IPackages, IPage, IPageItem, IPageRelation, IPageRelationResult, IPageUnresolvedRelation, IPagedResult, IPaginationResult, IPartial, IPreference, IPrettify, IQuerable, IRedirect, IRoute, IRouteCanonical, IRouteLink, IRouteParams, ISchema, ISerializedCollection, ISerializedStore, IServerSideContext, IServerSideSplatContext, IStaticContext, IStore, ITemplate, ITitledEntity, IUndecoratedMenu, IUndecoratedMenuBase, IUndecoratedMenuCategory, IUndecoratedMenuCustom, IUndecoratedMenuGroup, IUndecoratedMenuItem, IUndecoratedMenuLink, IUndecoratedMenuPage, IUndecoratedNav, ImageStrategy, Json, JsonService, LiteralUnion, Logger, LoggerLevel, MenuCategoryStrategy, NextApiRequestCookies, Operator, PageProps, Pagination, PreviewData, Primitive, QueryParams, RedirectReason, RequireAtLeastOne, RouteStrategy, SchemaType, ServerSidePropsContext, StaticPropsContext, User, UserRole, UserWithRoles, ValueOf, Where, WhereAndOr, WhereBase, WhereField, arrayShuffle, asCategoryId, asEntityId, asEquatable, asEquatableNumber, asEquatableString, asServerProps, asSortedOptions, awaitAll, base64ToString, camelToSnakeCase, cloneItem, collectFeatureTypes, collectFeatureTypes__, collectOptions, collectRoutes, consoleWarn, decryptImageResize, deepMerge, defaultLocale, defaultMarket, eachCategorized, eachMarketLocale, encryptImageToken, enumToList, findCategoryInCategories, findChildCategories, findRouteOfCategory, findRoutesOfCategory, getCategorySegments, getCategorySegmentsByCategory, getClassNames, getCollectionDescription, getEnv, getHost, getIsDevelopment, getIsProduction, getOrigin, getParentCategoriesById, getParentCategory, getProto, getRootCategory, getRouteHref, httpDelete, httpFetch, httpGet, httpPatch, httpPost, httpPut, isArray, isBrowser, isDevelopment, isEntity, isEquatable, isHeaders, isIncomingHttpHeaders, isLocalizedString, isMediaImage, isMediaJson, isMediaPdf, isMediaVideo, isMenuCategory, isMenuGroup, isMenuHref, isMenuLink, isMenuPage, isMenuRoute, isNotNullString, isNumber, isObject, isProduction, isPromise, isRelation, isReservedCollectionDescription, isStage, isString, isUndecoratedMenuCategory, isUndecoratedMenuItem, isUndecoratedMenuPage, isUndecoratedNav, isUnresolvedRelation, isValidCollectionDescription, isValidString, localize, localizeItem, localizeValue, localizedToString, merge, pascalCaseToCamelCase, pascalCaseToCharCase, pascalCaseToKebabCase, pascalCaseToSnakeCase, qsDeserialize, qsDeserializeRaw, qsSerialize, qsSerializeRaw, resolveMediaType, stringToBase64, toCamelCase, toCharCase, toDisplayName, toFindParams, toKebabCase, toPascalCase, toPluralName, toSnakeCase, toTitleCase, toValidCollectionName, unknownCaseToPascalCase, uuidv4, withSchema };
|
package/dist/index.js
CHANGED
|
@@ -98,7 +98,12 @@ __export(src_exports, {
|
|
|
98
98
|
isMediaJson: () => isMediaJson,
|
|
99
99
|
isMediaPdf: () => isMediaPdf,
|
|
100
100
|
isMediaVideo: () => isMediaVideo,
|
|
101
|
+
isMenuCategory: () => isMenuCategory,
|
|
102
|
+
isMenuGroup: () => isMenuGroup,
|
|
101
103
|
isMenuHref: () => isMenuHref,
|
|
104
|
+
isMenuLink: () => isMenuLink,
|
|
105
|
+
isMenuPage: () => isMenuPage,
|
|
106
|
+
isMenuRoute: () => isMenuRoute,
|
|
102
107
|
isNotNullString: () => isNotNullString,
|
|
103
108
|
isNumber: () => isNumber,
|
|
104
109
|
isObject: () => isObject,
|
|
@@ -1560,6 +1565,21 @@ function isMediaPdf(media) {
|
|
|
1560
1565
|
function isMenuHref(item) {
|
|
1561
1566
|
return ["category", "link", "page", "route"].includes(item.type);
|
|
1562
1567
|
}
|
|
1568
|
+
function isMenuCategory(item) {
|
|
1569
|
+
return item.type === "category";
|
|
1570
|
+
}
|
|
1571
|
+
function isMenuGroup(item) {
|
|
1572
|
+
return item.type === "group";
|
|
1573
|
+
}
|
|
1574
|
+
function isMenuLink(item) {
|
|
1575
|
+
return item.type === "link";
|
|
1576
|
+
}
|
|
1577
|
+
function isMenuPage(item) {
|
|
1578
|
+
return item.type === "page";
|
|
1579
|
+
}
|
|
1580
|
+
function isMenuRoute(item) {
|
|
1581
|
+
return item.type === "route";
|
|
1582
|
+
}
|
|
1563
1583
|
var MenuCategoryStrategy = /* @__PURE__ */ ((MenuCategoryStrategy2) => {
|
|
1564
1584
|
MenuCategoryStrategy2["Default"] = "default";
|
|
1565
1585
|
MenuCategoryStrategy2["ExcludeHidden"] = "exclude-hidden";
|
|
@@ -1654,7 +1674,12 @@ var RedirectReason = /* @__PURE__ */ ((RedirectReason2) => {
|
|
|
1654
1674
|
isMediaJson,
|
|
1655
1675
|
isMediaPdf,
|
|
1656
1676
|
isMediaVideo,
|
|
1677
|
+
isMenuCategory,
|
|
1678
|
+
isMenuGroup,
|
|
1657
1679
|
isMenuHref,
|
|
1680
|
+
isMenuLink,
|
|
1681
|
+
isMenuPage,
|
|
1682
|
+
isMenuRoute,
|
|
1658
1683
|
isNotNullString,
|
|
1659
1684
|
isNumber,
|
|
1660
1685
|
isObject,
|
package/dist/index.mjs
CHANGED
|
@@ -1412,6 +1412,21 @@ function isMediaPdf(media) {
|
|
|
1412
1412
|
function isMenuHref(item) {
|
|
1413
1413
|
return ["category", "link", "page", "route"].includes(item.type);
|
|
1414
1414
|
}
|
|
1415
|
+
function isMenuCategory(item) {
|
|
1416
|
+
return item.type === "category";
|
|
1417
|
+
}
|
|
1418
|
+
function isMenuGroup(item) {
|
|
1419
|
+
return item.type === "group";
|
|
1420
|
+
}
|
|
1421
|
+
function isMenuLink(item) {
|
|
1422
|
+
return item.type === "link";
|
|
1423
|
+
}
|
|
1424
|
+
function isMenuPage(item) {
|
|
1425
|
+
return item.type === "page";
|
|
1426
|
+
}
|
|
1427
|
+
function isMenuRoute(item) {
|
|
1428
|
+
return item.type === "route";
|
|
1429
|
+
}
|
|
1415
1430
|
var MenuCategoryStrategy = /* @__PURE__ */ ((MenuCategoryStrategy2) => {
|
|
1416
1431
|
MenuCategoryStrategy2["Default"] = "default";
|
|
1417
1432
|
MenuCategoryStrategy2["ExcludeHidden"] = "exclude-hidden";
|
|
@@ -1505,7 +1520,12 @@ export {
|
|
|
1505
1520
|
isMediaJson,
|
|
1506
1521
|
isMediaPdf,
|
|
1507
1522
|
isMediaVideo,
|
|
1523
|
+
isMenuCategory,
|
|
1524
|
+
isMenuGroup,
|
|
1508
1525
|
isMenuHref,
|
|
1526
|
+
isMenuLink,
|
|
1527
|
+
isMenuPage,
|
|
1528
|
+
isMenuRoute,
|
|
1509
1529
|
isNotNullString,
|
|
1510
1530
|
isNumber,
|
|
1511
1531
|
isObject,
|