@compassdigital/sdk.typescript 3.0.0-beta.13 → 3.0.0-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/README.md +10 -5
  2. package/gen.ts +13 -5
  3. package/lib/announcement.d.ts.map +1 -1
  4. package/lib/announcement.js +1 -0
  5. package/lib/announcement.js.map +1 -1
  6. package/lib/base.d.ts.map +1 -1
  7. package/lib/base.js.map +1 -1
  8. package/lib/brand.d.ts.map +1 -1
  9. package/lib/brand.js +1 -0
  10. package/lib/brand.js.map +1 -1
  11. package/lib/calendar.d.ts.map +1 -1
  12. package/lib/calendar.js +1 -0
  13. package/lib/calendar.js.map +1 -1
  14. package/lib/client/base.d.ts +157 -0
  15. package/lib/client/base.d.ts.map +1 -0
  16. package/lib/client/base.js +392 -0
  17. package/lib/client/base.js.map +1 -0
  18. package/lib/client/index.d.ts +1877 -0
  19. package/lib/client/index.d.ts.map +1 -0
  20. package/lib/client/index.js +2208 -0
  21. package/lib/client/index.js.map +1 -0
  22. package/lib/config.d.ts.map +1 -1
  23. package/lib/config.js +1 -0
  24. package/lib/config.js.map +1 -1
  25. package/lib/datalake.d.ts.map +1 -1
  26. package/lib/datalake.js +1 -0
  27. package/lib/datalake.js.map +1 -1
  28. package/lib/delivery.d.ts.map +1 -1
  29. package/lib/delivery.js +1 -0
  30. package/lib/delivery.js.map +1 -1
  31. package/lib/dh.d.ts.map +1 -1
  32. package/lib/dh.js +1 -0
  33. package/lib/dh.js.map +1 -1
  34. package/lib/email.d.ts.map +1 -1
  35. package/lib/email.js +1 -0
  36. package/lib/email.js.map +1 -1
  37. package/lib/file.d.ts.map +1 -1
  38. package/lib/file.js +1 -0
  39. package/lib/file.js.map +1 -1
  40. package/lib/index.d.ts +8 -19
  41. package/lib/index.d.ts.map +1 -1
  42. package/lib/index.js +11 -2
  43. package/lib/index.js.map +1 -1
  44. package/lib/interface/announcement.d.ts +76 -0
  45. package/lib/interface/announcement.d.ts.map +1 -0
  46. package/lib/interface/announcement.js +4 -0
  47. package/lib/interface/announcement.js.map +1 -0
  48. package/lib/interface/brand.d.ts +16 -0
  49. package/lib/interface/brand.d.ts.map +1 -0
  50. package/lib/interface/brand.js +4 -0
  51. package/lib/interface/brand.js.map +1 -0
  52. package/lib/interface/calendar.d.ts +85 -0
  53. package/lib/interface/calendar.d.ts.map +1 -0
  54. package/lib/interface/calendar.js +4 -0
  55. package/lib/interface/calendar.js.map +1 -0
  56. package/lib/interface/config.d.ts +68 -0
  57. package/lib/interface/config.d.ts.map +1 -0
  58. package/lib/interface/config.js +4 -0
  59. package/lib/interface/config.js.map +1 -0
  60. package/lib/interface/datalake.d.ts +19 -0
  61. package/lib/interface/datalake.d.ts.map +1 -0
  62. package/lib/interface/datalake.js +4 -0
  63. package/lib/interface/datalake.js.map +1 -0
  64. package/lib/interface/delivery.d.ts +34 -0
  65. package/lib/interface/delivery.d.ts.map +1 -0
  66. package/lib/interface/delivery.js +4 -0
  67. package/lib/interface/delivery.js.map +1 -0
  68. package/lib/interface/dh.d.ts +9 -0
  69. package/lib/interface/dh.d.ts.map +1 -0
  70. package/lib/interface/dh.js +4 -0
  71. package/lib/interface/dh.js.map +1 -0
  72. package/lib/interface/email.d.ts +5 -0
  73. package/lib/interface/email.d.ts.map +1 -0
  74. package/lib/interface/email.js +4 -0
  75. package/lib/interface/email.js.map +1 -0
  76. package/lib/interface/file.d.ts +17 -0
  77. package/lib/interface/file.d.ts.map +1 -0
  78. package/lib/interface/file.js +4 -0
  79. package/lib/interface/file.js.map +1 -0
  80. package/lib/interface/kds.d.ts +58 -0
  81. package/lib/interface/kds.d.ts.map +1 -0
  82. package/lib/interface/kds.js +4 -0
  83. package/lib/interface/kds.js.map +1 -0
  84. package/lib/interface/location.d.ts +747 -0
  85. package/lib/interface/location.d.ts.map +1 -0
  86. package/lib/interface/location.js +4 -0
  87. package/lib/interface/location.js.map +1 -0
  88. package/lib/interface/logger.d.ts +29 -0
  89. package/lib/interface/logger.d.ts.map +1 -0
  90. package/lib/interface/logger.js +4 -0
  91. package/lib/interface/logger.js.map +1 -0
  92. package/lib/interface/loyalty.d.ts +350 -0
  93. package/lib/interface/loyalty.d.ts.map +1 -0
  94. package/lib/interface/loyalty.js +4 -0
  95. package/lib/interface/loyalty.js.map +1 -0
  96. package/lib/interface/mealplan.d.ts +177 -0
  97. package/lib/interface/mealplan.d.ts.map +1 -0
  98. package/lib/interface/mealplan.js +4 -0
  99. package/lib/interface/mealplan.js.map +1 -0
  100. package/lib/interface/message.d.ts +38 -0
  101. package/lib/interface/message.d.ts.map +1 -0
  102. package/lib/interface/message.js +4 -0
  103. package/lib/interface/message.js.map +1 -0
  104. package/lib/interface/order.d.ts +303 -0
  105. package/lib/interface/order.d.ts.map +1 -0
  106. package/lib/interface/order.js +4 -0
  107. package/lib/interface/order.js.map +1 -0
  108. package/lib/interface/partner.d.ts +402 -0
  109. package/lib/interface/partner.d.ts.map +1 -0
  110. package/lib/interface/partner.js +4 -0
  111. package/lib/interface/partner.js.map +1 -0
  112. package/lib/interface/payment.d.ts +250 -0
  113. package/lib/interface/payment.d.ts.map +1 -0
  114. package/lib/interface/payment.js +4 -0
  115. package/lib/interface/payment.js.map +1 -0
  116. package/lib/interface/promo.d.ts +312 -0
  117. package/lib/interface/promo.d.ts.map +1 -0
  118. package/lib/interface/promo.js +4 -0
  119. package/lib/interface/promo.js.map +1 -0
  120. package/lib/interface/report.d.ts +376 -0
  121. package/lib/interface/report.d.ts.map +1 -0
  122. package/lib/interface/report.js +4 -0
  123. package/lib/interface/report.js.map +1 -0
  124. package/lib/interface/schedule.d.ts +95 -0
  125. package/lib/interface/schedule.d.ts.map +1 -0
  126. package/lib/interface/schedule.js +4 -0
  127. package/lib/interface/schedule.js.map +1 -0
  128. package/lib/interface/shoppingcart.d.ts +279 -0
  129. package/lib/interface/shoppingcart.d.ts.map +1 -0
  130. package/lib/interface/shoppingcart.js +4 -0
  131. package/lib/interface/shoppingcart.js.map +1 -0
  132. package/lib/interface/task.d.ts +171 -0
  133. package/lib/interface/task.d.ts.map +1 -0
  134. package/lib/interface/task.js +4 -0
  135. package/lib/interface/task.js.map +1 -0
  136. package/lib/interface/user.d.ts +359 -0
  137. package/lib/interface/user.d.ts.map +1 -0
  138. package/lib/interface/user.js +4 -0
  139. package/lib/interface/user.js.map +1 -0
  140. package/lib/interface/vote.d.ts +52 -0
  141. package/lib/interface/vote.d.ts.map +1 -0
  142. package/lib/interface/vote.js +4 -0
  143. package/lib/interface/vote.js.map +1 -0
  144. package/lib/kds.d.ts.map +1 -1
  145. package/lib/kds.js +1 -0
  146. package/lib/kds.js.map +1 -1
  147. package/lib/location.d.ts +4 -4
  148. package/lib/location.d.ts.map +1 -1
  149. package/lib/location.js +1 -0
  150. package/lib/location.js.map +1 -1
  151. package/lib/logger.d.ts.map +1 -1
  152. package/lib/logger.js +1 -0
  153. package/lib/logger.js.map +1 -1
  154. package/lib/loyalty.d.ts.map +1 -1
  155. package/lib/loyalty.js +1 -0
  156. package/lib/loyalty.js.map +1 -1
  157. package/lib/mealplan.d.ts.map +1 -1
  158. package/lib/mealplan.js +1 -0
  159. package/lib/mealplan.js.map +1 -1
  160. package/lib/message.d.ts.map +1 -1
  161. package/lib/message.js +1 -0
  162. package/lib/message.js.map +1 -1
  163. package/lib/order.d.ts.map +1 -1
  164. package/lib/order.js +1 -0
  165. package/lib/order.js.map +1 -1
  166. package/lib/partner.d.ts +13 -0
  167. package/lib/partner.d.ts.map +1 -1
  168. package/lib/partner.js +1 -0
  169. package/lib/partner.js.map +1 -1
  170. package/lib/payment.d.ts.map +1 -1
  171. package/lib/payment.js +1 -0
  172. package/lib/payment.js.map +1 -1
  173. package/lib/promo.d.ts.map +1 -1
  174. package/lib/promo.js +1 -0
  175. package/lib/promo.js.map +1 -1
  176. package/lib/report.d.ts.map +1 -1
  177. package/lib/report.js +1 -0
  178. package/lib/report.js.map +1 -1
  179. package/lib/schedule.d.ts.map +1 -1
  180. package/lib/schedule.js +1 -0
  181. package/lib/schedule.js.map +1 -1
  182. package/lib/shoppingcart.d.ts.map +1 -1
  183. package/lib/shoppingcart.js +1 -0
  184. package/lib/shoppingcart.js.map +1 -1
  185. package/lib/task.d.ts.map +1 -1
  186. package/lib/task.js +1 -0
  187. package/lib/task.js.map +1 -1
  188. package/lib/user.d.ts.map +1 -1
  189. package/lib/user.js +1 -0
  190. package/lib/user.js.map +1 -1
  191. package/lib/vote.d.ts.map +1 -1
  192. package/lib/vote.js +1 -0
  193. package/lib/vote.js.map +1 -1
  194. package/package.json +1 -1
  195. package/src/{index.ts → client/index.ts} +54 -24
  196. package/src/{announcement.ts → interface/announcement.ts} +2 -0
  197. package/src/{brand.ts → interface/brand.ts} +2 -0
  198. package/src/{calendar.ts → interface/calendar.ts} +2 -0
  199. package/src/{config.ts → interface/config.ts} +2 -0
  200. package/src/{datalake.ts → interface/datalake.ts} +2 -0
  201. package/src/{delivery.ts → interface/delivery.ts} +2 -0
  202. package/src/{dh.ts → interface/dh.ts} +2 -0
  203. package/src/{email.ts → interface/email.ts} +2 -0
  204. package/src/{file.ts → interface/file.ts} +2 -0
  205. package/src/{kds.ts → interface/kds.ts} +2 -0
  206. package/src/{location.ts → interface/location.ts} +2 -0
  207. package/src/{logger.ts → interface/logger.ts} +2 -0
  208. package/src/{loyalty.ts → interface/loyalty.ts} +2 -0
  209. package/src/{mealplan.ts → interface/mealplan.ts} +2 -0
  210. package/src/{message.ts → interface/message.ts} +2 -0
  211. package/src/{order.ts → interface/order.ts} +2 -0
  212. package/src/{partner.ts → interface/partner.ts} +25 -0
  213. package/src/{payment.ts → interface/payment.ts} +2 -0
  214. package/src/{promo.ts → interface/promo.ts} +2 -0
  215. package/src/{report.ts → interface/report.ts} +2 -0
  216. package/src/{schedule.ts → interface/schedule.ts} +2 -0
  217. package/src/{shoppingcart.ts → interface/shoppingcart.ts} +2 -0
  218. package/src/{task.ts → interface/task.ts} +2 -0
  219. package/src/{user.ts → interface/user.ts} +2 -0
  220. package/src/{vote.ts → interface/vote.ts} +2 -0
  221. package/test/client.test.ts +57 -73
  222. /package/src/{base.ts → client/base.ts} +0 -0
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  import {
2
4
  PostPaymentTransactionBody,
3
5
  PostPaymentTransactionResponse,
@@ -26,7 +28,7 @@ import {
26
28
  GetPaymentMethodsResponse,
27
29
  GetPaymentHpcQuery,
28
30
  GetPaymentHpcResponse,
29
- } from "./payment";
31
+ } from "../interface/payment";
30
32
 
