@merkaly/api 0.30.0 → 0.30.1

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.
@@ -9,6 +9,9 @@ export declare abstract class AppSchemas {
9
9
  customers: string;
10
10
  vendors: string;
11
11
  };
12
+ static get content(): {
13
+ pages: string;
14
+ };
12
15
  static get finance(): {
13
16
  payments: string;
14
17
  subscriptions: string;
@@ -0,0 +1,36 @@
1
+ import type { ContentFeatureIconEnum, ContentProductsSourceEnum } from './page.enum.js';
2
+ export interface ContentImage {
3
+ key: string;
4
+ url: string;
5
+ }
6
+ export interface ContentAction {
7
+ label?: string;
8
+ url?: string;
9
+ }
10
+ export interface ContentBannerBlock {
11
+ action?: ContentAction;
12
+ enabled?: boolean;
13
+ image?: ContentImage;
14
+ subtitle?: string;
15
+ title?: string;
16
+ }
17
+ export interface ContentProductsBlock {
18
+ category?: string;
19
+ enabled?: boolean;
20
+ products?: string[];
21
+ source?: ContentProductsSourceEnum;
22
+ title?: string;
23
+ }
24
+ export interface ContentFeatureItem {
25
+ icon: ContentFeatureIconEnum;
26
+ text: string;
27
+ title: string;
28
+ }
29
+ export interface ContentFeaturesBlock {
30
+ enabled?: boolean;
31
+ items?: ContentFeatureItem[];
32
+ }
33
+ export interface ContentBrandsBlock {
34
+ brands?: string[];
35
+ enabled?: boolean;
36
+ }
@@ -0,0 +1,16 @@
1
+ import type { ContentBannerBlock, ContentBrandsBlock, ContentFeaturesBlock, ContentProductsBlock } from './blocks.types.js';
2
+ export interface ContentHomePage {
3
+ brands?: ContentBrandsBlock;
4
+ features?: ContentFeaturesBlock;
5
+ hero?: ContentBannerBlock;
6
+ newArrivals?: ContentProductsBlock & {
7
+ banner?: ContentBannerBlock;
8
+ };
9
+ offers?: ContentProductsBlock & {
10
+ endsAt?: Date;
11
+ };
12
+ sale?: ContentBannerBlock & {
13
+ code?: string;
14
+ };
15
+ trending?: ContentProductsBlock;
16
+ }
@@ -0,0 +1,5 @@
1
+ export * from './page.enum';
2
+ export * from './page.entity';
3
+ export * from './blocks.types';
4
+ export * from './home.page.types';
5
+ export * from './page.types';
@@ -0,0 +1 @@
1
+ export * from './page.enum.js';
@@ -0,0 +1,5 @@
1
+ import { AbstractEntity } from '../../abstract.entity.js';
2
+ export declare class ContentPageEntity<V = unknown> extends AbstractEntity {
3
+ _id: string;
4
+ value: V;
5
+ }
@@ -0,0 +1,28 @@
1
+ export declare enum ContentPageEnum {
2
+ HOME = "home"
3
+ }
4
+ export declare enum ContentProductsSourceEnum {
5
+ CATEGORY = "category",
6
+ LATEST = "latest",
7
+ MANUAL = "manual"
8
+ }
9
+ export declare enum ContentPageImageEnum {
10
+ HERO = "hero",
11
+ NEW_ARRIVALS = "new-arrivals",
12
+ SALE = "sale"
13
+ }
14
+ export declare enum ContentFeatureIconEnum {
15
+ AWARD = "award",
16
+ CHAT = "chat",
17
+ CREDIT_CARD = "credit-card",
18
+ DELIVERY = "delivery",
19
+ GIFT = "gift",
20
+ HEADPHONES = "headphones",
21
+ LOCK = "lock",
22
+ PACKAGE = "package",
23
+ PERCENT = "percent",
24
+ REFRESH_CW = "refresh-cw",
25
+ SHIELD = "shield",
26
+ TAG = "tag",
27
+ TRUCK = "truck"
28
+ }
@@ -0,0 +1,32 @@
1
+ export var ContentPageEnum;
2
+ (function (ContentPageEnum) {
3
+ ContentPageEnum["HOME"] = "home";
4
+ })(ContentPageEnum || (ContentPageEnum = {}));
5
+ export var ContentProductsSourceEnum;
6
+ (function (ContentProductsSourceEnum) {
7
+ ContentProductsSourceEnum["CATEGORY"] = "category";
8
+ ContentProductsSourceEnum["LATEST"] = "latest";
9
+ ContentProductsSourceEnum["MANUAL"] = "manual";
10
+ })(ContentProductsSourceEnum || (ContentProductsSourceEnum = {}));
11
+ export var ContentPageImageEnum;
12
+ (function (ContentPageImageEnum) {
13
+ ContentPageImageEnum["HERO"] = "hero";
14
+ ContentPageImageEnum["NEW_ARRIVALS"] = "new-arrivals";
15
+ ContentPageImageEnum["SALE"] = "sale";
16
+ })(ContentPageImageEnum || (ContentPageImageEnum = {}));
17
+ export var ContentFeatureIconEnum;
18
+ (function (ContentFeatureIconEnum) {
19
+ ContentFeatureIconEnum["AWARD"] = "award";
20
+ ContentFeatureIconEnum["CHAT"] = "chat";
21
+ ContentFeatureIconEnum["CREDIT_CARD"] = "credit-card";
22
+ ContentFeatureIconEnum["DELIVERY"] = "delivery";
23
+ ContentFeatureIconEnum["GIFT"] = "gift";
24
+ ContentFeatureIconEnum["HEADPHONES"] = "headphones";
25
+ ContentFeatureIconEnum["LOCK"] = "lock";
26
+ ContentFeatureIconEnum["PACKAGE"] = "package";
27
+ ContentFeatureIconEnum["PERCENT"] = "percent";
28
+ ContentFeatureIconEnum["REFRESH_CW"] = "refresh-cw";
29
+ ContentFeatureIconEnum["SHIELD"] = "shield";
30
+ ContentFeatureIconEnum["TAG"] = "tag";
31
+ ContentFeatureIconEnum["TRUCK"] = "truck";
32
+ })(ContentFeatureIconEnum || (ContentFeatureIconEnum = {}));
@@ -0,0 +1,21 @@
1
+ import type { CatalogBrandEntity } from '../../inventory/catalog/brand';
2
+ import type { CatalogProductEntity } from '../../inventory/catalog/product';
3
+ import type { ContentPageEnum } from './page.enum.js';
4
+ import type { ContentHomePage } from './home.page.types.js';
5
+ export interface ContentPageValues {
6
+ [ContentPageEnum.HOME]: ContentHomePage;
7
+ }
8
+ export type ContentPageKey = keyof ContentPageValues;
9
+ type WithItems<B, I> = B & {
10
+ items: I[];
11
+ };
12
+ export interface ContentStoreHomePage extends Omit<ContentHomePage, 'brands' | 'newArrivals' | 'offers' | 'trending'> {
13
+ brands?: WithItems<ContentHomePage['brands'], CatalogBrandEntity>;
14
+ newArrivals: WithItems<ContentHomePage['newArrivals'], CatalogProductEntity>;
15
+ offers: WithItems<ContentHomePage['offers'], CatalogProductEntity>;
16
+ trending: WithItems<ContentHomePage['trending'], CatalogProductEntity>;
17
+ }
18
+ export interface ContentStorePageValues {
19
+ [ContentPageEnum.HOME]: ContentStoreHomePage;
20
+ }
21
+ export {};
package/dist/index.d.ts CHANGED
@@ -30,6 +30,7 @@ export * from './logistics/shipment';
30
30
  export * from './order/purchase';
31
31
  export * from './order/sale';
32
32
  export * from './order/item';
33
+ export * from './content/page';
33
34
  export * from './settings/organization';
34
35
  export * from './settings/authentication';
35
36
  export type { SaveEntityArgs } from './repository.types';
package/dist/index.js CHANGED
@@ -21,5 +21,6 @@ export * from './logistics/shipment/index.js';
21
21
  export * from './order/purchase/index.js';
22
22
  export * from './order/sale/index.js';
23
23
  export * from './order/item/index.js';
24
+ export * from './content/page/index.js';
24
25
  export * from './settings/organization/index.js';
25
26
  export * from './settings/authentication/index.js';
@@ -215,7 +215,8 @@ __decorate([
215
215
  __metadata("design:type", String)
216
216
  ], UpdateOrganizationBrandingRequestValidator.prototype, "description", void 0);
217
217
  __decorate([
218
- (0, class_validator_1.Matches)(/^(#[0-9a-f]{6})?$/i, { message: '$property must be a #RRGGBB color' }),
218
+ (0, class_validator_1.IsHexColor)(),
219
+ (0, class_validator_1.ValidateIf)((_, value) => value !== ''),
219
220
  (0, class_validator_1.IsOptional)(),
220
221
  __metadata("design:type", String)
221
222
  ], UpdateOrganizationBrandingRequestValidator.prototype, "primaryColor", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "type": "module",
5
5
  "description": "Shared TypeScript interfaces and enums for Merkaly API",
6
6
  "repository": {