@@ -19,10 +19,10 @@ type AnalyticsController = {
19
19
track : ( name : string , dimensions : { [ key : string ] : string } ) => Promise < any > ;
20
20
} ;
21
21
type CloudController = {
22
- run : ( name : string , data : any , options : RequestOptions ) => Promise < any > ;
23
- getJobsData : ( options : RequestOptions ) => Promise < any > ;
22
+ run : ( name : string , data : any , options ? : RequestOptions ) => Promise < any > ;
23
+ getJobsData : ( options ? : RequestOptions ) => Promise < any > ;
24
24
/** Returns promise which resolves with JobStatusId of the job */
25
- startJob : ( name : string , data : any , options : RequestOptions ) => Promise < string > ;
25
+ startJob : ( name : string , data : any , options ? : RequestOptions ) => Promise < string > ;
26
26
} ;
27
27
type ConfigController = {
28
28
current : ( ) => Promise < ParseConfig > | ParseConfig ;
@@ -55,15 +55,15 @@ type ObjectController = {
55
55
fetch : (
56
56
object : ParseObject | Array < ParseObject > ,
57
57
forceFetch : boolean ,
58
- options : RequestOptions
58
+ options ? : RequestOptions
59
59
) => Promise < Array < ParseObject | undefined > | ParseObject | undefined > ;
60
60
save : (
61
61
object : ParseObject | Array < ParseObject | ParseFile > | null ,
62
- options : RequestOptions
62
+ options ? : RequestOptions
63
63
) => Promise < ParseObject | Array < ParseObject > | ParseFile | undefined > ;
64
64
destroy : (
65
65
object : ParseObject | Array < ParseObject > ,
66
- options : RequestOptions
66
+ options ? : RequestOptions
67
67
) => Promise < ParseObject | Array < ParseObject > > ;
68
68
} ;
69
69
type ObjectStateController = {
@@ -92,18 +92,52 @@ type QueryController = {
92
92
find (
93
93
className : string ,
94
94
params : QueryJSON ,
95
- options : RequestOptions
95
+ options ? : RequestOptions
96
96
) : Promise < { results ?: Array < ParseObject > ; className ?: string ; count ?: number } > ;
97
97
aggregate (
98
98
className : string ,
99
99
params : any ,
100
- options : RequestOptions
100
+ options ? : RequestOptions
101
101
) : Promise < { results ?: Array < any > } > ;
102
102
} ;
103
- type EventuallyQueue = {
104
- save : ( object : ParseObject , serverOptions : SaveOptions ) => Promise < any > ;
105
- destroy : ( object : ParseObject , serverOptions : RequestOptions ) => Promise < any > ;
106
- 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
+ } ;
107
141
} ;
108
142
type RESTController = {
109
143
request : ( method : string , path : string , data ?: any , options ?: RequestOptions ) => Promise < any > ;
@@ -122,10 +156,10 @@ type SchemaController = {
122
156
delete : ( className : string , options ?: RequestOptions ) => Promise < void > ;
123
157
create : ( className : string , params : any , options ?: RequestOptions ) => Promise < any > ;
124
158
update : ( className : string , params : any , options ?: RequestOptions ) => Promise < any > ;
125
- send ( className : string , method : string , params : any , options : RequestOptions ) : Promise < any > ;
159
+ send ( className : string , method : string , params : any , options ? : RequestOptions ) : Promise < any > ;
126
160
} ;
127
161
type SessionController = {
128
- getSession : ( token : RequestOptions ) => Promise < ParseSession > ;
162
+ getSession : ( options ? : RequestOptions ) => Promise < ParseSession > ;
129
163
} ;
130
164
type StorageController =
131
165
| {
@@ -165,24 +199,24 @@ type UserController = {
165
199
setCurrentUser : ( user : ParseUser ) => Promise < void > ;
166
200
currentUser : ( ) => ParseUser | null ;
167
201
currentUserAsync : ( ) => Promise < ParseUser | null > ;
168
- signUp : ( user : ParseUser , attrs : AttributeMap , options : RequestOptions ) => Promise < ParseUser > ;
169
- 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 > ;
170
204
loginAs : ( user : ParseUser , userId : string ) => Promise < ParseUser > ;
171
- become : ( user : ParseUser , options : RequestOptions ) => Promise < ParseUser > ;
205
+ become : ( user : ParseUser , options ? : RequestOptions ) => Promise < ParseUser > ;
172
206
hydrate : ( user : ParseUser , userJSON : AttributeMap ) => Promise < ParseUser > ;
173
- logOut : ( options : RequestOptions ) => Promise < void > ;
174
- me : ( user : ParseUser , options : RequestOptions ) => Promise < ParseUser > ;
175
- 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 > ;
176
210
updateUserOnDisk : ( user : ParseUser ) => Promise < ParseUser > ;
177
- upgradeToRevocableSession : ( user : ParseUser , options : RequestOptions ) => Promise < void > ;
211
+ upgradeToRevocableSession : ( user : ParseUser , options ? : RequestOptions ) => Promise < void > ;
178
212
linkWith : ( user : ParseUser , authData : AuthData , options ?: FullOptions ) => Promise < ParseUser > ;
179
213
removeUserFromDisk : ( ) => Promise < ParseUser | void > ;
180
214
verifyPassword : (
181
215
username : string ,
182
216
password : string ,
183
- options : RequestOptions
217
+ options ? : RequestOptions
184
218
) => Promise < ParseUser > ;
185
- requestEmailVerification : ( email : string , options : RequestOptions ) => Promise < void > ;
219
+ requestEmailVerification : ( email : string , options ? : RequestOptions ) => Promise < void > ;
186
220
} ;
187
221
type HooksController = {
188
222
get : ( type : string , functionName ?: string , triggerName ?: string ) => Promise < any > ;
0 commit comments