asv-hlps 1.4.5 → 1.4.7

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.
Files changed (107) hide show
  1. package/lib/cjs/auth/auth.d.ts +2 -1
  2. package/lib/cjs/auth/auth.js +18 -23
  3. package/lib/cjs/markets/index.d.ts +2 -0
  4. package/lib/cjs/markets/index.js +18 -0
  5. package/lib/cjs/markets/models/Market.d.ts +8 -0
  6. package/lib/cjs/markets/models/Market.js +2 -0
  7. package/lib/cjs/markets/models/UMarket.d.ts +11 -0
  8. package/lib/cjs/markets/models/UMarket.js +2 -0
  9. package/lib/cjs/markets/models/index.d.ts +2 -0
  10. package/lib/cjs/markets/models/index.js +18 -0
  11. package/lib/cjs/markets/products/models/Product.d.ts +39 -0
  12. package/lib/cjs/markets/products/models/Product.js +2 -0
  13. package/lib/cjs/markets/products/models/ProductAsset.d.ts +8 -0
  14. package/lib/cjs/markets/products/models/ProductAsset.js +2 -0
  15. package/lib/cjs/markets/products/models/ProductCat.d.ts +3 -0
  16. package/lib/cjs/markets/products/models/ProductCat.js +2 -0
  17. package/lib/cjs/markets/products/models/ProductCollection.d.ts +3 -0
  18. package/lib/cjs/markets/products/models/ProductCollection.js +2 -0
  19. package/lib/cjs/markets/products/models/ProductDepot.d.ts +11 -0
  20. package/lib/cjs/markets/products/models/ProductDepot.js +2 -0
  21. package/lib/cjs/markets/products/models/ProductElt.d.ts +3 -0
  22. package/lib/cjs/markets/products/models/ProductElt.js +2 -0
  23. package/lib/cjs/markets/products/models/ProductGrp.d.ts +3 -0
  24. package/lib/cjs/markets/products/models/ProductGrp.js +2 -0
  25. package/lib/cjs/markets/products/models/ProductImage.d.ts +4 -0
  26. package/lib/cjs/markets/products/models/ProductImage.js +6 -0
  27. package/lib/cjs/markets/products/models/ProductIn.d.ts +42 -0
  28. package/lib/cjs/markets/products/models/ProductIn.js +6 -0
  29. package/lib/cjs/markets/products/models/ProductState.d.ts +3 -0
  30. package/lib/cjs/markets/products/models/ProductState.js +2 -0
  31. package/lib/cjs/markets/products/models/ProductStock.d.ts +6 -0
  32. package/lib/cjs/markets/products/models/ProductStock.js +2 -0
  33. package/lib/cjs/markets/products/models/ProductTag.d.ts +3 -0
  34. package/lib/cjs/markets/products/models/ProductTag.js +2 -0
  35. package/lib/cjs/markets/products/models/ProductVariant.d.ts +6 -0
  36. package/lib/cjs/markets/products/models/ProductVariant.js +2 -0
  37. package/lib/cjs/markets/products/models/index.d.ts +13 -0
  38. package/lib/cjs/markets/products/models/index.js +29 -0
  39. package/lib/cjs/markets/shops/index.d.ts +1 -0
  40. package/lib/cjs/markets/shops/index.js +17 -0
  41. package/lib/cjs/markets/shops/models/Shop.d.ts +13 -0
  42. package/lib/cjs/markets/shops/models/Shop.js +2 -0
  43. package/lib/cjs/markets/users/models/User.d.ts +7 -0
  44. package/lib/cjs/markets/users/models/User.js +2 -0
  45. package/lib/cjs/npms/yup.js +17 -7
  46. package/lib/cjs/shared/models/IIcon.d.ts +4 -0
  47. package/lib/cjs/shared/models/IIcon.js +6 -0
  48. package/lib/cjs/shared/models/NaAcIc.d.ts +7 -0
  49. package/lib/cjs/shared/models/NaAcIc.js +7 -0
  50. package/lib/cjs/shared/models/NaCoAcIc.d.ts +4 -0
  51. package/lib/cjs/shared/models/NaCoAcIc.js +7 -0
  52. package/lib/cjs/users/user.js +17 -7
  53. package/lib/cjs/utils.d.ts +1 -0
  54. package/lib/cjs/utils.js +5 -0
  55. package/lib/esm/auth/auth.d.ts +2 -1
  56. package/lib/esm/auth/auth.js +18 -23
  57. package/lib/esm/markets/index.d.ts +2 -0
  58. package/lib/esm/markets/index.js +2 -0
  59. package/lib/esm/markets/models/Market.d.ts +8 -0
  60. package/lib/esm/markets/models/Market.js +1 -0
  61. package/lib/esm/markets/models/UMarket.d.ts +11 -0
  62. package/lib/esm/markets/models/UMarket.js +1 -0
  63. package/lib/esm/markets/models/index.d.ts +2 -0
  64. package/lib/esm/markets/models/index.js +2 -0
  65. package/lib/esm/markets/products/models/Product.d.ts +39 -0
  66. package/lib/esm/markets/products/models/Product.js +1 -0
  67. package/lib/esm/markets/products/models/ProductAsset.d.ts +8 -0
  68. package/lib/esm/markets/products/models/ProductAsset.js +1 -0
  69. package/lib/esm/markets/products/models/ProductCat.d.ts +3 -0
  70. package/lib/esm/markets/products/models/ProductCat.js +1 -0
  71. package/lib/esm/markets/products/models/ProductCollection.d.ts +3 -0
  72. package/lib/esm/markets/products/models/ProductCollection.js +1 -0
  73. package/lib/esm/markets/products/models/ProductDepot.d.ts +11 -0
  74. package/lib/esm/markets/products/models/ProductDepot.js +1 -0
  75. package/lib/esm/markets/products/models/ProductElt.d.ts +3 -0
  76. package/lib/esm/markets/products/models/ProductElt.js +1 -0
  77. package/lib/esm/markets/products/models/ProductGrp.d.ts +3 -0
  78. package/lib/esm/markets/products/models/ProductGrp.js +1 -0
  79. package/lib/esm/markets/products/models/ProductImage.d.ts +4 -0
  80. package/lib/esm/markets/products/models/ProductImage.js +2 -0
  81. package/lib/esm/markets/products/models/ProductIn.d.ts +42 -0
  82. package/lib/esm/markets/products/models/ProductIn.js +2 -0
  83. package/lib/esm/markets/products/models/ProductState.d.ts +3 -0
  84. package/lib/esm/markets/products/models/ProductState.js +1 -0
  85. package/lib/esm/markets/products/models/ProductStock.d.ts +6 -0
  86. package/lib/esm/markets/products/models/ProductStock.js +1 -0
  87. package/lib/esm/markets/products/models/ProductTag.d.ts +3 -0
  88. package/lib/esm/markets/products/models/ProductTag.js +1 -0
  89. package/lib/esm/markets/products/models/ProductVariant.d.ts +6 -0
  90. package/lib/esm/markets/products/models/ProductVariant.js +1 -0
  91. package/lib/esm/markets/products/models/index.d.ts +13 -0
  92. package/lib/esm/markets/products/models/index.js +13 -0
  93. package/lib/esm/markets/shops/index.d.ts +1 -0
  94. package/lib/esm/markets/shops/index.js +1 -0
  95. package/lib/esm/markets/shops/models/Shop.d.ts +13 -0
  96. package/lib/esm/markets/shops/models/Shop.js +1 -0
  97. package/lib/esm/markets/users/models/User.d.ts +7 -0
  98. package/lib/esm/markets/users/models/User.js +1 -0
  99. package/lib/esm/shared/models/IIcon.d.ts +4 -0
  100. package/lib/esm/shared/models/IIcon.js +2 -0
  101. package/lib/esm/shared/models/NaAcIc.d.ts +7 -0
  102. package/lib/esm/shared/models/NaAcIc.js +3 -0
  103. package/lib/esm/shared/models/NaCoAcIc.d.ts +4 -0
  104. package/lib/esm/shared/models/NaCoAcIc.js +3 -0
  105. package/lib/esm/utils.d.ts +1 -0
  106. package/lib/esm/utils.js +4 -0
  107. package/package.json +9 -9
