@web-portal/core-infrastructure 1.0.0 → 1.0.2

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.
@@ -2,14 +2,35 @@ import { Observable } from "rxjs";
2
2
  import { HttpClient } from "@angular/common/http";
3
3
  import { ApiService } from "./api.service";
4
4
  import * as i0 from "@angular/core";
5
+ interface ImageUploadResult {
6
+ url: string;
7
+ filePath: string;
8
+ fileName: string;
9
+ originalName: string;
10
+ }
5
11
  export declare class FileAIA_GCSService {
6
12
  private _http;
7
13
  private _apiService;
8
14
  baseUrl: string;
9
15
  constructor(_http: HttpClient, _apiService: ApiService);
10
16
  getSignedLink(filePath: string): Observable<any>;
17
+ getPresignedLink(fileName: string): Observable<any>;
11
18
  attachFile(file: File): Observable<any>;
12
19
  attachFilePromise(file: File): Promise<any>;
20
+ /**
21
+ * Build an Error object but keep HTTP-related metadata for callers that need to branch by status.
22
+ * Note: We intentionally do NOT change business flow; we only enrich the error instance.
23
+ */
24
+ private buildHttpError;
25
+ uploadFile(file: File): Observable<ImageUploadResult>;
26
+ /**
27
+ * Tạo tên file unique bằng cách thêm timestamp và random string
28
+ * Format: originalname-timestamp-random.ext
29
+ */
30
+ private generateUniqueFileName;
31
+ private extractFileName;
32
+ private buildResult;
13
33
  static ɵfac: i0.ɵɵFactoryDeclaration<FileAIA_GCSService, never>;
14
34
  static ɵprov: i0.ɵɵInjectableDeclaration<FileAIA_GCSService>;
15
35
  }
36
+ export {};
@@ -2,14 +2,35 @@ import { Observable } from "rxjs";
2
2
  import { HttpClient } from "@angular/common/http";
3
3
  import { ApiService } from "./api.service";
4
4
  import * as i0 from "@angular/core";
5
+ interface ImageUploadResult {
6
+ url: string;
7
+ filePath: string;
8
+ fileName: string;
9
+ originalName: string;
10
+ }
5
11
  export declare class FileGCSService {
6
12
  private _http;
7
13
  private _apiService;
8
14
  baseUrl: string;
9
15
  constructor(_http: HttpClient, _apiService: ApiService);
10
16
  getSignedLink(filePath: string): Observable<any>;
17
+ getPresignedLink(fileName: string): Observable<any>;
11
18
  attachFile(file: File): Observable<any>;
12
19
  attachFilePromise(file: File): Promise<any>;
20
+ /**
21
+ * Build an Error object but keep HTTP-related metadata for callers that need to branch by status.
22
+ * Note: We intentionally do NOT change business flow; we only enrich the error instance.
23
+ */
24
+ private buildHttpError;
25
+ uploadFile(file: File): Observable<ImageUploadResult>;
26
+ /**
27
+ * Tạo tên file unique bằng cách thêm timestamp và random string
28
+ * Format: originalname-timestamp-random.ext
29
+ */
30
+ private generateUniqueFileName;
31
+ private extractFileName;
32
+ private buildResult;
13
33
  static ɵfac: i0.ɵɵFactoryDeclaration<FileGCSService, never>;
14
34
  static ɵprov: i0.ɵɵInjectableDeclaration<FileGCSService>;
15
35
  }
36
+ export {};
@@ -2,7 +2,7 @@ import { Observable } from "rxjs";
2
2
  import { HttpClient } from "@angular/common/http";
3
3
  import { ApiService } from "./api.service";
4
4
  import * as i0 from "@angular/core";
5
- export interface ImageUploadResult {
5
+ interface ImageUploadResult {
6
6
  url: string;
7
7
  filePath: string;
8
8
  fileName: string;
@@ -13,6 +13,11 @@ export declare class FileWAPGCSService {
13
13
  private _apiService;
14
14
  baseUrl: string;
15
15
  constructor(_http: HttpClient, _apiService: ApiService);
16
+ /**
17
+ * Build an Error object but keep HTTP-related metadata for callers that need to branch by status.
18
+ * Note: We intentionally do NOT change business flow; we only enrich the error instance.
19
+ */
20
+ private buildHttpError;
16
21
  getSignedLink(filePath: string): Observable<any>;
17
22
  getPresignedLink(fileName: string): Observable<any>;
18
23
  setPublic(filePath: string): Observable<boolean>;
@@ -29,3 +34,4 @@ export declare class FileWAPGCSService {
29
34
  static ɵfac: i0.ɵɵFactoryDeclaration<FileWAPGCSService, never>;
30
35
  static ɵprov: i0.ɵɵInjectableDeclaration<FileWAPGCSService>;
31
36
  }
37
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web-portal/core-infrastructure",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.0",
6
6
  "@angular/core": "^19.2.0",