31
33
  import {
32
34
  PostOrderQuery,
@@ -49,7 +51,7 @@ import {
49
51
  GetOrderLocationOrdersResponse,
50
52
  GetOrderGroupOrdersQuery,
51
53
  GetOrderGroupOrdersResponse,
52
- } from "./order";
54
+ } from "../interface/order";
53
55
 
54
56
  import {
55
57
  PostLocationBody,
@@ -146,7 +148,7 @@ import {
146
148
  GetLocationCompanyResponse,
147
149
  PatchLocationCompanyBody,
148
150
  PatchLocationCompanyResponse,
149
- } from "./location";
151
+ } from "../interface/location";
150
152
 
151
153
  import {
152
154
  PostShoppingcartCartBody,
@@ -171,16 +173,17 @@ import {
171
173
  PostShoppingcartCloneCartResponse,
172
174
  PostShoppingcartBulkBody,
173
175
  PostShoppingcartBulkResponse,
174
- } from "./shoppingcart";
176
+ } from "../interface/shoppingcart";
175
177
 
176
178
  import {
177
179
  PostPartnerStandardcognitionShoppingcartBody,
178
180
  PostPartnerStandardcognitionShoppingcartResponse,
179
181
  GetPartnerStandardcognitionLocationsResponse,
182
+ GetPartnerStandardcognitionStoresResponse,
180
183
  GetPartnerCoolrLocationsResponse,
181
184
  GetPartnerCoolrImagesResponse,
182
185
  GetPartnerSwaggerResponse,
183
- } from "./partner";
186
+ } from "../interface/partner";
184
187
 
