@8ms/helpers 1.1.67 → 1.1.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/api/response.js +1 -12
  2. package/api/states.js +1 -10
  3. package/api/unexpectedError.js +1 -4
  4. package/array/contains.js +2 -9
  5. package/array/getArray.js +2 -13
  6. package/atInternet/request.js +1 -2
  7. package/aws/athenaExpress/initClient.js +3 -28
  8. package/aws/athenaExpress/query.js +3 -0
  9. package/aws/getConfig.js +2 -27
  10. package/aws/glue/initClient.js +2 -18
  11. package/aws/glue/invoke.js +2 -73
  12. package/aws/isResponse200.js +2 -22
  13. package/aws/lambda/getHandlerPath.js +1 -8
  14. package/aws/lambda/initClient.js +2 -18
  15. package/aws/lambda/invoke.js +2 -87
  16. package/aws/s3/copyFile.js +2 -61
  17. package/aws/s3/deleteFile.js +2 -60
  18. package/aws/s3/deleteFiles.js +2 -64
  19. package/aws/s3/deleteFolder.js +2 -85
  20. package/aws/s3/getGlueJson.js +2 -16
  21. package/aws/s3/getPresignedPost.js +3 -63
  22. package/aws/s3/getSignedUrl.js +2 -83
  23. package/aws/s3/initClient.js +2 -18
  24. package/aws/s3/isFileExists.js +2 -75
  25. package/aws/s3/listFiles.js +2 -79
  26. package/aws/s3/listFolders.js +4 -78
  27. package/aws/s3/moveFile.js +2 -68
  28. package/aws/s3/readBuffer.js +2 -99
  29. package/aws/s3/readFile.js +2 -120
  30. package/aws/s3/writeFile.js +2 -77
  31. package/aws/s3/writePresignedPost.js +2 -101
  32. package/aws/s3cache/cache.js +1 -2
  33. package/aws/s3cache/getCache.js +2 -79
  34. package/aws/s3cache/getKey.js +2 -17
  35. package/aws/s3cache/saveCache.js +2 -58
  36. package/aws/s3cache/updateCache.js +2 -75
  37. package/aws/ses/SimpleEmail.js +2 -219
  38. package/aws/ses/initClient.js +2 -18
  39. package/aws/ssm/getParameter.js +2 -86
  40. package/aws/ssm/initClient.js +2 -18
  41. package/axios/get.js +1 -115
  42. package/axios/post.js +2 -117
  43. package/boolean/getBoolean.js +2 -16
  44. package/class/BaseClass.js +9 -57
  45. package/crud/actions.js +1 -10
  46. package/crypto/getDecrypt.js +2 -12
  47. package/crypto/getEncrypt.js +2 -12
  48. package/crypto/getRandom.js +2 -11
  49. package/crypto/getSha256.js +2 -16
  50. package/date/date.js +1 -2
  51. package/date/duration.js +1 -2
  52. package/date/durationComparisons.js +1 -7
  53. package/date/durations.js +1 -10
  54. package/date/financialYear.js +1 -2
  55. package/date/financialYearWeek.js +1 -2
  56. package/date/format.js +2 -19
  57. package/date/getDate.js +9 -97
  58. package/date/getDatesBetween.js +3 -26
  59. package/date/getDurationHours.js +2 -26
  60. package/date/getDurationMinutes.js +2 -25
  61. package/date/getFinancialYear.js +8 -49
  62. package/date/getFinancialYearToDate.js +2 -18
  63. package/date/getFinancialYearToYesterday.js +2 -18
  64. package/date/getFinancialYearWeeks.js +2 -30
  65. package/date/getLastWeek.js +2 -29
  66. package/date/getMax.js +2 -16
  67. package/date/getMidnight.js +2 -13
  68. package/date/getMin.js +2 -16
  69. package/date/getMonday.js +5 -33
  70. package/date/getNumber.js +2 -15
  71. package/date/getPredefinedTimeframe.js +2 -24
  72. package/date/getSunday.js +5 -33
  73. package/date/getThisWeek.js +2 -29
  74. package/date/getTimeZoned.js +5 -37
  75. package/date/getToday.js +2 -40
  76. package/date/getTwoWeeksAgo.js +2 -29
  77. package/date/getWeeksAgo.js +2 -17
  78. package/date/getYesterday.js +2 -41
  79. package/date/isDateValid.js +2 -23
  80. package/date/isLastWeek.js +2 -14
  81. package/date/isThisWeek.js +2 -14
  82. package/date/parseExcelDate.js +2 -18
  83. package/date/predefinedTimeframes.js +1 -9
  84. package/date/timeframe.js +1 -2
  85. package/date/timeframes.js +1 -7
  86. package/deepCrawl/buildRequest.js +4 -84
  87. package/deepCrawl/filter.js +1 -2
  88. package/deepCrawl/getData.js +1 -87
  89. package/deepCrawl/initClient.js +2 -78
  90. package/deepCrawl/operands.js +1 -13
  91. package/deepCrawl/orders.js +1 -7
  92. package/deepCrawl/reports.js +1 -13
  93. package/environment/environments.js +1 -8
  94. package/environment/getEnvironment.js +2 -42
  95. package/environment/isAws.js +2 -10
  96. package/environment/isDevelopment.js +1 -9
  97. package/environment/isLocalhost.js +2 -21
  98. package/environment/isProduction.js +1 -9
  99. package/environment/isStaging.js +1 -9
  100. package/environment/isVercel.js +2 -6
  101. package/environment/platforms.js +1 -7
  102. package/eskimi/ageGroups.js +1 -41
  103. package/eskimi/campaign.js +1 -2
  104. package/eskimi/devices.js +1 -13
  105. package/eskimi/endpoints.js +2 -17
  106. package/eskimi/genders.js +1 -13
  107. package/eskimi/getAccessToken.js +2 -68
  108. package/eskimi/getAgeGroup.js +2 -17
  109. package/eskimi/getCampaignIds.js +2 -12
  110. package/eskimi/getDevice.js +2 -17
  111. package/eskimi/getGender.js +2 -17
  112. package/eskimi/request.js +2 -69
  113. package/globals.d.js +1 -0
  114. package/google/bigQuery/initClient.js +4 -0
  115. package/google/bigQuery/query.js +3 -0
  116. package/google/getConfig.js +5 -0
  117. package/google/sheets/getAssociatedData.js +8 -99
  118. package/google/sheets/getBatchData.js +1 -64
  119. package/google/sheets/initClient.js +5 -0
  120. package/google/sheets/isCellNa.js +2 -9
  121. package/google/storage/initClient.js +5 -0
  122. package/google/storage/writeFile.js +2 -87
  123. package/googleAds/getCustomer.js +2 -55
  124. package/googleAds/initClient.js +2 -67
  125. package/initClients.js +5 -112
  126. package/json/isJson.js +2 -19
  127. package/littleWarden/getUrlStatus.js +2 -66
  128. package/littleWarden/isAllGood.js +2 -18
  129. package/littleWarden/isDanger.js +2 -18
  130. package/littleWarden/isWarning.js +2 -18
  131. package/littleWarden/states.js +1 -8
  132. package/myTarget/getAccessToken.js +2 -68
  133. package/myTarget/request.js +2 -69
  134. package/nextAuth/isSessionReady.js +1 -13
  135. package/nextAuth/states.js +2 -8
  136. package/nextJs/getIp.js +2 -13
  137. package/nextJs/getUserAgent.js +2 -9
  138. package/number/getDivide.js +2 -18
  139. package/number/getNumber.js +7 -51
  140. package/number/getPercent.js +2 -18
  141. package/number/getPercentIncrease.js +2 -18
  142. package/number/getRounded.js +2 -22
  143. package/package.json +47 -43
  144. package/prisma/initClient.js +3 -34
  145. package/snapchat/getAccessToken.js +2 -83
  146. package/sorting/byNumberAscending.js +2 -17
  147. package/sorting/byNumberDescending.js +2 -17
  148. package/sorting/byStringAscending.js +2 -21
  149. package/sorting/byStringDescending.js +2 -21
  150. package/string/formatCapitalise.js +2 -15
  151. package/string/getCleanFolder.js +2 -14
  152. package/string/getString.js +2 -36
  153. package/string/getStringFromStream.js +2 -15
  154. package/string/toProperCase.js +2 -18
  155. package/swr/isAllData.js +2 -19
  156. package/swr/isAnyError.js +2 -19
  157. package/swr/isAnyLoading.js +2 -21
  158. package/swr/isData.js +2 -9
  159. package/swr/isError.js +2 -9
  160. package/swr/isLoading.js +2 -14
  161. package/upTimeRobot/getMonitors.js +2 -87
  162. package/upTimeRobot/logTypes.js +1 -9
  163. package/upTimeRobot/monitorStatuses.js +1 -10
  164. package/upTimeRobot/monitorSubTypes.js +1 -12
  165. package/upTimeRobot/monitorTypes.js +1 -10
  166. package/upTimeRobot/requestStatuses.js +1 -7
  167. package/url/buildParameters.js +2 -22
  168. package/url/buildRelative.js +2 -13
  169. package/url/buildUrl.js +2 -29
  170. package/url/isAbsolute.js +2 -15
  171. package/url/isRelative.js +2 -10
  172. package/url/url.js +1 -2
  173. package/util/defaultTo.js +2 -35
  174. package/util/isUndefined.js +3 -0
  175. package/util/sleep.js +1 -7
  176. package/webWorker/states.js +1 -8
  177. package/xml/getXml.js +1 -62
  178. package/api/response.d.ts +0 -8
  179. package/api/states.d.ts +0 -9
  180. package/api/unexpectedError.d.ts +0 -2
  181. package/array/contains.d.ts +0 -8
  182. package/array/getArray.d.ts +0 -7
  183. package/atInternet/request.d.ts +0 -30
  184. package/aws/athenaExpress/initClient.d.ts +0 -12
  185. package/aws/athenaExpress/request.d.ts +0 -8
  186. package/aws/athenaExpress/request.js +0 -54
  187. package/aws/config.d.ts +0 -5
  188. package/aws/config.js +0 -2
  189. package/aws/getConfig.d.ts +0 -9
  190. package/aws/glue/initClient.d.ts +0 -9
  191. package/aws/glue/invoke.d.ts +0 -11
  192. package/aws/isResponse200.d.ts +0 -7
  193. package/aws/lambda/getHandlerPath.d.ts +0 -4
  194. package/aws/lambda/initClient.d.ts +0 -9
  195. package/aws/lambda/invoke.d.ts +0 -14
  196. package/aws/s3/copyFile.d.ts +0 -13
  197. package/aws/s3/deleteFile.d.ts +0 -9
  198. package/aws/s3/deleteFiles.d.ts +0 -10
  199. package/aws/s3/deleteFolder.d.ts +0 -10
  200. package/aws/s3/getGlueJson.d.ts +0 -4
  201. package/aws/s3/getPresignedPost.d.ts +0 -21
  202. package/aws/s3/getSignedUrl.d.ts +0 -12
  203. package/aws/s3/initClient.d.ts +0 -9
  204. package/aws/s3/isFileExists.d.ts +0 -9
  205. package/aws/s3/listFiles.d.ts +0 -9
  206. package/aws/s3/listFolders.d.ts +0 -9
  207. package/aws/s3/moveFile.d.ts +0 -9
  208. package/aws/s3/readBuffer.d.ts +0 -13
  209. package/aws/s3/readFile.d.ts +0 -30
  210. package/aws/s3/writeFile.d.ts +0 -10
  211. package/aws/s3/writePresignedPost.d.ts +0 -15
  212. package/aws/s3cache/cache.d.ts +0 -7
  213. package/aws/s3cache/getCache.d.ts +0 -12
  214. package/aws/s3cache/getKey.d.ts +0 -10
  215. package/aws/s3cache/saveCache.d.ts +0 -10
  216. package/aws/s3cache/updateCache.d.ts +0 -10
  217. package/aws/ses/SimpleEmail.d.ts +0 -54
  218. package/aws/ses/initClient.d.ts +0 -9
  219. package/aws/ssm/getParameter.d.ts +0 -10
  220. package/aws/ssm/initClient.d.ts +0 -9
  221. package/axios/get.d.ts +0 -8
  222. package/axios/post.d.ts +0 -12
  223. package/boolean/getBoolean.d.ts +0 -7
  224. package/class/BaseClass.d.ts +0 -31
  225. package/crud/actions.d.ts +0 -8
  226. package/crypto/getDecrypt.d.ts +0 -10
  227. package/crypto/getEncrypt.d.ts +0 -10
  228. package/crypto/getRandom.d.ts +0 -8
  229. package/crypto/getSha256.d.ts +0 -8
  230. package/date/date.d.ts +0 -4
  231. package/date/duration.d.ts +0 -5
  232. package/date/durationComparisons.d.ts +0 -5
  233. package/date/durations.d.ts +0 -8
  234. package/date/financialYear.d.ts +0 -4
  235. package/date/financialYearWeek.d.ts +0 -6
  236. package/date/format.d.ts +0 -13
  237. package/date/getDate.d.ts +0 -12
  238. package/date/getDatesBetween.d.ts +0 -10
  239. package/date/getDurationHours.d.ts +0 -8
  240. package/date/getDurationMinutes.d.ts +0 -8
  241. package/date/getFinancialYear.d.ts +0 -9
  242. package/date/getFinancialYearToDate.d.ts +0 -7
  243. package/date/getFinancialYearToYesterday.d.ts +0 -7
  244. package/date/getFinancialYearWeeks.d.ts +0 -9
  245. package/date/getLastWeek.d.ts +0 -10
  246. package/date/getMax.d.ts +0 -12
  247. package/date/getMidnight.d.ts +0 -10
  248. package/date/getMin.d.ts +0 -12
  249. package/date/getMonday.d.ts +0 -14
  250. package/date/getNumber.d.ts +0 -11
  251. package/date/getPredefinedTimeframe.d.ts +0 -9
  252. package/date/getSunday.d.ts +0 -14
  253. package/date/getThisWeek.d.ts +0 -10
  254. package/date/getTimeZoned.d.ts +0 -13
  255. package/date/getToday.d.ts +0 -9
  256. package/date/getTwoWeeksAgo.d.ts +0 -10
  257. package/date/getWeeksAgo.d.ts +0 -12
  258. package/date/getYesterday.d.ts +0 -9
  259. package/date/isDateValid.d.ts +0 -7
  260. package/date/isLastWeek.d.ts +0 -6
  261. package/date/isThisWeek.d.ts +0 -6
  262. package/date/parseExcelDate.d.ts +0 -8
  263. package/date/predefinedTimeframes.d.ts +0 -7
  264. package/date/timeframe.d.ts +0 -8
  265. package/date/timeframes.d.ts +0 -4
  266. package/deepCrawl/buildRequest.d.ts +0 -15
  267. package/deepCrawl/filter.d.ts +0 -5
  268. package/deepCrawl/getData.d.ts +0 -5
  269. package/deepCrawl/initClient.d.ts +0 -13
  270. package/deepCrawl/operands.d.ts +0 -11
  271. package/deepCrawl/orders.d.ts +0 -9
  272. package/deepCrawl/reports.d.ts +0 -11
  273. package/environment/environments.d.ts +0 -7
  274. package/environment/getEnvironment.d.ts +0 -6
  275. package/environment/isAws.d.ts +0 -5
  276. package/environment/isDevelopment.d.ts +0 -2
  277. package/environment/isLocalhost.d.ts +0 -5
  278. package/environment/isProduction.d.ts +0 -2
  279. package/environment/isStaging.d.ts +0 -2
  280. package/environment/isVercel.d.ts +0 -5
  281. package/environment/platforms.d.ts +0 -6
  282. package/eskimi/ageGroups.d.ts +0 -5
  283. package/eskimi/campaign.d.ts +0 -19
  284. package/eskimi/devices.d.ts +0 -5
  285. package/eskimi/endpoints.d.ts +0 -16
  286. package/eskimi/genders.d.ts +0 -5
  287. package/eskimi/getAccessToken.d.ts +0 -9
  288. package/eskimi/getAgeGroup.d.ts +0 -7
  289. package/eskimi/getCampaignIds.d.ts +0 -7
  290. package/eskimi/getDevice.d.ts +0 -7
  291. package/eskimi/getGender.d.ts +0 -7
  292. package/eskimi/request.d.ts +0 -8
  293. package/google/getCredentials.d.ts +0 -20
  294. package/google/getCredentials.js +0 -76
  295. package/google/sheets/getAssociatedData.d.ts +0 -20
  296. package/google/sheets/getAuth.d.ts +0 -8
  297. package/google/sheets/getAuth.js +0 -69
  298. package/google/sheets/getBatchData.d.ts +0 -20
  299. package/google/sheets/isCellNa.d.ts +0 -7
  300. package/google/storage/writeFile.d.ts +0 -11
  301. package/googleAds/getCustomer.d.ts +0 -7
  302. package/googleAds/initClient.d.ts +0 -15
  303. package/initClients.d.ts +0 -30
  304. package/json/isJson.d.ts +0 -8
  305. package/littleWarden/getUrlStatus.d.ts +0 -9
  306. package/littleWarden/isAllGood.d.ts +0 -7
  307. package/littleWarden/isDanger.d.ts +0 -7
  308. package/littleWarden/isWarning.d.ts +0 -7
  309. package/littleWarden/states.d.ts +0 -7
  310. package/myTarget/getAccessToken.d.ts +0 -9
  311. package/myTarget/request.d.ts +0 -8
  312. package/nextAuth/isSessionReady.d.ts +0 -4
  313. package/nextAuth/states.d.ts +0 -7
  314. package/nextJs/getIp.d.ts +0 -7
  315. package/nextJs/getUserAgent.d.ts +0 -7
  316. package/number/getDivide.d.ts +0 -9
  317. package/number/getNumber.d.ts +0 -8
  318. package/number/getPercent.d.ts +0 -9
  319. package/number/getPercentIncrease.d.ts +0 -9
  320. package/number/getRounded.d.ts +0 -9
  321. package/prisma/initClient.d.ts +0 -4
  322. package/snapchat/getAccessToken.d.ts +0 -9
  323. package/sorting/byNumberAscending.d.ts +0 -8
  324. package/sorting/byNumberDescending.d.ts +0 -8
  325. package/sorting/byStringAscending.d.ts +0 -8
  326. package/sorting/byStringDescending.d.ts +0 -8
  327. package/string/formatCapitalise.d.ts +0 -9
  328. package/string/getCleanFolder.d.ts +0 -7
  329. package/string/getString.d.ts +0 -7
  330. package/string/getStringFromStream.d.ts +0 -8
  331. package/string/toProperCase.d.ts +0 -7
  332. package/swr/isAllData.d.ts +0 -7
  333. package/swr/isAnyError.d.ts +0 -7
  334. package/swr/isAnyLoading.d.ts +0 -7
  335. package/swr/isData.d.ts +0 -7
  336. package/swr/isError.d.ts +0 -7
  337. package/swr/isLoading.d.ts +0 -7
  338. package/upTimeRobot/getMonitors.d.ts +0 -1
  339. package/upTimeRobot/logTypes.d.ts +0 -7
  340. package/upTimeRobot/monitorStatuses.d.ts +0 -8
  341. package/upTimeRobot/monitorSubTypes.d.ts +0 -10
  342. package/upTimeRobot/monitorTypes.d.ts +0 -8
  343. package/upTimeRobot/requestStatuses.d.ts +0 -5
  344. package/url/buildParameters.d.ts +0 -8
  345. package/url/buildRelative.d.ts +0 -8
  346. package/url/buildUrl.d.ts +0 -10
  347. package/url/isAbsolute.d.ts +0 -7
  348. package/url/isRelative.d.ts +0 -7
  349. package/url/url.d.ts +0 -6
  350. package/util/defaultTo.d.ts +0 -9
  351. package/util/sleep.d.ts +0 -4
  352. package/webWorker/states.d.ts +0 -7
  353. package/xml/getXml.d.ts +0 -4
