MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / constructor

Method constructor

client/js/src/protonDriveClient.ts:166–318  ·  view source on GitHub ↗
({
        httpClient,
        entitiesCache,
        cryptoCache,
        account,
        openPGPCryptoModule,
        srpModule,
        config,
        telemetry,
        featureFlagProvider,
        latestEventIdProvider,
    }: ProtonDriveClientContructorParameters)

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 15

getConfigFunction · 0.90
initSharesModuleFunction · 0.90
initNodesModuleFunction · 0.90
initSharingModuleFunction · 0.90
initDownloadModuleFunction · 0.90
initUploadModuleFunction · 0.90
initDevicesModuleFunction · 0.90
getUidFunction · 0.90
getNodeUrlMethod · 0.80
getInfoMethod · 0.80
processCoreEventMethod · 0.80

Tested by

no test coverage detected