@lookiero/checkout 12.28.0 → 12.29.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.
@@ -28,7 +28,7 @@ const order = {
28
28
  coupon: "MYLOOKIERO",
29
29
  };
30
30
  const customer = {
31
- customerId: "0004a049-fef6-4bac-a45d-b3a904b4ee4b",
31
+ customerId: "5d7228e5-2220-4437-bdab-e5e6fb28e49d",
32
32
  country: Country.ES,
33
33
  segment: Segment.WOMEN,
34
34
  email: "email@example.com",
@@ -49,10 +49,10 @@ const apiUrl = Platform.OS !== "web"
49
49
  ? "/local-to-dev"
50
50
  : "http://localhost:3004/local-to-dev"
51
51
  : "/checkout/api";
52
- const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIyMDgzMTMsImV4cCI6MTc2NTk4NzE0MywiZGlzcGxheU5hbWUiOiJUZXN0aW5nIiwiY291bnRyeV9jb2RlIjoiTkwiLCJhY2Nlc3NWaWEiOiJlbWFpbCIsInN1YnNjcmlwdGlvblN0YXJ0aW5nRGF0ZSI6IjIwMjAtMTAtMDEiLCJpbXBlcnNvbmF0ZWQiOmZhbHNlLCJ1dWlkIjoiMDAwNGEwNDktZmVmNi00YmFjLWE0NWQtYjNhOTA0YjRlZTRiIiwidHJhZGVuYW1lIjoiTE9PS0lFUk8iLCJpYXQiOjE3NjMzOTUxNDN9.X3UQ0NSow2zu76ROCm4pl2cwTkDTOhHOaQT9N8zcqdg";
52
+ const authToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIyMDgzMTMsImV4cCI6MTc3MDQ1NzEzMCwiZGlzcGxheU5hbWUiOiJtYWlsLmRlditCRlUtLTIwMzc0MjExMTYiLCJjb3VudHJ5X2NvZGUiOiJOTCIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwic3Vic2NyaXB0aW9uU3RhcnRpbmdEYXRlIjoiMjAyMC0xMC0wMSIsImltcGVyc29uYXRlZCI6ZmFsc2UsInV1aWQiOiIwMDA0YTA0OS1mZWY2LTRiYWMtYTQ1ZC1iM2E5MDRiNGVlNGIiLCJ0cmFkZW5hbWUiOiJMT09LSUVSTyIsImlhdCI6MTc2Nzc3ODczMH0.5x6bj95AAh2c4zoQaR5AMrTO6xAkW73KHyYbFKnYzD8";
53
53
  const getAuthToken = () => Promise.resolve(authToken);
54
54
  const externalTranslationsUrl = Platform.OS !== "web"
55
- ? "https://backend-for-user.dev.envs.lookiero.tech/api/v2/translations"
55
+ ? "https://web2.sp.dev.aws.lookiero.es/api/v2/translations"
56
56
  : __DEV__
57
57
  ? process.env.EXPO_PUBLIC_CI
58
58
  ? "/local-to-external-i18n"
@@ -1,15 +1,17 @@
1
1
  import { useCallback } from "react";
2
2
  import { useCommand } from "@lookiero/messaging-react";
3
- import { NotificationLevel, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
3
+ import { NotificationLevel, useClearNotifications, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
4
4
  import { returnCheckoutItem as returnCheckoutItemCommand } from "../../../../domain/checkoutItem/command/returnCheckoutItem";
5
5
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
6
6
  import { I18nMessages } from "../../../ui/i18n/i18n";
7
7
  const useReturnCheckoutItem = ({ checkoutItemId, logger }) => {
8
8
  const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
9
9
  const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
10
+ const [clearNotifications] = useClearNotifications({ contextId: MESSAGING_CONTEXT_ID, logger });
10
11
  const returnCheckoutItem = useCallback(async ({ feedbacks }) => {
11
12
  try {
12
13
  await commandBus(returnCheckoutItemCommand({ aggregateId: checkoutItemId, feedbacks }));
14
+ await clearNotifications();
13
15
  createNotification({
14
16
  bodyI18nKey: I18nMessages.RETURN_QUESTION_TOAST_SUCCESS,
15
17
  level: NotificationLevel.SUCCESS,
@@ -22,7 +24,7 @@ const useReturnCheckoutItem = ({ checkoutItemId, logger }) => {
22
24
  bodyI18nKey: I18nMessages.TOAST_GENERIC_ERROR,
23
25
  });
24
26
  }
25
- }, [checkoutItemId, commandBus, createNotification, logger]);
27
+ }, [checkoutItemId, commandBus, clearNotifications, createNotification, logger]);
26
28
  return [returnCheckoutItem, status];
27
29
  };
28
30
  export { useReturnCheckoutItem };
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "12.28.0";
2
- export declare const RELEASE = "checkout@12.28.0";
1
+ export declare const VERSION = "12.29.0";
2
+ export declare const RELEASE = "checkout@12.29.0";
@@ -1,2 +1,2 @@
1
- export const VERSION = "12.28.0";
2
- export const RELEASE = "checkout@12.28.0";
1
+ export const VERSION = "12.29.0";
2
+ export const RELEASE = "checkout@12.29.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "12.28.0",
3
+ "version": "12.29.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": "false",
@@ -28,13 +28,13 @@
28
28
  "@lookiero/sty-psp-i18n": "^1.5",
29
29
  "@lookiero/sty-psp-locale": "^2.1",
30
30
  "@lookiero/sty-psp-logging": "^2.2",
31
- "@lookiero/sty-psp-notifications": "^2.13",
31
+ "@lookiero/sty-psp-notifications": "^2.14",
32
32
  "@lookiero/sty-psp-react-native": "^2.0",
33
33
  "@lookiero/sty-psp-segment": "^0.1",
34
- "@lookiero/sty-psp-storage": "^1.0",
34
+ "@lookiero/sty-psp-storage": "^1.1",
35
35
  "@lookiero/sty-psp-tracking": "^2.4",
36
36
  "@lookiero/sty-psp-ui": "^3.3",
37
- "@lookiero/sty-psp-ui-settings": "^1.4",
37
+ "@lookiero/sty-psp-ui-settings": "^1.5",
38
38
  "@lookiero/sty-psp-units": "^0.1",
39
39
  "@lookiero/sty-psp-uuid": "^0.2",
40
40
  "@lookiero/sty-sp-tradename": "^1.0",
package/proxy-server.js CHANGED
@@ -1,6 +1,6 @@
1
- const express = require('express');
2
- const { createProxyMiddleware } = require('http-proxy-middleware');
3
- const cors = require('cors');
1
+ const express = require("express");
2
+ const { createProxyMiddleware } = require("http-proxy-middleware");
3
+ const cors = require("cors");
4
4
  const app = express();
5
5
 
6
6
  app.use(cors());
@@ -9,39 +9,53 @@ const DEV_UAF_SP = "https://web2.sp.dev.aws.lookiero.es";
9
9
  const DEV_BFU = "https://backend-for-user.dev.envs.lookiero.tech";
10
10
  const PROD_UAF_PROXY = "https://lookiero.es";
11
11
 
12
- app.use('/local-to-dev', createProxyMiddleware({
13
- target: DEV_UAF_SP,
14
- pathRewrite: { '^/local-to-dev': '/checkout/api' },
15
- changeOrigin: true,
16
- logLevel: 'debug',
17
- }));
18
-
19
- app.use('/local-to-prod', createProxyMiddleware({
20
- target: PROD_UAF_PROXY,
21
- pathRewrite: { '^/local-to-prod': '/checkout/api' },
22
- changeOrigin: true,
23
- logLevel: 'debug',
24
- }));
25
-
26
- app.use('/local-to-external-i18n', createProxyMiddleware({
27
- target: DEV_BFU,
28
- pathRewrite: { "^/local-to-external-i18n": "/api/v2/translations" },
29
- changeOrigin: true,
30
- logLevel: "debug",
31
- }));
12
+ app.use(
13
+ "/local-to-dev",
14
+ createProxyMiddleware({
15
+ target: DEV_UAF_SP,
16
+ pathRewrite: { "^/local-to-dev": "/checkout/api" },
17
+ changeOrigin: true,
18
+ logLevel: "debug",
19
+ }),
20
+ );
21
+
22
+ app.use(
23
+ "/local-to-prod",
24
+ createProxyMiddleware({
25
+ target: PROD_UAF_PROXY,
26
+ pathRewrite: { "^/local-to-prod": "/checkout/api" },
27
+ changeOrigin: true,
28
+ logLevel: "debug",
29
+ }),
30
+ );
31
+
32
+ app.use(
33
+ "/local-to-external-i18n",
34
+ createProxyMiddleware({
35
+ target: DEV_UAF_SP,
36
+ pathRewrite: { "^/local-to-external-i18n": "/api/v2/translations" },
37
+ changeOrigin: true,
38
+ logLevel: "debug",
39
+ }),
40
+ );
32
41
 
33
42
  // Payments
34
- app.use('/web', createProxyMiddleware({
35
- target: DEV_UAF_SP,
36
- changeOrigin: true,
37
- }));
38
-
39
- app.use('/graphql', createProxyMiddleware({
40
- target: DEV_BFU,
41
- changeOrigin: true,
42
- }));
43
+ app.use(
44
+ "/web",
45
+ createProxyMiddleware({
46
+ target: DEV_UAF_SP,
47
+ changeOrigin: true,
48
+ }),
49
+ );
50
+
51
+ app.use(
52
+ "/graphql",
53
+ createProxyMiddleware({
54
+ target: DEV_BFU,
55
+ changeOrigin: true,
56
+ }),
57
+ );
43
58
 
44
59
  app.listen(3004, () => {
45
- console.log('Proxy server running on http://localhost:3004');
60
+ console.log("Proxy server running on http://localhost:3004");
46
61
  });
47
-
package/src/ExpoRoot.tsx CHANGED
@@ -37,7 +37,7 @@ const order: OrderProjection = {
37
37
  };
38
38
 
39
39
  const customer: Customer = {
40
- customerId: "0004a049-fef6-4bac-a45d-b3a904b4ee4b",
40
+ customerId: "5d7228e5-2220-4437-bdab-e5e6fb28e49d",
41
41
  country: Country.ES,
42
42
  segment: Segment.WOMEN,
43
43
  email: "email@example.com",
@@ -62,12 +62,12 @@ const apiUrl =
62
62
  : "http://localhost:3004/local-to-dev"
63
63
  : "/checkout/api";
64
64
  const authToken =
65
- "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIyMDgzMTMsImV4cCI6MTc2NTk4NzE0MywiZGlzcGxheU5hbWUiOiJUZXN0aW5nIiwiY291bnRyeV9jb2RlIjoiTkwiLCJhY2Nlc3NWaWEiOiJlbWFpbCIsInN1YnNjcmlwdGlvblN0YXJ0aW5nRGF0ZSI6IjIwMjAtMTAtMDEiLCJpbXBlcnNvbmF0ZWQiOmZhbHNlLCJ1dWlkIjoiMDAwNGEwNDktZmVmNi00YmFjLWE0NWQtYjNhOTA0YjRlZTRiIiwidHJhZGVuYW1lIjoiTE9PS0lFUk8iLCJpYXQiOjE3NjMzOTUxNDN9.X3UQ0NSow2zu76ROCm4pl2cwTkDTOhHOaQT9N8zcqdg";
65
+ "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIyMDgzMTMsImV4cCI6MTc3MDQ1NzEzMCwiZGlzcGxheU5hbWUiOiJtYWlsLmRlditCRlUtLTIwMzc0MjExMTYiLCJjb3VudHJ5X2NvZGUiOiJOTCIsImFjY2Vzc1ZpYSI6ImVtYWlsIiwic3Vic2NyaXB0aW9uU3RhcnRpbmdEYXRlIjoiMjAyMC0xMC0wMSIsImltcGVyc29uYXRlZCI6ZmFsc2UsInV1aWQiOiIwMDA0YTA0OS1mZWY2LTRiYWMtYTQ1ZC1iM2E5MDRiNGVlNGIiLCJ0cmFkZW5hbWUiOiJMT09LSUVSTyIsImlhdCI6MTc2Nzc3ODczMH0.5x6bj95AAh2c4zoQaR5AMrTO6xAkW73KHyYbFKnYzD8";
66
66
  const getAuthToken = () => Promise.resolve(authToken);
67
67
 
68
68
  const externalTranslationsUrl =
69
69
  Platform.OS !== "web"
70
- ? "https://backend-for-user.dev.envs.lookiero.tech/api/v2/translations"
70
+ ? "https://web2.sp.dev.aws.lookiero.es/api/v2/translations"
71
71
  : __DEV__
72
72
  ? process.env.EXPO_PUBLIC_CI
73
73
  ? "/local-to-external-i18n"
@@ -1,7 +1,7 @@
1
1
  import { useCallback } from "react";
2
2
  import { CommandStatus, useCommand } from "@lookiero/messaging-react";
3
3
  import { Logger } from "@lookiero/sty-psp-logging";
4
- import { NotificationLevel, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
4
+ import { NotificationLevel, useClearNotifications, useCreateToastNotification } from "@lookiero/sty-psp-notifications";
5
5
  import { returnCheckoutItem as returnCheckoutItemCommand } from "../../../../domain/checkoutItem/command/returnCheckoutItem";
6
6
  import { Feedbacks } from "../../../../domain/checkoutItem/model/feedbacks";
7
7
  import { MESSAGING_CONTEXT_ID } from "../../../delivery/baseBootstrap";
@@ -29,11 +29,15 @@ interface UseReturnCheckoutItemFunction {
29
29
  const useReturnCheckoutItem: UseReturnCheckoutItemFunction = ({ checkoutItemId, logger }) => {
30
30
  const [commandBus, status] = useCommand({ contextId: MESSAGING_CONTEXT_ID });
31
31
  const [createNotification] = useCreateToastNotification({ contextId: MESSAGING_CONTEXT_ID, logger });
32
+ const [clearNotifications] = useClearNotifications({ contextId: MESSAGING_CONTEXT_ID, logger });
32
33
 
33
34
  const returnCheckoutItem: ReturnCheckoutItemFunction = useCallback(
34
35
  async ({ feedbacks }) => {
35
36
  try {
36
37
  await commandBus(returnCheckoutItemCommand({ aggregateId: checkoutItemId, feedbacks }));
38
+
39
+ await clearNotifications();
40
+
37
41
  createNotification({
38
42
  bodyI18nKey: I18nMessages.RETURN_QUESTION_TOAST_SUCCESS,
39
43
  level: NotificationLevel.SUCCESS,
@@ -46,7 +50,7 @@ const useReturnCheckoutItem: UseReturnCheckoutItemFunction = ({ checkoutItemId,
46
50
  });
47
51
  }
48
52
  },
49
- [checkoutItemId, commandBus, createNotification, logger],
53
+ [checkoutItemId, commandBus, clearNotifications, createNotification, logger],
50
54
  );
51
55
 
52
56
  return [returnCheckoutItem, status];
package/tsconfig.json CHANGED
@@ -9,6 +9,7 @@
9
9
  "fake-dependencies/**/*.tsx"
10
10
  ],
11
11
  "compilerOptions": {
12
- "outDir": "./dist"
12
+ "outDir": "./dist",
13
+ "baseUrl": "."
13
14
  }
14
15
  }