@artisan-commerce/products 0.0.2 → 0.1.3

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 (46) hide show
  1. package/build/main.bundle.js +8 -1
  2. package/build/report.html +53 -0
  3. package/build/src/config/constants.d.ts +10 -0
  4. package/build/src/errors/api.errors.d.ts +7 -0
  5. package/build/src/index.d.ts +7 -0
  6. package/build/src/lib/common.d.ts +15 -0
  7. package/build/src/lib/getCategories/getCategories.d.ts +1 -0
  8. package/build/src/lib/getCategories/getCategories.test.d.ts +1 -0
  9. package/build/src/lib/getProductDetails/getProductDetails.d.ts +9 -0
  10. package/build/src/lib/getProductDetails/getProductDetails.test.d.ts +1 -0
  11. package/build/src/lib/getProductDetails/getProductDetails.types.d.ts +7 -0
  12. package/build/src/lib/getProducts/getProducts.d.ts +9 -0
  13. package/build/src/lib/getProducts/getProducts.test.d.ts +1 -0
  14. package/build/src/lib/getProducts/getProducts.types.d.ts +3 -0
  15. package/build/src/lib/getRecommendedProducts/getRecommendedProducts.d.ts +1 -0
  16. package/build/src/lib/getRecommendedProducts/getRecommendedProducts.test.d.ts +1 -0
  17. package/build/src/lib/getRelatedProducts/getRelatedProducts.d.ts +1 -0
  18. package/build/src/lib/getRelatedProducts/getRelatedProducts.test.d.ts +1 -0
  19. package/build/src/lib/getStoreDetails/getStoreDetails.d.ts +9 -0
  20. package/build/src/lib/getStoreDetails/getStoreDetails.test.d.ts +1 -0
  21. package/build/src/lib/getStoreDetails/getStoreDetails.types.d.ts +7 -0
  22. package/build/src/lib/initProducts/initProducts.d.ts +10 -0
  23. package/build/src/services/fetchProductDetails/fetchProductDetails.service.d.ts +2 -0
  24. package/build/src/services/fetchProductDetails/fetchProductDetails.service.mock.d.ts +2 -0
  25. package/build/src/services/fetchProductDetails/fetchProductDetails.service.types.d.ts +1 -0
  26. package/build/src/services/fetchProducts/fetchPRoducts.service.mock.d.ts +2 -0
  27. package/build/src/services/fetchProducts/fetchProducts.service.d.ts +2 -0
  28. package/build/src/services/fetchProducts/fetchProducts.service.types.d.ts +1 -0
  29. package/build/src/services/fetchStoreDetails/fetchStoreDetails.service.d.ts +2 -0
  30. package/build/src/services/fetchStoreDetails/fetchStoreDetails.service.types.d.ts +1 -0
  31. package/build/src/tests/exports.test.d.ts +1 -0
  32. package/build/src/types/common.types.d.ts +15 -0
  33. package/build/src/types/http.types.d.ts +66 -0
  34. package/build/src/utils/http/cache.utils.d.ts +4 -0
  35. package/build/src/utils/http/http.utils.d.ts +11 -0
  36. package/build/src/utils/http/purge.utils.d.ts +38 -0
  37. package/build/src/utils/http/request.utils.d.ts +6 -0
  38. package/build/src/utils/transformers/api.transformer.d.ts +9 -0
  39. package/build/vendors.bundle.js +1 -1
  40. package/package.json +11 -7
  41. package/build/src/builders/common.builder.d.ts +0 -23
  42. package/build/src/builders/user.builder.d.ts +0 -2
  43. package/build/src/services/auth/auth.service.d.ts +0 -6
  44. package/build/src/services/auth/auth.service.types.d.ts +0 -8
  45. package/build/src/types/user.types.d.ts +0 -12
  46. package/build/src/utils/axios.d.ts +0 -2
