@djust-b2b/djust-front-sdk 2.17.1 → 2.18.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.
package/lib/index.d.ts CHANGED
@@ -44,7 +44,7 @@ export declare const DjustSDK: {
44
44
  updateCommercialOrderBillingInformation({ orderId, billingAddressId, }: import("./interfaces").UpdateCommercialOrderBillingInformationParameters): Promise<void>;
45
45
  setCommercialOrderStatusAsCreated({ orderId, paymentInfo, }: import("./interfaces").SetCommercialOrderStatusAsCreatedParameters): Promise<void>;
46
46
  setCommercialOrderStatusAsOnHold({ orderId, }: import("./interfaces").SetCommercialOrderStatusAsOnHoldParameters): Promise<void>;
47
- syncCommercialOrder(orderId: string): Promise<void>;
47
+ syncCommercialOrder(orderId: string): Promise<unknown>;
48
48
  getCommercialOrderPaymentPageUrl({ orderId, paymentOption, paymentProvider, }: import("./interfaces").GetCommercialOrderPaymentPageUrlParameters): Promise<string>;
49
49
  createCommercialOrderPreauthorization({ orderId, paymentProvider, authorId, browserInfo, ipAddress, paymentCardInfo, }: import("./interfaces").CreateCommercialOrderPreauthorizationParameters): Promise<import("./interfaces").CreateCommercialOrderPreauthorizationResponse>;
50
50
  updateCommercialOrderShippingAddress({ orderId, shippingAddressId, }: import("./interfaces").UpdateCommercialOrderShippingAddressParameters): Promise<void>;
@@ -380,9 +380,9 @@ export declare function setCommercialOrderStatusAsOnHold({ orderId, }: SetCommer
380
380
  * ```
381
381
  *
382
382
  * @param {string} orderId - The ID of the commercial order to synchronize
383
- * @returns {Promise<void>} A promise resolving when the synchronization is triggered
383
+ * @returns {Promise<unknown>} A promise resolving when the synchronization is triggered
384
384
  */
385
- export declare function syncCommercialOrder(orderId: string): Promise<void>;
385
+ export declare function syncCommercialOrder(orderId: string): Promise<unknown>;
386
386
  /**
387
387
  * 🚚 Gets payment page url for a specific order.
388
388
  *
@@ -529,11 +529,11 @@ async function setCommercialOrderStatusAsOnHold({ orderId, }) {
529
529
  * ```
530
530
  *
531
531
  * @param {string} orderId - The ID of the commercial order to synchronize
532
- * @returns {Promise<void>} A promise resolving when the synchronization is triggered
532
+ * @returns {Promise<unknown>} A promise resolving when the synchronization is triggered
533
533
  */
534
534
  async function syncCommercialOrder(orderId) {
535
535
  (0, parameters_validation_1.required)({ orderId });
536
- await (0, fetch_instance_1.enhancedFetch)({
536
+ return await (0, fetch_instance_1.enhancedFetch)({
537
537
  method: "PUT",
538
538
  path: `/v1/shop/commercial-orders/${orderId}/sync`,
539
539
  body: JSON.stringify({}),
@@ -58,30 +58,36 @@ const initialize = (initConfig) => {
58
58
  "https://39ef5198e24fa0ec7b743c460bd1ca63@o1191347.ingest.us.sentry.io/4508879498575872",
59
59
  environment: `${clientConfig.clientName}-${clientConfig.env}`,
60
60
  release: `${SDK_VERSION || "unknown"}`,
61
- integrations: [
62
- Sentry.browserTracingIntegration(),
63
- Sentry.replayIntegration(),
64
- Sentry.httpClientIntegration(),
65
- Sentry.breadcrumbsIntegration({
66
- console: true,
67
- dom: true,
68
- fetch: true,
69
- history: true,
70
- xhr: true,
71
- }),
72
- Sentry.browserApiErrorsIntegration({
73
- setTimeout: true,
74
- setInterval: true,
75
- requestAnimationFrame: true,
76
- XMLHttpRequest: true,
77
- eventTarget: true,
78
- }),
79
- ],
80
- tracesSampleRate: 1.0,
81
- replaysSessionSampleRate: 0.1,
82
- replaysOnErrorSampleRate: 1.0,
83
- profilesSampleRate: 1.0,
84
- sendDefaultPii: true,
61
+ tracesSampleRate: 0,
62
+ tracePropagationTargets: [],
63
+ beforeSend(event) {
64
+ if (event.type === "transaction") {
65
+ return null;
66
+ }
67
+ return event;
68
+ },
69
+ integrations: (defaults) => defaults.map((integration) => {
70
+ if (integration.name === "Breadcrumbs") {
71
+ return Sentry.breadcrumbsIntegration({
72
+ console: true,
73
+ dom: false,
74
+ fetch: true,
75
+ history: true,
76
+ xhr: true,
77
+ });
78
+ }
79
+ if (integration.name === "BrowserApiErrors") {
80
+ return Sentry.browserApiErrorsIntegration({
81
+ setTimeout: true,
82
+ setInterval: true,
83
+ requestAnimationFrame: true,
84
+ XMLHttpRequest: true,
85
+ eventTarget: true,
86
+ });
87
+ }
88
+ return integration;
89
+ }),
90
+ sendDefaultPii: false,
85
91
  });
86
92
  if ((_a = clientConfig.logLevels) === null || _a === void 0 ? void 0 : _a.includes("info")) {
87
93
  console.info(`[Djust SDK] Sentry initialized in ${clientConfig.clientName || "unknown"} environment: ${clientConfig.env || "unknown"}.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djust-b2b/djust-front-sdk",
3
- "version": "2.17.1",
3
+ "version": "2.18.0",
4
4
  "description": "DJUST Front SDK is a versatile JavaScript Software Development Kit (SDK)",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -17,7 +17,12 @@
17
17
  "commit": "cz",
18
18
  "prepack": "npmignore --auto"
19
19
  },
20
- "keywords": [],
20
+ "keywords": [
21
+ "djust",
22
+ "b2b",
23
+ "sdk",
24
+ "api-client"
25
+ ],
21
26
  "author": "sami@djust.io",
22
27
  "license": "MIT",
23
28
  "devDependencies": {