@8ms/helpers 1.39.0 → 1.40.0

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 (529) hide show
  1. package/dist/api/index.d.mts +12 -0
  2. package/dist/api/index.mjs +13 -0
  3. package/dist/aws/s3cache/index.d.mts +10 -0
  4. package/dist/crud/index.d.mts +9 -0
  5. package/dist/crud/index.mjs +10 -0
  6. package/dist/date/index.d.mts +58 -0
  7. package/dist/date/index.mjs +36 -0
  8. package/dist/environment/index.d.mts +12 -0
  9. package/dist/environment/index.mjs +14 -0
  10. package/dist/googleAds/keywordPlanner/index.d.mts +241 -0
  11. package/dist/googleAds/keywordPlanner/index.mjs +244 -0
  12. package/dist/littleWarden/index.d.mts +8 -0
  13. package/dist/littleWarden/index.mjs +9 -0
  14. package/dist/nextAuth/index.d.mts +9 -0
  15. package/dist/nextAuth/index.mjs +9 -0
  16. package/dist/webWorker/index.d.mts +8 -0
  17. package/dist/webWorker/index.mjs +9 -0
  18. package/package.json +62 -44
  19. package/.github/workflows/deploy_npmjs.yml +0 -17
  20. package/api/ApiResponse.d.ts +0 -50
  21. package/api/ApiResponse.js +0 -94
  22. package/api/index.d.ts +0 -9
  23. package/api/index.js +0 -13
  24. package/api/isError.d.ts +0 -6
  25. package/api/isError.js +0 -7
  26. package/api/isSuccess.d.ts +0 -6
  27. package/api/isSuccess.js +0 -7
  28. package/api/response.d.ts +0 -8
  29. package/api/response.js +0 -9
  30. package/array/contains.d.ts +0 -9
  31. package/array/contains.js +0 -7
  32. package/array/getArray.d.ts +0 -8
  33. package/array/getArray.js +0 -11
  34. package/atInternet/request.d.ts +0 -30
  35. package/atInternet/request.js +0 -2
  36. package/aws/athenaExpress/initClient.d.ts +0 -12
  37. package/aws/athenaExpress/initClient.js +0 -31
  38. package/aws/athenaExpress/query.d.ts +0 -8
  39. package/aws/athenaExpress/query.js +0 -16
  40. package/aws/ec2/initClient.d.ts +0 -11
  41. package/aws/ec2/initClient.js +0 -23
  42. package/aws/ec2/startInstances.d.ts +0 -11
  43. package/aws/ec2/startInstances.js +0 -18
  44. package/aws/ec2/stopInstances.d.ts +0 -12
  45. package/aws/ec2/stopInstances.js +0 -19
  46. package/aws/ecs/getClusters.d.ts +0 -9
  47. package/aws/ecs/getClusters.js +0 -32
  48. package/aws/ecs/getTaskDefinitions.d.ts +0 -13
  49. package/aws/ecs/getTaskDefinitions.js +0 -35
  50. package/aws/ecs/getTasks.d.ts +0 -16
  51. package/aws/ecs/getTasks.js +0 -38
  52. package/aws/ecs/initClient.d.ts +0 -11
  53. package/aws/ecs/initClient.js +0 -23
  54. package/aws/ecs/runTask.d.ts +0 -16
  55. package/aws/ecs/runTask.js +0 -30
  56. package/aws/getConfig.d.ts +0 -13
  57. package/aws/getConfig.js +0 -27
  58. package/aws/glue/initClient.d.ts +0 -10
  59. package/aws/glue/initClient.js +0 -21
  60. package/aws/glue/invoke.d.ts +0 -9
  61. package/aws/glue/invoke.js +0 -23
  62. package/aws/isResponse200.d.ts +0 -7
  63. package/aws/isResponse200.js +0 -22
  64. package/aws/lambda/getHandlerPath.d.ts +0 -5
  65. package/aws/lambda/getHandlerPath.js +0 -7
  66. package/aws/lambda/initClient.d.ts +0 -10
  67. package/aws/lambda/initClient.js +0 -21
  68. package/aws/lambda/invoke.d.ts +0 -13
  69. package/aws/lambda/invoke.js +0 -61
  70. package/aws/s3/copyFile.d.ts +0 -13
  71. package/aws/s3/copyFile.js +0 -14
  72. package/aws/s3/deleteFile.d.ts +0 -9
  73. package/aws/s3/deleteFile.js +0 -13
  74. package/aws/s3/deleteFiles.d.ts +0 -9
  75. package/aws/s3/deleteFiles.js +0 -17
  76. package/aws/s3/deleteFolder.d.ts +0 -9
  77. package/aws/s3/deleteFolder.js +0 -36
  78. package/aws/s3/getGlueJson.d.ts +0 -8
  79. package/aws/s3/getGlueJson.js +0 -11
  80. package/aws/s3/getPresignedPost.d.ts +0 -20
  81. package/aws/s3/getPresignedPost.js +0 -19
  82. package/aws/s3/getSignedUrl.d.ts +0 -12
  83. package/aws/s3/getSignedUrl.js +0 -17
  84. package/aws/s3/initClient.d.ts +0 -10
  85. package/aws/s3/initClient.js +0 -19
  86. package/aws/s3/isFileExists.d.ts +0 -9
  87. package/aws/s3/isFileExists.js +0 -27
  88. package/aws/s3/listFiles.d.ts +0 -9
  89. package/aws/s3/listFiles.js +0 -33
  90. package/aws/s3/listFilesIteratively.d.ts +0 -9
  91. package/aws/s3/listFilesIteratively.js +0 -44
  92. package/aws/s3/listFolders.d.ts +0 -9
  93. package/aws/s3/listFolders.js +0 -32
  94. package/aws/s3/moveFile.d.ts +0 -10
  95. package/aws/s3/moveFile.js +0 -21
  96. package/aws/s3/readBrotli.d.ts +0 -11
  97. package/aws/s3/readBrotli.js +0 -28
  98. package/aws/s3/readBuffer.d.ts +0 -13
  99. package/aws/s3/readBuffer.js +0 -39
  100. package/aws/s3/readFile.d.ts +0 -31
  101. package/aws/s3/readFile.js +0 -83
  102. package/aws/s3/readGzip.d.ts +0 -11
  103. package/aws/s3/readGzip.js +0 -28
  104. package/aws/s3/writeBrotli.d.ts +0 -12
  105. package/aws/s3/writeBrotli.js +0 -28
  106. package/aws/s3/writeFile.d.ts +0 -11
  107. package/aws/s3/writeFile.js +0 -16
  108. package/aws/s3/writeGzip.d.ts +0 -12
  109. package/aws/s3/writeGzip.js +0 -28
  110. package/aws/s3/writePresignedPost.d.ts +0 -14
  111. package/aws/s3/writePresignedPost.js +0 -31
  112. package/aws/s3/writeUrlContents.d.ts +0 -10
  113. package/aws/s3/writeUrlContents.js +0 -26
  114. package/aws/s3cache/getCache.d.ts +0 -11
  115. package/aws/s3cache/getCache.js +0 -37
  116. package/aws/s3cache/getKey.d.ts +0 -10
  117. package/aws/s3cache/getKey.js +0 -18
  118. package/aws/s3cache/index.d.ts +0 -6
  119. package/aws/s3cache/index.js +0 -2
  120. package/aws/s3cache/saveCache.d.ts +0 -10
  121. package/aws/s3cache/saveCache.js +0 -17
  122. package/aws/s3cache/updateCache.d.ts +0 -10
  123. package/aws/s3cache/updateCache.js +0 -24
  124. package/aws/ses/SimpleEmail.d.ts +0 -51
  125. package/aws/ses/SimpleEmail.js +0 -114
  126. package/aws/ses/initClient.d.ts +0 -10
  127. package/aws/ses/initClient.js +0 -19
  128. package/aws/sqs/addToQueue.d.ts +0 -27
  129. package/aws/sqs/addToQueue.js +0 -26
  130. package/aws/sqs/deleteFromQueue.d.ts +0 -10
  131. package/aws/sqs/deleteFromQueue.js +0 -15
  132. package/aws/sqs/initClient.d.ts +0 -10
  133. package/aws/sqs/initClient.js +0 -19
  134. package/aws/sqs/isEventSqs.js +0 -13
  135. package/aws/ssm/getParameter.d.ts +0 -10
  136. package/aws/ssm/getParameter.js +0 -40
  137. package/aws/ssm/initClient.d.ts +0 -10
  138. package/aws/ssm/initClient.js +0 -19
  139. package/axios/delete.d.ts +0 -11
  140. package/axios/delete.js +0 -39
  141. package/axios/get.d.ts +0 -10
  142. package/axios/get.js +0 -38
  143. package/axios/post.d.ts +0 -11
  144. package/axios/post.js +0 -38
  145. package/boolean/getBoolean.d.ts +0 -7
  146. package/boolean/getBoolean.js +0 -16
  147. package/brightData/getCustomerId.d.ts +0 -10
  148. package/brightData/getCustomerId.js +0 -11
  149. package/brightData/getZone.d.ts +0 -9
  150. package/brightData/getZone.js +0 -10
  151. package/brightData/param.d.ts +0 -9
  152. package/brightData/param.js +0 -3
  153. package/brightData/serpApi/buildGoogleSerpUrl.d.ts +0 -32
  154. package/brightData/serpApi/buildGoogleSerpUrl.js +0 -115
  155. package/brightData/serpApi/buildGoogleTrendsUrl.d.ts +0 -22
  156. package/brightData/serpApi/buildGoogleTrendsUrl.js +0 -60
  157. package/brightData/serpApi/getAsyncRequestId.d.ts +0 -14
  158. package/brightData/serpApi/getAsyncRequestId.js +0 -50
  159. package/brightData/serpApi/getAsyncResults.d.ts +0 -12
  160. package/brightData/serpApi/getAsyncResults.js +0 -49
  161. package/brightData/serpApi/getRealtime.d.ts +0 -10
  162. package/brightData/serpApi/getRealtime.js +0 -35
  163. package/brightData/serpApi/type.d.ts +0 -11
  164. package/brightData/serpApi/type.js +0 -14
  165. package/brightData/webScraperIde/getBatch.d.ts +0 -14
  166. package/brightData/webScraperIde/getBatch.js +0 -34
  167. package/brightData/webScraperIde/getRealtime.d.ts +0 -13
  168. package/brightData/webScraperIde/getRealtime.js +0 -64
  169. package/class/BaseClass.d.ts +0 -31
  170. package/class/BaseClass.js +0 -50
  171. package/crud/index.d.ts +0 -6
  172. package/crud/index.js +0 -10
  173. package/crypto/getDecrypt.d.ts +0 -10
  174. package/crypto/getDecrypt.js +0 -13
  175. package/crypto/getEncrypt.d.ts +0 -10
  176. package/crypto/getEncrypt.js +0 -13
  177. package/crypto/getRandom.d.ts +0 -8
  178. package/crypto/getRandom.js +0 -12
  179. package/crypto/getSha256.d.ts +0 -8
  180. package/crypto/getSha256.js +0 -17
  181. package/date/format.d.ts +0 -10
  182. package/date/format.js +0 -21
  183. package/date/getDate.d.ts +0 -14
  184. package/date/getDate.js +0 -138
  185. package/date/getDatesBetween.d.ts +0 -13
  186. package/date/getDatesBetween.js +0 -54
  187. package/date/getDurationHours.d.ts +0 -9
  188. package/date/getDurationHours.js +0 -24
  189. package/date/getDurationMinutes.d.ts +0 -9
  190. package/date/getDurationMinutes.js +0 -22
  191. package/date/getFinancialYear.d.ts +0 -9
  192. package/date/getFinancialYear.js +0 -52
  193. package/date/getFinancialYearToDate.d.ts +0 -7
  194. package/date/getFinancialYearToDate.js +0 -20
  195. package/date/getFinancialYearToYesterday.d.ts +0 -7
  196. package/date/getFinancialYearToYesterday.js +0 -20
  197. package/date/getFinancialYearWeeks.d.ts +0 -9
  198. package/date/getFinancialYearWeeks.js +0 -33
  199. package/date/getLastWeek.d.ts +0 -10
  200. package/date/getLastWeek.js +0 -34
  201. package/date/getMax.d.ts +0 -13
  202. package/date/getMax.js +0 -24
  203. package/date/getMidnight.d.ts +0 -10
  204. package/date/getMidnight.js +0 -13
  205. package/date/getMin.d.ts +0 -13
  206. package/date/getMin.js +0 -24
  207. package/date/getMonday.d.ts +0 -15
  208. package/date/getMonday.js +0 -46
  209. package/date/getNumber.d.ts +0 -7
  210. package/date/getNumber.js +0 -20
  211. package/date/getPredefinedTimeframe.d.ts +0 -8
  212. package/date/getPredefinedTimeframe.js +0 -24
  213. package/date/getSunday.d.ts +0 -15
  214. package/date/getSunday.js +0 -42
  215. package/date/getThisWeek.d.ts +0 -10
  216. package/date/getThisWeek.js +0 -36
  217. package/date/getTimeZoned.d.ts +0 -13
  218. package/date/getTimeZoned.js +0 -55
  219. package/date/getToday.d.ts +0 -9
  220. package/date/getToday.js +0 -24
  221. package/date/getTodayYmd.d.ts +0 -5
  222. package/date/getTodayYmd.js +0 -21
  223. package/date/getTodayYmdhis.d.ts +0 -5
  224. package/date/getTodayYmdhis.js +0 -21
  225. package/date/getTwoWeeksAgo.d.ts +0 -10
  226. package/date/getTwoWeeksAgo.js +0 -36
  227. package/date/getWeeksAgo.d.ts +0 -13
  228. package/date/getWeeksAgo.js +0 -25
  229. package/date/getYesterday.d.ts +0 -9
  230. package/date/getYesterday.js +0 -52
  231. package/date/index.d.ts +0 -55
  232. package/date/index.js +0 -36
  233. package/date/isDateValid.d.ts +0 -7
  234. package/date/isDateValid.js +0 -20
  235. package/date/isLastWeek.d.ts +0 -6
  236. package/date/isLastWeek.js +0 -14
  237. package/date/isThisWeek.d.ts +0 -6
  238. package/date/isThisWeek.js +0 -14
  239. package/date/parseExcelDate.d.ts +0 -8
  240. package/date/parseExcelDate.js +0 -19
  241. package/environment/getEnvironment.d.ts +0 -6
  242. package/environment/getEnvironment.js +0 -43
  243. package/environment/index.d.ts +0 -9
  244. package/environment/index.js +0 -14
  245. package/environment/isAws.d.ts +0 -5
  246. package/environment/isAws.js +0 -8
  247. package/environment/isDevelopment.d.ts +0 -2
  248. package/environment/isDevelopment.js +0 -9
  249. package/environment/isLocalhost.d.ts +0 -5
  250. package/environment/isLocalhost.js +0 -25
  251. package/environment/isProduction.d.ts +0 -2
  252. package/environment/isProduction.js +0 -9
  253. package/environment/isStaging.d.ts +0 -2
  254. package/environment/isStaging.js +0 -9
  255. package/environment/isVercel.d.ts +0 -5
  256. package/environment/isVercel.js +0 -7
  257. package/eskimi/ageGroups.d.ts +0 -5
  258. package/eskimi/ageGroups.js +0 -41
  259. package/eskimi/campaign.d.ts +0 -19
  260. package/eskimi/campaign.js +0 -2
  261. package/eskimi/devices.d.ts +0 -5
  262. package/eskimi/devices.js +0 -13
  263. package/eskimi/endpoints.d.ts +0 -16
  264. package/eskimi/endpoints.js +0 -18
  265. package/eskimi/genders.d.ts +0 -5
  266. package/eskimi/genders.js +0 -13
  267. package/eskimi/getAccessToken.d.ts +0 -9
  268. package/eskimi/getAccessToken.js +0 -23
  269. package/eskimi/getAgeGroup.d.ts +0 -7
  270. package/eskimi/getAgeGroup.js +0 -17
  271. package/eskimi/getCampaignIds.d.ts +0 -7
  272. package/eskimi/getCampaignIds.js +0 -12
  273. package/eskimi/getData.d.ts +0 -8
  274. package/eskimi/getData.js +0 -23
  275. package/eskimi/getDevice.d.ts +0 -7
  276. package/eskimi/getDevice.js +0 -17
  277. package/eskimi/getGender.d.ts +0 -7
  278. package/eskimi/getGender.js +0 -17
  279. package/file/createDirectory.d.ts +0 -9
  280. package/file/createDirectory.js +0 -16
  281. package/file/writeFile.d.ts +0 -1
  282. package/file/writeFile.js +0 -2
  283. package/global/forceUpdate.d.ts +0 -8
  284. package/global/forceUpdate.js +0 -25
  285. package/global/init.d.ts +0 -10
  286. package/global/init.js +0 -18
  287. package/global/isSet.d.ts +0 -8
  288. package/global/isSet.js +0 -9
  289. package/global/maxCache.d.ts +0 -8
  290. package/global/maxCache.js +0 -17
  291. package/global/read.d.ts +0 -8
  292. package/global/read.js +0 -30
  293. package/google/bigQuery/IsTableExists.d.ts +0 -11
  294. package/google/bigQuery/IsTableExists.js +0 -25
  295. package/google/bigQuery/createDataset.d.ts +0 -11
  296. package/google/bigQuery/createDataset.js +0 -22
  297. package/google/bigQuery/createTable.d.ts +0 -12
  298. package/google/bigQuery/createTable.js +0 -31
  299. package/google/bigQuery/getClient.d.ts +0 -9
  300. package/google/bigQuery/getClient.js +0 -18
  301. package/google/bigQuery/getDatasets.d.ts +0 -13
  302. package/google/bigQuery/getDatasets.js +0 -27
  303. package/google/bigQuery/getTables.d.ts +0 -12
  304. package/google/bigQuery/getTables.js +0 -25
  305. package/google/bigQuery/initClient.d.ts +0 -11
  306. package/google/bigQuery/initClient.js +0 -29
  307. package/google/bigQuery/isDatasetExists.d.ts +0 -11
  308. package/google/bigQuery/isDatasetExists.js +0 -25
  309. package/google/bigQuery/loadData.d.ts +0 -18
  310. package/google/bigQuery/loadData.js +0 -32
  311. package/google/bigQuery/query.d.ts +0 -19
  312. package/google/bigQuery/query.js +0 -15
  313. package/google/getConfig.d.ts +0 -20
  314. package/google/getConfig.js +0 -23
  315. package/google/sheets/getAssociatedData.d.ts +0 -16
  316. package/google/sheets/getAssociatedData.js +0 -53
  317. package/google/sheets/getBatchData.d.ts +0 -18
  318. package/google/sheets/getBatchData.js +0 -19
  319. package/google/sheets/initClient.d.ts +0 -11
  320. package/google/sheets/initClient.js +0 -25
  321. package/google/sheets/isCellNa.d.ts +0 -7
  322. package/google/sheets/isCellNa.js +0 -7
  323. package/google/storage/copyToCloud.d.ts +0 -11
  324. package/google/storage/copyToCloud.js +0 -18
  325. package/google/storage/getClient.d.ts +0 -8
  326. package/google/storage/getClient.js +0 -18
  327. package/google/storage/initClient.d.ts +0 -12
  328. package/google/storage/initClient.js +0 -29
  329. package/google/storage/isFileExists.d.ts +0 -10
  330. package/google/storage/isFileExists.js +0 -19
  331. package/google/storage/writeFile.d.ts +0 -11
  332. package/google/storage/writeFile.js +0 -37
  333. package/googleAds/getCustomer.d.ts +0 -8
  334. package/googleAds/getCustomer.js +0 -14
  335. package/googleAds/initClient.d.ts +0 -16
  336. package/googleAds/initClient.js +0 -25
  337. package/googleAds/keywordPlanner/index.d.ts +0 -238
  338. package/googleAds/keywordPlanner/index.js +0 -244
  339. package/googleAds/keywordPlanner/request.d.ts +0 -18
  340. package/googleAds/keywordPlanner/request.js +0 -13
  341. package/googleAds/keywordPlanner/response.d.ts +0 -25
  342. package/googleAds/keywordPlanner/response.js +0 -2
  343. package/initClients.d.ts +0 -43
  344. package/initClients.js +0 -131
  345. package/json/getJsonNewline.d.ts +0 -5
  346. package/json/getJsonNewline.js +0 -17
  347. package/json/isJson.d.ts +0 -8
  348. package/json/isJson.js +0 -20
  349. package/littleWarden/getUrlStatus.d.ts +0 -9
  350. package/littleWarden/getUrlStatus.js +0 -21
  351. package/littleWarden/index.d.ts +0 -5
  352. package/littleWarden/index.js +0 -9
  353. package/littleWarden/isAllGood.d.ts +0 -7
  354. package/littleWarden/isAllGood.js +0 -15
  355. package/littleWarden/isDanger.d.ts +0 -7
  356. package/littleWarden/isDanger.js +0 -15
  357. package/littleWarden/isWarning.d.ts +0 -7
  358. package/littleWarden/isWarning.js +0 -15
  359. package/lumar/api/buildRequest.d.ts +0 -15
  360. package/lumar/api/buildRequest.js +0 -83
  361. package/lumar/api/filter.d.ts +0 -5
  362. package/lumar/api/filter.js +0 -2
  363. package/lumar/api/getData.d.ts +0 -6
  364. package/lumar/api/getData.js +0 -18
  365. package/lumar/api/initClient.d.ts +0 -13
  366. package/lumar/api/initClient.js +0 -38
  367. package/lumar/api/operands.d.ts +0 -11
  368. package/lumar/api/operands.js +0 -13
  369. package/lumar/api/orders.d.ts +0 -9
  370. package/lumar/api/orders.js +0 -7
  371. package/lumar/api/reports.d.ts +0 -11
  372. package/lumar/api/reports.js +0 -13
  373. package/lumar/graphql/columns.d.ts +0 -29
  374. package/lumar/graphql/columns.js +0 -31
  375. package/lumar/graphql/getData.d.ts +0 -9
  376. package/lumar/graphql/getData.js +0 -26
  377. package/lumar/graphql/getReportKey.d.ts +0 -9
  378. package/lumar/graphql/getReportKey.js +0 -9
  379. package/lumar/graphql/initClient.d.ts +0 -12
  380. package/lumar/graphql/initClient.js +0 -38
  381. package/lumar/graphql/operands.d.ts +0 -16
  382. package/lumar/graphql/operands.js +0 -18
  383. package/lumar/graphql/queries/crawl.d.ts +0 -5
  384. package/lumar/graphql/queries/crawl.js +0 -2
  385. package/lumar/graphql/queries/getCrawls.d.ts +0 -18
  386. package/lumar/graphql/queries/getCrawls.js +0 -33
  387. package/lumar/graphql/queries/getReportDifferences.d.ts +0 -24
  388. package/lumar/graphql/queries/getReportDifferences.js +0 -40
  389. package/lumar/graphql/queries/getRows.d.ts +0 -38
  390. package/lumar/graphql/queries/getRows.js +0 -57
  391. package/lumar/graphql/queries/getTotals.d.ts +0 -25
  392. package/lumar/graphql/queries/getTotals.js +0 -40
  393. package/lumar/graphql/queries/row.d.ts +0 -157
  394. package/lumar/graphql/queries/row.js +0 -2
  395. package/lumar/graphql/reportTemplates.d.ts +0 -68
  396. package/lumar/graphql/reportTemplates.js +0 -70
  397. package/lumar/graphql/reportTypes.d.ts +0 -7
  398. package/lumar/graphql/reportTypes.js +0 -9
  399. package/myTarget/getAccessToken.d.ts +0 -9
  400. package/myTarget/getAccessToken.js +0 -23
  401. package/myTarget/request.d.ts +0 -9
  402. package/myTarget/request.js +0 -23
  403. package/nextAuth/index.d.ts +0 -5
  404. package/nextAuth/index.js +0 -9
  405. package/nextAuth/isSessionReady.d.ts +0 -4
  406. package/nextAuth/isSessionReady.js +0 -12
  407. package/nextJs/getIp.d.ts +0 -7
  408. package/nextJs/getIp.js +0 -13
  409. package/nextJs/getUserAgent.d.ts +0 -7
  410. package/nextJs/getUserAgent.js +0 -7
  411. package/number/format.d.ts +0 -11
  412. package/number/format.js +0 -23
  413. package/number/getCurrency.d.ts +0 -10
  414. package/number/getCurrency.js +0 -20
  415. package/number/getDecimal.d.ts +0 -9
  416. package/number/getDecimal.js +0 -16
  417. package/number/getDivide.d.ts +0 -11
  418. package/number/getDivide.js +0 -26
  419. package/number/getNumber.d.ts +0 -8
  420. package/number/getNumber.js +0 -51
  421. package/number/getPercentIncrease.d.ts +0 -10
  422. package/number/getPercentIncrease.js +0 -22
  423. package/object/replaceKeys.d.ts +0 -10
  424. package/object/replaceKeys.js +0 -30
  425. package/prisma/getDecimal.d.ts +0 -9
  426. package/prisma/getDecimal.js +0 -25
  427. package/prisma/initClient.d.ts +0 -6
  428. package/prisma/initClient.js +0 -36
  429. package/snapchat/getAccessToken.d.ts +0 -9
  430. package/snapchat/getAccessToken.js +0 -35
  431. package/sorting/byNumberAscending.d.ts +0 -8
  432. package/sorting/byNumberAscending.js +0 -17
  433. package/sorting/byNumberDescending.d.ts +0 -8
  434. package/sorting/byNumberDescending.js +0 -17
  435. package/sorting/byStringAscending.d.ts +0 -8
  436. package/sorting/byStringAscending.js +0 -21
  437. package/sorting/byStringDescending.d.ts +0 -8
  438. package/sorting/byStringDescending.js +0 -21
  439. package/stream/sort.d.ts +0 -14
  440. package/stream/sort.js +0 -50
  441. package/string/getCapitalised.d.ts +0 -10
  442. package/string/getCapitalised.js +0 -17
  443. package/string/getClean.d.ts +0 -18
  444. package/string/getClean.js +0 -65
  445. package/string/getDecoded.d.ts +0 -10
  446. package/string/getDecoded.js +0 -26
  447. package/string/getFolder.d.ts +0 -8
  448. package/string/getFolder.js +0 -14
  449. package/string/getProperCase.d.ts +0 -11
  450. package/string/getProperCase.js +0 -27
  451. package/string/getString.d.ts +0 -7
  452. package/string/getString.js +0 -34
  453. package/string/getStringFromStream.d.ts +0 -8
  454. package/string/getStringFromStream.js +0 -16
  455. package/string/getWithoutAccents.d.ts +0 -9
  456. package/string/getWithoutAccents.js +0 -16
  457. package/string/getWithoutHtmlTags.d.ts +0 -9
  458. package/string/getWithoutHtmlTags.js +0 -15
  459. package/string/getWithoutPunctuation.d.ts +0 -9
  460. package/string/getWithoutPunctuation.js +0 -16
  461. package/string/getWithoutUnderscores.d.ts +0 -8
  462. package/string/getWithoutUnderscores.js +0 -14
  463. package/string/getWithoutWhitespaces.d.ts +0 -9
  464. package/string/getWithoutWhitespaces.js +0 -16
  465. package/swr/isAllData.d.ts +0 -7
  466. package/swr/isAllData.js +0 -19
  467. package/swr/isAnyError.d.ts +0 -7
  468. package/swr/isAnyError.js +0 -19
  469. package/swr/isAnyLoading.d.ts +0 -7
  470. package/swr/isAnyLoading.js +0 -21
  471. package/swr/isData.d.ts +0 -7
  472. package/swr/isData.js +0 -9
  473. package/swr/isError.d.ts +0 -7
  474. package/swr/isError.js +0 -7
  475. package/swr/isLoading.d.ts +0 -7
  476. package/swr/isLoading.js +0 -12
  477. package/upTimeRobot/getMonitors.d.ts +0 -1
  478. package/upTimeRobot/getMonitors.js +0 -33
  479. package/upTimeRobot/logTypes.d.ts +0 -7
  480. package/upTimeRobot/logTypes.js +0 -9
  481. package/upTimeRobot/monitorStatuses.d.ts +0 -8
  482. package/upTimeRobot/monitorStatuses.js +0 -10
  483. package/upTimeRobot/monitorSubTypes.d.ts +0 -10
  484. package/upTimeRobot/monitorSubTypes.js +0 -12
  485. package/upTimeRobot/monitorTypes.d.ts +0 -8
  486. package/upTimeRobot/monitorTypes.js +0 -10
  487. package/upTimeRobot/requestStatuses.d.ts +0 -5
  488. package/upTimeRobot/requestStatuses.js +0 -7
  489. package/url/buildParameters.d.ts +0 -8
  490. package/url/buildParameters.js +0 -22
  491. package/url/buildRelative.d.ts +0 -8
  492. package/url/buildRelative.js +0 -13
  493. package/url/buildUrl.d.ts +0 -10
  494. package/url/buildUrl.js +0 -29
  495. package/url/isAbsolute.d.ts +0 -7
  496. package/url/isAbsolute.js +0 -15
  497. package/url/isRelative.d.ts +0 -7
  498. package/url/isRelative.js +0 -8
  499. package/url/url.d.ts +0 -6
  500. package/url/url.js +0 -2
  501. package/url/writeUrlContents.d.ts +0 -11
  502. package/url/writeUrlContents.js +0 -43
  503. package/util/defaultTo.d.ts +0 -10
  504. package/util/defaultTo.js +0 -43
  505. package/util/getBrotliCompressed.d.ts +0 -9
  506. package/util/getBrotliCompressed.js +0 -19
  507. package/util/getBrotliDecompressed.d.ts +0 -9
  508. package/util/getBrotliDecompressed.js +0 -20
  509. package/util/getClean.d.ts +0 -11
  510. package/util/getClean.js +0 -28
  511. package/util/getGzipCompressed.d.ts +0 -9
  512. package/util/getGzipCompressed.js +0 -19
  513. package/util/getGzipDecompressed.d.ts +0 -9
  514. package/util/getGzipDecompressed.js +0 -20
  515. package/util/getWithoutHash.d.ts +0 -8
  516. package/util/getWithoutHash.js +0 -17
  517. package/util/getWithoutParameter.d.ts +0 -8
  518. package/util/getWithoutParameter.js +0 -17
  519. package/util/isUndefined.d.ts +0 -9
  520. package/util/isUndefined.js +0 -19
  521. package/util/promiseChunks.d.ts +0 -10
  522. package/util/promiseChunks.js +0 -18
  523. package/util/sleep.d.ts +0 -5
  524. package/util/sleep.js +0 -6
  525. package/webWorker/index.d.ts +0 -5
  526. package/webWorker/index.js +0 -9
  527. package/xml/getXml.d.ts +0 -5
  528. package/xml/getXml.js +0 -22
  529. /package/{aws/sqs/isEventSqs.d.ts → dist/aws/s3cache/index.mjs} +0 -0
