@sd-angular/core 19.0.0-beta.87 → 19.0.0-beta.89

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.
Files changed (30) hide show
  1. package/components/document-builder/src/plugins/variable/variable.plugin.d.ts +6 -0
  2. package/components/tab-router/src/components/tab-router-nav/tab-router-nav.component.d.ts +5 -6
  3. package/components/tab-router/src/components/tab-router-outlet/tab-router-outlet.component.d.ts +3 -2
  4. package/components/table/src/models/table-option-selector.model.d.ts +48 -0
  5. package/components/table/src/models/table-option.model.d.ts +102 -0
  6. package/fesm2022/sd-angular-core-components-document-builder.mjs +84 -18
  7. package/fesm2022/sd-angular-core-components-document-builder.mjs.map +1 -1
  8. package/fesm2022/sd-angular-core-components-tab-router.mjs +40 -36
  9. package/fesm2022/sd-angular-core-components-tab-router.mjs.map +1 -1
  10. package/fesm2022/sd-angular-core-components-upload-file.mjs +9 -9
  11. package/fesm2022/sd-angular-core-components-upload-file.mjs.map +1 -1
  12. package/fesm2022/sd-angular-core-forms-input.mjs +9 -2
  13. package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
  14. package/fesm2022/sd-angular-core-forms-select.mjs +4 -1
  15. package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
  16. package/fesm2022/sd-angular-core-forms-textarea.mjs +9 -2
  17. package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
  18. package/fesm2022/sd-angular-core-interceptors.mjs +24 -1
  19. package/fesm2022/sd-angular-core-interceptors.mjs.map +1 -1
  20. package/fesm2022/sd-angular-core-services-api.mjs +18 -34
  21. package/fesm2022/sd-angular-core-services-api.mjs.map +1 -1
  22. package/forms/input/src/input.component.d.ts +2 -0
  23. package/forms/textarea/src/textarea.component.d.ts +2 -0
  24. package/interceptors/index.d.ts +1 -0
  25. package/interceptors/unauthorized/unauthorized.interceptor.d.ts +12 -0
  26. package/package.json +71 -71
  27. package/sd-angular-core-19.0.0-beta.89.tgz +0 -0
  28. package/services/api/src/api.service.d.ts +3 -7
  29. package/services/api/src/interceptors/api.interceptor.d.ts +2 -4
  30. package/sd-angular-core-19.0.0-beta.87.tgz +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"sd-angular-core-services-api.mjs","sources":["../../../projects/sd-angular/services/api/src/api.model.ts","../../../projects/sd-angular/services/api/src/api.service.ts","../../../projects/sd-angular/services/api/src/interceptors/api.interceptor.ts","../../../projects/sd-angular/services/api/src/api.module.ts","../../../projects/sd-angular/services/api/sd-angular-core-services-api.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { HttpClient, HttpErrorResponse, HttpRequest, HttpResponse } from '@angular/common/http';\r\nimport { InjectionToken } from '@angular/core';\r\nimport { SdCacheOption } from '@sd-angular/core/services/cache';\r\nimport { SdUtilities } from '@sd-angular/core/utilities';\r\n// import hash from 'object-hash';\r\n\r\nexport interface SdApiOption {\r\n cacheOption?: SdCacheOption;\r\n timeout?: number; // Default: 30000 (30s)\r\n autoCache?: boolean; // Default: true\r\n}\r\ntype HttpGetOption = Parameters<HttpClient['get']>[1];\r\nexport type SdGetOption = HttpGetOption & SdApiOption;\r\n\r\ntype HttpPostOption = Parameters<HttpClient['post']>[2];\r\nexport type SdPostOption = HttpPostOption & SdApiOption;\r\n\r\ntype HttpPutOption = Parameters<HttpClient['put']>[2];\r\nexport type SdPutOption = HttpPutOption & SdApiOption;\r\n\r\ntype HttpDeleteOption = Parameters<HttpClient['delete']>[1];\r\nexport type SdDeleteOption = HttpDeleteOption & SdApiOption;\r\n\r\nexport interface SdApiHandler {\r\n /** Danh sách host URL mà handler này sẽ xử lý */\r\n hosts: string[];\r\n /** Can thiệp request: gắn header, token, transform body... */\r\n intercept?: (request: HttpRequest<any>) => HttpRequest<any>;\r\n /** Hook chạy TRƯỚC khi gửi request (dùng để log, tracking...) */\r\n beforeRemote?: (request: HttpRequest<any>) => void | Promise<void>;\r\n /** Hook chạy SAU khi nhận response (xử lý lỗi, notify...) */\r\n afterRemote?: (\r\n response: HttpResponse<any> | HttpErrorResponse | Error\r\n ) => void | Promise<void>;\r\n /** Transform response body thành kiểu dữ liệu mong muốn */\r\n mapResponse?: <Tres = any, Tdata = any>(response: Tres) => Tdata;\r\n /** Timeout tính bằng milliseconds. Mặc định: 30000 (30 giây) */\r\n timeout?: number;\r\n}\r\n\r\nexport interface ISdApiConfiguration {\r\n handlers: SdApiHandler[];\r\n}\r\n\r\nexport const SD_API_CONFIG = new InjectionToken<ISdApiConfiguration>('sd-api.configuration');\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Inject, Injectable, Optional } from '@angular/core';\r\nimport { SdCacheService } from '@sd-angular/core/services/cache';\r\nimport { SdUtilities } from '@sd-angular/core/utilities/extensions';\r\nimport { lastValueFrom, Observable } from 'rxjs';\r\nimport { catchError, map, shareReplay, timeout } from 'rxjs/operators';\r\nimport { v4 } from 'uuid';\r\nimport { ISdApiConfiguration, SD_API_CONFIG, SdApiHandler, SdDeleteOption, SdGetOption, SdPostOption, SdPutOption } from './api.model';\r\n\r\n// Gom nhóm các Option lại cho gọn\r\ntype SdHttpOptions = SdGetOption & SdPostOption & SdPutOption & SdDeleteOption;\r\ntype HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class SdApiService {\r\n readonly #defaultTimeout = 60000; // 60s\r\n readonly #dedupCacheDuration = 1000; // 1s (Deduplication cache duration)\r\n\r\n // Thay đổi cấu trúc Cache: Lưu Observable thay vì Subject phức tạp\r\n // Key: hash string -> Value: { stream$: Observable, expiry: number }\r\n #inFlightRequests: Map<string, { stream$: Observable<any>; expiry: number }> = new Map();\r\n\r\n constructor(\r\n private httpClient: HttpClient,\r\n @Inject(SD_API_CONFIG) @Optional() private configurations: ISdApiConfiguration[],\r\n private cacheService: SdCacheService\r\n ) {\r\n // Optional: Cơ chế dọn dẹp cache định kỳ (mỗi 1 phút dọn dẹp các key hết hạn)\r\n setInterval(() => this.#cleanupCache(), 60000);\r\n }\r\n\r\n get http() {\r\n return this.httpClient;\r\n }\r\n\r\n // --- PUBLIC METHODS ---\r\n\r\n get = <T = any>(url: string, option?: SdGetOption): Promise<T> => {\r\n return this.#executeWithLayeredCache<T>(url, 'GET', undefined, option);\r\n };\r\n\r\n post = <T = any>(url: string, body?: any, option?: SdPostOption): Promise<T> => {\r\n return this.#executeWithLayeredCache<T>(url, 'POST', body, option);\r\n };\r\n\r\n put = <T = any>(url: string, body?: any, option?: SdPutOption): Promise<T> => {\r\n return this.#executeWithLayeredCache<T>(url, 'PUT', body, option);\r\n };\r\n\r\n delete = <T = any>(url: string, option?: SdDeleteOption): Promise<T> => {\r\n return this.#executeWithLayeredCache<T>(url, 'DELETE', undefined, option);\r\n };\r\n\r\n // Upload file logic giữ nguyên nhưng refactor nhẹ\r\n upload = async (url: string, option?: { extensions?: string[]; maxSizeInMb?: number }): Promise<any> => {\r\n const file = await SdUtilities.upload(option);\r\n if (!Array.isArray(file) && file) {\r\n return this.uploadFile(url, file);\r\n }\r\n };\r\n\r\n uploadFile = async (url: string, file: File): Promise<any> => {\r\n if (!file) return null;\r\n if (file.name.lastIndexOf('.') === -1) throw new Error('Invalid file extension');\r\n\r\n const formData = new FormData();\r\n formData.append('file', file, file.name);\r\n // Upload thường không cần deduplication cache, set autoCache: false\r\n return await this.post(url, formData, { autoCache: false });\r\n };\r\n\r\n // --- PRIVATE CORE LOGIC ---\r\n\r\n /**\r\n * Hàm trung gian xử lý Layer Cache (SdCacheService) trước khi gọi API thực tế\r\n */\r\n #executeWithLayeredCache = async <T>(url: string, method: HttpMethod, body?: any, option?: SdHttpOptions): Promise<T> => {\r\n // Layer 1: Persistent Cache (SdCacheService)\r\n if (option?.cacheOption) {\r\n const key = this.#generateKey(url, method, body, option);\r\n const { get, set, has } = this.cacheService.create(key, option.cacheOption);\r\n\r\n if (has()) {\r\n return get();\r\n }\r\n\r\n const result = await this.#request<T>(url, method, body, option);\r\n set(result);\r\n return result;\r\n }\r\n\r\n // Không có cache dài hạn thì gọi trực tiếp logic deduplication\r\n return this.#request<T>(url, method, body, option);\r\n };\r\n\r\n /**\r\n * Core Request: Xử lý Deduplication, Timeout, Mapping Response\r\n */\r\n #request = <T>(url: string, method: HttpMethod, body: any, option?: SdHttpOptions): Promise<T> => {\r\n const key = this.#generateKey(url, method, body, option);\r\n\r\n // Layer 2: Deduplication Cache (In-Flight Request / Short-term cache)\r\n const now = Date.now();\r\n const cachedItem = this.#inFlightRequests.get(key);\r\n\r\n // Nếu đã có request đang chạy hoặc mới chạy xong trong vòng 1s -> Trả về stream đó luôn\r\n if (cachedItem && cachedItem.expiry > now) {\r\n return lastValueFrom(cachedItem.stream$);\r\n }\r\n\r\n // Setup request mới\r\n const handler = this.#getHandler(url);\r\n const apiTimeout = option?.timeout ?? handler?.timeout ?? this.#defaultTimeout;\r\n\r\n // Tạo Observable call API\r\n const request$ = this.httpClient\r\n .request(method, url, {\r\n body,\r\n headers: option?.headers,\r\n params: option?.params,\r\n observe: 'response', // Lấy full response để check status\r\n responseType: option?.responseType,\r\n })\r\n .pipe(\r\n timeout(apiTimeout),\r\n map(res => {\r\n // Normalize Response Logic\r\n const bodyRes = res.body as any;\r\n // Logic check response cũ của bạn\r\n if (bodyRes && typeof bodyRes === 'object' && 'ok' in bodyRes && !bodyRes.ok) {\r\n throw bodyRes; // Giả sử structure trả về { ok: false, ... } là lỗi\r\n }\r\n\r\n if (handler?.mapResponse) {\r\n return handler.mapResponse(bodyRes);\r\n }\r\n\r\n return bodyRes;\r\n }),\r\n catchError(err => {\r\n // Xóa cache ngay lập tức nếu lỗi để user có thể retry\r\n this.#inFlightRequests.delete(key);\r\n throw err;\r\n }),\r\n // QUAN TRỌNG: shareReplay(1) giúp share kết quả cho các subscriber đến sau (trong 1s)\r\n shareReplay(1)\r\n );\r\n\r\n // Lưu vào Map\r\n this.#inFlightRequests.set(key, {\r\n stream$: request$,\r\n expiry: now + this.#dedupCacheDuration,\r\n });\r\n\r\n // Chuyển đổi sang Promise cho đúng return type của bạn\r\n return lastValueFrom(request$);\r\n };\r\n\r\n // --- HELPERS ---\r\n\r\n #getHandler = (url: string): SdApiHandler | undefined => {\r\n const handlers = this.configurations?.flatMap(b => b?.handlers || []) || [];\r\n return handlers.find(e => e.hosts.some(host => url.startsWith(host)));\r\n };\r\n\r\n #generateKey = (url: string, method: HttpMethod, body: any, option?: SdHttpOptions): string => {\r\n // FormData không hash được nội dung file, luôn generate key mới\r\n if (body instanceof FormData || option?.autoCache === false) {\r\n return v4();\r\n }\r\n return SdUtilities.hash({\r\n url,\r\n method,\r\n params: option?.params,\r\n headers: option?.headers,\r\n body,\r\n });\r\n };\r\n\r\n // Dọn dẹp memory leak\r\n #cleanupCache() {\r\n const now = Date.now();\r\n this.#inFlightRequests.forEach((value, key) => {\r\n if (value.expiry < now) {\r\n this.#inFlightRequests.delete(key);\r\n }\r\n });\r\n }\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http';\r\nimport { Inject, Injectable, Optional } from '@angular/core';\r\nimport { from, Observable, throwError } from 'rxjs';\r\nimport { catchError, map, switchMap } from 'rxjs/operators';\r\nimport { SD_API_CONFIG, ISdApiConfiguration, SdApiHandler } from '../api.model';\r\n\r\n@Injectable()\r\nexport class SdHttpInterceptor implements HttpInterceptor {\r\n constructor(\r\n @Inject(SD_API_CONFIG)\r\n @Optional()\r\n private configurations: ISdApiConfiguration[]\r\n ) {}\r\n intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\r\n const url = request.url;\r\n if (!url) {\r\n throw new Error(`Invalid URL`);\r\n }\r\n const handlers = this.configurations?.reduce<SdApiHandler[]>((a, b) => [...a, ...(b?.handlers || [])], []) || [];\r\n const handler = handlers?.find(e => e.hosts.some(host => url.startsWith(host)));\r\n const intercept = handler?.intercept;\r\n if (intercept) {\r\n request = request.clone(intercept(request));\r\n }\r\n if (request.body instanceof FormData) {\r\n request = request.clone({\r\n headers: request.headers.delete('Content-Type'),\r\n });\r\n }\r\n const beforeRemoteHandler = handler?.beforeRemote;\r\n const afterRemoteHandler = handler?.afterRemote;\r\n const beforeRemote = beforeRemoteHandler?.(request);\r\n if (beforeRemote instanceof Promise) {\r\n return from(beforeRemote).pipe(\r\n switchMap(() => next.handle(request)),\r\n map((event: HttpEvent<any>) => {\r\n if (event instanceof HttpResponse) {\r\n afterRemoteHandler?.(event);\r\n }\r\n return event;\r\n }),\r\n catchError((error: HttpErrorResponse) => {\r\n afterRemoteHandler?.(error);\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n return next.handle(request).pipe(\r\n map((event: HttpEvent<any>) => {\r\n if (event instanceof HttpResponse) {\r\n afterRemoteHandler?.(event);\r\n }\r\n return event;\r\n }),\r\n catchError((error: HttpErrorResponse) => {\r\n afterRemoteHandler?.(error);\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n}\r\n","import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\nimport { SdHttpInterceptor } from './interceptors/api.interceptor';\n\n@NgModule({\n imports: [],\n exports: [],\n providers: [provideHttpClient(withInterceptorsFromDi()), { provide: HTTP_INTERCEPTORS, useClass: SdHttpInterceptor, multi: true }],\n})\nexport class SdApiModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MA6Ca,aAAa,GAAG,IAAI,cAAc,CAAsB,sBAAsB;;MC5B9E,YAAY,CAAA;AASb,IAAA,UAAA;AACmC,IAAA,cAAA;AACnC,IAAA,YAAA;AAVD,IAAA,eAAe,GAAG,KAAK,CAAC;AACxB,IAAA,mBAAmB,GAAG,IAAI,CAAC;;;AAIpC,IAAA,iBAAiB,GAA8D,IAAI,GAAG,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QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,EAAE;oBACX,SAAS,EAAE,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACnI,iBAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"sd-angular-core-services-api.mjs","sources":["../../../projects/sd-angular/services/api/src/api.model.ts","../../../projects/sd-angular/services/api/src/api.service.ts","../../../projects/sd-angular/services/api/src/interceptors/api.interceptor.ts","../../../projects/sd-angular/services/api/src/api.module.ts","../../../projects/sd-angular/services/api/sd-angular-core-services-api.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { HttpClient, HttpErrorResponse, HttpRequest, HttpResponse } from '@angular/common/http';\r\nimport { InjectionToken } from '@angular/core';\r\nimport { SdCacheOption } from '@sd-angular/core/services/cache';\r\nimport { SdUtilities } from '@sd-angular/core/utilities';\r\n// import hash from 'object-hash';\r\n\r\nexport interface SdApiOption {\r\n cacheOption?: SdCacheOption;\r\n timeout?: number; // Default: 30000 (30s)\r\n autoCache?: boolean; // Default: true\r\n}\r\ntype HttpGetOption = Parameters<HttpClient['get']>[1];\r\nexport type SdGetOption = HttpGetOption & SdApiOption;\r\n\r\ntype HttpPostOption = Parameters<HttpClient['post']>[2];\r\nexport type SdPostOption = HttpPostOption & SdApiOption;\r\n\r\ntype HttpPutOption = Parameters<HttpClient['put']>[2];\r\nexport type SdPutOption = HttpPutOption & SdApiOption;\r\n\r\ntype HttpDeleteOption = Parameters<HttpClient['delete']>[1];\r\nexport type SdDeleteOption = HttpDeleteOption & SdApiOption;\r\n\r\nexport interface SdApiHandler {\r\n /** Danh sách host URL mà handler này sẽ xử lý */\r\n hosts: string[];\r\n /** Can thiệp request: gắn header, token, transform body... */\r\n intercept?: (request: HttpRequest<any>) => HttpRequest<any>;\r\n /** Hook chạy TRƯỚC khi gửi request (dùng để log, tracking...) */\r\n beforeRemote?: (request: HttpRequest<any>) => void | Promise<void>;\r\n /** Hook chạy SAU khi nhận response (xử lý lỗi, notify...) */\r\n afterRemote?: (\r\n response: HttpResponse<any> | HttpErrorResponse | Error\r\n ) => void | Promise<void>;\r\n /** Transform response body thành kiểu dữ liệu mong muốn */\r\n mapResponse?: <Tres = any, Tdata = any>(response: Tres) => Tdata;\r\n /** Timeout tính bằng milliseconds. Mặc định: 30000 (30 giây) */\r\n timeout?: number;\r\n}\r\n\r\nexport interface ISdApiConfiguration {\r\n handlers: SdApiHandler[];\r\n}\r\n\r\nexport const SD_API_CONFIG = new InjectionToken<ISdApiConfiguration>('sd-api.configuration');\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { SdCacheService } from '@sd-angular/core/services/cache';\r\nimport { SdUtilities } from '@sd-angular/core/utilities/extensions';\r\nimport { lastValueFrom, Observable } from 'rxjs';\r\nimport { catchError, map, shareReplay, timeout } from 'rxjs/operators';\r\nimport { v4 } from 'uuid';\r\nimport { ISdApiConfiguration, SD_API_CONFIG, SdApiHandler, SdDeleteOption, SdGetOption, SdPostOption, SdPutOption } from './api.model';\r\n\r\n// Gom nhóm các Option lại cho gọn\r\ntype SdHttpOptions = SdGetOption & SdPostOption & SdPutOption & SdDeleteOption;\r\ntype HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class SdApiService {\r\n readonly #defaultTimeout = 60000; // 60s\r\n readonly #dedupCacheDuration = 1000; // 1s (Deduplication cache duration)\r\n #httpClient = inject(HttpClient);\r\n #configurations = inject<ISdApiConfiguration[]>(SD_API_CONFIG, { optional: true }) || [];\r\n #cacheService = inject(SdCacheService);\r\n\r\n // Thay đổi cấu trúc Cache: Lưu Observable thay vì Subject phức tạp\r\n // Key: hash string -> Value: { stream$: Observable, expiry: number }\r\n #inFlightRequests: Map<string, { stream$: Observable<any>; expiry: number }> = new Map();\r\n\r\n constructor() {\r\n // Optional: Cơ chế dọn dẹp cache định kỳ (mỗi 1 phút dọn dẹp các key hết hạn)\r\n setInterval(() => this.#cleanupCache(), 60000);\r\n }\r\n\r\n get http() {\r\n return this.#httpClient;\r\n }\r\n\r\n // --- PUBLIC METHODS ---\r\n\r\n get = <T = any>(url: string, option?: SdGetOption): Promise<T> => {\r\n return this.#executeWithLayeredCache<T>(url, 'GET', undefined, option);\r\n };\r\n\r\n post = <T = any>(url: string, body?: any, option?: SdPostOption): Promise<T> => {\r\n return this.#executeWithLayeredCache<T>(url, 'POST', body, option);\r\n };\r\n\r\n put = <T = any>(url: string, body?: any, option?: SdPutOption): Promise<T> => {\r\n return this.#executeWithLayeredCache<T>(url, 'PUT', body, option);\r\n };\r\n\r\n delete = <T = any>(url: string, option?: SdDeleteOption): Promise<T> => {\r\n return this.#executeWithLayeredCache<T>(url, 'DELETE', undefined, option);\r\n };\r\n\r\n // Upload file logic giữ nguyên nhưng refactor nhẹ\r\n upload = async (url: string, option?: { extensions?: string[]; maxSizeInMb?: number }): Promise<any> => {\r\n const file = await SdUtilities.upload(option);\r\n if (!Array.isArray(file) && file) {\r\n return this.uploadFile(url, file);\r\n }\r\n };\r\n\r\n uploadFile = async (url: string, file: File): Promise<any> => {\r\n if (!file) return null;\r\n if (file.name.lastIndexOf('.') === -1) throw new Error('Invalid file extension');\r\n\r\n const formData = new FormData();\r\n formData.append('file', file, file.name);\r\n // Upload thường không cần deduplication cache, set autoCache: false\r\n return await this.post(url, formData, { autoCache: false });\r\n };\r\n\r\n // --- PRIVATE CORE LOGIC ---\r\n\r\n /**\r\n * Hàm trung gian xử lý Layer Cache (SdCacheService) trước khi gọi API thực tế\r\n */\r\n #executeWithLayeredCache = async <T>(url: string, method: HttpMethod, body?: any, option?: SdHttpOptions): Promise<T> => {\r\n // Layer 1: Persistent Cache (SdCacheService)\r\n if (option?.cacheOption) {\r\n const key = this.#generateKey(url, method, body, option);\r\n const { get, set, has } = this.#cacheService.create(key, option.cacheOption);\r\n\r\n if (has()) {\r\n return get();\r\n }\r\n\r\n const result = await this.#request<T>(url, method, body, option);\r\n set(result);\r\n return result;\r\n }\r\n\r\n // Không có cache dài hạn thì gọi trực tiếp logic deduplication\r\n return this.#request<T>(url, method, body, option);\r\n };\r\n\r\n /**\r\n * Core Request: Xử lý Deduplication, Timeout, Mapping Response\r\n */\r\n #request = <T>(url: string, method: HttpMethod, body: any, option?: SdHttpOptions): Promise<T> => {\r\n const key = this.#generateKey(url, method, body, option);\r\n\r\n // Layer 2: Deduplication Cache (In-Flight Request / Short-term cache)\r\n const now = Date.now();\r\n const cachedItem = this.#inFlightRequests.get(key);\r\n\r\n // Nếu đã có request đang chạy hoặc mới chạy xong trong vòng 1s -> Trả về stream đó luôn\r\n if (cachedItem && cachedItem.expiry > now) {\r\n return lastValueFrom(cachedItem.stream$);\r\n }\r\n\r\n // Setup request mới\r\n const handler = this.#getHandler(url);\r\n const apiTimeout = option?.timeout ?? handler?.timeout ?? this.#defaultTimeout;\r\n\r\n // Tạo Observable call API\r\n const request$ = this.#httpClient\r\n .request(method, url, {\r\n body,\r\n headers: option?.headers,\r\n params: option?.params,\r\n observe: 'response', // Lấy full response để check status\r\n responseType: option?.responseType,\r\n })\r\n .pipe(\r\n timeout(apiTimeout),\r\n map(res => {\r\n // Normalize Response Logic\r\n const bodyRes = res.body as any;\r\n // Logic check response cũ của bạn\r\n if (bodyRes && typeof bodyRes === 'object' && 'ok' in bodyRes && !bodyRes.ok) {\r\n throw bodyRes; // Giả sử structure trả về { ok: false, ... } là lỗi\r\n }\r\n\r\n if (handler?.mapResponse) {\r\n return handler.mapResponse(bodyRes);\r\n }\r\n\r\n return bodyRes;\r\n }),\r\n catchError(err => {\r\n // Xóa cache ngay lập tức nếu lỗi để user có thể retry\r\n this.#inFlightRequests.delete(key);\r\n throw err;\r\n }),\r\n // QUAN TRỌNG: shareReplay(1) giúp share kết quả cho các subscriber đến sau (trong 1s)\r\n shareReplay(1)\r\n );\r\n\r\n // Lưu vào Map\r\n this.#inFlightRequests.set(key, {\r\n stream$: request$,\r\n expiry: now + this.#dedupCacheDuration,\r\n });\r\n\r\n // Chuyển đổi sang Promise cho đúng return type của bạn\r\n return lastValueFrom(request$);\r\n };\r\n\r\n // --- HELPERS ---\r\n\r\n #getHandler = (url: string): SdApiHandler | undefined => {\r\n const handlers = this.#configurations.flatMap(b => b?.handlers || []);\r\n return handlers.find(e => e.hosts.some(host => url.startsWith(host)));\r\n };\r\n\r\n #generateKey = (url: string, method: HttpMethod, body: any, option?: SdHttpOptions): string => {\r\n // FormData không hash được nội dung file, luôn generate key mới\r\n if (body instanceof FormData || option?.autoCache === false) {\r\n return v4();\r\n }\r\n return SdUtilities.hash({\r\n url,\r\n method,\r\n params: option?.params,\r\n headers: option?.headers,\r\n body,\r\n });\r\n };\r\n\r\n // Dọn dẹp memory leak\r\n #cleanupCache() {\r\n const now = Date.now();\r\n this.#inFlightRequests.forEach((value, key) => {\r\n if (value.expiry < now) {\r\n this.#inFlightRequests.delete(key);\r\n }\r\n });\r\n }\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { from, Observable, throwError } from 'rxjs';\r\nimport { catchError, map, switchMap } from 'rxjs/operators';\r\nimport { ISdApiConfiguration, SD_API_CONFIG } from '../api.model';\r\n\r\n@Injectable()\r\nexport class SdHttpInterceptor implements HttpInterceptor {\r\n #configurations = inject<ISdApiConfiguration[]>(SD_API_CONFIG, { optional: true }) || [];\r\n\r\n intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\r\n const url = request.url;\r\n if (!url) {\r\n throw new Error(`Invalid URL`);\r\n }\r\n const handlers = this.#configurations.flatMap(configuration => configuration?.handlers || []);\r\n const handler = handlers?.find(e => e.hosts.some(host => url.startsWith(host)));\r\n const intercept = handler?.intercept;\r\n if (intercept) {\r\n request = request.clone(intercept(request));\r\n }\r\n if (request.body instanceof FormData) {\r\n request = request.clone({\r\n headers: request.headers.delete('Content-Type'),\r\n });\r\n }\r\n const beforeRemoteHandler = handler?.beforeRemote;\r\n const afterRemoteHandler = handler?.afterRemote;\r\n const beforeRemote = beforeRemoteHandler?.(request);\r\n if (beforeRemote instanceof Promise) {\r\n return from(beforeRemote).pipe(\r\n switchMap(() => next.handle(request)),\r\n map((event: HttpEvent<any>) => {\r\n if (event instanceof HttpResponse) {\r\n afterRemoteHandler?.(event);\r\n }\r\n return event;\r\n }),\r\n catchError((error: HttpErrorResponse) => {\r\n afterRemoteHandler?.(error);\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n return next.handle(request).pipe(\r\n map((event: HttpEvent<any>) => {\r\n if (event instanceof HttpResponse) {\r\n afterRemoteHandler?.(event);\r\n }\r\n return event;\r\n }),\r\n catchError((error: HttpErrorResponse) => {\r\n afterRemoteHandler?.(error);\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n}\r\n","import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\nimport { SdHttpInterceptor } from './interceptors/api.interceptor';\n\n@NgModule({\n imports: [],\n exports: [],\n providers: [provideHttpClient(withInterceptorsFromDi()), { provide: HTTP_INTERCEPTORS, useClass: SdHttpInterceptor, multi: true }],\n})\nexport class SdApiModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MA6Ca,aAAa,GAAG,IAAI,cAAc,CAAsB,sBAAsB;;AC7C3F;MAiBa,YAAY,CAAA;AACd,IAAA,eAAe,GAAG,KAAK,CAAC;AACxB,IAAA,mBAAmB,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AE;AACjC,gBAAA,kBAAkB,GAAG,KAAK,CAAC;YAC7B;AACA,YAAA,OAAO,KAAK;AACd,QAAA,CAAC,CAAC,EACF,UAAU,CAAC,CAAC,KAAwB,KAAI;AACtC,YAAA,kBAAkB,GAAG,KAAK,CAAC;AAC3B,YAAA,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC;QAChC,CAAC,CAAC,CACH;IACH;wGAjDW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;4GAAjB,iBAAiB,EAAA,CAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B;;;MCEY,WAAW,CAAA;wGAAX,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;yGAAX,WAAW,EAAA,CAAA;yGAAX,WAAW,EAAA,SAAA,EAFX,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAA,CAAA;;4FAEvH,WAAW,EAAA,UAAA,EAAA,CAAA;kBALvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,EAAE;oBACX,SAAS,EAAE,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACnI,iBAAA;;;ACRD;;AAEG;;;;"}
@@ -61,6 +61,8 @@ export declare class SdInput implements OnDestroy, OnInit, AfterViewInit {
61
61
  ngOnDestroy(): void;
62
62
  reValidate: () => void;
63
63
  customInlineErrorValidator(): ValidatorFn;
64
+ getCurrentLength: () => number;
65
+ isMaxlengthExceeded: () => boolean;
64
66
  onKeyupEnter: () => void;
65
67
  onFocus: () => void;
66
68
  onBlur: () => void;
@@ -52,6 +52,8 @@ export declare class SdTextarea implements OnInit, AfterViewInit, OnDestroy {
52
52
  blur: () => void;
53
53
  focus: () => void;
54
54
  customInlineErrorValidator(): ValidatorFn;
55
+ getCurrentLength: () => number;
56
+ isMaxlengthExceeded: () => boolean;
55
57
  static ɵfac: i0.ɵɵFactoryDeclaration<SdTextarea, never>;
56
58
  static ɵcmp: i0.ɵɵComponentDeclaration<SdTextarea, "sd-textarea", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "hideInlineError": { "alias": "hideInlineError"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "autoHeight": { "alias": "autoHeight"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "pattern": { "alias": "pattern"; "required": false; "isSignal": true; }; "validator": { "alias": "validator"; "required": false; "isSignal": true; }; "inlineError": { "alias": "inlineError"; "required": false; "isSignal": true; }; "appearanceInput": { "alias": "appearance"; "required": false; "isSignal": true; }; "floatLabel": { "alias": "floatLabel"; "required": false; "isSignal": true; }; "valueModel": { "alias": "model"; "required": false; "isSignal": true; }; }, { "valueModel": "modelChange"; "sdChange": "sdChange"; }, ["sdViewDef", "sdLabelDef", "sdSuffixDef"], never, true, never>;
57
59
  }
@@ -1 +1,2 @@
1
1
  export * from './no-internet/no-internet.interceptor';
2
+ export * from './unauthorized/unauthorized.interceptor';
@@ -0,0 +1,12 @@
1
+ import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
+ import { SdAuthService } from '@sd-angular/core/modules';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export declare class SdUnauthorizedInterceptor implements HttpInterceptor {
6
+ #private;
7
+ private authService;
8
+ constructor(authService: SdAuthService);
9
+ intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdUnauthorizedInterceptor, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<SdUnauthorizedInterceptor>;
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sd-angular/core",
3
- "version": "19.0.0-beta.87",
3
+ "version": "19.0.0-beta.89",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0 || ^20.0.0 || ^21.0.0",
6
6
  "@angular/core": "^19.0.0 || ^20.0.0 || ^21.0.0",
@@ -31,10 +31,6 @@
31
31
  "types": "./index.d.ts",
32
32
  "default": "./fesm2022/sd-angular-core.mjs"
33
33
  },
34
- "./configurations": {
35
- "types": "./configurations/index.d.ts",
36
- "default": "./fesm2022/sd-angular-core-configurations.mjs"
37
- },
38
34
  "./components": {
39
35
  "types": "./components/index.d.ts",
40
36
  "default": "./fesm2022/sd-angular-core-components.mjs"
@@ -43,14 +39,18 @@
43
39
  "types": "./directives/index.d.ts",
44
40
  "default": "./fesm2022/sd-angular-core-directives.mjs"
45
41
  },
46
- "./handlers": {
47
- "types": "./handlers/index.d.ts",
48
- "default": "./fesm2022/sd-angular-core-handlers.mjs"
42
+ "./configurations": {
43
+ "types": "./configurations/index.d.ts",
44
+ "default": "./fesm2022/sd-angular-core-configurations.mjs"
49
45
  },
50
46
  "./forms": {
51
47
  "types": "./forms/index.d.ts",
52
48
  "default": "./fesm2022/sd-angular-core-forms.mjs"
53
49
  },
50
+ "./handlers": {
51
+ "types": "./handlers/index.d.ts",
52
+ "default": "./fesm2022/sd-angular-core-handlers.mjs"
53
+ },
54
54
  "./interceptors": {
55
55
  "types": "./interceptors/index.d.ts",
56
56
  "default": "./fesm2022/sd-angular-core-interceptors.mjs"
@@ -71,30 +71,30 @@
71
71
  "types": "./utilities/index.d.ts",
72
72
  "default": "./fesm2022/sd-angular-core-utilities.mjs"
73
73
  },
74
- "./components/anchor-v2": {
75
- "types": "./components/anchor-v2/index.d.ts",
76
- "default": "./fesm2022/sd-angular-core-components-anchor-v2.mjs"
77
- },
78
74
  "./components/anchor": {
79
75
  "types": "./components/anchor/index.d.ts",
80
76
  "default": "./fesm2022/sd-angular-core-components-anchor.mjs"
81
77
  },
82
- "./components/avatar": {
83
- "types": "./components/avatar/index.d.ts",
84
- "default": "./fesm2022/sd-angular-core-components-avatar.mjs"
78
+ "./components/anchor-v2": {
79
+ "types": "./components/anchor-v2/index.d.ts",
80
+ "default": "./fesm2022/sd-angular-core-components-anchor-v2.mjs"
85
81
  },
86
82
  "./components/badge": {
87
83
  "types": "./components/badge/index.d.ts",
88
84
  "default": "./fesm2022/sd-angular-core-components-badge.mjs"
89
85
  },
90
- "./components/button": {
91
- "types": "./components/button/index.d.ts",
92
- "default": "./fesm2022/sd-angular-core-components-button.mjs"
86
+ "./components/avatar": {
87
+ "types": "./components/avatar/index.d.ts",
88
+ "default": "./fesm2022/sd-angular-core-components-avatar.mjs"
93
89
  },
94
90
  "./components/base": {
95
91
  "types": "./components/base/index.d.ts",
96
92
  "default": "./fesm2022/sd-angular-core-components-base.mjs"
97
93
  },
94
+ "./components/button": {
95
+ "types": "./components/button/index.d.ts",
96
+ "default": "./fesm2022/sd-angular-core-components-button.mjs"
97
+ },
98
98
  "./components/chart": {
99
99
  "types": "./components/chart/index.d.ts",
100
100
  "default": "./fesm2022/sd-angular-core-components-chart.mjs"
@@ -103,57 +103,61 @@
103
103
  "types": "./components/code-editor/index.d.ts",
104
104
  "default": "./fesm2022/sd-angular-core-components-code-editor.mjs"
105
105
  },
106
- "./components/editor": {
107
- "types": "./components/editor/index.d.ts",
108
- "default": "./fesm2022/sd-angular-core-components-editor.mjs"
109
- },
110
106
  "./components/document-builder": {
111
107
  "types": "./components/document-builder/index.d.ts",
112
108
  "default": "./fesm2022/sd-angular-core-components-document-builder.mjs"
113
109
  },
114
- "./components/mini-editor": {
115
- "types": "./components/mini-editor/index.d.ts",
116
- "default": "./fesm2022/sd-angular-core-components-mini-editor.mjs"
117
- },
118
110
  "./components/history": {
119
111
  "types": "./components/history/index.d.ts",
120
112
  "default": "./fesm2022/sd-angular-core-components-history.mjs"
121
113
  },
122
- "./components/modal": {
123
- "types": "./components/modal/index.d.ts",
124
- "default": "./fesm2022/sd-angular-core-components-modal.mjs"
114
+ "./components/editor": {
115
+ "types": "./components/editor/index.d.ts",
116
+ "default": "./fesm2022/sd-angular-core-components-editor.mjs"
125
117
  },
126
118
  "./components/import-excel": {
127
119
  "types": "./components/import-excel/index.d.ts",
128
120
  "default": "./fesm2022/sd-angular-core-components-import-excel.mjs"
129
121
  },
122
+ "./components/mini-editor": {
123
+ "types": "./components/mini-editor/index.d.ts",
124
+ "default": "./fesm2022/sd-angular-core-components-mini-editor.mjs"
125
+ },
126
+ "./components/modal": {
127
+ "types": "./components/modal/index.d.ts",
128
+ "default": "./fesm2022/sd-angular-core-components-modal.mjs"
129
+ },
130
130
  "./components/preview": {
131
131
  "types": "./components/preview/index.d.ts",
132
132
  "default": "./fesm2022/sd-angular-core-components-preview.mjs"
133
133
  },
134
- "./components/quick-action": {
135
- "types": "./components/quick-action/index.d.ts",
136
- "default": "./fesm2022/sd-angular-core-components-quick-action.mjs"
137
- },
138
134
  "./components/query-builder": {
139
135
  "types": "./components/query-builder/index.d.ts",
140
136
  "default": "./fesm2022/sd-angular-core-components-query-builder.mjs"
141
137
  },
138
+ "./components/quick-action": {
139
+ "types": "./components/quick-action/index.d.ts",
140
+ "default": "./fesm2022/sd-angular-core-components-quick-action.mjs"
141
+ },
142
142
  "./components/section": {
143
143
  "types": "./components/section/index.d.ts",
144
144
  "default": "./fesm2022/sd-angular-core-components-section.mjs"
145
145
  },
146
+ "./components/tab-router": {
147
+ "types": "./components/tab-router/index.d.ts",
148
+ "default": "./fesm2022/sd-angular-core-components-tab-router.mjs"
149
+ },
146
150
  "./components/side-drawer": {
147
151
  "types": "./components/side-drawer/index.d.ts",
148
152
  "default": "./fesm2022/sd-angular-core-components-side-drawer.mjs"
149
153
  },
150
- "./components/tab-router": {
151
- "types": "./components/tab-router/index.d.ts",
152
- "default": "./fesm2022/sd-angular-core-components-tab-router.mjs"
154
+ "./components/view": {
155
+ "types": "./components/view/index.d.ts",
156
+ "default": "./fesm2022/sd-angular-core-components-view.mjs"
153
157
  },
154
- "./components/upload-file": {
155
- "types": "./components/upload-file/index.d.ts",
156
- "default": "./fesm2022/sd-angular-core-components-upload-file.mjs"
158
+ "./components/table": {
159
+ "types": "./components/table/index.d.ts",
160
+ "default": "./fesm2022/sd-angular-core-components-table.mjs"
157
161
  },
158
162
  "./components/workflow": {
159
163
  "types": "./components/workflow/index.d.ts",
@@ -163,54 +167,50 @@
163
167
  "types": "./forms/autocomplete/index.d.ts",
164
168
  "default": "./fesm2022/sd-angular-core-forms-autocomplete.mjs"
165
169
  },
166
- "./components/view": {
167
- "types": "./components/view/index.d.ts",
168
- "default": "./fesm2022/sd-angular-core-components-view.mjs"
170
+ "./forms/chip": {
171
+ "types": "./forms/chip/index.d.ts",
172
+ "default": "./fesm2022/sd-angular-core-forms-chip.mjs"
169
173
  },
170
174
  "./forms/checkbox": {
171
175
  "types": "./forms/checkbox/index.d.ts",
172
176
  "default": "./fesm2022/sd-angular-core-forms-checkbox.mjs"
173
177
  },
174
- "./forms/chip": {
175
- "types": "./forms/chip/index.d.ts",
176
- "default": "./fesm2022/sd-angular-core-forms-chip.mjs"
178
+ "./forms/chip-calendar": {
179
+ "types": "./forms/chip-calendar/index.d.ts",
180
+ "default": "./fesm2022/sd-angular-core-forms-chip-calendar.mjs"
177
181
  },
178
182
  "./forms/date": {
179
183
  "types": "./forms/date/index.d.ts",
180
184
  "default": "./fesm2022/sd-angular-core-forms-date.mjs"
181
185
  },
182
- "./forms/chip-calendar": {
183
- "types": "./forms/chip-calendar/index.d.ts",
184
- "default": "./fesm2022/sd-angular-core-forms-chip-calendar.mjs"
186
+ "./forms/datetime": {
187
+ "types": "./forms/datetime/index.d.ts",
188
+ "default": "./fesm2022/sd-angular-core-forms-datetime.mjs"
185
189
  },
186
190
  "./forms/date-range": {
187
191
  "types": "./forms/date-range/index.d.ts",
188
192
  "default": "./fesm2022/sd-angular-core-forms-date-range.mjs"
189
193
  },
190
- "./forms/datetime": {
191
- "types": "./forms/datetime/index.d.ts",
192
- "default": "./fesm2022/sd-angular-core-forms-datetime.mjs"
193
- },
194
194
  "./forms/directives": {
195
195
  "types": "./forms/directives/index.d.ts",
196
196
  "default": "./fesm2022/sd-angular-core-forms-directives.mjs"
197
197
  },
198
- "./forms/input-number": {
199
- "types": "./forms/input-number/index.d.ts",
200
- "default": "./fesm2022/sd-angular-core-forms-input-number.mjs"
201
- },
202
198
  "./forms/input": {
203
199
  "types": "./forms/input/index.d.ts",
204
200
  "default": "./fesm2022/sd-angular-core-forms-input.mjs"
205
201
  },
206
- "./forms/models": {
207
- "types": "./forms/models/index.d.ts",
208
- "default": "./fesm2022/sd-angular-core-forms-models.mjs"
209
- },
210
202
  "./forms/label": {
211
203
  "types": "./forms/label/index.d.ts",
212
204
  "default": "./fesm2022/sd-angular-core-forms-label.mjs"
213
205
  },
206
+ "./forms/input-number": {
207
+ "types": "./forms/input-number/index.d.ts",
208
+ "default": "./fesm2022/sd-angular-core-forms-input-number.mjs"
209
+ },
210
+ "./forms/models": {
211
+ "types": "./forms/models/index.d.ts",
212
+ "default": "./fesm2022/sd-angular-core-forms-models.mjs"
213
+ },
214
214
  "./forms/select": {
215
215
  "types": "./forms/select/index.d.ts",
216
216
  "default": "./fesm2022/sd-angular-core-forms-select.mjs"
@@ -235,14 +235,14 @@
235
235
  "types": "./modules/authom/index.d.ts",
236
236
  "default": "./fesm2022/sd-angular-core-modules-authom.mjs"
237
237
  },
238
- "./modules/layout": {
239
- "types": "./modules/layout/index.d.ts",
240
- "default": "./fesm2022/sd-angular-core-modules-layout.mjs"
241
- },
242
238
  "./modules/keycloak": {
243
239
  "types": "./modules/keycloak/index.d.ts",
244
240
  "default": "./fesm2022/sd-angular-core-modules-keycloak.mjs"
245
241
  },
242
+ "./modules/layout": {
243
+ "types": "./modules/layout/index.d.ts",
244
+ "default": "./fesm2022/sd-angular-core-modules-layout.mjs"
245
+ },
246
246
  "./modules/permission": {
247
247
  "types": "./modules/permission/index.d.ts",
248
248
  "default": "./fesm2022/sd-angular-core-modules-permission.mjs"
@@ -279,14 +279,14 @@
279
279
  "types": "./services/loading/index.d.ts",
280
280
  "default": "./fesm2022/sd-angular-core-services-loading.mjs"
281
281
  },
282
- "./services/notify": {
283
- "types": "./services/notify/index.d.ts",
284
- "default": "./fesm2022/sd-angular-core-services-notify.mjs"
285
- },
286
282
  "./services/storage": {
287
283
  "types": "./services/storage/index.d.ts",
288
284
  "default": "./fesm2022/sd-angular-core-services-storage.mjs"
289
285
  },
286
+ "./services/notify": {
287
+ "types": "./services/notify/index.d.ts",
288
+ "default": "./fesm2022/sd-angular-core-services-notify.mjs"
289
+ },
290
290
  "./utilities/extensions": {
291
291
  "types": "./utilities/extensions/index.d.ts",
292
292
  "default": "./fesm2022/sd-angular-core-utilities-extensions.mjs"
@@ -295,9 +295,9 @@
295
295
  "types": "./utilities/models/index.d.ts",
296
296
  "default": "./fesm2022/sd-angular-core-utilities-models.mjs"
297
297
  },
298
- "./components/table": {
299
- "types": "./components/table/index.d.ts",
300
- "default": "./fesm2022/sd-angular-core-components-table.mjs"
298
+ "./components/upload-file": {
299
+ "types": "./components/upload-file/index.d.ts",
300
+ "default": "./fesm2022/sd-angular-core-components-upload-file.mjs"
301
301
  }
302
302
  }
303
303
  }
@@ -1,13 +1,9 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
- import { SdCacheService } from '@sd-angular/core/services/cache';
3
- import { ISdApiConfiguration, SdDeleteOption, SdGetOption, SdPostOption, SdPutOption } from './api.model';
2
+ import { SdDeleteOption, SdGetOption, SdPostOption, SdPutOption } from './api.model';
4
3
  import * as i0 from "@angular/core";
5
4
  export declare class SdApiService {
6
5
  #private;
7
- private httpClient;
8
- private configurations;
9
- private cacheService;
10
- constructor(httpClient: HttpClient, configurations: ISdApiConfiguration[], cacheService: SdCacheService);
6
+ constructor();
11
7
  get http(): HttpClient;
12
8
  get: <T = any>(url: string, option?: SdGetOption) => Promise<T>;
13
9
  post: <T = any>(url: string, body?: any, option?: SdPostOption) => Promise<T>;
@@ -18,6 +14,6 @@ export declare class SdApiService {
18
14
  maxSizeInMb?: number;
19
15
  }) => Promise<any>;
20
16
  uploadFile: (url: string, file: File) => Promise<any>;
21
- static ɵfac: i0.ɵɵFactoryDeclaration<SdApiService, [null, { optional: true; }, null]>;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdApiService, never>;
22
18
  static ɵprov: i0.ɵɵInjectableDeclaration<SdApiService>;
23
19
  }
@@ -1,11 +1,9 @@
1
1
  import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
- import { ISdApiConfiguration } from '../api.model';
4
3
  import * as i0 from "@angular/core";
5
4
  export declare class SdHttpInterceptor implements HttpInterceptor {
6
- private configurations;
7
- constructor(configurations: ISdApiConfiguration[]);
5
+ #private;
8
6
  intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<SdHttpInterceptor, [{ optional: true; }]>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdHttpInterceptor, never>;
10
8
  static ɵprov: i0.ɵɵInjectableDeclaration<SdHttpInterceptor>;
11
9
  }
Binary file