@@ -1,3 +1,4 @@
1
+ import { GROUPS as Groups } from "../types/http.types";
1
2
  declare const CONSTANTS: {
2
3
  CLIENT_NAME: string;
3
4
  DEFAULT_REQUEST_TIMEOUT: number;
@@ -9,5 +10,14 @@ declare const CONSTANTS: {
9
10
  CODE: string;
10
11
  LANGUAGE: string;
11
12
  };
13
+ DEFAULT_API_TIMEOUT: number;
14
+ HEADERS: string[];
15
+ FILTERS: ("productId" | "vendorId" | "storeId" | "catalogueId" | "categoryId")[];
16
+ GROUPS: Groups[];
17
+ ORDER_FIELDS: string[];
18
+ ORDER_TYPES: ("ALPHABETIC" | "PRICE" | "PREDEFINED" | undefined)[];
19
+ ORDER_SORTS: ("ASC" | "DESC" | undefined)[];
20
+ PAGINATION: string[];
21
+ ADDITIONAL_FILTERS: string[];
12
22
  };
13
23
  export default CONSTANTS;
@@ -0,0 +1,7 @@
1
+ import { ProductHints } from "../types/common.types";
2
+ import { ID, ProductsHTTPConfig, RequestData } from "../types/http.types";
3
+ export declare const checkAccountId: (accountId: ProductHints["accountId"] | undefined, message?: string) => void;
4
+ export declare const checkVendorId: (vendorId: ID | undefined, message?: string) => void;
5
+ export declare const checkStoreId: (storeId: ID | undefined, message?: string) => void;
6
+ export declare const checkCatalogueId: (catalogueId: ID | undefined, message?: string) => void;
7
+ export declare const checkHTTPMinimumConfig: (config: ProductsHTTPConfig, data: RequestData, message?: string) => void;
@@ -1,4 +1,11 @@
1
1
  import * as transformers from "./utils/transformers/transformers.utils";
2
2
  import * as assertions from "./utils/assertions/assertions.utils";
3
+ export { getCategories } from "./lib/getCategories/getCategories";
4
+ export { getProductDetails } from "./lib/getProductDetails/getProductDetails";
5
+ export { getProducts } from "./lib/getProducts/getProducts";
6
+ export { getRecommendedProducts } from "./lib/getRecommendedProducts/getRecommendedProducts";
7
+ export { getRelatedProducts } from "./lib/getRelatedProducts/getRelatedProducts";
8
+ export { getStoreDetails } from "./lib/getStoreDetails/getStoreDetails";
9
+ export { initProducts } from "./lib/initProducts/initProducts";
3
10
  export { getProductTotals } from "./utils/caculations/calculations.utils";
4
11
  export { transformers, assertions };
