1. ######################################################################################################
2. #
3. # ███████╗██╗███╗ ███╗██████╗ ██╗ ███████╗███████╗████████╗ ██████╗ ██████╗ ███████╗
4. # ██╔════╝██║████╗ ████║██╔══██╗██║ ██╔════╝██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗██╔════╝
5. # ███████╗██║██╔████╔██║██████╔╝██║ █████╗ ███████╗ ██║ ██║ ██║██████╔╝█████╗
6. # ╚════██║██║██║╚██╔╝██║██╔═══╝ ██║ ██╔══╝ ╚════██║ ██║ ██║ ██║██╔══██╗██╔══╝
7. # ███████║██║██║ ╚═╝ ██║██║ ███████╗███████╗███████║ ██║ ╚██████╔╝██║ ██║███████╗
8. # ╚══════╝╚═╝╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
9. #
10. #######################################################################################################
11. #
12. # Welcome to simplestore BootCamp! All our APIs are 100% TEst case coverage. So Just go through the
13. # testcase which is just a documents for us.
14. #
15. # NOTE:
16. # (1) For testing local and remote db is same as local db
17. # This is not just a test case file. However, This fill will list all the feature which has supported.
18. # Any feature must be converged with test case which ensure we don't break while adding new feature.
19. # Here is the feature we support:
20. # create, find, regex, update, hits, rankup, rankdown, delete, count
21. #
22. # FEATURE LIST :
23. # (1) We are not supporting _cmd API
24. # (9) Started supporting _analytics which offer to track the app useas time and other important stuff.
25. # (10) Started supporting appconfig which offer to do easy A/B testing across the apps.
26. #######################################################################################################
27. #
28. # Do you know?
29. # (a) We support two two interesting was of scheduling: using schedule2 and schedule script.
30. #
31. #
32. #
33. #
34. #
35. #
36. #######################################################################################################
37.
38. # Set ENV
39. #=> context => server => localhost
40.
41. # Quick Test add here
42.
43.
44. # API Error case
45. => GET => http://{{server}}/api/test0/test => 404 - We have not yet support this api
46. => POST => http://{{server}}/api/test0/create/ => abc => Unexpected token a in JSON
47. => POST => http://{{server}}/api/test0/ => Hello => Unexpected token
48.
49. => GET => http://{{server}}/api/_test0/find => Invalid DB name
50. => POST => http://{{server}}/api/_test0/find => {} => Invalid DB name
51.
52. => GET => http://{{server}}/api/test0/ => Find successfully with
53. => POST => http://{{server}}/api/test0/ => {} => Find successfully wit
54.
55. #######################################################################################
56. # RULES for API Validation
57. # (a) Any params passes to the API using get of post like _abc will be treated as config.
58. # (b) The API internally can add abc_ fields which will be store in db but not exposed with API Resp.
59. #######################################################################################
60.
61. # Test Normalization like auto remove of abc_
62. => GET => http://{{server}}/api/test/delete?_confirmstr=test => success
63. => POST => http://localhost/api/test/insert=>{"name":"dip", "hidden_":"hidden"} => "name":"dip","ts_insert" # Hiden is not in resp hidden
64. => GET => http://{{server}}/api/test => "name":"dip","ts_insert"
65. # Test for object array
66. => POST => http://{{server}}/api/test/insert=>{"name":"dip2", "hidden_":"hidden"} => "name":"dip2","ts_insert" # Hiden is not in resp hidden
67. => GET => http://{{server}}/api/test => "name":"dip","ts_insert"
68. => GET => http://{{server}}/api/_test => access db with db name with
69.
70. #########################################################################################
71. ## ##
72. ## HOW TO ACCESS DOCS FILE ##
73. ## ##
74. #########################################################################################
75.
76. => GET => http://{{server}}/api/ => This is not just a test case file
77. => POST => http://{{server}}/api/ => {} => This is not just a test case file
78.
79. #########################################################################################
80. ## ##
81. ## APPLYING DB CONTSRINS ##
82. ## ##
83. #########################################################################################
84. => !GET => http://{{server}}/api/test/delete => missing _confirmstr
85. => !GET => http://{{server}}/api/test/delete?_confirmstr=delete => invalid _confirmstr
86. => !GET => http://{{server}}/api/test/delete?_confirmstr=test => Deleted count is
87. => GET => http://{{server}}/api/test/delete?_confirmstr=test => Deleted count is : 0
88. => !GET => http://{{server}}/api/test/constraints/clear => all constraints cleared successfully
89.
90. => !GET => http://{{server}}/api/test0/constraints/clear => all constraints cleared successfully
91. => !GET => http://{{server}}/api/test0/delete?_confirmstr=test0 => Deleted count is
92.
93.
94. => !GET => http://{{server}}/api/test1/delete?_confirmstr=test1 => Deleted count is
95. => !GET => http://{{server}}/api/test1/constraints/clear => all constraints cleared successfully
96. #### DB restriction ####
97. => GET => http://{{server}}/api/_test => db name with _
98. => POST => http://{{server}}/api/_test => {} => db name with _
99. => GET => http://{{server}}/api/_test/delete => db name with _
100.
101.
102. #########################################################################################
103. ## ##
104. ## DB INSERTIONS ##
105. ## ##
106. #########################################################################################
107.
108. ######### Test: insert one or many ############
109. => GET => http://{{server}}/api/test0/create =>Trying insert Empty Object
110. => GET => http://{{server}}/api/test0/create?name=dip1&roll=10 => "ts_insert":"202
111. => GET => http://{{server}}/api/test0/insert?name=dip1&roll=10 => "ts_insert":"202
112. => POST => http://{{server}}/api/test0/insert => {} => error
113. => POST => http://{{server}}/api/test0/create => {"name":"dip2","roll":10} => 1 entry\(s\) insert successfully.
114. => POST => http://{{server}}/api/test0/create => {"_payload":[{"name":"dip3","roll":10},{"name":"dip3","roll":10}]} => 2 entry\(s\) insert successfully.
115. => POST => http://{{server}}/api/test0/insert => {"_payload":[{"name":"dip3","roll":10},{"name":"dip3","roll":10}]} => 2 entry\(s\) insert successfully.
116.
117. ########## BULK Insert
118. => POST => http://{{server}}/api/test0/bulk_insert => {"_payload":[{"name":"dip3","roll":10},{"name":"dip3","roll":10}]} => [2/2]
119. => POST => http://{{server}}/api/test0/bulk_insert => {"_payload":[{"name":"dip3","roll":10},{"name":"dip3","roll":10,"_id":10}]} => we found id for some entry which is not allowed
120.
121.
122.
123.
124.
125. #########################################################################################
126. ## ##
127. ## DB QUERY ##
128. ## ##
129. #########################################################################################
130. # allows to search over the db.
131. # You can use get or find alternatively in GET or POST Request.
132. # You can use _filter for advance ops and even pass Mongo query inside _filter while makeing POST.
133.
134. => !GET => http://{{server}}/api/test0/delete?_confirmstr=test0 => Deleted count is
135. => !POST => http://{{server}}/api/test0/insert => {"_payload":[{"name":"dip1", "roll":10},{"name":"dip2", "roll":20},{"name":"dip3", "roll":30} ]} => 3 entry\(s\) insert successfully.
136. => !POST => http://{{server}}/api/test0/create => {"name":"dip","count":1} => "_id":"(?.*?)"
137. => GET => http://{{server}}/api/test0 => 4 items.
138. => GET => http://{{server}}/api/test0/ => 4 items.
139. => GET => http://{{server}}/api/test0/find => 4 items.
140. => GET => http://{{server}}/api/test0/find/ => 4 items.
141. => GET => http://{{server}}/api/test0/get => 4 items.
142. => GET => http://{{server}}/api/test0/get/ => 4 items.
143. => GET => http://{{server}}/api/test0/find?id={{id}} => Find successfully with 1 items
144. => GET => http://{{server}}/api/test0/get?id={{id}} => Find successfully with 1 items
145. => GET => http://{{server}}/api/test0/find?name=dip3 => 1 items
146. => GET => http://{{server}}/api/test0/find?name=dip1&roll=10 => 0 items
147. # you should you POST to make type senasitive serach.
148. => POST => http://{{server}}/api/test0/find => {"name":"dip3","roll":30} => 1 items.
149. #Test _filter
150. => GET => http://{{server}}/api/test0/find?_filter=name:dip3 => 1 items
151. => POST => http://{{server}}/api/test0/find => {"_filter":"name:dip3"} => 1 items
152. => POST => http://{{server}}/api/test0/find => {"_filter":{"name":"dip3"}} => 1 items
153. => POST => http://{{server}}/api/test0/find => {"_filter":{"name":{"$regex":"dip","$options":"i"}}} => 4 items
154. => GET => http://{{server}}/api/test0/ => 4 items
155. # FIX ME: GET => http://{{server}}/api/test0 => 4 items
156.
157.
158.
159. # ======= _page and _limit =================
160. # A SS way to support pagination.
161.
162. => !POST => http://{{server}}/api/test0/insert => {"_payload":[{"name":"dip20", "roll":10},{"name":"dip21", "roll":20},{"name":"dip22", "roll":30},{"name":"dip23", "roll":10},{"name":"dip24", "roll":20},{"name":"dip25", "roll":30},{"name":"dip26", "roll":10},{"name":"dip27", "roll":20},{"name":"dip28", "roll":30},{"name":"dip29", "roll":10},{"name":"dip30", "roll":20},{"name":"dip31", "roll":30} ]} => 12 entry
163. => GET => http://{{server}}/api/test0/find?_page=0 => 10 items
164. => GET => http://{{server}}/api/test0/find?_page=1 => 6 items
165. => GET => http://{{server}}/api/test0/find?_limit=2 => 2 items
166. => GET => http://{{server}}/api/test0/find?_page=0&_limit=2 => 2 items
167. => GET => http://{{server}}/api/test0/find?_page=1&_limit=2 => Find successfully with 2 items \(page:1, limit:2\)
168. => GET => http://{{server}}/api/test0/find?_page=200&_limit=2 => 0 items
169.
170. # _project helps to return only those ele in the find.
171. => GET => http://{{server}}/api/test0/find?_project=_id => ,{"_id":".*?"},
172. => GET => http://{{server}}/api/test0/find?_project=name => {"name":".*?"},{"name":".*?"},
173. => GET => http://{{server}}/api/test0/find?_project=_id,name => {"_id":".*?","name":".*?"},
174. => GET => http://{{server}}/api/test0/find?_project=_id,name,roll => {"_id":".*?","name":".*?","roll":.*?},{
175. => GET => http://{{server}}/api/test0/find?_project= => ts_insert
176. => GET => http://{{server}}/api/test0/find?_project=unknown => \[{},{},{},{}
177.
178. #==================== ~ with _filter ===================
179. # we use _filter to filter documents for insert/delete/find/update. we can use _filter in POST
180. # to support = operator which should be replaced by : for GET. You should use ~ for partial matching REGEX.
181.
182. => !GET => http://{{server}}/api/test0/delete?_confirmstr=test0 => Deleted count is
183. => !POST => http://{{server}}/api/test0/insert => {"_payload":[{"name":"dip1"},{"name":"dip2"},{"name":"supdi2"} ]} => 3 entry\(s\) insert successfully.
184. => GET => http://{{server}}/api/test0/find?_filter=name:dip1 => 1 items
185. => GET => http://{{server}}/api/test0/find?_filter=name~dip1 => 1 items
186. => GET => http://{{server}}/api/test0/find?_filter=name~p => 3 items
187. => GET => http://{{server}}/api/test0/find?_filter=name~^di => 2 items
188. => GET => http://{{server}}/api/test0/find?_filter=name~1$ => 1 items.
189.
190.
191.
192. #=================== regex =======================
193. # this a way to support regular expression search.
194.
195. => !GET => http://{{server}}/api/test0/delete?_confirmstr=test0 => Deleted count is
196. => !POST => http://{{server}}/api/test0/create?_confirmstr=test0 => {"_payload":[{"name":"dip1","roll":1}, {"name":"dip2","roll":2}, {"name":"xip2","roll":3}]} => success
197. => GET => http://{{server}}/api/test0/regex?name=^d => with 2 items.
198. => GET => http://{{server}}/api/test0/regex?name=1$ => with 1 items.
199.
200.
201. #================= @today, @week, @month ==============
202. => GET => http://{{server}}/api/test0?ts_insert=@today =>3 items
203. => GET => http://{{server}}/api/test0/count?ts_insert=@week => Count: 3
204. => GET => http://{{server}}/api/test0?ts_insert=@month =>3 items
205. => GET => http://{{server}}/api/test0?ts_update=@today =>3 items
206. => GET => http://{{server}}/api/test0?ts_update=@week => 3 items
207. => GET => http://{{server}}/api/test0/count?ts_update=@month =>Count: 3
208. => GET => http://{{server}}/api/test0/count?ts_update=@3DaysOld =>Count: 0
209. => GET => http://{{server}}/api/test0/count?ts_update=@7DaysOld =>Count: 0
210.
211. # ==== TEST get random ####
212. => GET => http://{{server}}/api/test0/get_random?_limit=3 => returned random list of size : 3
213. => GET => http://{{server}}/api/test0/get_random?_limit=3 => returned random list of size : 3
214.
215. #########################################################################################
216. ## ##
217. ## DB UPDATE ##
218. ## ##
219. #########################################################################################
220.
221. #============= create and update =================
222. # 1. Test We able update an specific entry
223. # 2. Test we update multiple entry by filter.
224. # 3. Test we update multiple entry with multiple specific data ( using _payload.)
225.
226. => !GET => http://{{server}}/api/test0/delete?_confirmstr=test0 => Deleted count is
227. => !POST => http://{{server}}/api/test0/create => {"name":"subha","roll":1} => success
228. => !POST => http://{{server}}/api/test0/create => {"name":"subha","roll":2} => success
229. # Simple create should be return list everywhere
230. => POST => http://{{server}}/api/test0/create => {"name":"hari","roll":3} => "out":\[{"name":"hari",
231. => GET => http://{{server}}/api/test0/update?id={{id}}&name=hari1 => "name":"hari1"
232. => GET => http://{{server}}/api/test0/update?id={{id}}&name=hari2 => "name":"hari2"
233. => GET => http://{{server}}/api/test0/update?roll=10&_filter=name:subha => missing _confirmstr
234. => GET => http://{{server}}/api/test0/update?_filter=name:subha&_confirmstr=test0 => Looks like you are sending empty data
235. => GET => http://{{server}}/api/test0/update?roll=10&_filter=name:subha&_confirmstr=test0 => Successfully updated 2 entry out of 2 matched cout
236. => POST => http://{{server}}/api/test0/update => {"roll":10,"_filter":{"name":"subha"},"_confirmstr":"test0"} => Successfully updated 2 entry out of 2 matched cout
237. => POST => http://{{server}}/api/test0/update => {"_payload":[{"name":"dip"}], "_confirmstr":"test0"} => each object in _payload must have a id
238.
239.
240. ########################## Subentry #################################################################
241. # This helps to building facebook post with comments
242. # adding subentry to a database entry: like adding a comments
243. # Whne you add a subentry , it will create a entry_id as a uniquer id whcih can be used to delete.
244. ######################################################################################################
245. => !GET => http://{{server}}/api/test1/delete?_confirmstr=test1 => Deleted count is
246. => !POST => http://{{server}}/api/test1/insert => {"name":"A1","comments":[]} => "_id":"(?.*?)"
247. => POST => http://{{server}}/api/test1/subentry/add? => {"id":"{{id1}}"} => Missing key
248. => POST => http://{{server}}/api/test1/subentry/add? => {"id":"{{id1}}","key":"comments"} => Missing value
249. => POST => http://{{server}}/api/test1/subentry/add? => {"id":"{{id1}}","key":"comments","value":10} => error
250. => POST => http://{{server}}/api/test1/subentry/add? => {"id":"{{id1}}","key":"comments","value":{"msg":"message1"}} => "msg":"message1"
251. => POST => http://{{server}}/api/test1/subentry/add? => {"_id":"601ddf283ac366b16c634000","key":"comments","value":{"msg":"message1"}} => not found this id
252. => POST => http://{{server}}/api/test1/subentry/add? => {"_id":"{{id1}}","key":"comments","value":{"msg":"message1"}} => "msg":"message1"
253. => POST => http://{{server}}/api/test1/subentry/add? => {"id":"{{id1}}","key":"comments","value":[{"msg":"message2"},{"msg":"message3"}]} => Input is not an object
254. => POST => http://{{server}}/api/test1/subentry/add_many => {"id":"{{id1}}","key":"comments","value":[{"msg":"message2"},{"msg":"message3"}]} => "msg":"message3"
255. => POST => http://{{server}}/api/test1 => {"id":"{{id1}}"} => "msg":"message3"
256. #Check add remove
257. => POST => http://{{server}}/api/test1/subentry/add? => {"id":"{{id1}}","key":"comments","value":{"msg":"message4"}} => "entry_id":"(?.*?)"
258. => POST => http://{{server}}/api/test1/subentry/remove => {"id":"{{id1}}", "key":"comments", "entry_id":"{{entry_id}}"} => success
259. => POST => http://{{server}}/api/test1/subentry/get => {"id":"{{id1}}"} => This feature not yet supported
260.
261. # test update
262. => !POST => http://{{server}}/api/test1/insert => {"name":"A2","comments":[]} => "_id":"(?.*?)"
263. => POST => http://{{server}}/api/test1/subentry/add? =>{"_id":"{{id1}}", "key":"comments", "value":{"msg":"hello","name":"hello"}} => "entry_id":"(?.*?)" => "name":"hello"
264. # This should merge
265. => POST => http://{{server}}/api/test1/subentry/update? =>{"_id":"{{id1}}","entry_id":"{{entry_id}}", "key":"comments", "value":{"msg":"hello1", "color":"red"}} => successfully update subentry with key
266. => POST => http://{{server}}/api/test1/ => {"_id":"{{id1}}"} => "name":"hello"
267. => POST => http://{{server}}/api/test1/ => {"_id":"{{id1}}"} => "color":"red"
268.
269. #Testing with auth_token_
270. => POST => http://{{server}}/api/test1/subentry/update? => {"_id":"{{id1}}","entry_id":"{{entry_id}}", "key":"comments", "value":{"msg":"hello1", "color":"red"}, "auth_token_":"skip"} => successfully update subentry with key
271.
272. => !GET => http://{{server}}/api/test1/delete?_confirmstr=test1 => Deleted count is
273.
274.
275.
276. ############# BULK UPDATE #############################
277. => !POST => http://{{server}}/api/test0/insert => {"name":"A1"} => "_id":"(?.*?)"
278. => !POST => http://{{server}}/api/test0/insert => {"name":"A2"} => "_id":"(?.*?)"
279. => POST => http://{{server}}/api/test0/bulkupdate => {"_payload":[]} => missing _confirmstr
280. => POST => http://{{server}}/api/test0/bulkupdate => {"_payload":[], "_confirmstr":"test0"} => ensureHasNonEmptyPayload
281. => POST => http://{{server}}/api/test0/bulkupdate => {"_payload":[{"name":"10"}], "_confirmstr":"test0"} => ensurePayloadHasId
282. => POST => http://{{server}}/api/test0/bulkupdate => {"_payload":[{"id":"{{id1}}", "name":"B1","tool":3}, {"id":"{{id2}}", "name":"B2"}], "_confirmstr":"test0"} => 2/2
283. => GET => http://{{server}}/api/test0?_id={{id1}} => B1
284.
285.
286. #===================== insertorupdate =============================
287. => !POST => http://{{server}}/api/test0/insertorupdate => {} => _field is missing
288. => !POST => http://{{server}}/api/test0/insertorupdate => {"_payload":[{"name":"dip","roll":1}, {"name":"dip2","roll":1}],"_field":"name"} => 2/0
289. => !POST => http://{{server}}/api/test0/insertorupdate => {"_payload":[{"name":"dip","roll":2}, {"name":"dip2","roll":2},{"name":"dip3","roll":3}],"_field":"name"} => 1/2
290.
291.
292. #########################################################################################
293. ## ##
294. ## DB DELETE ##
295. ## ##
296. #########################################################################################
297.
298. # delete allows to delete one or many items or all the items. to delete in bulk you need to
299. # provide _confirmstr as a db name. A db starting with nodel_ don't support any delete _operation by design.
300.
301. => GET => http://{{server}}/api/test0/delete => missing _confirmstr
302. => GET => http://{{server}}/api/test0/delete?_confirmstr=test0 => Deleted count is
303. => GET => http://{{server}}/api/nodel_test0/delete?_confirmstr=nodel_test0 => The DB has marked as nodel
304.
305. #########################################################################################
306. ## ##
307. ## DB RANK ##
308. ## ##
309. #########################################################################################
310.
311. # ranks and hits are the simplestore ways to ranking algorithms
312. # hits will help increment or decrements ranking.
313. # rankup - will rankup based on rank strategies
314. # rankdown - will rankdown based on rank strategies
315.
316. => !GET => http://{{server}}/api/test0/delete?_confirmstr=test0 => Deleted count is : 0
317. => !POST => http://{{server}}/api/test0/create => {"name":"dip","count":1} => "_id":"(?.*?)"
318. => GET => http://{{server}}/api/test0/find?id={{id}} => Find successfully with 1 items
319. => GET => http://{{server}}/api/test0/hits => You must pass a _id
320. => GET => http://{{server}}/api/test0/hits?_field=count => You must pass a _id
321. => GET => http://{{server}}/api/test0/hits?id={{id}}=> _field is missing
322. => GET => http://{{server}}/api/test0/hits?_field=count&id={{id}} => ","out":2,"help"
323. => GET => http://{{server}}/api/test0/hits?_field=count&id={{id}} => ","out":3,"help"
324. # Adjust the bellow test as they are right.
325. => GET => http://{{server}}/api/test0/hits?_field=count&id={{id}}&_value=8 => 11
326. => GET => http://{{server}}/api/test0/hits?_field=count&id={{id}}&_value=-1 => 10
327. => GET => http://{{server}}/api/test0/increment?_field=count&id={{id}}&_value=-1 => ","out":9,"help"
328. => GET => http://{{server}}/api/test0/increment/?_field=count&id={{id}}&_value=-1 => 8
329. => GET => http://{{server}}/api/test0/increment?_field=count&id=wrongID&_value=-1 => not a valid ID
330. => GET => http://{{server}}/api/test0/increment?_field=count&id=5df55c6273df4d3ec6cbcf15&_value=-1 => Item not found
331.
332.
333. => !GET => http://{{server}}/api/test0/create?name=dip1 => "_id":"(?.*?)"
334. => GET => http://{{server}}/api/test0/rankup => You must pass a _id
335. => GET => http://{{server}}/api/test0/rankup?id={{id}} => _field is missing
336. => GET => http://{{server}}/api/test0/rankup?_field=count => You must pass a _id
337. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => ","out":1,"help"
338. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => 2
339. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => 3
340. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => 4
341. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => 5
342. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => 6
343. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => 7
344. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => 8
345. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => 9
346. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => 10
347. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => 10
348. => GET => http://{{server}}/api/test0/rankdown?_field=count&id={{id}} => ","out":9,"help"
349. => GET => http://{{server}}/api/test0/rankdown?_field=count&id={{id}} => 8
350. => GET => http://{{server}}/api/test0/rankdown?_field=count&id={{id}} => 7
351. => GET => http://{{server}}/api/test0/rankdown?_field=count&id={{id}} => 6
352. => GET => http://{{server}}/api/test0/rankdown?_field=count&id={{id}} => 5
353. => GET => http://{{server}}/api/test0/rankdown?_field=count&id={{id}} => 4
354. => GET => http://{{server}}/api/test0/rankdown?_field=count&id={{id}} => 3
355. => GET => http://{{server}}/api/test0/rankdown?_field=count&id={{id}} => 2
356. => GET => http://{{server}}/api/test0/rankdown?_field=count&id={{id}} => 1
357. => GET => http://{{server}}/api/test0/rankdown?_field=count&id={{id}} => 0
358. => GET => http://{{server}}/api/test0/rankdown?_field=count&id={{id}} => 0
359. => GET => http://{{server}}/api/test0/rankup?_field=count&id={{id}} => 1
360.
361. #########################################################################################
362. ## ##
363. ## DB COUNT ##
364. ## ##
365. #########################################################################################
366.
367. # just count elements of find or filter.
368.
369. => !GET => http://{{server}}/api/test0/delete?_confirmstr=test0 => Deleted count is : 2
370. => !POST => http://{{server}}/api/test0/create?_confirmstr=test0 => {"_payload":[{"name":"dip","roll":1}, {"name":"dip","roll":2}, {"name":"sup","roll":3}]} => success
371. => GET => http://{{server}}/api/test0/count => 3
372. => GET => http://{{server}}/api/test0/count?name=dip => 2
373. => GET => http://{{server}}/api/test0/count?roll=3 => 0
374. => POST => http://{{server}}/api/test0/count => {"roll":3} => 1
375.
376. #########################################################################################
377. ## ##
378. ## DB AGGRESSION ##
379. ## ##
380. #########################################################################################
381.
382. # sum is the aggregation framework for simplestore. It allows to count, sum, max,min avg on
383. # a _field.
384.
385. => !GET => http://{{server}}/api/test0/delete?_confirmstr=test0 => Deleted count is
386. => !POST => http://{{server}}/api/test0/create?_confirmstr=test0 => {"_payload":[{ "name": "Infosys", "qty": 100, "price": 800 }, { "name": "TCS", "qty": 100, "price": 2000 },{ "name": "Wipro", "qty": 2500, "price": 300 }]} => success
387. => GET => http://{{server}}/api/test0/sum => _field is missing
388. => GET => http://{{server}}/api/test0/sum?_field=qty => 2700
389. => POST => http://{{server}}/api/test0/sum => {"_field" : "qty"} => 2700
390. => POST => http://{{server}}/api/test0/sum => {"_field" : "qty", "_operation":"$max"} => 2500
391. => POST => http://{{server}}/api/test0/sum => {"_field" : "qty", "_operation":"$min"} => 100
392. => POST => http://{{server}}/api/test0/sum => {"_field" : "qty", "_operation":"$avg"} => 900
393. => POST => http://{{server}}/api/test0/sum => {"_field":"qty", "_filter":{"qty":100}} => 200
394.
395. #########################################################################################
396. ## ##
397. ## DB CONSTRAINT ##
398. ## ##
399. #########################################################################################
400. # Constraints allows us to dynamically insert of delete the unique key for a db.
401. # we sound support other func like not null or datatype constraints.
402.
403. => !GET => http://{{server}}/api/test1/delete?_confirmstr=test1 => success
404. => GET => http://{{server}}/api/test1/constraints/get => all constraints returned successfully
405. => GET => http://{{server}}/api/test1/constraints/add?name=unique => all constraints added successfully
406. => GET => http://{{server}}/api/test1/constraints/get => name_1
407. => GET => http://{{server}}/api/test1/constraints/remove => all constraints removed successfully
408. => GET => http://{{server}}/api/test1/constraints/get => all constraints returned successfully
409. => GET => http://{{server}}/api/test1/constraints/add?name=unique => name_1
410. => GET => http://{{server}}/api/test1/constraints/add?name1=unique1 => invalid constraints found:
411. => GET => http://{{server}}/api/test1/constraints/clear => all constraints cleared successfully
412. => GET => http://{{server}}/api/test1/constraints/get => all constraints returned successfully
413.
414. => !GET => http://{{server}}/api/test1/constraints/clear => all constraints cleared successfully
415. => !GET => http://{{server}}/api/test1/constraints/add?name=unique => all constraints added successfully
416. => POST => http://{{server}}/api/test1/insert => {"name":"DIP"} => insert successfully
417. => POST => http://{{server}}/api/test1/insert => {"name":"DIP"} => duplicate key error collection
418. => POST => http://{{server}}/api/test1/insert => {"_payload":[{"name":"DIP"},{"name":"DIP1"}]} => E11000 duplicate key error collection
419. => GET => http://{{server}}/api/test1 => DIP1
420.
421. #============= BULK INSERT =====================
422. # Bulk insert allows you to insert a list of items to DB even if some items are not able insert. It's similar to insert
423. # but provides the count of success and fails.
424.
425. => POST => http://{{server}}/api/test1/bulk_insert => {"name":"DIP"} => you must send _payload as list
426. => POST => http://{{server}}/api/test1/bulk_insert => {"_payload":[{"name":"DIP"},{"name":"DIP1"}]} => 0/2
427. => POST => http://{{server}}/api/test1/bulk_insert => {"_payload":[{"name":"DIP"},{"name":"DIP3"}]} => 1/2
428.
429.
430. #########################################################################################
431. ## ##
432. ## DB TAGS ##
433. ## ##
434. #########################################################################################
435. # Tags allows us to adding, removing and searching tags attached to a documents. This is essentially
436. # a tagging mechanism to support hashtag or categories a documents. It's works like a set _operation.
437. # you need to use rwa_search to do the searching the tag.
438. => POST => http://{{server}}/api/test/tags/add => {"_id":"{{id}}", "_field":"tag"} => You have not send either _field or _value.
439. => POST => http://{{server}}/api/test/tags/add => {"_id":"{{id}}", "_value":"tag"} => You have not send either _field or _value.
440. => !POST => http://{{server}}/api/test/create => {"name":"dip","count":1} => "_id":"(?.*?)"
441. => GET => http://{{server}}/api/test/tags/clear?id=5daa8d3ea216e2d820e2c09e&_field=tag&_value=10,20 => item has not found
442. => GET => http://{{server}}/api/test/tags/clear?id={{id}}&_field=tag&_value=10,20 => "tag":\[\]
443. => GET => http://{{server}}/api/test/tags/add?id={{id}}&_field=tag&_value=10,20 => \["10","20"\]
444. => GET => http://{{server}}/api/test/tags/add?id={{id}}&_field=tag&_value=10,20 => \["10","20"\]
445. => GET => http://{{server}}/api/test/tags/add?id={{id}}&_field=tag&_value=10,20,30,40 => \["10","20","30","40"\]
446. => GET => http://{{server}}/api/test/tags/remove?id={{id}}&_field=tag&_value=10 => \["20","30","40"\]
447. => GET => http://{{server}}/api/test/tags/remove?id={{id}}&_field=tag&_value=10 => \["20","30","40"\]
448. => GET => http://{{server}}/api/test/tags/clear?id={{id}}&_field=tag&_value='' => "tag":\[\]
449.
450.
451. #########################################################################################
452. ## ##
453. ## DB INDEX ##
454. ## ##
455. #########################################################################################
456.
457. => POST => http://{{server}}/api/test/index => {} => you must send _payload as list
458. => POST => http://{{server}}/api/test/index => {"_payload":[]} => You must NOT send a empty list
459. # TODO: BROKEN TEST - FIX IT
460. # => POST => http://{{server}}/api/test/index => {"_payload":[{ "ts_insert": 1 }, { "expireAfterSeconds": 60 }]} => \{"ts_insert":1,"expireAfterSeconds":60\}
461.
462.
463.
464.
465.
466.
467. #==================== Help =================================
468. # TODO : BROKEN FIX IT -- BLOCKING TEST
469. #=> POST => http://{{server}}/api/test/index/help => {} => This API is used to create Index for a DB
470. #=> GET => http://{{server}}/api/test/index/help => This API is used to create Index for a DB
471.
472.
473.
474. #########################################################################################
475. ## ##
476. ## DB DISTRIBUTION ##
477. ## ##
478. #########################################################################################
479. => !POST => http://{{server}}/api/test/bulk_insert => {"_payload":[{"type":"a","roll":1},{"type":"a","roll":1},{"type":"a","roll":1},{"type":"b","roll":1},{"type":"b","roll":2},{"type":"c","roll":1},{"type":"d","roll":2},{"type":"d","roll":2}]} => 8/8
480. => POST => http://{{server}}/api/test/distribution => {"roll":1,"_field":"type"} => {"count":3,"type":"a"}
481. => POST => http://{{server}}/api/test/distribution?_output_type=chartjs => {"roll":1,"_field":"type"} => "borderWidth":1
482. => POST => http://{{server}}/api/test/distribution => {"roll":1,"ts_insert":"@today", "_field":"type"} => {"count":3,"type":"a"}
483. => POST => http://{{server}}/api/test/distribution => {"roll":2,"_field":"type"} => {"count":2,"type":"d"}
484.
485.
486.
487. #########################################################################################
488. ## ##
489. ## DB TIME SERIES ##
490. ## ##
491. #########################################################################################
492. => !POST => http://{{server}}/api/test/create => {"_payload":[{"name":"dipp","number":10}, {"name":"dipp","number":20}, {"name":"dipp1","number":20}]} => success
493. => GET => http://{{server}}/api/test/ts => "count":12
494. => GET => http://{{server}}/api/test/ts?name=dipp&_field=dummy => "count":2,
495.
496.
497. #########################################################################################
498. ## ##
499. ## APP ANALYTICS ##
500. ## ##
501. #########################################################################################
502. # Note it is causing the perf issue for we black listed the analytics API
503. # _analytics will provides Analytics in the app.
504. #=> context => app_id => test.app
505. #=> !GET => http://{{server}}/api/analytics/delete?app_id={{app_id}}&_confirmstr=analytics => success
506. #=> POST => http://{{server}}/api/_analytics/launch => {"app_id":"{{app_id}}","app_version":"1.0","device_os":"android", "device_id":"abc","device_api":"27"} => "session":"(?.*?)"
507. #=> POST => http://{{server}}/api/_analytics/action => {"app_id":"{{app_id}}","session":"{{session}}","type":"click", "target_id":"btn1"} => Tracked action
508. #=> POST => http://{{server}}/api/_analytics/exception => {"app_id":"{{app_id}}", "session":"{{session}}","type":"RuntimeException", "location":"Main.c:20","stack":"full stack here"} => Tracked exception
509. #=> POST => http://{{server}}/api/_analytics/timeit => {"app_id":"{{app_id}}", "session":"{{session}}", "total_time": 10000, "type" :"Activity", "block":"MainActivity"} => Tracked timeit
510. #=> GET => http://{{server}}/api/_analytics/hit_tracker?app_id={{app_id}}&action=play => 1
511. #=> GET => http://{{server}}/api/_analytics/hit_tracker?app_id={{app_id}}&action=play => 2
512. #=> GET => http://{{server}}/api/_analytics/hit_tracker?app_id={{app_id}}&action=play => 3
513. #=> GET => http://{{server}}/api/_analytics/hit_tracker?app_id={{app_id}}&action=pause => 1
514. #=> GET => http://{{server}}/api/_analytics/hit_tracker?app_id={{app_id}}&action=pause => 2
515. #=> POST => http://{{server}}/api/_analytics/logs => {"app_id":"{{app_id}}"} => found all logs
516. #=> POST => http://{{server}}/api/_analytics/logs => {"app_id":"Invalid"} => "out":\[\],
517. #=> POST => http://{{server}}/api/_analytics/session_history => {"session":"{{session}}"} => History returned
518. #=> GET => http://{{server}}/api/_analytics/session_history?session={{session}} => History returned
519. #=> POST => http://{{server}}/api/_analytics/app_summary_today => {"app_id":"{{app_id}}"} => not yet supported
520. #=> POST => http://{{server}}/api/_analytics/app_summary_week => {"app_id":"{{app_id}}"} => not yet supported
521. #
522. #
523. #=> context => app_id => test.app
524. #=> !GET => http://{{server}}/api/analytics/delete?app_id={{app_id}}&_confirmstr=analytics => success
525. #=> POST => http://{{server}}/api/analytics/launch => {"app_id":"{{app_id}}","app_version":"1.0","device_os":"android", "device_id":"abc","device_api":"27"} => "session":"(?.*?)"
526. #=> POST => http://{{server}}/api/analytics/action => {"app_id":"{{app_id}}","session":"{{session}}","type":"click", "target_id":"btn1","tag":"btn_click"} => Tracked action
527. #=> POST => http://{{server}}/api/analytics/action => {"app_id":"{{app_id}}","session":"{{session}}","type":"click", "target_id":"btn1", "tag":"btn_click"} => Tracked action
528. #=> POST => http://{{server}}/api/analytics/exception => {"app_id":"{{app_id}}", "session":"{{session}}","type":"RuntimeException", "location":"Main.c:20","stack":"full stack here"} => Tracked exception
529. #=> POST => http://{{server}}/api/analytics/exception => {"app_id":"{{app_id}}", "session":"{{session}}","type":"RuntimeException", "location":"Main.c:20","stack":"full stack here"} => Tracked exception
530. #=> POST => http://{{server}}/api/analytics/timeit => {"app_id":"{{app_id}}", "session":"{{session}}", "total_time": 10000, "type" :"Activity", "block":"MainActivity"} => Tracked timeit
531. #=> GET => http://{{server}}/api/analytics/hit_tracker?app_id={{app_id}}&action=play => 1
532. #=> GET => http://{{server}}/api/analytics/hit_tracker?app_id={{app_id}}&action=play => 2
533. #=> GET => http://{{server}}/api/analytics/hit_tracker?app_id={{app_id}}&action=play => 3
534. #=> GET => http://{{server}}/api/analytics/hit_tracker?app_id={{app_id}}&action=pause => 1
535. #=> GET => http://{{server}}/api/analytics/hit_tracker?app_id={{app_id}}&action=pause => 2
536. #=> POST => http://{{server}}/api/analytics/logs => {"app_id":"{{app_id}}"} => found all logs
537. #=> POST => http://{{server}}/api/analytics/logs => {"app_id":"Invalid"} => "out":\[\],
538. #=> POST => http://{{server}}/api/analytics/session_history => {"session":"{{session}}"} => History returned
539. #=> GET => http://{{server}}/api/analytics/session_history?session={{session}} => History returned
540. #=> POST => http://{{server}}/api/analytics/app_summary_today => {"app_id":"{{app_id}}"} => We have not yet support this api
541. #=> POST => http://{{server}}/api/analytics/app_summary_week => {"app_id":"{{app_id}}"} => We have not yet support this api
542. #=> GET => http://{{server}}/api/analytics/show => Please select a app id:
543. #=> GET => http://{{server}}/api/analytics/show?app_id={{app_id}} => Main.c:20
544.
545. #########################################################################################
546. ## ##
547. ## APP APPCONFIG ##
548. ## ##
549. #########################################################################################
550. ## appconfig allows you gate your feature and do A/B testing.
551. ## TODO: This test is broken, we need to fix it.
552. #=> context => app_id => test.app
553. #=> POST => http://{{server}}/api/appconfig/fetch => {} => Input validation failed: Missing app_id
554. #=> POST => http://{{server}}/api/appconfig/clear => {"app_id":"{{app_id}}"} => AppConfig config has deleted
555. #=> POST => http://{{server}}/api/appconfig/fetch => {"app_id":"{{app_id}}"} => Error: AppConfig not found for this app id
556. #=> POST => http://{{server}}/api/appconfig/set => {"app_id":"{{app_id}}","test1":false} => "gk_list":{"test1":{"type":"raw","key":"test1","value":false}}}
557. #=> POST => http://{{server}}/api/appconfig/set => {"app_id":"{{app_id}}","test2":"something"} => "test2":{"type":"raw","key":"test2","value":"something"
558. ## Enable feature 60%
559. #=> POST => http://{{server}}/api/appconfig/ab => {"app_id":"{{app_id}}","test3":60} => "test3":{"type":"ab","key":"test3","value":60}}}
560. #=> POST => http://{{server}}/api/appconfig/fetch => {"app_id":"{{app_id}}"} => "force_id":"(?.*?)"
561. #=> POST => http://{{server}}/api/appconfig/fetch => {"app_id":"{{app_id}}"} => force_id
562. #=> POST => http://{{server}}/api/appconfig/force => {"app_id":"{{app_id}}"} => "force_id":"(?.*?)"
563. #=> POST => http://{{server}}/api/appconfig/fetch => {"app_id":"{{app_id}}"} => force_id
564. #=> POST => http://{{server}}/api/appconfig/set => {"app_id":"in.peerreview.khabar","min_version":28} =>success
565. #=> POST => http://{{server}}/api/appconfig/fetch => {} => 28
566.
567.
568. # ======= exist API ===================
569. => !POST => http://{{server}}/api/test/create?_confirmstr=test0 => {"_payload":[{"name":"dip","roll":1}, {"name":"dip1","roll":2}]} => success
570. => POST => http://{{server}}/api/test/exist => {} => You have not send either _field or _value
571. => POST => http://{{server}}/api/test/exist => {"_field":"name"} => You have not send either _field or _value
572. => POST => http://{{server}}/api/test/exist => {"_field":"name","_value":""} => You have not send either _field or _value.
573. => POST => http://{{server}}/api/test/exist => {"_field":"name","_value":",,,"} => You must NOT send a not empty _value as a list or equivalent comma separated string
574. => POST => http://{{server}}/api/test/exist => {"_field":"name","_value":"dip"} => Found 1 out of 1.
575. => POST => http://{{server}}/api/test/exist => {"_field":"name","_value":"dip, dip1"} => Found 2 out of 2.
576. => POST => http://{{server}}/api/test/exist => {"_field":"name","_value":["dip","dip1"]} => Found 2 out of 2.
577.
578. # ===== _output_type =====================
579. => GET => http://{{server}}/api/test/find?_output_type=compressed => Find successfully
580. => GET => http://{{server}}/api/test/find?_output_type=invalid => Network request contains invalid _output_type
581. => GET => http://{{server}}/api/test/find?name=dip&_output_type=input => "input":\{"name":"dip"
582. => GET => http://{{server}}/api/test/?_output_type=html => button type="button" onclick="clone
583.
584.
585. #=== aggregate API ===========
586. => !POST => http://{{server}}/api/test/create?_confirmstr=test => {"_payload":[{"product":"X","type":"type1"}, {"product":"X","type":"type1"}, {"product":"Y","type":"type1"}, {"product":"Y","type":"type2"}, {"product":"Z","type":"type2"}]} => success
587. => POST => http://{{server}}/api/test/aggregate => {} => you must send _payload as list
588. => POST => http://{{server}}/api/test/aggregate => {"_payload":{"hello":"hello"}} => you must send _payload as list
589. => POST => http://{{server}}/api/test/aggregate => {"_payload": [ {"$match":{"type":"type1"}}, {"$group": {"_id": "$product","count": {"$sum": 1}}}] } => {"_id":"X","count":2}
590.
591. #====== date api ======
592. => POST => http://{{server}}/api/utils/date => {} => 202
593. => GET => http://{{server}}/api/utils/date => 202
594.
595. # ============ test /dbconfig ====================
596. => GET => http://{{server}}/api/test10/dbconfig => DbConfig not found
597. => GET => http://{{server}}/api/test_r/dbconfig => \{"local":false\}
598.
599. # ========== type-sefty and data validation ======
600. # define rules as per https://github.com/skaterdav85/validatorjs
601. # supported type: string, array, boolean, date, email, integer, numeric,regex:pattern,
602. # Supported constraints: required, not_in:foo,bar , max:value. min:value, in:foo,bar
603. => GET => http://{{server}}/api/test_v/insert?aa=aa => The name field is required
604. => POST => http://{{server}}/api/test_v/insert =>{"name":""}=> name field must not empty
605. # Also detect empty string
606. => POST => http://{{server}}/api/test_v/insert =>{"name":" "}=> name field must not empty
607. => POST => http://{{server}}/api/test_v/insert =>{"name":" "}=> name field must not empty
608. => GET => http://{{server}}/api/test_v/insert?name=dip => The email field is required
609. => GET => http://{{server}}/api/test_v/insert?name=aa&email=dip => email must be email
610. => GET => http://{{server}}/api/test_v/insert?name=aa&email=dip@dip.com => insert successfully
611. => POST => http://{{server}}/api/test_v/insert => {"name":"aa","email":"dip@dip.com","array":"hello"} => array must be a array
612. => POST => http://{{server}}/api/test_v/insert => {"name":"aa","email":"dip@dip.com","array":["hello"]} => insert successfully
613.
614. => POST => http://{{server}}/api/test_v/insert => {"name":"aa","email":"dip@dip.com","boolean":100} => boolean must be a boolean
615. => POST => http://{{server}}/api/test_v/insert => {"name":"aa","email":"dip@dip.com","boolean":true} => insert successfully
616.
617. => POST => http://{{server}}/api/test_v/insert => {"name":"aa","email":"dip@dip.com","number":"hello"} => number must be a number
618. => POST => http://{{server}}/api/test_v/insert => {"name":"aa","email":"dip@dip.com","number":1000} => "_id":"(?.*?)"
619. => POST => http://{{server}}/api/test_v/update => {"_id":"{{id}}","number":"1D000"} => number must be a number
620. => POST => http://{{server}}/api/test_v/update => {"_id":"{{id}}","number":"10000"} => success
621. => POST => http://{{server}}/api/test_v/update => {"_id":"{{id}}","number":10000} => success
622. => POST => http://{{server}}/api/test_v/update => {"_id":"{{id}}","array":"1D000"} => array must be a array
623. => POST => http://{{server}}/api/test_v/update => {"_id":"{{id}}","array":["1D000"]} => success
624. => GET => http://{{server}}/api/test_v/update?number="123D"&_confirmstr=test_v => number must be a number
625. => GET => http://{{server}}/api/test_v/update?number=123&_confirmstr=test_v => success
626. => POST => http://{{server}}/api/test_v/insert => {"_payload":[{"name":"aa","email":"dip@dip.com","number":1000},{"name":"aa","email":"dip@dip.com","number":1000}]} => success
627. => POST => http://{{server}}/api/test_v/insert => {"_payload":[{"name":"aa","email":"dip@dip.com","number":"WRONG"},{"name":"aa","email":"dip@dip.com","number":1000}]} => error
628. => POST => http://{{server}}/api/test_v/insert => {"_payload":[{"name":"aa","email":"dip@dip.com","number":"WRONG"},{"name":"aa","email":"dip@dip.com","number":"WRONG"}]} => error
629.
630.
631. ###################################################################
632. #
633. # Advance Search with RHS Color search
634. # Supported annotation:
635. # eq, ne, starts, ends:, regex:, in:, all:,int:eqi, nei, date:
636. ###################################################################
637. => !GET => http://{{server}}/api/test/delete?_confirmstr=test =>success
638. => !POST => http://{{server}}/api/test/insert => {"name":"A123","roll":10,"color":["red","green"]} => success
639. => !POST => http://{{server}}/api/test/insert => {"name":"B123","roll":11,"color":["red","blue"]} => success
640. => !POST => http://{{server}}/api/test/insert => {"name":"C124","roll":12,"color":["blue","green"]} => success
641. => !POST => http://{{server}}/api/test/insert => {"name":"xxx:xx66"} => success
642. => GET => http://{{server}}/api/test/count?name=eq:A123 => Count: 1
643. => GET => http://{{server}}/api/test/count?name=ne:A123 => Count: 3
644. => GET => http://{{server}}/api/test/count?name=starts:A => Count: 1
645. => GET => http://{{server}}/api/test/count?name=ends:3 => Count: 2
646. => GET => http://{{server}}/api/test/count?name=regex:12 => Count: 3
647. => GET => http://{{server}}/api/test/count?color=in:red => Count: 2
648. => GET => http://{{server}}/api/test/count?color=in:red,green => Count: 3
649. => GET => http://{{server}}/api/test/count?color=in:red, green,,,, => Count: 3
650. => GET => http://{{server}}/api/test/count?color=in:green,red => Count: 3
651. => GET => http://{{server}}/api/test/count?color=all:green,red => Count: 1
652. => GET => http://{{server}}/api/test/count?color=all:green,red,blue => Count: 0
653. => GET => http://{{server}}/api/test/count?color=all:green,red, blue, => Count: 0
654. => GET => http://{{server}}/api/test/count?color=in: green, red, blue, => Count: 3
655. => GET => http://{{server}}/api/test/count?color=in:green,red, blue,&name=starts:A => Count: 1
656. => GET => http://{{server}}/api/test/count?name=xxx:xx66 => Count: 1
657. => GET => http://{{server}}/api/test/count?roll=int:10 => Count: 1
658. => GET => http://{{server}}/api/test/count?roll=eqi:10 => Count: 1
659. => GET => http://{{server}}/api/test/count?roll=nei:10 => Count: 3
660. => GET => http://{{server}}/api/test/count?roll=eqi:XX => Count: 0
661.
662. # Test Params annotation
663. => !GET => http://{{server}}/api/test/delete?_confirmstr=test =>success
664. => GET => http://{{server}}/api/test/insert?rate=number:abc => params starts with number:XX
665. => GET => http://{{server}}/api/test/insert?rate=number:100 => "rate":100
666. => GET => http://{{server}}/api/test/insert?rate=number:100.100 => "rate":100.1,
667. => GET => http://{{server}}/api/test/insert?join_date=date:abc => params starts with date:
668. => GET => http://{{server}}/api/test/insert?join_date=date:2014-11-03T19:38:34.203Z => "join_date":"2014-11-03T19:38:34.203Z",
669. => POST => http://{{server}}/api/test/insert => {"join_date":"date:2014-11-03T19:38:34.203Z"} => "join_date":"2014-11-03T19:38:34.203Z",
670. => GET => http://{{server}}/api/test/insert?join_date=date:2014-11-03 => "join_date":"2014-11-03T00:00:00.000Z",
671. => GET => http://{{server}}/api/test/insert?join_date=date:2014-11-03X => must be a valid ISO Date
672.
673.
674.
675. => !GET => http://{{server}}/api/test/delete?_confirmstr=test => success
676.
677.
678.
679. # == Download
680. => !POST => http://{{server}}/api/test/insert => {"name":"A123","roll":10,"color":["red","green"]} => success
681. => GET => http://{{server}}/api/test/download => \[\{"_id":
682. => GET => http://{{server}}/api/test/export => \[\{"_id":
683.
684. # override db selection.
685. # its not possible to test as in testing all are local db.
686. => GET => http://{{server}}/api/test/count?_targetdb=local => success
687. => GET => http://{{server}}/api/test/count?_targetdb=remote => success
688.
689. # pivoit Table.
690. => !GET => http://{{server}}/api/test/delete?_confirmstr=test =>success
691. => POST => http://{{server}}/api/test/insert => {"_payload":[{"name":"A", "country":"india"},{"name":"B", "country":"india"},{"name":"A", "country":"uk"},{"name":"B", "country":"uk"},{"name":"C", "country":"uk"}, {"name":"A", "country":"usa"}]} =>success
692. => GET => http://{{server}}/api/test/pivot?_field=name,country => 6 distribution found
693.
694. # Timeseries on multiple fuilds.
695. => POST => http://{{server}}/api/test/insert => {"_payload":[{"name":"A", "event":"play_error"},{"name":"A", "event":"play_error"},{"name":"A", "event":"play_error"},{"name":"A", "event":"play_success"},{"name":"A", "event":"play_success"},{"name":"A", "event":"play_success"},{"name":"A", "event":"play_success"},{"name":"A", "event":"play_hit"},{"name":"A", "event":"play_hit"}]} =>success
696. => POST => http://{{server}}/api/test/ts_multi => {} => you must send _payload as non empty list
697. => POST => http://{{server}}/api/test/ts_multi => {"_payload":{"":""}} => you must send _payload as list
698. => POST => http://{{server}}/api/test/ts_multi => {"_payload":[]} => you must send _payload as non empty list
699. => POST => http://{{server}}/api/test/ts_multi => {"_payload":["a"]} => each element of _payload must be a object
700. => POST => http://{{server}}/api/test/ts_multi => {"_payload":[{"event":"play_error"},{"event":"play_success"},{"event":"play_hit"}]} => multi distribution found
701.
702. # testing hooks
703. => POST => http://{{server}}/api/test_hook/insert => {"_payload":[{"name":"A", "event":"play_error"}]} => onBeforeInsert
704. => POST => http://{{server}}/api/test_hook/create => {"name":"dip","count":1} =>onBeforeInsert
705. => GET => http://{{server}}/api/test_hook/delete?id={{id}} => onBeforeDelete
706. => GET => http://{{server}}/api/test_hook/update?id={{id}}&name=hari1 => onBeforeUpdate
707.
708. #Composute key
709. => GET => http://{{server}}/api/test_composite/delete?_confirmstr=test_composite => success
710. => POST => http://{{server}}/api/test_composite/create => {"key1":"dip"} => Data validation failed as key2 must be present as composite key
711. => POST => http://{{server}}/api/test_composite/create => {"key2":"dip"} => Data validation failed as key1 must be present as composite key
712. => POST => http://{{server}}/api/test_composite/create => {"key1":"z1","key2":"z2"} => insert successfully
713. => POST => http://{{server}}/api/test_composite/create => {"key1":"z1","key2":"z2"} => Data validation failed as composite key failed
714. => POST => http://{{server}}/api/test_composite/create => {"key1":"z1","key2":"z3"} =>insert successfully
715. => POST => http://{{server}}/api/test_composite/create => {"key1":"z1","key2":"z3","key3":"123"} =>Data validation failed as composite key failed
716. => POST => http://{{server}}/api/test_composite/bulk_insert => {"_payload":[{"key1":"z1","key2":"z2"},{"key1":"z1","key2":"z4","key3":"123"}]} =>1/2- Bulk Insert completed
717.
718. #schedule
719. # GET => http://{{server}}/api/schedule/count => 0
720. # GET => http://{{server}}/api/schedule/insert?url=http://google.com/1&cron_format=* * * * *&method=get&is_active=true => Insert Done. Schedule success:1, error:0. Active Job count:1
721. # GET => http://{{server}}/api/schedule/count => 1
722. # GET => http://{{server}}/api/schedule/insert?url=http://google.com/1&cron_format=* * * * *&method=get&is_active=false => Data validation failed as composite key failed
723. # GET => http://{{server}}/api/schedule/insert?url=http://google.com/2&cron_format=* * * * *&method=get&is_active=false => Schedule success:0, error:1. Active Job count:1
724. # GET => http://{{server}}/api/schedule/insert?url=http://google.com/3&cron_format=wrong&method=get&is_active=true => error:1
725. # GET => http://{{server}}/api/schedule/insert?url=http://google.com/3&cron_format=* 1 * * *&method=get&is_active=true => "_id":"(?.*?)"
726. # GET => http://{{server}}/api/schedule/update?id={{id2}}&cron_format=* 2 * * * => success
727. # GET => http://{{server}}/api/schedule/?id={{id2}}=> \* 2 \* \* \*
728. # GET => http://{{server}}/api/schedule/update?id={{id2}}&is_active=true => Update Done. Schedule Ops success:0, error:1. Active Job count:2
729. # GET => http://{{server}}/api/schedule/update?id={{id2}}&is_active=true => Update Done. Schedule Ops success:0, error:1. Active Job count:2
730. # GET => http://{{server}}/api/schedule/update?id={{id2}}&is_active=false => Update Done. Schedule Ops success:1, error:0. Active Job count:1
731. # GET => http://{{server}}/api/schedule/update?id={{id2}}&is_active=fass => The selected is active is invalid.
732. # GET => http://{{server}}/api/schedule/insert?url=http://google.com/4&cron_format=* * * * *&method=get&is_active=false => "_id":"(?.*?)"
733. # GET => http://{{server}}/api/schedule/update?id={{id2}}&is_active=false => Update Done. Schedule Ops success:0, error:1. Active Job count:1
734. # GET => http://{{server}}/api/schedule/update?id={{id2}}&is_active=true => Update Done. Schedule Ops success:1, error:0. Active Job count:2
735. # GET => http://{{server}}/api/schedule/update?is_active=false&_confirmstr=schedule => Update Done
736. # POST => http://{{server}}/api/schedule/insert => {"url":"http://{{server}}/api/test11/insert","cron_format":"*/1 * * * *","method":"post","is_active":true, "data":{"name":"dip"}} => "_id":"(?.*?)"
737. # sleep 65
738. # GET => http://{{server}}/api/schedule/?id={{id}} => "last_result":
739. # GET => http://{{server}}/api/schedule/delete?_confirmstr=schedule => Deleted count is :
740.
741.
742. # test Extension for /api/test/ext
743. => GET => http://{{server}}/api/test/ext => Ext API Called
744. => POST => http://{{server}}/api/test/ext => {} => Ext API Called
745.
746. # Push Notification
747. => GET => http://{{server}}/api/push_notification/delete?_confirmstr=push_notification => success
748. => GET => http://{{server}}/api/push_notification/insert => Trying insert Empty Object
749. => GET => http://{{server}}/api/push_notification/insert?app_id=test&token=abc&os=android => insert successfully
750. => GET => http://{{server}}/api/push_notification/insert?app_id=test&token=abc&os=android => Data validation failed as composite key failed
751. => GET => http://{{server}}/api/push_notification/count => 1
752. => GET => http://{{server}}/api/push_notification/insert?app_id=test&token=abc1&os=android => insert successfully
753. => GET => http://{{server}}/api/push_notification/count => 2
754. => POST => http://{{server}}/api/push_notification/insert => {"_payload":[{"app_id":"test","token":"abc11", "os":"android"},{"app_id":"test","token":"abc2", "os":"android"},{"app_id":"test","token":"abc3", "os":"android"},{"app_id":"test","token":"abc4", "os":"android"},{"app_id":"test","token":"abc5", "os":"android"},{"app_id":"test","token":"abc6", "os":"android"},{"app_id":"test","token":"abc7", "os":"android"},{"app_id":"test","token":"abc8", "os":"android"},{"app_id":"test","token":"abc9", "os":"android"},{"app_id":"test","token":"abc10", "os":"android"}]} => insert successfully
755.
756. => GET => http://{{server}}/api/push_notification/delete => You are trying to bulk operation.
757. => GET => http://{{server}}/api/push_notification/delete?token=abc=> missing _confirmstr
758. => GET => http://{{server}}/api/push_notification/delete?token=abc&_confirmstr=push_notification => Deleted count is : 1
759. => GET => http://{{server}}/api/push_notification/count => 1
760. => GET => http://{{server}}/api/push_notification/delete?token=invalid&_confirmstr=push_notification => Deleted count is : 0
761. => GET => http://{{server}}/api/push_notification/count => 1
762.
763. => GET => http://{{server}}/api/push_notification/push => Input validation failed: Missing app_id
764.
765. # It's dicult to test as we donb't have any token from mobile.
766. => GET => http://{{server}}/api/push_notification/push?app_id=test&page=0&title=hello&body=No Data&key=0 => succcss_count:0, error_count:1
767. => GET => http://{{server}}/api/push_notification/insert?app_id=test&token=abc1&os=android => insert successfully
768. => GET => http://{{server}}/api/push_notification/push?app_id=test&page=0&title=hello&body=No Data&key=0 => DRYRUN: true
769. => GET => http://{{server}}/api/push_notification/insert?app_id=test&token=abc1&os=android => insert successfully
770. => GET => http://{{server}}/api/push_notification/push?app_id=test&page=0&title=hello&body=No DATA&key=0&_no_dry_run=0 => [DRYRUN: false]
771. => GET => http://{{server}}/api/push_notification/insert?app_id=test&token=abc1&os=android => insert successfully
772. => GET => http://{{server}}/api/push_notification/push?app_id=test&page=0&title=hello&body=WITH DATA&key=0&pane=music&target=5e6d53f944526b7da8c0a844 => succcss_count:0, error_count:1
773. => GET => http://{{server}}/api/push_notification/insert?app_id=test&token=abc1&os=android => insert successfully
774. => GET => http://{{server}}/api/push_notification/push?app_id=test&page=0&title=hello&body=WITH DATA&key=0&pane=music&target=5e6d53f944526b7da8c0a844&_no_dry_run=0 => succcss_count:0, error_count:1
775.
776. => GET => http://{{server}}/api/push_notification/push_one?title=hello&body=WITH DATA&key=0&pane=music&target=5e6d53f944526b7da8c0a844 => Missing token
777. => GET => http://{{server}}/api/push_notification/push_one?token=fgEljAT1Qzg:APA91bFFF2zSUg3MaMtepRUzoE0xWcOvg4DlSSlxx8-85qDWreGJLHGWIM6zUkVgHIm3M7oZmcCoWIO11y2ZPbizyKt88dk-aNMYxgAiCf_DKF53ypPmpEH1-SpwSOTkV2wacIqSMBcz&title=hello&body=WITH DATA&key=0&pane=music&target=5e6d53f944526b7da8c0a844 => succcss_count:0, error_count:1
778. => POST =>http://{{server}}/api/push_notification/push_one => { "token":"fgEljAT1Qzg:APA91bFFF2zSUg3MaMtepRUzoE0xWcOvg4DlSSlxx8-85qDWreGJLHGWIM6zUkVgHIm3M7oZmcCoWIO11y2ZPbizyKt88dk-aNMYxgAiCf_DKF53ypPmpEH1-SpwSOTkV2wacIqSMBcz","title":"test","body":"pane","pane":"webview","target":"https://covidout.in/"} => succcss_count:0, error_count:1
779. # => GET => http://{{server}}/api/push_notification/push_one?token=fgEljAT1Qzg:APA91bFFF2zSUg3MaMtepRUzoE0xWcOvg4DlSSlxx8-85qDWreGJLHGWIM6zUkVgHIm3M7oZmcCoWIO11y2ZPbizyKt88dk-aNMYxgAiCf_DKF53ypPmpEH1-SpwSOTkV2wacIqSMBcz&title=এটা কিছু টেস্ট &body=এটা কিছু টেস্ট &key=0&pane=music&target=5e6d53f944526b7da8c0a844 => Successfully sent
780. => GET => http://{{server}}/api/push_notification/count?app_id=test => Count: 0
781.
782. # Testing Utilities
783. => GET => http://{{server}}/api/utils/test?app_id=test => You are hitting Test Utils
784. => GET => http://{{server}}/api/utils/date => The system time is
785. => GET => http://{{server}}/api/utils/bootcamp => Welcome to simplestore BootCamp!
786.
787. # Test Stategyies
788. => GET => http://{{server}}/api/test/insert?name=dip&_output_type=noresp => {"status":"success"}
789. => POST => http://{{server}}/api/test/insert?_output_type=noresp => {"name":"dip"}=> ^{"status":"success"}$
790. # We should get the exception evenif there is _output_type=noresp
791. => GET => http://{{server}}/api/test/insert?name=dip&_output_type=noresp&_output_type=xxx => Error while parsing request
792.
793.
794.
795. # test Bulk hits and rank
796. => !GET => http://{{server}}/api/test0/create?name=dip2 => "_id":"(?.*?)"
797. => POST => http://{{server}}/api/test0/bulk_hit => {"_payload":[{"id":"{{id}}","field":"count", "value":1}]} => s/e: 1/0
798. # Te hardcoded value treaded as a true.
799. => POST => http://{{server}}/api/test0/bulk_hit => {"_payload":[{"id":"{{id}}","field":"count", "value":1}, {"id":"56cafab06639904e9b68e73a","field":"count", "value":1}, {"id":"{{id}}","field":"count", "value":"wrong"}]} => s/e: 2/1
800. => GET => http://{{server}}/api/test0/?id={{id}} => "count":2
801. => POST => http://{{server}}/api/test0/bulk_hit => {"_payload":[{"id":"{{id}}","field":"count", "value":-1}]} => [s/e: 1/0]
802. => POST => http://{{server}}/api/test0/bulk_hit => {"_payload":[{"id":"{{id}}","field1":"count", "value":-1}]} => [s/e: 0/1]
803. => GET => http://{{server}}/api/test0/?id={{id}} => "count":1
804. => POST => http://{{server}}/api/test0/bulk_rank => {"_payload":[{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true},{"id":"{{id}}","field":"count", "up":true}]} => [s/e: 16/0]
805. => GET => http://{{server}}/api/test0/?id={{id}} => "count":10
806. => POST => http://{{server}}/api/test0/bulk_rank => {"_payload":[{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false}]} => [s/e: 16/0]
807. => POST => http://{{server}}/api/test0/bulk_rank => {"_payload":[{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false},{"id":"{{id}}","field":"count", "up":false}]} => [s/e: 16/0]
808. => GET => http://{{server}}/api/test0/?id={{id}} => "count":0
809.
810.
811.
812. ################################################################################
813. # Sending Email functinaly ( Broken Needs API redesign)
814. ################################################################################
815. ## TODO: Test are broken as we meshed up with body and html two data, I would perefr to have body and then isHtml as a flag so this need to be rredesigned
816. => GET => http://{{server}}/api/utils/email => Input validation failed: Missing to
817. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&body=Simple Test =>Input validation failed: Missing subject
818. ## Please use dryrun to ensure to avoid getting so many mails.
819. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&dry_run=1 => ACTUALY NOT SEND - JUST A DRY RUN
820. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&dry_run=1 => Missing body
821. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&dry_run=1 => ACTUALY NOT SEND - JUST A DRY RUN
822. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&dry_run=1&is_html=1 => ACTUALY NOT SEND - JUST A DRY RUN
823.
824. ## Test multiple sendaccount by spaciating product
825.
826. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&product=Grodok&body=hello&dry_run=1 => ACTUALY NOT SEND
827. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&dry_run=1&product=hello => Mail is not supported for this product
828. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&dry_run=1&product=default => \[DRYRUN\] Mail sent to
829.
830. ##send calender invitew - just add start_time as ISO date String and duration as number in minites
831. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&start_time=2023-07-23T23:37:08.505Z => Missing duration
832. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&start_time=2023-07-23T23:37:08.505Z&duration=xyz => has to be a valid date!
833. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&start_time=INAVLID&duration=xyz => has to be a valid date
834. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&start_time=2023-07-23T23:37:08.505Z&duration=30&dry_run=1 => ACTUALY NOT SEND
835. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&start_time=2023-07-23T23:37:08.505Z&duration=30&cal_body=Cal Body &cal_subject=Cal_Subject&cal_location=Kolkata&dry_run=1 => ACTUALY NOT SEND
836.
837. ## test HTML Mail.
838. ## We are supported HTML mail - you need to send body and html but body would be droped. It just use the degault HTML
839. ## template to send the email. It works for both w/o calender
840. => POST => http://{{server}}/api/utils/email => {"to":"dutta.dipankar08@gmail.com", "subject":"Hello", "body":"hello", "body":"Hello\nHow ae you doing?\n\nThnaks,\nDipankar","dry_run":1, "is_html":1} => ACTUALY NOT SEND
841. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&start_time=2023-07-23T23:37:08.505Z&duration=30&cal_body=Cal Body &cal_subject=Cal_Subject&cal_location=Kolkata&html=hello there&dry_run=1 => ACTUALY NOT SEND
842. => GET => http://{{server}}/api/utils/email?to=testuser@gmail.com&subject=Hello World&body=Simple Test => You must pass some valid email addess
843.
844. ## REAL SEND MAIL - DISABLE BELOW TEST
845. ## GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test => Mail sent to
846. ## GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Hello\n\nWorld\nDipankar\nTest=> Mail sent to
847. ## GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&start_time=2023-07-23T23:37:08.505Z&duration=30 => [DRYRUN] Mail sent to
848.
849. ## HTML Norm : new line to
850. => GET => http://localhost/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Hello\nWorld&dry_run=1&is_html=1 => Hello
World
851. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=\nHello\nWorld\n&dry_run=1&is_html=1 =>
Hello
World
852. => POST => http://{{server}}/api/utils/email => {"to":"dutta.dipankar08@gmail.com", "subject":"Hello World","body":"\nHello\nWorld\n","dry_run":1, "is_html":1 } =>
Hello
World
853.
854. ################################################
855. # Short code
856. ################################################
857. => GET => http://{{server}}/api/nodel_shortcode/insert => Trying insert Empty Object
858. => GET => http://{{server}}/api/nodel_shortcode/generate => Input validation failed: Missing target_db
859. => GET => http://{{server}}/api/nodel_shortcode/generate?target_id=123&target_db=xxxdb => "short_code":"(?.*?)"
860. => GET => http://{{server}}/api/nodel_shortcode/get?short_code={{short_code}} => xxxdb
861. => GET => http://{{server}}/api/nodel_shortcode/get?short_code=wrong => Find successfully with 0 items
862.
863.
864.
865.
866. # Support _sort.
867. => !GET => http://{{server}}/api/test0/delete?_confirmstr=test0 => success
868. => !POST => http://{{server}}/api/test0/create => {"_payload":[{"name":"dip3","roll":1},{"name":"dip3","roll":2}]} => success
869. => GET => http://{{server}}/api/test0/find?&_sort=roll => "roll":1.*?"roll":2
870. => GET => http://{{server}}/api/test0/find?&_sort=-roll => "roll":2.*?"roll":1
871.
872. # Support clone APIs
873. => !POST => http://{{server}}/api/test0/create => {"name":"dip","num":{"math":10, "eng":11}} => "_id":"(?.*?)"
874. => GET => http://{{server}}/api/test0/clone => You must pass a _id
875. => POST => http://{{server}}/api/test0/clone => {} => You must pass a _id
876. => GET => http://{{server}}/api/test0/clone?_id={{id}} => "name":"dip"
877. => GET => http://{{server}}/api/test0/clone?_id={{id}}&name=dip2 => "name":"dip2"
878. => POST => http://{{server}}/api/test0/clone => {"id":"{{id}}", "name":"dip3"} => "name":"dip3"
879.
880. # QR code generation:
881. => GET => http://{{server}}/api/utils/qr => Missing url
882. => GET => http://{{server}}/api/utils/qr?url=http://google.com => svg
883. => GET => http://{{server}}/api/utils/qr?url=http://google.com&size=100 => height="100"
884. => GET => http://{{server}}/api/utils/qr?url=http://google.com&size=100&color=%23ff0000 => \#ff0000
885.
886.
887. # test system_payment == Migrate to simple_auth
888. #=> GET => http://{{server}}/api/system_payment/stripe => Stripe API returns an unexpected resp
889. # => GET => http://{{server}}/api/system_payment/stripe?id=1234 => Stripe API returns an unexpected resp <<< FIX THIS
890. #=> GET => http://{{server}}/api/system_payment_not_webhook/?id=1234 => not a valid ID
891. # test invalid sqi
892. #=> POST => http://{{server}}/api/system_payment/stripe => {"data":{"object":{"amount":100,"currency":"inr","id":"123", "customer":"cus_123", "description":"tx description", "charges":{"data":[{"billing_details":{"email":"dip@fb.com"}}]}}}}=> SKU not configuired in SimpleStore
893. # test right parsing
894. #=> POST => http://{{server}}/api/system_payment/stripe => {"data":{"object":{"amount":100,"currency":"inr","id":"123", "customer":"cus_123", "description":"sku1", "charges":{"data":[{"billing_details":{"email":"dip@fb.com"}}]}}}}=> Payment is inserted
895. # test empty data
896. #=> POST => http://{{server}}/api/system_payment/stripe => {}=> Stripe API returns an unexpected resp
897. #=> GET => http://{{server}}/api/system_payment/points => Missing user_id
898. # this api should be used to get total points for an user
899. #=> GET => http://{{server}}/api/system_payment/points?user_id=123 => No matching query found
900. #=> GET => http://{{server}}/api/system_payment/points?user_id=dip@fb.com => Total points is:
901.
902. # test roserpay WebHook
903. #=> POST => http://{{server}}/api/system_payment/razorpay => { "entity": "event", "account_id": "acc_3xhNTlBQgmDD7g", "event": "payment.captured", "contains": ["payment" ], "payload": {"payment": { "entity": {"id": "pay_FVxUMaT3vnv78M","entity": "payment","amount": 20000,"currency": "INR","status": "captured","order_id": "order_FVxUBI0n9PhY5T","invoice_id": null,"international": false,"method": "netbanking","amount_refunded": 0,"refund_status": null,"captured": true,"description": null,"card_id": null,"bank": "HDFC","wallet": null,"vpa": null,"email": "dutta.dipankat08@gmail.com","contact": "+919933588184","notes": { "email": "dutta.dipankat08@gmail.com", "phone": "9933588184"},"fee": 590,"tax": 90,"error_code": null,"error_description": null,"error_source": null,"error_step": null,"error_reason": null,"acquirer_data": { "bank_transaction_id": "5972833"},"created_at": 1598568741 }} }, "created_at": 1598568744} => Payment is inserted
904. #=> POST => http://{{server}}/api/system_payment/razorpay => { "entity": "event", "account_id": "acc_3xhNTlBQgmDD7g", "event": "payment.failure", "contains": ["payment" ], "payload": {"payment": { "entity": {"id": "pay_FVxUMaT3vnv78M","entity": "payment","amount": 20000,"currency": "INR","status": "captured","order_id": "order_FVxUBI0n9PhY5T","invoice_id": null,"international": false,"method": "netbanking","amount_refunded": 0,"refund_status": null,"captured": true,"description": null,"card_id": null,"bank": "HDFC","wallet": null,"vpa": null,"email": "dutta.dipankat08@gmail.com","contact": "+919933588184","notes": { "email": "dutta.dipankat08@gmail.com", "phone": "9933588184"},"fee": 590,"tax": 90,"error_code": null,"error_description": null,"error_source": null,"error_step": null,"error_reason": null,"acquirer_data": { "bank_transaction_id": "5972833"},"created_at": 1598568741 }} }, "created_at": 1598568744} => Received invalid events - razorpay API returns an unexpected resp
905. #=> POST => http://{{server}}/api/system_payment/razorpay => { "entity": "event", "account_id": "acc_3xhNTlBQgmDD7g", "event": "payment.captured", "contains": ["payment" ], "payload": {"payment": { "entity": {"id": "pay_FVxUMaT3vnv78M","entity": "payment","amount": 20001,"currency": "INR","status": "captured","order_id": "order_FVxUBI0n9PhY5T","invoice_id": null,"international": false,"method": "netbanking","amount_refunded": 0,"refund_status": null,"captured": true,"description": null,"card_id": null,"bank": "HDFC","wallet": null,"vpa": null,"email": "dutta.dipankat08@gmail.com","contact": "+919933588184","notes": { "email": "dutta.dipankat08@gmail.com", "phone": "9933588184"},"fee": 590,"tax": 90,"error_code": null,"error_description": null,"error_source": null,"error_step": null,"error_reason": null,"acquirer_data": { "bank_transaction_id": "5972833"},"created_at": 1598568741 }} }, "created_at": 1598568744} => SKU not configuired in SimpleStore
906.
907. # Test Trial points.
908. #=> GET => http://{{server}}/api/system_payment/trial?user_id=trial_user1&sku=test_sku_trial => Your trail is activated!
909. #=> GET => http://{{server}}/api/system_payment/trial?user_id=trial_user1&sku=test_sku_trial => You aleady used your trial
910. #=> GET => http://{{server}}/api/system_payment/trial?user_id=trial_user1&sku=unknown => SKU not configuired in SimpleStore
911. #=> GET => http://{{server}}/api/system_payment/trial?user_id=trial_user1&sku=test_sku_trial_no => This SKU is not elligiable from trail
912. #=> GET => http://{{server}}/api/system_payment/points?user_id=trial_user1 => 10
913. #=> GET => http://{{server}}/api/system_payment/delete?_confirmstr=system_payment => success
914.
915.
916. # test friendly ID: ( test3 is config for friendly id so it would be a match)
917. # You should note that friendlyID should NOT necessaryly to be unique due to te perf.
918. => POST => http://{{server}}/api/test0/insert => {"name":"dip"} => ts_insert
919. => POST => http://{{server}}/api/test3/insert => {"name":"dip"} => friendly_id
920. => POST => http://{{server}}/api/test3/insert => {"name":"dip"} => friendly_id
921.
922. ######### Testing calender APIS #############
923. => POST => http://{{server}}/api/system_calender/grant => {} => Input validation failed
924. => POST => http://{{server}}/api/system_calender/grant => {"product":"test", "user_id":"123", "start_time":"invalid","duration":30, "type":"type1" } => Invalid start_time
925. #=> POST => http://{{server}}/api/system_calender/grant => {"product":"test", "user_id":"123", "start_time":"2013-03-10T02:00:00Z","duration":15, "type":"type1" } => success
926. #=> POST => http://{{server}}/api/system_calender/grant => {"product":"test", "user_id":"123", "start_time":"2013-03-10T02:00:00Z","duration":60, "type":"type1" } => 2/2 slots created
927. => POST => http://{{server}}/api/system_calender/grant => {"product":"test", "user_id":"123", "start_time":"2013-03-10T03:00:00Z","duration":60, "type":"type1","slot":10 } => 6/6 slots created
928. => POST => http://{{server}}/api/system_calender/grant => {"product":"test", "user_id":"123", "start_time":"2013-03-10T03:00:00Z","duration":60, "type":"type1","slot":10 } => error
929. => POST => http://{{server}}/api/system_calender/grant => {"product":"test", "user_id":"123", "start_time":"2013-03-10T03:10:00Z","duration":70, "type":"type1","slot":10 } => 2/7
930. => POST => http://{{server}}/api/system_calender/grant => {"product":"test", "user_id":"123", "start_time":"2014-03-10T03:10:00Z","duration":70, "type":"type1","slot":10 } => 7/7
931.
932. # Test Avilablity
933. => POST => http://{{server}}/api/system_calender/availability => {"product":"test", "date":"2013-03-10T03:10:00Z" } => ,"user_id":"123","type":"type1"
934. # There is an issue in the below test
935. => POST => http://{{server}}/api/system_calender/availability => {"product":"test", "date":"2015-03-10T03:10:00Z" } => 0 free slots found
936. => POST => http://{{server}}/api/system_calender/availability => {"product":"test", "date":"2013-03-10T03:10:00Z","type":"type1" } => ,"user_id":"123","type":"type1"
937. => POST => http://{{server}}/api/system_calender/availability => {"product":"test", "date":"2013-03-10T03:10:00Z","type":"type2" } => "out":\[\]
938. => POST => http://{{server}}/api/system_calender/availability => {"product":"test", "date":"2013-03-10T03:10:00Z","type":"pe1" } => ,"user_id":"123",
939. => POST => http://{{server}}/api/system_calender/availability => {"product":"test", "date":"2012-03-10T03:10:00Z","type":"pe2" } => "out":\[\]
940. => POST => http://{{server}}/api/system_calender/availability => {"date":"2013-03-10T03:10:00Z","type":"pe2" } => Missing product
941.
942. # test booking:
943. => POST => http://{{server}}/api/system_calender/grant => {"product":"doctor", "user_id":"123", "start_time":"2015-03-15T03:00:00Z","duration":60, "type":"type1","slot":10 } => 6/6
944. => POST => http://{{server}}/api/system_calender/availability => {"product":"doctor", "date":"2015-03-15T03:00:00Z"} => 6 free slots found
945. => POST => http://{{server}}/api/system_calender/availability => {"product":"doctor", "date":"2015-03-15T03:00:00Z"} => "_id":"(?.*?)"
946. => POST => http://{{server}}/api/system_calender/book => {"product":"test", "id" :"{{id2}}", "user_id":"booker2"} => successfully booked
947. => POST => http://{{server}}/api/system_calender/book => {"product":"test", "id" :"{{id2}}", "user_id":"booker2"} => This schedule is already taken
948. => POST => http://{{server}}/api/system_calender/availability => {"product":"doctor", "date":"2015-03-15T03:00:00Z" } => 5 free slots found
949.
950. # test cancel
951. => POST => http://{{server}}/api/system_calender/cancel => {"id" :"{{id2}}", "user_id":"booker3"} => not auth
952. => POST => http://{{server}}/api/system_calender/cancel => {"id" :"5f46e8952dd1ada69b161f91", "user_id":"booker3"} => Schedule not found"
953. => POST => http://{{server}}/api/system_calender/cancel => {"id" :"{{id2}}", "user_id":"booker2"} => successfully canceled
954. => POST => http://{{server}}/api/system_calender/availability => {"product":"doctor", "date":"2015-03-15T03:00:00Z" } => 6 free slots found
955. => GET => http://{{server}}/api/system_calender/delete?_confirmstr=system_calender => success
956.
957.
958. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&dry_run=1&product=hello => Mail is not supported for this product
959. => GET => http://{{server}}/api/utils/email?to=dutta.dipankar08@gmail.com&subject=Hello World&body=Simple Test&dry_run=1&product=default => \[DRYRUN\] Mail sent to
960.
961. # Test promotion ## Needs a migration simple auth => admin_promotions DB instead
962. #=> !POST => http://{{server}}/api/auth2/login_by_token => {"token": "fake_token"} => "auth_token":"(?.*?)"
963. #=> POST => http://{{server}}/api/promotion/get_referral_code => {} => Missing auth_token
964. #=> POST => http://{{server}}/api/promotion/get_referral_code => {"auth_token": "wrong","product":"fake_product"} => Unauthorized request
965. #=> POST => http://{{server}}/api/promotion/get_referral_code => {"auth_token": "{{auth_token}}","product":"fake_product"} => "code":"(?.*?)"
966. #=> POST => http://{{server}}/api/promotion/get_referral_code => {"auth_token": "{{auth_token}}","product":"fake_product"} => You already have generated the ref code.
967. #=> POST => http://{{server}}/api/promotion/get_referral_code => {"auth_token": "{{auth_token}}","product":"fake_product1"} => "code":"(?.*?)"
968. #=> POST => http://{{server}}/api/promotion/check_referral_code => {"code": "{{code}}","product":"fake_product"} => "type":"REFER",
969. #=> POST => http://{{server}}/api/promotion/check_referral_code => {"code": "{{code}}","product":"fake_product1"} => This referral code is not valid
970. #=> POST => http://{{server}}/api/promotion/check_referral_code => {"code": "wrong","product":"fake_product1"} => This referral code is not valid
971. #=> GET => http://{{server}}/api/promotion/delete?_confirmstr=promotion => success
972.
973. # RCE - JUST BASIC TEST
974.
975. # Capabilities
976. => GET => http://{{server}}/api/utils/rce/capabilities?_dev_token=root => hello_world_code
977.
978. # Status
979. => GET => http://{{server}}/api/utils/rce/status?_dev_token=root&lang=c => Compiler works fine
980. => POST => http://{{server}}/api/utils/rce/execute => {"_dev_token":"root", "lang":"c", "code":"\#include"} => \"out\":{\"stderr\":\"/tmp/
981. => POST => http://{{server}}/api/utils/rce/execute => {"_dev_token":"root", "lang":"c","code": "\#include \n int main(){ while(1) printf(\"Hello Dipankar\"); \nreturn 0;}"} => DipankarHello DipankarHello DipankarHello DipankarHello DipankarHello
982. => POST => http://{{server}}/api/utils/rce/execute_ext => {"_dev_token":"root", "lang":"python", "code":"print 'hello123'"} => hello123
983. => POST => http://{{server}}/api/utils/rce/execute_input => {"_dev_token":"root", "lang":"c", "code": "\#include \n int main(){ char str[100]; scanf(\"%s\",&str);printf(\"%s\", str); \nreturn 0;}","lang":"c","input":"HelloWorld"} => HelloWorld
984.
985.
986.
987. # Test Youtube Download
988. #sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
989. # sudo chmod a+rx /usr/local/bin/youtube-dl
990. #=> GET => http://{{server}}/api/utils/youtubedl?id=sb_sMqAF_o => Incomplete YouTube ID
991. # => GET => http://{{server}}/api/utils/youtubedl?id=CP2AYEqoaZo => googlevideo.com
992. # => GET => http://{{server}}/api/utils/youtubedl/audio?id=CP2AYEqoaZo => googlevideo.com
993. # => GET => http://{{server}}/api/utils/youtubedl/video?id=CP2AYEqoaZo => googlevideo.com
994. # => GET => http://{{server}}/api/utils/youtubedl/info?id=CP2AYEqoaZo => googlevideo.com
995. # => GET => http://{{server}}/api/utils/youtubedl/audio?id=https://www.youtube.com/watch?v=De8UKeURlWU => googlevideo.com
996. # => GET => http://{{server}}/api/utils/youtubedl/dl?id=kEld6MLDXPI => A-V-mp4
997. #### USE TESING BELOW LINE ##
998.
999. # SimpleStore EXPLORE
1000. => GET => http://{{server}}/api/explore/play => Simple Store API EXPLORE
1001.
1002. # SMS
1003. => GET => http://{{server}}/api/utils/sms?to=8927476238&msg=hello&dryrun=true => \[Dryrun\] SMS sent to 8927476238
1004.
1005. # Dev key
1006. GET => http://{{server}}/api/utils/rce/execute?code=hello&lang=kotlin => Access denied
1007. GET => http://{{server}}/api/utils/rce/execute?code=hello&lang=kotlin&_dev_token=root1 => Access denied
1008. GET => http://{{server}}/api/utils/rce/execute?code=hello&lang=kotlin&_dev_token=root => Error while executing this code
1009.
1010. # Status utils = This tracks the health of the endpoints
1011. GET => http://{{server}}/api/status/ping?name=ServiceA => Missing endpoint
1012. GET => http://{{server}}/api/status/ping?endpoint=www.google.com => Missing name
1013. GET => http://{{server}}/api/status/ping?name=ServiceA&endpoint=www.google.com => pong
1014. GET => http://{{server}}/api/status/ping?name=ServiceA&endpoint=www.google.com => pong
1015. GET => http://{{server}}/api/status/show => Live Status of our Service
1016. # HTML TEST NOT SUPPORTED GET => http://{{server}}/api/analytics/show?app_id=sample1 => Showing data for app id sample1
1017. # HTML TEST NOT SUPPORTED GET => http://{{server}}/api/analytics/show?app_id=sample => Showing data for app id sample
1018.
1019. # Long tern Jobs
1020.
1021.
1022.
1023.
1024. ############################# license APIS. #############################
1025. # License APis allows you to create license for an app user for a app for a duration.
1026. # You can either grant, revoke and validate the license
1027. # All common api's needs root_key to access (TODO)
1028. # There is no renew supported, you just revoke and grant it again.
1029. #########################################################################
1030. => !GET => http://{{server}}/api/license/delete?_confirmstr=license => success
1031. # Root key
1032. # => GET => http://{{server}}/api/license/ => api access denied
1033. # => GET => http://{{server}}/api/license?root_key=WRONG => success
1034. # Grant, validate and revoke
1035. => GET => http://{{server}}/api/license/grant?app_id=test&user_id=test => Missing duration
1036. => GET => http://{{server}}/api/license/grant?app_id=test&user_id=test&duration=1&key=NO_KEY => "key":"NO_KEY"
1037. => GET => http://{{server}}/api/license/grant?app_id=test&user_id=test&duration=1&key=NO_KEY => license already granted
1038. => GET => http://{{server}}/api/license/grant?app_id=test&user_id=test1&duration=WRONG&key=NO_KEY => please pass a valid duration
1039. => GET => http://{{server}}/api/license/validate?app_id=test&user_id=test&key=NO_KEY => access granted
1040. => GET => http://{{server}}/api/license/validate?app_id=test&user_id=test&key=NO_KEY1 => access denied
1041. => GET => http://{{server}}/api/license/validate?app_id=WRONG&user_id=test&key=NO_KEY => access denied
1042. => GET => http://{{server}}/api/license/revoke?app_id=test&user_id=test => license revoked
1043. => GET => http://{{server}}/api/license/revoke?app_id=test&user_id=test => license not found
1044. => GET => http://{{server}}/api/license/revoke?app_id=test&user_id=test => license not found
1045. => GET => http://{{server}}/api/license/revoke?app_id=test=> Missing user_id
1046.
1047. # expairy
1048. => GET => http://{{server}}/api/license/grant?app_id=test&user_id=test2&duration=0&key=NO_KEY=> success
1049. => GET => http://{{server}}/api/license/validate?app_id=test&user_id=test2&key=NO_KEY => license expired
1050.
1051. # renew
1052. => GET => http://{{server}}/api/license/revoke?app_id=test&user_id=test2 => license revoked
1053. => GET => http://{{server}}/api/license/grant?app_id=test&user_id=test2&duration=1&key=NO_KEY=> success
1054. => GET => http://{{server}}/api/license/validate?app_id=test&user_id=test2&key=NO_KEY => access granted
1055.
1056. # generate key
1057. => GET => http://{{server}}/api/license/grant?app_id=test&user_id=test3&duration=1=> "key":"(?.*?)"
1058. => GET => http://{{server}}/api/license/validate?app_id=test&user_id=test3&key={{key}} => access granted
1059.
1060.
1061. ############################# Schedule Script #############################
1062. # You can schedule arbitrary script execution with SimpleStore
1063. # FIrst submit a task using /schedule_script/submit/
1064. # Then Activate the task using /schedule_script/submit/
1065. # Great! You job has scheduled.
1066. # Check a list of jobs which are current scheduled as /schedule_script/status/ and you can deactivate as /schedule_script/deactivate/
1067. #########################################################################
1068. => !GET => http://{{server}}/api/schedule_script/delete?_confirmstr=schedule_script => success
1069.
1070. => GET => http://{{server}}/api/schedule_script/submit?name=test&description=test&script=console.log(%22hello%20Dipankar%22)ZZ&corn=*/1%20*%20*%20*%20* => "_id":"(?.*?)"
1071. => GET => http://{{server}}/api/schedule_script/activate?id={{job_id}} => Job has scheduled
1072. => GET => http://{{server}}/api/schedule_script/activate?id={{job_id}} => already scheduled
1073. => GET => http://{{server}}/api/schedule_script/activate_all => 0/1 Job has scheduled
1074. => GET => http://{{server}}/api/schedule_script/reload => We have restarted 1 jobs
1075. => GET => http://{{server}}/api/schedule_script/status => {{job_id}}
1076. # => sleep => 30 # Disabled to just avoid waiting while testing -- works fine,
1077. # => GET => http://{{server}}/api/schedule_script/status => "successCount":1
1078. => GET => http://{{server}}/api/schedule_script/deactivate?id={{job_id}} => canceled
1079. => GET => http://{{server}}/api/schedule_script/deactivate?id={{job_id}} => is not scheduled
1080. => GET => http://{{server}}/api/schedule_script/status => We found 0 active scheduled Script
1081. => GET => http://{{server}}/api/schedule_script/dryrun?script=ABCD => ABCD
1082. => GET => http://{{server}}/api/schedule_script/dryrun?script=console.log('hello') => success
1083.
1084.
1085. # Delete all at the end this is needed as server auto load when stat
1086. => !GET => http://{{server}}/api/schedule_script/delete?_confirmstr=schedule_script => success
1087.
1088.
1089. ############################# Subscription #############################
1090. # Provides api for email subscription and resubscription
1091. # User can do subscribe and unscibe to an app by giving email id.
1092. # Admin can notify by ending mail to all the people who subscribe.
1093. # Maximum notification allow is 1000
1094. #########################################################################
1095. => !GET => http://{{server}}/api/subscription/delete?_confirmstr=subscription => success
1096. => GET => http://{{server}}/api/subscription/subscribe?app_id=test&email=dutta.dipankar08@gmail.com => success
1097. => GET => http://{{server}}/api/subscription/subscribe?app_id=test&email=dutta.dipankar08@gmail.com => Data validation failed as composite key failed
1098. => GET => http://{{server}}/api/subscription/count => Count: 1
1099. => GET => http://{{server}}/api/subscription/notify?subject=Hello&body=Some HTML Content&app_id=test&dry_run=1 => Email send to 1 subscriber
1100. => GET => http://{{server}}/api/subscription/notify?subject=Hello&body=Some HTML Content&app_id=wrong&dry_run=1 => Not able to notify as there is zero subscription for this app
1101. => GET => http://{{server}}/api/subscription/unsubscribe?app_id=test&email=dutta.dipankar08@gmail.com => success
1102. => GET => http://{{server}}/api/subscription/unsubscribe?app_id=test&email=dutta.dipankar08@gmail.com => Not able to unsubscribe
1103. => GET => http://{{server}}/api/subscription/count => Count: 0
1104.
1105.
1106. ############################ SOCIAL POST ##################################
1107. # This allow to post the text and image in FB, Tweeter, Linked-In and Telegram
1108. # We currently supports (1)FB abd (2) Tweeter
1109. # You need to update the key in /etc/SECURE
1110. ############################################################################
1111. # Comments to avoid spanning the profile
1112. # => GET => http://{{server}}/api/utils/social/twitter?text=automation test => Successfully tweeted
1113. # => GET => http://{{server}}/api/utils/social/twitter?text=automation test => Status is a duplicate
1114. # => GET => http://{{server}}/api/utils/social/facebook?text=automation test => Successfully tweeted
1115. => GET => http://{{server}}/api/utils/social/telegram => Missing text
1116. # => GET => http://{{server}}/api/utils/social/telegram?text=automationtest\&Test => success
1117. # You should you post method to pass data
1118. # Below two test is diable as missing real tokens
1119. # => POST => http://{{server}}/api/utils/social/telegram => {"text":"automation test & Test & test"} => success
1120. # => POST => http://{{server}}/api/utils/social/facebook => {"text":"Welcome to SimpleStore! This is post where we test our APIs"} => success
1121.
1122. ############################ TEST Universal Link page ##################################
1123. #
1124. ############################################################################
1125. => GET => http://{{server}}/api/utils/universal_link?app_id=in.co.dipankar.fmradio&key=1&app_name=FMRadio => https://play\.google\.com/store/apps/details\?id=in\.co\.dipankar\.fmradio
1126. => GET => http://{{server}}/api/utils/universal_link?app_id=in.co.dipankar.fmradio&key=1&app_name => Input validation failed: Missing app_name"
1127. => GET => http://{{server}}/api/utils/universal_link => Input validation failed: Missing app_id"
1128.
1129. ############################ Static File generator ##################################
1130. #
1131. ############################################################################
1132. => GET => http://{{server}}/api/utils/static/privacy?app_id=in.co.dipankar.fmradio&key=1&app_name=XXXXXXXXX => XXXXXXXXX
1133. => GET => http://{{server}}/api/utils/static/toc?app_id=in.co.dipankar.fmradio&key=1&app_name=XXXXXXXXX => XXXXXXXXX
1134.
1135. ############################## UPDATE ONE ###########################################
1136. # THIS API helps to update one entry entry in ethe system. you must by _filter and _payload to serch that
1137. # entry and update with the needed data. Should throw the error it it found many entry
1138. #####################################################################################
1139. => !GET => http://{{server}}/api/test/delete?_confirmstr=test => success
1140. => POST => http://{{server}}/api/test/create => {"name":"dip", "roll":1} => success
1141. => POST => http://{{server}}/api/test/update_one => {} => _filter object must be non empty
1142. => POST => http://{{server}}/api/test/update_one => {"_filter":{}} => _filter object must be non empty
1143. => POST => http://{{server}}/api/test/update_one => {"_filter":{"name":"dip"} ,"_payload":{}} => You must pass some data in the request
1144. => POST => http://{{server}}/api/test/update_one => {"_filter":{"name":"dip1"},"_payload":{"roll":2}} => there is no matching entry
1145. => POST => http://{{server}}/api/test/update_one => {"_filter":{"name":"dip"},"_payload":{"roll":2}} => pdated 1 entry out of 1 matched
1146. => POST => http://{{server}}/api/test/create => {"name":"dip", "roll":1} => success
1147. => POST => http://{{server}}/api/test/update_one => {"_filter":{"name":"dip"},"_payload":{"roll":2}} => We found multiple entry
1148. => !GET => http://{{server}}/api/test/delete?_confirmstr=test => success
1149.
1150. ############################## INSERT OR UPDATE ONE ###########################################
1151. # THIS API helps to insert update one entry entry in ethe system. you must by _filter and _payload to pass
1152. # if the item is found that are updated with new payload - or it will create a new entry by marging _filter and _payload
1153. #####################################################################################
1154. => !GET => http://{{server}}/api/test/delete?_confirmstr=test => success
1155. => POST => http://{{server}}/api/test/insert_or_update_one => {} => _filter object must be non empty
1156. => POST => http://{{server}}/api/test/insert_or_update_one => {"_filter":{}} => _filter object must be non empty
1157. => POST => http://{{server}}/api/test/insert_or_update_one => {"_filter":{"name":"dip"} ,"_payload":{}} => Please send some non empty payload
1158. => POST => http://{{server}}/api/test/insert_or_update_one => {"_filter":{"name":"dip1"},"_payload":{"roll":2}} => inserted one entry
1159. => POST => http://{{server}}/api/test/insert_or_update_one => {"_filter":{"name":"dip1"},"_payload":{"roll":3}} => updated one entry
1160. => POST => http://{{server}}/api/test/insert_or_update_one => {"_filter":{"name":"dip1"},"_payload":{"roll":4}} => updated one entry
1161. => POST => http://{{server}}/api/test/create => {"name":"dip1", "roll":5} => success
1162. => POST => http://{{server}}/api/test/insert_or_update_one => {"_filter":{"name":"dip1"},"_payload":{"roll":4}} => We found multiple entry
1163. => !GET => http://{{server}}/api/test/delete?_confirmstr=test => success
1164.
1165.
1166. ################ LIST APIs #############################
1167. # append to list
1168. # remove from list
1169. # clean from list
1170. ######################################################
1171. => POST => http://{{server}}/api/test/delete?_confirmstr=test => {} => success
1172. => POST => http://{{server}}/api/test/insert => {"name":"dip"} => "_id":"(?.*?)"
1173. => GET => http://{{server}}/api/test/list/append?_id={{id1}}&_field=tag&_value=a => "tag":\["a"\]
1174. => GET => http://{{server}}/api/test/list/append?_id={{id1}}&_field=tag&_value=a,b,c => "tag":\["a","b","c"\]
1175. => GET => http://{{server}}/api/test/list/remove?_id={{id1}}&_field=tag&_value=a => "tag":\["b","c"\]
1176. => GET => http://{{server}}/api/test/list/remove?_id={{id1}}&_field=tag&_value=a,b => "tag":\["c"\]
1177. => GET => http://{{server}}/api/test/list/clear?_id={{id1}}&_field=tag&_value=a,b => "tag":\[\]
1178. => POST => http://{{server}}/api/test/delete?_confirmstr=test => {} => success
1179.
1180. ############# Raiseing tickets for the app #############
1181. # This api will raise github tickts
1182. #
1183. ###########################################################
1184. => GET => http://{{server}}/api/utils/ticket?app_id=test => Error: Input validation failed: Missing app
1185. # TODO: FIX IT github expaired the token
1186. #=> GET => http://{{server}}/api/utils/ticket?app=test&title=Raise by e2e test&desc=ignore this bug&label=bug => Successfully created a tickets
1187. #=> POST => http://{{server}}/api/utils/ticket=> {"app":"test", "title":"Raise by e2e test", "desc":"ignore this bug", "label":"bug,test"} => Successfully created a tickets
1188.
1189. ######## Create or Get #######
1190. # If filter returns some result - just get it back or create with _payload + _filter data
1191. ###############################
1192. => POST => http://{{server}}/api/test/delete?_confirmstr=test => {} => success
1193. => POST => http://{{server}}/api/test/create_or_get => {"_filter":{"name":"dip"}, "_payload":{"roll":100}} => inserted the entry
1194. => POST => http://{{server}}/api/test/create_or_get => {"_filter":{"name":"dip"}, "_payload":{"roll":100}} => found entry
1195. => POST => http://{{server}}/api/test/create_or_get => {"_filter":{"name":"dip"}, "_payload":{"roll":100}} => found entry
1196.
1197. ############ Simple Login/AUth #################################################
1198. ## SImpel password based login.
1199. ## Support only login from obe devices.
1200. ## Hash password got stored
1201. ## Once you log successfully , it will return auth_token_
1202. #################################################################################
1203.
1204. # first clean the DB
1205. => POST => http://localhost/api/simple_auth/delete?_confirmstr=simple_auth => {} => success
1206. => GET => http://localhost/api/_auth_token/delete?_root_user=1&_confirmstr=_auth_token => success # This will clean the token DB -> Note that it must be a root_user
1207.
1208. # Dfine two users: test and test1
1209. => GET => http://{{server}}/api/simple_auth/register?username=test&password_=test&email=dutta.dipankar08@gmail.com => registration success
1210. => GET => http://{{server}}/api/simple_auth/register?username=test1&password_=test1&email=dutta.dipankar08@gmail.com => registration success
1211. => GET => http://{{server}}/api/simple_auth/register?username=test&password_=test&email=dutta.dipankar08@gmail.com => Duplicate item found: username
1212. => GET => http://{{server}}/api/simple_auth/login?username=test&password_=test11 => Invalid username or password
1213. => GET => http://{{server}}/api/simple_auth/login?username=test11&password_=test => Invalid username or password
1214.
1215.
1216. # login and get login_token1
1217. => GET => http://localhost/api/simple_auth/login?_no_encode=1&username=test&password_=test => "auth_token_":"(?.*?)"
1218. => GET => http://{{server}}/api/simple_auth/login?_no_encode=1&username=test&auth_token_={{login_token1}} => dutta.dipankar08@gmail.com
1219. => GET => http://{{server}}/api/simple_auth/login_session?_no_encode=1&auth_token_={{login_token1}} => We found 1 active sessions
1220.
1221. # getifo
1222. => GET => http://{{server}}/api/simple_auth/get_info?_no_encode=1&auth_token_={{login_token1}} => user data returned
1223.
1224. # login agaun get token2
1225. => GET => http://{{server}}/api/simple_auth/login?_no_encode=1&username=test&password_=test => "auth_token_":"(?.*?)"
1226. => GET => http://{{server}}/api/simple_auth/login?_no_encode=1&username=test&auth_token_={{login_token2}} => dutta.dipankar08@gmail.com
1227.
1228. # try login with invalid tokens.
1229. => GET => http://{{server}}/api/simple_auth/login?username=test&auth_token_=wrong => Invalid username or auth_token_
1230. => GET => http://{{server}}/api/simple_auth/login?_no_encode=1&username=test2&auth_token_={{login_token2}} => Invalid username or auth_token_
1231.
1232. # logout with one token but other token should works.
1233. => GET => http://{{server}}/api/simple_auth/logout?username=test&auth_token_={{login_token1}} => Logout done
1234. => GET => http://{{server}}/api/simple_auth/logout?username=test&auth_token_={{login_token1}} => not able to logout as username or auth_token is wrong
1235. => GET => http://{{server}}/api/simple_auth/login?_no_encode=1&username=test&auth_token_={{login_token2}} => dutta.dipankar08@gmail.com
1236.
1237. # logout all session and no token should not work
1238. => GET => http://{{server}}/api/simple_auth/logout?username=test => Missing auth_token_
1239. => GET => http://{{server}}/api/simple_auth/logout_all?username=test => Missing auth_token_
1240. => GET => http://{{server}}/api/simple_auth/logout_all?username=test1&force=1 => Logout done for 0 session forcefully
1241. => GET => http://{{server}}/api/simple_auth/logout_all?username=test&force=1 => Logout done for 1 session forcefully
1242. => GET => http://{{server}}/api/simple_auth/login?username=test&auth_token_={{login_token2}} => Invalid username or auth_token_
1243.
1244.
1245. #### The bwlo example shows how we can make a DB is accexx protected and to access it it must be logged in ###
1246. => GET => http://{{server}}/api/test_simple_auth => Please send auth_token_
1247. => GET => http://{{server}}/api/test_simple_auth?auth_token_=test => Wrong auth_token_ passed
1248. => GET => http://{{server}}/api/simple_auth/login?_no_encode=1&username=test&password_=test => "auth_token_":"(?.*?)"
1249. => GET => http://{{server}}/api/simple_auth/login?_no_encode=1&username=test1&password_=test1 => "auth_token_":"(?.*?)"
1250. => GET => http://{{server}}/api/test_simple_auth?auth_token_={{login_token}} => Find successfully with 0 items
1251. => GET => http://{{server}}/api/test_simple_auth/create?_no_encode=1&auth_token_={{login_token}}&name=Dip => "_username":"test"
1252. => GET => http://{{server}}/api/test_simple_auth?auth_token_={{login_token}} => Find successfully with 1 items
1253. => GET => http://{{server}}/api/test_simple_auth/create?_no_encode=1&auth_token_={{login_token1}}&name=Dip => "_username":"test1"
1254. => GET => http://{{server}}/api/test_simple_auth/create?_no_encode=1&auth_token_={{login_token1}}&name=Dip => "_username":"test1"
1255. => GET => http://{{server}}/api/test_simple_auth?auth_token_={{login_token1}} => Find successfully with 2 items ##
1256. => GET => http://{{server}}/api/test_simple_auth?auth_token_=skip => Find successfully with 3 items ####
1257. => GET => http://{{server}}/api/test_simple_auth/delete?auth_token_={{login_token}}&_confirmstr=test_simple_auth => Deleted count is : 1
1258. => GET => http://{{server}}/api/test_simple_auth/delete?auth_token_=skip&_confirmstr=test_simple_auth => Deleted count is : 2
1259.
1260. ## Forget and reset password
1261. => GET => http://{{server}}/api/simple_auth/forgot_password => Missing username
1262. => GET => http://{{server}}/api/simple_auth/forgot_password?username=wrong => Invalid username
1263. => GET => http://{{server}}/api/simple_auth/forgot_password?_no_encode=1&username=test => "short_lived_token":"(?.*?)"
1264. => GET => http://{{server}}/api/simple_auth/reset_password?username=test => Missing short_lived_token
1265. => GET => http://{{server}}/api/simple_auth/reset_password?username=test&short_lived_token=wrong => Missing password_
1266. => GET => http://{{server}}/api/simple_auth/reset_password?username=wrong&short_lived_token={{short_lived_token}} => Missing password_
1267. => GET => http://{{server}}/api/simple_auth/reset_password?username=wrong&short_lived_token=wrong&password_=hello => Invalid username or token got expired
1268. => GET => http://{{server}}/api/simple_auth/reset_password?username=test_unknown&short_lived_token={{short_lived_token}}&password_=test5 => Invalid username or token got expired
1269. => GET => http://{{server}}/api/simple_auth/reset_password?username=test&short_lived_token={{short_lived_token}}&password_=test5 => Password changed successfully
1270. => GET => http://{{server}}/api/simple_auth/reset_password?username=test&short_lived_token={{short_lived_token}}&password_=test5 => Invalid username or token got expired
1271.
1272. # You can pass auth_token_ as a header or cookies
1273. # curl -H "auth_token_:skip" -X GET "http://localhost/api/test_simple_auth"
1274. # curl http://localhost/api/test_simple_auth--cookie "auth_token_=skip"
1275.
1276.
1277. # add_subscription_by_stipe
1278. => GET => http://{{server}}/api/simple_auth/login?_no_encode=1&username=test&password_=test5 => "auth_token_":"(?.*?)"
1279. => GET => http://localhost/api/simple_auth/add_subscription?_no_encode=1&payment_method_id=pm_1MQHD9CtA5cdHPVpgX6YpXRY&subscription_key=test&auth_token_={{login_token1}}&subscription_provider=dummy => subscription success
1280. => GET => http://localhost/api/simple_auth/add_subscription?_no_encode=1&payment_method_id=pm_1MQHD9CtA5cdHPVpgX6YpXRY&subscription_key=test&auth_token_={{login_token1}}&subscription_provider=dummy => subscription success
1281.
1282. # duplicate subscription
1283. => GET => http://localhost/api/simple_auth/add_subscription?_no_encode=1&payment_method_id=pm_1MQHD9CtA5cdHPVpgX6YpXRY&subscription_key=test&auth_token_={{login_token1}}&subscription_provider=dummy => subscription success
1284.
1285. crack_life_in_the_uk
1286. # clear subscription
1287. => GET => http://localhost/api/simple_auth/clear_subscription?_no_encode=1&subscription_key=test&auth_token_={{login_token1}}&subscription_provider=dummy => subscription clear
1288.
1289.
1290. => GET => http://localhost/api/simple_auth/clear_subscription?_no_encode=1&subscription_key=test&auth_token_={{login_token1}}&subscription_provider=dummy => not able to find the subscription
1291.
1292.
1293. # For testng this you need to generate the payment_method_id first with public dat
1294. #=> GET => http://localhost/api/simple_auth/add_subscription?_no_encode=1&payment_method_id=pm_1MQHY0CtA5cdHPVpZpglF5a7&subscription_key=test&auth_token_={{login_token1}}&&subscription_provider=stripe => recept_url":"https://pay.stripe.com/receipts/payment
1295.
1296. # Google Login
1297. => POST => http://localhost/api/simple_auth/google_login => {"iss": "https://accounts.google.com","email": "test3@gmail.com", "name": "DIPANKAR DUTTA","picture": "https://lh3.googleusercontent.com/a/AEdFTp68hUhkoSvDnP6rAuuDqZwMVU4A5ULh6OoMogKdog=s96-c"} => Login success
1298.
1299. #########################################################################################
1300. ## ##
1301. ## IPTV APIS ##
1302. ## ##
1303. #########################################################################################
1304. => POST => http://{{server}}/api/ip_tv/delete?_confirmstr=ip_tv => {} => success
1305. => POST => http://{{server}}/api/ip_tv/add_seed => {"seed_url":"https://raw.githubusercontent.com/143maha/Sonuiptvnew/main/Indian15sep.m3u8", "name":"143maha"} => We have parsed seed
1306. => GET => http://{{server}}/api/ip_tv?_limit=1 => "_id":"(?.*?)"
1307. => GET => http://{{server}}/api/ip_tv/?id={{id1}} => "rank":
1308. => GET => http://{{server}}/api/ip_tv/rankup?id={{id1}}&_field=rank => Up voted
1309. => GET => http://{{server}}/api/ip_tv/?id={{id1}} => "rank":
1310. => GET => http://{{server}}/api/ip_tv/rankdown?id={{id1}}&_field=rank => Down voted
1311. => GET => http://{{server}}/api/ip_tv/?id={{id1}} => "rank":
1312. => GET => http://{{server}}/api/ip_tv/count => success
1313. # => GET => http://{{server}}/api/ip_tv/cleanup => clean up done by removing
1314.
1315. #########################################################################################
1316. ## ##
1317. ## TRADE APIS ##
1318. ## ##
1319. #########################################################################################
1320. # We have tested the api but disabling it=> POST => http://{{server}}/api/utils/trade/expert_call_result => {"symbol":"TCS.NS","target":"3600","stoploss":"3370","start_date":"2023-02-24T10:10:17.617Z","end_date":"2023-02-26T10:10:17.617Z"} => RESULT
1321. => GET => http://{{server}}/api/utils/trade/ltp => TCS.NS
1322. => GET => http://{{server}}/api/utils/trade/ltp?symbols=TCS.NS,WIPRO.NS => TCS.NS
1323. # Supported Index is WORLD_INDEX and INDIA_INDEX
1324. => GET => http://{{server}}/api/utils/trade/ltp?group=WORLD_INDEX=> NASDAQ
1325. => GET => http://{{server}}/api/utils/trade/ltp?group=INDIA_INDEX=> NSEI
1326. => POST => http://{{server}}/api/utils/trade/expert_result_intraday => {"date":"2023-03-16T10:10:17.617Z", "symbol":"TCS.NS","buy_at":"3630","stoploss":"3590", "target":"3645","target2":"3665"} => success
1327. => POST => http://{{server}}/api/utils/trade/expert_result_intraday => {"date":"2023-03-16T10:10:17.617Z", "symbol":"TCS.NS","buy_at":"3630","stoploss":"3590", "target":"3645","target2":"3670"} => success
1328. => POST => http://{{server}}/api/utils/trade/expert_result_intraday => {"date":"2023-03-16T10:10:17.617Z", "symbol":"TCS.NS","buy_at":"3630","stoploss":"3620", "target":"3645","target2":"3695"} => success
1329. => POST => http://{{server}}/api/utils/trade/expert_result_intraday => {"date":"2023-03-16T10:10:17.617Z", "symbol":"TCS.NS","buy_at":"3630","stoploss":"3590", "target":"4000","target2":"4000"} => success
1330. => POST => http://{{server}}/api/utils/trade/expert_result_intraday => {"date":"2023-03-16T10:10:17.617Z", "symbol":"TCS.NS","buy_at":"3700","stoploss":"3590", "target":"3645","target2":"3695"} => success
1331. => POST => http://{{server}}/api/utils/trade/expert_result_intraday => {"date":"2023-03-16T10:10:17.617Z", "symbol":"TCS.NS","buy_at":"3598","stoploss":"3590", "target":"3645","target2":"3695"} => success
1332.
1333.
1334. #########################################################################################
1335. ## ##
1336. ## Youtube uploader ##
1337. ## ##
1338. ## FOR AUTH ISSUE: generate toekn: node bin/core/google/youtube.js ##
1339. #########################################################################################
1340.
1341. => GET => http://localhost/api/utils/yupload/m3u8upload => error
1342.
1343. => GET => http://localhost/api/utils/yupload/m3u8upload?uri=https://stream.live.vc.bbcmedia.co.uk/bbc_hindi_radio&duration=300 =>Please send a key
1344.
1345.
1346. #########################################################################################
1347. ## ##
1348. ## Error ##
1349. ## ##
1350. ## FOR AUTH ISSUE: generate toekn: node bin/core/google/youtube.js ##
1351. #########################################################################################
1352. => POST => http://{{server}}/api/error/delete?_confirmstr=error => {} => success
1353. => GET => http://localhost/api/error/test => Test Error
1354. => GET => http://localhost/api/error => Test Error
1355.
1356. #########################################################################################
1357. ## ##
1358. ## INFO ##
1359. ## ##
1360. ## GET API INFO ##
1361. #########################################################################################
1362. => GET => http://localhost/api/local_test/info => "isRemoteDB":false
1363. => GET => http://localhost/api/remote_test/info => "isRemoteDB":true
1364. # curl http://localhost/api/test/info --cookie "Cho=Kim;Greet=Hello"
1365. => GET => http://localhost/api/test/info => "isRemoteDB":false
1366. => GET => http://localhost/api/test_secure/info => "secure":false
1367. => GET => http://localhost/api/test_secure/ => success
1368. => GET => http://localhost/api/test_secure_/info => "secure":true # Note that You must have secure_ to pass the match
1369. => GET => http://localhost/api/test_secure_/ => Please send auth_token_
1370. => GET => http://localhost/api/test/info => "secure":false
1371.
1372.
1373. #########################################################################################
1374. ## ##
1375. ## STRIPE ##
1376. ## ##
1377. ## STRIPE validation api's helps to validate any purchase via simplestore ##
1378. #########################################################################################
1379. # ( need real setup )=> GET => http://localhost/api/stripe/check_subscription?customer_id=cus_Melrh5VwxSJB2v => "email":"dutta.dipankar08@gmail.com"
1380. => GET => http://localhost/api/stripe/check_payment?payment_id=unknwon => No such payment_intent
1381. # ( not real setup)=> GET => http://localhost/api/stripe/check_payment?payment_id=pi_3LvRVnCtA5cdHPVp0DrsawEx => "amount_captured":500
1382.
1383. #########################################################################################
1384. ## ##
1385. ## TEST Encript and dryption API output ##
1386. ## ##
1387. ## STRIPE validation api's helps to validate any purchase via simplestore ##
1388. #########################################################################################
1389. => GET => http://localhost/api/test_crypto/delete?_confirmstr=test_crypto => success
1390. => GET => http://localhost/api/test_crypto/insert?name=dip => insert successfully
1391. => GET => http://localhost/api/test_crypto => Find successfully
1392. => GET => http://localhost/api/test_crypto/count => success
1393. => GET => http://localhost/api/test_crypto/delete?_confirmstr=test_crypto => success
1394.
1395.
1396. ## Root users
1397. => GET => http://localhost/api/_auth_token/ => access db with db name with _
1398. => GET => http://localhost/api/_auth_token?_root_user=1 => success
1399.
1400. #########################################################################################
1401. ## test unset or delete fields
1402. ## This API allow you to delete a list of fileds ( just unset in the docs)
1403. ## How to unsert a field?
1404. ## How to unset multiple fields?
1405. ## how to unset fileds with nested documnets ? use dot notation.
1406. ## How to unset fields for all entrys by seraching? query + _field combination
1407. #########################################################################################
1408. => GET => http://localhost/api/test/delete?_confirmstr=test =>success
1409. => GET => http://localhost/api/test/insert?name=dip&roll=20&email=hello@hello.com => "_id":"(?.*?)"
1410. => GET => http://localhost/api/test/get?_id={{id1}} => "roll":"20"
1411. => GET => http://localhost/api/test/delete_fields?_id={{id1}}&_field=roll => We have un-set the filed for 1 entries
1412. => GET => http://localhost/api/test/get?_id={{id1}} => "name":"dip","email":"hello@hello.com",
1413.
1414. # unsetting nested object
1415. => POST => http://localhost/api/test/insert => {"name":{"first":"dip", "last":"dutta"}} => "_id":"(?.*?)"
1416. => GET => http://localhost/api/test/delete_fields?_id={{id1}}&_field=name.last => un-set the filed for 1 entries
1417. => GET => http://localhost/api/test/get?_id={{id1}} => "name":\{"first":"dip"\}
1418.
1419.
1420.
1421. #########################################################################################
1422. # File utilitiesv
1423. # This api define upload, download, delete and list files in the SimpleStore application
1424. # This is for the prototype purpose. Please don't use for scale
1425. # All test is passing - disabled for new file is missing
1426. #########################################################################################
1427. # curl -d @a.txt http://localhost/api/utils/files/upload use this for upload
1428. #=> GET => http://localhost/api/utils/files/download?filename=a.txt => Dipankar
1429. #=> GET => http://localhost/api/utils/files/list => a.txt
1430. #=> GET => http://localhost/api/utils/files/delete?filename=a.txt => success
1431. #=> GET => http://localhost/api/utils/files/delete?filename=a.txt => error
1432.
1433.
1434. #########################################################################################
1435. # remote_smb_manifest
1436. # This API will build the necessaryly function to support SMB.
1437. # Like Enable payment gateway
1438. #########################################################################################
1439. # [PASS ALL] (1) Test razorpay_create_order APIs
1440. => GET => http://localhost/api/remote_smb_manifest/delete?_confirmstr=remote_smb_manifest => success
1441. => POST => http://localhost/api/remote_smb_manifest/insert => {"public_keys":{"razor_key":"1"},"secret_keys_":{"razor_secret":"1"}} => "_id":"(?.*?)"
1442. => POST => http://localhost/api/remote_smb_manifest/razorpay_create_order => {"_no_encode":1, "amount":500, "currency":"INR", "smb_id":"{{id1}}"} => The api key provided is invalid
1443. => POST => http://localhost/api/remote_smb_manifest/razorpay_create_order => {"_no_encode":1, "amount":500, "currency":"INR", "smb_id":"wrong"} => Argument passed in must be a single String of 12 bytes
1444. => POST => http://localhost/api/remote_smb_manifest/razorpay_create_order => {"_no_encode":1, "currency":"INR", "smb_id":"wrong"} => Missing amount
1445. => POST => http://localhost/api/remote_smb_manifest/insert => {"public_keys":{"razor_key":"rzp_test_I2VzFwGWMekWJe"},"secret_keys_":{"razor_secret":"4Hk97bepWLg7PS0Lli1rCXmx"}} => "_id":"(?.*?)"
1446. => POST => http://localhost/api/remote_smb_manifest/razorpay_create_order => {"_no_encode":1, "amount":500, "currency":"INR", "smb_id":"{{id1}}"} => "order_id":"order_
1447.
1448.
1449. ####################
1450. ## Market APIs: As we wants to get the live market data, we can use goofle api to do that
1451. ##
1452. ####################
1453.
1454. # => GET => http://localhost/api/utils/market/google_ltp?symbol=VUSA.L => Vanguard S
1455.
1456. ####
1457. # Supporting revison
1458. ####
1459. => GET => http://localhost/api/test/delete?_confirmstr=test => success
1460. => GET => http://localhost/api/test/insert?name=dip => "_id":"(?.*?)"
1461. => POST => http://localhost/api/test/update_one => {"_id":"{{id1}}","_revision":true} => You must pass some data in the request
1462. => POST => http://localhost/api/test/update_one => {"_id":"{{id1}}","name":"dip1","_revision":true} => "dip1"
1463. => POST => http://localhost/api/test/update_one => {"_id":"{{id1}}","name":"dip2","_revision":true} => "dip2"
1464. => GET => http://localhost/api/test/revision?_id={{id1}} => All History\(revision\) returned
1465.
1466. ###
1467. # You need to mark remote_db to store in remote database
1468. ##
1469. => GET => https://simplestore.dipankar.co.in/api/remote_db_secure_merit/info => "isRemoteDB":true
1470. => GET => https://simplestore.dipankar.co.in/api/nodel_remote_db_secure_merit/info => "isRemoteDB":true
1471. => GET => https://simplestore.dipankar.co.in/api/nodel_secure_merit_remote_db/info => "isRemoteDB":true
1472. => GET => https://simplestore.dipankar.co.in/api/nodel_secure_merit_remoooote_db/info => "isRemoteDB":false
1473.
1474.
1475. #############################################
1476. # Test kill swicth - It provides way to set config which is globally store
1477. # this will help to switch code path based on remote coffi
1478. # This can be used for shipping experimeing features
1479. #############################################
1480. => GET => http://localhost/api/kill_switch/delete?_confirmstr=kill_switch => success
1481. => GET => http://localhost/api/kill_switch/set_bool?key=a&value=1 => "a":true
1482. => GET => http://localhost/api/kill_switch/set_bool?key=b&value=0 => "b":false
1483. => GET => http://localhost/api/kill_switch/set_bool?key=c&value=true => "c":true
1484. => GET => http://localhost/api/kill_switch/set_string?key=d&value=hello => "d":"hello"
1485. => GET => http://localhost/api/kill_switch/set_string?key=d&value=hello1 => "d":"hello1"
1486. => GET => http://localhost/api/kill_switch/get_current => "d":"hello1"
1487. => GET => http://localhost/api/kill_switch/reload => 4
1488.
1489.
1490. #############################################
1491. # Template store
1492. # this feature allow to create template in the tempalte store ( store in remote db)
1493. # and the you create_from_template api to create duplicate data from template
1494. #############################################
1495. => GET => http://localhost/api/template_store/delete?_confirmstr=template_store => success
1496. => POST => http://localhost/api/template_store/create => {"name":"dipankar", "roll":100} => template_name must be present as composite key
1497. => POST => http://localhost/api/template_store/create => {"name":"dipankar", "roll":100, "template_name":"test"} => success
1498. => POST => http://localhost/api/template_store/create => {"name":"dipankar", "roll":100, "template_name":"test"} => Duplicate item found: template_name
1499. # here how to create clone from templates
1500. => POST => http://localhost/api/test/create_from_template => {"template_name":"test", "more_info":"extra data"} => "name":"dipankar","roll":100
1501. => POST => http://localhost/api/test/create_from_template => {"template_name":"test1", "more_info":"extra data"} => template not found
1502.
1503.
1504.
1505. ################ SCHEULE 2 API ######################
1506. # Schedule2 allows you to schele HTTP cron job - this is the next version of schedule
1507. # a) insert an entry
1508. # b) activate it uisng /activate.
1509. # c) check the status = /status
1510. #####################################################
1511. => POST => http://localhost/api/schedule2/delete?_confirmstr=schedule2 => {} => success
1512. => POST => http://{{server}}/api/schedule2/insert => {"method":"get", "url":"https://google.com","cron_format":"*/10 * * * * *"} => "_id":"(?.*?)" # Just insert not activated
1513. => POST => http://{{server}}/api/schedule2/insert => {"method":"get", "url":"https://google.com","cron_format":"*/10 * * * * *"} => Duplicate item found
1514. => POST => http://{{server}}/api/schedule2/activate?id={{job_id}} => {} => Job is now scheduled
1515. => POST => http://{{server}}/api/schedule2/activate?id={{job_id}} => {} => is already scheduled
1516. => GET => http://{{server}}/api/schedule2/status => We have 1 jobs
1517. => GET => http://{{server}}/api/schedule2/reload => We have restarted 1 jobs
1518. => sleep => 12
1519. => GET => http://{{server}}/api/schedule2/?id={{job_id}} => doctype html # we are cjeking if the job got executed or not!
1520. => POST => http://{{server}}/api/schedule2/deactivate?id={{job_id}} => {} => canceled
1521. => POST => http://{{server}}/api/schedule2/deactivate?id={{job_id}} => {} => is not scheduled
1522. => GET => http://{{server}}/api/schedule2/status => We have 0 jobs
1523.
1524. # test post api call.
1525. => POST => http://{{server}}/api/schedule2/insert => {"method":"post", "url":"http://localhost/api/test/insert","cron_format":"*/10 * * * * *","data":{"name":"dip432"}} => "_id":"(?.*?)"
1526. => GET => http://{{server}}/api/schedule2/activate?id={{job_id2}} => Job is now scheduled
1527. => sleep => 12 # will execute in 12 sec
1528. => GET => http://{{server}}/api/schedule2/?id={{job_id2}} => insert successfully
1529. #=> POST => http://{{server}}/api/schedule2/deactivate?id={{job_id2}} => {} => canceled
1530.
1531. # Stop everything
1532. => POST => http://localhost/api/schedule2/delete?_confirmstr=schedule2 => {} => success
1533. => GET => http://localhost/api/schedule2/reload => We have restarted 0 jobs
1534.
1535. # check reload on boot
1536. => POST => http://{{server}}/api/schedule2/insert => {"method":"get", "url":"https://google.com","cron_format":"*/60 * * * * *"} => "_id":"(?.*?)" # Just insert not activated
1537. => POST => http://{{server}}/api/schedule2/activate?id={{job_id}} => {} => Job is now scheduled
1538. # now restart.
1539. => GET => http://localhost/api/schedule2/status => We have 1 jobs
1540.
1541. #check timezoe support
1542. => POST => http://{{server}}/api/schedule2/insert => {"method":"get", "url":"https://google.com/test1","cron_format":"*/60 * * * * *", "time_zone":"invalid"} => "_id":"(?.*?)" # Just insert not activated
1543. => POST => http://{{server}}/api/schedule2/activate?id={{job_id}} => {} => Not a valid timezone:invalid
1544.
1545. => POST => http://{{server}}/api/schedule2/insert => {"method":"get", "url":"https://google.com/test2","cron_format":"*/60 * * * * *", "time_zone":"Europe/London"} => "_id":"(?.*?)" # Just insert not activated
1546. => POST => http://{{server}}/api/schedule2/activate?id={{job_id}} => {} => Job is now scheduled
1547.
1548.
1549. ################ Test Webhooks######################
1550. # Webhoks allowsto add endpoint when some db data is getting updated
1551. #####################################################
1552. => GET => http://localhost/api/webhook/status_clear => {"CALl_COUNT":0}
1553. => POST => http://localhost/api/webhook/insert => {"db_name":"test_webhook", "hook_url":"https://google.com"} => success
1554. => POST => http://localhost/api/test_webhook/insert => {"name":"Dipankar"} => success
1555. => GET => http://localhost/api/webhook/status => {"CALl_COUNT":1}
1556.
1557.
1558.
1559. ################ SECURE DB and Visibility Rules ######################
1560. # This allows to build secure DB protected by access_token.
1561. # 1. Secure DB contains the letter secure in it's name.
1562. # 2. When you define a db as secure you must pass a valid auth_token_ to create, insert. update.
1563. # 3. They are only visiuble to you and no others
1564. # 4. You can add other username as __visibility list to ensure they can be edited. But you still own that. add "public" to indicate they are public
1565. # 5. You can also create those db annonomously using spacial access token called "anonymous" - They are budefult make public visibility.
1566. # 6. Acess token "debug" can work for debug evn and skip all the secure rules
1567. #####################################################
1568.
1569. # Step1: Adding or remiving visibiity
1570. => GET => http://localhost/api/secure_test/insert?auth_token_=debug&name=hello => "_id":"(?.*?)"
1571. => GET => http://localhost/api/secure_test/visibility/add?_id1={{id1}}&auth_token_=debug => You must pass a _id or id
1572. => GET => http://localhost/api/test/visibility/add?_id={{id1}} => You can only make this action on secure db
1573. => GET => http://localhost/api/secure_test/visibility/add?_id={{id1}} => Missing auth_token_
1574. => GET => http://localhost/api/secure_test/visibility/add?_id={{id1}}&auth_token_=debug1 => Not logged in as Invalid auth_token_
1575. => GET => http://localhost/api/secure_test/visibility/add?_id={{id1}}&auth_token_=debug&username=user1 => Successfully added
1576. => GET => http://localhost/api/secure_test/?auth_token_=debug&_id={{id1}} => "_visibility":\["user1"\]
1577. => GET => http://localhost/api/secure_test/visibility/add?_id={{id1}}&auth_token_=debug&username=user1 => Not updated
1578. => GET => http://localhost/api/secure_test/visibility/add?_id={{id1}}&auth_token_=debug&username=user2 => Successfully added
1579.
1580. => GET => http://localhost/api/secure_test/visibility/remove?_id={{id1}}&auth_token_=debug&username=user1 => Successfully removed
1581. => GET => http://localhost/api/secure_test/visibility/remove?_id={{id1}}&auth_token_=debug&username=user1 => Not updated
1582. => GET => http://localhost/api/secure_test/visibility/remove?_id={{id1}}&auth_token_=debug&username=user2 => Successfully removed
1583. => GET => http://localhost/api/secure_test/?auth_token_=debug&_id={{id1}} => "_visibility":\[\]
1584. => GET => http://localhost/api/secure_test/visibility/add?_id={{id1}}&auth_token_=debug&username=user1 => Successfully added
1585. => GET => http://localhost/api/secure_test/visibility/clear?_id={{id1}}&auth_token_=debug => Successfully
1586. => GET => http://localhost/api/secure_test/?auth_token_=debug&_id={{id1}} => "_visibility":\[\]
1587.
1588.
1589.
1590. # Step 2: test secure access via visibility
1591. # In this case I will login as user1 and then create entry and add visibility for user2 and then try to access from user 2
1592.
1593. # first clean the DB
1594. => POST => http://localhost/api/simple_auth/delete?_confirmstr=simple_auth => {} => success
1595. => GET => http://localhost/api/_auth_token/delete?_root_user=1&_confirmstr=_auth_token => success # This will clean the token DB -> Note that it must be a root_user
1596.
1597. # Register user
1598. => GET => http://{{server}}/api/simple_auth/register?username=user1&password_=user1&email=dutta.dipankar08@gmail.com => registration success
1599. => GET => http://{{server}}/api/simple_auth/register?username=user2&password_=user2&email=dutta.dipankar08@gmail.com => registration success
1600. # login user
1601. => GET => http://{{server}}/api/simple_auth/login?_no_encode=1&username=user1&password_=user1 => "auth_token_":"(?.*?)"
1602. => GET => http://{{server}}/api/simple_auth/login?_no_encode=1&username=user2&password_=user2 => "auth_token_":"(?.*?)"
1603. # Create an ietm by user1 and add visibility to user 2
1604. => GET => http://localhost/api/secure_test/insert?auth_token_={{login_token1}}&name=share with user2 => "_id":"(?.*?)"
1605. => GET => http://localhost/api/secure_test/get?auth_token_={{login_token2}}&_id={{id1}} => Find successfully with 0 items
1606. => GET => http://localhost/api/secure_test/visibility/add?_id={{id1}}&auth_token_={{login_token1}}&username=user2 => Successfully added
1607. # Access by user 2
1608. => GET => http://localhost/api/secure_test/get?auth_token_={{login_token2}}&_id={{id1}} => share with user2
1609. #Revoke access
1610. => GET => http://localhost/api/secure_test/visibility/remove?_id={{id1}}&auth_token_={{login_token1}}&username=user2 => Successfully removed
1611. => GET => http://localhost/api/secure_test/get?auth_token_={{login_token2}}&_id={{id1}} => Find successfully with 0 items
1612.
1613. # Update Visibility in a go using /replace
1614. => GET => http://localhost/api/secure_test/visibility/replace?_id={{id1}}&auth_token_={{login_token1}}&username=user1,user2,user3 => Successfully replaced with 3
1615. => GET => http://localhost/api/secure_test/visibility/replace?_id={{id1}}&auth_token_={{login_token1}}&username=user1,user2,user3 ,user4 => Successfully replaced with 4
1616. => GET => http://localhost/api/secure_test/visibility/replace?_id={{id1}}&auth_token_={{login_token1}}&username=user1 => Successfully replaced with 1
1617. => POST => http://localhost/api/secure_test/visibility/replace => {"_id":"{{id1}}","auth_token_":"{{login_token1}}","username":["user1"]} => Successfully replaced with 1
1618. # In the below case, you need use clear API to replace
1619. => POST => http://localhost/api/secure_test/visibility/replace => {"_id":"{{id1}}","auth_token_":"{{login_token1}}","username":[]} => you must pass username
1620.
1621.
1622. # Testing anonymous entries.
1623. => GET => http://localhost/api/secure_test/insert?auth_token_=anonymous&name=test_anonymous => "_id":"(?.*?)"
1624. => GET => http://localhost/api/secure_test?id={{id3}} => Please send auth_token_
1625. => GET => http://localhost/api/secure_test?id={{id3}}&auth_token_=anonymous => "_visibility":\["public"\]
1626. => GET => http://localhost/api/secure_test?id={{id3}}&auth_token_=test => Wrong auth_token_ passed # So you must pass valid access token or anonymous
1627. => GET => http://localhost/api/secure_test?id={{id3}}&auth_token_={{login_token1}} => "_visibility":\["public"\]
1628.
1629.
1630. ################ PDF GEN API ######################
1631. # This allow to a secure entry to other user
1632. #####################################################
1633. => GET => http://localhost/api/utils/pdf/letter?from=Dipankar\nDutta&to=dip&subject=hello&content=hello\nworld => company_name missing
1634. => GET => http://localhost/api/utils/pdf/letter?from=Dipankar\nDutta&to=dip&subject=hello&content=hello\nworld&company_name=hello&company_address=hello => /PDF /Text
1635.
1636.
1637. ################ HEARTBEAT API ######################
1638. # This allow to a secure entry to other user
1639. #####################################################
1640. => GET => http://localhost/api/utils/heartbeat/ping => please pass name
1641. => GET => http://localhost/api/utils/heartbeat/ping?name=test =>pong
1642. => GET => http://localhost/api/utils/heartbeat/status?name=test => status: active
1643. => GET => http://localhost/api/utils/heartbeat/ping?name=test&status=error =>pong
1644. => GET => http://localhost/api/utils/heartbeat/status?name=test => status: error
1645. => GET => http://localhost/api/utils/heartbeat/ping?name=test&status=error&last_error=error_stack =>pong
1646. => GET => http://localhost/api/utils/heartbeat/status?name=test => error_stack
1647. => GET => http://localhost/api/utils/heartbeat/status?name=test1 => status: not found
1648.
1649. # Test auto expaire ( must be pinnged in every 60 sec - we delete the entry in 120 sec)
1650. # This give two chnages to ensure your pingged in reached to the server
1651. => GET => http://localhost/api/utils/heartbeat/status?name=test => error_stack
1652. => sleep => 120
1653. => GET => http://localhost/api/utils/heartbeat/status?name=test => status: inactive
1654.
1655. ################ TUNNEL REQUEST ######################
1656. # This mecahnisn allows to execute a JSON request to 3p wesbite and allow to pass a custum function to process the output.
1657. #####################################################
1658. => GET => http://localhost/api/tunnel_request/delete?_confirmstr=tunnel_request =>success
1659. => POST => http://localhost/api/tunnel_request/add_tunnel => {"name":"test", "type":"get", "url":"https://market.tipranks.com/api/details/GetRealTimeQuotes", "process_fn" : "none"} => success
1660. => POST => http://localhost/api/tunnel_request/add_tunnel => {"name":"test", "type":"get", "url":"https://market.tipranks.com/api/details/GetRealTimeQuotes", "process_fn" : "none"} => Duplicate item found: name
1661.
1662. # Once we setup a tunnel, execute it using get or post
1663. => GET => http://localhost/api/tunnel_request/execute?name=test => Request failed with status code 404
1664. => GET => http://localhost/api/tunnel_request/execute?name=test&tickers=MSFT => Issue with processing function
1665.
1666. # thsi will override thr process fucntion to test purpose ( you can use both lamda and nameed function)
1667. => POST => http://localhost/api/tunnel_request/execute => {"name":"test","tickers":"MSFT","process_fn":"function(a){return a}"} => successfully executeed the process fiunction
1668.
1669. # DONT USE LAMDA FUNCTION for test as => can't eb used
1670. # curl -X POST -H "Content-Type: application/json" -d '{"name":"test","tickers":"MSFT","process_fn":"(a)=>a"}' 'http://localhost/api/tunnel_request/execute' should work but test will fail
1671. #=> POST => http://localhost/api/tunnel_request/execute => {"name":"test","tickers":"MSFT","process_fn":"(a)=>a"} => successfully executeed the process fiunction
1672.
1673. # You can add revision for that tunnel and latest revisition will be used
1674. => POST => http://localhost/api/tunnel_request/add_revision => {"name":"test", "type":"get", "url":"https://market.tipranks.com/api/details/GetRealTimeQuotes", "process_fn" : "function(a){return a[0].ticker}"} =>new revisions added
1675. => GET => http://localhost/api/tunnel_request/execute?name=test&tickers=MSFT => MSFT
1676.
1677. ################ Crash Report ######################
1678. # Thsi APi provides to report crashes from any app.
1679. #####################################################
1680. => GET => http://localhost/api/crash_log/delete?_confirmstr=crash_log =>success
1681. => POST => http://localhost/api/crash_log/report_crash => {"app_name":"test", "message":"hello","stack":"stack1"} => first_line_hash:-1e788fb6
1682. => POST => http://localhost/api/crash_log/report_crash => {"app_name":"test", "message":"hello","stack":"stack1 "} => first_line_hash:-1e788fb6
1683. => GET => http://localhost/api/crash_log => "total_count":2
1684.
1685. ################ System DB ######################
1686. # Simple store supports system db which load all SimpleStore Server realted remote config on DB start.
1687. # This will override any local config so that we can control the service remotely.
1688. # One of the example is the SERCURE_KEYS which could be reset remotely
1689. #####################################################
1690. => GET => http://localhost/api/internal_nodel_system_db/delete?_confirmstr=internal_nodel_system_db => The DB has marked as nodel
1691. => GET => http://localhost/api/utils/system_db/dump => system db dump
1692. # /update will add, update, delete all in a single api. for delete pass null
1693. => POST => http://localhost/api/utils/system_db/update => {"db_name":"SECURE_KEYS", "test_key1":"test_key_value1","test_key2":"test_key_value2"} => "test_key2":"test_key_value2"
1694. => POST => http://localhost/api/utils/system_db/update => {"db_name":"SECURE_KEYS", "test_key1":"test_key_value1","test_key2":"null"} => "test_key2":null
1695. => POST => http://localhost/api/utils/system_db/update => {"db_name":"SECURE_KEYS", "test_key1":"test_key_value1","test_key2":"test_key_value3"} => "test_key2":"test_key_value3"
1696. => GET => http://localhost/api/utils/system_db/dump => "test_key2":"test_key_value3"
1697.
1698. ######### SERVER INFO ######
1699. => GET => http://localhost/info => "secureKeys":"Un autorized"
1700. => GET => http://localhost/info?admin=1 => "secureKeys"
1701.
1702. ##############
1703. # Test for stock_alert
1704. #
1705. ############
1706. => GET => http://localhost/api/stock_alert/delete?_confirmstr=stock_alert => success
1707. => POST => http://localhost/api/stock_alert/create => {"email":"dutta.dipankar08@gmail.com"} => "_id":"(?.*?)"
1708. => POST => http://localhost/api/stock_alert/tags/add => {"id":"{{id1}}","_field":"symbol_list", "_value":"AAPL"} => "symbol_list":\["AAPL"\]
1709. => POST => http://localhost/api/stock_alert/tags/add => {"id":"{{id1}}","_field":"subscription_list", "_value":"NOTIFY_BEGIN_5,NOTIFY_END_5"} => "subscription_list":\["NOTIFY_BEGIN_5","NOTIFY_END_5"\]
1710. => POST => http://localhost/api/stock_alert => {"id":"{{id1}}"} => "email":"dutta.dipankar08@gmail.com"
1711. => GET => http://localhost/api/stock_alert/trigger?exchange=NASDAQ&event=NOTIFY_BEGIN_5 => 1 Event processed
1712.
1713.
1714. ###########
1715. # Expose reliability for admin acess
1716. ###########
1717. => GET => http://localhost/reliability/ => success
1718.
1719. ##### Admin DB ####
1720. => GET => http://localhost/api/admin_hello => Missing admin_token_
1721. => GET => http://localhost/api/test_admin => Missing admin_token_
1722. => GET => http://localhost/api/test_admin?admin_token_=admin_test => Find successfully
1723. => GET => http://localhost/api/test_admin?admin_token_=admin_test_token_invalid => Invalid admin_token_
1724. => GET => http://localhost/api/test_admin/insert?admin_token_=admin_test&name=test=> success
1725. => GET => http://localhost/api/test_admin/get?name=test=> Missing admin_token_
1726. => GET => http://localhost/api/test_admin/find?name=test=> Missing admin_token_
1727.
1728.
1729. # Get and Delete.
1730. => GET => http://localhost/api/test/insert?name=test => "_id":"(?.*?)"
1731. => GET => http://localhost/api/test/get_and_delete?id={{id1}} => success
1732. => GET => http://localhost/api/test/get_and_delete?id={{id1}} => error