@8ms/helpers 1.39.0 → 2.0.1

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 (663) hide show
  1. package/.github/workflows/deploy_npmjs.yml +29 -14
  2. package/.yarn/install-state.gz +0 -0
  3. package/.yarn/releases/yarn-4.9.2.cjs +942 -0
  4. package/.yarnrc.yml +2 -0
  5. package/README.md +12 -0
  6. package/_class/BaseClass.d.ts +18 -0
  7. package/_class/BaseClass.js +53 -0
  8. package/_class/BaseNamespace.d.ts +9 -0
  9. package/_class/BaseNamespace.js +27 -0
  10. package/_class/index.d.ts +2 -0
  11. package/_class/index.js +7 -0
  12. package/adverity/getJobs.d.ts +15 -0
  13. package/adverity/getJobs.js +30 -0
  14. package/adverity/index.d.ts +112 -0
  15. package/adverity/index.js +61 -0
  16. package/api/ApiResponseClass.d.ts +35 -0
  17. package/api/ApiResponseClass.js +97 -0
  18. package/api/index.d.ts +14 -1
  19. package/api/index.js +41 -10
  20. package/array/index.d.ts +8 -0
  21. package/array/{getArray.js → index.js} +8 -2
  22. package/atInternet/index.d.ts +16 -0
  23. package/atInternet/index.js +18 -0
  24. package/aws/athenaExpress/AwsAthenaNamespace.d.ts +8 -0
  25. package/aws/athenaExpress/AwsAthenaNamespace.js +82 -0
  26. package/aws/athenaExpress/index.d.ts +10 -0
  27. package/aws/athenaExpress/index.js +40 -0
  28. package/aws/ec2/AwsEc2Namespace.d.ts +10 -0
  29. package/aws/ec2/AwsEc2Namespace.js +78 -0
  30. package/aws/ec2/index.d.ts +3 -0
  31. package/aws/ec2/index.js +16 -0
  32. package/aws/ecs/AwsEcsNamespace.d.ts +53 -0
  33. package/aws/ecs/AwsEcsNamespace.js +159 -0
  34. package/aws/ecs/index.d.ts +3 -0
  35. package/aws/ecs/index.js +16 -0
  36. package/aws/glue/AwsGlueNamespace.d.ts +12 -0
  37. package/aws/glue/AwsGlueNamespace.js +70 -0
  38. package/aws/glue/index.d.ts +3 -0
  39. package/aws/glue/index.js +16 -0
  40. package/aws/index.d.ts +9 -0
  41. package/aws/index.js +34 -0
  42. package/aws/isResponse200.d.ts +1 -4
  43. package/aws/isResponse200.js +5 -11
  44. package/aws/lambda/AwsLambdaNamespace.d.ts +21 -0
  45. package/aws/lambda/AwsLambdaNamespace.js +110 -0
  46. package/aws/lambda/index.d.ts +4 -0
  47. package/aws/lambda/index.js +21 -0
  48. package/aws/s3/AwsS3Namespace.d.ts +60 -0
  49. package/aws/s3/AwsS3Namespace.js +401 -0
  50. package/aws/s3/index.d.ts +25 -0
  51. package/aws/s3/index.js +36 -0
  52. package/aws/s3/payload.d.ts +42 -0
  53. package/aws/s3/payload.js +46 -0
  54. package/aws/ses/AwsSesNamespace.d.ts +18 -0
  55. package/{date/getYesterday.js → aws/ses/AwsSesNamespace.js} +34 -17
  56. package/aws/ses/SimpleEmail.d.ts +38 -33
  57. package/aws/ses/SimpleEmail.js +77 -85
  58. package/aws/ses/index.d.ts +4 -0
  59. package/aws/ses/index.js +18 -0
  60. package/aws/sqs/AwsSqsNamespace.d.ts +34 -0
  61. package/aws/sqs/AwsSqsNamespace.js +96 -0
  62. package/aws/sqs/index.d.ts +3 -0
  63. package/aws/sqs/index.js +16 -0
  64. package/aws/ssm/AwsSsmNamespace.d.ts +11 -0
  65. package/aws/ssm/AwsSsmNamespace.js +89 -0
  66. package/aws/ssm/index.d.ts +3 -0
  67. package/aws/ssm/index.js +16 -0
  68. package/axios/deleteRequest.d.ts +6 -0
  69. package/axios/{delete.js → deleteRequest.js} +10 -16
  70. package/axios/get.d.ts +2 -7
  71. package/axios/get.js +8 -15
  72. package/axios/index.d.ts +3 -0
  73. package/axios/index.js +9 -0
  74. package/axios/post.d.ts +2 -8
  75. package/axios/post.js +8 -14
  76. package/boolean/getBoolean.d.ts +1 -4
  77. package/boolean/getBoolean.js +10 -3
  78. package/boolean/index.d.ts +1 -0
  79. package/boolean/index.js +5 -0
  80. package/brightData/index.d.ts +15 -0
  81. package/brightData/index.js +20 -0
  82. package/brightData/serpApi/buildGoogleSerpUrl.d.ts +2 -2
  83. package/brightData/serpApi/buildGoogleSerpUrl.js +2 -1
  84. package/brightData/serpApi/buildGoogleTrendsUrl.d.ts +2 -2
  85. package/brightData/serpApi/buildGoogleTrendsUrl.js +2 -1
  86. package/brightData/serpApi/getAsyncRequestId.d.ts +3 -9
  87. package/brightData/serpApi/getAsyncRequestId.js +14 -28
  88. package/brightData/serpApi/getAsyncResults.d.ts +3 -8
  89. package/brightData/serpApi/getAsyncResults.js +14 -28
  90. package/brightData/serpApi/getRealtime.d.ts +2 -7
  91. package/brightData/serpApi/getRealtime.js +13 -18
  92. package/brightData/serpApi/index.d.ts +14 -0
  93. package/brightData/serpApi/index.js +23 -0
  94. package/brightData/webScraperIde/getBatch.d.ts +2 -9
  95. package/brightData/webScraperIde/getBatch.js +12 -18
  96. package/brightData/webScraperIde/getRealtime.d.ts +2 -8
  97. package/brightData/webScraperIde/getRealtime.js +18 -33
  98. package/brightData/webScraperIde/index.d.ts +2 -0
  99. package/brightData/webScraperIde/index.js +7 -0
  100. package/cache/index.d.ts +2 -0
  101. package/cache/index.js +48 -0
  102. package/cache/test/cache.test.js +10 -0
  103. package/crud/index.d.ts +1 -1
  104. package/crud/index.js +8 -8
  105. package/crypto/getDecrypt.d.ts +1 -6
  106. package/crypto/getDecrypt.js +37 -3
  107. package/crypto/getEncrypt.d.ts +1 -6
  108. package/crypto/getEncrypt.js +37 -3
  109. package/crypto/getRandom.d.ts +1 -5
  110. package/crypto/getRandom.js +3 -3
  111. package/crypto/getSha256.d.ts +1 -4
  112. package/crypto/getSha256.js +39 -8
  113. package/crypto/index.d.ts +4 -0
  114. package/crypto/index.js +11 -0
  115. package/date/calculation.d.ts +75 -0
  116. package/date/calculation.js +207 -0
  117. package/date/financialYear.d.ts +19 -0
  118. package/date/financialYear.js +85 -0
  119. package/date/format.d.ts +66 -8
  120. package/date/format.js +148 -19
  121. package/date/index.d.ts +28 -48
  122. package/date/index.js +53 -32
  123. package/environment/index.d.ts +23 -0
  124. package/environment/index.js +79 -1
  125. package/eskimi/getAgeGroup.d.ts +1 -4
  126. package/eskimi/getAgeGroup.js +6 -8
  127. package/eskimi/getData.d.ts +1 -5
  128. package/eskimi/getData.js +9 -15
  129. package/eskimi/getDevice.d.ts +1 -4
  130. package/eskimi/getDevice.js +6 -8
  131. package/eskimi/getGender.d.ts +1 -4
  132. package/eskimi/getGender.js +6 -8
  133. package/eskimi/index.d.ts +49 -0
  134. package/eskimi/index.js +96 -0
  135. package/file/createDirectory.d.ts +1 -5
  136. package/file/createDirectory.js +38 -4
  137. package/file/index.d.ts +1 -0
  138. package/file/index.js +5 -0
  139. package/geo/countries.d.ts +12 -0
  140. package/geo/countries.js +222 -0
  141. package/geo/index.d.ts +2 -0
  142. package/geo/index.js +7 -0
  143. package/geo/languages.d.ts +9 -0
  144. package/geo/languages.js +58 -0
  145. package/google/bigQuery/GoogleBigQueryNamespace.d.ts +51 -0
  146. package/google/bigQuery/GoogleBigQueryNamespace.js +165 -0
  147. package/google/bigQuery/index.d.ts +5 -0
  148. package/google/bigQuery/index.js +37 -0
  149. package/google/bigQuery/loadData.d.ts +6 -5
  150. package/google/bigQuery/loadData.js +8 -22
  151. package/google/{getConfig.d.ts → index.d.ts} +13 -6
  152. package/google/index.js +24 -0
  153. package/google/sheets/GoogleSheetsNamespace.d.ts +16 -0
  154. package/google/sheets/GoogleSheetsNamespace.js +81 -0
  155. package/google/sheets/getAssociatedData.d.ts +5 -11
  156. package/google/sheets/getAssociatedData.js +13 -23
  157. package/google/sheets/index.d.ts +8 -0
  158. package/google/sheets/index.js +37 -0
  159. package/google/storage/GoogleCloudStorageNamespace.d.ts +20 -0
  160. package/google/storage/GoogleCloudStorageNamespace.js +108 -0
  161. package/google/storage/index.d.ts +3 -0
  162. package/google/storage/index.js +30 -0
  163. package/googleAds/GoogleAdsNamespace.d.ts +11 -0
  164. package/googleAds/GoogleAdsNamespace.js +73 -0
  165. package/googleAds/index.d.ts +11 -0
  166. package/googleAds/index.js +30 -0
  167. package/googleAds/keywordPlanner/index.d.ts +36 -234
  168. package/googleAds/keywordPlanner/index.js +52 -237
  169. package/googlePageSpeed/GooglePageSpeedNamespace.d.ts +11 -0
  170. package/googlePageSpeed/GooglePageSpeedNamespace.js +35 -0
  171. package/googlePageSpeed/index.d.ts +17 -0
  172. package/googlePageSpeed/index.js +44 -0
  173. package/googleSearchIncidents/index.d.ts +69 -0
  174. package/googleSearchIncidents/index.js +46 -0
  175. package/greenDomain/index.d.ts +21 -0
  176. package/greenDomain/index.js +41 -0
  177. package/inngest/index.d.ts +6 -0
  178. package/inngest/index.js +10 -0
  179. package/json/getJsonNewline.d.ts +1 -5
  180. package/json/getJsonNewline.js +5 -9
  181. package/json/index.d.ts +2 -0
  182. package/json/index.js +7 -0
  183. package/json/isJson.d.ts +1 -8
  184. package/json/isJson.js +18 -12
  185. package/littleWarden/LittleWardenNamespace.d.ts +11 -0
  186. package/littleWarden/LittleWardenNamespace.js +38 -0
  187. package/littleWarden/getUrlStatus.d.ts +1 -6
  188. package/littleWarden/getUrlStatus.js +8 -13
  189. package/littleWarden/index.d.ts +25 -1
  190. package/littleWarden/index.js +72 -7
  191. package/lumar/api/buildRequest.d.ts +3 -5
  192. package/lumar/api/buildRequest.js +40 -43
  193. package/lumar/api/getData.d.ts +2 -3
  194. package/lumar/api/getData.js +6 -11
  195. package/lumar/api/index.d.ts +36 -0
  196. package/lumar/api/index.js +33 -0
  197. package/lumar/api/initClient.d.ts +1 -8
  198. package/lumar/api/initClient.js +17 -29
  199. package/lumar/graphql/columns.d.ts +1 -2
  200. package/lumar/graphql/columns.js +2 -2
  201. package/lumar/graphql/getData.d.ts +1 -9
  202. package/lumar/graphql/getData.js +13 -19
  203. package/lumar/graphql/index.d.ts +29 -0
  204. package/lumar/graphql/index.js +39 -0
  205. package/lumar/graphql/initClient.d.ts +1 -8
  206. package/lumar/graphql/initClient.js +17 -30
  207. package/lumar/graphql/queries/getReportDifferences.js +2 -5
  208. package/lumar/graphql/reportTemplates.d.ts +1 -2
  209. package/lumar/graphql/reportTemplates.js +2 -2
  210. package/myTarget/request.d.ts +2 -6
  211. package/myTarget/request.js +8 -14
  212. package/nextAuth/index.d.ts +2 -1
  213. package/nextAuth/index.js +9 -7
  214. package/nextAuth/isSessionReady.d.ts +1 -4
  215. package/nextAuth/isSessionReady.js +3 -2
  216. package/nextJs/getIp.d.ts +1 -2
  217. package/nextJs/getIp.js +2 -1
  218. package/nextJs/getUserAgent.d.ts +1 -2
  219. package/nextJs/getUserAgent.js +2 -1
  220. package/nextJs/index.d.ts +2 -0
  221. package/nextJs/index.js +7 -0
  222. package/number/format.d.ts +4 -3
  223. package/number/format.js +12 -15
  224. package/number/{getCurrency.d.ts → formatCurrency.d.ts} +1 -6
  225. package/number/{getCurrency.js → formatCurrency.js} +7 -6
  226. package/number/getDecimal.d.ts +1 -6
  227. package/number/getDecimal.js +6 -10
  228. package/number/getNumber.d.ts +1 -5
  229. package/number/getNumber.js +30 -33
  230. package/number/getPercentIncrease.d.ts +1 -7
  231. package/number/getPercentIncrease.js +6 -12
  232. package/number/{getDivide.d.ts → getSafeDivide.d.ts} +3 -3
  233. package/number/getSafeDivide.js +20 -0
  234. package/number/index.d.ts +6 -0
  235. package/number/index.js +15 -0
  236. package/object/index.d.ts +1 -0
  237. package/object/index.js +5 -0
  238. package/object/replaceKeys.d.ts +1 -6
  239. package/object/replaceKeys.js +5 -10
  240. package/onePassword/OnePasswordNamespace.d.ts +13 -0
  241. package/onePassword/OnePasswordNamespace.js +81 -0
  242. package/onePassword/index.d.ts +7 -0
  243. package/onePassword/index.js +25 -0
  244. package/openAi/OpenAiNamespace.d.ts +11 -0
  245. package/openAi/OpenAiNamespace.js +44 -0
  246. package/openAi/index.d.ts +5 -0
  247. package/openAi/index.js +30 -0
  248. package/package.json +175 -46
  249. package/prisma/PrismaNamespace.d.ts +8 -0
  250. package/prisma/PrismaNamespace.js +79 -0
  251. package/prisma/getDecimal.d.ts +1 -6
  252. package/prisma/getDecimal.js +8 -10
  253. package/prisma/index.d.ts +8 -0
  254. package/prisma/index.js +29 -0
  255. package/snapchat/SnapchatNamespace.d.ts +15 -0
  256. package/snapchat/SnapchatNamespace.js +30 -0
  257. package/snapchat/index.d.ts +7 -0
  258. package/snapchat/index.js +30 -0
  259. package/sorting/byNumberAscending.d.ts +1 -5
  260. package/sorting/byNumberAscending.js +11 -9
  261. package/sorting/byNumberDescending.d.ts +1 -5
  262. package/sorting/byNumberDescending.js +13 -8
  263. package/sorting/byStringAscending.d.ts +1 -5
  264. package/sorting/byStringAscending.js +6 -11
  265. package/sorting/byStringDescending.d.ts +1 -5
  266. package/sorting/byStringDescending.js +6 -11
  267. package/sorting/index.d.ts +4 -0
  268. package/sorting/index.js +11 -0
  269. package/stream/index.d.ts +1 -0
  270. package/stream/index.js +5 -0
  271. package/stream/sort.d.ts +2 -3
  272. package/stream/sort.js +3 -2
  273. package/string/getCapitalised.d.ts +1 -6
  274. package/string/getCapitalised.js +5 -4
  275. package/string/getClean.d.ts +3 -3
  276. package/string/getClean.js +30 -44
  277. package/string/getFolder.d.ts +1 -5
  278. package/string/getFolder.js +4 -3
  279. package/string/getProperCase.d.ts +4 -4
  280. package/string/getProperCase.js +10 -12
  281. package/string/getString.d.ts +1 -4
  282. package/string/getString.js +8 -8
  283. package/string/getStringFromStream.d.ts +1 -4
  284. package/string/getStringFromStream.js +7 -6
  285. package/string/{getDecoded.d.ts → getUnescaped.d.ts} +1 -5
  286. package/string/{getDecoded.js → getUnescaped.js} +5 -5
  287. package/string/getWithoutAccents.d.ts +1 -5
  288. package/string/getWithoutAccents.js +4 -7
  289. package/string/getWithoutHtmlTags.d.ts +1 -5
  290. package/string/getWithoutHtmlTags.js +5 -8
  291. package/string/getWithoutPunctuation.d.ts +1 -5
  292. package/string/getWithoutPunctuation.js +6 -9
  293. package/string/getWithoutUnderscores.d.ts +1 -5
  294. package/string/getWithoutUnderscores.js +5 -8
  295. package/string/getWithoutWhitespaces.d.ts +1 -5
  296. package/string/getWithoutWhitespaces.js +5 -8
  297. package/string/index.d.ts +12 -0
  298. package/string/index.js +27 -0
  299. package/swr/index.d.ts +42 -0
  300. package/swr/index.js +59 -0
  301. package/upTimeRobot/UpTimeRobotNamespace.d.ts +31 -0
  302. package/upTimeRobot/UpTimeRobotNamespace.js +52 -0
  303. package/upTimeRobot/index.d.ts +38 -0
  304. package/upTimeRobot/index.js +63 -0
  305. package/url/index.d.ts +19 -0
  306. package/url/index.js +70 -0
  307. package/url/writeUrlContents.d.ts +1 -6
  308. package/url/writeUrlContents.js +41 -9
  309. package/util/defaultTo.d.ts +1 -7
  310. package/util/defaultTo.js +10 -9
  311. package/util/getBrotliCompressed.d.ts +2 -6
  312. package/util/getBrotliCompressed.js +10 -6
  313. package/util/getBrotliDecompressed.d.ts +2 -6
  314. package/util/getBrotliDecompressed.js +9 -5
  315. package/util/getClean.d.ts +3 -3
  316. package/util/getClean.js +12 -17
  317. package/util/getGzipCompressed.d.ts +2 -6
  318. package/util/getGzipCompressed.js +10 -6
  319. package/util/getGzipDecompressed.d.ts +2 -6
  320. package/util/getGzipDecompressed.js +11 -7
  321. package/util/getWithoutHash.d.ts +1 -5
  322. package/util/getWithoutHash.js +5 -4
  323. package/util/getWithoutParameter.d.ts +1 -5
  324. package/util/getWithoutParameter.js +5 -4
  325. package/util/index.d.ts +11 -0
  326. package/util/index.js +25 -0
  327. package/util/isUndefined.d.ts +1 -6
  328. package/util/isUndefined.js +6 -12
  329. package/util/promiseChunks.d.ts +1 -6
  330. package/util/promiseChunks.js +4 -3
  331. package/util/sleep.d.ts +1 -5
  332. package/util/sleep.js +4 -3
  333. package/webWorker/index.d.ts +1 -1
  334. package/webWorker/index.js +7 -7
  335. package/xml/getXml.d.ts +1 -5
  336. package/xml/getXml.js +5 -9
  337. package/api/ApiResponse.d.ts +0 -50
  338. package/api/ApiResponse.js +0 -94
  339. package/api/isError.d.ts +0 -6
  340. package/api/isError.js +0 -7
  341. package/api/isSuccess.d.ts +0 -6
  342. package/api/isSuccess.js +0 -7
  343. package/api/response.d.ts +0 -8
  344. package/api/response.js +0 -9
  345. package/array/contains.d.ts +0 -9
  346. package/array/contains.js +0 -7
  347. package/array/getArray.d.ts +0 -8
  348. package/atInternet/request.d.ts +0 -30
  349. package/atInternet/request.js +0 -2
  350. package/aws/athenaExpress/initClient.d.ts +0 -12
  351. package/aws/athenaExpress/initClient.js +0 -31
  352. package/aws/athenaExpress/query.d.ts +0 -8
  353. package/aws/athenaExpress/query.js +0 -16
  354. package/aws/ec2/initClient.d.ts +0 -11
  355. package/aws/ec2/initClient.js +0 -23
  356. package/aws/ec2/startInstances.d.ts +0 -11
  357. package/aws/ec2/startInstances.js +0 -18
  358. package/aws/ec2/stopInstances.d.ts +0 -12
  359. package/aws/ec2/stopInstances.js +0 -19
  360. package/aws/ecs/getClusters.d.ts +0 -9
  361. package/aws/ecs/getClusters.js +0 -32
  362. package/aws/ecs/getTaskDefinitions.d.ts +0 -13
  363. package/aws/ecs/getTaskDefinitions.js +0 -35
  364. package/aws/ecs/getTasks.d.ts +0 -16
  365. package/aws/ecs/getTasks.js +0 -38
  366. package/aws/ecs/initClient.d.ts +0 -11
  367. package/aws/ecs/initClient.js +0 -23
  368. package/aws/ecs/runTask.d.ts +0 -16
  369. package/aws/ecs/runTask.js +0 -30
  370. package/aws/getConfig.d.ts +0 -13
  371. package/aws/getConfig.js +0 -27
  372. package/aws/glue/initClient.d.ts +0 -10
  373. package/aws/glue/initClient.js +0 -21
  374. package/aws/glue/invoke.d.ts +0 -9
  375. package/aws/glue/invoke.js +0 -23
  376. package/aws/lambda/getHandlerPath.d.ts +0 -5
  377. package/aws/lambda/getHandlerPath.js +0 -7
  378. package/aws/lambda/initClient.d.ts +0 -10
  379. package/aws/lambda/initClient.js +0 -21
  380. package/aws/lambda/invoke.d.ts +0 -13
  381. package/aws/lambda/invoke.js +0 -61
  382. package/aws/s3/copyFile.d.ts +0 -13
  383. package/aws/s3/copyFile.js +0 -14
  384. package/aws/s3/deleteFile.d.ts +0 -9
  385. package/aws/s3/deleteFile.js +0 -13
  386. package/aws/s3/deleteFiles.d.ts +0 -9
  387. package/aws/s3/deleteFiles.js +0 -17
  388. package/aws/s3/deleteFolder.d.ts +0 -9
  389. package/aws/s3/deleteFolder.js +0 -36
  390. package/aws/s3/getGlueJson.d.ts +0 -8
  391. package/aws/s3/getGlueJson.js +0 -11
  392. package/aws/s3/getPresignedPost.d.ts +0 -20
  393. package/aws/s3/getPresignedPost.js +0 -19
  394. package/aws/s3/getSignedUrl.d.ts +0 -12
  395. package/aws/s3/getSignedUrl.js +0 -17
  396. package/aws/s3/initClient.d.ts +0 -10
  397. package/aws/s3/initClient.js +0 -19
  398. package/aws/s3/isFileExists.d.ts +0 -9
  399. package/aws/s3/isFileExists.js +0 -27
  400. package/aws/s3/listFiles.d.ts +0 -9
  401. package/aws/s3/listFiles.js +0 -33
  402. package/aws/s3/listFilesIteratively.d.ts +0 -9
  403. package/aws/s3/listFilesIteratively.js +0 -44
  404. package/aws/s3/listFolders.d.ts +0 -9
  405. package/aws/s3/listFolders.js +0 -32
  406. package/aws/s3/moveFile.d.ts +0 -10
  407. package/aws/s3/moveFile.js +0 -21
  408. package/aws/s3/readBrotli.d.ts +0 -11
  409. package/aws/s3/readBrotli.js +0 -28
  410. package/aws/s3/readBuffer.d.ts +0 -13
  411. package/aws/s3/readBuffer.js +0 -39
  412. package/aws/s3/readFile.d.ts +0 -31
  413. package/aws/s3/readFile.js +0 -83
  414. package/aws/s3/readGzip.d.ts +0 -11
  415. package/aws/s3/readGzip.js +0 -28
  416. package/aws/s3/writeBrotli.d.ts +0 -12
  417. package/aws/s3/writeBrotli.js +0 -28
  418. package/aws/s3/writeFile.d.ts +0 -11
  419. package/aws/s3/writeFile.js +0 -16
  420. package/aws/s3/writeGzip.d.ts +0 -12
  421. package/aws/s3/writeGzip.js +0 -28
  422. package/aws/s3/writePresignedPost.d.ts +0 -14
  423. package/aws/s3/writePresignedPost.js +0 -31
  424. package/aws/s3/writeUrlContents.d.ts +0 -10
  425. package/aws/s3/writeUrlContents.js +0 -26
  426. package/aws/s3cache/getCache.d.ts +0 -11
  427. package/aws/s3cache/getCache.js +0 -37
  428. package/aws/s3cache/getKey.d.ts +0 -10
  429. package/aws/s3cache/getKey.js +0 -18
  430. package/aws/s3cache/index.d.ts +0 -6
  431. package/aws/s3cache/index.js +0 -2
  432. package/aws/s3cache/saveCache.d.ts +0 -10
  433. package/aws/s3cache/saveCache.js +0 -17
  434. package/aws/s3cache/updateCache.d.ts +0 -10
  435. package/aws/s3cache/updateCache.js +0 -24
  436. package/aws/ses/initClient.d.ts +0 -10
  437. package/aws/ses/initClient.js +0 -19
  438. package/aws/sqs/addToQueue.d.ts +0 -27
  439. package/aws/sqs/addToQueue.js +0 -26
  440. package/aws/sqs/deleteFromQueue.d.ts +0 -10
  441. package/aws/sqs/deleteFromQueue.js +0 -15
  442. package/aws/sqs/initClient.d.ts +0 -10
  443. package/aws/sqs/initClient.js +0 -19
  444. package/aws/sqs/isEventSqs.js +0 -13
  445. package/aws/ssm/getParameter.d.ts +0 -10
  446. package/aws/ssm/getParameter.js +0 -40
  447. package/aws/ssm/initClient.d.ts +0 -10
  448. package/aws/ssm/initClient.js +0 -19
  449. package/axios/delete.d.ts +0 -11
  450. package/brightData/getCustomerId.d.ts +0 -10
  451. package/brightData/getCustomerId.js +0 -11
  452. package/brightData/getZone.d.ts +0 -9
  453. package/brightData/getZone.js +0 -10
  454. package/brightData/param.d.ts +0 -9
  455. package/brightData/param.js +0 -3
  456. package/brightData/serpApi/type.d.ts +0 -11
  457. package/brightData/serpApi/type.js +0 -14
  458. package/class/BaseClass.d.ts +0 -31
  459. package/class/BaseClass.js +0 -50
  460. package/date/getDate.d.ts +0 -14
  461. package/date/getDate.js +0 -138
  462. package/date/getDatesBetween.d.ts +0 -13
  463. package/date/getDatesBetween.js +0 -54
  464. package/date/getDurationHours.d.ts +0 -9
  465. package/date/getDurationHours.js +0 -24
  466. package/date/getDurationMinutes.d.ts +0 -9
  467. package/date/getDurationMinutes.js +0 -22
  468. package/date/getFinancialYear.d.ts +0 -9
  469. package/date/getFinancialYear.js +0 -52
  470. package/date/getFinancialYearToDate.d.ts +0 -7
  471. package/date/getFinancialYearToDate.js +0 -20
  472. package/date/getFinancialYearToYesterday.d.ts +0 -7
  473. package/date/getFinancialYearToYesterday.js +0 -20
  474. package/date/getFinancialYearWeeks.d.ts +0 -9
  475. package/date/getFinancialYearWeeks.js +0 -33
  476. package/date/getLastWeek.d.ts +0 -10
  477. package/date/getLastWeek.js +0 -34
  478. package/date/getMax.d.ts +0 -13
  479. package/date/getMax.js +0 -24
  480. package/date/getMidnight.d.ts +0 -10
  481. package/date/getMidnight.js +0 -13
  482. package/date/getMin.d.ts +0 -13
  483. package/date/getMin.js +0 -24
  484. package/date/getMonday.d.ts +0 -15
  485. package/date/getMonday.js +0 -46
  486. package/date/getNumber.d.ts +0 -7
  487. package/date/getNumber.js +0 -20
  488. package/date/getPredefinedTimeframe.d.ts +0 -8
  489. package/date/getPredefinedTimeframe.js +0 -24
  490. package/date/getSunday.d.ts +0 -15
  491. package/date/getSunday.js +0 -42
  492. package/date/getThisWeek.d.ts +0 -10
  493. package/date/getThisWeek.js +0 -36
  494. package/date/getTimeZoned.d.ts +0 -13
  495. package/date/getTimeZoned.js +0 -55
  496. package/date/getToday.d.ts +0 -9
  497. package/date/getToday.js +0 -24
  498. package/date/getTodayYmd.d.ts +0 -5
  499. package/date/getTodayYmd.js +0 -21
  500. package/date/getTodayYmdhis.d.ts +0 -5
  501. package/date/getTodayYmdhis.js +0 -21
  502. package/date/getTwoWeeksAgo.d.ts +0 -10
  503. package/date/getTwoWeeksAgo.js +0 -36
  504. package/date/getWeeksAgo.d.ts +0 -13
  505. package/date/getWeeksAgo.js +0 -25
  506. package/date/getYesterday.d.ts +0 -9
  507. package/date/isDateValid.d.ts +0 -7
  508. package/date/isDateValid.js +0 -20
  509. package/date/isLastWeek.d.ts +0 -6
  510. package/date/isLastWeek.js +0 -14
  511. package/date/isThisWeek.d.ts +0 -6
  512. package/date/isThisWeek.js +0 -14
  513. package/date/parseExcelDate.d.ts +0 -8
  514. package/date/parseExcelDate.js +0 -19
  515. package/environment/getEnvironment.d.ts +0 -6
  516. package/environment/getEnvironment.js +0 -43
  517. package/environment/isAws.d.ts +0 -5
  518. package/environment/isAws.js +0 -8
  519. package/environment/isDevelopment.d.ts +0 -2
  520. package/environment/isDevelopment.js +0 -9
  521. package/environment/isLocalhost.d.ts +0 -5
  522. package/environment/isLocalhost.js +0 -25
  523. package/environment/isProduction.d.ts +0 -2
  524. package/environment/isProduction.js +0 -9
  525. package/environment/isStaging.d.ts +0 -2
  526. package/environment/isStaging.js +0 -9
  527. package/environment/isVercel.d.ts +0 -5
  528. package/environment/isVercel.js +0 -7
  529. package/eskimi/ageGroups.d.ts +0 -5
  530. package/eskimi/ageGroups.js +0 -41
  531. package/eskimi/campaign.d.ts +0 -19
  532. package/eskimi/campaign.js +0 -2
  533. package/eskimi/devices.d.ts +0 -5
  534. package/eskimi/devices.js +0 -13
  535. package/eskimi/endpoints.d.ts +0 -16
  536. package/eskimi/endpoints.js +0 -18
  537. package/eskimi/genders.d.ts +0 -5
  538. package/eskimi/genders.js +0 -13
  539. package/eskimi/getAccessToken.d.ts +0 -9
  540. package/eskimi/getAccessToken.js +0 -23
  541. package/eskimi/getCampaignIds.d.ts +0 -7
  542. package/eskimi/getCampaignIds.js +0 -12
  543. package/file/writeFile.d.ts +0 -1
  544. package/file/writeFile.js +0 -2
  545. package/global/forceUpdate.d.ts +0 -8
  546. package/global/forceUpdate.js +0 -25
  547. package/global/init.d.ts +0 -10
  548. package/global/init.js +0 -18
  549. package/global/isSet.d.ts +0 -8
  550. package/global/isSet.js +0 -9
  551. package/global/maxCache.d.ts +0 -8
  552. package/global/maxCache.js +0 -17
  553. package/global/read.d.ts +0 -8
  554. package/global/read.js +0 -30
  555. package/google/bigQuery/IsTableExists.d.ts +0 -11
  556. package/google/bigQuery/IsTableExists.js +0 -25
  557. package/google/bigQuery/createDataset.d.ts +0 -11
  558. package/google/bigQuery/createDataset.js +0 -22
  559. package/google/bigQuery/createTable.d.ts +0 -12
  560. package/google/bigQuery/createTable.js +0 -31
  561. package/google/bigQuery/getClient.d.ts +0 -9
  562. package/google/bigQuery/getClient.js +0 -18
  563. package/google/bigQuery/getDatasets.d.ts +0 -13
  564. package/google/bigQuery/getDatasets.js +0 -27
  565. package/google/bigQuery/getTables.d.ts +0 -12
  566. package/google/bigQuery/getTables.js +0 -25
  567. package/google/bigQuery/initClient.d.ts +0 -11
  568. package/google/bigQuery/initClient.js +0 -29
  569. package/google/bigQuery/isDatasetExists.d.ts +0 -11
  570. package/google/bigQuery/isDatasetExists.js +0 -25
  571. package/google/bigQuery/query.d.ts +0 -19
  572. package/google/bigQuery/query.js +0 -15
  573. package/google/getConfig.js +0 -23
  574. package/google/sheets/getBatchData.d.ts +0 -18
  575. package/google/sheets/getBatchData.js +0 -19
  576. package/google/sheets/initClient.d.ts +0 -11
  577. package/google/sheets/initClient.js +0 -25
  578. package/google/sheets/isCellNa.d.ts +0 -7
  579. package/google/sheets/isCellNa.js +0 -7
  580. package/google/storage/copyToCloud.d.ts +0 -11
  581. package/google/storage/copyToCloud.js +0 -18
  582. package/google/storage/getClient.d.ts +0 -8
  583. package/google/storage/getClient.js +0 -18
  584. package/google/storage/initClient.d.ts +0 -12
  585. package/google/storage/initClient.js +0 -29
  586. package/google/storage/isFileExists.d.ts +0 -10
  587. package/google/storage/isFileExists.js +0 -19
  588. package/google/storage/writeFile.d.ts +0 -11
  589. package/google/storage/writeFile.js +0 -37
  590. package/googleAds/getCustomer.d.ts +0 -8
  591. package/googleAds/getCustomer.js +0 -14
  592. package/googleAds/initClient.d.ts +0 -16
  593. package/googleAds/initClient.js +0 -25
  594. package/googleAds/keywordPlanner/request.d.ts +0 -18
  595. package/googleAds/keywordPlanner/request.js +0 -13
  596. package/googleAds/keywordPlanner/response.d.ts +0 -25
  597. package/googleAds/keywordPlanner/response.js +0 -2
  598. package/initClients.d.ts +0 -43
  599. package/initClients.js +0 -131
  600. package/littleWarden/isAllGood.d.ts +0 -7
  601. package/littleWarden/isAllGood.js +0 -15
  602. package/littleWarden/isDanger.d.ts +0 -7
  603. package/littleWarden/isDanger.js +0 -15
  604. package/littleWarden/isWarning.d.ts +0 -7
  605. package/littleWarden/isWarning.js +0 -15
  606. package/lumar/api/filter.d.ts +0 -5
  607. package/lumar/api/filter.js +0 -2
  608. package/lumar/api/operands.d.ts +0 -11
  609. package/lumar/api/operands.js +0 -13
  610. package/lumar/api/orders.d.ts +0 -9
  611. package/lumar/api/orders.js +0 -7
  612. package/lumar/api/reports.d.ts +0 -11
  613. package/lumar/api/reports.js +0 -13
  614. package/lumar/graphql/getReportKey.d.ts +0 -9
  615. package/lumar/graphql/getReportKey.js +0 -9
  616. package/lumar/graphql/operands.d.ts +0 -16
  617. package/lumar/graphql/operands.js +0 -18
  618. package/lumar/graphql/reportTypes.d.ts +0 -7
  619. package/lumar/graphql/reportTypes.js +0 -9
  620. package/myTarget/getAccessToken.d.ts +0 -9
  621. package/myTarget/getAccessToken.js +0 -23
  622. package/number/getDivide.js +0 -26
  623. package/prisma/initClient.d.ts +0 -6
  624. package/prisma/initClient.js +0 -36
  625. package/snapchat/getAccessToken.d.ts +0 -9
  626. package/snapchat/getAccessToken.js +0 -35
  627. package/swr/isAllData.d.ts +0 -7
  628. package/swr/isAllData.js +0 -19
  629. package/swr/isAnyError.d.ts +0 -7
  630. package/swr/isAnyError.js +0 -19
  631. package/swr/isAnyLoading.d.ts +0 -7
  632. package/swr/isAnyLoading.js +0 -21
  633. package/swr/isData.d.ts +0 -7
  634. package/swr/isData.js +0 -9
  635. package/swr/isError.d.ts +0 -7
  636. package/swr/isError.js +0 -7
  637. package/swr/isLoading.d.ts +0 -7
  638. package/swr/isLoading.js +0 -12
  639. package/upTimeRobot/getMonitors.d.ts +0 -1
  640. package/upTimeRobot/getMonitors.js +0 -33
  641. package/upTimeRobot/logTypes.d.ts +0 -7
  642. package/upTimeRobot/logTypes.js +0 -9
  643. package/upTimeRobot/monitorStatuses.d.ts +0 -8
  644. package/upTimeRobot/monitorStatuses.js +0 -10
  645. package/upTimeRobot/monitorSubTypes.d.ts +0 -10
  646. package/upTimeRobot/monitorSubTypes.js +0 -12
  647. package/upTimeRobot/monitorTypes.d.ts +0 -8
  648. package/upTimeRobot/monitorTypes.js +0 -10
  649. package/upTimeRobot/requestStatuses.d.ts +0 -5
  650. package/upTimeRobot/requestStatuses.js +0 -7
  651. package/url/buildParameters.d.ts +0 -8
  652. package/url/buildParameters.js +0 -22
  653. package/url/buildRelative.d.ts +0 -8
  654. package/url/buildRelative.js +0 -13
  655. package/url/buildUrl.d.ts +0 -10
  656. package/url/buildUrl.js +0 -29
  657. package/url/isAbsolute.d.ts +0 -7
  658. package/url/isAbsolute.js +0 -15
  659. package/url/isRelative.d.ts +0 -7
  660. package/url/isRelative.js +0 -8
  661. package/url/url.d.ts +0 -6
  662. package/url/url.js +0 -2
  663. /package/{aws/sqs/isEventSqs.d.ts → cache/test/cache.test.d.ts} +0 -0
