@8ms/helpers 2.2.26 → 2.3.3

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 (242) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/_class/index.d.ts +2 -2
  3. package/_class/index.js +2 -2
  4. package/adverity/adverity.d.ts +112 -0
  5. package/adverity/adverity.js +58 -0
  6. package/adverity/index.d.ts +1 -112
  7. package/adverity/index.js +1 -58
  8. package/adverity/server/index.d.ts +1 -1
  9. package/adverity/server/index.js +1 -1
  10. package/api/ApiResponseClass.d.ts +1 -1
  11. package/api/ApiResponseClass.js +12 -12
  12. package/api/{types.d.ts → api.d.ts} +2 -2
  13. package/api/{types.js → api.js} +2 -2
  14. package/api/functions.d.ts +1 -1
  15. package/api/functions.js +7 -7
  16. package/api/index.d.ts +1 -1
  17. package/api/index.js +1 -1
  18. package/array/array.d.ts +8 -0
  19. package/array/array.js +9 -0
  20. package/array/index.d.ts +1 -8
  21. package/array/index.js +1 -9
  22. package/atInternet/atInternet.d.ts +16 -0
  23. package/atInternet/atInternet.js +15 -0
  24. package/atInternet/index.d.ts +1 -16
  25. package/atInternet/index.js +1 -15
  26. package/aws/ec2/server/awsEc2.d.ts +3 -0
  27. package/aws/ec2/server/awsEc2.js +12 -0
  28. package/aws/ec2/server/index.d.ts +2 -3
  29. package/aws/ec2/server/index.js +2 -12
  30. package/aws/ecs/server/awsEcs.d.ts +3 -0
  31. package/aws/ecs/server/awsEcs.js +12 -0
  32. package/aws/ecs/server/index.d.ts +2 -3
  33. package/aws/ecs/server/index.js +2 -12
  34. package/aws/glue/server/awsGlue.d.ts +3 -0
  35. package/aws/glue/server/awsGlue.js +12 -0
  36. package/aws/glue/server/index.d.ts +2 -3
  37. package/aws/glue/server/index.js +2 -12
  38. package/aws/lambda/server/awsLambda.d.ts +4 -0
  39. package/aws/lambda/server/awsLambda.js +16 -0
  40. package/aws/lambda/server/index.d.ts +2 -4
  41. package/aws/lambda/server/index.js +2 -16
  42. package/aws/s3/server/awsS3.d.ts +13 -0
  43. package/aws/s3/server/awsS3.js +20 -0
  44. package/aws/s3/server/index.d.ts +3 -13
  45. package/aws/s3/server/index.js +3 -20
  46. package/aws/server/aws.d.ts +9 -0
  47. package/aws/server/aws.js +29 -0
  48. package/aws/server/index.d.ts +2 -9
  49. package/aws/server/index.js +2 -29
  50. package/aws/ses/server/awsSes.d.ts +4 -0
  51. package/aws/ses/server/awsSes.js +13 -0
  52. package/aws/ses/server/index.d.ts +3 -4
  53. package/aws/ses/server/index.js +3 -13
  54. package/aws/sqs/server/awsSqs.d.ts +3 -0
  55. package/aws/sqs/server/awsSqs.js +12 -0
  56. package/aws/sqs/server/index.d.ts +2 -3
  57. package/aws/sqs/server/index.js +2 -12
  58. package/aws/ssm/server/awsSsm.d.ts +3 -0
  59. package/aws/ssm/server/awsSsm.js +12 -0
  60. package/aws/ssm/server/index.d.ts +2 -3
  61. package/aws/ssm/server/index.js +2 -12
  62. package/axios/index.d.ts +3 -3
  63. package/axios/index.js +3 -3
  64. package/boolean/boolean.d.ts +4 -0
  65. package/boolean/boolean.js +16 -0
  66. package/boolean/index.d.ts +1 -4
  67. package/boolean/index.js +1 -16
  68. package/brightData/serpApi/server/brightDataSerpApi.d.ts +10 -0
  69. package/brightData/serpApi/server/brightDataSerpApi.js +9 -0
  70. package/brightData/serpApi/server/getAsyncRequestId.js +2 -2
  71. package/brightData/serpApi/server/index.d.ts +6 -15
  72. package/brightData/serpApi/server/index.js +6 -14
  73. package/brightData/server/brightData.d.ts +15 -0
  74. package/brightData/server/brightData.js +15 -0
  75. package/brightData/server/index.d.ts +1 -15
  76. package/brightData/server/index.js +1 -15
  77. package/brightData/webScraperIde/server/getRealtime.js +5 -5
  78. package/brightData/webScraperIde/server/index.d.ts +2 -2
  79. package/brightData/webScraperIde/server/index.js +2 -2
  80. package/cache/server/cache.d.ts +7 -0
  81. package/cache/server/cache.js +43 -0
  82. package/cache/server/index.d.ts +1 -7
  83. package/cache/server/index.js +1 -43
  84. package/crud/crud.d.ts +7 -0
  85. package/crud/crud.js +6 -0
  86. package/crud/index.d.ts +1 -7
  87. package/crud/index.js +1 -6
  88. package/crypto/index.d.ts +4 -4
  89. package/crypto/index.js +4 -4
  90. package/date/calculation.d.ts +4 -1
  91. package/date/calculation.js +3 -0
  92. package/date/{type.d.ts → date.d.ts} +2 -2
  93. package/date/{type.js → date.js} +1 -1
  94. package/date/financialYear.d.ts +2 -2
  95. package/date/financialYear.js +1 -1
  96. package/date/format.d.ts +1 -1
  97. package/date/index.d.ts +1 -1
  98. package/date/index.js +1 -1
  99. package/environment/environment.d.ts +34 -0
  100. package/environment/environment.js +79 -0
  101. package/environment/index.d.ts +1 -34
  102. package/environment/index.js +1 -79
  103. package/eskimi/eskimi.d.ts +49 -0
  104. package/eskimi/eskimi.js +93 -0
  105. package/eskimi/index.d.ts +1 -49
  106. package/eskimi/index.js +1 -93
  107. package/file/getFileKey.js +2 -2
  108. package/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.d.ts +41 -0
  109. package/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.js +55 -0
  110. package/googleAds/keywordPlanner/server/index.d.ts +1 -41
  111. package/googleAds/keywordPlanner/server/index.js +1 -55
  112. package/googleAds/server/GoogleAdsNamespace.js +1 -2
  113. package/googleAds/server/googleAds.d.ts +11 -0
  114. package/googleAds/server/googleAds.js +26 -0
  115. package/googleAds/server/index.d.ts +2 -11
  116. package/googleAds/server/index.js +2 -26
  117. package/{google/bigquery/server/GoogleBigqueryNamespace.d.ts → googleCloud/bigquery/server/GoogleCloudBigqueryNamespace.d.ts} +1 -1
  118. package/{google/bigquery/server/GoogleBigqueryNamespace.js → googleCloud/bigquery/server/GoogleCloudBigqueryNamespace.js} +1 -1
  119. package/googleCloud/bigquery/server/googleCloudBigquery.d.ts +5 -0
  120. package/{google/bigquery/server/index.js → googleCloud/bigquery/server/googleCloudBigquery.js} +7 -8
  121. package/googleCloud/bigquery/server/index.d.ts +3 -0
  122. package/googleCloud/bigquery/server/index.js +3 -0
  123. package/{google → googleCloud}/bigquery/server/loadData.d.ts +3 -3
  124. package/{google → googleCloud}/bigquery/server/loadData.js +3 -3
  125. package/googleCloud/server/index.d.ts +1 -0
  126. package/googleCloud/server/index.js +1 -0
  127. package/{google/sheets/server/GoogleSheetsNamespace.d.ts → googleCloud/sheets/server/GoogleCloudSheetsNamespace.d.ts} +1 -1
  128. package/{google/sheets/server/GoogleSheetsNamespace.js → googleCloud/sheets/server/GoogleCloudSheetsNamespace.js} +1 -1
  129. package/googleCloud/sheets/server/index.d.ts +1 -0
  130. package/googleCloud/sheets/server/index.js +1 -0
  131. package/googleCloud/storage/server/index.d.ts +2 -0
  132. package/googleCloud/storage/server/index.js +2 -0
  133. package/googlePageSpeed/server/GooglePageSpeedNamespace.d.ts +1 -1
  134. package/googlePageSpeed/server/GooglePageSpeedNamespace.js +3 -3
  135. package/googlePageSpeed/server/googlePageSpeed.d.ts +19 -0
  136. package/googlePageSpeed/server/googlePageSpeed.js +38 -0
  137. package/googlePageSpeed/server/index.d.ts +2 -19
  138. package/googlePageSpeed/server/index.js +2 -38
  139. package/googleSearchIncidents/server/googleSearchIncidents.d.ts +69 -0
  140. package/googleSearchIncidents/server/googleSearchIncidents.js +42 -0
  141. package/googleSearchIncidents/server/index.d.ts +1 -69
  142. package/googleSearchIncidents/server/index.js +1 -42
  143. package/greenDomain/server/greenDomain.d.ts +21 -0
  144. package/greenDomain/server/greenDomain.js +37 -0
  145. package/greenDomain/server/index.d.ts +1 -21
  146. package/greenDomain/server/index.js +1 -37
  147. package/inngest/index.d.ts +1 -7
  148. package/inngest/index.js +1 -6
  149. package/inngest/inngest.d.ts +7 -0
  150. package/inngest/inngest.js +6 -0
  151. package/littleWarden/server/index.d.ts +2 -30
  152. package/littleWarden/server/index.js +2 -65
  153. package/littleWarden/server/littleWarden.d.ts +30 -0
  154. package/littleWarden/server/littleWarden.js +65 -0
  155. package/lumar/api/server/buildRequest.d.ts +3 -3
  156. package/lumar/api/server/buildRequest.js +15 -15
  157. package/lumar/api/server/index.d.ts +1 -33
  158. package/lumar/api/server/index.js +1 -24
  159. package/lumar/api/server/lumarApi.d.ts +36 -0
  160. package/lumar/api/server/lumarApi.js +24 -0
  161. package/lumar/graphql/server/columns.d.ts +28 -27
  162. package/lumar/graphql/server/columns.js +1 -1
  163. package/lumar/graphql/server/getData.js +1 -2
  164. package/lumar/graphql/server/index.d.ts +11 -29
  165. package/lumar/graphql/server/index.js +11 -31
  166. package/lumar/graphql/server/lumarGraphql.d.ts +27 -0
  167. package/lumar/graphql/server/lumarGraphql.js +27 -0
  168. package/lumar/graphql/server/queries/getReportDifferences.d.ts +1 -1
  169. package/lumar/graphql/server/queries/getReportDifferences.js +2 -2
  170. package/lumar/graphql/server/reportTemplates.d.ts +67 -66
  171. package/lumar/graphql/server/reportTemplates.js +1 -1
  172. package/myTarget/server/index.d.ts +1 -5
  173. package/myTarget/server/index.js +1 -13
  174. package/myTarget/server/myTarget.d.ts +5 -0
  175. package/myTarget/server/myTarget.js +13 -0
  176. package/nextAuth/index.d.ts +2 -7
  177. package/nextAuth/index.js +2 -6
  178. package/nextAuth/nextAuth.d.ts +7 -0
  179. package/nextAuth/nextAuth.js +6 -0
  180. package/nextJs/index.d.ts +1 -12
  181. package/nextJs/index.js +1 -14
  182. package/nextJs/nextJs.d.ts +12 -0
  183. package/nextJs/nextJs.js +8 -0
  184. package/onePassword/server/index.d.ts +2 -7
  185. package/onePassword/server/index.js +2 -21
  186. package/onePassword/server/onePassword.d.ts +8 -0
  187. package/onePassword/server/onePassword.js +21 -0
  188. package/openAi/server/index.d.ts +2 -5
  189. package/openAi/server/index.js +2 -26
  190. package/openAi/server/openAi.d.ts +6 -0
  191. package/openAi/server/openAi.js +26 -0
  192. package/package.json +65 -65
  193. package/prisma/server/index.d.ts +2 -20
  194. package/prisma/server/index.js +2 -26
  195. package/prisma/server/prisma.d.ts +20 -0
  196. package/prisma/server/prisma.js +26 -0
  197. package/snapchat/server/index.d.ts +2 -7
  198. package/snapchat/server/index.js +2 -26
  199. package/snapchat/server/snapchat.d.ts +7 -0
  200. package/snapchat/server/snapchat.js +26 -0
  201. package/sorting/index.d.ts +1 -4
  202. package/sorting/index.js +1 -4
  203. package/sorting/sorting.d.ts +4 -0
  204. package/sorting/sorting.js +4 -0
  205. package/stream/server/index.d.ts +1 -1
  206. package/stream/server/index.js +1 -1
  207. package/string/index.d.ts +13 -12
  208. package/string/index.js +13 -12
  209. package/swr/client/index.d.ts +1 -42
  210. package/swr/client/index.js +1 -50
  211. package/swr/client/swr.d.ts +42 -0
  212. package/swr/client/swr.js +50 -0
  213. package/upTimeRobot/server/index.d.ts +2 -38
  214. package/upTimeRobot/server/index.js +2 -59
  215. package/upTimeRobot/server/upTimeRobot.d.ts +38 -0
  216. package/upTimeRobot/server/upTimeRobot.js +59 -0
  217. package/url/index.d.ts +1 -26
  218. package/url/index.js +1 -59
  219. package/url/server/index.d.ts +1 -1
  220. package/url/server/index.js +1 -1
  221. package/url/url.d.ts +26 -0
  222. package/url/url.js +59 -0
  223. package/util/index.d.ts +7 -7
  224. package/util/index.js +7 -7
  225. package/util/isUndefined.js +2 -2
  226. package/util/server/index.d.ts +4 -4
  227. package/util/server/index.js +4 -4
  228. package/webWorker/index.d.ts +1 -8
  229. package/webWorker/index.js +1 -7
  230. package/webWorker/webWorker.d.ts +8 -0
  231. package/webWorker/webWorker.js +7 -0
  232. package/google/bigquery/server/index.d.ts +0 -6
  233. package/google/sheets/server/index.d.ts +0 -8
  234. package/google/sheets/server/index.js +0 -42
  235. /package/{google/server/index.d.ts → googleCloud/server/googleCloud.d.ts} +0 -0
  236. /package/{google/server/index.js → googleCloud/server/googleCloud.js} +0 -0
  237. /package/{google → googleCloud}/sheets/server/getAssociatedData.d.ts +0 -0
  238. /package/{google → googleCloud}/sheets/server/getAssociatedData.js +0 -0
  239. /package/{google → googleCloud}/storage/server/GoogleCloudStorageNamespace.d.ts +0 -0
  240. /package/{google → googleCloud}/storage/server/GoogleCloudStorageNamespace.js +0 -0
  241. /package/{google/storage/server/index.d.ts → googleCloud/storage/server/googleCloudStorage.d.ts} +0 -0
  242. /package/{google/storage/server/index.js → googleCloud/storage/server/googleCloudStorage.js} +0 -0