185
188
  import {
186
189
  PostTaskBody,
@@ -199,7 +202,7 @@ import {
199
202
  GetTaskLocationBrandResponse,
200
203
  GetTaskLocationGroupQuery,
201
204
  GetTaskLocationGroupResponse,
202
- } from "./task";
205
+ } from "../interface/task";
203
206
 
204
207
  import {
205
208
  GetKdsDevicesQuery,
@@ -208,7 +211,7 @@ import {
208
211
  PostKdsDeviceAuthResponse,
209
212
  DeleteKdsDeviceAuthResponse,
210
213
  GetKdsSwaggerResponse,
211
- } from "./kds";
214
+ } from "../interface/kds";
212
215
 
213
216
  import {
214
217
  PostMealplanBody,
@@ -230,9 +233,13 @@ import {
230
233
  PutMealplanVerifyResponse,
231
234
  PostMealplanAuthorizeBody,
232
235
  PostMealplanAuthorizeResponse,
233
- } from "./mealplan";
236
+ } from "../interface/mealplan";
234
237
 
235
- import { PostDatalakeSqlBody, PostDatalakeSqlResponse, GetSwaggerResponse } from "./datalake";
238
+ import {
239
+ PostDatalakeSqlBody,
240
+ PostDatalakeSqlResponse,
241
+ GetSwaggerResponse,
242
+ } from "../interface/datalake";
236
243
 