@@ -0,0 +1,15 @@
1
+ import { GlobalState } from "../types/common.types";
2
+ export declare const initialState: GlobalState;
3
+ export declare const setState: (overrides: Partial<GlobalState>) => void;
4
+ export declare const getState: () => {
5
+ artisanApp: import("../../../types/build").ArtisanApp | undefined;
6
+ apiCache: import("../types/common.types").ApiCache;
7
+ expiresAt: number;
8
+ timeout?: number | undefined;
9
+ accountId?: string | number | undefined;
10
+ productId?: string | number | undefined;
11
+ vendorId?: string | number | undefined;
12
+ storeId?: string | number | undefined;
13
+ catalogueId?: string | number | undefined;
14
+ categoryId?: string | number | undefined;
15
+ };
@@ -0,0 +1 @@
1
+ export declare const getCategories: () => void;
@@ -0,0 +1,9 @@
1
+ import { FetchProductDetailsConfig } from "./getProductDetails.types";
2
+ export declare const getProductDetails: (productId: number | string, config: FetchProductDetailsConfig) => Promise<import("../../../../types/build").BaseProduct | {
3
+ data: any;
4
+ hints: {
5
+ [x: string]: string | number | boolean;
6
+ };
7
+ config: import("../../../../types/build").ArtisanRequest;
8
+ error: string | undefined;
9
+ } | import("../../../../types/build").Product[]>;
@@ -0,0 +1,7 @@
1
+ import { ProductsHTTPConfig } from "../../types/http.types";
2
+ export interface FetchProductDetailsConfig extends ProductsHTTPConfig {
3
+ groupBy?: undefined;
4
+ orderBy?: undefined;
5
+ pagination?: undefined;
6
+ additionalFilters?: undefined;
7
+ }
@@ -0,0 +1,9 @@
1
+ import { FetchProductsConfig } from "./getProducts.types";
2
+ export declare const getProducts: (config: FetchProductsConfig) => Promise<import("../../../../types/build").BaseProduct | {
3
+ data: any;
4
+ hints: {
5
+ [x: string]: string | number | boolean;
6
+ };
7
+ config: import("../../../../types/build").ArtisanRequest;
8
+ error: string | undefined;
9
+ } | import("../../../../types/build").Product[]>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { ProductsHTTPConfig } from "../../types/http.types";
2
+ export interface FetchProductsConfig extends ProductsHTTPConfig {
3
+ }
@@ -0,0 +1 @@
1
+ export declare const getRecommendedProducts: () => void;
@@ -0,0 +1 @@
1
+ export declare const getRelatedProducts: () => void;
@@ -0,0 +1,9 @@
1
+ import { FetchStoreDetailsConfig } from "./getStoreDetails.types";
2
+ export declare const getStoreDetails: (config: FetchStoreDetailsConfig) => Promise<import("../../../../types/build").BaseProduct | {
3
+ data: any;
4
+ hints: {
5
+ [x: string]: string | number | boolean;
6
+ };
7
+ config: import("../../../../types/build").ArtisanRequest;
8
+ error: string | undefined;
9
+ } | import("../../../../types/build").Product[]>;
@@ -0,0 +1,7 @@
1
+ import { ProductsHTTPConfig } from "../../types/http.types";
2
+ export interface FetchStoreDetailsConfig extends ProductsHTTPConfig {
3
+ groupBy?: undefined;
4
+ orderBy?: undefined;
5
+ pagination?: undefined;
6
+ additionalFilters?: undefined;
7
+ }
@@ -0,0 +1,10 @@
1
+ import { ArtisanApp } from "@artisan-commerce/types";
2
+ import { InitProductsConfig } from "../../types/common.types";
3
+ /**
4
+ * Initialize products metadata, stores initial global state for future needs.
5
+ * @author Luis Eduardo Andrade
6
+ * @since 1.0
7
+ * @param artisanApp: An artisan initialized app.
8
+ * @param config: Global products state that can be configure at the function call level
9
+ */
10
+ export declare const initProducts: (artisanApp: ArtisanApp, config?: InitProductsConfig) => void;
@@ -0,0 +1,2 @@
1
+ import { ArtisanRequest, ProductDetails } from "@artisan-commerce/types";
2
+ export declare const fetchProductDetails: (request: ArtisanRequest) => Promise<ProductDetails>;
@@ -0,0 +1,2 @@
1
+ import { ProductDetails, ArtisanRequest } from "@artisan-commerce/types";
2
+ export declare const fetchProductDetails: (request: ArtisanRequest) => Promise<ProductDetails>;
@@ -0,0 +1,2 @@
1
+ import { BaseProduct, ArtisanRequest } from "@artisan-commerce/types";
2
+ export declare const fetchProductDetails: (request: ArtisanRequest) => Promise<BaseProduct[]>;
@@ -0,0 +1,2 @@
1
+ import { ArtisanRequest, BaseProduct } from "@artisan-commerce/types";
2
+ export declare const fetchProducts: (request: ArtisanRequest) => Promise<BaseProduct[]>;
@@ -0,0 +1,2 @@
1
+ import { ArtisanRequest, BaseProduct } from "@artisan-commerce/types";
2
+ export declare const fetchStoreDetails: (request: ArtisanRequest) => Promise<BaseProduct[]>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ArtisanApp, ArtisanHints, Product } from "@artisan-commerce/types";
2
+ export interface ProductHints extends Omit<ArtisanHints, "accountId"> {
3
+ accountId?: ArtisanHints["accountId"];
4
+ }
5
+ export interface InitProductsConfig extends ProductHints {
6
+ timeout?: number;
7
+ }
8
+ export interface GlobalState extends InitProductsConfig {
9
+ artisanApp: ArtisanApp | undefined;
10
+ apiCache: ApiCache;
11
+ expiresAt: number;
12
+ }
13
+ export interface ApiCache {
14
+ [key: string]: Product | Product[];
15
+ }
@@ -0,0 +1,66 @@
1
+ import { ArtisanRequestHeaders } from "@artisan-commerce/types";
2
+ export interface ProductsHTTPConfig {
3
+ filterBy: Filters;
4
+ groupBy?: GROUPS;
5
+ orderBy?: Order;
6
+ pagination?: Pagination;
7
+ additionalFilters?: AdditionalFilters;
8
+ }
9
+ export declare type ID = string | number | (string | number)[];
10
+ export interface Filters {
11
+ vendorId: ID;
12
+ storeId: ID;
13
+ catalogueId: ID;
14
+ categoryId?: ID;
15
+ productId?: ID;
16
+ }
17
+ export declare type GROUPS = "CATEGORIES" | "TAGS";
18
+ export declare type ORDER_TYPES = "ALPHABETIC" | "PRICE" | "PREDEFINED";
19
+ export interface Order {
20
+ type?: ORDER_TYPES;
21
+ sort?: "ASC" | "DESC";
22
+ }
23
+ export interface Pagination {
24
+ page?: number;
25
+ vendor?: {
26
+ size: number;
27
+ };
28
+ store?: {
29
+ size: number;
30
+ };
31
+ catalogue?: {
32
+ size: number;
33
+ };
34
+ category?: {
35
+ size: number;
36
+ };
37
+ product?: {
38
+ size: number;
39
+ };
40
+ }
41
+ export interface AdditionalFilters {
42
+ price?: {
43
+ type?: "NORMAL" | "POINTS";
44
+ from?: number;
45
+ to?: number;
46
+ };
47
+ query?: string;
48
+ tags?: string[];
49
+ manufacturerId?: number | number[];
50
+ weigth?: {
51
+ unit: string;
52
+ value: number;
53
+ };
54
+ dimensions?: {
55
+ unit: string;
56
+ width: number;
57
+ height: number;
58
+ depth: number;
59
+ };
60
+ }
61
+ export interface RequestData {
62
+ headers: ArtisanRequestHeaders;
63
+ params: Record<string, string | number>;
64
+ query: Record<string, string | number | boolean>;
65
+ body: Record<string, any>;
66
+ }
@@ -0,0 +1,4 @@
1
+ export declare const getCacheKey: (hash: string) => import("../../../../types/build").BaseProduct | import("../../../../types/build").ProductDetails | import("../../../../types/build").CartProduct | import("../../../../types/build").Product[];
2
+ export declare const setCacheKey: (hash: string, data: any) => void;
3
+ export declare const isCacheExpired: () => boolean;
4
+ export declare const flushCache: () => void;
@@ -0,0 +1,11 @@
1
+ import { ArtisanRequest } from "@artisan-commerce/types";
2
+ import { ProductsHTTPConfig, RequestData } from "../../types/http.types";
3
+ export declare const handleHTTPCall: <T extends ProductsHTTPConfig>(path: string, config: T, data: RequestData, callback: (request: ArtisanRequest) => any) => Promise<import("../../../../types/build").BaseProduct | {
4
+ data: any;
5
+ hints: {
6
+ [x: string]: string | number | boolean;
7
+ };
8
+ config: ArtisanRequest;
9
+ error: string | undefined;
10
+ } | import("../../../../types/build").Product[]>;
11
+ export declare const fetchHandler: <T>(request: ArtisanRequest) => Promise<T>;
@@ -0,0 +1,38 @@
1
+ import { ProductsHTTPConfig } from "../../types/http.types";
2
+ /**
3
+ * Purge all invalid fields and values from the products http config
4
+ */
5
+ export declare const purgeHTTPConfig: <T extends ProductsHTTPConfig>(config: T) => T;
6
+ /**
7
+ * Purge invalid Filters
8
+ */
9
+ export declare const purgeFilters: <T extends ProductsHTTPConfig>(config: ProductsHTTPConfig) => T;
10
+ export declare const purgeGroup: <T extends ProductsHTTPConfig>(config: ProductsHTTPConfig) => T;
11
+ /**
12
+ * Purge Order invalid values
13
+ */
14
+ export declare const purgeOrder: <T extends ProductsHTTPConfig>(config: ProductsHTTPConfig) => T;
15
+ /**
16
+ * Purge pagination invalid keys
17
+ */
18
+ export declare const purgePagination: <T extends ProductsHTTPConfig>(config: ProductsHTTPConfig) => T;
19
+ /**
20
+ * Purge AdditionalFilters invalid keys
21
+ */
22
+ export declare const purgeAdditionalFilters: <T extends ProductsHTTPConfig>(config: ProductsHTTPConfig) => T;
23
+ /**
24
+ * Remove object field
25
+ */
26
+ export declare const purgeObject: (obj: Record<string, any>, validKeys: string[], field: string) => {
27
+ [x: string]: any;
28
+ };
29
+ /**
30
+ * Remove field value
31
+ */
32
+ export declare const purgeField: (obj: Record<string, any>, validKeys: string[], fieldName: string) => {
33
+ [x: string]: any;
34
+ };
35
+ export declare const purgeNotID: (obj: Record<string, any>) => {
36
+ [x: string]: any;
37
+ };
38
+ export declare const isNumberOrString: (data: any) => boolean;
@@ -0,0 +1,6 @@
1
+ import { ArtisanRequest } from "@artisan-commerce/types";
2
+ import { ProductsHTTPConfig, RequestData } from "../../types/http.types";
3
+ export declare const buildHTTPRequest: (path: string, config: ProductsHTTPConfig, data: RequestData) => ArtisanRequest;
4
+ export declare const filtersToQuery: (filters: ProductsHTTPConfig["filterBy"]) => {};
5
+ export declare const parseRoute: (path: string, params: RequestData["params"]) => string;
6
+ export declare const getRequestHash: (url: string) => string;
@@ -0,0 +1,9 @@
1
+ import { ArtisanRequest } from "@artisan-commerce/types";
2
+ export declare const transformResponse: (data: any, error: Error | undefined, req: ArtisanRequest) => {
3
+ data: any;
4
+ hints: {
5
+ [x: string]: string | number | boolean;
6
+ };
7
+ config: ArtisanRequest;
8
+ error: string | undefined;
9
+ };
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("products",[],t):"object"==typeof exports?exports.products=t():e.products=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=12)}({12:function(e,t){}})}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("products",[],t):"object"==typeof exports?exports.products=t():e.products=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=21)}({21:function(e,t){}})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@artisan-commerce/products",
3
3
  "description": "Artisan's product management library",
