@8ms/helpers 1.1.67 → 1.1.73

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 (353) hide show
  1. package/api/response.js +1 -12
  2. package/api/states.js +1 -10
  3. package/api/unexpectedError.js +1 -4
  4. package/array/contains.js +2 -9
  5. package/array/getArray.js +2 -13
  6. package/atInternet/request.js +1 -2
  7. package/aws/athenaExpress/initClient.js +3 -28
  8. package/aws/athenaExpress/query.js +3 -0
  9. package/aws/getConfig.js +2 -27
  10. package/aws/glue/initClient.js +2 -18
  11. package/aws/glue/invoke.js +2 -73
  12. package/aws/isResponse200.js +2 -22
  13. package/aws/lambda/getHandlerPath.js +1 -8
  14. package/aws/lambda/initClient.js +2 -18
  15. package/aws/lambda/invoke.js +2 -87
  16. package/aws/s3/copyFile.js +2 -61
  17. package/aws/s3/deleteFile.js +2 -60
  18. package/aws/s3/deleteFiles.js +2 -64
  19. package/aws/s3/deleteFolder.js +2 -85
  20. package/aws/s3/getGlueJson.js +2 -16
  21. package/aws/s3/getPresignedPost.js +3 -63
  22. package/aws/s3/getSignedUrl.js +2 -83
  23. package/aws/s3/initClient.js +2 -18
  24. package/aws/s3/isFileExists.js +2 -75
  25. package/aws/s3/listFiles.js +2 -79
  26. package/aws/s3/listFolders.js +4 -78
  27. package/aws/s3/moveFile.js +2 -68
  28. package/aws/s3/readBuffer.js +2 -99
  29. package/aws/s3/readFile.js +2 -120
  30. package/aws/s3/writeFile.js +2 -77
  31. package/aws/s3/writePresignedPost.js +2 -101
  32. package/aws/s3cache/cache.js +1 -2
  33. package/aws/s3cache/getCache.js +2 -79
  34. package/aws/s3cache/getKey.js +2 -17
  35. package/aws/s3cache/saveCache.js +2 -58
  36. package/aws/s3cache/updateCache.js +2 -75
  37. package/aws/ses/SimpleEmail.js +2 -219
  38. package/aws/ses/initClient.js +2 -18
  39. package/aws/ssm/getParameter.js +2 -86
  40. package/aws/ssm/initClient.js +2 -18
  41. package/axios/get.js +1 -115
  42. package/axios/post.js +2 -117
  43. package/boolean/getBoolean.js +2 -16
  44. package/class/BaseClass.js +9 -57
  45. package/crud/actions.js +1 -10
  46. package/crypto/getDecrypt.js +2 -12
  47. package/crypto/getEncrypt.js +2 -12
  48. package/crypto/getRandom.js +2 -11
  49. package/crypto/getSha256.js +2 -16
  50. package/date/date.js +1 -2
  51. package/date/duration.js +1 -2
  52. package/date/durationComparisons.js +1 -7
  53. package/date/durations.js +1 -10
  54. package/date/financialYear.js +1 -2
  55. package/date/financialYearWeek.js +1 -2
  56. package/date/format.js +2 -19
  57. package/date/getDate.js +9 -97
  58. package/date/getDatesBetween.js +3 -26
  59. package/date/getDurationHours.js +2 -26
  60. package/date/getDurationMinutes.js +2 -25
  61. package/date/getFinancialYear.js +8 -49
  62. package/date/getFinancialYearToDate.js +2 -18
  63. package/date/getFinancialYearToYesterday.js +2 -18
  64. package/date/getFinancialYearWeeks.js +2 -30
  65. package/date/getLastWeek.js +2 -29
  66. package/date/getMax.js +2 -16
  67. package/date/getMidnight.js +2 -13
  68. package/date/getMin.js +2 -16
  69. package/date/getMonday.js +5 -33
  70. package/date/getNumber.js +2 -15
  71. package/date/getPredefinedTimeframe.js +2 -24
  72. package/date/getSunday.js +5 -33
  73. package/date/getThisWeek.js +2 -29
  74. package/date/getTimeZoned.js +5 -37
  75. package/date/getToday.js +2 -40
  76. package/date/getTwoWeeksAgo.js +2 -29
  77. package/date/getWeeksAgo.js +2 -17
  78. package/date/getYesterday.js +2 -41
  79. package/date/isDateValid.js +2 -23
  80. package/date/isLastWeek.js +2 -14
  81. package/date/isThisWeek.js +2 -14
  82. package/date/parseExcelDate.js +2 -18
  83. package/date/predefinedTimeframes.js +1 -9
  84. package/date/timeframe.js +1 -2
  85. package/date/timeframes.js +1 -7
  86. package/deepCrawl/buildRequest.js +4 -84
  87. package/deepCrawl/filter.js +1 -2
  88. package/deepCrawl/getData.js +1 -87
  89. package/deepCrawl/initClient.js +2 -78
  90. package/deepCrawl/operands.js +1 -13
  91. package/deepCrawl/orders.js +1 -7
  92. package/deepCrawl/reports.js +1 -13
  93. package/environment/environments.js +1 -8
  94. package/environment/getEnvironment.js +2 -42
  95. package/environment/isAws.js +2 -10
  96. package/environment/isDevelopment.js +1 -9
  97. package/environment/isLocalhost.js +2 -21
  98. package/environment/isProduction.js +1 -9
  99. package/environment/isStaging.js +1 -9
  100. package/environment/isVercel.js +2 -6
  101. package/environment/platforms.js +1 -7
  102. package/eskimi/ageGroups.js +1 -41
  103. package/eskimi/campaign.js +1 -2
  104. package/eskimi/devices.js +1 -13
  105. package/eskimi/endpoints.js +2 -17
  106. package/eskimi/genders.js +1 -13
  107. package/eskimi/getAccessToken.js +2 -68
  108. package/eskimi/getAgeGroup.js +2 -17
  109. package/eskimi/getCampaignIds.js +2 -12
  110. package/eskimi/getDevice.js +2 -17
  111. package/eskimi/getGender.js +2 -17
  112. package/eskimi/request.js +2 -69
  113. package/globals.d.js +1 -0
  114. package/google/bigQuery/initClient.js +4 -0
  115. package/google/bigQuery/query.js +3 -0
  116. package/google/getConfig.js +5 -0
  117. package/google/sheets/getAssociatedData.js +8 -99
  118. package/google/sheets/getBatchData.js +1 -64
  119. package/google/sheets/initClient.js +5 -0
  120. package/google/sheets/isCellNa.js +2 -9
  121. package/google/storage/initClient.js +5 -0
  122. package/google/storage/writeFile.js +2 -87
  123. package/googleAds/getCustomer.js +2 -55
  124. package/googleAds/initClient.js +2 -67
  125. package/initClients.js +5 -112
  126. package/json/isJson.js +2 -19
  127. package/littleWarden/getUrlStatus.js +2 -66
  128. package/littleWarden/isAllGood.js +2 -18
  129. package/littleWarden/isDanger.js +2 -18
  130. package/littleWarden/isWarning.js +2 -18
  131. package/littleWarden/states.js +1 -8
  132. package/myTarget/getAccessToken.js +2 -68
  133. package/myTarget/request.js +2 -69
  134. package/nextAuth/isSessionReady.js +1 -13
  135. package/nextAuth/states.js +2 -8
  136. package/nextJs/getIp.js +2 -13
  137. package/nextJs/getUserAgent.js +2 -9
  138. package/number/getDivide.js +2 -18
  139. package/number/getNumber.js +7 -51
  140. package/number/getPercent.js +2 -18
  141. package/number/getPercentIncrease.js +2 -18
  142. package/number/getRounded.js +2 -22
  143. package/package.json +47 -43
  144. package/prisma/initClient.js +3 -34
  145. package/snapchat/getAccessToken.js +2 -83
  146. package/sorting/byNumberAscending.js +2 -17
  147. package/sorting/byNumberDescending.js +2 -17
  148. package/sorting/byStringAscending.js +2 -21
  149. package/sorting/byStringDescending.js +2 -21
  150. package/string/formatCapitalise.js +2 -15
  151. package/string/getCleanFolder.js +2 -14
  152. package/string/getString.js +2 -36
  153. package/string/getStringFromStream.js +2 -15
  154. package/string/toProperCase.js +2 -18
  155. package/swr/isAllData.js +2 -19
  156. package/swr/isAnyError.js +2 -19
  157. package/swr/isAnyLoading.js +2 -21
  158. package/swr/isData.js +2 -9
  159. package/swr/isError.js +2 -9
  160. package/swr/isLoading.js +2 -14
  161. package/upTimeRobot/getMonitors.js +2 -87
  162. package/upTimeRobot/logTypes.js +1 -9
  163. package/upTimeRobot/monitorStatuses.js +1 -10
  164. package/upTimeRobot/monitorSubTypes.js +1 -12
  165. package/upTimeRobot/monitorTypes.js +1 -10
  166. package/upTimeRobot/requestStatuses.js +1 -7
  167. package/url/buildParameters.js +2 -22
  168. package/url/buildRelative.js +2 -13
  169. package/url/buildUrl.js +2 -29
  170. package/url/isAbsolute.js +2 -15
  171. package/url/isRelative.js +2 -10
  172. package/url/url.js +1 -2
  173. package/util/defaultTo.js +2 -35
  174. package/util/isUndefined.js +3 -0
  175. package/util/sleep.js +1 -7
  176. package/webWorker/states.js +1 -8
  177. package/xml/getXml.js +1 -62
  178. package/api/response.d.ts +0 -8
  179. package/api/states.d.ts +0 -9
  180. package/api/unexpectedError.d.ts +0 -2
  181. package/array/contains.d.ts +0 -8
  182. package/array/getArray.d.ts +0 -7
  183. package/atInternet/request.d.ts +0 -30
  184. package/aws/athenaExpress/initClient.d.ts +0 -12
  185. package/aws/athenaExpress/request.d.ts +0 -8
  186. package/aws/athenaExpress/request.js +0 -54
  187. package/aws/config.d.ts +0 -5
  188. package/aws/config.js +0 -2
  189. package/aws/getConfig.d.ts +0 -9
  190. package/aws/glue/initClient.d.ts +0 -9
  191. package/aws/glue/invoke.d.ts +0 -11
  192. package/aws/isResponse200.d.ts +0 -7
  193. package/aws/lambda/getHandlerPath.d.ts +0 -4
  194. package/aws/lambda/initClient.d.ts +0 -9
  195. package/aws/lambda/invoke.d.ts +0 -14
  196. package/aws/s3/copyFile.d.ts +0 -13
  197. package/aws/s3/deleteFile.d.ts +0 -9
  198. package/aws/s3/deleteFiles.d.ts +0 -10
  199. package/aws/s3/deleteFolder.d.ts +0 -10
  200. package/aws/s3/getGlueJson.d.ts +0 -4
  201. package/aws/s3/getPresignedPost.d.ts +0 -21
  202. package/aws/s3/getSignedUrl.d.ts +0 -12
  203. package/aws/s3/initClient.d.ts +0 -9
  204. package/aws/s3/isFileExists.d.ts +0 -9
  205. package/aws/s3/listFiles.d.ts +0 -9
  206. package/aws/s3/listFolders.d.ts +0 -9
  207. package/aws/s3/moveFile.d.ts +0 -9
  208. package/aws/s3/readBuffer.d.ts +0 -13
  209. package/aws/s3/readFile.d.ts +0 -30
  210. package/aws/s3/writeFile.d.ts +0 -10
  211. package/aws/s3/writePresignedPost.d.ts +0 -15
  212. package/aws/s3cache/cache.d.ts +0 -7
  213. package/aws/s3cache/getCache.d.ts +0 -12
  214. package/aws/s3cache/getKey.d.ts +0 -10
  215. package/aws/s3cache/saveCache.d.ts +0 -10
  216. package/aws/s3cache/updateCache.d.ts +0 -10
  217. package/aws/ses/SimpleEmail.d.ts +0 -54
  218. package/aws/ses/initClient.d.ts +0 -9
  219. package/aws/ssm/getParameter.d.ts +0 -10
  220. package/aws/ssm/initClient.d.ts +0 -9
  221. package/axios/get.d.ts +0 -8
  222. package/axios/post.d.ts +0 -12
  223. package/boolean/getBoolean.d.ts +0 -7
  224. package/class/BaseClass.d.ts +0 -31
  225. package/crud/actions.d.ts +0 -8
  226. package/crypto/getDecrypt.d.ts +0 -10
  227. package/crypto/getEncrypt.d.ts +0 -10
  228. package/crypto/getRandom.d.ts +0 -8
  229. package/crypto/getSha256.d.ts +0 -8
  230. package/date/date.d.ts +0 -4
  231. package/date/duration.d.ts +0 -5
  232. package/date/durationComparisons.d.ts +0 -5
  233. package/date/durations.d.ts +0 -8
  234. package/date/financialYear.d.ts +0 -4
  235. package/date/financialYearWeek.d.ts +0 -6
  236. package/date/format.d.ts +0 -13
  237. package/date/getDate.d.ts +0 -12
  238. package/date/getDatesBetween.d.ts +0 -10
  239. package/date/getDurationHours.d.ts +0 -8
  240. package/date/getDurationMinutes.d.ts +0 -8
  241. package/date/getFinancialYear.d.ts +0 -9
  242. package/date/getFinancialYearToDate.d.ts +0 -7
  243. package/date/getFinancialYearToYesterday.d.ts +0 -7
  244. package/date/getFinancialYearWeeks.d.ts +0 -9
  245. package/date/getLastWeek.d.ts +0 -10
  246. package/date/getMax.d.ts +0 -12
  247. package/date/getMidnight.d.ts +0 -10
  248. package/date/getMin.d.ts +0 -12
  249. package/date/getMonday.d.ts +0 -14
  250. package/date/getNumber.d.ts +0 -11
  251. package/date/getPredefinedTimeframe.d.ts +0 -9
  252. package/date/getSunday.d.ts +0 -14
  253. package/date/getThisWeek.d.ts +0 -10
  254. package/date/getTimeZoned.d.ts +0 -13
  255. package/date/getToday.d.ts +0 -9
  256. package/date/getTwoWeeksAgo.d.ts +0 -10
  257. package/date/getWeeksAgo.d.ts +0 -12
  258. package/date/getYesterday.d.ts +0 -9
  259. package/date/isDateValid.d.ts +0 -7
  260. package/date/isLastWeek.d.ts +0 -6
  261. package/date/isThisWeek.d.ts +0 -6
  262. package/date/parseExcelDate.d.ts +0 -8
  263. package/date/predefinedTimeframes.d.ts +0 -7
  264. package/date/timeframe.d.ts +0 -8
  265. package/date/timeframes.d.ts +0 -4
  266. package/deepCrawl/buildRequest.d.ts +0 -15
  267. package/deepCrawl/filter.d.ts +0 -5
  268. package/deepCrawl/getData.d.ts +0 -5
  269. package/deepCrawl/initClient.d.ts +0 -13
  270. package/deepCrawl/operands.d.ts +0 -11
  271. package/deepCrawl/orders.d.ts +0 -9
  272. package/deepCrawl/reports.d.ts +0 -11
  273. package/environment/environments.d.ts +0 -7
  274. package/environment/getEnvironment.d.ts +0 -6
  275. package/environment/isAws.d.ts +0 -5
  276. package/environment/isDevelopment.d.ts +0 -2
  277. package/environment/isLocalhost.d.ts +0 -5
  278. package/environment/isProduction.d.ts +0 -2
  279. package/environment/isStaging.d.ts +0 -2
  280. package/environment/isVercel.d.ts +0 -5
  281. package/environment/platforms.d.ts +0 -6
  282. package/eskimi/ageGroups.d.ts +0 -5
  283. package/eskimi/campaign.d.ts +0 -19
  284. package/eskimi/devices.d.ts +0 -5
  285. package/eskimi/endpoints.d.ts +0 -16
  286. package/eskimi/genders.d.ts +0 -5
  287. package/eskimi/getAccessToken.d.ts +0 -9
  288. package/eskimi/getAgeGroup.d.ts +0 -7
  289. package/eskimi/getCampaignIds.d.ts +0 -7
  290. package/eskimi/getDevice.d.ts +0 -7
  291. package/eskimi/getGender.d.ts +0 -7
  292. package/eskimi/request.d.ts +0 -8
  293. package/google/getCredentials.d.ts +0 -20
  294. package/google/getCredentials.js +0 -76
  295. package/google/sheets/getAssociatedData.d.ts +0 -20
  296. package/google/sheets/getAuth.d.ts +0 -8
  297. package/google/sheets/getAuth.js +0 -69
  298. package/google/sheets/getBatchData.d.ts +0 -20
  299. package/google/sheets/isCellNa.d.ts +0 -7
  300. package/google/storage/writeFile.d.ts +0 -11
  301. package/googleAds/getCustomer.d.ts +0 -7
  302. package/googleAds/initClient.d.ts +0 -15
  303. package/initClients.d.ts +0 -30
  304. package/json/isJson.d.ts +0 -8
  305. package/littleWarden/getUrlStatus.d.ts +0 -9
  306. package/littleWarden/isAllGood.d.ts +0 -7
  307. package/littleWarden/isDanger.d.ts +0 -7
  308. package/littleWarden/isWarning.d.ts +0 -7
  309. package/littleWarden/states.d.ts +0 -7
  310. package/myTarget/getAccessToken.d.ts +0 -9
  311. package/myTarget/request.d.ts +0 -8
  312. package/nextAuth/isSessionReady.d.ts +0 -4
  313. package/nextAuth/states.d.ts +0 -7
  314. package/nextJs/getIp.d.ts +0 -7
  315. package/nextJs/getUserAgent.d.ts +0 -7
  316. package/number/getDivide.d.ts +0 -9
  317. package/number/getNumber.d.ts +0 -8
  318. package/number/getPercent.d.ts +0 -9
  319. package/number/getPercentIncrease.d.ts +0 -9
  320. package/number/getRounded.d.ts +0 -9
  321. package/prisma/initClient.d.ts +0 -4
  322. package/snapchat/getAccessToken.d.ts +0 -9
  323. package/sorting/byNumberAscending.d.ts +0 -8
  324. package/sorting/byNumberDescending.d.ts +0 -8
  325. package/sorting/byStringAscending.d.ts +0 -8
  326. package/sorting/byStringDescending.d.ts +0 -8
  327. package/string/formatCapitalise.d.ts +0 -9
  328. package/string/getCleanFolder.d.ts +0 -7
  329. package/string/getString.d.ts +0 -7
  330. package/string/getStringFromStream.d.ts +0 -8
  331. package/string/toProperCase.d.ts +0 -7
  332. package/swr/isAllData.d.ts +0 -7
  333. package/swr/isAnyError.d.ts +0 -7
  334. package/swr/isAnyLoading.d.ts +0 -7
  335. package/swr/isData.d.ts +0 -7
  336. package/swr/isError.d.ts +0 -7
  337. package/swr/isLoading.d.ts +0 -7
  338. package/upTimeRobot/getMonitors.d.ts +0 -1
  339. package/upTimeRobot/logTypes.d.ts +0 -7
  340. package/upTimeRobot/monitorStatuses.d.ts +0 -8
  341. package/upTimeRobot/monitorSubTypes.d.ts +0 -10
  342. package/upTimeRobot/monitorTypes.d.ts +0 -8
  343. package/upTimeRobot/requestStatuses.d.ts +0 -5
  344. package/url/buildParameters.d.ts +0 -8
  345. package/url/buildRelative.d.ts +0 -8
  346. package/url/buildUrl.d.ts +0 -10
  347. package/url/isAbsolute.d.ts +0 -7
  348. package/url/isRelative.d.ts +0 -7
  349. package/url/url.d.ts +0 -6
  350. package/util/defaultTo.d.ts +0 -9
  351. package/util/sleep.d.ts +0 -4
  352. package/webWorker/states.d.ts +0 -7
  353. package/xml/getXml.d.ts +0 -4