@@ -0,0 +1,30 @@
1
+ import { LittleWardenNamespace } from "./LittleWardenNamespace";
2
+ export type LittleWardenConfig = {
3
+ apiKey: string;
4
+ };
5
+ export declare const littleWardenClient: (key?: string, config?: LittleWardenConfig, vaultId?: string, itemId?: string) => Promise<LittleWardenNamespace>;
6
+ export declare const littleWardenState: {
7
+ readonly ALL_GOOD: "all_good";
8
+ readonly DANGER: "danger";
9
+ readonly WARNING: "warning";
10
+ };
11
+ export type LittleWardenState = typeof littleWardenState[keyof typeof littleWardenState];
12
+ /**
13
+ * Check if the field is All Good.
14
+ */
15
+ export declare const isAllGood: ({ field }: {
16
+ field: any;
17
+ }) => boolean;
18
+ /**
19
+ * Check if the field is Warning.
20
+ */
21
+ export declare const isWarning: ({ field }: {
22
+ field: any;
23
+ }) => boolean;
24
+ /**
25
+ * Check if the field is Danger.
26
+ */
27
+ export declare const isDanger: ({ field }: {
28
+ field: any;
29
+ }) => boolean;
30
+ export * from "./getUrlStatus";
@@ -0,0 +1,65 @@
1
+ import { LittleWardenNamespace } from "./LittleWardenNamespace";
2
+ import { onePasswordClient } from "../../onePassword/server";
3
+ const littleWardenNamespaces = new Map();
4
+ export const littleWardenClient = async (key = "default", config, vaultId, itemId) => {
5
+ if (littleWardenNamespaces.has(key)) {
6
+ return littleWardenNamespaces.get(key);
7
+ }
8
+ let instanceConfig;
9
+ if (config) {
10
+ instanceConfig = config;
11
+ }
12
+ else if (vaultId && itemId) {
13
+ instanceConfig = await (await onePasswordClient())
14
+ .getJsonNote(vaultId, itemId);
15
+ }
16
+ else if (process.env.LITTLE_WARDEN_VAULT_ID && process.env.LITTLE_WARDEN_ITEM_ID) {
17
+ instanceConfig = await (await onePasswordClient())
18
+ .getJsonNote(process.env.LITTLE_WARDEN_VAULT_ID, process.env.LITTLE_WARDEN_ITEM_ID);
19
+ }
20
+ else {
21
+ throw new Error(`Config required for namespace '${key}'`);
22
+ }
23
+ const namespace = new LittleWardenNamespace(key, instanceConfig);
24
+ littleWardenNamespaces.set(key, namespace);
25
+ return namespace;
26
+ };
27
+ export const littleWardenState = {
28
+ ALL_GOOD: "all_good",
29
+ DANGER: "danger",
30
+ WARNING: "warning",
31
+ };
32
+ /**
33
+ * Check if the field is All Good.
34
+ */
35
+ export const isAllGood = ({ field }) => {
36
+ let response = false;
37
+ // Check that the status field exists
38
+ if (undefined !== field && undefined !== field["status"]) {
39
+ response = littleWardenState.ALL_GOOD === field["status"];
40
+ }
41
+ return response;
42
+ };
43
+ /**
44
+ * Check if the field is Warning.
45
+ */
46
+ export const isWarning = ({ field }) => {
47
+ let response = false;
48
+ // Check that the status field exists
49
+ if (undefined !== field && undefined !== field["status"]) {
50
+ response = littleWardenState.WARNING === field["status"];
51
+ }
52
+ return response;
53
+ };
54
+ /**
55
+ * Check if the field is Danger.
56
+ */
57
+ export const isDanger = ({ field }) => {
58
+ let response = false;
59
+ // Check that the status field exists
60
+ if (undefined !== field && undefined !== field["status"]) {
61
+ response = littleWardenState.DANGER === field["status"];
62
+ }
63
+ return response;
64
+ };
65
+ export * from "./getUrlStatus";
@@ -1,13 +1,13 @@
1
- import { Filter, Order } from "./";
1
+ import { Filter, OrderRow, Report } from "./";
2
2
  export type BuildRequestProps = {
3
3
  crawlId?: number;
4
4
  customPath?: string;
5
5
  filters?: Filter[];
6
6
  limit?: number;
7
- orders?: Order[];
7
+ orders?: OrderRow[];
8
8
  page?: number;
9
9
  projectId?: number;
10
- report?: string;
10
+ report?: Report;
11
11
  subReport?: string;
12
12
  };