@@ -0,0 +1,9 @@
1
+ //#region src/littleWarden/index.ts
2
+ let State = /* @__PURE__ */ function(State) {
3
+ State["ALL_GOOD"] = "all_good";
4
+ State["DANGER"] = "danger";
5
+ State["WARNING"] = "warning";
6
+ return State;
7
+ }({});
8
+ //#endregion
9
+ export { State };
@@ -0,0 +1,9 @@
1
+ //#region src/nextAuth/index.d.ts
2
+ declare enum State {
3
+ AUTHENTICATED = "authenticated",
4
+ PENDING = "loading",
5
+ // Defined by NextAuth
6
+ UNAUTHENTICATED = "unauthenticated"
7
+ }
8
+ //#endregion
9
+ export { State };
@@ -0,0 +1,9 @@
1
+ //#region src/nextAuth/index.ts
2
+ let State = /* @__PURE__ */ function(State) {
3
+ State["AUTHENTICATED"] = "authenticated";
4
+ State["PENDING"] = "loading";
5
+ State["UNAUTHENTICATED"] = "unauthenticated";
6
+ return State;
7
+ }({});
8
+ //#endregion
9
+ export { State };
@@ -0,0 +1,8 @@
1
+ //#region src/webWorker/index.d.ts
2
+ declare enum State {
3
+ ERROR = "ERROR",
4
+ SUCCESS = "SUCCESS",
5
+ PROGRESS = "PROGRESS"
6
+ }
7
+ //#endregion
8
+ export { State };
@@ -0,0 +1,9 @@
1
+ //#region src/webWorker/index.ts
2
+ let State = /* @__PURE__ */ function(State) {
3
+ State["ERROR"] = "ERROR";
4
+ State["SUCCESS"] = "SUCCESS";
5
+ State["PROGRESS"] = "PROGRESS";
6
+ return State;
7
+ }({});
8
+ //#endregion
9
+ export { State };
package/package.json CHANGED
@@ -1,54 +1,72 @@
1
1
  {
2
- "name": "@8ms/helpers",
3
- "license": "UNLICENSED",
4
- "version": "1.39.0",
5
- "repository": {
2
+ "name": "@8ms/helpers",
3
+ "license": "UNLICENSED",
4
+ "version": "1.40.0",
5
+ "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"
7
+ "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"
8
8
  },
9
- "main": "index.js",
10
- "types": "index.d.ts",
11
- "scripts": {
12
- "build": "tsc",
13
- "jest": "jest --watch"
9
+ "types": "dist/index.d.ts",
10
+ "scripts": {
11
+ "build": "tsdown",
12
+ "jest": "jest --watch"
14
13
  },
15
- "dependencies": {
16
- "@date-fns/tz": "1.2.0",
14
+ "packageManager": "yarn@4.12.0",
15
+ "engines": {
16
+ "node": "24"
17
+ },
18
+ "dependencies": {
19
+ "@date-fns/tz": "1.2.0",
17
20
  "@date-fns/utc": "2.1.0",
18
- "axios": "1.7.8",
19
- "crypto-js": "4.2.0",
20
- "date-fns": "4.1.0",
21
- "lodash": "4.17.21",
22
- "zod": "3.23.8"
21
+ "crypto-js": "4.2.0",
22
+ "date-fns": "4.1.0",
23
+ "fs-extra": "^11.3.4",
24
+ "ky": "^2.0.0",
25
+ "lodash": "4.17.21",
26
+ "zod": "3.23.8"
23
27
  },
24
28
  "devDependencies": {
25
- "@aws-sdk/client-ec2": "3.701.0",
26
- "@aws-sdk/client-ecs": "3.699.0",
27
- "@aws-sdk/client-s3": "3.701.0",
28
- "@aws-sdk/client-ses": "3.699.0",
29
- "@aws-sdk/client-sqs": "3.699.0",
30
- "@aws-sdk/client-ssm": "3.699.0",
31
- "@aws-sdk/lib-storage": "3.701.0",
29
+ "@aws-sdk/client-ec2": "3.701.0",
30
+ "@aws-sdk/client-ecs": "3.699.0",
31
+ "@aws-sdk/client-s3": "3.701.0",
32
+ "@aws-sdk/client-ses": "3.699.0",
33
+ "@aws-sdk/client-sqs": "3.699.0",
34
+ "@aws-sdk/client-ssm": "3.699.0",
35
+ "@aws-sdk/lib-storage": "3.701.0",
32
36
  "@aws-sdk/s3-request-presigner": "3.701.0",
33
- "@babel/preset-env": "7.26.0",
34
- "@babel/preset-flow": "7.25.9",
35
- "@babel/preset-typescript": "7.26.0",
36
- "@google-cloud/bigquery": "7.9.1",
37
- "@google-cloud/storage": "7.14.0",
38
- "@planetscale/database": "1.19.0",
39
- "@prisma/adapter-planetscale": "5.22.0",
40
- "@prisma/client": "5.22.0",
41
- "@types/jest": "29.5.14",
42
- "@types/lodash": "4.17.13",
43
- "@types/node": "20.14.12",
44
- "babel-jest": "29.7.0",
45
- "jest": "29.7.0",
46
- "node-fetch": "3.3.2",
47
- "stream-chain": "3.3.2",
48
- "stream-json": "1.9.1",
49
- "timezone-mock": "1.3.6",
50
- "ts-node": "10.9.2",
51
- "tslib": "2.8.1",
52
- "typescript": "5.7.2"
37
+ "@babel/preset-env": "7.26.0",
38
+ "@babel/preset-flow": "7.25.9",
39
+ "@babel/preset-typescript": "7.26.0",
40
+ "@google-cloud/bigquery": "7.9.1",
41
+ "@google-cloud/storage": "7.14.0",
42
+ "@planetscale/database": "1.19.0",
43
+ "@prisma/adapter-planetscale": "5.22.0",
44
+ "@prisma/client": "5.22.0",
45
+ "@types/fs-extra": "^11",
46
+ "@types/jest": "29.5.14",
47
+ "@types/lodash": "4.17.13",
48
+ "@types/node": "20.14.12",
49
+ "babel-jest": "29.7.0",
50
+ "jest": "29.7.0",
51
+ "node-fetch": "3.3.2",
52
+ "stream-chain": "3.3.2",
53
+ "stream-json": "1.9.1",
54
+ "timezone-mock": "1.3.6",
55
+ "ts-node": "10.9.2",
56
+ "tsdown": "^0.21.7",
57
+ "tslib": "2.8.1",
58
+ "typescript": "5.7.2"
59
+ },
60
+ "exports": {
61
+ "./api": "./dist/api/index.mjs",
62
+ "./aws/s3cache": "./dist/aws/s3cache/index.mjs",
63
+ "./crud": "./dist/crud/index.mjs",
64
+ "./date": "./dist/date/index.mjs",
65
+ "./environment": "./dist/environment/index.mjs",
66
+ "./googleAds/keywordPlanner": "./dist/googleAds/keywordPlanner/index.mjs",
67
+ "./littleWarden": "./dist/littleWarden/index.mjs",
68
+ "./nextAuth": "./dist/nextAuth/index.mjs",
69
+ "./webWorker": "./dist/webWorker/index.mjs",
70
+ "./package.json": "./package.json"
53
71
  }
54
72
  }
@@ -1,17 +0,0 @@
1
- on:
2
- push:
3
- branches: [ main ]
4
-
5
- jobs:
6
- publish:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - uses: actions/checkout@v4.2.1
10
- - uses: actions/setup-node@v4.0.4
11
- with:
12
- node-version: 20
13
- - run: yarn
14
- - run: yarn build
15
- - uses: JS-DevTools/npm-publish@v3.1.1
16
- with:
17
- token: ${{ secrets.NPM_TOKEN }}
@@ -1,50 +0,0 @@
1
- import { Response } from "./response";
2
- import { State } from "./";
3
- type Constructor = {
4
- body?: any;
5
- error?: any;
6
- state?: State;
7
- };
8
- /**
9
- * Class version of the API to enable quicker instances.
10
- */
11
- declare class ApiResponse {
12
- state: State;
13
- body: any;
14
- error: any;
15
- constructor({ body, error, state }?: Constructor);
16
- fromJson({ input }: {
17
- input: Response;
18
- }): this;
19
- getBody(): any;
20
- getBodyDefaultTo({ defaultValue, keys }: {
21
- defaultValue: any;
22
- keys: any | any[];
23
- }): any;
24
- getError(): any;
25
- getJson(): Response;
26
- getState(): State;
27
- isError(): boolean;
28
- isIdle(): boolean;
29
- isPending(): boolean;
30
- isSuccess(): boolean;
31
- setToIdle(): this;
32
- setToPending(): this;
33
- setToError({ body, error }: {
34
- body?: any;
35
- error: any;
36
- }): this;
37
- setToSuccess({ body }: {
38
- body: any;
39
- }): this;
40
- setBody({ body }: {
41
- body: any;
42
- }): this;
43
- setError({ error }: {
44
- error: any;
45
- }): this;
46
- setState({ state }: {
47
- state: State;
48
- }): this;
49
- }
50
- export default ApiResponse;
@@ -1,94 +0,0 @@
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
- const defaultTo_1 = __importDefault(require("../util/defaultTo"));
7
- const _1 = require("./");
8
- /**
9
- * Class version of the API to enable quicker instances.
10
- */
11
- class ApiResponse {
12
- constructor({ body, error, state } = {}) {
13
- this.state = _1.State.IDLE;
14
- this.body = null;
15
- this.error = null;
16
- this.body = body || null;
17
- this.error = error || null;
18
- this.state = state || _1.State.IDLE;
19
- return this;
20
- }
21
- fromJson({ input }) {
22
- this.body = input.body;
23
- this.error = input.error;
24
- this.state = input.state;
25
- return this;
26
- }
27
- getBody() {
28
- return this.body;
29
- }
30
- getBodyDefaultTo({ defaultValue, keys }) {
31
- return (0, defaultTo_1.default)({
32
- defaultValue,
33
- instance: this.body,
34
- keys,
35
- });
36
- }
37
- getError() {
38
- return this.error;
39
- }
40
- getJson() {
41
- return {
42
- body: this.body,
43
- error: this.error,
44
- state: this.state,
45
- };
46
- }
47
- getState() {
48
- return this.state;
49
- }
50
- isError() {
51
- return this.state === _1.State.ERROR;
52
- }
53
- isIdle() {
54
- return this.state === _1.State.IDLE;
55
- }
56
- isPending() {
57
- return this.state === _1.State.PENDING;
58
- }
59
- isSuccess() {
60
- return this.state === _1.State.SUCCESS;
61
- }
62
- setToIdle() {
63
- this.state = _1.State.IDLE;
64
- return this;
65
- }
66
- setToPending() {
67
- this.state = _1.State.PENDING;
68
- return this;
69
- }
70
- setToError({ body, error }) {
71
- this.body = body || null;
72
- this.error = error;
73
- this.state = _1.State.ERROR;
74
- return this;
75
- }
76
- setToSuccess({ body }) {
77
- this.body = body;
78
- this.state = _1.State.SUCCESS;
79
- return this;
80
- }
81
- setBody({ body }) {
82
- this.body = body;
83
- return this;
84
- }
85
- setError({ error }) {
86
- this.error = error;
87
- return this;
88
- }
89
- setState({ state }) {
90
- this.state = state;
91
- return this;
92
- }
93
- }
94
- exports.default = ApiResponse;
package/api/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export declare enum State {
2
- CANCELLED = "CANCELLED",
3
- ERROR = "ERROR",
4
- IDLE = "IDLE",
5
- PENDING = "PENDING",
6
- SUCCESS = "SUCCESS",
7
- VALIDATION_ERROR = "VALIDATION_ERROR"
8
- }
9
- export declare const unexpectedError: string;
package/api/index.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unexpectedError = exports.State = void 0;
4
- var State;
5
- (function (State) {
6
- State["CANCELLED"] = "CANCELLED";
7
- State["ERROR"] = "ERROR";
8
- State["IDLE"] = "IDLE";
9
- State["PENDING"] = "PENDING";
10
- State["SUCCESS"] = "SUCCESS";
11
- State["VALIDATION_ERROR"] = "VALIDATION_ERROR";
12
- })(State || (exports.State = State = {}));
13
- exports.unexpectedError = "An unexpected error occurred, please try again.";
package/api/isError.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { Response } from "./response";
2
- type IsError = {
3
- response: Response;
4
- };
5
- declare const isError: (props: IsError) => boolean;
6
- export default isError;
package/api/isError.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const _1 = require("./");
4
- const isError = (props) => {
5
- return _1.State.ERROR === props.response.state;
6
- };
7
- exports.default = isError;
@@ -1,6 +0,0 @@
1
- import { Response } from './response';
2
- type IsSuccess = {
3
- response: Response;
4
- };
5
- declare const isSuccess: (props: IsSuccess) => boolean;
6
- export default isSuccess;
package/api/isSuccess.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const _1 = require("./");
4
- const isSuccess = (props) => {
5
- return _1.State.SUCCESS === props.response.state;
6
- };
7
- exports.default = isSuccess;
package/api/response.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { State } from "./";
2
- export type Response = {
3
- body: any | null;
4
- error: string | null;
5
- state: State;
6
- };
7
- declare const response: Response;
8
- export default response;
package/api/response.js DELETED
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const _1 = require("./");
4
- const response = {
5
- body: null,
6
- error: null,
7
- state: _1.State.IDLE,
8
- };
9
- exports.default = response;
@@ -1,9 +0,0 @@
1
- type Contains = {
2
- haystack: any;
3
- needle: any;
4
- };
5
- /**
6
- * Shorthand to check if an array or string contains a needle.
7
- */
8
- declare const contains: (props: Contains) => boolean;
9
- export default contains;
package/array/contains.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * Shorthand to check if an array or string contains a needle.
5
- */
6
- const contains = (props) => -1 !== props.haystack.indexOf(props.needle);
7
- exports.default = contains;
@@ -1,8 +0,0 @@
1
- type GetArray = {
2
- input: any;
3
- };
4
- /**
5
- * Convert an array into an array or return if already an array.
6
- */
7
- declare const getArray: (props: GetArray) => any[];
8
- export default getArray;
package/array/getArray.js DELETED
@@ -1,11 +0,0 @@
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
- const isArray_1 = __importDefault(require("lodash/isArray"));
7
- /**
8
- * Convert an array into an array or return if already an array.
9
- */
10
- const getArray = (props) => (0, isArray_1.default)(props.input) ? props.input : [props.input];
11
- exports.default = getArray;
@@ -1,30 +0,0 @@
1
- /**
2
- * The request in the structure required by AT Internet.
3
- */
4
- export type Request = {
5
- columns: string[];
6
- evo?: {
7
- [evoKey: string]: object;
8
- };
9
- filter?: {
10
- [filterKey: string]: object;
11
- };
12
- "max-results": number;
13
- options: {
14
- "ignore_null_properties": boolean;
15
- };
16
- "page-num": number;
17
- period: {
18
- [periodKey: string]: [
19
- {
20
- type: string;
21
- start: string;
22
- end: string;
23
- }
24
- ];
25
- };
26
- sort: string[];
27
- space: {
28
- s: number[];
29
- };
30
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +0,0 @@
1
- import { Config } from '../getConfig';
2
- type InitClient = {
3
- config: Config;
4
- database: string;
5
- s3Bucket: string;
6
- s3Key: string;
7
- };
8
- /**
9
- * Initialise the database using manually provided credentials.
10
- */
11
- declare const initClient: (props: InitClient) => void;
12
- export default initClient;
@@ -1,31 +0,0 @@
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
- const getConfig_1 = __importDefault(require("../getConfig"));
7
- global.awsAthenaExpressClient = null;
8
- /**
9
- * Initialise the database using manually provided credentials.
10
- */
11
- const initClient = (props) => {
12
- if (!global.awsAthenaExpressClient) {
13
- const athenaExpress = require('athena-express');
14
- const awsSdk = require('aws-sdk');
15
- const formattedConfig = (0, getConfig_1.default)({
16
- config: props.config,
17
- isAthenaExpress: true
18
- });
19
- // Set the aws authentication
20
- awsSdk.config.update(formattedConfig);
21
- global.awsAthenaExpressClient = new athenaExpress.AthenaExpress({
22
- aws: awsSdk,
23
- s3: `s3://${props.s3Bucket}/${props.s3Key}`,
24
- db: props.database,
25
- formatJson: true,
26
- retry: 200,
27
- getStats: false,
28
- });
29
- }
30
- };
31
- exports.default = initClient;
@@ -1,8 +0,0 @@
1
- type Query = {
2
- query: string;
3
- };
4
- /**
5
- * Build the query and return the data.
6
- */
7
- declare const query: (props: Query) => Promise<any>;
8
- export default query;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * Build the query and return the data.
5
- */
6
- const query = async (props) => {
7
- return await global.awsAthenaExpressClient.query(props.query)
8
- .then(data => {
9
- let subResponse = [];
10
- if (undefined !== data['Items']) {
11
- subResponse = data['Items'];
12
- }
13
- return subResponse;
14
- });
15
- };
16
- exports.default = query;
@@ -1,11 +0,0 @@
1
- import { Config } from "../getConfig";
2
- type InitClient = {
3
- config: Config;
4
- };
5
- /**
6
- * Shorthand function to get the EC2 Client.
7
- * Library: @aws-sdk/client-ec2
8
- * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/
9
- */
10
- export declare const initClient: (props: InitClient) => void;
11
- export {};
@@ -1,23 +0,0 @@
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
- exports.initClient = void 0;
7
- const getConfig_1 = __importDefault(require("../getConfig"));
8
- global.awsEc2Client = null;
9
- /**
10
- * Shorthand function to get the EC2 Client.
11
- * Library: @aws-sdk/client-ec2
12
- * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/
13
- */
14
- const initClient = (props) => {
15
- if (!global.awsEc2Client) {
16
- const { EC2Client } = require("@aws-sdk/client-ec2");
17
- const formattedConfig = (0, getConfig_1.default)({
18
- config: props.config
19
- });
20
- global.awsEc2Client = new EC2Client(formattedConfig);
21
- }
22
- };
23
- exports.initClient = initClient;
@@ -1,11 +0,0 @@
1
- type StartInstances = {
2
- additionalInfo?: string;
3
- instanceIds: string[];
4
- dryRun?: boolean;
5
- };
6
- /**
7
- * Start one or more Ec2 Instances.
8
- * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/StartInstancesCommand/
9
- */
10
- export declare const startInstances: (props: StartInstances) => Promise<any>;
11
- export {};
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.startInstances = void 0;
4
- /**
5
- * Start one or more Ec2 Instances.
6
- * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/StartInstancesCommand/
7
- */
8
- const startInstances = async (props) => {
9
- const { StartInstancesCommand } = require("@aws-sdk/client-ec2");
10
- const command = new StartInstancesCommand({
11
- InstanceIds: props.instanceIds,
12
- AdditionalInfo: props?.additionalInfo,
13
- DryRun: props?.dryRun,
14
- });
15
- const response = await global.awsEc2Client.send(command);
16
- return response;
17
- };
18
- exports.startInstances = startInstances;
@@ -1,12 +0,0 @@
1
- type StopInstances = {
2
- dryRun?: boolean;
3
- instanceIds: string[];
4
- hibernate?: boolean;
5
- force?: boolean;
6
- };
7
- /**
8
- * Stop one or more Ec2 Instances.
9
- * https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/StopInstancesCommand/
10
- */
11
- export declare const stopInstances: (props: StopInstances) => Promise<any>;
12
- export {};