4
- "version": "0.0.2",
4
+ "version": "0.1.3",
5
5
  "main": "./build/main.bundle.js",
6
6
  "types": "./build/src/index.d.ts",
7
7
  "files": [
@@ -14,9 +14,9 @@
14
14
  "dev": "webpack --watch --config webpack.dev.js",
15
15
  "build": "webpack --config webpack.prod.js",
16
16
  "start:build": "nodemon ./build/main.bundle.js",
17
- "test": "jest --watchAll --passWithNoTests",
17
+ "test": "jest --watchAll",
18
18
  "test:all": "npm run test -- --watchAll=false --coverage",
19
- "test:ci": "cross-env CI=true jest --runInBand --passWithNoTests",
19
+ "test:ci": "cross-env CI=true jest --runInBand",
20
20
  "test:staged": "npm run test:ci --findRelatedTests",
21
21
  "check-types": "tsc --noEmit",
22
22
  "lint": "eslint --ignore-path .gitignore --ignore-pattern !cypress/.eslintrc.js --ext .js,jsx,.ts,.tsx .",
@@ -31,15 +31,16 @@
31
31
  "author": "Luis Eduardo Andrade",
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
- "@artisan-commerce/builders": "^0.1.1",
34
+ "@artisan-commerce/builders": "^0.1.2",
35
35
  "@bugsnag/js": "^7.2.0",
36
36
  "axios": "^0.19.2",
37
37
  "i18next": "^19.6.2",
38
38
  "i18next-browser-languagedetector": "^5.0.0",
39
- "i18next-xhr-backend": "^3.2.2"
39
+ "i18next-xhr-backend": "^3.2.2",
40
+ "sha1": "^1.1.1"
40
41
  },