@@ -1,41 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var ageGroups = [
4
- {
5
- "id": 0,
6
- "name": "0-17",
7
- },
8
- {
9
- "id": 1,
10
- "name": "18-24",
11
- },
12
- {
13
- "id": 2,
14
- "name": "25-29",
15
- },
16
- {
17
- "id": 3,
18
- "name": "30-34",
19
- },
20
- {
21
- "id": 4,
22
- "name": "35-39",
23
- },
24
- {
25
- "id": 5,
26
- "name": "40-44",
27
- },
28
- {
29
- "id": 6,
30
- "name": "45-54",
31
- },
32
- {
33
- "id": 7,
34
- "name": "55-64",
35
- },
36
- {
37
- "id": 8,
38
- "name": "65+",
39
- },
40
- ];
41
- exports.default = ageGroups;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var ageGroups=[{id:0,name:"0-17"},{id:1,name:"18-24"},{id:2,name:"25-29"},{id:3,name:"30-34"},{id:4,name:"35-39"},{id:5,name:"40-44"},{id:6,name:"45-54"},{id:7,name:"55-64"},{id:8,name:"65+"}],_default=ageGroups;exports["default"]=_default;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
package/eskimi/devices.js CHANGED
@@ -1,13 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var devices = [
4
- {
5
- "id": 2,
6
- "name": "Personal Computer",
7
- },
8
- {
9
- "id": 3,
10
- "name": "Connected TV",
11
- },
12
- ];
13
- exports.default = devices;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var devices=[{id:2,name:"Personal Computer"},{id:3,name:"Connected TV"}],_default=devices;exports["default"]=_default;
@@ -1,18 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;/**
4
2
  * https://dsp-api.eskimi.com/docs/api/v1/#api-Report-GetCampaignReportByAgeGroups
5
- */
6
- var endpoints = {
7
- campaign: {
8
- age: 'https://dsp-api.eskimi.com/api/v1/report/ageGroups/get',
9
- gender: 'https://dsp-api.eskimi.com/api/v1/report/genders/get',
10
- list: 'https://dsp-api.eskimi.com/api/v1/campaign/get',
11
- performance: 'https://dsp-api.eskimi.com/api/v1/report/campaigns/get',
12
- video: 'https://dsp-api.eskimi.com/api/v1/report/videoCampaigns/get',
13
- },
14
- site: {
15
- list: 'https://dsp-api.eskimi.com/api/v1/report/sites/get',
16
- },
17
- };
18
- exports.default = endpoints;
3
+ */var endpoints={campaign:{age:"https://dsp-api.eskimi.com/api/v1/report/ageGroups/get",gender:"https://dsp-api.eskimi.com/api/v1/report/genders/get",list:"https://dsp-api.eskimi.com/api/v1/campaign/get",performance:"https://dsp-api.eskimi.com/api/v1/report/campaigns/get",video:"https://dsp-api.eskimi.com/api/v1/report/videoCampaigns/get"},site:{list:"https://dsp-api.eskimi.com/api/v1/report/sites/get"}},_default=endpoints;exports["default"]=_default;
package/eskimi/genders.js CHANGED
@@ -1,13 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var genders = [
4
- {
5
- "id": 1,
6
- "name": "Male",
7
- },
8
- {
9
- "id": 2,
10
- "name": "Female",
11
- },
12
- ];
13
- exports.default = genders;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var genders=[{id:1,name:"Male"},{id:2,name:"Female"}],_default=genders;exports["default"]=_default;
@@ -1,69 +1,3 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- var getParameter_1 = __importDefault(require("../aws/ssm/getParameter"));
43
- global.eskimiAccessToken = null;
44
- /**
1
+ "use strict";var _getParameter=_interopRequireDefault(require("../aws/ssm/getParameter"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}global.eskimiAccessToken=null;/**
45
2
  * Retrieve the access token from SSM Parameter Store.
46
- */
47
- var getAccessToken = function (_a) {
48
- var force = _a.force, parameterName = _a.parameterName;
49
- return __awaiter(void 0, void 0, void 0, function () {
50
- var parameter;
51
- return __generator(this, function (_b) {
52
- switch (_b.label) {
53
- case 0:
54
- if (!(!global.eskimiAccessToken || force)) return [3 /*break*/, 2];
55
- return [4 /*yield*/, (0, getParameter_1.default)({
56
- name: parameterName,
57
- withDecryption: true,
58
- isJson: true,
59
- })];
60
- case 1:
61
- parameter = _b.sent();
62
- global.eskimiAccessToken = parameter.accessToken;
63
- _b.label = 2;
64
- case 2: return [2 /*return*/, global.eskimiAccessToken];
65
- }
66
- });
67
- });
68
- };
69
- exports.default = getAccessToken;
3
+ */var getAccessToken=/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e;return _regeneratorRuntime().wrap(function f(b){for(;1;)switch(b.prev=b.next){case 0:if(c=a.force,d=a.parameterName,global.eskimiAccessToken&&!c){b.next=6;break}return b.next=4,(0,_getParameter["default"])({name:d,withDecryption:!0,isJson:!0});case 4:e=b.sent,global.eskimiAccessToken=e.accessToken;case 6:return b.abrupt("return",global.eskimiAccessToken);case 7:case"end":return b.stop();}},b)}));return function getAccessToken(b){return a.apply(this,arguments)}}(),_default=getAccessToken;exports["default"]=_default;
@@ -1,18 +1,3 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var ageGroups_1 = __importDefault(require("./ageGroups"));
7
- /**
1
+ "use strict";var _ageGroups=_interopRequireDefault(require("./ageGroups"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/**
8
2
  * Map the Age Group and return the user-friendly string.
9
- */
10
- var getAgeGroup = function (_a) {
11
- var input = _a.input;
12
- var matches = ageGroups_1.default.filter(function (group) { return group.id === input; });
13
- if (1 === matches.length) {
14
- return matches[0].name;
15
- }
16
- return 'Undefined';
17
- };
18
- exports.default = getAgeGroup;
3
+ */var getAgeGroup=function(a){var b=a.input,c=_ageGroups["default"].filter(function(a){return a.id===b});return 1===c.length?c[0].name:"Undefined"},_default=getAgeGroup;exports["default"]=_default;
@@ -1,13 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;/**
4
2
  * Convert the Regex of Campaign Ids into an array of integers.
5
- */
6
- var getCampaignIds = function (_a) {
7
- var accounts = _a.accounts;
8
- return accounts[0].campaignIdRegex.replace('(', '')
9
- .replace(')', '')
10
- .split('|')
11
- .map(function (id) { return parseInt(id); });
12
- };
13
- exports.default = getCampaignIds;
3
+ */var getCampaignIds=function(a){var b=a.accounts;return b[0].campaignIdRegex.replace("(","").replace(")","").split("|").map(function(a){return parseInt(a)})},_default=getCampaignIds;exports["default"]=_default;
@@ -1,18 +1,3 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var devices_1 = __importDefault(require("./devices"));
7
- /**
1
+ "use strict";var _devices=_interopRequireDefault(require("./devices"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/**
8
2
  * Map the Devices and return the user-friendly string.
9
- */
10
- var getDevice = function (_a) {
11
- var input = _a.input;
12
- var matches = devices_1.default.filter(function (device) { return device.id === input; });
13
- if (1 === matches.length) {
14
- return matches[0].name;
15
- }
16
- return 'Undefined';
17
- };
18
- exports.default = getDevice;
3
+ */var getDevice=function(a){var b=a.input,c=_devices["default"].filter(function(a){return a.id===b});return 1===c.length?c[0].name:"Undefined"},_default=getDevice;exports["default"]=_default;
@@ -1,18 +1,3 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- var genders_1 = __importDefault(require("./genders"));
7
- /**
1
+ "use strict";var _genders=_interopRequireDefault(require("./genders"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/**
8
2
  * Map the Gender and return the user-friendly string.
9
- */
10
- var getGender = function (_a) {
11
- var input = _a.input;
12
- var matches = genders_1.default.filter(function (gender) { return gender.id === input; });
13
- if (1 === matches.length) {
14
- return matches[0].name;
15
- }
16
- return 'Undefined';
17
- };
18
- exports.default = getGender;
3
+ */var getGender=function(a){var b=a.input,c=_genders["default"].filter(function(a){return a.id===b});return 1===c.length?c[0].name:"Undefined"},_default=getGender;exports["default"]=_default;
package/eskimi/request.js CHANGED
@@ -1,70 +1,3 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- var post_1 = __importDefault(require("../axios/post"));
43
- /**
1
+ "use strict";var _post=_interopRequireDefault(require("../axios/post"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}/**
44
2
  * Make the request to Eskimi API using the access token.
45
- */
46
- var request = function (_a) {
47
- var data = _a.data, url = _a.url;
48
- return __awaiter(void 0, void 0, void 0, function () {
49
- var response;
50
- return __generator(this, function (_b) {
51
- switch (_b.label) {
52
- case 0: return [4 /*yield*/, (0, post_1.default)({
53
- config: {
54
- headers: {
55
- Authorization: "Bearer ".concat(global.eskimiAccessToken),
56
- "Content-Type": "application/json",
57
- },
58
- },
59
- data: data,
60
- onSuccess: function (response) { return response.data; },
61
- url: url,
62
- })];
63
- case 1:
64
- response = _b.sent();
65
- return [2 /*return*/, response];
66
- }
67
- });
68
- });
69
- };
70
- exports.default = request;
3
+ */var request=/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e;return _regeneratorRuntime().wrap(function f(b){for(;1;)switch(b.prev=b.next){case 0:return c=a.data,d=a.url,b.next=3,(0,_post["default"])({config:{headers:{Authorization:"Bearer ".concat(global.eskimiAccessToken),"Content-Type":"application/json"}},data:c,onSuccess:function b(a){return a.data},url:d});case 3:return e=b.sent,b.abrupt("return",e);case 5:case"end":return b.stop();}},b)}));return function request(b){return a.apply(this,arguments)}}(),_default=request;exports["default"]=_default;
package/globals.d.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,4 @@
1
+ "use strict";var _getConfig=_interopRequireDefault(require("../getConfig"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}global.googleBigQueryClient={};/**
2
+ * Initialise the Big Query client.
3
+ * It's possible to use multiple clients, so we set one up per project id.
4
+ */var initClient=function(a){var b=a.parameter,c=a.projectId;if(!global.googleBigQueryClient[c]){var d=require("@google-cloud/bigquery"),e=d.BigQuery,f=(0,_getConfig["default"])({parameter:b});global.googleBigQueryClient[c]=new e({credentials:f,projectId:c})}},_default=initClient;exports["default"]=_default;
@@ -0,0 +1,3 @@
1
+ "use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}/**
2
+ * Build the query and return the data.
3
+ */var query=/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e;return _regeneratorRuntime().wrap(function f(b){for(;1;)switch(b.prev=b.next){case 0:return c=a.projectId,d=a.query,b.next=3,global.googleBigQueryClient[c].query(d);case 3:return e=b.sent,b.abrupt("return",e);case 5:case"end":return b.stop();}},b)}));return function query(b){return a.apply(this,arguments)}}(),_default=query;exports["default"]=_default;
@@ -0,0 +1,5 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;// Same input as output, except formatting differences for Private Key.
2
+ /**
3
+ * Using the response from Parameter Store and format it ready to be used with Google API.
4
+ */var getConfig=function(a){// Format the private key to be in the same format as required by Google
5
+ var b=a.private_key.replace(/\\n/g,"\n"),c={type:a.type,project_id:a.project_id,private_key_id:a.private_key_id,private_key:b,client_email:a.client_email,client_id:a.client_id,auth_uri:a.auth_uri,token_uri:a.token_uri,auth_provider_x509_cert_url:a.auth_provider_x509_cert_url,client_x509_cert_url:a.client_x509_cert_url};return c},_default=getConfig;exports["default"]=_default;
@@ -1,100 +1,9 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- var isUndefined_1 = __importDefault(require("lodash/isUndefined"));
43
- var getBatchData_1 = __importDefault(require("./getBatchData"));
44
- /**
1
+ "use strict";var _getBatchData=_interopRequireDefault(require("./getBatchData"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}/**
45
2
  * Make a batch get to Google Sheets to retrieve the data correctly formatted, with default values provided.
46
- */
47
- var getAssociatedData = function (_a) {
48
- var SheetsLib = _a.SheetsLib, client = _a.client, request = _a.request;
49
- return __awaiter(void 0, void 0, void 0, function () {
50
- var apiResponse, template, response, initialRangeLength, i, rowIndex, row, columnIndex, refValue, value;
51
- return __generator(this, function (_b) {
52
- switch (_b.label) {
53
- case 0: return [4 /*yield*/, (0, getBatchData_1.default)({
54
- SheetsLib: SheetsLib,
55
- client: client,
56
- spreadsheetId: request.spreadsheetId,
57
- ranges: request.ranges,
58
- dateTimeRender: request.dateTimeRender,
59
- valueRender: request.valueRender,
60
- })];
61
- case 1:
62
- apiResponse = _b.sent();
63
- template = [];
64
- response = [];
65
- // Missing ranges or too many ranges
66
- if (4 !== apiResponse.valueRanges.length) {
67
- throw new Error("Associated data response length must be 4.");
68
- }
69
- initialRangeLength = apiResponse.valueRanges[0].values[0].length;
70
- // Loop through the headings
71
- for (i = 0; i < initialRangeLength; i++) {
72
- template.push({
73
- format: apiResponse.valueRanges[0].values[0][i],
74
- default: apiResponse.valueRanges[1].values[0][i],
75
- heading: apiResponse.valueRanges[2].values[0][i],
76
- index: i,
77
- });
78
- }
79
- // console.log('template', template);
80
- // Loop through each row of data
81
- if (!(0, isUndefined_1.default)(apiResponse.valueRanges[3].values)) {
82
- for (rowIndex = 0; rowIndex < apiResponse.valueRanges[3].values.length; rowIndex++) {
83
- row = {};
84
- // Loop through each column within the row
85
- for (columnIndex = 0; columnIndex < apiResponse.valueRanges[3].values[rowIndex].length; columnIndex++) {
86
- refValue = apiResponse.valueRanges[3].values[rowIndex][columnIndex];
87
- value = ('' === refValue ? template[columnIndex]['default'] : refValue);
88
- // Add this to our row
89
- row[template[columnIndex]['heading']] = value;
90
- }
91
- // Add the row to our response
92
- response.push(row);
93
- }
94
- }
95
- return [2 /*return*/, response];
96
- }
97
- });
98
- });
99
- };
100
- exports.default = getAssociatedData;
3
+ */var getAssociatedData=/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e,f,g,h,j,k,l,m,n,o,p,q;return _regeneratorRuntime().wrap(function i(b){for(;1;)switch(b.prev=b.next){case 0:return c=a.dateTimeRender,d=a.ranges,e=a.spreadsheetId,f=a.valueRender,b.next=3,(0,_getBatchData["default"])({spreadsheetId:e,ranges:d,dateTimeRender:c,valueRender:f});case 3:if(g=b.sent,h=[],j=[],4===g.valueRanges.length){b.next=8;break}throw new Error("Associated data response length must be 4.");case 8:// Loop through the headings
4
+ for(k=g.valueRanges[0].values[0].length,l=0;l<k;l++)h.push({format:g.valueRanges[0].values[0][l],default:g.valueRanges[1].values[0][l],heading:g.valueRanges[2].values[0][l],index:l});// console.log('template', template);
5
+ // Loop through each row of data
6
+ if(void 0!==g.valueRanges[3].values)for(m=0;m<g.valueRanges[3].values.length;m++){// Loop through each column within the row
7
+ for(n={},o=0;o<g.valueRanges[3].values[m].length;o++)// Add this to our row
8
+ p=g.valueRanges[3].values[m][o],q=""===p?h[o]["default"]:p,n[h[o].heading]=q;// Add the row to our response
9
+ j.push(n)}return b.abrupt("return",j);case 12:case"end":return b.stop();}},b)}));return function getAssociatedData(b){return a.apply(this,arguments)}}(),_default=getAssociatedData;exports["default"]=_default;
@@ -1,64 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- var getBatchData = function (_a) {
40
- var SheetsLib = _a.SheetsLib, client = _a.client, spreadsheetId = _a.spreadsheetId, ranges = _a.ranges, _b = _a.dateTimeRender, dateTimeRender = _b === void 0 ? 'FORMATTED_STRING' : _b, _c = _a.valueRender, valueRender = _c === void 0 ? 'UNFORMATTED_VALUE' : _c;
41
- return __awaiter(void 0, void 0, void 0, function () {
42
- var request, data;
43
- return __generator(this, function (_d) {
44
- switch (_d.label) {
45
- case 0:
46
- request = {
47
- auth: client,
48
- dateTimeRenderOption: dateTimeRender,
49
- ranges: ranges,
50
- spreadsheetId: spreadsheetId,
51
- valueRenderOption: valueRender,
52
- };
53
- return [4 /*yield*/, SheetsLib.sheets('v4')
54
- .spreadsheets
55
- .values
56
- .batchGet(request)];
57
- case 1:
58
- data = (_d.sent()).data;
59
- return [2 /*return*/, data];
60
- }
61
- });
62
- });
63
- };
64
- exports.default = getBatchData;
1
+ "use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}var getBatchData=/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e,f,g,h,i,j,k;return _regeneratorRuntime().wrap(function l(b){for(;1;)switch(b.prev=b.next){case 0:return c=a.spreadsheetId,d=a.ranges,e=a.dateTimeRender,f=void 0===e?"FORMATTED_STRING":e,g=a.valueRender,h=void 0===g?"UNFORMATTED_VALUE":g,i=require("@googleapis/sheets"),j={auth:global.googleSheetsClient,dateTimeRenderOption:f,ranges:d,spreadsheetId:c,valueRenderOption:h},b.next=5,i.sheets("v4").spreadsheets.values.batchGet(j);case 5:return k=b.sent,b.abrupt("return",k.data);case 7:case"end":return b.stop();}},b)}));return function getBatchData(b){return a.apply(this,arguments)}}(),_default=getBatchData;exports["default"]=_default;