237
244
  import {
238
245
  PostPromoBody,
@@ -265,9 +272,9 @@ import {
265
272
  PostPromoVoucherifyActivityExecuteBody,
266
273
  PostPromoVoucherifyActivityExecuteResponse,
267
274
  GetPromoVoucherifyActivityConfigResponse,
268
- } from "./promo";
275
+ } from "../interface/promo";
269
276
 
270
- import { PostDhSqlResponse } from "./dh";
277
+ import { PostDhSqlResponse } from "../interface/dh";
271
278
 
272
279
  import {
273
280
  GetConfigResponse,
@@ -282,7 +289,7 @@ import {
282
289
  PutConfigPublicBody,
283
290
  PutConfigPublicResponse,
284
291
  DeleteConfigPublicResponse,
285
- } from "./config";
292
+ } from "../interface/config";
286
293
 
287
294
  import {
288
295
  PostAnnouncementBody,
@@ -295,7 +302,7 @@ import {
295
302
  PutAnnouncementBody,
296
303
  PutAnnouncementResponse,
297
304
  DeleteAnnouncementResponse,
298
- } from "./announcement";
305
+ } from "../interface/announcement";
299
306
 
300
307
  import {
301
308
  GetReportAnalyticsGroupQuery,
@@ -323,7 +330,7 @@ import {
323
330
  DeleteReportDiscrepancySubscribersResponse,
324
331
  PostReportDiscrepancySubscribersBody,
325
332
  PostReportDiscrepancySubscribersResponse,
326
- } from "./report";
333
+ } from "../interface/report";
327
334
 
