@@ -81,20 +81,20 @@ describe('remoting - integration', function() {
8181 var methods = getFormattedMethodsExcludingRelations ( storeClass . methods ) ;
8282
8383 var expectedMethods = [
84- 'create(data:object):store POST /stores' ,
85- 'patchOrCreate(data:object):store PATCH /stores' ,
86- 'replaceOrCreate(data:object):store PUT /stores' ,
87- 'replaceOrCreate(data:object):store POST /stores/replaceOrCreate' ,
84+ 'create(data:object:store ):store POST /stores' ,
85+ 'patchOrCreate(data:object:store ):store PATCH /stores' ,
86+ 'replaceOrCreate(data:object:store ):store PUT /stores' ,
87+ 'replaceOrCreate(data:object:store ):store POST /stores/replaceOrCreate' ,
8888 'exists(id:any):boolean GET /stores/:id/exists' ,
8989 'findById(id:any,filter:object):store GET /stores/:id' ,
90- 'replaceById(id:any,data:object):store PUT /stores/:id' ,
91- 'replaceById(id:any,data:object):store POST /stores/:id/replace' ,
90+ 'replaceById(id:any,data:object:store ):store PUT /stores/:id' ,
91+ 'replaceById(id:any,data:object:store ):store POST /stores/:id/replace' ,
9292 'find(filter:object):store GET /stores' ,
9393 'findOne(filter:object):store GET /stores/findOne' ,
94- 'updateAll(where:object,data:object):object POST /stores/update' ,
94+ 'updateAll(where:object,data:object:store ):object POST /stores/update' ,
9595 'deleteById(id:any):object DELETE /stores/:id' ,
9696 'count(where:object):number GET /stores/count' ,
97- 'prototype.patchAttributes(data:object):store PATCH /stores/:id' ,
97+ 'prototype.patchAttributes(data:object:store ):store PATCH /stores/:id' ,
9898 'createChangeStream(options:object):ReadableStream POST /stores/change-stream' ,
9999 ] ;
100100
@@ -109,7 +109,7 @@ describe('remoting - integration', function() {
109109
110110 var expectedMethods = [
111111 '__get__superStores(filter:object):store GET /stores/superStores' ,
112- '__create__superStores(data:store):store POST /stores/superStores' ,
112+ '__create__superStores(data:object: store):store POST /stores/superStores' ,
113113 '__delete__superStores() DELETE /stores/superStores' ,
114114 '__count__superStores(where:object):number GET /stores/superStores/count' ,
115115 ] ;
@@ -139,11 +139,11 @@ describe('remoting - integration', function() {
139139 'GET /stores/:id/widgets/:fk' ,
140140 'prototype.__destroyById__widgets(fk:any) ' +
141141 'DELETE /stores/:id/widgets/:fk' ,
142- 'prototype.__updateById__widgets(fk:any,data:widget):widget ' +
142+ 'prototype.__updateById__widgets(fk:any,data:object: widget):widget ' +
143143 'PUT /stores/:id/widgets/:fk' ,
144144 'prototype.__get__widgets(filter:object):widget ' +
145145 'GET /stores/:id/widgets' ,
146- 'prototype.__create__widgets(data:widget):widget ' +
146+ 'prototype.__create__widgets(data:object: widget):widget ' +
147147 'POST /stores/:id/widgets' ,
148148 'prototype.__delete__widgets() ' +
149149 'DELETE /stores/:id/widgets' ,
@@ -163,17 +163,17 @@ describe('remoting - integration', function() {
163163 'GET /physicians/:id/patients/:fk' ,
164164 'prototype.__destroyById__patients(fk:any) ' +
165165 'DELETE /physicians/:id/patients/:fk' ,
166- 'prototype.__updateById__patients(fk:any,data:patient):patient ' +
166+ 'prototype.__updateById__patients(fk:any,data:object: patient):patient ' +
167167 'PUT /physicians/:id/patients/:fk' ,
168- 'prototype.__link__patients(fk:any,data:appointment):appointment ' +
168+ 'prototype.__link__patients(fk:any,data:object: appointment):appointment ' +
169169 'PUT /physicians/:id/patients/rel/:fk' ,
170170 'prototype.__unlink__patients(fk:any) ' +
171171 'DELETE /physicians/:id/patients/rel/:fk' ,
172172 'prototype.__exists__patients(fk:any):boolean ' +
173173 'HEAD /physicians/:id/patients/rel/:fk' ,
174174 'prototype.__get__patients(filter:object):patient ' +
175175 'GET /physicians/:id/patients' ,
176- 'prototype.__create__patients(data:patient):patient ' +
176+ 'prototype.__create__patients(data:object: patient):patient ' +
177177 'POST /physicians/:id/patients' ,
178178 'prototype.__delete__patients() ' +
179179 'DELETE /physicians/:id/patients' ,
@@ -188,7 +188,7 @@ describe('remoting - integration', function() {
188188 var storeClass = findClass ( 'store' ) ;
189189 var methods = getFormattedMethodsExcludingRelations ( storeClass . methods ) ;
190190 var expectedMethods = [
191- 'upsertWithWhere(where:object,data:object):store POST /stores/upsertWithWhere' ,
191+ 'upsertWithWhere(where:object,data:object:store ):store POST /stores/upsertWithWhere' ,
192192 ] ;
193193 expect ( methods ) . to . include . members ( expectedMethods ) ;
194194 } ) ;
@@ -207,22 +207,22 @@ describe('With model.settings.replaceOnPUT false', function() {
207207 var methods = getFormattedMethodsExcludingRelations ( storeClass . methods ) ;
208208
209209 var expectedMethods = [
210- 'create(data:object):storeWithReplaceOnPUTfalse POST /stores-updating' ,
211- 'patchOrCreate(data:object):storeWithReplaceOnPUTfalse PUT /stores-updating' ,
212- 'patchOrCreate(data:object):storeWithReplaceOnPUTfalse PATCH /stores-updating' ,
213- 'replaceOrCreate(data:object):storeWithReplaceOnPUTfalse POST /stores-updating/replaceOrCreate' ,
214- 'upsertWithWhere(where:object,data:object):storeWithReplaceOnPUTfalse POST /stores-updating/upsertWithWhere' ,
210+ 'create(data:object:storeWithReplaceOnPUTfalse ):storeWithReplaceOnPUTfalse POST /stores-updating' ,
211+ 'patchOrCreate(data:object:storeWithReplaceOnPUTfalse ):storeWithReplaceOnPUTfalse PUT /stores-updating' ,
212+ 'patchOrCreate(data:object:storeWithReplaceOnPUTfalse ):storeWithReplaceOnPUTfalse PATCH /stores-updating' ,
213+ 'replaceOrCreate(data:object:storeWithReplaceOnPUTfalse ):storeWithReplaceOnPUTfalse POST /stores-updating/replaceOrCreate' ,
214+ 'upsertWithWhere(where:object,data:object:storeWithReplaceOnPUTfalse ):storeWithReplaceOnPUTfalse POST /stores-updating/upsertWithWhere' ,
215215 'exists(id:any):boolean GET /stores-updating/:id/exists' ,
216216 'exists(id:any):boolean HEAD /stores-updating/:id' ,
217217 'findById(id:any,filter:object):storeWithReplaceOnPUTfalse GET /stores-updating/:id' ,
218- 'replaceById(id:any,data:object):storeWithReplaceOnPUTfalse POST /stores-updating/:id/replace' ,
218+ 'replaceById(id:any,data:object:storeWithReplaceOnPUTfalse ):storeWithReplaceOnPUTfalse POST /stores-updating/:id/replace' ,
219219 'find(filter:object):storeWithReplaceOnPUTfalse GET /stores-updating' ,
220220 'findOne(filter:object):storeWithReplaceOnPUTfalse GET /stores-updating/findOne' ,
221- 'updateAll(where:object,data:object):object POST /stores-updating/update' ,
221+ 'updateAll(where:object,data:object:storeWithReplaceOnPUTfalse ):object POST /stores-updating/update' ,
222222 'deleteById(id:any):object DELETE /stores-updating/:id' ,
223223 'count(where:object):number GET /stores-updating/count' ,
224- 'prototype.patchAttributes(data:object):storeWithReplaceOnPUTfalse PUT /stores-updating/:id' ,
225- 'prototype.patchAttributes(data:object):storeWithReplaceOnPUTfalse PATCH /stores-updating/:id' ,
224+ 'prototype.patchAttributes(data:object:storeWithReplaceOnPUTfalse ):storeWithReplaceOnPUTfalse PUT /stores-updating/:id' ,
225+ 'prototype.patchAttributes(data:object:storeWithReplaceOnPUTfalse ):storeWithReplaceOnPUTfalse PATCH /stores-updating/:id' ,
226226 'createChangeStream(options:object):ReadableStream POST /stores-updating/change-stream' ,
227227 'createChangeStream(options:object):ReadableStream GET /stores-updating/change-stream' ,
228228 ] ;
@@ -244,12 +244,12 @@ describe('With model.settings.replaceOnPUT true', function() {
244244 var methods = getFormattedMethodsExcludingRelations ( storeClass . methods ) ;
245245
246246 var expectedMethods = [
247- 'patchOrCreate(data:object):storeWithReplaceOnPUTtrue PATCH /stores-replacing' ,
248- 'replaceOrCreate(data:object):storeWithReplaceOnPUTtrue POST /stores-replacing/replaceOrCreate' ,
249- 'replaceOrCreate(data:object):storeWithReplaceOnPUTtrue PUT /stores-replacing' ,
250- 'replaceById(id:any,data:object):storeWithReplaceOnPUTtrue POST /stores-replacing/:id/replace' ,
251- 'replaceById(id:any,data:object):storeWithReplaceOnPUTtrue PUT /stores-replacing/:id' ,
252- 'prototype.patchAttributes(data:object):storeWithReplaceOnPUTtrue PATCH /stores-replacing/:id' ,
247+ 'patchOrCreate(data:object:storeWithReplaceOnPUTtrue ):storeWithReplaceOnPUTtrue PATCH /stores-replacing' ,
248+ 'replaceOrCreate(data:object:storeWithReplaceOnPUTtrue ):storeWithReplaceOnPUTtrue POST /stores-replacing/replaceOrCreate' ,
249+ 'replaceOrCreate(data:object:storeWithReplaceOnPUTtrue ):storeWithReplaceOnPUTtrue PUT /stores-replacing' ,
250+ 'replaceById(id:any,data:object:storeWithReplaceOnPUTtrue ):storeWithReplaceOnPUTtrue POST /stores-replacing/:id/replace' ,
251+ 'replaceById(id:any,data:object:storeWithReplaceOnPUTtrue ):storeWithReplaceOnPUTtrue PUT /stores-replacing/:id' ,
252+ 'prototype.patchAttributes(data:object:storeWithReplaceOnPUTtrue ):storeWithReplaceOnPUTtrue PATCH /stores-replacing/:id' ,
253253 ] ;
254254
255255 expect ( methods ) . to . include . members ( expectedMethods ) ;
@@ -273,7 +273,7 @@ function formatMethod(m) {
273273 m . name ,
274274 '(' ,
275275 m . accepts . map ( function ( a ) {
276- return a . arg + ':' + a . type ;
276+ return a . arg + ':' + a . type + ( a . model ? ':' + a . model : '' ) ;
277277 } ) . join ( ',' ) ,
278278 ')' ,
279279 formatReturns ( m ) ,
0 commit comments