generated from array-in-a-matrix/matrix-bot-template
Auth is just the Client class, accessToken is a method of Client
This commit is contained in:
parent
b129fb0c60
commit
b66bc60f9c
|
@ -1,11 +1,11 @@
|
|||
# Things here have been tested to work
|
||||
|
||||
import nimbotsdk/matrixTypes
|
||||
export ICryptoStorageProvider, Storage, CryptoStore, Auth, Client, Content,
|
||||
export ICryptoStorageProvider, Storage, CryptoStore, Client, Content,
|
||||
Unsigned, Event, Filter, Appservice
|
||||
|
||||
import nimbotsdk/MatrixAuth
|
||||
export newMatrixAuth, passwordLogin, accessToken
|
||||
export newMatrixAuth, passwordLogin
|
||||
|
||||
import nimbotsdk/MatrixClient
|
||||
export newMatrixClient
|
||||
|
|
|
@ -2,12 +2,10 @@
|
|||
|
||||
import matrixTypes
|
||||
|
||||
proc newMatrixAuth*(homeserver: cstring): Auth {.importjs: "new MatrixAuth(#)".}
|
||||
proc newMatrixAuth*(homeserver: cstring): Client {.importjs: "new MatrixAuth(#)".}
|
||||
|
||||
proc passwordLogin*(auth: Auth, username, password: cstring): Client {.importjs: "await #.passwordLogin(#, #)".}
|
||||
proc passwordLogin*(auth: Auth, username, password, deviceName: cstring): Client {.importjs: "await #.passwordLogin(#, #, #)".}
|
||||
proc passwordLogin*(auth: Client, username, password: cstring): Client {.importjs: "await #.passwordLogin(#, #)".}
|
||||
proc passwordLogin*(auth: Client, username, password, deviceName: cstring): Client {.importjs: "await #.passwordLogin(#, #, #)".}
|
||||
|
||||
proc passwordRegister*(localpart, password: cstring): Client {.importjs: "await #.passwordRegister(#, #)".}
|
||||
proc passwordRegister*(localpart, password, deviceName: cstring): Client {.importjs: "await #.passwordRegister(#, #, #)".}
|
||||
|
||||
proc accessToken*(client: Client): cstring {.importjs: "#.accessToken".}
|
||||
|
|
|
@ -4,13 +4,13 @@ type Storage* = ref object
|
|||
|
||||
type CryptoStore* = ref object
|
||||
|
||||
type Auth* = ref object
|
||||
homeserverUrl: cstring
|
||||
|
||||
type Client* = ref object
|
||||
homeserverUrl*: cstring
|
||||
accessToken*: cstring
|
||||
cryptoStore*: ICryptoStorageProvider
|
||||
storage*: Storage
|
||||
syncingTimeout*: int
|
||||
userId*: cstring
|
||||
|
||||
type Content* = ref object
|
||||
body*, msgtype*: cstring
|
||||
|
|
Loading…
Reference in a new issue