13
13
  export declare const buildRequest: (props: BuildRequestProps) => string;
@@ -1,4 +1,4 @@
1
- import { orders, reports } from "./";
1
+ import { order, report } from "./";
2
2
  export const buildRequest = (props) => {
3
3
  let url = `https://api.deepcrawl.com/accounts/37204`;
4
4
  // Limit must be greater than 0 but also less than 200
@@ -15,35 +15,35 @@ export const buildRequest = (props) => {
15
15
  props.limit = 200;
16
16
  }
17
17
  // If a report other than List Crawls is selected, Crawl ID must be defined
18
- if (undefined !== props.report && reports.LIST_CRAWLS !== props.report && undefined == props.crawlId) {
18
+ if (undefined !== props.report && report.LIST_CRAWLS !== props.report && undefined == props.crawlId) {
19
19
  throw `Crawl ID must be defined.`;
20
20
  }
21
21
  switch (props.report) {
22
- case reports.LIST_CRAWLS:
22
+ case report.LIST_CRAWLS:
23
23
  url += `/projects/${props.projectId}/crawls`;
24
24
  break;
25
- case reports.LIST_PROJECTS:
25
+ case report.LIST_PROJECTS:
26
26
  url += `/projects`;
27
27
  break;
28
- case reports.CUSTOM:
28
+ case report.CUSTOM:
29
29
  url += props.customPath;
30
30
  url = url.replace("[PROJECT]", props.projectId.toString());
31
31
  url = url.replace("[CRAWL]", props.crawlId.toString());
32
32
  break;
33
- case reports.CRAWL_STATISTICS:
33
+ case report.CRAWL_STATISTICS:
34
34
  url += `/projects/${props.projectId}/crawls/${props.crawlId}/statistics`;
35
35
  break;
36
- case reports.LIST_REPORTS:
36
+ case report.LIST_REPORTS:
37
37
  url += `/projects/${props.projectId}/crawls/${props.crawlId}/reports`;
38
38
  break;
39
- case reports.REPORT_ROWS:
40
- case reports.REPORT_STATISTICS:
41
- case reports.REPORT_SUMMARY:
39
+ case report.REPORT_ROWS:
40
+ case report.REPORT_STATISTICS:
41
+ case report.REPORT_SUMMARY:
42
42
  url += `/projects/${props.projectId}/crawls/${props.crawlId}/reports/${props.subReport}`;
43
- if (reports.REPORT_ROWS === props.report) {
43
+ if (report.REPORT_ROWS === props.report) {
44
44
  url += `/report_rows`;
45
45
  }
46
- else if (reports.REPORT_STATISTICS === props.report) {
46
+ else if (report.REPORT_STATISTICS === props.report) {
47
47
  url += `/statistics`;
48
48
  }
49
49
  break;
@@ -66,10 +66,10 @@ export const buildRequest = (props) => {
66
66
  // Order the data
67
67
  if (undefined !== props.orders) {
68
68
  url += -1 === url.indexOf("?") ? "?" : "&";
69
- props.orders.map((order, index) => {
69
+ props.orders.map((orderRow, index) => {
70
70
  url += 0 === index ? "sort=" : ",";
71
- url += orders.DESCENDING === order.direction ? "-" : "";
72
- url += order.field;
71
+ url += order.DESCENDING === orderRow.direction ? "-" : "";
72
+ url += orderRow.field;
73
73
  });
74
74
  }
75
75
  return url;
@@ -1,36 +1,4 @@
1
- export type Filter = {
2
- field: string;
3
- operand: string;
4
- value: string;
5
- };
6
- export declare const operands: {
7
- EQUALS: string;
8
- CONTAINS: string;
9
- LESS_THAN: string;
10
- LESS_THAN_OR_EQUAL: string;
11
- GREATER_THAN: string;
12
- GREATER_THAN_OR_EQUAL: string;
13
- REGEX: string;
14
- NOT_REGEX: string;
15
- };
16
- export type Order = {
17
- direction: string;
18
- field: string;
19
- };
20
- export declare const orders: {
21
- ASCENDING: string;
22
- DESCENDING: string;
23
- };
24
- export declare const reports: {
25
- CRAWL_STATISTICS: string;
26
- CUSTOM: string;
27
- LIST_PROJECTS: string;
28
- LIST_CRAWLS: string;
29
- LIST_REPORTS: string;
30
- REPORT_ROWS: string;
31
- REPORT_STATISTICS: string;
32
- REPORT_SUMMARY: string;
33
- };
1
+ export * from "./lumarApi";
34
2
  export * from "./buildRequest";
35
3
  export * from "./getData";
36
4
  export * from "./initClient";
@@ -1,27 +1,4 @@
1
- export const operands = {
2
- EQUALS: 'eql',
3
- CONTAINS: 'cont',
4
- LESS_THAN: 'lt',
5
- LESS_THAN_OR_EQUAL: 'lte',
6
- GREATER_THAN: 'gt',
7
- GREATER_THAN_OR_EQUAL: 'gte',
8
- REGEX: 'rgx',
9
- NOT_REGEX: 'nrgx',
10
- };
11
- export const orders = {
12
- ASCENDING: 'asc',
13
- DESCENDING: 'desc',
14
- };
15
- export const reports = {
16
- CRAWL_STATISTICS: 'crawl_statistics',
17
- CUSTOM: 'custom',
18
- LIST_PROJECTS: 'list_projects',
19
- LIST_CRAWLS: 'list_crawls',
20
- LIST_REPORTS: 'list_reports',
21
- REPORT_ROWS: 'report_rows',
22
- REPORT_STATISTICS: 'report_statistics',
23
- REPORT_SUMMARY: 'report_summary',
24
- };
1
+ export * from "./lumarApi";
25
2
  export * from "./buildRequest";
26
3
  export * from "./getData";
27
4
  export * from "./initClient";
@@ -0,0 +1,36 @@
1
+ export type Filter = {
2
+ field: string;
3
+ operand: string;
4
+ value: string;
5
+ };
6
+ export declare const operand: {
7
+ readonly EQUALS: "eql";
8
+ readonly CONTAINS: "cont";
9
+ readonly LESS_THAN: "lt";
10
+ readonly LESS_THAN_OR_EQUAL: "lte";
11
+ readonly GREATER_THAN: "gt";
12
+ readonly GREATER_THAN_OR_EQUAL: "gte";
13
+ readonly REGEX: "rgx";
14
+ readonly NOT_REGEX: "nrgx";
15
+ };
16
+ export type Operand = typeof operand[keyof typeof operand];
17
+ export declare const order: {
18
+ readonly ASCENDING: "asc";
19
+ readonly DESCENDING: "desc";
20
+ };
21
+ export type Order = typeof order[keyof typeof order];
22
+ export type OrderRow = {
23
+ direction: Order;
24
+ field: string;
25
+ };
26
+ export declare const report: {
27
+ readonly CRAWL_STATISTICS: "crawl_statistics";
28
+ readonly CUSTOM: "custom";
29
+ readonly LIST_PROJECTS: "list_projects";
30
+ readonly LIST_CRAWLS: "list_crawls";
31
+ readonly LIST_REPORTS: "list_reports";
32
+ readonly REPORT_ROWS: "report_rows";
33
+ readonly REPORT_STATISTICS: "report_statistics";
34
+ readonly REPORT_SUMMARY: "report_summary";
35
+ };
36
+ export type Report = typeof report[keyof typeof report];
@@ -0,0 +1,24 @@
1
+ export const operand = {
2
+ EQUALS: 'eql',
3
+ CONTAINS: 'cont',
4
+ LESS_THAN: 'lt',
5
+ LESS_THAN_OR_EQUAL: 'lte',
6
+ GREATER_THAN: 'gt',
7
+ GREATER_THAN_OR_EQUAL: 'gte',
8
+ REGEX: 'rgx',
9
+ NOT_REGEX: 'nrgx',
10
+ };
11
+ export const order = {
12
+ ASCENDING: 'asc',
13
+ DESCENDING: 'desc',
14
+ };
15
+ export const report = {
16
+ CRAWL_STATISTICS: 'crawl_statistics',
17
+ CUSTOM: 'custom',
18
+ LIST_PROJECTS: 'list_projects',
19
+ LIST_CRAWLS: 'list_crawls',
20
+ LIST_REPORTS: 'list_reports',
21
+ REPORT_ROWS: 'report_rows',
22
+ REPORT_STATISTICS: 'report_statistics',
23
+ REPORT_SUMMARY: 'report_summary',
24
+ };
@@ -1,28 +1,29 @@
1
- export declare const columns: {
2
- CUSTOM_EXTRACTION_1: string;
3
- CUSTOM_EXTRACTION_2: string;
4
- DEEP_RANK: string;
5
- DESCRIPTION: string;
6
- DUPLICATE_PAGE: string;
7
- DUPLICATE_DESCRIPTION_FROM: string;
8
- DUPLICATE_TITLE_FROM: string;
9
- FOUND_AT_URL: string;
10
- FOUND_IN_CRAWL: string;
11
- FOUND_IN_SEARCH_CONSOLE: string;
12
- FOUND_IN_SITEMAP: string;
13
- LEVEL: string;
14
- PAGE_TITLE: string;
15
- PRIMARY_PAGE: string;
16
- PRIMARY_URL_FROM: string;
17
- PRIMARY_URL_FROM_STATUS_CODE: string;
18
- REDIRECTED_TO_URL: string;
19
- REDIRECTED_TO_STATUS_CODE: string;
20
- REDIRECTION_CHAIN: string;
21
- SOURCE_URL: string;
22
- STATUS_CODE: string;
23
- TARGET_STATUS_CODE: string;
24
- URL: string;
25
- URL_COUNT: string;
26
- URL_TO: string;
27
- URL_TO_STATUS_CODE: string;
1
+ export declare const column: {
2
+ readonly CUSTOM_EXTRACTION_1: "customExtraction1";
3
+ readonly CUSTOM_EXTRACTION_2: "customExtraction2";
4
+ readonly DEEP_RANK: "deepRank";
5
+ readonly DESCRIPTION: "description";
6
+ readonly DUPLICATE_PAGE: "duplicatePage";
7
+ readonly DUPLICATE_DESCRIPTION_FROM: "duplicateDescriptionPrimaryUrl";
8
+ readonly DUPLICATE_TITLE_FROM: "duplicateTitlePrimaryUrl";
9
+ readonly FOUND_AT_URL: "foundAtUrl";
10
+ readonly FOUND_IN_CRAWL: "foundInWebCrawl";
11
+ readonly FOUND_IN_SEARCH_CONSOLE: "foundInGoogleSearchConsole";
12
+ readonly FOUND_IN_SITEMAP: "foundInSitemap";
13
+ readonly LEVEL: "level";
14
+ readonly PAGE_TITLE: "pageTitle";
15
+ readonly PRIMARY_PAGE: "primaryPage";
16
+ readonly PRIMARY_URL_FROM: "primaryUrlFrom";
17
+ readonly PRIMARY_URL_FROM_STATUS_CODE: "primaryUrlFromStatusCode";
18
+ readonly REDIRECTED_TO_URL: "redirectedToUrl";
19
+ readonly REDIRECTED_TO_STATUS_CODE: "redirectedToStatusCode";
20
+ readonly REDIRECTION_CHAIN: "redirectionChain";
21
+ readonly SOURCE_URL: "sourceUrl";
22
+ readonly STATUS_CODE: "httpStatusCode";
23
+ readonly TARGET_STATUS_CODE: "targetStatusCode";
24
+ readonly URL: "url";
25
+ readonly URL_COUNT: "urlCount";
26
+ readonly URL_TO: "urlTo";
27
+ readonly URL_TO_STATUS_CODE: "urlToStatusCode";
28
28
  };
29
+ export type Column = typeof column[keyof typeof column];
@@ -1,4 +1,4 @@
1
- export const columns = {
1
+ export const column = {
2
2
  CUSTOM_EXTRACTION_1: 'customExtraction1',
3
3
  CUSTOM_EXTRACTION_2: 'customExtraction2',
4
4
  DEEP_RANK: 'deepRank',
@@ -4,7 +4,7 @@ export const getData = async (query, variables, accessToken) => {
4
4
  queryClean = queryClean.replace(/\n/g, " ");
5
5
  queryClean = queryClean.replace(/\t/g, " ");
6
6
  queryClean = queryClean.replace(/ /g, " ");
7
- const apiResponse = await post("https://api.lumar.io/graphql", {
7
+ return await post("https://api.lumar.io/graphql", {
8
8
  query: queryClean,
9
9
  variables,
10
10
  }, {
@@ -12,5 +12,4 @@ export const getData = async (query, variables, accessToken) => {
12
12
  "x-auth-token": accessToken,
13
13
  },
14
14
  });
15
- return apiResponse;
16
15
  };
@@ -1,29 +1,11 @@
1
- export declare const operands: {
2
- CONTAINS: string;
3
- DOESNT_CONTAIN: string;
4
- DOESNT_MATCH_REGEX: string;
5
- ENDS_WITH: string;
6
- EQUALS: string;
7
- GREATER_THAN: string;
8
- GREATER_THAN_OR_EQUAL: string;
9
- IS_EMPTY: string;
10
- LESS_THAN: string;
11
- LESS_THAN_OR_EQUAL: string;
12
- MATCHES_REGEX: string;
13
- NOT_EQUALS: string;
14
- STARTS_WITH: string;
15
- };
16
- export declare const reportTypes: {
17
- ADDED: string;
18
- BASIC: string;
19
- MISSING: string;
20
- REMOVED: string;
21
- };
22
- /**
23
- * Shorthand function to return the report key.
24
- */
25
- export declare const getReportKey: (templateCode: string, typeCode: string) => string;
26
- export { columns } from "./columns";
27
- export { reportTemplates } from "./reportTemplates";
28
- export { getData } from "./getData";
29
- export { initClient } from "./initClient";
1
+ export * from "./lumarGraphql";
2
+ export * from "./columns";
3
+ export * from "./getData";
4
+ export * from "./initClient";
5
+ export * from "./reportTemplates";
6
+ export * from "./queries/crawl";
7
+ export * from "./queries/getCrawls";
8
+ export * from "./queries/getReportDifferences";
9
+ export * from "./queries/getRows";
10
+ export * from "./queries/getTotals";
11
+ export * from "./queries/row";
@@ -1,31 +1,11 @@
1
- export const operands = {
2
- CONTAINS: "contains",
3
- DOESNT_CONTAIN: "notContains",
4
- DOESNT_MATCH_REGEX: "notMatchesRegex",
5
- ENDS_WITH: "endsWith",
6
- EQUALS: "eq",
7
- GREATER_THAN: "gt",
8
- GREATER_THAN_OR_EQUAL: "ge",
9
- IS_EMPTY: "isEmpty",
10
- LESS_THAN: "lt",
11
- LESS_THAN_OR_EQUAL: "le",
12
- MATCHES_REGEX: "matchesRegex",
13
- NOT_EQUALS: "ne",
14
- STARTS_WITH: "beginsWith",
15
- };
16
- export const reportTypes = {
17
- ADDED: "Added",
18
- BASIC: "Basic",
19
- MISSING: "Missing",
20
- REMOVED: "Removed",
21
- };
22
- /**
23
- * Shorthand function to return the report key.
24
- */
25
- export const getReportKey = (templateCode, typeCode) => {
26
- return `${templateCode}-${typeCode}`.toLowerCase();
27
- };
28
- export { columns } from "./columns";
29
- export { reportTemplates } from "./reportTemplates";
30
- export { getData } from "./getData";
31
- export { initClient } from "./initClient";
1
+ export * from "./lumarGraphql";
2
+ export * from "./columns";
3
+ export * from "./getData";
4
+ export * from "./initClient";
5
+ export * from "./reportTemplates";
6
+ export * from "./queries/crawl";
7
+ export * from "./queries/getCrawls";
8
+ export * from "./queries/getReportDifferences";
9
+ export * from "./queries/getRows";
10
+ export * from "./queries/getTotals";
11
+ export * from "./queries/row";
@@ -0,0 +1,27 @@
1
+ export declare const operand: {
2
+ readonly CONTAINS: "contains";
3
+ readonly DOESNT_CONTAIN: "notContains";
4
+ readonly DOESNT_MATCH_REGEX: "notMatchesRegex";
5
+ readonly ENDS_WITH: "endsWith";
6
+ readonly EQUALS: "eq";
7
+ readonly GREATER_THAN: "gt";
8
+ readonly GREATER_THAN_OR_EQUAL: "ge";
9
+ readonly IS_EMPTY: "isEmpty";
10
+ readonly LESS_THAN: "lt";
11
+ readonly LESS_THAN_OR_EQUAL: "le";
12
+ readonly MATCHES_REGEX: "matchesRegex";
13
+ readonly NOT_EQUALS: "ne";
14
+ readonly STARTS_WITH: "beginsWith";
15
+ };
16
+ export type Operand = typeof operand[keyof typeof operand];
17
+ export declare const reportType: {
18
+ readonly ADDED: "Added";
19
+ readonly BASIC: "Basic";
20
+ readonly MISSING: "Missing";
21
+ readonly REMOVED: "Removed";
22
+ };
23
+ export type ReportType = typeof reportType[keyof typeof reportType];
24
+ /**
25
+ * Shorthand function to return the report key.
26
+ */
27
+ export declare const getReportKey: (templateCode: string, typeCode: string) => string;
@@ -0,0 +1,27 @@
1
+ export const operand = {
2
+ CONTAINS: "contains",
3
+ DOESNT_CONTAIN: "notContains",
4
+ DOESNT_MATCH_REGEX: "notMatchesRegex",
5
+ ENDS_WITH: "endsWith",
6
+ EQUALS: "eq",
7
+ GREATER_THAN: "gt",
8
+ GREATER_THAN_OR_EQUAL: "ge",
9
+ IS_EMPTY: "isEmpty",
10
+ LESS_THAN: "lt",
11
+ LESS_THAN_OR_EQUAL: "le",
12
+ MATCHES_REGEX: "matchesRegex",
13
+ NOT_EQUALS: "ne",
14
+ STARTS_WITH: "beginsWith",
15
+ };
16
+ export const reportType = {
17
+ ADDED: "Added",
18
+ BASIC: "Basic",
19
+ MISSING: "Missing",
20
+ REMOVED: "Removed",
21
+ };
22
+ /**
23
+ * Shorthand function to return the report key.
24
+ */
25
+ export const getReportKey = (templateCode, typeCode) => {
26
+ return `${templateCode}-${typeCode}`.toLowerCase();
27
+ };
@@ -17,7 +17,7 @@ declare const getReportDifferences: ({ crawlId, filter, reportTemplateCode }: Ge
17
17
  input: {
18
18
  crawlId: number;
19
19
  reportTemplateCode: string;
20
- reportTypeCode: string;
20
+ reportTypeCode: "Basic";
21
21
  };
22
22
  };
23
23
  };
@@ -1,4 +1,4 @@
1
- import { reportTypes } from "../";
1
+ import { reportType } from "../";
2
2
  /**
3
3
  * Used to return the number for: Basic, Added, Missing, Removed for a given report.
4
4
  */
@@ -28,7 +28,7 @@ const getReportDifferences = ({ crawlId, filter, reportTemplateCode }) => ({
28
28
  input: {
29
29
  crawlId,
30
30
  reportTemplateCode,
31
- reportTypeCode: reportTypes.BASIC,
31
+ reportTypeCode: reportType.BASIC,
32
32
  },
33
33
  },
34
34
  });