41
42
  "devDependencies": {
42
- "@artisan-commerce/types": "^0.2.0",
43
+ "@artisan-commerce/types": "^0.3.0",
43
44
  "@babel/core": "^7.10.5",
44
45
  "@babel/preset-env": "^7.10.4",
45
46
  "@babel/preset-react": "^7.10.4",
@@ -47,6 +48,7 @@
47
48
  "@types/jest": "^26.0.5",
48
49
  "@types/jest-in-case": "^1.0.2",
49
50
  "@types/node": "^14.0.24",
51
+ "@types/sha1": "^1.1.2",
50
52
  "@typescript-eslint/eslint-plugin": "^3.7.0",
51
53
  "@typescript-eslint/parser": "^3.7.0",
52
54
  "avn": "^0.2.4",
@@ -68,6 +70,7 @@
68
70
  "is-ci-cli": "^2.1.2",
69
71
  "jest": "^24.9.0",
70
72
  "jest-axe": "^3.5.0",
73
+ "jest-extended": "^0.11.5",
71
74
  "jest-in-case": "^1.0.2",
72
75
  "jest-styled-components": "^7.0.2",
73
76
  "nodemon": "^2.0.4",
@@ -79,9 +82,10 @@
79
82
  "ts-loader": "^8.0.2",
80
83
  "typescript": "^3.9.7",
81
84
  "webpack": "^4.43.0",
85
+ "webpack-bundle-analyzer": "^3.9.0",
82
86
  "webpack-cli": "^3.3.12",
83
87
  "webpack-dev-server": "^3.11.0",
84
88
  "webpack-merge": "^5.0.9"
85
89
  },
