@@ -13,17 +13,16 @@ import type ParseSession from './ParseSession';
1313import type { HookDeclaration , HookDeleteArg } from './ParseHooks' ;
1414import type ParseConfig from './ParseConfig' ;
1515import type LiveQueryClient from './LiveQueryClient' ;
16- import type ParseSchema from './ParseSchema' ;
1716import type ParseInstallation from './ParseInstallation' ;
1817
1918type AnalyticsController = {
2019 track : ( name : string , dimensions : { [ key : string ] : string } ) => Promise < any > ;
2120} ;
2221type CloudController = {
23- run : ( name : string , data : any , options : RequestOptions ) => Promise < any > ;
24- getJobsData : ( options : RequestOptions ) => Promise < any > ;
22+ run : ( name : string , data : any , options ? : RequestOptions ) => Promise < any > ;
23+ getJobsData : ( options ? : RequestOptions ) => Promise < any > ;
2524 /** Returns promise which resolves with JobStatusId of the job */
26- startJob : ( name : string , data : any , options : RequestOptions ) => Promise < string > ;
25+ startJob : ( name : string , data : any , options ? : RequestOptions ) => Promise < string > ;
2726} ;
2827type ConfigController = {
2928 current : ( ) => Promise < ParseConfig > | ParseConfig ;
@@ -56,15 +55,15 @@ type ObjectController = {
5655 fetch : (
5756 object : ParseObject | Array < ParseObject > ,
5857 forceFetch : boolean ,
59- options : RequestOptions
58+ options ? : RequestOptions
6059 ) => Promise < Array < ParseObject | undefined > | ParseObject | undefined > ;
6160 save : (
6261 object : ParseObject | Array < ParseObject | ParseFile > | null ,
63- options : RequestOptions
62+ options ? : RequestOptions
6463 ) => Promise < ParseObject | Array < ParseObject > | ParseFile | undefined > ;
6564 destroy : (
6665 object : ParseObject | Array < ParseObject > ,
67- options : RequestOptions
66+ options ? : RequestOptions
6867 ) => Promise < ParseObject | Array < ParseObject > > ;
6968} ;
7069type ObjectStateController = {
@@ -93,18 +92,52 @@ type QueryController = {
9392 find (
9493 className : string ,
9594 params : QueryJSON ,
96- options : RequestOptions
95+ options ? : RequestOptions
9796 ) : Promise < { results ?: Array < ParseObject > ; className ?: string ; count ?: number } > ;
9897 aggregate (
9998 className : string ,
10099 params : any ,
101- options : RequestOptions
100+ options ? : RequestOptions
102101 ) : Promise < { results ?: Array < any > } > ;
103102} ;
104- type EventuallyQueue = {
105- save : ( object : ParseObject , serverOptions : SaveOptions ) => Promise < any > ;
106- destroy : ( object : ParseObject , serverOptions : RequestOptions ) => Promise < any > ;
107- poll : ( ms ?: number ) => void ;
103+ export type QueueObject = {
104+ queueId : string ;
105+ action : string ;
106+ object : ParseObject ;
107+ serverOptions : SaveOptions | RequestOptions ;
108+ id : string ;
109+ className : string ;
110+ hash : string ;
111+ createdAt : Date ;
112+ } ;
113+ export type Queue = Array < QueueObject > ;
114+ export type EventuallyQueue = {
115+ save : ( object : ParseObject , serverOptions ?: SaveOptions ) => Promise < void > ;
116+ destroy : ( object : ParseObject , serverOptions ?: RequestOptions ) => Promise < void > ;
117+ generateQueueId : ( action : string , object : ParseObject ) => string ;
118+ enqueue (
119+ action : string ,
120+ object : ParseObject ,
121+ serverOptions ?: SaveOptions | RequestOptions
122+ ) : Promise < void > ;
123+ store ( data : Queue ) : Promise < void > ;
124+ load ( ) : Promise < string | null > ;
125+ getQueue ( ) : Promise < Queue > ;
126+ setQueue ( queue : Queue ) : Promise < void > ;
127+ remove ( queueId : string ) : Promise < void > ;
128+ clear ( ) : Promise < void > ;
129+ queueItemExists ( queue : Queue , queueId : string ) : number ;
130+ length ( ) : Promise < number > ;
131+ sendQueue ( ) : Promise < boolean > ;
132+ sendQueueCallback ( object : ParseObject , queueObject : QueueObject ) : Promise < void > ;
133+ poll ( ms ?: number ) : void ;
134+ stopPoll ( ) : void ;
135+ isPolling ( ) : boolean ;
136+ process : {
137+ create ( ObjectType : any , queueObject : any ) : Promise < void > ;
138+ byId ( ObjectType : any , queueObject : any ) : Promise < void > ;
139+ byHash ( ObjectType : any , queueObject : any ) : Promise < void > ;
140+ } ;
108141} ;
109142type RESTController = {
110143 request : ( method : string , path : string , data ?: any , options ?: RequestOptions ) => Promise < any > ;
@@ -119,14 +152,14 @@ type RESTController = {
119152} ;
120153type SchemaController = {
121154 purge : ( className : string ) => Promise < any > ;
122- get : ( className : string , options ?: RequestOptions ) => Promise < { results : ParseSchema [ ] } > ;
155+ get : ( className : string , options ?: RequestOptions ) => Promise < any > ;
123156 delete : ( className : string , options ?: RequestOptions ) => Promise < void > ;
124157 create : ( className : string , params : any , options ?: RequestOptions ) => Promise < any > ;
125158 update : ( className : string , params : any , options ?: RequestOptions ) => Promise < any > ;
126- send ( className : string , method : string , params : any , options : RequestOptions ) : Promise < any > ;
159+ send ( className : string , method : string , params : any , options ? : RequestOptions ) : Promise < any > ;
127160} ;
128161type SessionController = {
129- getSession : ( token : RequestOptions ) => Promise < ParseSession > ;
162+ getSession : ( options ? : RequestOptions ) => Promise < ParseSession > ;
130163} ;
131164type StorageController =
132165 | {
@@ -166,24 +199,24 @@ type UserController = {
166199 setCurrentUser : ( user : ParseUser ) => Promise < void > ;
167200 currentUser : ( ) => ParseUser | null ;
168201 currentUserAsync : ( ) => Promise < ParseUser | null > ;
169- signUp : ( user : ParseUser , attrs : AttributeMap , options : RequestOptions ) => Promise < ParseUser > ;
170- logIn : ( user : ParseUser , options : RequestOptions ) => Promise < ParseUser > ;
202+ signUp : ( user : ParseUser , attrs : AttributeMap , options ? : RequestOptions ) => Promise < ParseUser > ;
203+ logIn : ( user : ParseUser , options ? : RequestOptions ) => Promise < ParseUser > ;
171204 loginAs : ( user : ParseUser , userId : string ) => Promise < ParseUser > ;
172- become : ( user : ParseUser , options : RequestOptions ) => Promise < ParseUser > ;
205+ become : ( user : ParseUser , options ? : RequestOptions ) => Promise < ParseUser > ;
173206 hydrate : ( user : ParseUser , userJSON : AttributeMap ) => Promise < ParseUser > ;
174- logOut : ( options : RequestOptions ) => Promise < void > ;
175- me : ( user : ParseUser , options : RequestOptions ) => Promise < ParseUser > ;
176- requestPasswordReset : ( email : string , options : RequestOptions ) => Promise < void > ;
207+ logOut : ( options ? : RequestOptions ) => Promise < void > ;
208+ me : ( user : ParseUser , options ? : RequestOptions ) => Promise < ParseUser > ;
209+ requestPasswordReset : ( email : string , options ? : RequestOptions ) => Promise < void > ;
177210 updateUserOnDisk : ( user : ParseUser ) => Promise < ParseUser > ;
178- upgradeToRevocableSession : ( user : ParseUser , options : RequestOptions ) => Promise < void > ;
211+ upgradeToRevocableSession : ( user : ParseUser , options ? : RequestOptions ) => Promise < void > ;
179212 linkWith : ( user : ParseUser , authData : AuthData , options ?: FullOptions ) => Promise < ParseUser > ;
180213 removeUserFromDisk : ( ) => Promise < ParseUser | void > ;
181214 verifyPassword : (
182215 username : string ,
183216 password : string ,
184- options : RequestOptions
217+ options ? : RequestOptions
185218 ) => Promise < ParseUser > ;
186- requestEmailVerification : ( email : string , options : RequestOptions ) => Promise < void > ;
219+ requestEmailVerification : ( email : string , options ? : RequestOptions ) => Promise < void > ;
187220} ;
188221type HooksController = {
189222 get : ( type : string , functionName ?: string , triggerName ?: string ) => Promise < any > ;
0 commit comments