@itwin/core-mobile 4.0.0-dev.8 → 4.0.0-dev.81
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/CHANGELOG.md +48 -1
- package/README.md +1 -1
- package/lib/cjs/MobileBackend.d.ts +7 -7
- package/lib/cjs/MobileBackend.js +28 -24
- package/lib/cjs/MobileBackend.js.map +1 -1
- package/lib/cjs/MobileFrontend.d.ts +5 -5
- package/lib/cjs/MobileFrontend.js +25 -21
- package/lib/cjs/MobileFrontend.js.map +1 -1
- package/lib/cjs/__DOC_ONLY__.d.ts +33 -33
- package/lib/cjs/__DOC_ONLY__.js +56 -52
- package/lib/cjs/__DOC_ONLY__.js.map +1 -1
- package/lib/cjs/backend/MobileAuthorizationBackend.d.ts +17 -17
- package/lib/cjs/backend/MobileAuthorizationBackend.js +46 -46
- package/lib/cjs/backend/MobileAuthorizationBackend.js.map +1 -1
- package/lib/cjs/backend/MobileFileHandler.d.ts +112 -112
- package/lib/cjs/backend/MobileFileHandler.d.ts.map +1 -1
- package/lib/cjs/backend/MobileFileHandler.js +263 -263
- package/lib/cjs/backend/MobileFileHandler.js.map +1 -1
- package/lib/cjs/backend/MobileHost.d.ts +72 -72
- package/lib/cjs/backend/MobileHost.d.ts.map +1 -1
- package/lib/cjs/backend/MobileHost.js +149 -156
- package/lib/cjs/backend/MobileHost.js.map +1 -1
- package/lib/cjs/backend/MobileRpcServer.d.ts +19 -19
- package/lib/cjs/backend/MobileRpcServer.js +156 -156
- package/lib/cjs/backend/MobileRpcServer.js.map +1 -1
- package/lib/cjs/backend/Request.d.ts +117 -149
- package/lib/cjs/backend/Request.d.ts.map +1 -1
- package/lib/cjs/backend/Request.js +255 -267
- package/lib/cjs/backend/Request.js.map +1 -1
- package/lib/cjs/common/MobileAppChannel.d.ts +4 -4
- package/lib/cjs/common/MobileAppChannel.js +11 -11
- package/lib/cjs/common/MobileAppChannel.js.map +1 -1
- package/lib/cjs/common/MobileAppProps.d.ts +35 -35
- package/lib/cjs/common/MobileAppProps.d.ts.map +1 -1
- package/lib/cjs/common/MobileAppProps.js +26 -26
- package/lib/cjs/common/MobileAppProps.js.map +1 -1
- package/lib/cjs/common/MobileEventLoop.d.ts +11 -11
- package/lib/cjs/common/MobileEventLoop.js +30 -30
- package/lib/cjs/common/MobileEventLoop.js.map +1 -1
- package/lib/cjs/common/MobileIpc.d.ts +17 -17
- package/lib/cjs/common/MobileIpc.js +70 -70
- package/lib/cjs/common/MobileIpc.js.map +1 -1
- package/lib/cjs/common/MobilePush.d.ts +20 -20
- package/lib/cjs/common/MobilePush.js +53 -53
- package/lib/cjs/common/MobilePush.js.map +1 -1
- package/lib/cjs/common/MobileRpcManager.d.ts +40 -40
- package/lib/cjs/common/MobileRpcManager.js +110 -110
- package/lib/cjs/common/MobileRpcManager.js.map +1 -1
- package/lib/cjs/common/MobileRpcProtocol.d.ts +58 -58
- package/lib/cjs/common/MobileRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/common/MobileRpcProtocol.js +277 -277
- package/lib/cjs/common/MobileRpcProtocol.js.map +1 -1
- package/lib/cjs/common/MobileRpcRequest.d.ts +20 -20
- package/lib/cjs/common/MobileRpcRequest.js +50 -50
- package/lib/cjs/common/MobileRpcRequest.js.map +1 -1
- package/lib/cjs/frontend/MobileApp.d.ts +23 -23
- package/lib/cjs/frontend/MobileApp.d.ts.map +1 -1
- package/lib/cjs/frontend/MobileApp.js +79 -80
- package/lib/cjs/frontend/MobileApp.js.map +1 -1
- package/lib/cjs/frontend/MobileAuthorizationFrontend.d.ts +17 -17
- package/lib/cjs/frontend/MobileAuthorizationFrontend.d.ts.map +1 -1
- package/lib/cjs/frontend/MobileAuthorizationFrontend.js +54 -46
- package/lib/cjs/frontend/MobileAuthorizationFrontend.js.map +1 -1
- package/lib/cjs/test/ios/MobilePlatform.test.d.ts +1 -1
- package/lib/cjs/test/ios/MobilePlatform.test.js +84 -84
- package/lib/cjs/test/ios/MobilePlatform.test.js.map +1 -1
- package/package.json +18 -26
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module iModelHub
|
|
3
|
-
*/
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
import * as https from "https";
|
|
6
|
-
import { AccessToken, BentleyError, GetMetaDataFunction } from "@itwin/core-bentley";
|
|
7
|
-
import { ProgressCallback } from "./Request";
|
|
8
|
-
/** Interface to cancel a request
|
|
9
|
-
* @beta
|
|
10
|
-
*/
|
|
11
|
-
export interface CancelRequest {
|
|
12
|
-
/** Returns true if cancel request was acknowledged */
|
|
13
|
-
cancel: () => boolean;
|
|
14
|
-
}
|
|
15
|
-
/** Error thrown when user cancelled operation
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare class UserCancelledError extends BentleyError {
|
|
19
|
-
constructor(errorNumber: number, message: string, getMetaData?: GetMetaDataFunction);
|
|
20
|
-
}
|
|
21
|
-
/** Error thrown fail to download file. ErrorNumber will correspond to HTTP error code.
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
export declare class DownloadFailed extends BentleyError {
|
|
25
|
-
constructor(errorNumber: number, message: string, getMetaData?: GetMetaDataFunction);
|
|
26
|
-
}
|
|
27
|
-
/** Error thrown when sas-url provided for download has expired
|
|
28
|
-
* @internal
|
|
29
|
-
*/
|
|
30
|
-
export declare class SasUrlExpired extends BentleyError {
|
|
31
|
-
constructor(errorNumber: number, message: string, getMetaData?: GetMetaDataFunction);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Provides methods to work with the file system and azure storage. An instance of this class has to be provided to [[IModelClient]] for file upload/download methods to work.
|
|
35
|
-
* @internal
|
|
36
|
-
*/
|
|
37
|
-
export declare class MobileFileHandler {
|
|
38
|
-
/** @internal */
|
|
39
|
-
agent?: https.Agent;
|
|
40
|
-
/**
|
|
41
|
-
* Constructor for MobileFileHandler.
|
|
42
|
-
*/
|
|
43
|
-
constructor();
|
|
44
|
-
/** Create a directory, recursively setting up the path as necessary. */
|
|
45
|
-
private static makeDirectoryRecursive;
|
|
46
|
-
/**
|
|
47
|
-
* Make url safe for logging by removing sensitive information
|
|
48
|
-
* @param url input url that will be strip of search and query parameters and replace them by ... for security reason
|
|
49
|
-
*/
|
|
50
|
-
private static getSafeUrlForLogging;
|
|
51
|
-
/**
|
|
52
|
-
* Check if sas url has expired
|
|
53
|
-
* @param download sas url for download
|
|
54
|
-
* @param futureSeconds should be valid in future for given seconds.
|
|
55
|
-
*/
|
|
56
|
-
static isUrlExpired(downloadUrl: string, futureSeconds?: number): boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Download a file from AzureBlobStorage for iModelHub. Creates the directory containing the file if necessary. If there is an error in the operation, incomplete file is deleted from disk.
|
|
59
|
-
* @param downloadUrl URL to download file from.
|
|
60
|
-
* @param downloadToPathname Pathname to download the file to.
|
|
61
|
-
* @param fileSize Size of the file that's being downloaded.
|
|
62
|
-
* @param progressCallback Callback for tracking progress.
|
|
63
|
-
* @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) if one of the arguments is undefined or empty.
|
|
64
|
-
*/
|
|
65
|
-
downloadFile(_accessToken: AccessToken, downloadUrl: string, downloadToPathname: string, fileSize?: number, progressCallback?: ProgressCallback, cancelRequest?: CancelRequest): Promise<void>;
|
|
66
|
-
/** Get encoded block id from its number. */
|
|
67
|
-
private getBlockId;
|
|
68
|
-
private uploadChunk;
|
|
69
|
-
/**
|
|
70
|
-
* Upload a file to AzureBlobStorage for iModelHub.
|
|
71
|
-
* @param uploadUrl URL to upload the file to.
|
|
72
|
-
* @param uploadFromPathname Pathname to upload the file from.
|
|
73
|
-
* @param progressCallback Callback for tracking progress.
|
|
74
|
-
* @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) if one of the arguments is undefined or empty.
|
|
75
|
-
*/
|
|
76
|
-
uploadFile(accessToken: AccessToken, uploadUrlString: string, uploadFromPathname: string, progressCallback?: ProgressCallback): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Get size of a file.
|
|
79
|
-
* @param filePath Path of the file.
|
|
80
|
-
* @returns Size of the file.
|
|
81
|
-
*/
|
|
82
|
-
getFileSize(filePath: string): number;
|
|
83
|
-
/**
|
|
84
|
-
* Check if path is a directory.
|
|
85
|
-
* @param filePath Path of the file.
|
|
86
|
-
* @returns True if path is directory.
|
|
87
|
-
*/
|
|
88
|
-
isDirectory(filePath: string): boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Check if path exists.
|
|
91
|
-
* @param filePath Path of the file.
|
|
92
|
-
* @returns True if path exists.
|
|
93
|
-
*/
|
|
94
|
-
exists(filePath: string): boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Deletes file.
|
|
97
|
-
* @param filePath Path of the file.
|
|
98
|
-
*/
|
|
99
|
-
unlink(filePath: string): void;
|
|
100
|
-
/**
|
|
101
|
-
* Get file name from the path.
|
|
102
|
-
* @param filePath Path of the file.
|
|
103
|
-
* @returns File name.
|
|
104
|
-
*/
|
|
105
|
-
basename(filePath: string): string;
|
|
106
|
-
/**
|
|
107
|
-
* Join multiple strings into a single path.
|
|
108
|
-
* @param paths Strings to join.
|
|
109
|
-
* @returns Joined path.
|
|
110
|
-
*/
|
|
111
|
-
join(...paths: string[]): string;
|
|
112
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module iModelHub
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
import * as https from "node:https";
|
|
6
|
+
import { AccessToken, BentleyError, GetMetaDataFunction } from "@itwin/core-bentley";
|
|
7
|
+
import { ProgressCallback } from "./Request";
|
|
8
|
+
/** Interface to cancel a request
|
|
9
|
+
* @beta
|
|
10
|
+
*/
|
|
11
|
+
export interface CancelRequest {
|
|
12
|
+
/** Returns true if cancel request was acknowledged */
|
|
13
|
+
cancel: () => boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Error thrown when user cancelled operation
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare class UserCancelledError extends BentleyError {
|
|
19
|
+
constructor(errorNumber: number, message: string, getMetaData?: GetMetaDataFunction);
|
|
20
|
+
}
|
|
21
|
+
/** Error thrown fail to download file. ErrorNumber will correspond to HTTP error code.
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export declare class DownloadFailed extends BentleyError {
|
|
25
|
+
constructor(errorNumber: number, message: string, getMetaData?: GetMetaDataFunction);
|
|
26
|
+
}
|
|
27
|
+
/** Error thrown when sas-url provided for download has expired
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export declare class SasUrlExpired extends BentleyError {
|
|
31
|
+
constructor(errorNumber: number, message: string, getMetaData?: GetMetaDataFunction);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Provides methods to work with the file system and azure storage. An instance of this class has to be provided to [[IModelClient]] for file upload/download methods to work.
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export declare class MobileFileHandler {
|
|
38
|
+
/** @internal */
|
|
39
|
+
agent?: https.Agent;
|
|
40
|
+
/**
|
|
41
|
+
* Constructor for MobileFileHandler.
|
|
42
|
+
*/
|
|
43
|
+
constructor();
|
|
44
|
+
/** Create a directory, recursively setting up the path as necessary. */
|
|
45
|
+
private static makeDirectoryRecursive;
|
|
46
|
+
/**
|
|
47
|
+
* Make url safe for logging by removing sensitive information
|
|
48
|
+
* @param url input url that will be strip of search and query parameters and replace them by ... for security reason
|
|
49
|
+
*/
|
|
50
|
+
private static getSafeUrlForLogging;
|
|
51
|
+
/**
|
|
52
|
+
* Check if sas url has expired
|
|
53
|
+
* @param download sas url for download
|
|
54
|
+
* @param futureSeconds should be valid in future for given seconds.
|
|
55
|
+
*/
|
|
56
|
+
static isUrlExpired(downloadUrl: string, futureSeconds?: number): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Download a file from AzureBlobStorage for iModelHub. Creates the directory containing the file if necessary. If there is an error in the operation, incomplete file is deleted from disk.
|
|
59
|
+
* @param downloadUrl URL to download file from.
|
|
60
|
+
* @param downloadToPathname Pathname to download the file to.
|
|
61
|
+
* @param fileSize Size of the file that's being downloaded.
|
|
62
|
+
* @param progressCallback Callback for tracking progress.
|
|
63
|
+
* @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) if one of the arguments is undefined or empty.
|
|
64
|
+
*/
|
|
65
|
+
downloadFile(_accessToken: AccessToken, downloadUrl: string, downloadToPathname: string, fileSize?: number, progressCallback?: ProgressCallback, cancelRequest?: CancelRequest): Promise<void>;
|
|
66
|
+
/** Get encoded block id from its number. */
|
|
67
|
+
private getBlockId;
|
|
68
|
+
private uploadChunk;
|
|
69
|
+
/**
|
|
70
|
+
* Upload a file to AzureBlobStorage for iModelHub.
|
|
71
|
+
* @param uploadUrl URL to upload the file to.
|
|
72
|
+
* @param uploadFromPathname Pathname to upload the file from.
|
|
73
|
+
* @param progressCallback Callback for tracking progress.
|
|
74
|
+
* @throws [[IModelHubClientError]] with [IModelHubStatus.UndefinedArgumentError]($bentley) if one of the arguments is undefined or empty.
|
|
75
|
+
*/
|
|
76
|
+
uploadFile(accessToken: AccessToken, uploadUrlString: string, uploadFromPathname: string, progressCallback?: ProgressCallback): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Get size of a file.
|
|
79
|
+
* @param filePath Path of the file.
|
|
80
|
+
* @returns Size of the file.
|
|
81
|
+
*/
|
|
82
|
+
getFileSize(filePath: string): number;
|
|
83
|
+
/**
|
|
84
|
+
* Check if path is a directory.
|
|
85
|
+
* @param filePath Path of the file.
|
|
86
|
+
* @returns True if path is directory.
|
|
87
|
+
*/
|
|
88
|
+
isDirectory(filePath: string): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Check if path exists.
|
|
91
|
+
* @param filePath Path of the file.
|
|
92
|
+
* @returns True if path exists.
|
|
93
|
+
*/
|
|
94
|
+
exists(filePath: string): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Deletes file.
|
|
97
|
+
* @param filePath Path of the file.
|
|
98
|
+
*/
|
|
99
|
+
unlink(filePath: string): void;
|
|
100
|
+
/**
|
|
101
|
+
* Get file name from the path.
|
|
102
|
+
* @param filePath Path of the file.
|
|
103
|
+
* @returns File name.
|
|
104
|
+
*/
|
|
105
|
+
basename(filePath: string): string;
|
|
106
|
+
/**
|
|
107
|
+
* Join multiple strings into a single path.
|
|
108
|
+
* @param paths Strings to join.
|
|
109
|
+
* @returns Joined path.
|
|
110
|
+
*/
|
|
111
|
+
join(...paths: string[]): string;
|
|
112
|
+
}
|
|
113
113
|
//# sourceMappingURL=MobileFileHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileFileHandler.d.ts","sourceRoot":"","sources":["../../../src/backend/MobileFileHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;;
|
|
1
|
+
{"version":3,"file":"MobileFileHandler.d.ts","sourceRoot":"","sources":["../../../src/backend/MobileFileHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAIH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,mBAAmB,EAAU,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAyC,MAAM,WAAW,CAAC;AAUpF;;IAEI;AACJ,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,MAAM,EAAE,MAAM,OAAO,CAAC;CACvB;AAED;;IAEI;AACJ,qBAAa,kBAAmB,SAAQ,YAAY;gBAC/B,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,mBAAmB;CAI3F;AAED;;IAEI;AACJ,qBAAa,cAAe,SAAQ,YAAY;gBAC3B,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,mBAAmB;CAI3F;AAED;;IAEI;AACJ,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