@lookiero/checkout 0.8.20 → 0.8.21
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.
- package/dist/index.d.ts +3 -3
- package/dist/infrastructure/delivery/bootstrap.d.ts +1 -1
- package/dist/infrastructure/delivery/http/fetchHttpClient.d.ts +1 -1
- package/dist/infrastructure/delivery/http/fetchHttpClient.js +2 -2
- package/dist/infrastructure/ui/Root.d.ts +2 -2
- package/dist/shared/logging/SentryLogger.d.ts +5 -2
- package/dist/shared/logging/SentryLogger.js +3 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { CheckoutStatus } from "./domain/checkout/model/checkout";
|
|
|
4
4
|
import { RootProps } from "./infrastructure/ui/Root";
|
|
5
5
|
import { CheckoutProjection } from "./projection/checkout/checkout";
|
|
6
6
|
import { IsCheckoutAccessibleByCustomerIdProjection } from "./projection/checkout/viewIsCheckoutAccessibleByCustomerId";
|
|
7
|
-
import {
|
|
7
|
+
import { SentryEnvironment } from "./shared/logging/SentryLogger";
|
|
8
8
|
interface IsCheckoutAccessibleFunctionArgs {
|
|
9
9
|
readonly customerId: string | undefined;
|
|
10
10
|
}
|
|
@@ -19,8 +19,8 @@ interface FirstAvailableCheckoutByCustomerIdFunction {
|
|
|
19
19
|
}
|
|
20
20
|
interface BootstrapFunctionArgs {
|
|
21
21
|
readonly getAuthToken: () => Promise<string>;
|
|
22
|
-
readonly apiUrl: string;
|
|
23
|
-
readonly sentry:
|
|
22
|
+
readonly apiUrl: () => string;
|
|
23
|
+
readonly sentry: () => SentryEnvironment;
|
|
24
24
|
readonly translations: EndpointFunction[];
|
|
25
25
|
}
|
|
26
26
|
interface BootstrapFunctionReturn {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BuildBootstrapFunctionReturn } from "@lookiero/messaging-react";
|
|
2
2
|
interface BootstrapFunctionArgs {
|
|
3
3
|
readonly getAuthToken: () => Promise<string>;
|
|
4
|
-
readonly apiUrl: string;
|
|
4
|
+
readonly apiUrl: () => string;
|
|
5
5
|
}
|
|
6
6
|
interface BootstrapFunction {
|
|
7
7
|
(args: BootstrapFunctionArgs): BuildBootstrapFunctionReturn;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const fetchHttpPost = ({ apiUrl, getAuthToken }) => async ({ endpoint, body, signal, result }) => {
|
|
2
|
-
const response = await fetch(`${apiUrl}${endpoint}`, {
|
|
2
|
+
const response = await fetch(`${apiUrl()}${endpoint}`, {
|
|
3
3
|
method: "POST",
|
|
4
4
|
headers: {
|
|
5
5
|
["Content-Type"]: "application/json",
|
|
@@ -11,7 +11,7 @@ const fetchHttpPost = ({ apiUrl, getAuthToken }) => async ({ endpoint, body, sig
|
|
|
11
11
|
return await processResponse({ response, result });
|
|
12
12
|
};
|
|
13
13
|
const fetchHttpGet = ({ apiUrl, getAuthToken }) => async ({ endpoint, signal, result }) => {
|
|
14
|
-
const response = await fetch(`${apiUrl}${endpoint}`, {
|
|
14
|
+
const response = await fetch(`${apiUrl()}${endpoint}`, {
|
|
15
15
|
method: "GET",
|
|
16
16
|
credentials: "include",
|
|
17
17
|
headers: {
|
|
@@ -3,13 +3,13 @@ import { MessagingRoot } from "@lookiero/messaging-react/bootstrap";
|
|
|
3
3
|
import { ComponentType } from "react";
|
|
4
4
|
import { useRoutes as reactRouterUseRoutes } from "react-router-native";
|
|
5
5
|
import { Customer } from "../../projection/shared/customer";
|
|
6
|
-
import {
|
|
6
|
+
import { SentryEnvironment } from "../../shared/logging/SentryLogger";
|
|
7
7
|
import { Menu, TabBar } from "./views/navigation/Navigation";
|
|
8
8
|
interface RootFunctionArgs {
|
|
9
9
|
readonly Messaging: MessagingRoot;
|
|
10
10
|
readonly I18n: I18n;
|
|
11
11
|
readonly development?: boolean;
|
|
12
|
-
readonly sentry:
|
|
12
|
+
readonly sentry: () => SentryEnvironment;
|
|
13
13
|
readonly getAuthToken: () => Promise<string>;
|
|
14
14
|
}
|
|
15
15
|
interface RootFunction {
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Platform } from "react-native";
|
|
2
2
|
import { Logger } from "./Logger";
|
|
3
|
-
interface
|
|
3
|
+
interface SentryEnvironment {
|
|
4
4
|
readonly publicKey: string;
|
|
5
5
|
readonly environment: `${typeof Platform.OS}-${"DEV" | "PROD" | "EXPO"}`;
|
|
6
6
|
readonly release: string;
|
|
7
7
|
readonly project: string;
|
|
8
8
|
}
|
|
9
|
+
interface SentryLoggerFunctionArgs {
|
|
10
|
+
(): SentryEnvironment;
|
|
11
|
+
}
|
|
9
12
|
interface SentryLoggerFunction {
|
|
10
13
|
(args: SentryLoggerFunctionArgs): Logger;
|
|
11
14
|
}
|
|
12
15
|
declare const sentryLogger: SentryLoggerFunction;
|
|
13
|
-
export type {
|
|
16
|
+
export type { SentryEnvironment };
|
|
14
17
|
export { sentryLogger };
|
|
@@ -49,12 +49,13 @@ const DENIED_URLS = [
|
|
|
49
49
|
/webappstoolbarba\.texthelp\.com\//i,
|
|
50
50
|
/metrics\.itunes\.apple\.com\.edgesuite\.net\//i,
|
|
51
51
|
];
|
|
52
|
-
const sentryLogger = (
|
|
52
|
+
const sentryLogger = (environment) => {
|
|
53
53
|
let globalHub;
|
|
54
54
|
let currentHub;
|
|
55
55
|
const createHub = () => {
|
|
56
|
+
const { environment: clientEnvironment, release, publicKey, project } = environment();
|
|
56
57
|
const client = new Client({
|
|
57
|
-
environment,
|
|
58
|
+
environment: clientEnvironment,
|
|
58
59
|
release,
|
|
59
60
|
dsn: `https://${publicKey}@o179049.ingest.sentry.io/${project}`,
|
|
60
61
|
integrations: integrations(),
|