Skip to content

Commit

Permalink
feat: add pre create users and validate invitation
Browse files Browse the repository at this point in the history
  • Loading branch information
apsantiso committed Nov 24, 2023
1 parent 9312667 commit 75ea804
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/drive/share/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,16 @@ export class Share {
);
}

/**
* Check if the expirationDate of invite is valid.
* @param {string} invitationId - The id of the invitation.
* @returns {Promise<{uuid: string}>} A promise that resolves when the folder is shared with the user.
*/
public validateInviteExpiration(invitationId: string): Promise<{ uuid: string }> {
return this.client.get(`sharings/invites/${invitationId}/validate`, this.headers());
}

/**
* Share a private folder with a user.
* @param {string} invitationId - The id of the invitation.
Expand Down
19 changes: 18 additions & 1 deletion src/drive/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
UpdateProfilePayload,
UserPublicKeyResponse,
} from './types';
import { UserSettings } from '../../shared/types/userSettings';
import { UUID, UserSettings } from '../../shared/types/userSettings';
import { HttpClient } from '../../shared/http/client';

export * as UserTypes from './types';
Expand Down Expand Up @@ -91,6 +91,23 @@ export class Users {
);
}

/**
* Pre registers an email
* @param email
*/
public preRegister(email: string): Promise<{
publicKey: string;
user: { uuid: UUID; email: string };
}> {
return this.client.post(
'/users/pre-create',
{
email,
},
this.headers(),
);
}

/**
* Updates a user profile
* @param payload
Expand Down

0 comments on commit 75ea804

Please sign in to comment.