@websolutespa/bom-core 0.0.1 → 0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @websolutespa/bom-core
2
2
 
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added: splat routes.
8
+ - Added: variants.
9
+
3
10
  ## 0.0.1
4
11
 
5
12
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -58,6 +58,7 @@ type ICategorized = {
58
58
  slug?: ILocalizedString | string;
59
59
  template?: string;
60
60
  title?: ILocalizedString | string;
61
+ useSplat?: boolean;
61
62
  };
62
63
 
63
64
  type IClassNameValue = string | boolean | number | null | undefined;
@@ -112,16 +113,17 @@ type IMeta = {
112
113
  };
113
114
 
114
115
  type IRoute = {
116
+ category: IEquatable | ICategory;
115
117
  id: string;
116
- market: string;
118
+ isDefault?: boolean;
117
119
  locale: string;
118
- category: IEquatable | ICategory;
120
+ market: string;
121
+ order?: number;
119
122
  page: IEquatable;
120
123
  schema: string;
121
124
  template?: string;
122
125
  title: string;
123
- isDefault?: boolean;
124
- order?: number;
126
+ useSplat?: boolean;
125
127
  };
126
128
  type IRouteLink = {
127
129
  href: string;
@@ -365,12 +367,15 @@ type Json = string | number | boolean | null | Json[] | {
365
367
  [key: string]: Json;
366
368
  };
367
369
  type ValueOf<T> = T[keyof T];
370
+ type LiteralUnion<T extends string | number> = T | Omit<T, T>;
368
371
  type PreviewData = string | false | object | undefined;
369
- type IContextParams = {
370
- id: string;
372
+ type IContextBaseParams = {
371
373
  market: string;
372
374
  locale: string;
373
375
  };
376
+ type IContextParams = IContextBaseParams & {
377
+ id: string;
378
+ };
374
379
  type StaticPropsContext<Q extends ParsedUrlQuery = ParsedUrlQuery, D extends PreviewData = PreviewData> = {
375
380
  params: Q;
376
381
  preview?: boolean;
@@ -379,7 +384,7 @@ type StaticPropsContext<Q extends ParsedUrlQuery = ParsedUrlQuery, D extends Pre
379
384
  locales?: string[];
380
385
  defaultLocale?: string;
381
386
  };
382
- type IStaticContext = StaticPropsContext<IContextParams>;
387
+ type IStaticContext<T extends {} = {}> = StaticPropsContext<IContextParams & T>;
383
388
  declare type NextApiRequestCookies = Partial<{
384
389
  [key: string]: string;
385
390
  }>;
@@ -397,10 +402,14 @@ type ServerSidePropsContext<Q extends ParsedUrlQuery = ParsedUrlQuery, D extends
397
402
  locales?: string[];
398
403
  defaultLocale?: string;
399
404
  };
400
- type IServerSideContext = ServerSidePropsContext<IContextParams>;
405
+ type IServerSideSplatContext<T extends {} = {}> = ServerSidePropsContext<IContextBaseParams & T>;
406
+ type IServerSideContext<T extends {} = {}> = ServerSidePropsContext<IContextParams & T>;
401
407
  type StateValue = StateValue[] | {
402
408
  [key: string]: StateValue;
403
- } | number | string | boolean | null | undefined;
409
+ } | number | string | boolean | null | undefined;
410
+ type IPartial<T> = {
411
+ [P in keyof T]?: Partial<T[P]>;
412
+ };
404
413
 
405
414
  declare function getClassNames(...props: Array<IClassName>): string;
406
415
 
