@sd-angular/core 19.0.35 → 19.0.38
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/README.md +2 -4
- package/components/index.d.ts +1 -0
- package/components/query-builder/src/query-builder.model.d.ts +1 -1
- package/components/table/src/components/desktop-cell/desktop-cell.component.d.ts +1 -1
- package/components/table/src/table.component.d.ts +1 -1
- package/components/timeline/index.d.ts +2 -0
- package/components/{history/models/history.model.d.ts → timeline/models/timeline.model.d.ts} +1 -1
- package/components/timeline/src/timeline.component.d.ts +7 -0
- package/configurations/src/sd-core.configuration.d.ts +0 -1
- package/fesm2022/sd-angular-core-components-form-generic.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-query-bar.mjs +8 -8
- package/fesm2022/sd-angular-core-components-query-bar.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-query-builder.mjs +2 -2
- package/fesm2022/sd-angular-core-components-query-builder.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-tab-router.mjs +11 -5
- package/fesm2022/sd-angular-core-components-tab-router.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-table.mjs +110 -39
- package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-timeline.mjs +49 -0
- package/fesm2022/sd-angular-core-components-timeline.mjs.map +1 -0
- package/fesm2022/sd-angular-core-components-upload-file.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components.mjs +1 -0
- package/fesm2022/sd-angular-core-components.mjs.map +1 -1
- package/fesm2022/sd-angular-core-configurations.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date-range.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-date-range.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-inline-text.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-inline-text.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input-color.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-input-color.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input-number.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
- package/fesm2022/sd-angular-core-i18n.mjs +10 -10
- package/fesm2022/sd-angular-core-i18n.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-auth.mjs +35 -3
- package/fesm2022/sd-angular-core-modules-auth.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-authom.mjs +847 -241
- package/fesm2022/sd-angular-core-modules-authom.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-layout.mjs +4 -4
- package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-cache.mjs +1 -1
- package/fesm2022/sd-angular-core-services-cache.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-confirm.mjs +2 -2
- package/fesm2022/sd-angular-core-services-confirm.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-storage.mjs.map +1 -1
- package/i18n/src/en.d.ts +1 -1
- package/modules/authom/authom.auth-configuration.d.ts +18 -0
- package/modules/authom/authom.configuration.d.ts +158 -2
- package/modules/authom/authom.event.d.ts +44 -0
- package/modules/authom/authom.guard.d.ts +13 -0
- package/modules/authom/authom.interceptor.d.ts +7 -1
- package/modules/authom/authom.module.d.ts +35 -5
- package/modules/authom/authom.return-url.d.ts +37 -0
- package/modules/authom/authom.service.d.ts +109 -15
- package/modules/authom/authom.session-channel.d.ts +26 -0
- package/modules/authom/index.d.ts +19 -9
- package/package.json +17 -19
- package/utilities/extensions/src/string.extension.d.ts +6 -2
- package/utilities/models/src/maybe-async.model.d.ts +1 -1
- package/components/base/index.d.ts +0 -1
- package/components/base/src/base-secure.component.d.ts +0 -8
- package/components/history/index.d.ts +0 -1
- package/components/history/src/history.component.d.ts +0 -7
- package/fesm2022/sd-angular-core-components-base.mjs +0 -23
- package/fesm2022/sd-angular-core-components-base.mjs.map +0 -1
- package/fesm2022/sd-angular-core-components-history.mjs +0 -51
- package/fesm2022/sd-angular-core-components-history.mjs.map +0 -1
- package/fesm2022/sd-angular-core-services-license.mjs +0 -97
- package/fesm2022/sd-angular-core-services-license.mjs.map +0 -1
- package/services/license/index.d.ts +0 -1
- package/services/license/src/license.service.d.ts +0 -9
- /package/components/{history → timeline}/pipes/view-date.pipe.d.ts +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { SD_CORE_CONFIGURATION } from '@sd-angular/core/configurations';
|
|
4
|
-
|
|
5
|
-
class SdLicenseService {
|
|
6
|
-
#SALT = 'angular-core-976e2fa6f8b44dadbc63f87b057a331f';
|
|
7
|
-
#isValid = false;
|
|
8
|
-
coreConfiguration = inject(SD_CORE_CONFIGURATION, { optional: true });
|
|
9
|
-
constructor() {
|
|
10
|
-
this.#verify();
|
|
11
|
-
}
|
|
12
|
-
enforceLicense = () => {
|
|
13
|
-
if (!this.#isValid) {
|
|
14
|
-
this.#throwSecurityError();
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
#verify = () => {
|
|
18
|
-
const hostname = window.location.hostname; // Ví dụ: store.uat.nexa.mobi
|
|
19
|
-
// 1. Bypass Localhost
|
|
20
|
-
if (this.#isLocalhost(hostname)) {
|
|
21
|
-
this.#isValid = true;
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const configKeys = this.#getConfiguredKeys();
|
|
25
|
-
if (configKeys.length === 0) {
|
|
26
|
-
this.#isValid = false;
|
|
27
|
-
this.#throwSecurityError();
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
// 2. CHECK EXACT MATCH (Ưu tiên khớp chính xác 100%)
|
|
31
|
-
// Hash chuỗi: "store.uat.nexa.mobi" + SALT
|
|
32
|
-
if (this.#checkMatch(hostname, configKeys)) {
|
|
33
|
-
this.#isValid = true;
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
// 3. CHECK WILDCARD MATCH (Thử các trường hợp có dấu *)
|
|
37
|
-
const parts = hostname.split('.'); // ["store", "uat", "nexa", "mobi"]
|
|
38
|
-
// Lặp để cắt dần subdomain bên trái và thêm "*." vào
|
|
39
|
-
// Điều kiện > 2 để đảm bảo không check các case vô nghĩa như *.mobi hay *.com
|
|
40
|
-
while (parts.length > 2) {
|
|
41
|
-
parts.shift(); // Bỏ phần đầu: ["uat", "nexa", "mobi"]
|
|
42
|
-
// Tạo domain wildcard: "*.uat.nexa.mobi"
|
|
43
|
-
const wildcardDomain = '*.' + parts.join('.');
|
|
44
|
-
// Hash chuỗi: "*.uat.nexa.mobi" + SALT
|
|
45
|
-
if (this.#checkMatch(wildcardDomain, configKeys)) {
|
|
46
|
-
this.#isValid = true;
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// Nếu chạy hết vòng lặp mà không khớp cái nào
|
|
51
|
-
this.#isValid = false;
|
|
52
|
-
this.#throwSecurityError();
|
|
53
|
-
};
|
|
54
|
-
// Helper để check xem hash của input có nằm trong list key không
|
|
55
|
-
#checkMatch = (inputString, validKeys) => {
|
|
56
|
-
const hash = this.#generateHash(inputString + this.#SALT);
|
|
57
|
-
return validKeys.includes(hash);
|
|
58
|
-
};
|
|
59
|
-
#getConfiguredKeys = () => {
|
|
60
|
-
const keyOrKeys = this.coreConfiguration?.licenseKey;
|
|
61
|
-
if (!keyOrKeys)
|
|
62
|
-
return [];
|
|
63
|
-
return Array.isArray(keyOrKeys) ? keyOrKeys : [keyOrKeys];
|
|
64
|
-
};
|
|
65
|
-
#isLocalhost = (domain) => {
|
|
66
|
-
return domain === 'localhost' || domain === '127.0.0.1' || domain.includes('localhost');
|
|
67
|
-
};
|
|
68
|
-
#generateHash = (input) => {
|
|
69
|
-
let hash = 0;
|
|
70
|
-
if (input.length === 0)
|
|
71
|
-
return hash.toString();
|
|
72
|
-
for (let i = 0; i < input.length; i++) {
|
|
73
|
-
const char = input.charCodeAt(i);
|
|
74
|
-
hash = (hash << 5) - hash + char;
|
|
75
|
-
hash = hash & hash;
|
|
76
|
-
}
|
|
77
|
-
return btoa(hash.toString() + 'signed');
|
|
78
|
-
};
|
|
79
|
-
#throwSecurityError = () => {
|
|
80
|
-
throw new Error(`[Security] Unauthorized usage of UI Lib on domain: ${window.location.hostname}`);
|
|
81
|
-
};
|
|
82
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdLicenseService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
83
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdLicenseService, providedIn: 'root' });
|
|
84
|
-
}
|
|
85
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdLicenseService, decorators: [{
|
|
86
|
-
type: Injectable,
|
|
87
|
-
args: [{
|
|
88
|
-
providedIn: 'root',
|
|
89
|
-
}]
|
|
90
|
-
}], ctorParameters: () => [] });
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Generated bundle index. Do not edit.
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
|
-
export { SdLicenseService };
|
|
97
|
-
//# sourceMappingURL=sd-angular-core-services-license.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-services-license.mjs","sources":["../../../projects/sd-angular/services/license/src/license.service.ts","../../../projects/sd-angular/services/license/sd-angular-core-services-license.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { ISdCoreConfiguration, SD_CORE_CONFIGURATION } from '@sd-angular/core/configurations';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SdLicenseService {\n readonly #SALT = 'angular-core-976e2fa6f8b44dadbc63f87b057a331f';\n #isValid = false;\n private readonly coreConfiguration: ISdCoreConfiguration | null = inject(SD_CORE_CONFIGURATION, { optional: true });\n\n constructor() {\n this.#verify();\n }\n\n enforceLicense = () => {\n if (!this.#isValid) {\n this.#throwSecurityError();\n }\n };\n\n #verify = () => {\n const hostname = window.location.hostname; // Ví dụ: store.uat.nexa.mobi\n\n // 1. Bypass Localhost\n if (this.#isLocalhost(hostname)) {\n this.#isValid = true;\n return;\n }\n\n const configKeys = this.#getConfiguredKeys();\n if (configKeys.length === 0) {\n this.#isValid = false;\n this.#throwSecurityError();\n return;\n }\n\n // 2. CHECK EXACT MATCH (Ưu tiên khớp chính xác 100%)\n // Hash chuỗi: \"store.uat.nexa.mobi\" + SALT\n if (this.#checkMatch(hostname, configKeys)) {\n this.#isValid = true;\n return;\n }\n\n // 3. CHECK WILDCARD MATCH (Thử các trường hợp có dấu *)\n const parts = hostname.split('.'); // [\"store\", \"uat\", \"nexa\", \"mobi\"]\n\n // Lặp để cắt dần subdomain bên trái và thêm \"*.\" vào\n // Điều kiện > 2 để đảm bảo không check các case vô nghĩa như *.mobi hay *.com\n while (parts.length > 2) {\n parts.shift(); // Bỏ phần đầu: [\"uat\", \"nexa\", \"mobi\"]\n \n // Tạo domain wildcard: \"*.uat.nexa.mobi\"\n const wildcardDomain = '*.' + parts.join('.'); \n \n // Hash chuỗi: \"*.uat.nexa.mobi\" + SALT\n if (this.#checkMatch(wildcardDomain, configKeys)) {\n this.#isValid = true;\n return;\n }\n }\n\n // Nếu chạy hết vòng lặp mà không khớp cái nào\n this.#isValid = false;\n this.#throwSecurityError();\n };\n\n // Helper để check xem hash của input có nằm trong list key không\n #checkMatch = (inputString: string, validKeys: string[]): boolean => {\n const hash = this.#generateHash(inputString + this.#SALT);\n return validKeys.includes(hash);\n };\n\n #getConfiguredKeys = (): string[] => {\n const keyOrKeys = this.coreConfiguration?.licenseKey;\n if (!keyOrKeys) return [];\n return Array.isArray(keyOrKeys) ? keyOrKeys : [keyOrKeys];\n };\n\n #isLocalhost = (domain: string) => {\n return domain === 'localhost' || domain === '127.0.0.1' || domain.includes('localhost');\n };\n\n #generateHash = (input: string): string => {\n let hash = 0;\n if (input.length === 0) return hash.toString();\n for (let i = 0; i < input.length; i++) {\n const char = input.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash;\n }\n return btoa(hash.toString() + 'signed');\n };\n\n #throwSecurityError = () => {\n throw new Error(`[Security] Unauthorized usage of UI Lib on domain: ${window.location.hostname}`);\n };\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAMa,gBAAgB,CAAA;IAClB,KAAK,GAAG,+CAA+C;IAChE,QAAQ,GAAG,KAAK;IACC,iBAAiB,GAAgC,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEnH,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,OAAO,EAAE;IAChB;IAEA,cAAc,GAAG,MAAK;AACpB,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,mBAAmB,EAAE;QAC5B;AACF,IAAA,CAAC;IAED,OAAO,GAAG,MAAK;QACb,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;;AAG1C,QAAA,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE;AAC/B,YAAA,IAAI,CAAC,QAAQ,GAAG,IAAI;YACpB;QACF;AAE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V,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/license.service';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class SdLicenseService {
|
|
3
|
-
#private;
|
|
4
|
-
private readonly coreConfiguration;
|
|
5
|
-
constructor();
|
|
6
|
-
enforceLicense: () => void;
|
|
7
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SdLicenseService, never>;
|
|
8
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<SdLicenseService>;
|
|
9
|
-
}
|
|
File without changes
|