@websolutespa/bom-core 1.7.14 → 1.7.16
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 +7 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.js +7 -0
- package/dist/index.mjs +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -52,11 +52,14 @@ type DeepPartial<T> = T extends object ? {
|
|
|
52
52
|
type IPrettify<T> = {
|
|
53
53
|
[K in keyof T]: T[K];
|
|
54
54
|
} & {};
|
|
55
|
-
type IOverrideReturnValue<T, FromType, ToType> = T extends Record<string, unknown> ? IOverride<T, FromType, ToType
|
|
56
|
-
type IOverrideValue<T, FromType, ToType> = T extends FromType ? ToType : IOverrideReturnValue<T, FromType, ToType>;
|
|
55
|
+
type IOverrideReturnValue<T, FromType, ToType> = T extends Record<string, unknown> ? IPrettify<IOverride<T, FromType, ToType>> : T;
|
|
56
|
+
type IOverrideValue<T, FromType, ToType> = T extends FromType ? (keyof T extends keyof FromType ? ToType : IOverrideReturnValue<T, FromType, ToType>) : IOverrideReturnValue<T, FromType, ToType>;
|
|
57
57
|
type IOverride<T, FromType, ToType> = {
|
|
58
58
|
[Property in keyof T]: IOverrideValue<T[Property], FromType, ToType>;
|
|
59
59
|
};
|
|
60
|
+
type RequireAtLeastOne<T> = {
|
|
61
|
+
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
|
|
62
|
+
}[keyof T];
|
|
60
63
|
|
|
61
64
|
/**
|
|
62
65
|
* List of ISO 639 language codes (set 1)
|
|
@@ -66,7 +69,7 @@ type ILetter = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' |
|
|
|
66
69
|
type ILocaleId = `${ILetter}${ILetter}`;
|
|
67
70
|
type ILocalizedString = Partial<Record<ILocaleId, string>>;
|
|
68
71
|
type ILocalizable = string | ILocalizedString;
|
|
69
|
-
type ILocalized<T> = IOverride<T,
|
|
72
|
+
type ILocalized<T> = IPrettify<IOverride<T, ILocalizedString, string>>;
|
|
70
73
|
|
|
71
74
|
type ILegalNotice = {
|
|
72
75
|
id: string;
|
|
@@ -434,10 +437,15 @@ type IUndecoratedMenuBase = {
|
|
|
434
437
|
media?: IMedia;
|
|
435
438
|
type: string;
|
|
436
439
|
};
|
|
440
|
+
declare enum MenuCategoryStrategy {
|
|
441
|
+
Default = "default",// show hidden categories recursively,
|
|
442
|
+
ExcludeHidden = "exclude-hidden"
|
|
443
|
+
}
|
|
437
444
|
type IUndecoratedMenuCategory = Omit<IUndecoratedMenuBase, 'type'> & {
|
|
438
445
|
type: 'category';
|
|
439
446
|
category: string;
|
|
440
447
|
maxDepth?: number;
|
|
448
|
+
strategy?: MenuCategoryStrategy;
|
|
441
449
|
title?: ILocalizable;
|
|
442
450
|
};
|
|
443
451
|
type IUndecoratedMenuGroup = Omit<IUndecoratedMenuBase, 'type'> & {
|
|
@@ -1221,4 +1229,4 @@ declare function asServerProps(props: any): any;
|
|
|
1221
1229
|
declare function awaitAll(array: any, callback: (item: any, index: number) => Promise<any>): Promise<any[]>;
|
|
1222
1230
|
declare function merge(target: any, source: any): any;
|
|
1223
1231
|
|
|
1224
|
-
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, 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, 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, Json, JsonService, LiteralUnion, Logger, LoggerLevel, NextApiRequestCookies, Operator, PageProps, Pagination, PreviewData, Primitive, QueryParams, RedirectReason, RouteStrategy, SchemaType, ServerSidePropsContext, StaticPropsContext, User, UserRole, UserWithRoles, ValueOf, Where, WhereAndOr, WhereBase, WhereField, asCategoryId, asEquatable, asEquatableNumber, asEquatableString, asServerProps, asSortedOptions, awaitAll, camelToSnakeCase, cloneItem, collectFeatureTypes, collectOptions, collectRoutes, consoleWarn, deepMerge, defaultLocale, defaultMarket, eachCategorized, eachMarketLocale, 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, toCamelCase, toCharCase, toDisplayName, toFindParams, toKebabCase, toPascalCase, toPluralName, toSnakeCase, toTitleCase, toValidCollectionName, unknownCaseToPascalCase, uuidv4, withSchema };
|
|
1232
|
+
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, 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, 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, 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, asCategoryId, asEquatable, asEquatableNumber, asEquatableString, asServerProps, asSortedOptions, awaitAll, camelToSnakeCase, cloneItem, collectFeatureTypes, collectOptions, collectRoutes, consoleWarn, deepMerge, defaultLocale, defaultMarket, eachCategorized, eachMarketLocale, 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, toCamelCase, toCharCase, toDisplayName, toFindParams, toKebabCase, toPascalCase, toPluralName, toSnakeCase, toTitleCase, toValidCollectionName, unknownCaseToPascalCase, uuidv4, withSchema };
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(src_exports, {
|
|
|
33
33
|
JsonService: () => JsonService,
|
|
34
34
|
Logger: () => Logger,
|
|
35
35
|
LoggerLevel: () => LoggerLevel,
|
|
36
|
+
MenuCategoryStrategy: () => MenuCategoryStrategy,
|
|
36
37
|
RedirectReason: () => RedirectReason,
|
|
37
38
|
RouteStrategy: () => RouteStrategy,
|
|
38
39
|
asCategoryId: () => asCategoryId,
|
|
@@ -1441,6 +1442,11 @@ function isMediaPdf(media) {
|
|
|
1441
1442
|
function isMenuHref(item) {
|
|
1442
1443
|
return ["category", "link", "page", "route"].includes(item.type);
|
|
1443
1444
|
}
|
|
1445
|
+
var MenuCategoryStrategy = /* @__PURE__ */ ((MenuCategoryStrategy2) => {
|
|
1446
|
+
MenuCategoryStrategy2["Default"] = "default";
|
|
1447
|
+
MenuCategoryStrategy2["ExcludeHidden"] = "exclude-hidden";
|
|
1448
|
+
return MenuCategoryStrategy2;
|
|
1449
|
+
})(MenuCategoryStrategy || {});
|
|
1444
1450
|
|
|
1445
1451
|
// src/types/querable.ts
|
|
1446
1452
|
function toFindParams(idOrParams) {
|
|
@@ -1465,6 +1471,7 @@ var RedirectReason = /* @__PURE__ */ ((RedirectReason2) => {
|
|
|
1465
1471
|
JsonService,
|
|
1466
1472
|
Logger,
|
|
1467
1473
|
LoggerLevel,
|
|
1474
|
+
MenuCategoryStrategy,
|
|
1468
1475
|
RedirectReason,
|
|
1469
1476
|
RouteStrategy,
|
|
1470
1477
|
asCategoryId,
|
package/dist/index.mjs
CHANGED
|
@@ -1302,6 +1302,11 @@ function isMediaPdf(media) {
|
|
|
1302
1302
|
function isMenuHref(item) {
|
|
1303
1303
|
return ["category", "link", "page", "route"].includes(item.type);
|
|
1304
1304
|
}
|
|
1305
|
+
var MenuCategoryStrategy = /* @__PURE__ */ ((MenuCategoryStrategy2) => {
|
|
1306
|
+
MenuCategoryStrategy2["Default"] = "default";
|
|
1307
|
+
MenuCategoryStrategy2["ExcludeHidden"] = "exclude-hidden";
|
|
1308
|
+
return MenuCategoryStrategy2;
|
|
1309
|
+
})(MenuCategoryStrategy || {});
|
|
1305
1310
|
|
|
1306
1311
|
// src/types/querable.ts
|
|
1307
1312
|
function toFindParams(idOrParams) {
|
|
@@ -1325,6 +1330,7 @@ export {
|
|
|
1325
1330
|
JsonService,
|
|
1326
1331
|
Logger,
|
|
1327
1332
|
LoggerLevel,
|
|
1333
|
+
MenuCategoryStrategy,
|
|
1328
1334
|
RedirectReason,
|
|
1329
1335
|
RouteStrategy,
|
|
1330
1336
|
asCategoryId,
|