package/.yarnrc.yml ADDED
@@ -0,0 +1,2 @@
1
+ nodeLinker: node-modules
2
+ yarnPath: .yarn/releases/yarn-4.9.2.cjs
package/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # Yarn 4
2
+ Use corepack to run Yarn 4 for this project.
3
+
4
+ # Dates and Timezones
5
+
6
+ Currently this is not possible to test using timezone-mock due to changing the timezone across the board and appears to not take effect.
7
+
8
+ If a date is coming from the Database/Server it should be in UTC.
9
+
10
+ If a date is coming from the client side, the server needs to convert this input into UTC before being processed.
11
+
12
+ Where possible dates should be passed as YYYYMMDD numbers so they are only converted for presentation purposes.
@@ -0,0 +1,18 @@
1
+ export declare class BaseClass {
2
+ /**
3
+ * Shortcut to set a value to an array and return the instance.
4
+ */
5
+ protected _setArray: (fields: any | any[], input: any | any[]) => this;
6
+ /**
7
+ * Shortcut to set a value and return the instance.
8
+ */
9
+ protected _setValue: (fields: any | any[], input: any) => this;
10
+ /**
11
+ * Shortcut to add a value to an existing array.
12
+ */
13
+ protected _push: (fields: any | any[], input: any | any[]) => this;
14
+ /**
15
+ * Shortcut to get a value, but default if the fields don't exist.
16
+ */
17
+ protected _get: (fields: any | any[], defaultValue?: any) => any;
18
+ }
@@ -0,0 +1,53 @@
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.BaseClass = void 0;
7
+ const isArray_1 = __importDefault(require("lodash/isArray"));
8
+ const set_1 = __importDefault(require("lodash/set"));
9
+ const util_1 = require("../util");
10
+ class BaseClass {
11
+ constructor() {
12
+ /**
13
+ * Shortcut to set a value to an array and return the instance.
14
+ */
15
+ this._setArray = (fields, input) => {
16
+ if ((0, isArray_1.default)(input)) {
17
+ (0, set_1.default)(this, fields, input);
18
+ }
19
+ else {
20
+ (0, set_1.default)(this, fields, [input]);
21
+ }
22
+ return this;
23
+ };
24
+ /**
25
+ * Shortcut to set a value and return the instance.
26
+ */
27
+ this._setValue = (fields, input) => {
28
+ (0, set_1.default)(this, fields, input);
29
+ return this;
30
+ };
31
+ /**
32
+ * Shortcut to add a value to an existing array.
33
+ */
34
+ this._push = (fields, input) => {
35
+ let temp = this._get(fields, []);
36
+ if ((0, isArray_1.default)(input)) {
37
+ temp = temp.concat(input);
38
+ }
39
+ else {
40
+ temp = temp.push(input);
41
+ }
42
+ (0, set_1.default)(this, fields, temp);
43
+ return this;
44
+ };
45
+ /**
46
+ * Shortcut to get a value, but default if the fields don't exist.
47
+ */
48
+ this._get = (fields, defaultValue = null) => {
49
+ return (0, util_1.defaultTo)(this, fields, defaultValue);
50
+ };
51
+ }
52
+ }
53
+ exports.BaseClass = BaseClass;
@@ -0,0 +1,9 @@
1
+ export declare class BaseNamespace {
2
+ client: any;
3
+ key: string;
4
+ config: any;
5
+ constructor(key: string, config: any);
6
+ ensureInit: () => Promise<void>;
7
+ reset: () => void;
8
+ getClient: () => Promise<any>;
9
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseNamespace = void 0;
4
+ const environment_1 = require("../environment");
5
+ class BaseNamespace {
6
+ constructor(key, config) {
7
+ this.client = null;
8
+ this.config = null;
9
+ // To be superseded by child
10
+ this.ensureInit = async () => {
11
+ };
12
+ // Reset the client
13
+ this.reset = () => {
14
+ this.client = null;
15
+ };
16
+ // Return the raw client if needed
17
+ this.getClient = async () => {
18
+ return this.client();
19
+ };
20
+ if (!environment_1.isServer) {
21
+ throw new Error("Server-side only class accessed from client");
22
+ }
23
+ this.key = key;
24
+ this.config = config;
25
+ }
26
+ }
27
+ exports.BaseNamespace = BaseNamespace;
@@ -0,0 +1,2 @@
1
+ export { BaseClass } from "./BaseClass";
2
+ export { BaseNamespace } from "./BaseNamespace";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseNamespace = exports.BaseClass = void 0;
4
+ var BaseClass_1 = require("./BaseClass");
5
+ Object.defineProperty(exports, "BaseClass", { enumerable: true, get: function () { return BaseClass_1.BaseClass; } });
6
+ var BaseNamespace_1 = require("./BaseNamespace");
7
+ Object.defineProperty(exports, "BaseNamespace", { enumerable: true, get: function () { return BaseNamespace_1.BaseNamespace; } });
@@ -0,0 +1,15 @@
1
+ import { InputDate } from "../date";
2
+ import { JobSchemaType } from "./index";
3
+ type AdverityJobsResponse = {
4
+ count: number;
5
+ next: string | null;
6
+ previous: string | null;
7
+ results: JobSchemaType[];
8
+ };
9
+ /**
10
+ * Fetch all the jobs that ran yesterday by default.
11
+ * A job can either by in Fetch, Enrich or Transfer states, but all have different job ids. This makes it difficult to track and we would be reliant on the start/end time which could varu.
12
+ * As a result, we only store the Transfer jobs as this is when it gets moved into Bigquery. If it's not in Bigquery we cant use it anyway.
13
+ */
14
+ export declare const getJobs: (apiKey: string, start?: InputDate, end?: InputDate, url?: string) => Promise<AdverityJobsResponse[]>;
15
+ export {};
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getJobs = void 0;
4
+ const date_1 = require("../date");
5
+ const axios_1 = require("../axios");
6
+ /**
7
+ * Fetch all the jobs that ran yesterday by default.
8
+ * A job can either by in Fetch, Enrich or Transfer states, but all have different job ids. This makes it difficult to track and we would be reliant on the start/end time which could varu.
9
+ * As a result, we only store the Transfer jobs as this is when it gets moved into Bigquery. If it's not in Bigquery we cant use it anyway.
10
+ */
11
+ const getJobs = async (apiKey, start, end, url) => {
12
+ const startYmd = (0, date_1.getYmdString)(start ? (0, date_1.getDate)(start) : (0, date_1.getYesterday)());
13
+ const endYmd = (0, date_1.getYmdString)(end ? (0, date_1.getDate)(end) : (0, date_1.getToday)());
14
+ const finalUrl = "undefined" !== typeof url ? url : `https://8ms.datatap.adverity.com/api/jobs/?start=${startYmd}&end=${endYmd}&page_size=300`;
15
+ let response = [];
16
+ const apiResponse = await (0, axios_1.get)(finalUrl, {
17
+ headers: {
18
+ Authorization: `Bearer ${apiKey}`,
19
+ }
20
+ });
21
+ if (apiResponse.isSuccess()) {
22
+ const apiResponseBody = apiResponse.getBody();
23
+ // Move to the next page
24
+ if (apiResponseBody.next) {
25
+ response = [...apiResponse.getBody(), await (0, exports.getJobs)(apiKey, start, end, apiResponseBody.next)];
26
+ }
27
+ }
28
+ return response;
29
+ };
30
+ exports.getJobs = getJobs;
@@ -0,0 +1,112 @@
1
+ import { z } from "zod/v4";
2
+ export declare const stackSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ uuid: z.ZodString;
5
+ name: z.ZodString;
6
+ slug: z.ZodString;
7
+ url: z.ZodString;
8
+ change_url: z.ZodString;
9
+ extracts_url: z.ZodString;
10
+ issues_url: z.ZodString;
11
+ overview_url: z.ZodString;
12
+ permissions: z.ZodObject<{
13
+ isCreator: z.ZodBoolean;
14
+ isDatastreamManager: z.ZodBoolean;
15
+ isViewer: z.ZodBoolean;
16
+ }, z.core.$strip>;
17
+ }, z.core.$strip>;
18
+ export type StackSchemaType = z.infer<typeof stackSchema>;
19
+ export declare const datastreamSchema: z.ZodObject<{
20
+ id: z.ZodNumber;
21
+ stack: z.ZodObject<{
22
+ id: z.ZodString;
23
+ uuid: z.ZodString;
24
+ name: z.ZodString;
25
+ slug: z.ZodString;
26
+ url: z.ZodString;
27
+ change_url: z.ZodString;
28
+ extracts_url: z.ZodString;
29
+ issues_url: z.ZodString;
30
+ overview_url: z.ZodString;
31
+ permissions: z.ZodObject<{
32
+ isCreator: z.ZodBoolean;
33
+ isDatastreamManager: z.ZodBoolean;
34
+ isViewer: z.ZodBoolean;
35
+ }, z.core.$strip>;
36
+ }, z.core.$strip>;
37
+ stack_id: z.ZodNumber;
38
+ name: z.ZodString;
39
+ slug: z.ZodString;
40
+ app_label: z.ZodString;
41
+ absolute_url: z.ZodString;
42
+ change_url: z.ZodString;
43
+ extracts_url: z.ZodString;
44
+ fetch_url: z.ZodString;
45
+ overview_url: z.ZodString;
46
+ schema_mapping_url: z.ZodString;
47
+ enabled: z.ZodBigInt;
48
+ next_run: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"Not Scheduled">]>;
49
+ url: z.ZodString;
50
+ datastream_type_id: z.ZodNumber;
51
+ logo_url: z.ZodString;
52
+ extracts_stream_url: z.ZodString;
53
+ supports_extended_intervals: z.ZodNumber;
54
+ updated: z.ZodString;
55
+ created: z.ZodString;
56
+ creator: z.ZodString;
57
+ can_be_fetched: z.ZodNumber;
58
+ }, z.core.$strip>;
59
+ export type DatastreamSchemaType = z.infer<typeof datastreamSchema>;
60
+ export declare const jobSchema: z.ZodObject<{
61
+ id: z.ZodNumber;
62
+ url: z.ZodString;
63
+ job_start: z.ZodNullable<z.ZodString>;
64
+ job_end: z.ZodNullable<z.ZodString>;
65
+ progress: z.ZodNumber;
66
+ state: z.ZodNumber;
67
+ state_label: z.ZodString;
68
+ state_color: z.ZodString;
69
+ datastream: z.ZodObject<{
70
+ id: z.ZodNumber;
71
+ stack: z.ZodObject<{
72
+ id: z.ZodString;
73
+ uuid: z.ZodString;
74
+ name: z.ZodString;
75
+ slug: z.ZodString;
76
+ url: z.ZodString;
77
+ change_url: z.ZodString;
78
+ extracts_url: z.ZodString;
79
+ issues_url: z.ZodString;
80
+ overview_url: z.ZodString;
81
+ permissions: z.ZodObject<{
82
+ isCreator: z.ZodBoolean;
83
+ isDatastreamManager: z.ZodBoolean;
84
+ isViewer: z.ZodBoolean;
85
+ }, z.core.$strip>;
86
+ }, z.core.$strip>;
87
+ stack_id: z.ZodNumber;
88
+ name: z.ZodString;
89
+ slug: z.ZodString;
90
+ app_label: z.ZodString;
91
+ absolute_url: z.ZodString;
92
+ change_url: z.ZodString;
93
+ extracts_url: z.ZodString;
94
+ fetch_url: z.ZodString;
95
+ overview_url: z.ZodString;
96
+ schema_mapping_url: z.ZodString;
97
+ enabled: z.ZodBigInt;
98
+ next_run: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"Not Scheduled">]>;
99
+ url: z.ZodString;
100
+ datastream_type_id: z.ZodNumber;
101
+ logo_url: z.ZodString;
102
+ extracts_stream_url: z.ZodString;
103
+ supports_extended_intervals: z.ZodNumber;
104
+ updated: z.ZodString;
105
+ created: z.ZodString;
106
+ creator: z.ZodString;
107
+ can_be_fetched: z.ZodNumber;
108
+ }, z.core.$strip>;
109
+ issues: z.ZodArray<z.ZodAny>;
110
+ type: z.ZodUnion<readonly [z.ZodString, z.ZodString, z.ZodString]>;
111
+ }, z.core.$strip>;
112
+ export type JobSchemaType = z.infer<typeof jobSchema>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jobSchema = exports.datastreamSchema = exports.stackSchema = void 0;
4
+ const v4_1 = require("zod/v4");
5
+ exports.stackSchema = v4_1.z.object({
6
+ id: v4_1.z.string(),
7
+ uuid: v4_1.z.string(),
8
+ name: v4_1.z.string(),
9
+ slug: v4_1.z.string(),
10
+ url: v4_1.z.string(),
11
+ change_url: v4_1.z.string(),
12
+ extracts_url: v4_1.z.string(),
13
+ issues_url: v4_1.z.string(),
14
+ overview_url: v4_1.z.string(),
15
+ permissions: v4_1.z.object({
16
+ isCreator: v4_1.z.boolean(),
17
+ isDatastreamManager: v4_1.z.boolean(),
18
+ isViewer: v4_1.z.boolean(),
19
+ })
20
+ });
21
+ exports.datastreamSchema = v4_1.z.object({
22
+ id: v4_1.z.number(),
23
+ stack: exports.stackSchema,
24
+ stack_id: v4_1.z.number(),
25
+ name: v4_1.z.string(),
26
+ slug: v4_1.z.string(),
27
+ app_label: v4_1.z.string(),
28
+ absolute_url: v4_1.z.string(),
29
+ change_url: v4_1.z.string(),
30
+ extracts_url: v4_1.z.string(),
31
+ fetch_url: v4_1.z.string(),
32
+ overview_url: v4_1.z.string(),
33
+ schema_mapping_url: v4_1.z.string(),
34
+ enabled: v4_1.z.bigint(),
35
+ next_run: v4_1.z.union([v4_1.z.string(), v4_1.z.literal("Not Scheduled")]),
36
+ url: v4_1.z.string(),
37
+ datastream_type_id: v4_1.z.number(),
38
+ logo_url: v4_1.z.string(),
39
+ extracts_stream_url: v4_1.z.string(),
40
+ supports_extended_intervals: v4_1.z.number(),
41
+ updated: v4_1.z.string(),
42
+ created: v4_1.z.string(),
43
+ creator: v4_1.z.string(),
44
+ can_be_fetched: v4_1.z.number(),
45
+ });
46
+ exports.jobSchema = v4_1.z.object({
47
+ id: v4_1.z.number(),
48
+ url: v4_1.z.string(),
49
+ job_start: v4_1.z.string()
50
+ .nullable(),
51
+ job_end: v4_1.z.string()
52
+ .nullable(),
53
+ progress: v4_1.z.number(),
54
+ state: v4_1.z.number(),
55
+ state_label: v4_1.z.string(),
56
+ state_color: v4_1.z.string(),
57
+ datastream: exports.datastreamSchema,
58
+ issues: v4_1.z.any()
59
+ .array(),
60
+ type: v4_1.z.union([v4_1.z.string("Fetch"), v4_1.z.string("Enrich"), v4_1.z.string("Transfer")]),
61
+ });
@@ -0,0 +1,35 @@
1
+ import { ApiState, ApiResponse } from "./";
2
+ import { z } from "zod/v4";
3
+ type ConstructorProps = {
4
+ body?: any;
5
+ error?: any;
6
+ state?: ApiState;
7
+ };
8
+ /**
9
+ * Class version of the API to enable quicker instances.
10
+ */
11
+ export declare class ApiResponseClass<T = any, E = any> {
12
+ state: ApiState;
13
+ body: T | null;
14
+ error: E | null;
15
+ constructor({ body, error, state }?: ConstructorProps);
16
+ fromJson: (input: ApiResponse) => this;
17
+ getBody: () => any;
18
+ getBodyDefaultTo: (keys: any | any[], defaultValue: any) => any;
19
+ getError: () => any;
20
+ getJson: () => ApiResponse<T, E>;
21
+ getApiState: () => ApiState;
22
+ isError: () => boolean;
23
+ isIdle: () => boolean;
24
+ isPending: () => boolean;
25
+ isSuccess: () => boolean;
26
+ setToIdle: () => this;
27
+ setToPending: () => this;
28
+ setToError: (body: any, error: any) => this;
29
+ setToSuccess: (body: any) => this;
30
+ setBody: (body: any) => this;
31
+ setError: (error: any) => this;
32
+ setApiState: (state: ApiState) => this;
33
+ validateZod: <T_1>(schema: z.ZodSchema<T_1>) => ApiResponseClass<T_1, E>;
34
+ }
35
+ export {};
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiResponseClass = void 0;
4
+ const util_1 = require("../util");
5
+ const _1 = require("./");
6
+ /**
7
+ * Class version of the API to enable quicker instances.
8
+ */
9
+ class ApiResponseClass {
10
+ constructor({ body, error, state } = {}) {
11
+ this.state = _1.ApiState.IDLE;
12
+ this.body = null;
13
+ this.error = null;
14
+ this.fromJson = (input) => {
15
+ this.body = input.body;
16
+ this.error = input.error;
17
+ this.state = input.state;
18
+ return this;
19
+ };
20
+ this.getBody = () => {
21
+ return this.body;
22
+ };
23
+ this.getBodyDefaultTo = (keys, defaultValue) => {
24
+ return (0, util_1.defaultTo)(this.body, keys, defaultValue);
25
+ };
26
+ this.getError = () => {
27
+ return this.error;
28
+ };
29
+ this.getJson = () => {
30
+ return {
31
+ body: this.body,
32
+ error: this.error,
33
+ state: this.state,
34
+ };
35
+ };
36
+ this.getApiState = () => {
37
+ return this.state;
38
+ };
39
+ this.isError = () => {
40
+ return this.state === _1.ApiState.ERROR;
41
+ };
42
+ this.isIdle = () => {
43
+ return this.state === _1.ApiState.IDLE;
44
+ };
45
+ this.isPending = () => {
46
+ return this.state === _1.ApiState.PENDING;
47
+ };
48
+ this.isSuccess = () => {
49
+ return this.state === _1.ApiState.SUCCESS;
50
+ };
51
+ this.setToIdle = () => {
52
+ this.state = _1.ApiState.IDLE;
53
+ return this;
54
+ };
55
+ this.setToPending = () => {
56
+ this.state = _1.ApiState.PENDING;
57
+ return this;
58
+ };
59
+ this.setToError = (body, error) => {
60
+ this.body = body || null;
61
+ this.error = error;
62
+ this.state = _1.ApiState.ERROR;
63
+ return this;
64
+ };
65
+ this.setToSuccess = (body) => {
66
+ this.body = body;
67
+ this.state = _1.ApiState.SUCCESS;
68
+ return this;
69
+ };
70
+ this.setBody = (body) => {
71
+ this.body = body;
72
+ return this;
73
+ };
74
+ this.setError = (error) => {
75
+ this.error = error;
76
+ return this;
77
+ };
78
+ this.setApiState = (state) => {
79
+ this.state = state;
80
+ return this;
81
+ };
82
+ this.validateZod = (schema) => {
83
+ try {
84
+ const validatedBody = schema.parse(this.body);
85
+ return new ApiResponseClass({ body: validatedBody, state: this.state });
86
+ }
87
+ catch (error) {
88
+ return new ApiResponseClass({ error, state: _1.ApiState.ERROR });
89
+ }
90
+ };
91
+ this.body = body || null;
92
+ this.error = error || null;
93
+ this.state = state || _1.ApiState.IDLE;
94
+ return this;
95
+ }
96
+ }
97
+ exports.ApiResponseClass = ApiResponseClass;
package/api/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export declare enum State {
1
+ export { ApiResponseClass } from "./ApiResponseClass";
2
+ export declare enum ApiState {
2
3
  CANCELLED = "CANCELLED",
3
4
  ERROR = "ERROR",
4
5
  IDLE = "IDLE",
@@ -6,4 +7,16 @@ export declare enum State {
6
7
  SUCCESS = "SUCCESS",
7
8
  VALIDATION_ERROR = "VALIDATION_ERROR"
8
9
  }
10
+ export type ApiResponse<T = any, E = any> = {
11
+ body: T | null;
12
+ error: E | null;
13
+ state: ApiState;
14
+ };
15
+ export declare const defaultResponse: ApiResponse;
9
16
  export declare const unexpectedError: string;
17
+ export declare const isCancelled: (apiResponse: ApiResponse) => boolean;
18
+ export declare const isError: (apiResponse: ApiResponse) => boolean;
19
+ export declare const isIdle: (apiResponse: ApiResponse) => boolean;
20
+ export declare const isPending: (apiResponse: ApiResponse) => boolean;
21
+ export declare const isSuccess: (apiResponse: ApiResponse) => boolean;
22
+ export declare const isValidationError: (apiResponse: ApiResponse) => boolean;
package/api/index.js CHANGED
@@ -1,13 +1,44 @@
1
1
  "use strict";
2
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 = {}));
3
+ exports.isValidationError = exports.isSuccess = exports.isPending = exports.isIdle = exports.isError = exports.isCancelled = exports.unexpectedError = exports.defaultResponse = exports.ApiState = exports.ApiResponseClass = void 0;
4
+ var ApiResponseClass_1 = require("./ApiResponseClass");
5
+ Object.defineProperty(exports, "ApiResponseClass", { enumerable: true, get: function () { return ApiResponseClass_1.ApiResponseClass; } });
6
+ var ApiState;
7
+ (function (ApiState) {
8
+ ApiState["CANCELLED"] = "CANCELLED";
9
+ ApiState["ERROR"] = "ERROR";
10
+ ApiState["IDLE"] = "IDLE";
11
+ ApiState["PENDING"] = "PENDING";
12
+ ApiState["SUCCESS"] = "SUCCESS";
13
+ ApiState["VALIDATION_ERROR"] = "VALIDATION_ERROR";
14
+ })(ApiState || (exports.ApiState = ApiState = {}));
15
+ exports.defaultResponse = {
16
+ body: null,
17
+ error: null,
18
+ state: ApiState.IDLE,
19
+ };
13
20
  exports.unexpectedError = "An unexpected error occurred, please try again.";
