({
httpClient,
entitiesCache,
cryptoCache,
account,
openPGPCryptoModule,
srpModule,
config,
telemetry,
featureFlagProvider,
latestEventIdProvider,
}: ProtonDriveClientContructorParameters)
| 164 | }>; |
| 165 | }; |
| 166 | |
| 167 | constructor({ |
| 168 | httpClient, |
| 169 | entitiesCache, |
| 170 | cryptoCache, |
| 171 | account, |
| 172 | openPGPCryptoModule, |
| 173 | srpModule, |
| 174 | config, |
| 175 | telemetry, |
| 176 | featureFlagProvider, |
| 177 | latestEventIdProvider, |
| 178 | }: ProtonDriveClientContructorParameters) { |
| 179 | if (!telemetry) { |
| 180 | telemetry = new Telemetry(); |
| 181 | } |
| 182 | if (!featureFlagProvider) { |
| 183 | featureFlagProvider = new NullFeatureFlagProvider(); |
| 184 | } |
| 185 | this.logger = telemetry.getLogger('interface'); |
| 186 | |
| 187 | const fullConfig = getConfig(config); |
| 188 | this.sdkEvents = new SDKEvents(telemetry); |
| 189 | const cryptoModule = new DriveCrypto(telemetry, openPGPCryptoModule, srpModule); |
| 190 | const apiService = new DriveAPIService( |
| 191 | telemetry, |
| 192 | this.sdkEvents, |
| 193 | httpClient, |
| 194 | fullConfig.baseUrl, |
| 195 | fullConfig.language, |
| 196 | ); |
| 197 | this.shares = initSharesModule(telemetry, apiService, entitiesCache, cryptoCache, account, cryptoModule); |
| 198 | this.nodes = initNodesModule( |
| 199 | telemetry, |
| 200 | apiService, |
| 201 | entitiesCache, |
| 202 | cryptoCache, |
| 203 | account, |
| 204 | cryptoModule, |
| 205 | this.shares, |
| 206 | fullConfig.clientUid, |
| 207 | ); |
| 208 | this.sharing = initSharingModule( |
| 209 | telemetry, |
| 210 | apiService, |
| 211 | entitiesCache, |
| 212 | account, |
| 213 | cryptoModule, |
| 214 | this.shares, |
| 215 | this.nodes.access, |
| 216 | ); |
| 217 | this.download = initDownloadModule( |
| 218 | telemetry, |
| 219 | apiService, |
| 220 | cryptoModule, |
| 221 | account, |
| 222 | this.shares, |
| 223 | this.nodes.access, |
nothing calls this directly
no test coverage detected