@@ -80,15 +80,15 @@ export class SFProjectService extends ProjectService<SFProject, SFProjectDoc> {
8080 }
8181
8282 async onlineCreate ( settings : SFProjectCreateSettings ) : Promise < string > {
83- return ( await this . onlineInvoke < string > ( 'create' , { settings } ) ) ! ;
83+ return await this . onlineInvoke < string > ( 'create' , { settings } ) ;
8484 }
8585
8686 /**
8787 * Creates an SF project/resource with the given paratext id, and adds the user to it.
8888 * @param paratextId The paratext id of the project or resource.
8989 * @returns The SF project id.
9090 */
91- async onlineCreateResourceProject ( paratextId : string ) : Promise < string | undefined > {
91+ async onlineCreateResourceProject ( paratextId : string ) : Promise < string > {
9292 return this . onlineInvoke < string > ( 'createResourceProject' , { paratextId } ) ;
9393 }
9494
@@ -219,7 +219,7 @@ export class SFProjectService extends ProjectService<SFProject, SFProjectDoc> {
219219 scriptureRange : string ,
220220 targetProjectId : string ,
221221 timestamp : Date
222- ) : Promise < string | undefined > {
222+ ) : Promise < string > {
223223 return this . onlineInvoke < string > ( 'applyPreTranslationToProject' , {
224224 projectId,
225225 scriptureRange,
@@ -244,40 +244,40 @@ export class SFProjectService extends ProjectService<SFProject, SFProjectDoc> {
244244 }
245245
246246 async onlineIsAlreadyInvited ( id : string , email : string ) : Promise < boolean > {
247- return ( await this . onlineInvoke < boolean > ( 'isAlreadyInvited' , {
247+ return await this . onlineInvoke < boolean > ( 'isAlreadyInvited' , {
248248 projectId : id ,
249249 email
250- } ) ) ! ;
250+ } ) ;
251251 }
252252
253253 /** Get list of email addresses that have outstanding invitations on project.
254254 * Caller must be an admin on the project. */
255255 async onlineInvitedUsers ( projectId : string ) : Promise < InviteeStatus [ ] > {
256- return ( await this . onlineInvoke < InviteeStatus [ ] > ( 'invitedUsers' , {
256+ return await this . onlineInvoke < InviteeStatus [ ] > ( 'invitedUsers' , {
257257 projectId
258- } ) ) ! ;
258+ } ) ;
259259 }
260260
261261 /** Get added into project with specified shareKey code. */
262262 async onlineJoinWithShareKey ( shareKey : string ) : Promise < string > {
263- return ( await this . onlineInvoke < string > ( 'joinWithShareKey' , { shareKey } ) ) ! ;
263+ return await this . onlineInvoke < string > ( 'joinWithShareKey' , { shareKey } ) ;
264264 }
265265
266- onlineInvite ( id : string , email : string , locale : string , role : string ) : Promise < string | undefined > {
266+ onlineInvite ( id : string , email : string , locale : string , role : string ) : Promise < string > {
267267 return this . onlineInvoke ( 'invite' , { projectId : id , email, locale, role } ) ;
268268 }
269269
270270 async onlineUninviteUser ( projectId : string , emailToUninvite : string ) : Promise < string > {
271- return ( await this . onlineInvoke < string > ( 'uninviteUser' , {
271+ return await this . onlineInvoke < string > ( 'uninviteUser' , {
272272 projectId,
273273 emailToUninvite
274- } ) ) ! ;
274+ } ) ;
275275 }
276276
277277 async onlineIsSourceProject ( projectId : string ) : Promise < boolean > {
278- return ( await this . onlineInvoke < boolean > ( 'isSourceProject' , {
278+ return await this . onlineInvoke < boolean > ( 'isSourceProject' , {
279279 projectId
280- } ) ) ! ;
280+ } ) ;
281281 }
282282
283283 async onlineGetLinkSharingKey (
@@ -286,14 +286,12 @@ export class SFProjectService extends ProjectService<SFProject, SFProjectDoc> {
286286 shareLinkType : ShareLinkType ,
287287 daysBeforeExpiration : number
288288 ) : Promise < string > {
289- return (
290- ( await this . onlineInvoke < string > ( 'linkSharingKey' , {
291- projectId,
292- role,
293- shareLinkType,
294- daysBeforeExpiration
295- } ) ) ?? ''
296- ) ;
289+ return await this . onlineInvoke < string > ( 'linkSharingKey' , {
290+ projectId,
291+ role,
292+ shareLinkType,
293+ daysBeforeExpiration
294+ } ) ;
297295 }
298296
299297 async onlineReserveLinkSharingKey ( shareKey : string , daysBeforeExpiration : number ) : Promise < void > {
@@ -305,19 +303,19 @@ export class SFProjectService extends ProjectService<SFProject, SFProjectDoc> {
305303 }
306304
307305 async onlineSetRoleProjectPermissions ( projectId : string , role : string , permissions : string [ ] ) : Promise < void > {
308- return ( await this . onlineInvoke < void > ( 'setRoleProjectPermissions' , {
306+ return await this . onlineInvoke < void > ( 'setRoleProjectPermissions' , {
309307 projectId,
310308 role,
311309 permissions
312- } ) ) ! ;
310+ } ) ;
313311 }
314312
315313 async onlineSetUserProjectPermissions ( projectId : string , userId : string , permissions : string [ ] ) : Promise < void > {
316- return ( await this . onlineInvoke < void > ( 'setUserProjectPermissions' , {
314+ return await this . onlineInvoke < void > ( 'setUserProjectPermissions' , {
317315 projectId,
318316 userId,
319317 permissions
320- } ) ) ! ;
318+ } ) ;
321319 }
322320
323321 async onlineCreateAudioTimingData (
@@ -383,11 +381,7 @@ export class SFProjectService extends ProjectService<SFProject, SFProjectDoc> {
383381 } ) ;
384382 }
385383
386- async onlineEventMetrics (
387- projectId : string ,
388- pageIndex : number ,
389- pageSize : number
390- ) : Promise < QueryResults < EventMetric > | undefined > {
384+ async onlineEventMetrics ( projectId : string , pageIndex : number , pageSize : number ) : Promise < QueryResults < EventMetric > > {
391385 return await this . onlineInvoke < QueryResults < EventMetric > > ( 'eventMetrics' , { projectId, pageIndex, pageSize } ) ;
392386 }
393387
@@ -396,7 +390,7 @@ export class SFProjectService extends ProjectService<SFProject, SFProjectDoc> {
396390 projectId ?: string ,
397391 startDate ?: Date ,
398392 endDate ?: Date
399- ) : Promise < QueryResults < EventMetric > | undefined > {
393+ ) : Promise < QueryResults < EventMetric > > {
400394 const params : any = {
401395 projectId : projectId ?? null ,
402396 scopes : [ 3 ] , // Drafting scope
0 commit comments