21
+ const isCancelled = (apiResponse) => {
22
+ return ApiState.CANCELLED === apiResponse.state;
23
+ };
24
+ exports.isCancelled = isCancelled;
25
+ const isError = (apiResponse) => {
26
+ return ApiState.ERROR === apiResponse.state;
27
+ };
28
+ exports.isError = isError;
29
+ const isIdle = (apiResponse) => {
30
+ return ApiState.IDLE === apiResponse.state;
31
+ };
32
+ exports.isIdle = isIdle;
33
+ const isPending = (apiResponse) => {
34
+ return ApiState.PENDING === apiResponse.state;
35
+ };
36
+ exports.isPending = isPending;
37
+ const isSuccess = (apiResponse) => {
38
+ return ApiState.SUCCESS === apiResponse.state;
39
+ };
40
+ exports.isSuccess = isSuccess;
41
+ const isValidationError = (apiResponse) => {
42
+ return ApiState.VALIDATION_ERROR === apiResponse.state;
43
+ };
44
+ exports.isValidationError = isValidationError;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shorthand to check if an array or string contains a needle.
3
+ */
4
+ export declare const contains: <T>(haystack: T[], needle: T) => boolean;
5
+ /**
6
+ * Convert an array into an array or return if already an array.
7
+ */
8
+ export declare const getArray: <T>(input: T) => T[];
@@ -3,9 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getArray = exports.contains = void 0;
6
7
  const isArray_1 = __importDefault(require("lodash/isArray"));