@@ -471,4 +480,4 @@ declare function awaitAll(array: any, callback: (item: any, index: number) => Pr
471
480
  declare function merge(target: any, source: any): any;
472
481
  declare function deepCopy<T>(source: T): T;
473
482
 
474
- export { FetchRequestOptions, FetchService, FindParams, FindWhereParams, ICategorized, ICategory, ICategoryItem, IClassName, IClassNameCollection, IClassNameValue, ICollectionDescription, IConfig, IContextParams, IEntity, IEquatable, ILabel, ILayout, ILocale, ILocalizedString, IMarket, IMedia, IMediaType, IMemoryStore, IMenu, IMenuBase, IMenuCategory, IMenuCustom, IMenuGroup, IMenuItem, IMenuLink, IMenuPage, IMenuRoute, INamedEntity, IOption, IPackages, IPage, IPageRelation, IPageResult, IQuerable, IRoute, IRouteLink, IRouteParams, ISchema, ISerializedCollection, ISerializedStore, IServerSideContext, IStaticContext, IStore, ITemplate, ITitledEntity, IUndecoratedMenu, IUndecoratedMenuBase, IUndecoratedMenuCategory, IUndecoratedMenuCustom, IUndecoratedMenuGroup, IUndecoratedMenuItem, IUndecoratedMenuLink, IUndecoratedMenuPage, Json, JsonService, NextApiRequestCookies, Operator, PageProps, Pagination, PreviewData, QueryParams, SchemaType, ServerSidePropsContext, StateValue, StaticPropsContext, ValueOf, Where, WhereAndOr, WhereBase, WhereField, asEquatable, asServerProps, awaitAll, camelToSnakeCase, consoleWarn, deepCopy, deserializeKey, deserializeValue, getClassNames, getCollectionDescription, getIsDevelopment, httpDelete, httpFetch, httpGet, httpPatch, httpPost, httpPut, isBrowser, isDevelopment, isLocalizedString, isValidCollectionDescription, localizeItem, localizeValue, localizedToString, merge, qsDeserialize, qsSerialize, titleToSlug, toDisplayName, toFindParams, toPluralName, toTitleCase, toValidCollectionName, withSchema };
483
+ export { FetchRequestOptions, FetchService, FindParams, FindWhereParams, ICategorized, ICategory, ICategoryItem, IClassName, IClassNameCollection, IClassNameValue, ICollectionDescription, IConfig, IContextBaseParams, IContextParams, IEntity, IEquatable, ILabel, ILayout, ILocale, ILocalizedString, IMarket, IMedia, IMediaType, IMemoryStore, IMenu, IMenuBase, IMenuCategory, IMenuCustom, IMenuGroup, IMenuItem, IMenuLink, IMenuPage, IMenuRoute, INamedEntity, IOption, IPackages, IPage, IPageRelation, IPageResult, IPartial, IQuerable, IRoute, IRouteLink, IRouteParams, ISchema, ISerializedCollection, ISerializedStore, IServerSideContext, IServerSideSplatContext, IStaticContext, IStore, ITemplate, ITitledEntity, IUndecoratedMenu, IUndecoratedMenuBase, IUndecoratedMenuCategory, IUndecoratedMenuCustom, IUndecoratedMenuGroup, IUndecoratedMenuItem, IUndecoratedMenuLink, IUndecoratedMenuPage, Json, JsonService, LiteralUnion, NextApiRequestCookies, Operator, PageProps, Pagination, PreviewData, QueryParams, SchemaType, ServerSidePropsContext, StateValue, StaticPropsContext, ValueOf, Where, WhereAndOr, WhereBase, WhereField, asEquatable, asServerProps, awaitAll, camelToSnakeCase, consoleWarn, deepCopy, deserializeKey, deserializeValue, getClassNames, getCollectionDescription, getIsDevelopment, httpDelete, httpFetch, httpGet, httpPatch, httpPost, httpPut, isBrowser, isDevelopment, isLocalizedString, isValidCollectionDescription, localizeItem, localizeValue, localizedToString, merge, qsDeserialize, qsSerialize, titleToSlug, toDisplayName, toFindParams, toPluralName, toTitleCase, toValidCollectionName, withSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-core",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Core module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",