@alba-cars/common-modules 1.4.2 → 1.4.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.
@@ -45,6 +45,9 @@ export declare const UTIL_ENDPOINTS: {
45
45
  media: {
46
46
  createS3Url: string;
47
47
  preprocessMediaUrl: string;
48
+ removeS3Media: string;
49
+ removeVehicleMedia: string;
50
+ removeByIdentifier: string;
48
51
  };
49
52
  };
50
53
  export declare const AUTH_ENDPOINTS: {
@@ -161,6 +161,9 @@ exports.UTIL_ENDPOINTS = {
161
161
  media: {
162
162
  createS3Url: "/utils/get-upload-url",
163
163
  preprocessMediaUrl: "/utils/process-media",
164
+ removeS3Media: '/utils/remove-s3',
165
+ removeVehicleMedia: '/utils/remove-vehcile-media',
166
+ removeByIdentifier: '/utils/remove-by-identifier'
164
167
  },
165
168
  };
166
169
  exports.AUTH_ENDPOINTS = {
@@ -10,18 +10,23 @@ const BASE_URL = process.env.NEXT_PUBLIC_API_URL;
10
10
  const AUTH_STORAGE_KEY = "auth_tokens";
11
11
  let isRefreshing = false;
12
12
  let refreshSubscribers = [];
13
+ const isServer = typeof window === "undefined";
13
14
  const getTokens = () => {
14
- if (typeof window === "undefined")
15
+ if (isServer)
15
16
  return null;
16
17
  const tokens = localStorage.getItem(AUTH_STORAGE_KEY);
17
18
  return tokens ? JSON.parse(tokens) : null;
18
19
  };
19
20
  exports.getTokens = getTokens;
20
21
  const setTokens = (tokens) => {
22
+ if (isServer)
23
+ return;
21
24
  localStorage.setItem(AUTH_STORAGE_KEY, JSON.stringify(tokens));
22
25
  };
23
26
  exports.setTokens = setTokens;
24
27
  const removeTokens = () => {
28
+ if (isServer)
29
+ return;
25
30
  localStorage.removeItem(AUTH_STORAGE_KEY);
26
31
  };
27
32
  exports.removeTokens = removeTokens;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.4.2",
6
+ "version": "1.4.3",
7
7
  "description": "A package containing DTOs, validation classes and common modules and interfaces for Alba Cars",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",