328
335
  import {
329
336
  GetUserAuthQuery,
@@ -378,7 +385,7 @@ import {
378
385
  PostUserSendEmailVerificationResponse,
379
386
  PutUserVerifyUserEmailBody,
380
387
  PutUserVerifyUserEmailResponse,
381
- } from "./user";
388
+ } from "../interface/user";
382
389
 
383
390
  import {
384
391
  PostLoyaltyEnrollQuery,
@@ -415,9 +422,9 @@ import {
415
422
  GetLoyaltyUsersResponse,
416
423
  GetLoyaltyEventsQuery,
417
424
  GetLoyaltyEventsResponse,
418
- } from "./loyalty";
425
+ } from "../interface/loyalty";
419
426
 
420
- import { GetBrandResponse, GetBrandsResponse } from "./brand";
427
+ import { GetBrandResponse, GetBrandsResponse } from "../interface/brand";
421
428
 
422
429
  import {
423
430
  GetCalendarResponse,
@@ -427,14 +434,14 @@ import {
427
434
  GetCalendarCdlResponse,
428
435
  GetCalendarSwaggerResponse,
429
436
  PostCalendarSyncResponse,
430
- } from "./calendar";
437
+ } from "../interface/calendar";
431
438
 
432
439
  import {
433
440
  PostDeliveryOrderBody,
434
441
  PostDeliveryOrderResponse,
435
442
  PatchDeliveryOrderResponse,
436
443
  GetDeliveryOrderResponse,
437
- } from "./delivery";
444
+ } from "../interface/delivery";
438
445
 
439
446
  import {
440
447
  PostScheduleBody,
@@ -445,15 +452,20 @@ import {
445
452
  PutScheduleBody,
446
453
  PutScheduleResponse,
447
454
  DeleteScheduleResponse,
448
- } from "./schedule";
455
+ } from "../interface/schedule";
449
456
 
450
- import { PostVoteBody, PostVoteResponse, GetVoteIdfaQuery, GetVoteIdfaResponse } from "./vote";
457
+ import {
458
+ PostVoteBody,
459
+ PostVoteResponse,
460
+ GetVoteIdfaQuery,
461
+ GetVoteIdfaResponse,
462
+ } from "../interface/vote";
451
463
 
452
- import { PostFileBody, PostFileResponse } from "./file";
464
+ import { PostFileBody, PostFileResponse } from "../interface/file";
453
465
 
454
- import { PostMessageBody, PostMessageResponse, GetMessageResponse } from "./message";
466
+ import { PostMessageBody, PostMessageResponse, GetMessageResponse } from "../interface/message";
455
467
 
456
- import { GetLoggerBrandStatusQuery, GetLoggerBrandStatusResponse } from "./logger";
468
+ import { GetLoggerBrandStatusQuery, GetLoggerBrandStatusResponse } from "../interface/logger";
457
469
 
