@8ms/helpers 2.0.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 (345) hide show
  1. package/.github/workflows/deploy_npmjs.yml +7 -0
  2. package/.yarn/install-state.gz +0 -0
  3. package/_class/BaseClass.d.ts +18 -0
  4. package/_class/BaseClass.js +53 -0
  5. package/_class/BaseNamespace.d.ts +9 -0
  6. package/_class/BaseNamespace.js +27 -0
  7. package/_class/index.d.ts +2 -0
  8. package/_class/index.js +7 -0
  9. package/adverity/getJobs.d.ts +15 -0
  10. package/adverity/getJobs.js +30 -0
  11. package/adverity/index.d.ts +112 -0
  12. package/adverity/index.js +61 -0
  13. package/api/ApiResponseClass.d.ts +35 -0
  14. package/api/ApiResponseClass.js +97 -0
  15. package/api/index.d.ts +22 -0
  16. package/api/index.js +44 -0
  17. package/array/index.d.ts +8 -0
  18. package/array/index.js +17 -0
  19. package/atInternet/index.d.ts +16 -0
  20. package/atInternet/index.js +18 -0
  21. package/aws/athenaExpress/AwsAthenaNamespace.d.ts +8 -0
  22. package/aws/athenaExpress/AwsAthenaNamespace.js +82 -0
  23. package/aws/athenaExpress/index.d.ts +10 -0
  24. package/aws/athenaExpress/index.js +40 -0
  25. package/aws/ec2/AwsEc2Namespace.d.ts +10 -0
  26. package/aws/ec2/AwsEc2Namespace.js +78 -0
  27. package/aws/ec2/index.d.ts +3 -0
  28. package/aws/ec2/index.js +16 -0
  29. package/aws/ecs/AwsEcsNamespace.d.ts +53 -0
  30. package/aws/ecs/AwsEcsNamespace.js +159 -0
  31. package/aws/ecs/index.d.ts +3 -0
  32. package/aws/ecs/index.js +16 -0
  33. package/aws/glue/AwsGlueNamespace.d.ts +12 -0
  34. package/aws/glue/AwsGlueNamespace.js +70 -0
  35. package/aws/glue/index.d.ts +3 -0
  36. package/aws/glue/index.js +16 -0
  37. package/aws/index.d.ts +9 -0
  38. package/aws/index.js +34 -0
  39. package/aws/isResponse200.d.ts +4 -0
  40. package/aws/isResponse200.js +16 -0
  41. package/aws/lambda/AwsLambdaNamespace.d.ts +21 -0
  42. package/aws/lambda/AwsLambdaNamespace.js +110 -0
  43. package/aws/lambda/index.d.ts +4 -0
  44. package/aws/lambda/index.js +21 -0
  45. package/aws/s3/AwsS3Namespace.d.ts +60 -0
  46. package/aws/s3/AwsS3Namespace.js +401 -0
  47. package/aws/s3/index.d.ts +25 -0
  48. package/aws/s3/index.js +36 -0
  49. package/aws/s3/payload.d.ts +42 -0
  50. package/aws/s3/payload.js +46 -0
  51. package/aws/ses/AwsSesNamespace.d.ts +18 -0
  52. package/aws/ses/AwsSesNamespace.js +69 -0
  53. package/aws/ses/SimpleEmail.d.ts +56 -0
  54. package/aws/ses/SimpleEmail.js +106 -0
  55. package/aws/ses/index.d.ts +4 -0
  56. package/aws/ses/index.js +18 -0
  57. package/aws/sqs/AwsSqsNamespace.d.ts +34 -0
  58. package/aws/sqs/AwsSqsNamespace.js +96 -0
  59. package/aws/sqs/index.d.ts +3 -0
  60. package/aws/sqs/index.js +16 -0
  61. package/aws/ssm/AwsSsmNamespace.d.ts +11 -0
  62. package/aws/ssm/AwsSsmNamespace.js +89 -0
  63. package/aws/ssm/index.d.ts +3 -0
  64. package/aws/ssm/index.js +16 -0
  65. package/axios/deleteRequest.d.ts +6 -0
  66. package/axios/deleteRequest.js +33 -0
  67. package/axios/get.d.ts +5 -0
  68. package/axios/get.js +31 -0
  69. package/axios/index.d.ts +3 -0
  70. package/axios/index.js +9 -0
  71. package/axios/post.d.ts +5 -0
  72. package/axios/post.js +32 -0
  73. package/boolean/getBoolean.d.ts +4 -0
  74. package/boolean/getBoolean.js +23 -0
  75. package/boolean/index.d.ts +1 -0
  76. package/boolean/index.js +5 -0
  77. package/brightData/index.d.ts +15 -0
  78. package/brightData/index.js +20 -0
  79. package/brightData/serpApi/buildGoogleSerpUrl.d.ts +32 -0
  80. package/brightData/serpApi/buildGoogleSerpUrl.js +116 -0
  81. package/brightData/serpApi/buildGoogleTrendsUrl.d.ts +22 -0
  82. package/brightData/serpApi/buildGoogleTrendsUrl.js +61 -0
  83. package/brightData/serpApi/getAsyncRequestId.d.ts +8 -0
  84. package/brightData/serpApi/getAsyncRequestId.js +36 -0
  85. package/brightData/serpApi/getAsyncResults.d.ts +7 -0
  86. package/brightData/serpApi/getAsyncResults.js +35 -0
  87. package/brightData/serpApi/getRealtime.d.ts +5 -0
  88. package/brightData/serpApi/getRealtime.js +30 -0
  89. package/brightData/serpApi/index.d.ts +14 -0
  90. package/brightData/serpApi/index.js +23 -0
  91. package/brightData/webScraperIde/getBatch.d.ts +7 -0
  92. package/brightData/webScraperIde/getBatch.js +28 -0
  93. package/brightData/webScraperIde/getRealtime.d.ts +7 -0
  94. package/brightData/webScraperIde/getRealtime.js +49 -0
  95. package/brightData/webScraperIde/index.d.ts +2 -0
  96. package/brightData/webScraperIde/index.js +7 -0
  97. package/cache/index.d.ts +2 -0
  98. package/cache/index.js +48 -0
  99. package/cache/test/cache.test.d.ts +1 -0
  100. package/cache/test/cache.test.js +10 -0
  101. package/crud/index.d.ts +6 -0
  102. package/crud/index.js +10 -0
  103. package/crypto/getDecrypt.d.ts +5 -0
  104. package/crypto/getDecrypt.js +47 -0
  105. package/crypto/getEncrypt.d.ts +5 -0
  106. package/crypto/getEncrypt.js +47 -0
  107. package/crypto/getRandom.d.ts +4 -0
  108. package/crypto/getRandom.js +12 -0
  109. package/crypto/getSha256.d.ts +5 -0
  110. package/crypto/getSha256.js +48 -0
  111. package/crypto/index.d.ts +4 -0
  112. package/crypto/index.js +11 -0
  113. package/date/calculation.d.ts +75 -0
  114. package/date/calculation.js +207 -0
  115. package/date/financialYear.d.ts +19 -0
  116. package/date/financialYear.js +85 -0
  117. package/date/format.d.ts +68 -0
  118. package/date/format.js +150 -0
  119. package/date/index.d.ts +35 -0
  120. package/date/index.js +57 -0
  121. package/environment/index.d.ts +32 -0
  122. package/environment/index.js +92 -0
  123. package/eskimi/getAgeGroup.d.ts +4 -0
  124. package/eskimi/getAgeGroup.js +15 -0
  125. package/eskimi/getData.d.ts +4 -0
  126. package/eskimi/getData.js +17 -0
  127. package/eskimi/getDevice.d.ts +4 -0
  128. package/eskimi/getDevice.js +15 -0
  129. package/eskimi/getGender.d.ts +4 -0
  130. package/eskimi/getGender.js +15 -0
  131. package/eskimi/index.d.ts +49 -0
  132. package/eskimi/index.js +96 -0
  133. package/file/createDirectory.d.ts +5 -0
  134. package/file/createDirectory.js +50 -0
  135. package/file/index.d.ts +1 -0
  136. package/file/index.js +5 -0
  137. package/geo/countries.d.ts +12 -0
  138. package/geo/countries.js +222 -0
  139. package/geo/index.d.ts +2 -0
  140. package/geo/index.js +7 -0
  141. package/geo/languages.d.ts +9 -0
  142. package/geo/languages.js +58 -0
  143. package/google/bigQuery/GoogleBigQueryNamespace.d.ts +51 -0
  144. package/google/bigQuery/GoogleBigQueryNamespace.js +165 -0
  145. package/google/bigQuery/index.d.ts +5 -0
  146. package/google/bigQuery/index.js +37 -0
  147. package/google/bigQuery/loadData.d.ts +19 -0
  148. package/google/bigQuery/loadData.js +18 -0
  149. package/google/index.d.ts +27 -0
  150. package/google/index.js +24 -0
  151. package/google/sheets/GoogleSheetsNamespace.d.ts +16 -0
  152. package/google/sheets/GoogleSheetsNamespace.js +81 -0
  153. package/google/sheets/getAssociatedData.d.ts +10 -0
  154. package/google/sheets/getAssociatedData.js +43 -0
  155. package/google/sheets/index.d.ts +8 -0
  156. package/google/sheets/index.js +37 -0
  157. package/google/storage/GoogleCloudStorageNamespace.d.ts +20 -0
  158. package/google/storage/GoogleCloudStorageNamespace.js +108 -0
  159. package/google/storage/index.d.ts +3 -0
  160. package/google/storage/index.js +30 -0
  161. package/googleAds/GoogleAdsNamespace.d.ts +11 -0
  162. package/googleAds/GoogleAdsNamespace.js +73 -0
  163. package/googleAds/index.d.ts +11 -0
  164. package/googleAds/index.js +30 -0
  165. package/googleAds/keywordPlanner/index.d.ts +40 -0
  166. package/googleAds/keywordPlanner/index.js +59 -0
  167. package/googlePageSpeed/GooglePageSpeedNamespace.d.ts +11 -0
  168. package/googlePageSpeed/GooglePageSpeedNamespace.js +35 -0
  169. package/googlePageSpeed/index.d.ts +17 -0
  170. package/googlePageSpeed/index.js +44 -0
  171. package/googleSearchIncidents/index.d.ts +69 -0
  172. package/googleSearchIncidents/index.js +46 -0
  173. package/greenDomain/index.d.ts +21 -0
  174. package/greenDomain/index.js +41 -0
  175. package/inngest/index.d.ts +6 -0
  176. package/inngest/index.js +10 -0
  177. package/json/getJsonNewline.d.ts +1 -0
  178. package/json/getJsonNewline.js +13 -0
  179. package/json/index.d.ts +2 -0
  180. package/json/index.js +7 -0
  181. package/json/isJson.d.ts +1 -0
  182. package/json/isJson.js +26 -0
  183. package/littleWarden/LittleWardenNamespace.d.ts +11 -0
  184. package/littleWarden/LittleWardenNamespace.js +38 -0
  185. package/littleWarden/getUrlStatus.d.ts +4 -0
  186. package/littleWarden/getUrlStatus.js +16 -0
  187. package/littleWarden/index.d.ts +29 -0
  188. package/littleWarden/index.js +74 -0
  189. package/lumar/api/buildRequest.d.ts +13 -0
  190. package/lumar/api/buildRequest.js +80 -0
  191. package/lumar/api/getData.d.ts +5 -0
  192. package/lumar/api/getData.js +13 -0
  193. package/lumar/api/index.d.ts +36 -0
  194. package/lumar/api/index.js +33 -0
  195. package/lumar/api/initClient.d.ts +6 -0
  196. package/lumar/api/initClient.js +26 -0
  197. package/lumar/graphql/columns.d.ts +28 -0
  198. package/lumar/graphql/columns.js +31 -0
  199. package/lumar/graphql/getData.d.ts +1 -0
  200. package/lumar/graphql/getData.js +20 -0
  201. package/lumar/graphql/index.d.ts +29 -0
  202. package/lumar/graphql/index.js +39 -0
  203. package/lumar/graphql/initClient.d.ts +5 -0
  204. package/lumar/graphql/initClient.js +25 -0
  205. package/lumar/graphql/queries/crawl.d.ts +5 -0
  206. package/lumar/graphql/queries/crawl.js +2 -0
  207. package/lumar/graphql/queries/getCrawls.d.ts +18 -0
  208. package/lumar/graphql/queries/getCrawls.js +33 -0
  209. package/lumar/graphql/queries/getReportDifferences.d.ts +24 -0
  210. package/lumar/graphql/queries/getReportDifferences.js +37 -0
  211. package/lumar/graphql/queries/getRows.d.ts +38 -0
  212. package/lumar/graphql/queries/getRows.js +57 -0
  213. package/lumar/graphql/queries/getTotals.d.ts +25 -0
  214. package/lumar/graphql/queries/getTotals.js +40 -0
  215. package/lumar/graphql/queries/row.d.ts +157 -0
  216. package/lumar/graphql/queries/row.js +2 -0
  217. package/lumar/graphql/reportTemplates.d.ts +67 -0
  218. package/lumar/graphql/reportTemplates.js +70 -0
  219. package/myTarget/request.d.ts +5 -0
  220. package/myTarget/request.js +17 -0
  221. package/nextAuth/index.d.ts +6 -0
  222. package/nextAuth/index.js +11 -0
  223. package/nextAuth/isSessionReady.d.ts +1 -0
  224. package/nextAuth/isSessionReady.js +13 -0
  225. package/nextJs/getIp.d.ts +6 -0
  226. package/nextJs/getIp.js +14 -0
  227. package/nextJs/getUserAgent.d.ts +6 -0
  228. package/nextJs/getUserAgent.js +8 -0
  229. package/nextJs/index.d.ts +2 -0
  230. package/nextJs/index.js +7 -0
  231. package/number/format.d.ts +12 -0
  232. package/number/format.js +20 -0
  233. package/number/formatCurrency.d.ts +5 -0
  234. package/number/formatCurrency.js +21 -0
  235. package/number/getDecimal.d.ts +4 -0
  236. package/number/getDecimal.js +12 -0
  237. package/number/getNumber.d.ts +4 -0
  238. package/number/getNumber.js +48 -0
  239. package/number/getPercentIncrease.d.ts +4 -0
  240. package/number/getPercentIncrease.js +16 -0
  241. package/number/getSafeDivide.d.ts +11 -0
  242. package/number/getSafeDivide.js +20 -0
  243. package/number/index.d.ts +6 -0
  244. package/number/index.js +15 -0
  245. package/object/index.d.ts +1 -0
  246. package/object/index.js +5 -0
  247. package/object/replaceKeys.d.ts +5 -0
  248. package/object/replaceKeys.js +25 -0
  249. package/onePassword/OnePasswordNamespace.d.ts +13 -0
  250. package/onePassword/OnePasswordNamespace.js +81 -0
  251. package/onePassword/index.d.ts +7 -0
  252. package/onePassword/index.js +25 -0
  253. package/openAi/OpenAiNamespace.d.ts +11 -0
  254. package/openAi/OpenAiNamespace.js +44 -0
  255. package/openAi/index.d.ts +5 -0
  256. package/openAi/index.js +30 -0
  257. package/package.json +2 -2
  258. package/prisma/PrismaNamespace.d.ts +8 -0
  259. package/prisma/PrismaNamespace.js +79 -0
  260. package/prisma/getDecimal.d.ts +4 -0
  261. package/prisma/getDecimal.js +23 -0
  262. package/prisma/index.d.ts +8 -0
  263. package/prisma/index.js +29 -0
  264. package/snapchat/SnapchatNamespace.d.ts +15 -0
  265. package/snapchat/SnapchatNamespace.js +30 -0
  266. package/snapchat/index.d.ts +7 -0
  267. package/snapchat/index.js +30 -0
  268. package/sorting/byNumberAscending.d.ts +4 -0
  269. package/sorting/byNumberAscending.js +19 -0
  270. package/sorting/byNumberDescending.d.ts +4 -0
  271. package/sorting/byNumberDescending.js +22 -0
  272. package/sorting/byStringAscending.d.ts +4 -0
  273. package/sorting/byStringAscending.js +16 -0
  274. package/sorting/byStringDescending.d.ts +4 -0
  275. package/sorting/byStringDescending.js +16 -0
  276. package/sorting/index.d.ts +4 -0
  277. package/sorting/index.js +11 -0
  278. package/stream/index.d.ts +1 -0
  279. package/stream/index.js +5 -0
  280. package/stream/sort.d.ts +13 -0
  281. package/stream/sort.js +51 -0
  282. package/string/getCapitalised.d.ts +5 -0
  283. package/string/getCapitalised.js +18 -0
  284. package/string/getClean.d.ts +18 -0
  285. package/string/getClean.js +51 -0
  286. package/string/getFolder.d.ts +4 -0
  287. package/string/getFolder.js +15 -0
  288. package/string/getProperCase.d.ts +11 -0
  289. package/string/getProperCase.js +25 -0
  290. package/string/getString.d.ts +4 -0
  291. package/string/getString.js +34 -0
  292. package/string/getStringFromStream.d.ts +5 -0
  293. package/string/getStringFromStream.js +17 -0
  294. package/string/getUnescaped.d.ts +6 -0
  295. package/string/getUnescaped.js +26 -0
  296. package/string/getWithoutAccents.d.ts +5 -0
  297. package/string/getWithoutAccents.js +13 -0
  298. package/string/getWithoutHtmlTags.d.ts +5 -0
  299. package/string/getWithoutHtmlTags.js +12 -0
  300. package/string/getWithoutPunctuation.d.ts +5 -0
  301. package/string/getWithoutPunctuation.js +13 -0
  302. package/string/getWithoutUnderscores.d.ts +4 -0
  303. package/string/getWithoutUnderscores.js +11 -0
  304. package/string/getWithoutWhitespaces.d.ts +5 -0
  305. package/string/getWithoutWhitespaces.js +13 -0
  306. package/string/index.d.ts +12 -0
  307. package/string/index.js +27 -0
  308. package/swr/index.d.ts +42 -0
  309. package/swr/index.js +59 -0
  310. package/upTimeRobot/UpTimeRobotNamespace.d.ts +31 -0
  311. package/upTimeRobot/UpTimeRobotNamespace.js +52 -0
  312. package/upTimeRobot/index.d.ts +38 -0
  313. package/upTimeRobot/index.js +63 -0
  314. package/url/index.d.ts +19 -0
  315. package/url/index.js +70 -0
  316. package/url/writeUrlContents.d.ts +6 -0
  317. package/url/writeUrlContents.js +75 -0
  318. package/util/defaultTo.d.ts +4 -0
  319. package/util/defaultTo.js +44 -0
  320. package/util/getBrotliCompressed.d.ts +5 -0
  321. package/util/getBrotliCompressed.js +23 -0
  322. package/util/getBrotliDecompressed.d.ts +5 -0
  323. package/util/getBrotliDecompressed.js +24 -0
  324. package/util/getClean.d.ts +11 -0
  325. package/util/getClean.js +23 -0
  326. package/util/getGzipCompressed.d.ts +5 -0
  327. package/util/getGzipCompressed.js +23 -0
  328. package/util/getGzipDecompressed.d.ts +5 -0
  329. package/util/getGzipDecompressed.js +24 -0
  330. package/util/getWithoutHash.d.ts +4 -0
  331. package/util/getWithoutHash.js +18 -0
  332. package/util/getWithoutParameter.d.ts +4 -0
  333. package/util/getWithoutParameter.js +18 -0
  334. package/util/index.d.ts +11 -0
  335. package/util/index.js +25 -0
  336. package/util/isUndefined.d.ts +4 -0
  337. package/util/isUndefined.js +13 -0
  338. package/util/promiseChunks.d.ts +5 -0
  339. package/util/promiseChunks.js +19 -0
  340. package/util/sleep.d.ts +1 -0
  341. package/util/sleep.js +7 -0
  342. package/webWorker/index.d.ts +5 -0
  343. package/webWorker/index.js +9 -0
  344. package/xml/getXml.d.ts +1 -0
  345. package/xml/getXml.js +18 -0
