@acorex/core 17.0.2 → 17.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,8 @@ export class AXLocalStorageService {
|
|
9
9
|
}
|
10
10
|
get(key) {
|
11
11
|
if (isBrowser()) {
|
12
|
-
|
12
|
+
const value = localStorage.getItem(key);
|
13
|
+
return value ? JSON.parse(value) : null;
|
13
14
|
}
|
14
15
|
else {
|
15
16
|
return null;
|
@@ -55,4 +56,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
|
|
55
56
|
type: Inject,
|
56
57
|
args: [AX_LOCALSTORAGE_SECRET_KEY]
|
57
58
|
}] }] });
|
58
|
-
//# sourceMappingURL=data:application/json;base64,
|
59
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwtc3RvcmFnZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9jb3JlL3N0b3JhZ2Uvc3JjL2xvY2FsLXN0b3JhZ2Uuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDbEQsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsY0FBYyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ25FLE9BQU8sS0FBSyxRQUFRLE1BQU0sV0FBVyxDQUFDOztBQUd0QyxNQUFNLENBQUMsTUFBTSwwQkFBMEIsR0FBMkIsSUFBSSxjQUFjLENBQUMsNEJBQTRCLENBQUMsQ0FBQztBQUduSCxNQUFNLE9BQU8scUJBQXFCO0lBQ2hDLFlBQXdELFVBQWtCO1FBQWxCLGVBQVUsR0FBVixVQUFVLENBQVE7SUFBRyxDQUFDO0lBRTlFLEdBQUcsQ0FBYyxHQUFXO1FBQzFCLElBQUksU0FBUy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TdG9yYWdlLnJlbW92ZUl0ZW0oa2V5KTtcbiAgICB9XG4gIH1cblxuICBzZXRXaXRoRW5jcnlwdGlvbjxUID0gdW5rbm93bj4oa2V5OiBzdHJpbmcsIHZhbHVlOiBUKSB7XG4gICAgaWYgKGlzQnJvd3NlcigpKSB7XG4gICAgICBjb25zdCBlbmNyeXB0ZWQgPSBDcnlwdG9KUy5BRVMuZW5jcnlwdChKU09OLnN0cmluZ2lmeSh2YWx1ZSksIHRoaXMuc2VjcmV0X2tleSkudG9TdHJpbmcoKTtcbiAgICAgIHJldHVybiBsb2NhbFN0b3JhZ2Uuc2V0SXRlbShrZXksIGVuY3J5cHRlZCk7XG4gICAgfVxuICB9XG5cbiAgZ2V0V2l0aEVuY3JpcHRpb248VCA9IHVua25vd24+KGtleTogc3RyaW5nKTogVCB7XG4gICAgaWYgKGlzQnJvd3NlcigpKSB7XG4gICAgICBjb25zdCBlbmNyeXB0ZWQgPSBsb2NhbFN0b3JhZ2UuZ2V0SXRlbShrZXkpIHx8ICcnO1xuICAgICAgY29uc3QgZGVjcnlwdGVkID0gQ3J5cHRvSlMuQUVTLmRlY3J5cHQoZW5jcnlwdGVkLCB0aGlzLnNlY3JldF9rZXkpLnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcbiAgICAgIHJldHVybiBlbmNyeXB0ZWQgPyBKU09OLnBhcnNlKGRlY3J5cHRlZCkgOiB7fTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuICB9XG59XG4iXX0=
|
@@ -1,17 +1,30 @@
|
|
1
|
+
import { isBrowser } from '@acorex/core/platform';
|
1
2
|
import { Injectable } from '@angular/core';
|
2
3
|
import * as i0 from "@angular/core";
|
3
4
|
export class AXSessionStorageService {
|
4
5
|
get(key) {
|
5
|
-
|
6
|
+
if (isBrowser()) {
|
7
|
+
const value = sessionStorage.getItem(key);
|
8
|
+
return value ? JSON.parse(value) : null;
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
return null;
|
12
|
+
}
|
6
13
|
}
|
7
14
|
set(key, value) {
|
8
|
-
|
15
|
+
if (isBrowser()) {
|
16
|
+
return sessionStorage.setItem(key, JSON.stringify(value));
|
17
|
+
}
|
9
18
|
}
|
10
19
|
clear() {
|
11
|
-
|
20
|
+
if (isBrowser()) {
|
21
|
+
return sessionStorage.clear();
|
22
|
+
}
|
12
23
|
}
|
13
24
|
removeItem(key) {
|
14
|
-
|
25
|
+
if (isBrowser()) {
|
26
|
+
return sessionStorage.removeItem(key);
|
27
|
+
}
|
15
28
|
}
|
16
29
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXSessionStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
17
30
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXSessionStorageService }); }
|
@@ -19,4 +32,4 @@ export class AXSessionStorageService {
|
|
19
32
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXSessionStorageService, decorators: [{
|
20
33
|
type: Injectable
|
21
34
|
}] });
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2Vzc2lvbi1zdG9yYWdlLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvc3RvcmFnZS9zcmMvc2Vzc2lvbi1zdG9yYWdlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ2xELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBSTNDLE1BQU0sT0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GFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IEFYU3RvcmFnZSB9IGZyb20gJy4vc3RvcmFnZS5pbnRlcmZhY2UnO1xuXG5ASW5qZWN0YWJsZSgpXG5leHBvcnQgY2xhc3MgQVhTZXNzaW9uU3RvcmFnZVNlcnZpY2UgaW1wbGVtZW50cyBBWFN0b3JhZ2Uge1xuICBnZXQ8VCA9IHVua25vd24+KGtleTogc3RyaW5nKTogVCB7XG4gICAgaWYgKGlzQnJvd3NlcigpKSB7XG4gICAgICBjb25zdCB2YWx1ZSA9IHNlc3Npb25TdG9yYWdlLmdldEl0ZW0oa2V5KTtcbiAgICAgIHJldHVybiB2YWx1ZSA/IEpTT04ucGFyc2UodmFsdWUpIDogbnVsbDtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuICB9XG5cbiAgc2V0PFQgPSB1bmtub3duPihrZXk6IHN0cmluZywgdmFsdWU6IFQpOiB2b2lkIHtcbiAgICBpZiAoaXNCcm93c2VyKCkpIHtcbiAgICAgIHJldHVybiBzZXNzaW9uU3RvcmFnZS5zZXRJdGVtKGtleSwgSlNPTi5zdHJpbmdpZnkodmFsdWUpKTtcbiAgICB9XG4gIH1cblxuICBjbGVhcigpOiB2b2lkIHtcbiAgICBpZiAoaXNCcm93c2VyKCkpIHtcbiAgICAgIHJldHVybiBzZXNzaW9uU3RvcmFnZS5jbGVhcigpO1xuICAgIH1cbiAgfVxuXG4gIHJlbW92ZUl0ZW0oa2V5OiBzdHJpbmcpIHtcbiAgICBpZiAoaXNCcm93c2VyKCkpIHtcbiAgICAgIHJldHVybiBzZXNzaW9uU3RvcmFnZS5yZW1vdmVJdGVtKGtleSk7XG4gICAgfVxuICB9XG59XG4iXX0=
|
@@ -210,7 +210,8 @@ class AXLocalStorageService {
|
|
210
210
|
}
|
211
211
|
get(key) {
|
212
212
|
if (isBrowser()) {
|
213
|
-
|
213
|
+
const value = localStorage.getItem(key);
|
214
|
+
return value ? JSON.parse(value) : null;
|
214
215
|
}
|
215
216
|
else {
|
216
217
|
return null;
|
@@ -259,16 +260,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
|
|
259
260
|
|
260
261
|
class AXSessionStorageService {
|
261
262
|
get(key) {
|
262
|
-
|
263
|
+
if (isBrowser()) {
|
264
|
+
const value = sessionStorage.getItem(key);
|
265
|
+
return value ? JSON.parse(value) : null;
|
266
|
+
}
|
267
|
+
else {
|
268
|
+
return null;
|
269
|
+
}
|
263
270
|
}
|
264
271
|
set(key, value) {
|
265
|
-
|
272
|
+
if (isBrowser()) {
|
273
|
+
return sessionStorage.setItem(key, JSON.stringify(value));
|
274
|
+
}
|
266
275
|
}
|
267
276
|
clear() {
|
268
|
-
|
277
|
+
if (isBrowser()) {
|
278
|
+
return sessionStorage.clear();
|
279
|
+
}
|
269
280
|
}
|
270
281
|
removeItem(key) {
|
271
|
-
|
282
|
+
if (isBrowser()) {
|
283
|
+
return sessionStorage.removeItem(key);
|
284
|
+
}
|
272
285
|
}
|
273
286
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXSessionStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
274
287
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXSessionStorageService }); }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-core-storage.mjs","sources":["../../../../libs/core/storage/src/cookie-storage.service.ts","../../../../libs/core/storage/src/local-storage.service.ts","../../../../libs/core/storage/src/session-storage.service.ts","../../../../libs/core/storage/src/acorex-core-storage.ts"],"sourcesContent":["import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { Inject, Injectable, PLATFORM_ID } from '@angular/core';\nimport { AXCookieOptions, AXSameSite } from './storage.interface';\n\n@Injectable()\nexport class AXCookieStorageService {\n private readonly documentIsAccessible: boolean;\n\n constructor(\n @Inject(DOCUMENT) private document: Document,\n // Get the `PLATFORM_ID` so we can check if we're in a browser.\n @Inject(PLATFORM_ID) private platformId\n ) {\n this.documentIsAccessible = isPlatformBrowser(this.platformId);\n }\n\n /**\n * Get cookie Regular Expression\n *\n * @param name Cookie name\n * @returns property RegExp\n *\n */\n private static getCookieRegExp(name: string): RegExp {\n const escapedName: string = name.replace(/([[\\]{}()|=;+?,.*^$])/gi, '\\\\$1');\n\n return new RegExp(\n '(?:^' + escapedName + '|;\\\\s*' + escapedName + ')=(.*?)(?:;|$)',\n 'g'\n );\n }\n\n /**\n * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).\n *\n * @param encodedURIComponent A value representing an encoded URI component.\n *\n * @returns The unencoded version of an encoded component of a Uniform Resource Identifier (URI).\n *\n */\n private static safeDecodeURIComponent(encodedURIComponent: string): string {\n try {\n return decodeURIComponent(encodedURIComponent);\n } catch {\n // probably it is not uri encoded. return as is\n return encodedURIComponent;\n }\n }\n\n /**\n * Return `true` if {@link Document} is accessible, otherwise return `false`\n *\n * @param name Cookie name\n * @returns boolean - whether cookie with specified name exists\n *\n */\n check(name: string): boolean {\n if (!this.documentIsAccessible) {\n return false;\n }\n name = encodeURIComponent(name);\n const regExp: RegExp = AXCookieStorageService.getCookieRegExp(name);\n return regExp.test(this.document.cookie);\n }\n\n /**\n * Get cookies by name\n *\n * @param name Cookie name\n * @returns property value\n *\n */\n get(name: string): string {\n if (this.documentIsAccessible && this.check(name)) {\n name = encodeURIComponent(name);\n\n const regExp: RegExp = AXCookieStorageService.getCookieRegExp(name);\n const result: RegExpExecArray = regExp.exec(this.document.cookie);\n\n return result[1]\n ? AXCookieStorageService.safeDecodeURIComponent(result[1])\n : '';\n } else {\n return '';\n }\n }\n\n /**\n * Get all cookies in JSON format\n *\n * @returns all the cookies in json\n *\n */\n getAll(): { [key: string]: string } {\n if (!this.documentIsAccessible) {\n return {};\n }\n\n const cookies: { [key: string]: string } = {};\n const document: any = this.document;\n\n if (document.cookie && document.cookie !== '') {\n document.cookie.split(';').forEach((currentCookie) => {\n const [cookieName, cookieValue] = currentCookie.split('=');\n cookies[\n AXCookieStorageService.safeDecodeURIComponent(\n cookieName.replace(/^ /, '')\n )\n ] = AXCookieStorageService.safeDecodeURIComponent(cookieValue);\n });\n }\n\n return cookies;\n }\n\n /**\n * Set cookie based on provided information\n *\n * @param name Cookie name\n * @param value Cookie value\n * @param expires Number of days until the cookies expires or an actual `Date`\n * @param path Cookie path\n * @param domain Cookie domain\n * @param secure Secure flag\n * @param sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `Lax`\n *\n */\n set(\n name: string,\n value: string,\n expires?: AXCookieOptions['expires'],\n path?: AXCookieOptions['path'],\n domain?: AXCookieOptions['domain'],\n secure?: AXCookieOptions['secure'],\n sameSite?: AXSameSite\n ): void;\n\n /**\n * Set cookie based on provided information\n *\n * Cookie's parameters:\n * <pre>\n * expires Number of days until the cookies expires or an actual `Date`\n * path Cookie path\n * domain Cookie domain\n * secure Secure flag\n * sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `Lax`\n * </pre>\n *\n * @param name Cookie name\n * @param value Cookie value\n * @param options Body with cookie's params\n *\n */\n set(name: string, value: string, options?: AXCookieOptions): void;\n\n set(\n name: string,\n value: string,\n expiresOrOptions?: AXCookieOptions['expires'] | AXCookieOptions,\n path?: AXCookieOptions['path'],\n domain?: AXCookieOptions['domain'],\n secure?: AXCookieOptions['secure'],\n sameSite?: AXSameSite\n ): void {\n if (!this.documentIsAccessible) {\n return;\n }\n\n if (\n typeof expiresOrOptions === 'number' ||\n expiresOrOptions instanceof Date ||\n path ||\n domain ||\n secure ||\n sameSite\n ) {\n const optionsBody = {\n expires: expiresOrOptions as AXCookieOptions['expires'],\n path,\n domain,\n secure,\n sameSite: sameSite ? sameSite : 'Lax',\n };\n\n this.set(name, value, optionsBody);\n return;\n }\n\n let cookieString: string =\n encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';';\n\n const options = expiresOrOptions ? expiresOrOptions : {};\n\n if (options.expires) {\n if (typeof options.expires === 'number') {\n const dateExpires: Date = new Date(\n new Date().getTime() + options.expires * 1000 * 60 * 60 * 24\n );\n\n cookieString += 'expires=' + dateExpires.toUTCString() + ';';\n } else {\n cookieString += 'expires=' + options.expires.toUTCString() + ';';\n }\n }\n\n if (options.path) {\n cookieString += 'path=' + options.path + ';';\n }\n\n if (options.domain) {\n cookieString += 'domain=' + options.domain + ';';\n }\n\n if (options.secure === false && options.sameSite === 'None') {\n options.secure = true;\n console.warn(\n `[ngx-cookie-service] Cookie ${name} was forced with secure flag because sameSite=None.` +\n `More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`\n );\n }\n if (options.secure) {\n cookieString += 'secure;';\n }\n\n if (!options.sameSite) {\n options.sameSite = 'Lax';\n }\n\n cookieString += 'sameSite=' + options.sameSite + ';';\n\n this.document.cookie = cookieString;\n }\n\n /**\n * Delete cookie by name\n *\n * @param name Cookie name\n * @param path Cookie path\n * @param domain Cookie domain\n * @param secure Cookie secure flag\n * @param sameSite Cookie sameSite flag - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite\n *\n */\n delete(\n name: string,\n path?: AXCookieOptions['path'],\n domain?: AXCookieOptions['domain'],\n secure?: AXCookieOptions['secure'],\n sameSite: AXSameSite = 'Lax'\n ): void {\n if (!this.documentIsAccessible) {\n return;\n }\n const expiresDate = new Date('Thu, 01 Jan 1970 00:00:01 GMT');\n this.set(name, '', {\n expires: expiresDate,\n path,\n domain,\n secure,\n sameSite,\n });\n }\n\n /**\n * Delete all cookies\n *\n * @param path Cookie path\n * @param domain Cookie domain\n * @param secure Is the Cookie secure\n * @param sameSite Is the cookie same site\n *\n */\n deleteAll(\n path?: AXCookieOptions['path'],\n domain?: AXCookieOptions['domain'],\n secure?: AXCookieOptions['secure'],\n sameSite: AXSameSite = 'Lax'\n ): void {\n if (!this.documentIsAccessible) {\n return;\n }\n\n const cookies = this.getAll();\n\n for (const cookieName in cookies) {\n // eslint-disable-next-line no-prototype-builtins\n if (cookies.hasOwnProperty(cookieName)) {\n this.delete(cookieName, path, domain, secure, sameSite);\n }\n }\n }\n}\n","import { isBrowser } from '@acorex/core/platform';\nimport { Inject, Injectable, InjectionToken } from '@angular/core';\nimport * as CryptoJS from 'crypto-js';\nimport { AXStorage } from './storage.interface';\n\nexport const AX_LOCALSTORAGE_SECRET_KEY: InjectionToken<string> = new InjectionToken('AX_LOCALSTORAGE_SECRET_KEY');\n\n@Injectable()\nexport class AXLocalStorageService implements AXStorage {\n constructor(@Inject(AX_LOCALSTORAGE_SECRET_KEY) private secret_key: string) {}\n\n get<T = unknown>(key: string): T {\n if (isBrowser()) {\n return JSON.parse(localStorage.getItem(key) || '');\n } else {\n return null;\n }\n }\n\n set<T = unknown>(key: string, value: T): void {\n if (isBrowser()) {\n return localStorage.setItem(key, JSON.stringify(value));\n }\n }\n\n clear(): void {\n if (isBrowser()) {\n return localStorage.clear();\n }\n }\n\n removeItem(key: string) {\n if (isBrowser()) {\n return localStorage.removeItem(key);\n }\n }\n\n setWithEncryption<T = unknown>(key: string, value: T) {\n if (isBrowser()) {\n const encrypted = CryptoJS.AES.encrypt(JSON.stringify(value), this.secret_key).toString();\n return localStorage.setItem(key, encrypted);\n }\n }\n\n getWithEncription<T = unknown>(key: string): T {\n if (isBrowser()) {\n const encrypted = localStorage.getItem(key) || '';\n const decrypted = CryptoJS.AES.decrypt(encrypted, this.secret_key).toString(CryptoJS.enc.Utf8);\n return encrypted ? JSON.parse(decrypted) : {};\n } else {\n return null;\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { AXStorage } from './storage.interface';\n\n@Injectable()\nexport class AXSessionStorageService implements AXStorage {\n get<T = unknown>(key: string): T {\n return JSON.parse(sessionStorage.getItem(key) || '');\n }\n\n set<T = unknown>(key: string, value: T): void {\n return sessionStorage.setItem(key, JSON.stringify(value));\n }\n\n clear(): void {\n return sessionStorage.clear();\n }\n\n removeItem(key: string) {\n return sessionStorage.removeItem(key);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAKa,sBAAsB,CAAA;AAGjC,IAAA,WAAA,CAC4B,QAAkB;;IAEf,UAAU,EAAA;QAFb,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;QAEf,IAAU,CAAA,UAAA,GAAV,UAAU,CAAA;QAEvC,IAAI,CAAC,oBAAoB,GAAG,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAChE;AAED;;;;;;AAMG;IACK,OAAO,eAAe,CAAC,IAAY,EAAA;QACzC,MAAM,WAAW,GAAW,IAAI,CAAC,OAAO,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;AAE5E,QAAA,OAAO,IAAI,MAAM,CACf,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,gBAAgB,EAChE,GAAG,CACJ,CAAC;KACH;AAED;;;;;;;AAOG;IACK,OAAO,sBAAsB,CAAC,mBAA2B,EAAA;AAC/D,QAAA,IAAI;AACF,YAAA,OAAO,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;SAChD;AAAC,QAAA,MAAM;;AAEN,YAAA,OAAO,mBAAmB,CAAC;SAC5B;KACF;AAED;;;;;;AAMG;AACH,IAAA,KAAK,CAAC,IAAY,EAAA;AAChB,QAAA,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;AAC9B,YAAA,OAAO,KAAK,CAAC;SACd;AACD,QAAA,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,MAAM,GAAW,sBAAsB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QACpE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC1C;AAED;;;;;;AAMG;AACH,IAAA,GAAG,C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AA,qBAAqB,kBACZ,0BAA0B,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;kHADnC,qBAAqB,EAAA,CAAA,CAAA,EAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,UAAU;;0BAEI,MAAM;2BAAC,0BAA0B,CAAA;;;MCLnC,uBAAuB,CAAA;AAClC,IAAA,GAAG,CAAc,GAAW,EAAA;AAC1B,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;KACtD;IAED,GAAG,CAAc,GAAW,EAAE,KAAQ,EAAA;AACpC,QAAA,OAAO,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;KAC3D;IAED,KAAK,GAAA;AACH,QAAA,OAAO,cAAc,CAAC,KAAK,EAAE,CAAC;KAC/B;AAED,IAAA,UAAU,CAAC,GAAW,EAAA;AACpB,QAAA,OAAO,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;KACvC;8GAfU,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;kHAAvB,uBAAuB,EAAA,CAAA,CAAA,EAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;;;ACHX;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-core-storage.mjs","sources":["../../../../libs/core/storage/src/cookie-storage.service.ts","../../../../libs/core/storage/src/local-storage.service.ts","../../../../libs/core/storage/src/session-storage.service.ts","../../../../libs/core/storage/src/acorex-core-storage.ts"],"sourcesContent":["import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { Inject, Injectable, PLATFORM_ID } from '@angular/core';\nimport { AXCookieOptions, AXSameSite } from './storage.interface';\n\n@Injectable()\nexport class AXCookieStorageService {\n private readonly documentIsAccessible: boolean;\n\n constructor(\n @Inject(DOCUMENT) private document: Document,\n // Get the `PLATFORM_ID` so we can check if we're in a browser.\n @Inject(PLATFORM_ID) private platformId\n ) {\n this.documentIsAccessible = isPlatformBrowser(this.platformId);\n }\n\n /**\n * Get cookie Regular Expression\n *\n * @param name Cookie name\n * @returns property RegExp\n *\n */\n private static getCookieRegExp(name: string): RegExp {\n const escapedName: string = name.replace(/([[\\]{}()|=;+?,.*^$])/gi, '\\\\$1');\n\n return new RegExp(\n '(?:^' + escapedName + '|;\\\\s*' + escapedName + ')=(.*?)(?:;|$)',\n 'g'\n );\n }\n\n /**\n * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).\n *\n * @param encodedURIComponent A value representing an encoded URI component.\n *\n * @returns The unencoded version of an encoded component of a Uniform Resource Identifier (URI).\n *\n */\n private static safeDecodeURIComponent(encodedURIComponent: string): string {\n try {\n return decodeURIComponent(encodedURIComponent);\n } catch {\n // probably it is not uri encoded. return as is\n return encodedURIComponent;\n }\n }\n\n /**\n * Return `true` if {@link Document} is accessible, otherwise return `false`\n *\n * @param name Cookie name\n * @returns boolean - whether cookie with specified name exists\n *\n */\n check(name: string): boolean {\n if (!this.documentIsAccessible) {\n return false;\n }\n name = encodeURIComponent(name);\n const regExp: RegExp = AXCookieStorageService.getCookieRegExp(name);\n return regExp.test(this.document.cookie);\n }\n\n /**\n * Get cookies by name\n *\n * @param name Cookie name\n * @returns property value\n *\n */\n get(name: string): string {\n if (this.documentIsAccessible && this.check(name)) {\n name = encodeURIComponent(name);\n\n const regExp: RegExp = AXCookieStorageService.getCookieRegExp(name);\n const result: RegExpExecArray = regExp.exec(this.document.cookie);\n\n return result[1]\n ? AXCookieStorageService.safeDecodeURIComponent(result[1])\n : '';\n } else {\n return '';\n }\n }\n\n /**\n * Get all cookies in JSON format\n *\n * @returns all the cookies in json\n *\n */\n getAll(): { [key: string]: string } {\n if (!this.documentIsAccessible) {\n return {};\n }\n\n const cookies: { [key: string]: string } = {};\n const document: any = this.document;\n\n if (document.cookie && document.cookie !== '') {\n document.cookie.split(';').forEach((currentCookie) => {\n const [cookieName, cookieValue] = currentCookie.split('=');\n cookies[\n AXCookieStorageService.safeDecodeURIComponent(\n cookieName.replace(/^ /, '')\n )\n ] = AXCookieStorageService.safeDecodeURIComponent(cookieValue);\n });\n }\n\n return cookies;\n }\n\n /**\n * Set cookie based on provided information\n *\n * @param name Cookie name\n * @param value Cookie value\n * @param expires Number of days until the cookies expires or an actual `Date`\n * @param path Cookie path\n * @param domain Cookie domain\n * @param secure Secure flag\n * @param sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `Lax`\n *\n */\n set(\n name: string,\n value: string,\n expires?: AXCookieOptions['expires'],\n path?: AXCookieOptions['path'],\n domain?: AXCookieOptions['domain'],\n secure?: AXCookieOptions['secure'],\n sameSite?: AXSameSite\n ): void;\n\n /**\n * Set cookie based on provided information\n *\n * Cookie's parameters:\n * <pre>\n * expires Number of days until the cookies expires or an actual `Date`\n * path Cookie path\n * domain Cookie domain\n * secure Secure flag\n * sameSite OWASP samesite token `Lax`, `None`, or `Strict`. Defaults to `Lax`\n * </pre>\n *\n * @param name Cookie name\n * @param value Cookie value\n * @param options Body with cookie's params\n *\n */\n set(name: string, value: string, options?: AXCookieOptions): void;\n\n set(\n name: string,\n value: string,\n expiresOrOptions?: AXCookieOptions['expires'] | AXCookieOptions,\n path?: AXCookieOptions['path'],\n domain?: AXCookieOptions['domain'],\n secure?: AXCookieOptions['secure'],\n sameSite?: AXSameSite\n ): void {\n if (!this.documentIsAccessible) {\n return;\n }\n\n if (\n typeof expiresOrOptions === 'number' ||\n expiresOrOptions instanceof Date ||\n path ||\n domain ||\n secure ||\n sameSite\n ) {\n const optionsBody = {\n expires: expiresOrOptions as AXCookieOptions['expires'],\n path,\n domain,\n secure,\n sameSite: sameSite ? sameSite : 'Lax',\n };\n\n this.set(name, value, optionsBody);\n return;\n }\n\n let cookieString: string =\n encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';';\n\n const options = expiresOrOptions ? expiresOrOptions : {};\n\n if (options.expires) {\n if (typeof options.expires === 'number') {\n const dateExpires: Date = new Date(\n new Date().getTime() + options.expires * 1000 * 60 * 60 * 24\n );\n\n cookieString += 'expires=' + dateExpires.toUTCString() + ';';\n } else {\n cookieString += 'expires=' + options.expires.toUTCString() + ';';\n }\n }\n\n if (options.path) {\n cookieString += 'path=' + options.path + ';';\n }\n\n if (options.domain) {\n cookieString += 'domain=' + options.domain + ';';\n }\n\n if (options.secure === false && options.sameSite === 'None') {\n options.secure = true;\n console.warn(\n `[ngx-cookie-service] Cookie ${name} was forced with secure flag because sameSite=None.` +\n `More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`\n );\n }\n if (options.secure) {\n cookieString += 'secure;';\n }\n\n if (!options.sameSite) {\n options.sameSite = 'Lax';\n }\n\n cookieString += 'sameSite=' + options.sameSite + ';';\n\n this.document.cookie = cookieString;\n }\n\n /**\n * Delete cookie by name\n *\n * @param name Cookie name\n * @param path Cookie path\n * @param domain Cookie domain\n * @param secure Cookie secure flag\n * @param sameSite Cookie sameSite flag - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite\n *\n */\n delete(\n name: string,\n path?: AXCookieOptions['path'],\n domain?: AXCookieOptions['domain'],\n secure?: AXCookieOptions['secure'],\n sameSite: AXSameSite = 'Lax'\n ): void {\n if (!this.documentIsAccessible) {\n return;\n }\n const expiresDate = new Date('Thu, 01 Jan 1970 00:00:01 GMT');\n this.set(name, '', {\n expires: expiresDate,\n path,\n domain,\n secure,\n sameSite,\n });\n }\n\n /**\n * Delete all cookies\n *\n * @param path Cookie path\n * @param domain Cookie domain\n * @param secure Is the Cookie secure\n * @param sameSite Is the cookie same site\n *\n */\n deleteAll(\n path?: AXCookieOptions['path'],\n domain?: AXCookieOptions['domain'],\n secure?: AXCookieOptions['secure'],\n sameSite: AXSameSite = 'Lax'\n ): void {\n if (!this.documentIsAccessible) {\n return;\n }\n\n const cookies = this.getAll();\n\n for (const cookieName in cookies) {\n // eslint-disable-next-line no-prototype-builtins\n if (cookies.hasOwnProperty(cookieName)) {\n this.delete(cookieName, path, domain, secure, sameSite);\n }\n }\n }\n}\n","import { isBrowser } from '@acorex/core/platform';\nimport { Inject, Injectable, InjectionToken } from '@angular/core';\nimport * as CryptoJS from 'crypto-js';\nimport { AXStorage } from './storage.interface';\n\nexport const AX_LOCALSTORAGE_SECRET_KEY: InjectionToken<string> = new InjectionToken('AX_LOCALSTORAGE_SECRET_KEY');\n\n@Injectable()\nexport class AXLocalStorageService implements AXStorage {\n constructor(@Inject(AX_LOCALSTORAGE_SECRET_KEY) private secret_key: string) {}\n\n get<T = unknown>(key: string): T {\n if (isBrowser()) {\n const value = localStorage.getItem(key);\n return value ? JSON.parse(value) : null;\n } else {\n return null;\n }\n }\n\n set<T = unknown>(key: string, value: T): void {\n if (isBrowser()) {\n return localStorage.setItem(key, JSON.stringify(value));\n }\n }\n\n clear(): void {\n if (isBrowser()) {\n return localStorage.clear();\n }\n }\n\n removeItem(key: string) {\n if (isBrowser()) {\n return localStorage.removeItem(key);\n }\n }\n\n setWithEncryption<T = unknown>(key: string, value: T) {\n if (isBrowser()) {\n const encrypted = CryptoJS.AES.encrypt(JSON.stringify(value), this.secret_key).toString();\n return localStorage.setItem(key, encrypted);\n }\n }\n\n getWithEncription<T = unknown>(key: string): T {\n if (isBrowser()) {\n const encrypted = localStorage.getItem(key) || '';\n const decrypted = CryptoJS.AES.decrypt(encrypted, this.secret_key).toString(CryptoJS.enc.Utf8);\n return encrypted ? JSON.parse(decrypted) : {};\n } else {\n return null;\n }\n }\n}\n","import { isBrowser } from '@acorex/core/platform';\nimport { Injectable } from '@angular/core';\nimport { AXStorage } from './storage.interface';\n\n@Injectable()\nexport class AXSessionStorageService implements AXStorage {\n get<T = unknown>(key: string): T {\n if (isBrowser()) {\n const value = sessionStorage.getItem(key);\n return value ? JSON.parse(value) : null;\n } else {\n return null;\n }\n }\n\n set<T = unknown>(key: string, value: T): void {\n if (isBrowser()) {\n return sessionStorage.setItem(key, JSON.stringify(value));\n }\n }\n\n clear(): void {\n if (isBrowser()) {\n return sessionStorage.clear();\n }\n }\n\n removeItem(key: string) {\n if (isBrowser()) {\n return sessionStorage.removeItem(key);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAKa,sBAAsB,CAAA;AAGjC,IAAA,WAAA,CAC4B,QAAkB;;IAEf,UAAU,EAAA;QAFb,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;QAEf,IAAU,CAAA,UAAA,GAAV,UAAU,CAAA;QAEvC,IAAI,CAAC,oBAAoB,GAAG,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAChE;AAED;;;;;;AAMG;IACK,OAAO,eAAe,CAAC,IAAY,EAAA;QACzC,MAAM,WAAW,GAAW,IAAI,CAAC,OAAO,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;AAE5E,QAAA,OAAO,IAAI,MAAM,CACf,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,gBAAgB,EAChE,GAAG,CACJ,CAAC;KACH;AAED;;;;;;;AAOG;IACK,OAAO,sBAAsB,CAAC,mBAA2B,EAAA;AAC/D,QAAA,IAAI;AACF,YAAA,OAAO,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;SAChD;AAAC,QAAA,MAAM;;AAEN,YAAA,OAAO,mBAAmB,CAAC;SAC5B;KACF;AAED;;;;;;AAMG;AACH,IAAA,KAAK,CAAC,IAAY,EAAA;AAChB,QAAA,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;AAC9B,YAAA,OAAO,KAAK,CAAC;SACd;AACD,QAAA,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,M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