diff --git a/keyserver/addons/rust-node-addon/rust-binding-types.js b/keyserver/addons/rust-node-addon/rust-binding-types.js index 0f632b687..ddfec0bc1 100644 --- a/keyserver/addons/rust-node-addon/rust-binding-types.js +++ b/keyserver/addons/rust-node-addon/rust-binding-types.js @@ -1,71 +1,67 @@ // @flow import type { SignedIdentityKeysBlob } from 'lib/types/crypto-types.js'; - -type UserLoginResponse = { - +userId: string, - +accessToken: string, -}; +import type { UserLoginResponse } from 'lib/types/identity-service-types.js'; type InboundKeyInfoResponse = { +payload: string, +payloadSignature: string, +socialProof?: ?string, +contentPrekey: string, +contentPrekeySignature: string, +notifPrekey: string, +notifPrekeySignature: string, }; type RustNativeBindingAPI = { +loginUser: ( username: string, password: string, signedIdentityKeysBlob: SignedIdentityKeysBlob, contentPrekey: string, contentPrekeySignature: string, notifPrekey: string, notifPrekeySignature: string, contentOneTimeKeys: $ReadOnlyArray, notifOneTimeKeys: $ReadOnlyArray, ) => Promise, +registerUser: ( username: string, password: string, signedIdentityKeysBlob: SignedIdentityKeysBlob, contentPrekey: string, contentPrekeySignature: string, notifPrekey: string, notifPrekeySignature: string, contentOneTimeKeys: $ReadOnlyArray, notifOneTimeKeys: $ReadOnlyArray, ) => Promise, +addReservedUsernames: (message: string, signature: string) => Promise, +removeReservedUsername: ( message: string, signature: string, ) => Promise, +publishPrekeys: ( userId: string, deviceId: string, accessToken: string, contentPrekey: string, contentPrekeySignature: string, notifPrekey: string, notifPrekeySignature: string, ) => Promise, +uploadOneTimeKeys: ( userId: string, deviceId: string, accessToken: string, contentOneTimePreKeys: $ReadOnlyArray, notifOneTimePreKeys: $ReadOnlyArray, ) => Promise, +getInboundKeysForUserDevice: ( identifierType: string, identifierValue: string, deviceId: string, ) => Promise, }; export type { RustNativeBindingAPI }; diff --git a/lib/types/identity-service-types.js b/lib/types/identity-service-types.js new file mode 100644 index 000000000..4207326e4 --- /dev/null +++ b/lib/types/identity-service-types.js @@ -0,0 +1,6 @@ +// @flow + +export type UserLoginResponse = { + +userId: string, + +accessToken: string, +};