@@ -1,9 +0,0 @@
1
- import { File } from './copyFile';
2
- /**
3
- * It's not possible to just move or rename a file, you must copy then delete the old file.
4
- */
5
- declare const moveFile: ({ from, to }: {
6
- from: File;
7
- to: File;
8
- }) => Promise<void>;
9
- export default moveFile;
@@ -1,13 +0,0 @@
1
- import { Modified } from './readFile';
2
- export declare type ReadBufferResponse = Modified & {
3
- buffer: any;
4
- };
5
- declare type ReadBuffer = {
6
- bucket: string;
7
- key: string;
8
- };
9
- /**
10
- * Similar function to reading the S3 file, but instead of a text file return a buffer.
11
- */
12
- declare const readBuffer: ({ bucket, key }: ReadBuffer) => Promise<ReadBufferResponse>;
13
- export default readBuffer;
@@ -1,30 +0,0 @@
1
- export declare type Modified = {
2
- now: number;
3
- modified: {
4
- unix: null | number;
5
- vsNow: {
6
- months: number;
7
- days: number;
8
- hours: number;
9
- minutes: number;
10
- };
11
- vsMidnight: {
12
- hours: number;
13
- minutes: number;
14
- };
15
- };
16
- };
17
- export declare type ReadFileResponse = Modified & {
18
- body: any;
19
- };
20
- export declare const readFileDefault: ReadFileResponse;
21
- declare type ReadFile = {
22
- bucket: string;
23
- key: string;
24
- isJson?: boolean;
25
- };
26
- /**
27
- * Read a file from S3 and return either null, the content or JSON decoded.
28
- */
29
- declare const readFile: ({ bucket, key, isJson }: ReadFile) => Promise<ReadFileResponse>;
30
- export default readFile;
@@ -1,10 +0,0 @@
1
- declare type WriteFile = {
2
- bucket: string;
3
- data: any;
4
- key: string;
5
- };
6
- /**
7
- * Write a file to S3.
8
- */
9
- declare const writeFile: ({ bucket, data, key, ...options }: WriteFile) => Promise<any>;
10
- export default writeFile;
@@ -1,15 +0,0 @@
1
- import { Response } from '../../api/response';
2
- import { Config } from '../config';
3
- declare type WritePresignedPost = {
4
- bucket: string;
5
- config: Config;
6
- fields: any;
7
- file: any;
8
- key: string;
9
- url: string;
10
- };
11
- /**
12
- * Get a presigned post URL so we can upload directly to S3 via frontend.
13
- */
14
- declare const writePresignedPost: ({ bucket, config, fields, file, key, url }: WritePresignedPost) => Promise<Response>;
15
- export default writePresignedPost;
@@ -1,7 +0,0 @@
1
- import durationComparisons from '../../date/durationComparisons';
2
- import durations from '../../date/durations';
3
- export declare type Cache = {
4
- duration: number;
5
- from: typeof durationComparisons.VS_MIDNIGHT | typeof durationComparisons.VS_NOW;
6
- timeframe: typeof durations.FOREVER | typeof durations.MONTHS | typeof durations.DAYS | typeof durations.HOURS | typeof durations.MINUTES;
7
- };
@@ -1,12 +0,0 @@
1
- import { Cache } from './cache';
2
- import { GetKey } from './getKey';
3
- declare type GetCache = GetKey & {
4
- bucket: string;
5
- cache: Cache;
6
- isJson?: boolean;
7
- };
8
- /**
9
- * Get the stored cache if it exists.
10
- */
11
- declare const getCache: ({ bucket, cache, fileName, folder, isJson }: GetCache) => Promise<any>;
12
- export default getCache;
@@ -1,10 +0,0 @@
1
- export declare type GetKey = {
2
- fileName: any;
3
- folder: string;
4
- };
5
- /**
6
- * Take an input and return the key.
7
- * Always in the "_cache" folder with the "environment" followed by the optional folder then the key.
8
- */
9
- declare const getKey: ({ fileName, folder }: GetKey) => string;
10
- export default getKey;
@@ -1,10 +0,0 @@
1
- declare type SaveCache = {
2
- bucket: string;
3
- data: any;
4
- key: string;
5
- };
6
- /**
7
- * Save the cache.
8
- */
9
- declare const saveCache: ({ bucket, data, key }: SaveCache) => Promise<void>;
10
- export default saveCache;
@@ -1,10 +0,0 @@
1
- import { GetKey } from './getKey';
2
- declare type UpdateCache = GetKey & {
3
- bucket: any;
4
- data: any;
5
- };
6
- /**
7
- * Delete other caches if present, then save the new file.
8
- */
9
- declare const updateCache: ({ bucket, data, fileName, folder }: UpdateCache) => Promise<void>;
10
- export default updateCache;
@@ -1,54 +0,0 @@
1
- import { Response } from '../../api/response';
2
- import BaseClass from '../../class/BaseClass';
3
- import { Config } from '../config';
4
- /**
5
- * Class to build and send an AWS SES email.
6
- */
7
- declare class SimpleEmail extends BaseClass {
8
- from?: string;
9
- to: string[];
10
- cc: string[];
11
- bcc: string[];
12
- html?: string;
13
- subject?: string;
14
- constructor({ bcc, cc, from, html, subject, to }: {
15
- bcc?: string[];
16
- cc?: string[];
17
- from?: string;
18
- html?: string;
19
- subject?: string;
20
- to?: string | string[];
21
- });
22
- setFrom({ from }: {
23
- from: string;
24
- }): this;
25
- setHtml({ html }: {
26
- html: string;
27
- }): this;
28
- setSubject({ subject }: {
29
- subject: string;
30
- }): this;
31
- pushBcc({ recipient }: {
32
- recipient: string | string[];
33
- }): this;
34
- pushCc({ recipient }: {
35
- recipient: string | string[];
36
- }): this;
37
- pushTo({ recipient }: {
38
- recipient: string | string[];
39
- }): this;
40
- setBcc({ recipient }: {
41
- recipient: string | string[];
42
- }): this;
43
- setCc({ recipient }: {
44
- recipient: string | string[];
45
- }): this;
46
- setTo({ recipient }: {
47
- recipient: string | string[];
48
- }): this;
49
- send({ config }: {
50
- config?: Config;
51
- }): Promise<Response>;
52
- private _filterRecipients;
53
- }
54
- export default SimpleEmail;
@@ -1,9 +0,0 @@
1
- import { Config } from '../config';
2
- /**
3
- * Shorthand function to get the Lambda Client.
4
- * Library: @aws-sdk/client-ses
5
- */
6
- declare const initClient: ({ config }: {
7
- config: Config;
8
- }) => void;
9
- export default initClient;
@@ -1,10 +0,0 @@
1
- declare type GetParameter = {
2
- name: string;
3
- withDecryption?: boolean;
4
- isJson?: boolean;
5
- };
6
- /**
7
- * Get a parameter and decryption if necessary (secure string)
8
- */
9
- declare const getParameter: ({ name, withDecryption, isJson }: GetParameter) => Promise<any>;
10
- export default getParameter;
@@ -1,9 +0,0 @@
1
- import { Config } from '../config';
2
- /**
3
- * Shorthand function to get the Lambda Client.
4
- * Library: @aws-sdk/client-ssm
5
- */
6
- declare const initClient: ({ config }: {
7
- config: Config;
8
- }) => void;
9
- export default initClient;
package/axios/get.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export declare type Get = {
2
- config?: object;
3
- onError?: Function;
4
- onSuccess?: Function;
5
- url: string;
6
- };
7
- declare const get: ({ config, onError, onSuccess, url }: Get) => Promise<any>;
8
- export default get;
package/axios/post.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export declare type Post = {
2
- config?: object;
3
- data?: object;
4
- onError?: Function;
5
- onSuccess?: Function;
6
- url: string;
7
- };
8
- /**
9
- * Make a POST request.
10
- */
11
- declare const post: ({ config, data, onError, onSuccess, url }: Post) => Promise<any>;
12
- export default post;
@@ -1,7 +0,0 @@
1
- /**
2
- * Convert an input from a variety of forms into boolean.
3
- */
4
- declare const getBoolean: ({ input }: {
5
- input: any;
6
- }) => boolean;
7
- export default getBoolean;
@@ -1,31 +0,0 @@
1
- declare class BaseClass {
2
- /**
3
- * Shortcut to set a value to an array and return the instance.
4
- */
5
- protected _setArray({ input, fields }: {
6
- input: any | any[];
7
- fields: any | any[];
8
- }): this;
9
- /**
10
- * Shortcut to set a value and return the instance.
11
- */
12
- protected _setValue({ input, fields }: {
13
- input: any;
14
- fields: any | any[];
15
- }): this;
16
- /**
17
- * Shortcut to add a value to an existing array.
18
- */
19
- protected _push({ input, fields }: {
20
- input: any | any[];
21
- fields: any | any[];
22
- }): this;
23
- /**
24
- * Shortcut to get a value, but default if the fields don't exist.
25
- */
26
- protected _get({ defaultValue, fields }: {
27
- defaultValue: any;
28
- fields: any | any[];
29
- }): any;
30
- }
31
- export default BaseClass;
package/crud/actions.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export declare const actions: {
2
- CREATE: string;
3
- READ: string;
4
- UPDATE: string;
5
- DELETE: string;
6
- };
7
- export declare type Action = typeof actions.CREATE | typeof actions.READ | typeof actions.UPDATE | typeof actions.DELETE;
8
- export default actions;
@@ -1,10 +0,0 @@
1
- /**
2
- * Decrypt an encoding string using a salt
3
- * Library: crypto-js
4
- */
5
- declare const getDecrypt: ({ appSalt, input, salt }: {
6
- appSalt: string;
7
- input: string;
8
- salt: string;
9
- }) => string;
10
- export default getDecrypt;
@@ -1,10 +0,0 @@
1
- /**
2
- * Encrypt an encoding string using a salt
3
- * Library: crypto-js
4
- */
5
- declare const getEncrypt: ({ appSalt, input, salt }: {
6
- appSalt: string;
7
- input: string;
8
- salt: string;
9
- }) => string;
10
- export default getEncrypt;
@@ -1,8 +0,0 @@
1
- /**
2
- * Create a random string and return a number of characters from it.
3
- * Library: crypto-js
4
- */
5
- declare const getRandom: ({ length }: {
6
- length: number;
7
- }) => string;
8
- export default getRandom;
@@ -1,8 +0,0 @@
1
- /**
2
- * Encrypt a string using sha256
3
- * Library: crypto-js
4
- */
5
- declare const getSha256: ({ input }: {
6
- input: any;
7
- }) => string;
8
- export default getSha256;
package/date/date.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /**
2
- * A date can be either a number (YYYYMMDD), string (YYYY-MM-DD) or Date instance.
3
- */
4
- export declare type DateType = number | string | Date;
@@ -1,5 +0,0 @@
1
- export declare type Duration = {
2
- hours: number;
3
- minutes: number;
4
- seconds: number;
5
- };
@@ -1,5 +0,0 @@
1
- declare const durationComparisons: {
2
- VS_NOW: string;
3
- VS_MIDNIGHT: string;
4
- };
5
- export default durationComparisons;
@@ -1,8 +0,0 @@
1
- declare const durations: {
2
- FOREVER: string;
3
- MONTHS: string;
4
- DAYS: string;
5
- HOURS: string;
6
- MINUTES: string;
7
- };
8
- export default durations;
@@ -1,4 +0,0 @@
1
- export declare type FinancialYear = {
2
- end: Date;
3
- start: Date;
4
- };
@@ -1,6 +0,0 @@
1
- export declare type FinancialYearWeekType = {
2
- end: Date;
3
- financialWeek: number;
4
- financialYear: number;
5
- start: Date;
6
- };
package/date/format.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import { DateType } from './date';
2
- import { GetMidnight } from './getMidnight';
3
- import { GetTimeZoned } from './getTimeZoned';
4
- declare type Format = GetTimeZoned & GetMidnight & {
5
- dateFormat?: string;
6
- input: DateType;
7
- };
8
- /**
9
- * Convert a (number | string | Date) into a "yyyy-MM-dd" string or a specified format.
10
- * As the user would be providing the input we don't want to change the timezone typically.
11
- */
12
- declare const format: ({ input, dateFormat, setMidnight, setTimeZone }: Format) => string;
13
- export default format;
package/date/getDate.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import { DateType } from './date';
2
- import { GetMidnight } from './getMidnight';
3
- import { GetTimeZoned } from './getTimeZoned';
4
- declare type GetDate = GetTimeZoned & GetMidnight & {
5
- input: DateType;
6
- };
7
- /**
8
- * Convert a (number | string | Date) into a Date object.
9
- * As the user would be providing the input we don't want to change the timezone typically.
10
- */
11
- declare const getDate: ({ input, setMidnight, setTimeZone }: GetDate) => Date;
12
- export default getDate;
@@ -1,10 +0,0 @@
1
- import { DateType } from './date';
2
- /**
3
- * Similar to date-fns' eachDayOfInterval, however the timezone messes this function up.
4
- * https://date-fns.org/v2.28.0/docs/eachDayOfInterval
5
- */
6
- declare const getDatesBetween: ({ end, start }: {
7
- end: DateType;
8
- start: DateType;
9
- }) => Date[];
10
- export default getDatesBetween;
@@ -1,8 +0,0 @@
1
- /**
2
- * Convert a number 1000 seconds into HH:MM:SS
3
- * https://stackoverflow.com/a/1322771
4
- */
5
- declare const getDurationHours: ({ seconds }: {
6
- seconds: number;
7
- }) => string;
8
- export default getDurationHours;
@@ -1,8 +0,0 @@
1
- /**
2
- * Convert a number 1000 seconds into MM:SS
3
- * https://stackoverflow.com/a/1322771
4
- */
5
- declare const getDurationMinutes: ({ seconds }: {
6
- seconds: number;
7
- }) => string;
8
- export default getDurationMinutes;
@@ -1,9 +0,0 @@
1
- import { FinancialYear } from './financialYear';
2
- declare type GetFinancialYearType = {
3
- year?: number;
4
- };
5
- /**
6
- * Get the current financial year.
7
- */
8
- declare const getFinancialYear: ({ year }?: GetFinancialYearType) => FinancialYear;
9
- export default getFinancialYear;
@@ -1,7 +0,0 @@
1
- import { FinancialYear } from './financialYear';
2
- /**
3
- * Return the current financial year up to today.
4
- * Timezone should always be London based
5
- */
6
- declare const getFinancialYearToDate: () => FinancialYear;
7
- export default getFinancialYearToDate;
@@ -1,7 +0,0 @@
1
- import { FinancialYear } from './financialYear';
2
- /**
3
- * Return the current financial year up to yesterday.
4
- * Timezone should always be London based
5
- */
6
- declare const getFinancialYearToYesterday: () => FinancialYear;
7
- export default getFinancialYearToYesterday;
@@ -1,9 +0,0 @@
1
- import { FinancialYearWeekType } from './financialYearWeek';
2
- declare type GetFinancialYearWeeks = {
3
- year?: number;
4
- };
5
- /**
6
- * Get the current financial year.
7
- */
8
- declare const getFinancialYearWeeks: ({ year }?: GetFinancialYearWeeks) => FinancialYearWeekType[];
9
- export default getFinancialYearWeeks;
@@ -1,10 +0,0 @@
1
- import { GetMidnight } from './getMidnight';
2
- import { GetTimeZoned } from './getTimeZoned';
3
- import { Timeframe } from './timeframe';
4
- declare type GetLastWeek = GetTimeZoned & GetMidnight;
5
- /**
6
- * Return an object of start/end predefined date of Last Week.
7
- * Creating a date from scratch (no user input), thus needs to be London time.
8
- */
9
- declare const getLastWeek: ({ setMidnight, setTimeZone }?: GetLastWeek) => Timeframe;
10
- export default getLastWeek;
package/date/getMax.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import { DateType } from './date';
2
- import { GetMidnight } from './getMidnight';
3
- import { GetTimeZoned } from './getTimeZoned';
4
- declare type GetMax = GetTimeZoned & GetMidnight & {
5
- input: DateType;
6
- max: DateType;
7
- };
8
- /**
9
- * If a given date is beyond the maximum, return the maximum.
10
- */
11
- declare const getMax: ({ input, max, setMidnight }: GetMax) => Date;
12
- export default getMax;
@@ -1,10 +0,0 @@
1
- export declare type GetMidnight = {
2
- setMidnight?: boolean;
3
- };
4
- /**
5
- * Set a date's time to 0 hours, 0 minutes, 0 seconds, 0 milliseconds
6
- */
7
- declare const getMidnight: ({ input, setMidnight }: GetMidnight & {
8
- input: Date;
9
- }) => Date;
10
- export default getMidnight;
package/date/getMin.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import { DateType } from './date';
2
- import { GetMidnight } from './getMidnight';
3
- import { GetTimeZoned } from './getTimeZoned';
4
- declare type GetMin = GetTimeZoned & GetMidnight & {
5
- input: DateType;
6
- min: DateType;
7
- };
8
- /**
9
- * If a given date is before the minimum, return the minimum.
10
- */
11
- declare const getMin: ({ input, min, setMidnight }: GetMin) => Date;
12
- export default getMin;
@@ -1,14 +0,0 @@
1
- import { DateType } from './date';
2
- import { GetMidnight } from './getMidnight';
3
- import { GetTimeZoned } from './getTimeZoned';
4
- declare type GetMonday = GetTimeZoned & GetMidnight & {
5
- input?: DateType;
6
- weeksAgo: number;
7
- };
8
- /**
9
- * Retrieve the closest last Monday relative to the input or today.
10
- * 0 weeksAgo - Tuesday (10th), return Monday (8th)
11
- * 1 weeksAgo - Tuesday (10th), return Monday (1st)
12
- */
13
- declare const getMonday: ({ weeksAgo, input, setMidnight, setTimeZone }: GetMonday) => Date;
14
- export default getMonday;
@@ -1,11 +0,0 @@
1
- import { DateType } from './date';
2
- import { GetMidnight } from './getMidnight';
3
- import { GetTimeZoned } from './getTimeZoned';
4
- declare type GetNumber = GetTimeZoned & GetMidnight & {
5
- input: DateType;
6
- };
7
- /**
8
- * Convert a (number | string | Date) into a YYYYMMDD number.
9
- */
10
- declare const getNumber: ({ input, setMidnight, setTimeZone }: GetNumber) => number;
11
- export default getNumber;
@@ -1,9 +0,0 @@
1
- import { PredefinedTimeframes } from './predefinedTimeframes';
2
- import { Timeframe } from './timeframe';
3
- /**
4
- * Check to see the date matches a predefined time frame
5
- */
6
- declare const getPredefinedTimeframe: ({ timeframe }: {
7
- timeframe: Timeframe;
8
- }) => PredefinedTimeframes;
9
- export default getPredefinedTimeframe;
@@ -1,14 +0,0 @@
1
- import { DateType } from './date';
2
- import { GetMidnight } from './getMidnight';
3
- import { GetTimeZoned } from './getTimeZoned';
4
- declare type GetSunday = GetTimeZoned & GetMidnight & {
5
- input?: DateType;
6
- weeksAgo: number;
7
- };
8
- /**
9
- * Retrieve the closest last Sunday relative to the input or today.
10
- * 0 weeksAgo - Tuesday (17th), return Sunday (14th)
11
- * 1 weeksAgo - Tuesday (17th), return Monday (7th)
12
- */
13
- declare const getSunday: ({ weeksAgo, input, setMidnight, setTimeZone }: GetSunday) => Date;
14
- export default getSunday;
@@ -1,10 +0,0 @@
1
- import { GetMidnight } from './getMidnight';
2
- import { GetTimeZoned } from './getTimeZoned';
3
- import { Timeframe } from './timeframe';
4
- declare type GetThisWeek = GetTimeZoned & GetMidnight;
5
- /**
6
- * Return an object of start/end predefined date of This Week.
7
- * Creating a date from scratch (no user input), thus needs to be London time.
8
- */
9
- declare const getThisWeek: ({ setMidnight, setTimeZone }?: GetThisWeek) => Timeframe;
10
- export default getThisWeek;
@@ -1,13 +0,0 @@
1
- export declare type GetTimeZoned = {
2
- setTimeZone?: string | false;
3
- };
4
- export declare const timeZoneLondon = "Europe/London";
5
- /**
6
- * Convert an input into a given timezone.
7
- * We can't use getDate here as it becomes a circular issue.
8
- * Returns a new Date instance.
9
- */
10
- declare const getTimeZoned: ({ input, setTimeZone }: GetTimeZoned & {
11
- input: Date;
12
- }) => Date;
13
- export default getTimeZoned;
@@ -1,9 +0,0 @@
1
- import { GetMidnight } from './getMidnight';
2
- import { GetTimeZoned } from './getTimeZoned';
3
- declare type GetToday = GetTimeZoned & GetMidnight;
4
- /**
5
- * Shortcut to get today's date.
6
- * Creating a date from scratch (no user input), thus needs to be London time.
7
- */
8
- declare const getToday: ({ setMidnight, setTimeZone }?: GetToday) => Date;
9
- export default getToday;
@@ -1,10 +0,0 @@
1
- import { GetMidnight } from './getMidnight';
2
- import { GetTimeZoned } from './getTimeZoned';
3
- import { Timeframe } from './timeframe';
4
- declare type GetTwoWeeksAgo = GetTimeZoned & GetMidnight;
5
- /**
6
- * Return an object of start/end predefined date of Two Weeks Ago.
7
- * Creating a date from scratch (no user input), thus needs to be London time.
8
- */
9
- declare const getTwoWeeksAgo: ({ setMidnight, setTimeZone }?: GetTwoWeeksAgo) => Timeframe;
10
- export default getTwoWeeksAgo;