@nguyentrungkien/shared 2.0.14 → 2.0.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.
@@ -1,7 +1,10 @@
1
- export var flashSaleStatus;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flashSaleStatus = void 0;
4
+ var flashSaleStatus;
2
5
  (function (flashSaleStatus) {
3
6
  flashSaleStatus["SCHEDULE"] = "SCHEDULE";
4
7
  flashSaleStatus["ACTIVE"] = "ACTIVE";
5
8
  flashSaleStatus["ENDED"] = "ENDED";
6
9
  flashSaleStatus["CANCELLED"] = "CANCELLED";
7
- })(flashSaleStatus || (flashSaleStatus = {}));
10
+ })(flashSaleStatus || (exports.flashSaleStatus = flashSaleStatus = {}));
@@ -1,6 +1,6 @@
1
- export * from "./user-role.enum.js";
2
- export * from "./order.enum.js";
3
- export * from "./payment.enum.js";
4
- export * from "./shipping.enum.js";
5
- export * from "./vouccher.enum.js";
6
- export * from "./flashsale.enum.js";
1
+ export * from "./user-role.enum";
2
+ export * from "./order.enum";
3
+ export * from "./payment.enum";
4
+ export * from "./shipping.enum";
5
+ export * from "./vouccher.enum";
6
+ export * from "./flashsale.enum";
@@ -1,6 +1,22 @@
1
- export * from "./user-role.enum.js";
2
- export * from "./order.enum.js";
3
- export * from "./payment.enum.js";
4
- export * from "./shipping.enum.js";
5
- export * from "./vouccher.enum.js";
6
- export * from "./flashsale.enum.js";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./user-role.enum"), exports);
18
+ __exportStar(require("./order.enum"), exports);
19
+ __exportStar(require("./payment.enum"), exports);
20
+ __exportStar(require("./shipping.enum"), exports);
21
+ __exportStar(require("./vouccher.enum"), exports);
22
+ __exportStar(require("./flashsale.enum"), exports);
@@ -1,4 +1,7 @@
1
- export var OrderStatus;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CancelReasonType = exports.PaymentMethod = exports.OrderStatus = void 0;
4
+ var OrderStatus;
2
5
  (function (OrderStatus) {
3
6
  OrderStatus["PENDING"] = "pending";
4
7
  OrderStatus["CONFIRMED"] = "confirmed";
@@ -6,18 +9,18 @@ export var OrderStatus;
6
9
  OrderStatus["COMPLETED"] = "completed";
7
10
  OrderStatus["CANCELLED"] = "cancelled";
8
11
  OrderStatus["DELIVERED"] = "delivered";
9
- })(OrderStatus || (OrderStatus = {}));
10
- export var PaymentMethod;
12
+ })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
13
+ var PaymentMethod;
11
14
  (function (PaymentMethod) {
12
15
  PaymentMethod["COD"] = "cod";
13
16
  PaymentMethod["MOMO"] = "momo";
14
17
  PaymentMethod["VNPAY"] = "vnpay";
15
- })(PaymentMethod || (PaymentMethod = {}));
16
- export var CancelReasonType;
18
+ })(PaymentMethod || (exports.PaymentMethod = PaymentMethod = {}));
19
+ var CancelReasonType;
17
20
  (function (CancelReasonType) {
18
21
  CancelReasonType["CHANGE_OF_MIND"] = "CHANGE_OF_MIND";
19
22
  CancelReasonType["FOUND_BETTER_PRICE"] = "FOUND_BETTER_PRICE";
20
23
  CancelReasonType["ORDER_BY_MISTAKE"] = "ORDER_BY_MISTAKE";
21
24
  CancelReasonType["WRONG_ADDRESS"] = "WRONG_ADDRESS";
22
25
  CancelReasonType["OTHER"] = "OTHER";
23
- })(CancelReasonType || (CancelReasonType = {}));
26
+ })(CancelReasonType || (exports.CancelReasonType = CancelReasonType = {}));
@@ -1,12 +1,15 @@
1
- export var PaymentStatus;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentStatusLabel = exports.PaymentStatus = void 0;
4
+ var PaymentStatus;
2
5
  (function (PaymentStatus) {
3
6
  PaymentStatus["PENDING"] = "PENDING";
4
7
  PaymentStatus["SUCCESS"] = "SUCCESS";
5
8
  PaymentStatus["FAILED"] = "FAILED";
6
9
  PaymentStatus["CANCELLED"] = "CANCELLED";
7
10
  PaymentStatus["REFUNDED"] = "REFUNDED";
8
- })(PaymentStatus || (PaymentStatus = {}));
9
- export const PaymentStatusLabel = {
11
+ })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
12
+ exports.PaymentStatusLabel = {
10
13
  [PaymentStatus.PENDING]: "Chờ thanh toán",
11
14
  [PaymentStatus.SUCCESS]: "Thanh toán thành công",
12
15
  [PaymentStatus.FAILED]: "Thanh toán thất bại",
@@ -1,4 +1,7 @@
1
- export var ShippingStatus;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShippingProvider = exports.ShippingStatus = void 0;
4
+ var ShippingStatus;
2
5
  (function (ShippingStatus) {
3
6
  ShippingStatus["PENDING"] = "PENDING";
4
7
  ShippingStatus["PICKED_UP"] = "PICKED_UP";
@@ -8,8 +11,8 @@ export var ShippingStatus;
8
11
  ShippingStatus["FAILED"] = "FAILED";
9
12
  ShippingStatus["RETURNED"] = "RETURNED";
10
13
  ShippingStatus["CANCELED"] = "CANCELED";
11
- })(ShippingStatus || (ShippingStatus = {}));
12
- export var ShippingProvider;
14
+ })(ShippingStatus || (exports.ShippingStatus = ShippingStatus = {}));
15
+ var ShippingProvider;
13
16
  (function (ShippingProvider) {
14
17
  ShippingProvider["GHN"] = "GHN";
15
18
  ShippingProvider["GHTK"] = "GHTK";
@@ -17,4 +20,4 @@ export var ShippingProvider;
17
20
  ShippingProvider["VN_POST"] = "VN_POST";
18
21
  ShippingProvider["J_T_EXPRESS"] = "J_T_EXPRESS";
19
22
  ShippingProvider["INTERNAL"] = "INTERNAL";
20
- })(ShippingProvider || (ShippingProvider = {}));
23
+ })(ShippingProvider || (exports.ShippingProvider = ShippingProvider = {}));
@@ -1,38 +1,41 @@
1
- export var UserRole;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteReason = exports.MemberRank = exports.StaffPosition = exports.StaffStatus = exports.Gender = exports.UserRole = void 0;
4
+ var UserRole;
2
5
  (function (UserRole) {
3
6
  UserRole["ADMIN"] = "admin";
4
7
  UserRole["USER"] = "user";
5
8
  UserRole["STAFF"] = "staff";
6
- })(UserRole || (UserRole = {}));
7
- export var Gender;
9
+ })(UserRole || (exports.UserRole = UserRole = {}));
10
+ var Gender;
8
11
  (function (Gender) {
9
12
  Gender["MALE"] = "male";
10
13
  Gender["FEMALE"] = "female";
11
- })(Gender || (Gender = {}));
12
- export var StaffStatus;
14
+ })(Gender || (exports.Gender = Gender = {}));
15
+ var StaffStatus;
13
16
  (function (StaffStatus) {
14
17
  StaffStatus["ACTIVE"] = "active";
15
18
  StaffStatus["PROBATION"] = "probation";
16
19
  StaffStatus["ON_LEAVE"] = "on_leave";
17
20
  StaffStatus["RESIGNED"] = "resigned";
18
- })(StaffStatus || (StaffStatus = {}));
19
- export var StaffPosition;
21
+ })(StaffStatus || (exports.StaffStatus = StaffStatus = {}));
22
+ var StaffPosition;
20
23
  (function (StaffPosition) {
21
24
  StaffPosition["SALE"] = "sale";
22
25
  StaffPosition["INVENTORY"] = "inventory";
23
26
  StaffPosition["MANAGER"] = "manager";
24
- })(StaffPosition || (StaffPosition = {}));
25
- export var MemberRank;
27
+ })(StaffPosition || (exports.StaffPosition = StaffPosition = {}));
28
+ var MemberRank;
26
29
  (function (MemberRank) {
27
30
  MemberRank["BRONZE"] = "bronze";
28
31
  MemberRank["SILVER"] = "silver";
29
32
  MemberRank["GOLD"] = "gold";
30
- })(MemberRank || (MemberRank = {}));
31
- export var DeleteReason;
33
+ })(MemberRank || (exports.MemberRank = MemberRank = {}));
34
+ var DeleteReason;
32
35
  (function (DeleteReason) {
33
36
  DeleteReason["NOT_USING"] = "NOT_USING";
34
37
  DeleteReason["PRIVACY_CONCERNS"] = "PRIVACY_CONCERNS";
35
38
  DeleteReason["FOUND_BETTER_ALTERNATIVE"] = "FOUND_BETTER_ALTERNATIVE";
36
39
  DeleteReason["ACCOUNT_ISSUE"] = "ACCOUNT_ISSUE";
37
40
  DeleteReason["OTHER"] = "OTHER";
38
- })(DeleteReason || (DeleteReason = {}));
41
+ })(DeleteReason || (exports.DeleteReason = DeleteReason = {}));
@@ -1,10 +1,13 @@
1
- export var VoucherStatus;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VoucherType = exports.VoucherStatus = void 0;
4
+ var VoucherStatus;
2
5
  (function (VoucherStatus) {
3
6
  VoucherStatus["ACTIVE"] = "ACTIVE";
4
7
  VoucherStatus["INACTIVE"] = "INACTIVE";
5
- })(VoucherStatus || (VoucherStatus = {}));
6
- export var VoucherType;
8
+ })(VoucherStatus || (exports.VoucherStatus = VoucherStatus = {}));
9
+ var VoucherType;
7
10
  (function (VoucherType) {
8
11
  VoucherType["PERCENT"] = "PERCENT";
9
12
  VoucherType["FIXED"] = "FIXED";
10
- })(VoucherType || (VoucherType = {}));
13
+ })(VoucherType || (exports.VoucherType = VoucherType = {}));
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./enums/index.js";
2
- export * from "./types/index.js";
1
+ export * from "./enums";
2
+ export * from "./types";
package/dist/index.js CHANGED
@@ -1,2 +1,18 @@
1
- export * from "./enums/index.js";
2
- export * from "./types/index.js";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./enums"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -1,3 +1,3 @@
1
- export * from "./user.types.js";
2
- export * from "./order.types.js";
3
- export * from "./shipping.types.js";
1
+ export * from "./user.types";
2
+ export * from "./order.types";
3
+ export * from "./shipping.types";
@@ -1,3 +1,19 @@
1
- export * from "./user.types.js";
2
- export * from "./order.types.js";
3
- export * from "./shipping.types.js";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./user.types"), exports);
18
+ __exportStar(require("./order.types"), exports);
19
+ __exportStar(require("./shipping.types"), exports);
@@ -1,12 +1,15 @@
1
- import { PaymentMethod } from "../enums";
2
- export const getPaymentMethod = {
3
- [PaymentMethod.COD]: {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPaymentMethod = void 0;
4
+ const enums_1 = require("../enums");
5
+ exports.getPaymentMethod = {
6
+ [enums_1.PaymentMethod.COD]: {
4
7
  text: "Thanh toán khi nhận hàng",
5
8
  },
6
- [PaymentMethod.MOMO]: {
9
+ [enums_1.PaymentMethod.MOMO]: {
7
10
  text: "Thanh toán qua ví MOMO",
8
11
  },
9
- [PaymentMethod.VNPAY]: {
12
+ [enums_1.PaymentMethod.VNPAY]: {
10
13
  text: "Thanh toán qua VNPay",
11
14
  },
12
15
  };
@@ -1,47 +1,50 @@
1
- import { ShippingProvider, ShippingStatus } from "../enums/shipping.enum";
2
- export const getShippingStatus = {
3
- [ShippingStatus.PENDING]: {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getShippingProvider = exports.getShippingStatus = void 0;
4
+ const shipping_enum_1 = require("../enums/shipping.enum");
5
+ exports.getShippingStatus = {
6
+ [shipping_enum_1.ShippingStatus.PENDING]: {
4
7
  text: "Chờ lấy hàng",
5
8
  },
6
- [ShippingStatus.PICKED_UP]: {
9
+ [shipping_enum_1.ShippingStatus.PICKED_UP]: {
7
10
  text: "Đơn vị vận chuyển đã lấy hàng",
8
11
  },
9
- [ShippingStatus.IN_TRANSIT]: {
12
+ [shipping_enum_1.ShippingStatus.IN_TRANSIT]: {
10
13
  text: "Đang vận chuyển",
11
14
  },
12
- [ShippingStatus.OUT_FOR_DELIVERY]: {
15
+ [shipping_enum_1.ShippingStatus.OUT_FOR_DELIVERY]: {
13
16
  text: "Đang giao hàng",
14
17
  },
15
- [ShippingStatus.DELIVERED]: {
18
+ [shipping_enum_1.ShippingStatus.DELIVERED]: {
16
19
  text: "Giao hàng thành công",
17
20
  },
18
- [ShippingStatus.FAILED]: {
21
+ [shipping_enum_1.ShippingStatus.FAILED]: {
19
22
  text: "Giao hàng thất bại",
20
23
  },
21
- [ShippingStatus.RETURNED]: {
24
+ [shipping_enum_1.ShippingStatus.RETURNED]: {
22
25
  text: "Đã hoàn hàng",
23
26
  },
24
- [ShippingStatus.CANCELED]: {
27
+ [shipping_enum_1.ShippingStatus.CANCELED]: {
25
28
  text: "Đã hủy giao hàng",
26
29
  },
27
30
  };
28
- export const getShippingProvider = {
29
- [ShippingProvider.GHN]: {
31
+ exports.getShippingProvider = {
32
+ [shipping_enum_1.ShippingProvider.GHN]: {
30
33
  text: "Giao hàng nhanh (GHN)",
31
34
  },
32
- [ShippingProvider.GHTK]: {
35
+ [shipping_enum_1.ShippingProvider.GHTK]: {
33
36
  text: "Giao hàng tiết kiệm (GHTK)",
34
37
  },
35
- [ShippingProvider.INTERNAL]: {
38
+ [shipping_enum_1.ShippingProvider.INTERNAL]: {
36
39
  text: "Nội bộ giao hàng",
37
40
  },
38
- [ShippingProvider.J_T_EXPRESS]: {
41
+ [shipping_enum_1.ShippingProvider.J_T_EXPRESS]: {
39
42
  text: "J&T_Express",
40
43
  },
41
- [ShippingProvider.VIETTEL_POST]: {
44
+ [shipping_enum_1.ShippingProvider.VIETTEL_POST]: {
42
45
  text: "Viettel Post",
43
46
  },
44
- [ShippingProvider.VN_POST]: {
47
+ [shipping_enum_1.ShippingProvider.VN_POST]: {
45
48
  text: "Vn Post",
46
49
  },
47
50
  };
@@ -1,42 +1,45 @@
1
- import { OrderStatus } from "../enums";
2
- export const getStatusConfig = (status) => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getStatusConfig = void 0;
4
+ const enums_1 = require("../enums");
5
+ const getStatusConfig = (status) => {
3
6
  switch (status) {
4
- case OrderStatus.PENDING:
7
+ case enums_1.OrderStatus.PENDING:
5
8
  return {
6
9
  text: "Chờ xác nhận",
7
10
  bgColor: "#fef3c7",
8
11
  textColor: "#92400e",
9
12
  borderColor: "#fbbf24",
10
13
  };
11
- case OrderStatus.CONFIRMED:
14
+ case enums_1.OrderStatus.CONFIRMED:
12
15
  return {
13
16
  text: "Đã xác nhận",
14
17
  bgColor: "#dbeafe",
15
18
  textColor: "#1e40af",
16
19
  borderColor: "#3b82f6",
17
20
  };
18
- case OrderStatus.SHIPPING:
21
+ case enums_1.OrderStatus.SHIPPING:
19
22
  return {
20
23
  text: "Đang giao",
21
24
  bgColor: "#c3dafe",
22
25
  textColor: "#4c51bf",
23
26
  borderColor: "#818cf8",
24
27
  };
25
- case OrderStatus.DELIVERED:
28
+ case enums_1.OrderStatus.DELIVERED:
26
29
  return {
27
30
  text: "Đã giao",
28
31
  bgColor: "#d1fae5",
29
32
  textColor: "#065f46",
30
33
  borderColor: "#34d399",
31
34
  };
32
- case OrderStatus.COMPLETED:
35
+ case enums_1.OrderStatus.COMPLETED:
33
36
  return {
34
37
  text: "Hoàn thành",
35
38
  bgColor: "#d1fae5",
36
39
  textColor: "#065f46",
37
40
  borderColor: "#10b981",
38
41
  };
39
- case OrderStatus.CANCELLED:
42
+ case enums_1.OrderStatus.CANCELLED:
40
43
  return {
41
44
  text: "Đã hủy",
42
45
  bgColor: "#fee2e2",
@@ -52,3 +55,4 @@ export const getStatusConfig = (status) => {
52
55
  };
53
56
  }
54
57
  };
58
+ exports.getStatusConfig = getStatusConfig;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@nguyentrungkien/shared",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "description": "shared enum & types",
5
5
  "license": "ISC",
6
- "type": "module",
6
+ "type": "commonjs",
7
7
  "author": "nguyentrungkien04921@gmail.com",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -27,9 +27,5 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "typescript": "^5.9.2"
30
- },
31
- "exports": {
32
- ".": "./dist/index.js",
33
- "./enums": "./dist/enums/index.js"
34
30
  }
35
31
  }