86
- "gitHead": "720bb9d861c9897cbe82400f4b8a1847b840c958"
90
+ "gitHead": "2e06658726110f5744ea05e7e68dcc9a908f8902"
87
91
  }
@@ -1,23 +0,0 @@
1
- export declare const getPassword: (...args: any[]) => string;
2
- export declare const getUsername: (firstName?: string | undefined, lastName?: string | undefined) => string;
3
- export declare const genId: () => string;
4
- export declare const genName: (firstName?: string | undefined, lastName?: string | undefined, gender?: number | undefined) => string;
5
- export declare const genEmail: (firstName?: string | undefined, lastName?: string | undefined, provider?: string | undefined) => string;
6
- export declare const genCompanyName: (format?: number | undefined) => string;
7
- export declare const genParagraph: (sentenceCount?: number | undefined) => string;
8
- export declare const genTitle: () => string;
9
- export declare const genNumber: {
10
- (max?: number | undefined): number;
11
- (options?: {
12
- min?: number | undefined;
13
- max?: number | undefined;
14
- precision?: number | undefined;
15
- } | undefined): number;
16
- };
17
- export declare const getBoolean: () => boolean;
18
- export declare const genBiasBoolean: (bias: number) => boolean;
19
- export declare const genDocument: (digits: number) => string;
20
- export declare const genMobilPhone: (countryCode: string) => string;
21
- export declare const fillNumber: (num: string, max?: number | undefined) => string;
22
- export declare const chooseRandom: <T>(arr: T[]) => T;
23
- export declare const chooseRandomEnum: <T>(anEnum: T) => T[keyof T];
@@ -1,2 +0,0 @@
1
- import { User } from "../types/user.types";
2
- export declare const buildUser: (overrides?: Partial<User>) => User;
@@ -1,6 +0,0 @@
1
- import { LogInByTokenRes, LogInByCredentials } from "./auth.service.types";
2
- import { User } from "../../types/user.types";
3
- export declare const fetchAuthToken: (token: string | null) => Promise<LogInByTokenRes>;
4
- export declare const logInUser: (email: string, password: string) => Promise<LogInByCredentials>;
5
- export declare const updateUserService: (user: User) => Promise<User>;
6
- export declare const logOutService: (authToken: string) => Promise<unknown>;
@@ -1,8 +0,0 @@
1
- import { User } from "../../types/user.types";
2
- declare type LogInRes = {
3
- token: string;
4
- user: User;
5
- };
6
- export declare type LogInByTokenRes = LogInRes;
7
- export declare type LogInByCredentials = LogInRes;
8
- export {};
@@ -1,12 +0,0 @@
1
- export interface User {
2
- id: string;
3
- name: string;
4
- lastName: string;
5
- email: string;
6
- phone?: string;
7
- rol: UserRol;
8
- }
9
- export declare enum UserRol {
10
- ADMIN = "Admin",
11
- VIEWER = "Viewer"
12
- }
@@ -1,2 +0,0 @@
1
- declare const axiosDefault: import("axios").AxiosInstance;
2
- export default axiosDefault;