8
+ /**
9
+ * Shorthand to check if an array or string contains a needle.
10
+ */
11
+ const contains = (haystack, needle) => -1 !== haystack.indexOf(needle);
12
+ exports.contains = contains;
7
13
  /**
8
14
  * Convert an array into an array or return if already an array.
9
15
  */
10
- const getArray = (props) => (0, isArray_1.default)(props.input) ? props.input : [props.input];
11
- exports.default = getArray;
16
+ const getArray = (input) => (0, isArray_1.default)(input) ? input : [input];
17
+ exports.getArray = getArray;
@@ -0,0 +1,16 @@
1
+ import { z } from "zod/v4";
2
+ /**
3
+ * The request in the structure required by AT Internet.
4
+ */
5
+ export declare const requestSchema: z.ZodObject<{
6
+ columns: z.ZodArray<z.ZodString>;
7
+ evo: z.ZodObject<{}, z.core.$strip>;
8
+ filter: z.ZodObject<{}, z.core.$strip>;
9
+ "max-results": z.ZodNumber;
10
+ options: z.ZodObject<{
11
+ ignore_null_properties: z.ZodBoolean;
12
+ }, z.core.$strip>;
13
+ "page-num": z.ZodNumber;
14
+ period: z.ZodObject<{}, z.core.$strip>;
15
+ }, z.core.$strip>;
16
+ export type RequestSchemaType = z.infer<typeof requestSchema>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.requestSchema = void 0;
4
+ const v4_1 = require("zod/v4");
5
+ /**
6
+ * The request in the structure required by AT Internet.
7
+ */
8
+ exports.requestSchema = v4_1.z.object({
9
+ columns: v4_1.z.array(v4_1.z.string()),
10
+ evo: v4_1.z.object({}),
11
+ filter: v4_1.z.object({}),
12
+ "max-results": v4_1.z.number(),
13
+ options: v4_1.z.object({
14
+ "ignore_null_properties": v4_1.z.boolean(),
15
+ }),
16
+ "page-num": v4_1.z.number(),
17
+ period: v4_1.z.object({}),
18
+ });
@@ -0,0 +1,8 @@
1
+ import { BaseNamespace } from "../../_class";
2
+ import { AthenaConfig } from "./index";
3
+ export declare class AwsAthenaNamespace extends BaseNamespace {
4
+ client: any | null;
5
+ config: AthenaConfig;
6
+ ensureInit: () => Promise<void>;
7
+ query: (query: string) => Promise<any>;
8
+ }