Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@internxt/sdk",
"author": "Internxt <[email protected]>",
"version": "1.9.1",
"version": "1.9.2",
"description": "An sdk for interacting with Internxt's services",
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion src/drive/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ export class Users {
newPassword: payload.newEncryptedPassword,
newSalt: payload.newEncryptedSalt,
mnemonic: payload.encryptedMnemonic,
privateKey: payload.encryptedPrivateKey,
privateKey: payload.keys.encryptedPrivateKey,
privateKyberKey: payload.keys.encryptedPrivateKyberKey,
encryptVersion: payload.encryptVersion,
},
this.headers(),
Expand Down
10 changes: 9 additions & 1 deletion src/drive/users/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,28 @@ export interface ChangePasswordPayloadNew {
newEncryptedPassword: string;
newEncryptedSalt: string;
encryptedMnemonic: string;
/**
* @deprecated encryptedPrivateKey field is depercated, use keys.encryptedPrivateKey instead
*/
encryptedPrivateKey: string;
keys: {
encryptedPrivateKey: string;
encryptedPrivateKyberKey: string;
}
encryptVersion: string;
}

export type UpdateProfilePayload = Partial<Pick<UserSettings, 'name' | 'lastname'>>;

export type PreCreateUserResponse = {
publicKey: string;
publicKyberKey?: string;
user: { uuid: UUID; email: string };
};

export type FriendInvite = { guestEmail: string; host: number; accepted: boolean; id: number };

export type UserPublicKeyResponse = { publicKey: string };
export type UserPublicKeyResponse = { publicKey: string, publicKyberKey?: string };

export type VerifyEmailChangeResponse = {
oldEmail: string;
Expand Down
15 changes: 11 additions & 4 deletions test/drive/users/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ describe('# users service tests', () => {
const email = '[email protected]';
const callStub = sinon.stub(httpClient, 'post').resolves({
publicKey: 'publicKey',
publicKyberKey: 'publicKeyberKey',
user: { uuid: 'exampleUuid', email },
});

Expand All @@ -110,6 +111,7 @@ describe('# users service tests', () => {
expect(callStub.firstCall.args).toEqual(['/users/pre-create', { email }, headers]);
expect(body).toEqual({
publicKey: 'publicKey',
publicKyberKey: 'publicKeyberKey',
user: { uuid: 'exampleUuid', email },
});
});
Expand All @@ -124,9 +126,13 @@ describe('# users service tests', () => {
currentEncryptedPassword: '1',
encryptedMnemonic: '2',
encryptedPrivateKey: '3',
newEncryptedPassword: '4',
newEncryptedSalt: '5',
encryptVersion: '6',
keys: {
encryptedPrivateKey: '3',
encryptedPrivateKyberKey: '4',
},
newEncryptedPassword: '5',
newEncryptedSalt: '6',
encryptVersion: '7',
};

// Act
Expand All @@ -140,7 +146,8 @@ describe('# users service tests', () => {
newPassword: payload.newEncryptedPassword,
newSalt: payload.newEncryptedSalt,
mnemonic: payload.encryptedMnemonic,
privateKey: payload.encryptedPrivateKey,
privateKey: payload.keys.encryptedPrivateKey,
privateKyberKey: payload.keys.encryptedPrivateKyberKey,
encryptVersion: payload.encryptVersion,
},
headers,
Expand Down
Loading