@@ -1,4 +1,5 @@
1
1
  import { Ste, SteGrp, UserGrp, UserRole } from "../users/models";
2
+ import AuthTag from "./models/AuthTag";
2
3
  interface AuthParam {
3
4
  tag?: string;
4
5
  roles?: string[];
@@ -17,7 +18,7 @@ interface AuthParam {
17
18
  url?: string;
18
19
  }
19
20
  type TData = {
20
- tags?: string[];
21
+ tags?: AuthTag[] | string[];
21
22
  ste: Ste;
22
23
  role: UserRole;
23
24
  roles: string[];
@@ -2,33 +2,28 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAuth = void 0;
4
4
  const user_1 = require("../users/user");
5
+ const utils_1 = require("../utils");
5
6
  const arraySome = (arr1, arr2) => {
6
7
  return arr1.some((x) => arr2.includes(x));
7
8
  };
8
9
  const getAuth = (authUser, authSte, param) => {
9
- var _a, _b, _c, _d, _e, _f, _g, _h;
10
- /* if (param?.tag && authUser?.tags?.length) {
11
- const tags: string[] = [];
12
- for (const tag of authUser.tags) {
13
- tags.push(tag?.code?.toLowerCase());
14
- }
15
- const authIn = tags?.includes(param?.tag?.toLowerCase());
16
- if (authIn) {
17
- return true;
18
- }
19
- } */
10
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
20
11
  if ((param === null || param === void 0 ? void 0 : param.tag) && ((_a = authUser === null || authUser === void 0 ? void 0 : authUser.tags) === null || _a === void 0 ? void 0 : _a.length)) {
21
- // const tags: string[] = [];
22
- /* for (const tag of authUser.tags) {
23
- tags.push(tag?.code?.toLowerCase());
24
- } */
25
- const tags = authUser.tags;
26
- const authIn = tags === null || tags === void 0 ? void 0 : tags.includes((_b = param === null || param === void 0 ? void 0 : param.tag) === null || _b === void 0 ? void 0 : _b.toLowerCase());
12
+ let tags = [];
13
+ if ((0, utils_1.checkIsStringOfArray)(authUser.tags)) {
14
+ tags = authUser === null || authUser === void 0 ? void 0 : authUser.tags;
15
+ }
16
+ else {
17
+ for (const tag of authUser.tags) {
18
+ tags.push((_b = tag === null || tag === void 0 ? void 0 : tag.code) === null || _b === void 0 ? void 0 : _b.toLowerCase());
19
+ }
20
+ }
21
+ const authIn = tags === null || tags === void 0 ? void 0 : tags.includes((_c = param === null || param === void 0 ? void 0 : param.tag) === null || _c === void 0 ? void 0 : _c.toLowerCase());
27
22
  if (authIn) {
28
23
  return true;
29
24
  }
30
25
  }
31
- if (((_c = param === null || param === void 0 ? void 0 : param.roles) === null || _c === void 0 ? void 0 : _c.length) > 0) {
26
+ if (((_d = param === null || param === void 0 ? void 0 : param.roles) === null || _d === void 0 ? void 0 : _d.length) > 0) {
32
27
  /* if (isStaffSte(authSte, authUser.ste.name) && ["sadm", ...param.roles].includes(authUser.role.code.toLowerCase())) {
33
28
  return true;
34
29
  } */
@@ -38,7 +33,7 @@ const getAuth = (authUser, authSte, param) => {
38
33
  }
39
34
  // ------ staff ------
40
35
  if (param === null || param === void 0 ? void 0 : param.staff) {
41
- if (((_d = param === null || param === void 0 ? void 0 : param.staff.roles) === null || _d === void 0 ? void 0 : _d.length) > 0 &&
36
+ if (((_e = param === null || param === void 0 ? void 0 : param.staff.roles) === null || _e === void 0 ? void 0 : _e.length) > 0 &&
42
37
  (0, user_1.isStaffSte)(authSte, authUser.ste.name) &&
43
38
  ["sadm", ...param.roles].includes(authUser.role.code.toLowerCase())) {
44
39
  return true;
@@ -59,7 +54,7 @@ const getAuth = (authUser, authSte, param) => {
59
54
  param.client.steGrps.includes(authUser.ste.grp.code.toLowerCase())) {
60
55
  return true;
61
56
  }
62
- if (((_e = param === null || param === void 0 ? void 0 : param.client.roles) === null || _e === void 0 ? void 0 : _e.length) &&
57
+ if (((_f = param === null || param === void 0 ? void 0 : param.client.roles) === null || _f === void 0 ? void 0 : _f.length) &&
63
58
  (param === null || param === void 0 ? void 0 : param.client.steGrps.length) &&
64
59
  ["ceo", ...param === null || param === void 0 ? void 0 : param.client.roles].includes(authUser.role.code.toLowerCase()) &&
65
60
  (param === null || param === void 0 ? void 0 : param.client.steGrps).includes(authUser.ste.grp.code.toLowerCase())) {
@@ -68,13 +63,13 @@ const getAuth = (authUser, authSte, param) => {
68
63
  }
69
64
  }
70
65
  // ------ ste grps ------
71
- if (((_f = param === null || param === void 0 ? void 0 : param.steGrps) === null || _f === void 0 ? void 0 : _f.length) > 0 && param.steGrps.includes(authUser.ste.grp.code.toLowerCase())) {
66
+ if (((_g = param === null || param === void 0 ? void 0 : param.steGrps) === null || _g === void 0 ? void 0 : _g.length) > 0 && param.steGrps.includes(authUser.ste.grp.code.toLowerCase())) {
72
67
  return true;
73
68
  }
74
- if (((_g = param === null || param === void 0 ? void 0 : param.grps) === null || _g === void 0 ? void 0 : _g.length) && param.grps.includes(authUser.grp.code.toLowerCase())) {
69
+ if (((_h = param === null || param === void 0 ? void 0 : param.grps) === null || _h === void 0 ? void 0 : _h.length) && param.grps.includes(authUser.grp.code.toLowerCase())) {
75
70
  return true;
76
71
  }
77
- if (((_h = param === null || param === void 0 ? void 0 : param.steNames) === null || _h === void 0 ? void 0 : _h.length) > 0 && param.steNames.includes(authUser.ste.name.toLowerCase())) {
72
+ if (((_j = param === null || param === void 0 ? void 0 : param.steNames) === null || _j === void 0 ? void 0 : _j.length) > 0 && param.steNames.includes(authUser.ste.name.toLowerCase())) {
78
73
  return true;
79
74
  }
80
75
  return false;
@@ -0,0 +1,2 @@
1
+ export * from "./models";
2
+ export * from "./products/models";
@@ -0,0 +1,18 @@
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("./models"), exports);
18
+ __exportStar(require("./products/models"), exports);
@@ -0,0 +1,8 @@
1
+ export interface Market {
2
+ id?: number;
3
+ name: string;
4
+ code: string;
5
+ iconName: string;
6
+ iconPack: string;
7
+ isActive: boolean;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import User from "../../users/models/User";
2
+ import { Market } from "./Market";
3
+ export interface UMarket {
4
+ id: number;
5
+ createdAt: Date;
6
+ updatedAt: Date;
7
+ isActive: boolean;
8
+ disabled?: boolean;
9
+ user: User;
10
+ market: Market;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./Market";
2
+ export * from "./UMarket";
@@ -0,0 +1,18 @@
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("./Market"), exports);
18
+ __exportStar(require("./UMarket"), exports);
@@ -0,0 +1,39 @@
1
+ import { Market } from "../../models/Market";
2
+ import { Shop } from "../../shops/models/Shop";
3
+ import { ProductCat } from "./ProductCat";
4
+ import { ProductImage } from "./ProductImage";
5
+ import { ProductIn } from "./ProductIn";
6
+ interface Stock {
7
+ sumIns: number;
8
+ sumOuts: number;
9
+ qtityPerPackaging: number;
10
+ }
11
+ export interface Product {
12
+ capacity: string;
13
+ cat: ProductCat;
14
+ createdAt: Date;
15
+ description: string;
16
+ designation: string;
17
+ disabled?: boolean;
18
+ iconName: string;
19
+ iconPack: string;
20
+ id: number;
21
+ images: ProductImage[];
22
+ ins: ProductIn[];
23
+ isActive: boolean;
24
+ isAvailable?: boolean;
25
+ isBulk: boolean;
26
+ market: Market;
27
+ price: number;
28
+ publicPrice: number;
29
+ qtityLimit: number;
30
+ qtityUnit: number;
31
+ stock: Stock;
32
+ qtityPerBox: number;
33
+ qtityPerPackaging: number;
34
+ ref: string;
35
+ salePrice: number;
36
+ shop: Shop;
37
+ updatedAt: Date;
38
+ }
39
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export interface ProductAsset {
2
+ id: number;
3
+ elt: string;
4
+ name: string;
5
+ qtity: number;
6
+ size: number;
7
+ isActive: boolean;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { NaCoAcIc } from "../../../shared/models/NaCoAcIc";
2
+ export interface ProductCat extends NaCoAcIc {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import NaAc from "../../../shared/models/NaAc";
2
+ export interface ProductCollection extends NaAc {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { ProductIn } from "./ProductIn";
2
+ export interface ProductDepot {
3
+ id: number;
4
+ name: string;
5
+ code: string;
6
+ main: "master" | "slave";
7
+ hasViewStock: boolean;
8
+ qtityInTransfert: number;
9
+ isActive: boolean;
10
+ ins: ProductIn[];
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { NaCoAc } from "../../../shared/models";
2
+ export interface ProductElt extends NaCoAc {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import NaAc from "../../../shared/models/NaAc";
2
+ export interface ProductGrp extends NaAc {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { Product } from "./Product";
2
+ export declare class ProductImage extends Image {
3
+ product: Product;
4
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductImage = void 0;
4
+ class ProductImage extends Image {
5
+ }
6
+ exports.ProductImage = ProductImage;
@@ -0,0 +1,42 @@
1
+ import EInOutMotive from "../../../shared/models/EInOutMotive";
2
+ import { Product } from "./Product";
3
+ import { ProductDepot } from "./ProductDepot";
4
+ export declare class ProductIn {
5
+ id: number;
6
+ createdAt: Date;
7
+ lot: string;
8
+ qtity: number;
9
+ comment: string;
10
+ isEdit: boolean;
11
+ motive: EInOutMotive;
12
+ authorId: number;
13
+ qtityPerPackaging: number;
14
+ /**
15
+ * remaining qtity
16
+ */
17
+ qtityIn: number;
18
+ isOutDate: boolean;
19
+ /**
20
+ * expired
21
+ */
22
+ isOut: boolean;
23
+ /**
24
+ * if true the productIn is created from transfering qtity from another productin
25
+ */
26
+ fromTransfert: boolean;
27
+ /**
28
+ * indique the qtity waiting to transfert after transfert validation
29
+ */
30
+ qtityInTransfert: number;
31
+ /**
32
+ * is true if the transfert not validate
33
+ */
34
+ inTransfert: boolean;
35
+ depotId: number;
36
+ productId: number;
37
+ designation: string;
38
+ salePrice: number;
39
+ publicPrice: number;
40
+ product: Product;
41
+ depot: ProductDepot;
42
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductIn = void 0;
4
+ class ProductIn {
5
+ }
6
+ exports.ProductIn = ProductIn;
@@ -0,0 +1,3 @@
1
+ import NaAc from "../../../shared/models/NaAc";
2
+ export interface ProductState extends NaAc {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface ProductStock {
2
+ sumIns: number;
3
+ sumOuts: number;
4
+ qtityPerPackaging: number;
5
+ qtityUnit?: number;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import NaAc from "../../../shared/models/NaAc";
2
+ export interface ProductTag extends NaAc {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export interface ProductVariant {
2
+ id: number;
3
+ sku: string;
4
+ size: string;
5
+ color: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ export * from "./Product";
2
+ export * from "./ProductAsset";
3
+ export * from "./ProductCat";
4
+ export * from "./ProductCollection";
5
+ export * from "./ProductDepot";
6
+ export * from "./ProductElt";
7
+ export * from "./ProductGrp";
8
+ export * from "./ProductImage";
9
+ export * from "./ProductIn";
10
+ export * from "./ProductState";
11
+ export * from "./ProductStock";
12
+ export * from "./ProductTag";
13
+ export * from "./ProductVariant";
@@ -0,0 +1,29 @@
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("./Product"), exports);
18
+ __exportStar(require("./ProductAsset"), exports);
19
+ __exportStar(require("./ProductCat"), exports);
20
+ __exportStar(require("./ProductCollection"), exports);
21
+ __exportStar(require("./ProductDepot"), exports);
22
+ __exportStar(require("./ProductElt"), exports);
23
+ __exportStar(require("./ProductGrp"), exports);
24
+ __exportStar(require("./ProductImage"), exports);
25
+ __exportStar(require("./ProductIn"), exports);
26
+ __exportStar(require("./ProductState"), exports);
27
+ __exportStar(require("./ProductStock"), exports);
28
+ __exportStar(require("./ProductTag"), exports);
29
+ __exportStar(require("./ProductVariant"), exports);
@@ -0,0 +1 @@
1
+ export * from "./models/Shop";
@@ -0,0 +1,17 @@
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("./models/Shop"), exports);
@@ -0,0 +1,13 @@
1
+ import { UMarket } from "../../models/UMarket";
2
+ import { Product } from "../../products/models/Product";
3
+ export interface Shop {
4
+ id: number;
5
+ name: string;
6
+ title: string;
7
+ description: string;
8
+ logo: string;
9
+ banner: string;
10
+ isActive: boolean;
11
+ products: Product[];
12
+ umarket: UMarket;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import UserBase from "../../../users/models/UserBase";
2
+ import { UMarket } from "../../models/UMarket";
3
+ export default interface User extends UserBase {
4
+ markets?: UMarket[];
5
+ wallets?: any;
6
+ phone?: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -0,0 +1,4 @@
1
+ export declare abstract class IIcon {
2
+ iconName: string;
3
+ iconPack: string;
4
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IIcon = void 0;
4
+ class IIcon {
5
+ }
6
+ exports.IIcon = IIcon;
@@ -0,0 +1,7 @@
1
+ import { IIcon } from "./IIcon";
2
+ export declare abstract class NaAcIc extends IIcon {
3
+ id: number;
4
+ name: string;
5
+ isActive?: boolean;
6
+ disabled?: boolean;
7
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NaAcIc = void 0;
4
+ const IIcon_1 = require("./IIcon");
5
+ class NaAcIc extends IIcon_1.IIcon {
6
+ }
7
+ exports.NaAcIc = NaAcIc;
@@ -0,0 +1,4 @@
1
+ import { NaAcIc } from "./NaAcIc";
2
+ export declare abstract class NaCoAcIc extends NaAcIc {
3
+ code: string;
4
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NaCoAcIc = void 0;
4
+ const NaAcIc_1 = require("./NaAcIc");
5
+ class NaCoAcIc extends NaAcIc_1.NaAcIc {
6
+ }
7
+ exports.NaCoAcIc = NaCoAcIc;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -108,3 +108,4 @@ export declare const toggleProp: (tob: any, propToToggle: string) => any;
108
108
  export declare const winMaxHeight: (step?: 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9) => number;
109
109
  export declare const arraySome: (arr1: any[], arr2: any[]) => boolean;
110
110
  export declare const checkObjInArray: (objs: any[], checkProp: string | number, prop?: string) => boolean;
111
+ export declare function checkIsStringOfArray(array: unknown[]): array is string[];
package/lib/cjs/utils.js CHANGED
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.unCheckedAll = exports.inputChecked = exports.arrayMultiChecked = exports.getPeriodDateColor = exports.getColorAccordingToDate = exports.genRandomColour = exports.formatNgbDate = exports.getNbOfDaysBetweenTwoDates = exports.displayDateRangeFr = exports.reformatDates = exports.firstDayOfDate = exports.dateToString = exports.dateDiff = exports.dateFormatter = exports.replaceSpacesWith = exports.replaceAllIn = exports.toPlural = exports.sesStorageGet = exports.sesStorageSet = exports.genSequenceRef = exports.refGenerator = exports.removeBackSlashOccurences = exports.stringifyFormatter = exports.removeString = exports.diffArraysByProp = exports.diffArraysByFunc = exports.deepClone = exports.findFirstSequenceMissing = exports.fillNumWithZero = exports.findSequencesMissing = exports.sequencesToNumbers = exports.notInSequence = exports.currencyFormatterCfa = exports.formatToStringCfa = exports.currencyFormatter = exports.formatToString = exports.checkAuth = exports.wakeUp = exports.sleep = exports.limitTo = exports.titleCase = exports.toObjectDate = exports.duplicateObjects = exports.removeDuplicateObjects = exports.getRandomColor = exports.calPercent = exports.percentOf = exports.genDateMinutesStep = exports.formatDateFirstDayFr = exports.isEmpty = void 0;
7
7
  exports.checkObjInArray = exports.arraySome = exports.winMaxHeight = exports.toggleProp = exports.roundLastNDigits = exports.removeParamKeyName = exports.countryIsoToFlag = exports.monthStringName = exports.returnBool = exports.formatAmountToString = exports.reduceTimes = exports.reduceSum = exports.sumAmount = exports.fillEndWithZero = exports.fillStartWithZero = exports.absFromSequence = exports.returnDates = exports.displayFrDatePeriode = exports.getArrayOfRandomColor = exports.randomHslColor = exports.randomHexColor = exports.randomRgbColor = exports.randomInteger = exports.insertAtInArray = exports.isBirthday = exports.padEndWithZero = exports.padStartWithZero = exports.formatMonthYearToLocaleString = exports.calculPercent = exports.validEmail = exports.convertToCfa = exports.packAndUnit = void 0;
8
+ exports.checkIsStringOfArray = checkIsStringOfArray;
8
9
  const dayjs_1 = __importDefault(require("dayjs"));
9
10
  const relativeTime_1 = __importDefault(require("dayjs/plugin/relativeTime"));
10
11
  const lodash_1 = __importDefault(require("lodash"));
@@ -774,3 +775,7 @@ const checkObjInArray = (objs, checkProp, prop = "id") => {
774
775
  });
775
776
  };
776
777
  exports.checkObjInArray = checkObjInArray;
778
+ function checkIsStringOfArray(array) {
779
+ // return array.every((element) => typeof element === "string");
780
+ return array.some((element) => typeof element === "string");
781
+ }