dpu-cloud-sdk 1.0.0
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/.env.development +1 -0
- package/.env.production +1 -0
- package/dist/DPUClient.d.ts +83 -0
- package/dist/DPUClient.js +1043 -0
- package/dist/ServiceIntegration.d.ts +20 -0
- package/dist/ServiceIntegration.js +506 -0
- package/dist/api/auth.d.ts +3 -0
- package/dist/api/auth.js +10 -0
- package/dist/api/compress.d.ts +4 -0
- package/dist/api/compress.js +16 -0
- package/dist/api/translate.d.ts +8 -0
- package/dist/api/translate.js +38 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/models/RequestModel.d.ts +33 -0
- package/dist/models/RequestModel.js +2 -0
- package/dist/models/ResponseModel.d.ts +99 -0
- package/dist/models/ResponseModel.js +1 -0
- package/dist/utils/Config.d.ts +32 -0
- package/dist/utils/Config.js +44 -0
- package/dist/utils/Constants.d.ts +48 -0
- package/dist/utils/Constants.js +55 -0
- package/dist/utils/Enum.d.ts +27 -0
- package/dist/utils/Enum.js +30 -0
- package/dist/utils/Helper.d.ts +4 -0
- package/dist/utils/Helper.js +47 -0
- package/dist/workerDownloadSingleFile.d.ts +1 -0
- package/dist/workerDownloadSingleFile.js +35 -0
- package/dist/workerUploadChildFile.d.ts +1 -0
- package/dist/workerUploadChildFile.js +82 -0
- package/dist/workerUploadSingleFile.d.ts +1 -0
- package/dist/workerUploadSingleFile.js +93 -0
- package/dpubim-service-1.1.28.tgz +0 -0
- package/package.json +33 -0
- package/src/DPUClient.ts +1505 -0
- package/src/ServiceIntegration.ts +710 -0
- package/src/api/auth.ts +18 -0
- package/src/api/compress.ts +36 -0
- package/src/api/translate.ts +94 -0
- package/src/index.ts +4 -0
- package/src/models/RequestModel.ts +44 -0
- package/src/models/ResponseModel.ts +110 -0
- package/src/utils/Config.ts +59 -0
- package/src/utils/Constants.ts +61 -0
- package/src/utils/Enum.ts +29 -0
- package/src/utils/Helper.ts +57 -0
- package/src/workerDownloadSingleFile.ts +34 -0
- package/src/workerUploadChildFile.ts +85 -0
- package/src/workerUploadSingleFile.ts +123 -0
- package/tsconfig.json +108 -0
- package/webpack.config.js +43 -0
package/.env.development
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
BaseURL=https://localhost:7211
|
package/.env.production
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
BaseURL=https://translateservicedev.corebim.com
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { CompressionResponse, CompressStatus, InitUploadResponse, PresignURLResponse, Token, TranslateInfo } from "./models/ResponseModel";
|
|
2
|
+
import { Scope } from "./utils/Enum";
|
|
3
|
+
import { GetStatusTranslateRequest, TranslateRequest } from "./models/RequestModel";
|
|
4
|
+
interface IMultiFileUpload {
|
|
5
|
+
bucketName: string;
|
|
6
|
+
arrayBuffer: ArrayBuffer;
|
|
7
|
+
index: number;
|
|
8
|
+
percentOfChild?: ({ fileKey, versionFile, }: {
|
|
9
|
+
fileKey: string;
|
|
10
|
+
versionFile?: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
requestId: string;
|
|
13
|
+
fullName: string;
|
|
14
|
+
accessToken: string;
|
|
15
|
+
fileKey: string;
|
|
16
|
+
reGetAccessToken?: () => string;
|
|
17
|
+
initUpload?: InitUploadResponse;
|
|
18
|
+
isGetInfo?: boolean;
|
|
19
|
+
cancellationToken?: AbortController;
|
|
20
|
+
preSignUrl?: PresignURLResponse;
|
|
21
|
+
dataUploadId?: string;
|
|
22
|
+
}
|
|
23
|
+
type FileUploadType = {
|
|
24
|
+
file: File;
|
|
25
|
+
fileKey: string;
|
|
26
|
+
customFileName?: string;
|
|
27
|
+
initUpload?: InitUploadResponse;
|
|
28
|
+
isGetInfo?: boolean;
|
|
29
|
+
preSignUrl?: PresignURLResponse;
|
|
30
|
+
};
|
|
31
|
+
export declare class DPUClient {
|
|
32
|
+
private accessToken?;
|
|
33
|
+
private reFreshToken?;
|
|
34
|
+
private maxRetry;
|
|
35
|
+
private workersStatus;
|
|
36
|
+
constructor(accessToken?: string, reFreshToken?: () => Promise<string>, maxRetry?: number | undefined, baseURL?: string);
|
|
37
|
+
private baseAction;
|
|
38
|
+
private baseActionAnonymous;
|
|
39
|
+
compressFolder(bucketName: string, rootFolder?: string): Promise<CompressionResponse>;
|
|
40
|
+
getStatusCompress(requestIds: string[]): Promise<CompressStatus>;
|
|
41
|
+
cancelDownload(requestId: string): Promise<boolean>;
|
|
42
|
+
uploadFileAferInit(path: string, file: File, initUpload?: InitUploadResponse, cancellationToken?: AbortController, onProgress?: (chunkUploaded: number) => void, maxWebWorker?: number, worker?: Worker, dataUploadId?: string): Promise<unknown>;
|
|
43
|
+
uploadFileRetry(bucketName: string, file: File, cancellationToken: AbortController, onProgress?: (chunkUploaded: number) => void, maxWebWorker?: number, prefix?: string, initUpload?: InitUploadResponse, customFileName?: string, worker?: Worker, dataUploadId?: string): Promise<unknown>;
|
|
44
|
+
uploadFile(bucketName: string, file: File, cancellationToken: AbortController, onProgress?: (chunkUploaded: number) => void, maxWebWorker?: number, prefix?: string, initUpload?: InitUploadResponse, customFileName?: string, worker?: Worker, dataUploadId?: string): Promise<unknown>;
|
|
45
|
+
private runOnWorker;
|
|
46
|
+
uploadFolderAferInit(filesInitiated: {
|
|
47
|
+
file: File;
|
|
48
|
+
fileKey: string;
|
|
49
|
+
path: string;
|
|
50
|
+
initUpload?: InitUploadResponse;
|
|
51
|
+
isGetInfo?: boolean;
|
|
52
|
+
}[], cancellationToken?: AbortController, worker?: Worker, dataUploadId?: string, onProgress?: ({ percentCompleted, fileKey, versionFile, }: {
|
|
53
|
+
percentCompleted: number;
|
|
54
|
+
fileKey: string;
|
|
55
|
+
versionFile?: string;
|
|
56
|
+
}) => void, maxWebWorker?: number): Promise<any>;
|
|
57
|
+
uploadFolder(bucketName: string, files: FileUploadType[], cancellationToken: AbortController, worker?: Worker, dataUploadId?: string, onProgress?: ({ percentCompleted, fileKey, versionFile, }: {
|
|
58
|
+
percentCompleted: number;
|
|
59
|
+
fileKey: string;
|
|
60
|
+
versionFile?: string;
|
|
61
|
+
}) => void, maxWebWorker?: number, prefix?: string): Promise<any>;
|
|
62
|
+
uploadMultiFileRetry(bucketName: string, files: FileUploadType[], accessToken: string, cancellationToken: AbortController, maxWebWorker: number, reFreshToken?: () => Promise<string>, percentOfChild?: ({ fileKey, versionFile, }: {
|
|
63
|
+
fileKey: string;
|
|
64
|
+
versionFile?: string;
|
|
65
|
+
}) => void, prefix?: string, worker?: Worker, dataUploadId?: string): Promise<{
|
|
66
|
+
filesUploadFail: FileUploadType[] | undefined;
|
|
67
|
+
filesUploadSuccess: {
|
|
68
|
+
file: File;
|
|
69
|
+
customFileName?: string;
|
|
70
|
+
versionFile?: string;
|
|
71
|
+
}[] | undefined;
|
|
72
|
+
} | undefined>;
|
|
73
|
+
uploadSingleFile: (request: IMultiFileUpload) => Promise<any>;
|
|
74
|
+
private downloadSingleLargeFile;
|
|
75
|
+
translateFile(request: TranslateRequest): Promise<TranslateInfo>;
|
|
76
|
+
getStatusTranslate(request: string[]): Promise<any>;
|
|
77
|
+
getStatusTranslateFile(request: GetStatusTranslateRequest[]): Promise<any>;
|
|
78
|
+
getEPSGRegionCode(): Promise<string[]>;
|
|
79
|
+
getFileTileSet(translateId: string): Promise<string>;
|
|
80
|
+
getToken(clientId: string, clientSecret: string, scopes: Scope[]): Promise<Token>;
|
|
81
|
+
delay(ms: number): Promise<unknown>;
|
|
82
|
+
}
|
|
83
|
+
export {};
|