@@ -0,0 +1,38 @@
1
+ type GetRows = {
2
+ after?: string;
3
+ before?: string;
4
+ crawlId: number;
5
+ first: number;
6
+ filter: object;
7
+ last: number;
8
+ orderBy?: object;
9
+ reportTemplateCode: string;
10
+ reportTypeCode: string;
11
+ };
12
+ declare const getRows: ({ after, before, crawlId, filter, first, last, orderBy, reportTemplateCode, reportTypeCode }: GetRows) => {
13
+ id: string;
14
+ after: string;
15
+ before: string;
16
+ crawlId: number;
17
+ filter: object;
18
+ first: number;
19
+ last: number;
20
+ orderBy: object;
21
+ query: string;
22
+ reportTemplateCode: string;
23
+ reportTypeCode: string;
24
+ variables: {
25
+ after: string;
26
+ before: string;
27
+ filter: object;
28
+ first: number;
29
+ input: {
30
+ crawlId: number;
31
+ reportTemplateCode: string;
32
+ reportTypeCode: string;
33
+ };
34
+ last: number;
35
+ orderBy: object;
36
+ };
37
+ };
38
+ export default getRows;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getRows = ({ after, before, crawlId, filter, first, last, orderBy, reportTemplateCode, reportTypeCode }) => ({
4
+ id: `get-rows-${crawlId}-${reportTemplateCode}-${reportTypeCode}`.toLowerCase(),
5
+ after,
6
+ before,
7
+ crawlId,
8
+ filter,
9
+ first,
10
+ last,
11
+ orderBy,
12
+ query: `
13
+ query GetRows($input: GetReportInputType!, $orderBy: [JSONObject!], $filter: JSONObject, $first: Int, $after: String, $last: Int, $before: String) {
14
+ getReport(input: $input) {
15
+ totalRows
16
+ rawID
17
+ reportTemplateCode
18
+ reportTypeCode
19
+ id
20
+ rowsWithAllMetrics(
21
+ filter: $filter
22
+ orderBy: $orderBy
23
+ last: $last
24
+ first: $first
25
+ before: $before
26
+ after: $after
27
+ ) {
28
+ __typename
29
+ totalCount
30
+ nodes
31
+ pageInfo {
32
+ hasNextPage
33
+ endCursor
34
+ startCursor
35
+ hasPreviousPage
36
+ }
37
+ }
38
+ }
39
+ }
40
+ `,
41
+ reportTemplateCode,
42
+ reportTypeCode,
43
+ variables: {
44
+ after,
45
+ before,
46
+ filter,
47
+ first,
48
+ input: {
49
+ crawlId,
50
+ reportTemplateCode,
51
+ reportTypeCode,
52
+ },
53
+ last,
54
+ orderBy: orderBy || null,
55
+ },
56
+ });
57
+ exports.default = getRows;
@@ -0,0 +1,25 @@
1
+ type GetTotals = {
2
+ crawlId: number;
3
+ filter: object;
4
+ filterKey?: string;
5
+ reportTemplateCode: string;
6
+ reportTypeCode: string;
7
+ };
8
+ declare const getTotals: ({ crawlId, filter, filterKey, reportTemplateCode, reportTypeCode }: GetTotals) => {
9
+ id: string;
10
+ crawlId: number;
11
+ filter: object;
12
+ filterKey: string;
13
+ query: string;
14
+ reportTemplateCode: string;
15
+ reportTypeCode: string;
16
+ variables: {
17
+ filter: object;
18
+ input: {
19
+ crawlId: number;
20
+ reportTemplateCode: string;
21
+ reportTypeCode: string;
22
+ };
23
+ };
24
+ };
25
+ export default getTotals;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getTotals = ({ crawlId, filter, filterKey, reportTemplateCode, reportTypeCode }) => ({
4
+ id: `get-totals-${crawlId}-${reportTemplateCode}-${reportTypeCode}`.toLowerCase(),
5
+ crawlId,
6
+ filter,
7
+ filterKey,
8
+ query: `
9
+ query GetTotals($input: GetReportInputType!, $filter: JSONObject) {
10
+ getReport(input: $input) {
11
+ rawID
12
+ reportTemplateCode
13
+ reportTypeCode
14
+ totalRows
15
+ id
16
+ diffReportTotals(includeSelf: true, filter: $filter) {
17
+ totalRows
18
+ reportTypeCode
19
+ __typename
20
+ }
21
+ rows(
22
+ filter: $filter
23
+ ) {
24
+ totalCount
25
+ }
26
+ }
27
+ }
28
+ `,
29
+ reportTemplateCode,
30
+ reportTypeCode,
31
+ variables: {
32
+ filter,
33
+ input: {
34
+ crawlId,
35
+ reportTemplateCode,
36
+ reportTypeCode,
37
+ },
38
+ },
39
+ });
40
+ exports.default = getTotals;
@@ -0,0 +1,157 @@
1
+ type RedirectChain = {
2
+ "isMetaRedirect": boolean;
3
+ "redirectsTo": null | string;
4
+ "result": string;
5
+ "statusCode": string;
6
+ "url": string;
7
+ };
8
+ export type Row = {
9
+ "canonicalLinksInCount": number;
10
+ "canonicalUrlIsConsistent": boolean;
11
+ "canonicalizedPage": boolean;
12
+ "contentHtmlRatio": string;
13
+ "contentSize": number;
14
+ "crawlDatetime": string;
15
+ "css": boolean;
16
+ "customExtractionMatch": boolean;
17
+ "customExtraction1": any[];
18
+ "customExtraction2": any[];
19
+ "deeprank": number;
20
+ "description": string;
21
+ "descriptionLengthPx": number;
22
+ "descriptionLength": number;
23
+ "disallowedPage": boolean;
24
+ "duplicateBodyCount": number;
25
+ "duplicateBodyNonIndexable": boolean;
26
+ "duplicateBody": boolean;
27
+ "duplicateDescriptionCount": number;
28
+ "duplicateDescriptionNonIndexable": boolean;
29
+ "duplicateDescriptionPrimaryUrl": string;
30
+ "duplicateDescription": boolean;
31
+ "duplicatePageCount": number;
32
+ "duplicatePageNonIndexable": boolean;
33
+ "duplicatePage": boolean;
34
+ "duplicateTitleCount": number;
35
+ "duplicateTitleNonIndexable": boolean;
36
+ "duplicateTitlePrimaryUrl": string;
37
+ "duplicateTitle": boolean;
38
+ "encodingHeader": string;
39
+ "externalLinksCount": number;
40
+ "fetchTime": string;
41
+ "folderCount": number;
42
+ "followedExternalLinksOutCount": number;
43
+ "followedLinksInCount": number;
44
+ "foundAtUrl": string;
45
+ "foundInBacklinks": boolean;
46
+ "foundInGoogleAnalytics": boolean;
47
+ "foundInGoogleSearchConsole": boolean;
48
+ "foundInList": boolean;
49
+ "foundInLogSummary": boolean;
50
+ "foundInSitemap": boolean;
51
+ "foundInWebCrawl": boolean;
52
+ "h1Count": number;
53
+ "h1Length": number;
54
+ "headerContentType": string;
55
+ "headerNoarchive": boolean;
56
+ "headerNofollow": boolean;
57
+ "headerNoindex": boolean;
58
+ "headerNoodp": boolean;
59
+ "headerNosnippet": boolean;
60
+ "headerNoydir": boolean;
61
+ "hreflangLinksInCount": number;
62
+ "hreflangLinksOutCount": number;
63
+ "hreflangOnHeader": boolean;
64
+ "hreflangOnPage": boolean;
65
+ "hreflangOnSitemap": boolean;
66
+ "hreflangUrlCount": number;
67
+ "hsts": string;
68
+ "htmlSize": number;
69
+ "httpStatusCode": number;
70
+ "https": boolean;
71
+ "indexable": boolean;
72
+ "internalLinksCount": number;
73
+ "internal": boolean;
74
+ "isImage": boolean;
75
+ "isRedirectLoop": boolean;
76
+ "isRedirect": boolean;
77
+ "isSelfCanonical": boolean;
78
+ "js": boolean;
79
+ "level": number;
80
+ "linksInCount": number;
81
+ "linksOutCount": number;
82
+ "metaDisabledSitelinks": boolean;
83
+ "metaNoarchive": boolean;
84
+ "metaNofollow": boolean;
85
+ "metaNoindex": boolean;
86
+ "metaNoodp": boolean;
87
+ "metaNosnippet": boolean;
88
+ "metaNoydir": boolean;
89
+ "metaRedirect": boolean;
90
+ "mobileDesktopContentMismatch": boolean;
91
+ "mobileRelAlternateUrlIsConsistent": boolean;
92
+ "mobileRelAlternate": boolean;
93
+ "mobileRelAmphtml": boolean;
94
+ "newsarticleAuthorSchemaValue": string;
95
+ "noarchive": boolean;
96
+ "nofollowedPage": boolean;
97
+ "noindex": boolean;
98
+ "noodp": boolean;
99
+ "nosnippet": boolean;
100
+ "noydir": boolean;
101
+ "page1": boolean;
102
+ "pageTitle": string;
103
+ "pageTitleLengthPx": number;
104
+ "pageTitleLength": number;
105
+ "paginatedPage": boolean;
106
+ "productAvailabilitySchemaValue": string;
107
+ "productBrandSchemaValue": string;
108
+ "productSkuSchemaValue": string;
109
+ "primaryPage": boolean;
110
+ "primaryUrlFrom": string;
111
+ "primaryUrlFromStatusCode": string;
112
+ "paramCount": number;
113
+ "path0": string;
114
+ "path1": string;
115
+ "path2": string;
116
+ "path3": string;
117
+ "pathCount": number;
118
+ "performanceCls"?: number;
119
+ "performanceDcl"?: number;
120
+ "performanceFcp"?: number;
121
+ "performanceLcp"?: number;
122
+ "performanceTtfb"?: number;
123
+ "performanceTti"?: number;
124
+ "previousPath": string;
125
+ "previousPathDigest": string;
126
+ "rawHeader": {
127
+ [key: string]: string;
128
+ };
129
+ "redirectChain": RedirectChain[];
130
+ "redirectCount": number;
131
+ "redirectedToStatusCode": number;
132
+ "redirectedToUrlDigest": string;
133
+ "redirectedToUrl": string;
134
+ "redirectsInCount": number;
135
+ "relLinksInCount": number;
136
+ "relNextUrlIsConsistent": boolean;
137
+ "relPrevUrlIsConsistent": boolean;
138
+ "responsive": boolean;
139
+ "robotsNoindex": boolean;
140
+ "secureFormInputField": boolean;
141
+ "separateDesktop": boolean;
142
+ "separateMobile": boolean;
143
+ "sitemapsInCount": number;
144
+ "sourceUrl": string;
145
+ "urlAliasDigest": string;
146
+ "urlAlias": string;
147
+ "urlDigest": string;
148
+ "urlLength": number;
149
+ "url": string;
150
+ "urlCount": number;
151
+ "urlTo": string;
152
+ "urlToStatusCode": number;
153
+ "validTwitterCard": boolean;
154
+ "varyUserAgent": boolean;
155
+ "wordCount": number;
156
+ };
157
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,67 @@
1
+ export declare const reportTemplates: {
2
+ "200_PAGES": string;
3
+ "301_REDIRECTS": string;
4
+ "4XX_ERRORS": string;
5
+ "5XX_ERRORS": string;
6
+ ALL_PAGES: string;
7
+ BROKEN_EXTERNAL_LINKS: string;
8
+ BROKEN_INTERNAL_LINKS: string;
9
+ BROKEN_SITEMAP_PAGES: string;
10
+ CANONICAL_CONFLICTING: string;
11
+ CANONICAL_NON_200: string;
12
+ CANONICAL_NON_INDEXABLE: string;
13
+ CANONICAL_ORPHANED: string;
14
+ CUSTOM_EXTRACTION_1: string;
15
+ CUSTOM_EXTRACTION_2: string;
16
+ DUPLICATE_CONTENT: string;
17
+ DUPLICATE_DESCRIPTIONS: string;
18
+ DUPLICATE_TITLES: string;
19
+ EMPTY_PAGES: string;
20
+ INDEXABLE_PAGES: string;
21
+ LINKED_DOMAINS: string;
22
+ MAX_DESCRIPTIONS: string;
23
+ MAX_MOBILE_DESCRIPTIONS: string;
24
+ MAX_TITLES: string;
25
+ MISSING_DESCRIPTIONS: string;
26
+ MISSING_TITLES: string;
27
+ NON_301_REDIRECTS: string;
28
+ NON_INDEXABLE_PAGES: string;
29
+ NON_INDEXABLE_SITEMAP_PAGES: string;
30
+ ORPHANED_CANONICAL: string;
31
+ ORPHANED_ANALYTICS_PAGES: string;
32
+ ORPHANED_SEARCH_CONSOLE_PAGES: string;
33
+ ORPHANED_SITEMAP_PAGES: string;
34
+ PAGES_WITH_HIGH_EXTERNAL_LINKS: string;
35
+ PERFORMANCE_MAX_FETCH_TIME: string;
36
+ PERFORMANCE_POOR_CLS: string;
37
+ PERFORMANCE_SLOW_DCL: string;
38
+ PERFORMANCE_SLOW_FCP: string;
39
+ PERFORMANCE_SLOW_LCP: string;
40
+ PERFORMANCE_SLOW_TTFB: string;
41
+ PERFORMANCE_SLOW_TTI: string;
42
+ PRIMARY_PAGES: string;
43
+ REDIRECTS_BROKEN: string;
44
+ REDIRECTS_CHAIN: string;
45
+ REDIRECTS_LOOP: string;
46
+ SCHEMA_BREADCRUMB: string;
47
+ SCHEMA_EVENT: string;
48
+ SCHEMA_FAQ: string;
49
+ SCHEMA_HOW_TO: string;
50
+ SCHEMA_NEWS_ARTICLE: string;
51
+ SCHEMA_PRODUCT: string;
52
+ SCHEMA_QA: string;
53
+ SCHEMA_RECIPE: string;
54
+ SCHEMA_REVIEW: string;
55
+ SCHEMA_VIDEO: string;
56
+ SHORT_DESCRIPTIONS: string;
57
+ SHORT_TITLES: string;
58
+ SITEMAP_PAGES: string;
59
+ SITEMAPS_NON_INDEXABLE_PAGES: string;
60
+ SITEMAPS_ORPHANED_PAGES: string;
61
+ SITEMAPS_MISSING_PAGES: string;
62
+ THIN_PAGES: string;
63
+ TRUE_UNIQUE_PAGES: string;
64
+ UNIQUE_EXTERNAL_LINKS: string;
65
+ UNIQUE_INTERNAL_LINKS: string;
66
+ XML_SITEMAPS: string;
67
+ };
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reportTemplates = void 0;
4
+ exports.reportTemplates = {
5
+ "200_PAGES": "200_pages",
6
+ "301_REDIRECTS": "301_redirects",
7
+ "4XX_ERRORS": "4xx_errors",
8
+ "5XX_ERRORS": "5xx_errors",
9
+ ALL_PAGES: 'all_pages',
10
+ BROKEN_EXTERNAL_LINKS: 'broken_links_external',
11
+ BROKEN_INTERNAL_LINKS: 'all_broken_links',
12
+ BROKEN_SITEMAP_PAGES: 'broken_sitemap_links',
13
+ CANONICAL_CONFLICTING: 'conflicting_canonical_tags',
14
+ CANONICAL_NON_200: 'canonical_to_non_200',
15
+ CANONICAL_NON_INDEXABLE: 'non_indexable_canonical_links_in',
16
+ CANONICAL_ORPHANED: 'unlinked_canonical_pages',
17
+ CUSTOM_EXTRACTION_1: 'custom_extraction_1',
18
+ CUSTOM_EXTRACTION_2: 'custom_extraction_2',
19
+ DUPLICATE_CONTENT: 'duplicate_body_content',
20
+ DUPLICATE_DESCRIPTIONS: 'pages_with_duplicate_descriptions',
21
+ DUPLICATE_TITLES: 'pages_with_duplicate_titles',
22
+ EMPTY_PAGES: 'empty_pages',
23
+ INDEXABLE_PAGES: 'indexable_pages',
24
+ LINKED_DOMAINS: 'linked_domains',
25
+ MAX_DESCRIPTIONS: 'max_description_length',
26
+ MAX_MOBILE_DESCRIPTIONS: 'max_mobile_description_length',
27
+ MAX_TITLES: 'max_title_length',
28
+ MISSING_DESCRIPTIONS: 'missing_descriptions',
29
+ MISSING_TITLES: 'missing_titles',
30
+ NON_301_REDIRECTS: 'non_301_redirects',
31
+ NON_INDEXABLE_PAGES: 'non_indexable_pages',
32
+ NON_INDEXABLE_SITEMAP_PAGES: 'sitemaps_non_indexable_links',
33
+ ORPHANED_CANONICAL: 'unlinked_canonical_pages',
34
+ ORPHANED_ANALYTICS_PAGES: 'orphaned_organic_landing_pages',
35
+ ORPHANED_SEARCH_CONSOLE_PAGES: 'orphaned_google_search_console_pages',
36
+ ORPHANED_SITEMAP_PAGES: 'orphaned_sitemaps_pages',
37
+ PAGES_WITH_HIGH_EXTERNAL_LINKS: 'max_external_links',
38
+ PERFORMANCE_MAX_FETCH_TIME: 'max_load_time',
39
+ PERFORMANCE_POOR_CLS: 'poor_cls',
40
+ PERFORMANCE_SLOW_DCL: 'slow_dcl',
41
+ PERFORMANCE_SLOW_FCP: 'slow_fcp',
42
+ PERFORMANCE_SLOW_LCP: 'slow_lcp',
43
+ PERFORMANCE_SLOW_TTFB: 'slow_server_response',
44
+ PERFORMANCE_SLOW_TTI: 'slow_tti',
45
+ PRIMARY_PAGES: 'unique_pages',
46
+ REDIRECTS_BROKEN: 'all_broken_redirects',
47
+ REDIRECTS_CHAIN: 'redirect_chains',
48
+ REDIRECTS_LOOP: 'redirection_loop',
49
+ SCHEMA_BREADCRUMB: 'pages_with_breadcrumb_schema',
50
+ SCHEMA_EVENT: 'pages_with_event_schema',
51
+ SCHEMA_FAQ: 'pages_with_faqpage_schema',
52
+ SCHEMA_HOW_TO: 'pages_with_howto_schema',
53
+ SCHEMA_NEWS_ARTICLE: 'pages_with_news_article_schema',
54
+ SCHEMA_PRODUCT: 'pages_with_product_schema',
55
+ SCHEMA_QA: 'pages_with_qapage_schema',
56
+ SCHEMA_RECIPE: 'pages_with_recipe_schema',
57
+ SCHEMA_REVIEW: 'pages_with_review_schema',
58
+ SCHEMA_VIDEO: 'pages_with_videoobject_schema',
59
+ SHORT_DESCRIPTIONS: 'short_descriptions',
60
+ SHORT_TITLES: 'short_titles',
61
+ SITEMAP_PAGES: 'all_sitemaps_links',
62
+ SITEMAPS_NON_INDEXABLE_PAGES: 'sitemaps_non_indexable_links',
63
+ SITEMAPS_ORPHANED_PAGES: 'orphaned_sitemaps_pages',
64
+ SITEMAPS_MISSING_PAGES: 'not_in_sitemaps_primary_indexable',
65
+ THIN_PAGES: 'thin_pages',
66
+ TRUE_UNIQUE_PAGES: 'true_uniques',
67
+ UNIQUE_EXTERNAL_LINKS: 'unique_external_links',
68
+ UNIQUE_INTERNAL_LINKS: 'unique_internal_links',
69
+ XML_SITEMAPS: 'xml_sitemaps',
70
+ };
@@ -0,0 +1,5 @@
1
+ import { ApiResponse } from "../api";
2
+ /**
3
+ * Make the request to MyTarget API using the access token.
4
+ */
5
+ export declare const request: (data: object, url: string) => Promise<ApiResponse>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.request = void 0;
4
+ const axios_1 = require("../axios");
5
+ /**
6
+ * Make the request to MyTarget API using the access token.
7
+ */
8
+ const request = async (data, url) => {
9
+ const response = await (0, axios_1.post)(url, data, {
10
+ headers: {
11
+ Authorization: `Bearer ${global.myTargetAccessToken}`,
12
+ "Content-Type": "application/json",
13
+ },
14
+ });
15
+ return response;
16
+ };
17
+ exports.request = request;
@@ -0,0 +1,6 @@
1
+ export { isSessionReady } from "./isSessionReady";
2
+ export declare enum NextAuthState {
3
+ AUTHENTICATED = "authenticated",
4
+ PENDING = "loading",// Defined by NextAuth
5
+ UNAUTHENTICATED = "unauthenticated"
6
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NextAuthState = exports.isSessionReady = void 0;
4
+ var isSessionReady_1 = require("./isSessionReady");
5
+ Object.defineProperty(exports, "isSessionReady", { enumerable: true, get: function () { return isSessionReady_1.isSessionReady; } });
6
+ var NextAuthState;
7
+ (function (NextAuthState) {
8
+ NextAuthState["AUTHENTICATED"] = "authenticated";
9
+ NextAuthState["PENDING"] = "loading";
10
+ NextAuthState["UNAUTHENTICATED"] = "unauthenticated";
11
+ })(NextAuthState || (exports.NextAuthState = NextAuthState = {}));
@@ -0,0 +1 @@
1
+ export declare const isSessionReady: (session: any) => boolean;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isSessionReady = void 0;
4
+ const isSessionReady = (session) => {
5
+ let response = false;
6
+ if (undefined !== session && null !== session) {
7
+ if (undefined !== session.user && null !== session.user) {
8
+ response = true;
9
+ }
10
+ }
11
+ return response;
12
+ };
13
+ exports.isSessionReady = isSessionReady;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get the user's remote IP Address
3
+ */
4
+ export declare const getIp: ({ req }: {
5
+ req: any;
6
+ }) => string;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getIp = void 0;
4
+ /**
5
+ * Get the user's remote IP Address
6
+ */
7
+ const getIp = ({ req }) => {
8
+ let response = 'unset';
9
+ if (undefined !== req.headers['x-real-ip']) {
10
+ response = String(req.headers['x-real-ip']);
11
+ }
12
+ return response;
13
+ };
14
+ exports.getIp = getIp;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get the user's User Agent
3
+ */
4
+ export declare const getUserAgent: ({ req }: {
5
+ req: any;
6
+ }) => string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUserAgent = void 0;
4
+ /**
5
+ * Get the user's User Agent
6
+ */
7
+ const getUserAgent = ({ req }) => req.headers['user-agent'] || 'unset';
8
+ exports.getUserAgent = getUserAgent;
@@ -0,0 +1,2 @@
1
+ export { getIp } from "./getIp";
2
+ export { getUserAgent } from "./getUserAgent";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUserAgent = exports.getIp = void 0;
4
+ var getIp_1 = require("./getIp");
5
+ Object.defineProperty(exports, "getIp", { enumerable: true, get: function () { return getIp_1.getIp; } });
6
+ var getUserAgent_1 = require("./getUserAgent");
7
+ Object.defineProperty(exports, "getUserAgent", { enumerable: true, get: function () { return getUserAgent_1.getUserAgent; } });
@@ -0,0 +1,12 @@
1
+ type FormatProps = {
2
+ compact?: boolean;
3
+ input: any;
4
+ locale?: string;
5
+ minDp?: number;
6
+ maxDp?: number;
7
+ };
8
+ /**
9
+ * Take a given number and format it.
10
+ */
11
+ export declare const format: (props: FormatProps) => string;
12
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.format = void 0;
4
+ const getNumber_1 = require("./getNumber");
5
+ /**
6
+ * Take a given number and format it.
7
+ */
8
+ const format = (props) => {
9
+ const minDp = props?.minDp ?? 0;
10
+ const maxDp = props?.maxDp ?? 2;
11
+ const compact = props?.compact || false;
12
+ const inputValue = (0, getNumber_1.getNumber)(props.input);
13
+ return Intl.NumberFormat(props?.locale || "en-GB", {
14
+ minimumFractionDigits: minDp,
15
+ maximumFractionDigits: maxDp,
16
+ notation: compact ? "compact" : "standard",
17
+ })
18
+ .format(inputValue);
19
+ };
20
+ exports.format = format;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Use the International number formatting to return the currency value.
3
+ * https://www.freecodecamp.org/news/how-to-format-number-as-currency-in-javascript-one-line-of-code/
4
+ */
5
+ export declare const formatCurrency: (input: any, locale?: string, currency?: string) => string;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatCurrency = void 0;
4
+ /**
5
+ * Use the International number formatting to return the currency value.
6
+ * https://www.freecodecamp.org/news/how-to-format-number-as-currency-in-javascript-one-line-of-code/
7
+ */
8
+ const formatCurrency = (input, locale = "en-GB", currency = "GBP") => {
9
+ const value = Number(input);
10
+ const currencyClean = currency.toUpperCase()
11
+ .trim();
12
+ let formatted = new Intl.NumberFormat(locale, {
13
+ style: "currency",
14
+ currency: currencyClean,
15
+ }).format(value);
16
+ if ("USD" === currencyClean) {
17
+ formatted = formatted.replace("US$", "$");
18
+ }
19
+ return formatted;
20
+ };
21
+ exports.formatCurrency = formatCurrency;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Return a decimal number after rounding.
3
+ */
4
+ export declare const getDecimal: (input: any, dp?: number) => number;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDecimal = void 0;
4
+ const getNumber_1 = require("./getNumber");
5
+ /**
6
+ * Return a decimal number after rounding.
7
+ */
8
+ const getDecimal = (input, dp = 2) => {
9
+ const number = (0, getNumber_1.getNumber)(input);
10
+ return Number(number.toFixed(dp));
11
+ };
12
+ exports.getDecimal = getDecimal;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Take an input and return a number.
3
+ */
4
+ export declare const getNumber: (input: any, defaultValue?: number) => number;