458
470
  import { BaseServiceClient, RequestOptions, ResponsePromise } from "./base";
459
471
  export * from "./base";
@@ -2267,6 +2279,24 @@ export class ServiceClient extends BaseServiceClient {
2267
2279
  );
2268
2280
  }
2269
2281
 
2282
+ /**
2283
+ * GET /partner/standardcognition/stores - Gets the UUID for all the Standard Cognition external locations
2284
+ *
2285
+ * @param options - additional request options
2286
+ */
2287
+ get_partner_standardcognition_stores(
2288
+ options?: RequestOptions
2289
+ ): ResponsePromise<GetPartnerStandardcognitionStoresResponse> {
2290
+ return this.request(
2291
+ "partner",
2292
+ "get_partner_standardcognition_stores",
2293
+ "get",
2294
+ `/partner/standardcognition/stores`,
2295
+ null,
2296
+ options
2297
+ );
2298
+ }
2299
+
2270
2300
  /**
2271
2301
  * GET /partner/coolr/locations - Gets the locations where Coolr is available
2272
2302
  *
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  code?: number;
3
5
  message?: string;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Brand {
2
4
  // brand
3
5
  id?: string;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  message?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export type CreateConfig = any;
2
4
 
3
5
  export interface Config {
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  error?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  code?: number;
3
5
  message?: string;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  error?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  message?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  message?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  error?: string;
3
5
  message?: string;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface POS {
2
4
  // pos
3
5
  id?: string;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  error?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  message?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  code?: number;
3
5
  message?: string;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  message?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface CreateOrder {
2
4
  // brand
3
5
  location_brand?: string;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  message?: string;
3
5
  code?: number;
@@ -395,6 +397,23 @@ export type Hours = any;
395
397
 
396
398
  export type DeliveryHours = any;
397
399
 
400
+ export interface CognitionStore {
401
+ // UUID for external store
402
+ uuid?: string;
403
+ // Store name
404
+ name?: string;
405
+ // Full address
406
+ address?: string;
407
+ city?: string;
408
+ state?: string;
409
+ // Abbreviated address
410
+ street_address?: string;
411
+ // ISO code for currency
412
+ currency_code?: string;
413
+ latitude?: number;
414
+ longitude?: number;
415
+ }
416
+
398
417
  export interface CoolrLocations {
399
418
  // location
400
419
  id?: string;
@@ -438,6 +457,12 @@ export interface GetPartnerStandardcognitionLocationsResponse {
438
457
 
439
458
  export type GetPartnerStandardcognitionLocationsRequest = {};
440
459
 
460
+ // GET /partner/standardcognition/stores - Gets the UUID for all the Standard Cognition external locations
461
+
462
+ export type GetPartnerStandardcognitionStoresResponse = CognitionStore;
463
+
464
+ export type GetPartnerStandardcognitionStoresRequest = {};
465
+
441
466
  // GET /partner/coolr/locations - Gets the locations where Coolr is available
442
467
 
443
468
  export interface GetPartnerCoolrLocationsResponse {
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Transaction {
2
4
  success?: boolean;
3
5
  [index: string]: any;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  message?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Success {
2
4
  success?: boolean;
3
5
  }
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  message?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  message?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface location {
2
4
  // Location ID
3
5
  location_id: string;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  message?: string;
3
5
  code?: number;
@@ -1,3 +1,5 @@
1
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
2
+
1
3
  export interface Error {
2
4
  message?: string;
3
5
  code?: number;
@@ -1,92 +1,90 @@
1
1
 
2
- import { ServiceClient, ResponseData, ServiceError } from "../src";
3
- import { Task } from "../src/task";
2
+ import { ServiceClient, ResponseData, ServiceError, RequestData, InterceptFn } from "../src/client";
3
+ import { Task } from "../src/interface/task";
4
4
 
5
5
  describe("ServiceClient", () => {
6
6
 
7
- const empty: ResponseData = { ok: true, status: 200, body: "" };
7
+ function response(status: number, body?: any): ResponseData {
8
+ const res = { ok: status === 200, status: status, body: "" };
9
+ if (body) {
10
+ res.body = JSON.stringify(body);
11
+ }
12
+ return res;
13
+ }
14
+
15
+ function interceptor(status: number, body?: any): InterceptFn {
16
+ return (req: RequestData) => Promise.resolve(response(status, body));
17
+ }
8
18
 
9
19
  test("makes basic request", async () => {
10
20
  const fake: Task = { id: "some_id" };
11
- const api = new ServiceClient({
12
- intercept: async (req) => {
13
- expect(req.name).toBe("get_task");
14
- expect(req.service).toBe("task");
15
- expect(req.url).toBe("https://api.compassdigital.org/dev/task/some_id");
16
- return {
17
- ok: true,
18
- status: 200,
19
- body: JSON.stringify(fake)
20
- };
21
- },
22
- });
21
+ const intercept = jest.fn(interceptor(200, fake));
22
+ const api = new ServiceClient({ intercept });
23
23
  const task = await api.get_task("some_id");
24
24
  expect(task).toEqual(fake);
25
+ const req = intercept.mock.calls[0][0];
26
+ expect(req).toEqual({
27
+ name: "get_task",
28
+ service: "task",
29
+ url: "https://api.compassdigital.org/dev/task/some_id",
30
+ method: "get",
31
+ headers: {
32
+ "User-Agent": "CDL/ServiceClient",
33
+ },
34
+ })
25
35
  });
26
36
 
27
37
  test("token gets passed", async () => {
28
38
  const token = "this is a token";
29
- const api = new ServiceClient({
30
- intercept: async (req) => {
31
- expect(req.headers).toHaveProperty("Authorization", `Bearer ${token}`);
32
- return empty;
33
- },
34
- });
39
+ const intercept = jest.fn(interceptor(200));
40
+ const api = new ServiceClient({ intercept });
35
41
  await api.get_task("", { token });
42
+ const req = intercept.mock.calls[0][0];
43
+ expect(req.headers).toHaveProperty("Authorization", `Bearer ${token}`);
36
44
  });
37
45
 
38
46
  test("headers get merged", async () => {
47
+ const intercept = jest.fn(interceptor(200));
39
48
  const api = new ServiceClient({
49
+ intercept,
40
50
  headers: {
41
51
  "a": "a from constructor",
42
52
  "b": "b from constructor",
43
53
  },
44
- intercept: async (req) => {
45
- expect(req.headers).toEqual({
46
- "User-Agent": "CDL/ServiceClient",
47
- "a": "a from constructor",
48
- "b": "b from method",
49
- "c": "c from method",
50
- })
51
- return empty;
52
- }
53
54
  });
54
55
  await api.get_task("", {
55
56
  headers: {
56
57
  "b": "b from method",
57
58
  "c": "c from method",
58
59
  },
59
- })
60
+ });
61
+ const req = intercept.mock.calls[0][0];
62
+ expect(req.headers).toEqual({
63
+ "User-Agent": "CDL/ServiceClient",
64
+ "a": "a from constructor",
65
+ "b": "b from method",
66
+ "c": "c from method",
67
+ });
60
68
  });
61
69
 
62
70
  test("client retries on failure", async () => {
63
- let attempts = 0;
64
- const api = new ServiceClient({
65
- intercept: async (req) => {
66
- attempts++;
67
- if (attempts === 3) {
68
- return { ok: true, status: 200, body: "{}" };
69
- }
70
- return { ok: false, status: 500, body: "something went wrong"};
71
+ const intercept = jest.fn(async (req: RequestData) => {
72
+ if (intercept.mock.calls.length === 3) {
73
+ return response(200, "{}");
71
74
  }
75
+ return response(500, "something went wrong");
72
76
  });
77
+ const api = new ServiceClient({ intercept });
73
78
  const task = await api.get_task("", { retry: 2 });
79
+ expect(intercept.mock.calls.length).toBe(3);
74
80
  });
75
81
 
76
82
  test("client gives up after retry limit", async () => {
77
- let attempts = 0;
78
- const api = new ServiceClient({
79
- intercept: async (req) => {
80
- attempts++;
81
- return { ok: false, status: 500, body: "something went wrong"};
82
- },
83
- });
84
- try {
85
- const task = await api.get_task("", { retry: 5 });
86
- throw new Error("request should not have succeeded");
87
- } catch (_) {
88
- expect(attempts).toEqual(6);
89
- }
83
+ const intercept = jest.fn(interceptor(500));
84
+ const api = new ServiceClient({ intercept });
85
+ const promise = api.get_task("", { retry: 5 });
86
+ await expect(promise).rejects.toBeInstanceOf(ServiceError);
87
+ expect(intercept.mock.calls.length).toEqual(6);
90
88
  });
91
89
 
92
90
  describe("ServiceError", () => {
@@ -99,9 +97,7 @@ describe("ServiceClient", () => {
99
97
 
100
98
  test("returns null for ignored http status", async () => {
101
99
  const api = new ServiceClient({
102
- intercept: async (req) => {
103
- return { ok: false, status: 501, body: "" };
104
- }
100
+ intercept: interceptor(501),
105
101
  });
106
102
  const task = await api.get_task("").ignore(501);
107
103
  expect(task).toBeNull();
@@ -109,9 +105,7 @@ describe("ServiceClient", () => {
109
105
 
110
106
  test("returns null for ignored service error code", async () => {
111
107
  const api = new ServiceClient({
112
- intercept: async (req) => {
113
- return { ok: false, status: 500, body: JSON.stringify({ code: 500.4, message: "uh oh" }) };
114
- }
108
+ intercept: interceptor(500, { code: 500.4, message: "uh oh" }),
115
109
  });
116
110
  const task = await api.get_task("").ignore(500.4);
117
111
  expect(task).toBeNull();
@@ -119,9 +113,7 @@ describe("ServiceClient", () => {
119
113
 
120
114
  test("throws ServiceError for non-ignored errors", async () => {
121
115
  const api = new ServiceClient({
122
- intercept: async (req) => {
123
- return { ok: false, status: 500, body: JSON.stringify({ code: 500.4, message: "hello world" }) };
124
- }
116
+ intercept: interceptor(500, { code: 500.4, message: "hello world"}),
125
117
  });
126
118
  try {
127
119
  await api.get_task("");
@@ -134,9 +126,7 @@ describe("ServiceClient", () => {
134
126
 
135
127
  test("either should be true with 200 response", async () => {
136
128
  const api = new ServiceClient({
137
- intercept: async (req) => {
138
- return { ok: true, status: 200, body: "{}" };
139
- }
129
+ intercept: interceptor(200, "{}"),
140
130
  });
141
131
  const res = await api.get_task("{}").combine();
142
132
  expect(res.ok).toBe(true);
@@ -146,9 +136,7 @@ describe("ServiceClient", () => {
146
136
 
147
137
  test("either should be false with non-200 response", async () => {
148
138
  const api = new ServiceClient({
149
- intercept: async (req) => {
150
- return { ok: false, status: 400, body: "{}" };
151
- }
139
+ intercept: interceptor(400, "{}"),
152
140
  });
153
141
  const res = await api.get_task("{}").combine();
154
142
  expect(res.ok).toBe(false);
@@ -158,9 +146,7 @@ describe("ServiceClient", () => {
158
146
 
159
147
  test("either should be false with matching code", async () => {
160
148
  const api = new ServiceClient({
161
- intercept: async (req) => {
162
- return { ok: false, status: 400, body: "{}" };
163
- }
149
+ intercept: interceptor(400, "{}"),
164
150
  });
165
151
  const res = await api.get_task("{}").combine(400);
166
152
  expect(res.ok).toBe(false);
@@ -169,9 +155,7 @@ describe("ServiceClient", () => {
169
155
 
170
156
  test("method should throw if code is not specified", async () => {
171
157
  const api = new ServiceClient({
172
- intercept: async (req) => {
173
- return { ok: false, status: 400, body: "{}" };
174
- }
158
+ intercept: interceptor(400, "{}"),
175
159
  });
176
160
  const promise = api.get_task("").combine(500);
177
161
  expect(promise).rejects.toThrow();
File without changes