@8ms/helpers 2.2.26 → 2.3.2

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 (224) 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 +1 -1
  12. package/api/functions.d.ts +1 -1
  13. package/api/functions.js +1 -1
  14. package/api/index.d.ts +1 -1
  15. package/api/index.js +1 -1
  16. package/array/array.d.ts +8 -0
  17. package/array/array.js +9 -0
  18. package/array/index.d.ts +1 -8
  19. package/array/index.js +1 -9
  20. package/atInternet/atInternet.d.ts +16 -0
  21. package/atInternet/atInternet.js +15 -0
  22. package/atInternet/index.d.ts +1 -16
  23. package/atInternet/index.js +1 -15
  24. package/aws/ec2/server/awsEc2.d.ts +3 -0
  25. package/aws/ec2/server/awsEc2.js +12 -0
  26. package/aws/ec2/server/index.d.ts +2 -3
  27. package/aws/ec2/server/index.js +2 -12
  28. package/aws/ecs/server/awsEcs.d.ts +3 -0
  29. package/aws/ecs/server/awsEcs.js +12 -0
  30. package/aws/ecs/server/index.d.ts +2 -3
  31. package/aws/ecs/server/index.js +2 -12
  32. package/aws/glue/server/awsGlue.d.ts +3 -0
  33. package/aws/glue/server/awsGlue.js +12 -0
  34. package/aws/glue/server/index.d.ts +2 -3
  35. package/aws/glue/server/index.js +2 -12
  36. package/aws/lambda/server/awsLambda.d.ts +4 -0
  37. package/aws/lambda/server/awsLambda.js +16 -0
  38. package/aws/lambda/server/index.d.ts +2 -4
  39. package/aws/lambda/server/index.js +2 -16
  40. package/aws/s3/server/awsS3.d.ts +13 -0
  41. package/aws/s3/server/awsS3.js +20 -0
  42. package/aws/s3/server/index.d.ts +3 -13
  43. package/aws/s3/server/index.js +3 -20
  44. package/aws/server/aws.d.ts +9 -0
  45. package/aws/server/aws.js +29 -0
  46. package/aws/server/index.d.ts +2 -9
  47. package/aws/server/index.js +2 -29
  48. package/aws/ses/server/awsSes.d.ts +4 -0
  49. package/aws/ses/server/awsSes.js +13 -0
  50. package/aws/ses/server/index.d.ts +3 -4
  51. package/aws/ses/server/index.js +3 -13
  52. package/aws/sqs/server/awsSqs.d.ts +3 -0
  53. package/aws/sqs/server/awsSqs.js +12 -0
  54. package/aws/sqs/server/index.d.ts +2 -3
  55. package/aws/sqs/server/index.js +2 -12
  56. package/aws/ssm/server/awsSsm.d.ts +3 -0
  57. package/aws/ssm/server/awsSsm.js +12 -0
  58. package/aws/ssm/server/index.d.ts +2 -3
  59. package/aws/ssm/server/index.js +2 -12
  60. package/axios/index.d.ts +3 -3
  61. package/axios/index.js +3 -3
  62. package/boolean/boolean.d.ts +4 -0
  63. package/boolean/boolean.js +16 -0
  64. package/boolean/index.d.ts +1 -4
  65. package/boolean/index.js +1 -16
  66. package/brightData/serpApi/server/brightDataSerpApi.d.ts +10 -0
  67. package/brightData/serpApi/server/brightDataSerpApi.js +9 -0
  68. package/brightData/serpApi/server/index.d.ts +6 -15
  69. package/brightData/serpApi/server/index.js +6 -14
  70. package/brightData/server/brightData.d.ts +15 -0
  71. package/brightData/server/brightData.js +15 -0
  72. package/brightData/server/index.d.ts +1 -15
  73. package/brightData/server/index.js +1 -15
  74. package/brightData/webScraperIde/server/index.d.ts +2 -2
  75. package/brightData/webScraperIde/server/index.js +2 -2
  76. package/cache/server/cache.d.ts +7 -0
  77. package/cache/server/cache.js +43 -0
  78. package/cache/server/index.d.ts +1 -7
  79. package/cache/server/index.js +1 -43
  80. package/crud/crud.d.ts +7 -0
  81. package/crud/crud.js +6 -0
  82. package/crud/index.d.ts +1 -7
  83. package/crud/index.js +1 -6
  84. package/crypto/index.d.ts +4 -4
  85. package/crypto/index.js +4 -4
  86. package/date/calculation.d.ts +1 -1
  87. package/date/financialYear.d.ts +1 -1
  88. package/date/format.d.ts +1 -1
  89. package/date/index.d.ts +1 -1
  90. package/date/index.js +1 -1
  91. package/environment/environment.d.ts +34 -0
  92. package/environment/environment.js +79 -0
  93. package/environment/index.d.ts +1 -34
  94. package/environment/index.js +1 -79
  95. package/eskimi/eskimi.d.ts +49 -0
  96. package/eskimi/eskimi.js +93 -0
  97. package/eskimi/index.d.ts +1 -49
  98. package/eskimi/index.js +1 -93
  99. package/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.d.ts +41 -0
  100. package/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.js +55 -0
  101. package/googleAds/keywordPlanner/server/index.d.ts +1 -41
  102. package/googleAds/keywordPlanner/server/index.js +1 -55
  103. package/googleAds/server/googleAds.d.ts +11 -0
  104. package/googleAds/server/googleAds.js +26 -0
  105. package/googleAds/server/index.d.ts +2 -11
  106. package/googleAds/server/index.js +2 -26
  107. package/{google/bigquery/server/GoogleBigqueryNamespace.d.ts → googleCloud/bigquery/server/GoogleCloudBigqueryNamespace.d.ts} +1 -1
  108. package/{google/bigquery/server/GoogleBigqueryNamespace.js → googleCloud/bigquery/server/GoogleCloudBigqueryNamespace.js} +1 -1
  109. package/googleCloud/bigquery/server/googleCloudBigquery.d.ts +5 -0
  110. package/{google/bigquery/server/index.js → googleCloud/bigquery/server/googleCloudBigquery.js} +7 -8
  111. package/googleCloud/bigquery/server/index.d.ts +3 -0
  112. package/googleCloud/bigquery/server/index.js +3 -0
  113. package/{google → googleCloud}/bigquery/server/loadData.d.ts +3 -3
  114. package/{google → googleCloud}/bigquery/server/loadData.js +3 -3
  115. package/googleCloud/server/index.d.ts +1 -0
  116. package/googleCloud/server/index.js +1 -0
  117. package/{google/sheets/server/GoogleSheetsNamespace.d.ts → googleCloud/sheets/server/GoogleCloudSheetsNamespace.d.ts} +1 -1
  118. package/{google/sheets/server/GoogleSheetsNamespace.js → googleCloud/sheets/server/GoogleCloudSheetsNamespace.js} +1 -1
  119. package/googleCloud/sheets/server/index.d.ts +1 -0
  120. package/googleCloud/sheets/server/index.js +1 -0
  121. package/googleCloud/storage/server/index.d.ts +2 -0
  122. package/googleCloud/storage/server/index.js +2 -0
  123. package/googlePageSpeed/server/googlePageSpeed.d.ts +19 -0
  124. package/googlePageSpeed/server/googlePageSpeed.js +38 -0
  125. package/googlePageSpeed/server/index.d.ts +2 -19
  126. package/googlePageSpeed/server/index.js +2 -38
  127. package/googleSearchIncidents/server/googleSearchIncidents.d.ts +69 -0
  128. package/googleSearchIncidents/server/googleSearchIncidents.js +42 -0
  129. package/googleSearchIncidents/server/index.d.ts +1 -69
  130. package/googleSearchIncidents/server/index.js +1 -42
  131. package/greenDomain/server/greenDomain.d.ts +21 -0
  132. package/greenDomain/server/greenDomain.js +37 -0
  133. package/greenDomain/server/index.d.ts +1 -21
  134. package/greenDomain/server/index.js +1 -37
  135. package/inngest/index.d.ts +1 -7
  136. package/inngest/index.js +1 -6
  137. package/inngest/inngest.d.ts +7 -0
  138. package/inngest/inngest.js +6 -0
  139. package/littleWarden/server/index.d.ts +2 -30
  140. package/littleWarden/server/index.js +2 -65
  141. package/littleWarden/server/littleWarden.d.ts +30 -0
  142. package/littleWarden/server/littleWarden.js +65 -0
  143. package/lumar/api/server/index.d.ts +1 -33
  144. package/lumar/api/server/index.js +1 -24
  145. package/lumar/api/server/lumarApi.d.ts +36 -0
  146. package/lumar/api/server/lumarApi.js +27 -0
  147. package/lumar/graphql/server/index.d.ts +11 -29
  148. package/lumar/graphql/server/index.js +11 -31
  149. package/lumar/graphql/server/lumarGraphql.d.ts +29 -0
  150. package/lumar/graphql/server/lumarGraphql.js +31 -0
  151. package/myTarget/server/index.d.ts +1 -5
  152. package/myTarget/server/index.js +1 -13
  153. package/myTarget/server/myTarget.d.ts +5 -0
  154. package/myTarget/server/myTarget.js +13 -0
  155. package/nextAuth/index.d.ts +2 -7
  156. package/nextAuth/index.js +2 -6
  157. package/nextAuth/nextAuth.d.ts +7 -0
  158. package/nextAuth/nextAuth.js +6 -0
  159. package/nextJs/index.d.ts +1 -12
  160. package/nextJs/index.js +1 -14
  161. package/nextJs/nextJs.d.ts +12 -0
  162. package/nextJs/nextJs.js +14 -0
  163. package/onePassword/server/index.d.ts +2 -7
  164. package/onePassword/server/index.js +2 -21
  165. package/onePassword/server/onePassword.d.ts +8 -0
  166. package/onePassword/server/onePassword.js +21 -0
  167. package/openAi/server/index.d.ts +2 -5
  168. package/openAi/server/index.js +2 -26
  169. package/openAi/server/openAi.d.ts +6 -0
  170. package/openAi/server/openAi.js +26 -0
  171. package/package.json +65 -65
  172. package/prisma/server/index.d.ts +2 -20
  173. package/prisma/server/index.js +2 -26
  174. package/prisma/server/prisma.d.ts +20 -0
  175. package/prisma/server/prisma.js +26 -0
  176. package/snapchat/server/index.d.ts +2 -7
  177. package/snapchat/server/index.js +2 -26
  178. package/snapchat/server/snapchat.d.ts +7 -0
  179. package/snapchat/server/snapchat.js +26 -0
  180. package/sorting/index.d.ts +1 -4
  181. package/sorting/index.js +1 -4
  182. package/sorting/sorting.d.ts +4 -0
  183. package/sorting/sorting.js +4 -0
  184. package/stream/server/index.d.ts +1 -1
  185. package/stream/server/index.js +1 -1
  186. package/string/index.d.ts +13 -12
  187. package/string/index.js +13 -12
  188. package/swr/client/index.d.ts +1 -42
  189. package/swr/client/index.js +1 -50
  190. package/swr/client/swr.d.ts +42 -0
  191. package/swr/client/swr.js +50 -0
  192. package/upTimeRobot/server/index.d.ts +2 -38
  193. package/upTimeRobot/server/index.js +2 -59
  194. package/upTimeRobot/server/upTimeRobot.d.ts +38 -0
  195. package/upTimeRobot/server/upTimeRobot.js +59 -0
  196. package/url/index.d.ts +1 -26
  197. package/url/index.js +1 -59
  198. package/url/server/index.d.ts +1 -1
  199. package/url/server/index.js +1 -1
  200. package/url/url.d.ts +26 -0
  201. package/url/url.js +59 -0
  202. package/util/index.d.ts +7 -7
  203. package/util/index.js +7 -7
  204. package/util/server/index.d.ts +4 -4
  205. package/util/server/index.js +4 -4
  206. package/webWorker/index.d.ts +1 -8
  207. package/webWorker/index.js +1 -7
  208. package/webWorker/webWorker.d.ts +8 -0
  209. package/webWorker/webWorker.js +7 -0
  210. package/google/bigquery/server/index.d.ts +0 -6
  211. package/google/sheets/server/index.d.ts +0 -8
  212. package/google/sheets/server/index.js +0 -42
  213. /package/api/{types.d.ts → api.d.ts} +0 -0
  214. /package/api/{types.js → api.js} +0 -0
  215. /package/date/{type.d.ts → date.d.ts} +0 -0
  216. /package/date/{type.js → date.js} +0 -0
  217. /package/{google/server/index.d.ts → googleCloud/server/googleCloud.d.ts} +0 -0
  218. /package/{google/server/index.js → googleCloud/server/googleCloud.js} +0 -0
  219. /package/{google → googleCloud}/sheets/server/getAssociatedData.d.ts +0 -0
  220. /package/{google → googleCloud}/sheets/server/getAssociatedData.js +0 -0
  221. /package/{google → googleCloud}/storage/server/GoogleCloudStorageNamespace.d.ts +0 -0
  222. /package/{google → googleCloud}/storage/server/GoogleCloudStorageNamespace.js +0 -0
  223. /package/{google/storage/server/index.d.ts → googleCloud/storage/server/googleCloudStorage.d.ts} +0 -0
  224. /package/{google/storage/server/index.js → googleCloud/storage/server/googleCloudStorage.js} +0 -0
@@ -0,0 +1,16 @@
1
+ import { AwsLambdaNamespace } from "./AwsLambdaNamespace";
2
+ import { getConfig } from "../../server";
3
+ const awsLambdaNamespaces = new Map();
4
+ export const awsLambdaClient = async (key = "default", config, vaultId, itemId) => {
5
+ if (awsLambdaNamespaces.has(key)) {
6
+ return awsLambdaNamespaces.get(key);
7
+ }
8
+ const instanceConfig = await getConfig(key, config, vaultId, itemId);
9
+ const namespace = new AwsLambdaNamespace(key, instanceConfig);
10
+ awsLambdaNamespaces.set(key, namespace);
11
+ return namespace;
12
+ };
13
+ export const getHandlerPath = (input) => {
14
+ return `${input.split(process.cwd())[1].substring(1)
15
+ .replace(/\\/g, "/")}`;
16
+ };
@@ -1,4 +1,2 @@
1
- import { AwsLambdaNamespace } from "./AwsLambdaNamespace";
2
- import { AwsConfig } from "../../server";
3
- export declare const awsLambdaClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsLambdaNamespace>;
4
- export declare const getHandlerPath: (input: string) => string;
1
+ export * from "./awsLambda";
2
+ export * from "./AwsLambdaNamespace";
@@ -1,16 +1,2 @@
1
- import { AwsLambdaNamespace } from "./AwsLambdaNamespace";
2
- import { getConfig } from "../../server";
3
- const awsLambdaNamespaces = new Map();
4
- export const awsLambdaClient = async (key = "default", config, vaultId, itemId) => {
5
- if (awsLambdaNamespaces.has(key)) {
6
- return awsLambdaNamespaces.get(key);
7
- }
8
- const instanceConfig = await getConfig(key, config, vaultId, itemId);
9
- const namespace = new AwsLambdaNamespace(key, instanceConfig);
10
- awsLambdaNamespaces.set(key, namespace);
11
- return namespace;
12
- };
13
- export const getHandlerPath = (input) => {
14
- return `${input.split(process.cwd())[1].substring(1)
15
- .replace(/\\/g, "/")}`;
16
- };
1
+ export * from "./awsLambda";
2
+ export * from "./AwsLambdaNamespace";
@@ -0,0 +1,13 @@
1
+ import { AwsS3Namespace } from "./AwsS3Namespace";
2
+ import { AwsConfig } from "../../server";
3
+ export declare const awsS3Client: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsS3Namespace>;
4
+ export type Modified = {
5
+ now: number;
6
+ modified: string;
7
+ };
8
+ export type ReadFileResponse = Modified & {
9
+ body: any;
10
+ error: any;
11
+ };
12
+ export declare const readFileDefault: ReadFileResponse;
13
+ export { payloadSchema, PayloadSchemaType } from "./payload";
@@ -0,0 +1,20 @@
1
+ import { AwsS3Namespace } from "./AwsS3Namespace";
2
+ import { getConfig } from "../../server";
3
+ import { defaultDateTime } from "../../../date";
4
+ const awsS3Namespaces = new Map();
5
+ export const awsS3Client = async (key = "default", config, vaultId, itemId) => {
6
+ if (awsS3Namespaces.has(key)) {
7
+ return awsS3Namespaces.get(key);
8
+ }
9
+ const instanceConfig = await getConfig(key, config, vaultId, itemId);
10
+ const namespace = new AwsS3Namespace(key, instanceConfig);
11
+ awsS3Namespaces.set(key, namespace);
12
+ return namespace;
13
+ };
14
+ export const readFileDefault = {
15
+ body: undefined,
16
+ now: undefined,
17
+ error: undefined,
18
+ modified: defaultDateTime,
19
+ };
20
+ export { payloadSchema } from "./payload";
@@ -1,13 +1,3 @@
1
- import { AwsS3Namespace } from "./AwsS3Namespace";
2
- import { AwsConfig } from "../../server";
3
- export declare const awsS3Client: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsS3Namespace>;
4
- export type Modified = {
5
- now: number;
6
- modified: string;
7
- };
8
- export type ReadFileResponse = Modified & {
9
- body: any;
10
- error: any;
11
- };
12
- export declare const readFileDefault: ReadFileResponse;
13
- export { payloadSchema, PayloadSchemaType } from "./payload";
1
+ export * from "./awsS3";
2
+ export * from "./AwsS3Namespace";
3
+ export * from "./payload";
@@ -1,20 +1,3 @@
1
- import { AwsS3Namespace } from "./AwsS3Namespace";
2
- import { getConfig } from "../../server";
3
- import { defaultDateTime } from "../../../date";
4
- const awsS3Namespaces = new Map();
5
- export const awsS3Client = async (key = "default", config, vaultId, itemId) => {
6
- if (awsS3Namespaces.has(key)) {
7
- return awsS3Namespaces.get(key);
8
- }
9
- const instanceConfig = await getConfig(key, config, vaultId, itemId);
10
- const namespace = new AwsS3Namespace(key, instanceConfig);
11
- awsS3Namespaces.set(key, namespace);
12
- return namespace;
13
- };
14
- export const readFileDefault = {
15
- body: undefined,
16
- now: undefined,
17
- error: undefined,
18
- modified: defaultDateTime,
19
- };
20
- export { payloadSchema } from "./payload";
1
+ export * from "./awsS3";
2
+ export * from "./AwsS3Namespace";
3
+ export * from "./payload";
@@ -0,0 +1,9 @@
1
+ export type AwsConfig = {
2
+ region: string;
3
+ credentials: {
4
+ accessKeyId: string;
5
+ secretAccessKey: string;
6
+ };
7
+ };
8
+ export declare const getConfig: (key: any, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsConfig>;
9
+ export { isResponse200 } from "./isResponse200";
@@ -0,0 +1,29 @@
1
+ import { onePasswordClient } from "../../onePassword/server";
2
+ export const getConfig = async (key, config, vaultId, itemId) => {
3
+ let response;
4
+ if (config) {
5
+ response = config;
6
+ }
7
+ else if (vaultId && itemId) {
8
+ response = await (await onePasswordClient())
9
+ .getJsonNote(vaultId, itemId);
10
+ }
11
+ else if (process.env.AWS_VAULT_ID && process.env.AWS_ITEM_ID) {
12
+ response = await (await onePasswordClient())
13
+ .getJsonNote(process.env.AWS_VAULT_ID, process.env.AWS_ITEM_ID);
14
+ }
15
+ else if (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_REGION && process.env.AWS_SECRET_ACCESS_KEY) {
16
+ response = {
17
+ region: process.env.AWS_REGION,
18
+ credentials: {
19
+ accessKeyId: process.env.AWS_ACCESS_KEY_ID,
20
+ secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
21
+ }
22
+ };
23
+ }
24
+ else {
25
+ throw new Error(`Config required for namespace '${key}'`);
26
+ }
27
+ return response;
28
+ };
29
+ export { isResponse200 } from "./isResponse200";
@@ -1,9 +1,2 @@
1
- export type AwsConfig = {
2
- region: string;
3
- credentials: {
4
- accessKeyId: string;
5
- secretAccessKey: string;
6
- };
7
- };
8
- export declare const getConfig: (key: any, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsConfig>;
9
- export { isResponse200 } from "./isResponse200";
1
+ export * from "./aws";
2
+ export * from "./isResponse200";
@@ -1,29 +1,2 @@
1
- import { onePasswordClient } from "../../onePassword/server";
2
- export const getConfig = async (key, config, vaultId, itemId) => {
3
- let response;
4
- if (config) {
5
- response = config;
6
- }
7
- else if (vaultId && itemId) {
8
- response = await (await onePasswordClient())
9
- .getJsonNote(vaultId, itemId);
10
- }
11
- else if (process.env.AWS_VAULT_ID && process.env.AWS_ITEM_ID) {
12
- response = await (await onePasswordClient())
13
- .getJsonNote(process.env.AWS_VAULT_ID, process.env.AWS_ITEM_ID);
14
- }
15
- else if (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_REGION && process.env.AWS_SECRET_ACCESS_KEY) {
16
- response = {
17
- region: process.env.AWS_REGION,
18
- credentials: {
19
- accessKeyId: process.env.AWS_ACCESS_KEY_ID,
20
- secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
21
- }
22
- };
23
- }
24
- else {
25
- throw new Error(`Config required for namespace '${key}'`);
26
- }
27
- return response;
28
- };
29
- export { isResponse200 } from "./isResponse200";
1
+ export * from "./aws";
2
+ export * from "./isResponse200";
@@ -0,0 +1,4 @@
1
+ import { AwsSesNamespace } from "./AwsSesNamespace";
2
+ import { AwsConfig } from "../../server";
3
+ export declare const awsSesClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsSesNamespace>;
4
+ export { SimpleEmail } from "./SimpleEmail";
@@ -0,0 +1,13 @@
1
+ import { AwsSesNamespace } from "./AwsSesNamespace";
2
+ import { getConfig } from "../../server";
3
+ const awsSesNamespaces = new Map();
4
+ export const awsSesClient = async (key = "default", config, vaultId, itemId) => {
5
+ if (awsSesNamespaces.has(key)) {
6
+ return awsSesNamespaces.get(key);
7
+ }
8
+ const instanceConfig = await getConfig(key, config, vaultId, itemId);
9
+ const namespace = new AwsSesNamespace(key, instanceConfig);
10
+ awsSesNamespaces.set(key, namespace);
11
+ return namespace;
12
+ };
13
+ export { SimpleEmail } from "./SimpleEmail";
@@ -1,4 +1,3 @@
1
- import { AwsSesNamespace } from "./AwsSesNamespace";
2
- import { AwsConfig } from "../../server";
3
- export declare const awsSesClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsSesNamespace>;
4
- export { SimpleEmail } from "./SimpleEmail";
1
+ export * from "./awsSes";
2
+ export * from "./AwsSesNamespace";
3
+ export * from "./SimpleEmail";
@@ -1,13 +1,3 @@
1
- import { AwsSesNamespace } from "./AwsSesNamespace";
2
- import { getConfig } from "../../server";
3
- const awsSesNamespaces = new Map();
4
- export const awsSesClient = async (key = "default", config, vaultId, itemId) => {
5
- if (awsSesNamespaces.has(key)) {
6
- return awsSesNamespaces.get(key);
7
- }
8
- const instanceConfig = await getConfig(key, config, vaultId, itemId);
9
- const namespace = new AwsSesNamespace(key, instanceConfig);
10
- awsSesNamespaces.set(key, namespace);
11
- return namespace;
12
- };
13
- export { SimpleEmail } from "./SimpleEmail";
1
+ export * from "./awsSes";
2
+ export * from "./AwsSesNamespace";
3
+ export * from "./SimpleEmail";
@@ -0,0 +1,3 @@
1
+ import { AwsSqsNamespace } from "./AwsSqsNamespace";
2
+ import { AwsConfig } from "../../server";
3
+ export declare const awsSqsClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsSqsNamespace>;
@@ -0,0 +1,12 @@
1
+ import { AwsSqsNamespace } from "./AwsSqsNamespace";
2
+ import { getConfig } from "../../server";
3
+ const awsSqsNamespaces = new Map();
4
+ export const awsSqsClient = async (key = "default", config, vaultId, itemId) => {
5
+ if (awsSqsNamespaces.has(key)) {
6
+ return awsSqsNamespaces.get(key);
7
+ }
8
+ const instanceConfig = await getConfig(key, config, vaultId, itemId);
9
+ const namespace = new AwsSqsNamespace(key, instanceConfig);
10
+ awsSqsNamespaces.set(key, namespace);
11
+ return namespace;
12
+ };
@@ -1,3 +1,2 @@
1
- import { AwsSqsNamespace } from "./AwsSqsNamespace";
2
- import { AwsConfig } from "../../server";
3
- export declare const awsSqsClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsSqsNamespace>;
1
+ export * from "./awsSqs";
2
+ export * from "./AwsSqsNamespace";
@@ -1,12 +1,2 @@
1
- import { AwsSqsNamespace } from "./AwsSqsNamespace";
2
- import { getConfig } from "../../server";
3
- const awsSqsNamespaces = new Map();
4
- export const awsSqsClient = async (key = "default", config, vaultId, itemId) => {
5
- if (awsSqsNamespaces.has(key)) {
6
- return awsSqsNamespaces.get(key);
7
- }
8
- const instanceConfig = await getConfig(key, config, vaultId, itemId);
9
- const namespace = new AwsSqsNamespace(key, instanceConfig);
10
- awsSqsNamespaces.set(key, namespace);
11
- return namespace;
12
- };
1
+ export * from "./awsSqs";
2
+ export * from "./AwsSqsNamespace";
@@ -0,0 +1,3 @@
1
+ import { AwsSsmNamespace } from "./AwsSsmNamespace";
2
+ import { AwsConfig } from "../../server";
3
+ export declare const awsSsmClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsSsmNamespace>;
@@ -0,0 +1,12 @@
1
+ import { AwsSsmNamespace } from "./AwsSsmNamespace";
2
+ import { getConfig } from "../../server";
3
+ const awsSsmNamespaces = new Map();
4
+ export const awsSsmClient = async (key = "default", config, vaultId, itemId) => {
5
+ if (awsSsmNamespaces.has(key)) {
6
+ return awsSsmNamespaces.get(key);
7
+ }
8
+ const instanceConfig = await getConfig(key, config, vaultId, itemId);
9
+ const namespace = new AwsSsmNamespace(key, instanceConfig);
10
+ awsSsmNamespaces.set(key, namespace);
11
+ return namespace;
12
+ };
@@ -1,3 +1,2 @@
1
- import { AwsSsmNamespace } from "./AwsSsmNamespace";
2
- import { AwsConfig } from "../../server";
3
- export declare const awsSsmClient: (key?: string, config?: AwsConfig, vaultId?: string, itemId?: string) => Promise<AwsSsmNamespace>;
1
+ export * from "./awsSsm";
2
+ export * from "./AwsSsmNamespace";
@@ -1,12 +1,2 @@
1
- import { AwsSsmNamespace } from "./AwsSsmNamespace";
2
- import { getConfig } from "../../server";
3
- const awsSsmNamespaces = new Map();
4
- export const awsSsmClient = async (key = "default", config, vaultId, itemId) => {
5
- if (awsSsmNamespaces.has(key)) {
6
- return awsSsmNamespaces.get(key);
7
- }
8
- const instanceConfig = await getConfig(key, config, vaultId, itemId);
9
- const namespace = new AwsSsmNamespace(key, instanceConfig);
10
- awsSsmNamespaces.set(key, namespace);
11
- return namespace;
12
- };
1
+ export * from "./awsSsm";
2
+ export * from "./AwsSsmNamespace";
package/axios/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { get } from "./get";
2
- export { post } from "./post";
3
- export { deleteRequest } from "./deleteRequest";
1
+ export * from "./deleteRequest";
2
+ export * from "./get";
3
+ export * from "./post";
package/axios/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { get } from "./get";
2
- export { post } from "./post";
3
- export { deleteRequest } from "./deleteRequest";
1
+ export * from "./deleteRequest";
2
+ export * from "./get";
3
+ export * from "./post";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Convert an input from a variety of forms into boolean.
3
+ */
4
+ export declare const getBoolean: (input: any, defaultValue?: boolean) => boolean;
@@ -0,0 +1,16 @@
1
+ import isBoolean from "lodash/isBoolean";
2
+ /**
3
+ * Convert an input from a variety of forms into boolean.
4
+ */
5
+ export const getBoolean = (input, defaultValue = false) => {
6
+ if (isBoolean(input)) {
7
+ return input;
8
+ }
9
+ else if ("string" === typeof input) {
10
+ return "true" === input || "1" === input || "yes" === input || "y" === input;
11
+ }
12
+ else if ("number" === typeof input) {
13
+ return 1 === input;
14
+ }
15
+ return defaultValue;
16
+ };
@@ -1,4 +1 @@
1
- /**
2
- * Convert an input from a variety of forms into boolean.
3
- */
4
- export declare const getBoolean: (input: any, defaultValue?: boolean) => boolean;
1
+ export * from "./boolean";
package/boolean/index.js CHANGED
@@ -1,16 +1 @@
1
- import isBoolean from "lodash/isBoolean";
2
- /**
3
- * Convert an input from a variety of forms into boolean.
4
- */
5
- export const getBoolean = (input, defaultValue = false) => {
6
- if (isBoolean(input)) {
7
- return input;
8
- }
9
- else if ("string" === typeof input) {
10
- return "true" === input || "1" === input || "yes" === input || "y" === input;
11
- }
12
- else if ("number" === typeof input) {
13
- return 1 === input;
14
- }
15
- return defaultValue;
16
- };
1
+ export * from "./boolean";
@@ -0,0 +1,10 @@
1
+ export declare const BrightDataSerpApiType: {
2
+ readonly GOOGLE_FLIGHTS: "GOOGLE_FLIGHTS";
3
+ readonly GOOGLE_HOTELS: "GOOGLE_HOTELS";
4
+ readonly GOOGLE_LENS: "GOOGLE_LENS";
5
+ readonly GOOGLE_MAPS: "GOOGLE_MAPS";
6
+ readonly GOOGLE_REVIEWS: "GOOGLE_REVIEWS";
7
+ readonly GOOGLE_SEARCH: "GOOGLE_SEARCH";
8
+ readonly GOOGLE_TRENDS: "GOOGLE_TRENDS";
9
+ };
10
+ export type BrightDataSerpApiType = typeof BrightDataSerpApiType[keyof typeof BrightDataSerpApiType];
@@ -0,0 +1,9 @@
1
+ export const BrightDataSerpApiType = {
2
+ GOOGLE_FLIGHTS: "GOOGLE_FLIGHTS",
3
+ GOOGLE_HOTELS: "GOOGLE_HOTELS",
4
+ GOOGLE_LENS: "GOOGLE_LENS",
5
+ GOOGLE_MAPS: "GOOGLE_MAPS",
6
+ GOOGLE_REVIEWS: "GOOGLE_REVIEWS",
7
+ GOOGLE_SEARCH: "GOOGLE_SEARCH",
8
+ GOOGLE_TRENDS: "GOOGLE_TRENDS",
9
+ };
@@ -1,15 +1,6 @@
1
- export declare const BrightDataSerpApiType: {
2
- readonly GOOGLE_FLIGHTS: "GOOGLE_FLIGHTS";
3
- readonly GOOGLE_HOTELS: "GOOGLE_HOTELS";
4
- readonly GOOGLE_LENS: "GOOGLE_LENS";
5
- readonly GOOGLE_MAPS: "GOOGLE_MAPS";
6
- readonly GOOGLE_REVIEWS: "GOOGLE_REVIEWS";
7
- readonly GOOGLE_SEARCH: "GOOGLE_SEARCH";
8
- readonly GOOGLE_TRENDS: "GOOGLE_TRENDS";
9
- };
10
- export type BrightDataSerpApiType = typeof BrightDataSerpApiType[keyof typeof BrightDataSerpApiType];
11
- export { buildGoogleSerpUrl } from "./buildGoogleSerpUrl";
12
- export { buildGoogleTrendsUrl } from "./buildGoogleTrendsUrl";
13
- export { getAsyncRequestId } from "./getAsyncRequestId";
14
- export { getAsyncResults } from "./getAsyncResults";
15
- export { getRealtime } from "./getRealtime";
1
+ export * from "./brightDataSerpApi";
2
+ export * from "./buildGoogleSerpUrl";
3
+ export * from "./buildGoogleTrendsUrl";
4
+ export * from "./getAsyncResults";
5
+ export * from "./getAsyncRequestId";
6
+ export * from "./getRealtime";
@@ -1,14 +1,6 @@
1
- export const BrightDataSerpApiType = {
2
- GOOGLE_FLIGHTS: "GOOGLE_FLIGHTS",
3
- GOOGLE_HOTELS: "GOOGLE_HOTELS",
4
- GOOGLE_LENS: "GOOGLE_LENS",
5
- GOOGLE_MAPS: "GOOGLE_MAPS",
6
- GOOGLE_REVIEWS: "GOOGLE_REVIEWS",
7
- GOOGLE_SEARCH: "GOOGLE_SEARCH",
8
- GOOGLE_TRENDS: "GOOGLE_TRENDS",
9
- };
10
- export { buildGoogleSerpUrl } from "./buildGoogleSerpUrl";
11
- export { buildGoogleTrendsUrl } from "./buildGoogleTrendsUrl";
12
- export { getAsyncRequestId } from "./getAsyncRequestId";
13
- export { getAsyncResults } from "./getAsyncResults";
14
- export { getRealtime } from "./getRealtime";
1
+ export * from "./brightDataSerpApi";
2
+ export * from "./buildGoogleSerpUrl";
3
+ export * from "./buildGoogleTrendsUrl";
4
+ export * from "./getAsyncResults";
5
+ export * from "./getAsyncRequestId";
6
+ export * from "./getRealtime";
@@ -0,0 +1,15 @@
1
+ export type Auth = {
2
+ apiKey: string;
3
+ host: string;
4
+ port: string;
5
+ username: string;
6
+ password: string;
7
+ };
8
+ /**
9
+ * Return the Zone based on the username.
10
+ */
11
+ export declare const getZone: (auth: Auth) => string;
12
+ /**
13
+ * Return the customer Id based on the username.
14
+ */
15
+ export declare const getCustomerId: (auth: Auth, prefix?: string) => string;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Return the Zone based on the username.
3
+ */
4
+ export const getZone = (auth) => {
5
+ const segments = auth.username.split("-");
6
+ return segments[segments.length - 1];
7
+ };
8
+ /**
9
+ * Return the customer Id based on the username.
10
+ */
11
+ export const getCustomerId = (auth, prefix) => {
12
+ const segments = auth.username.split("-")[2];
13
+ const customerId = segments[2].replace("hl_", "");
14
+ return (prefix || "") + customerId;
15
+ };
@@ -1,15 +1 @@
1
- export type Auth = {
2
- apiKey: string;
3
- host: string;
4
- port: string;
5
- username: string;
6
- password: string;
7
- };
8
- /**
9
- * Return the Zone based on the username.
10
- */
11
- export declare const getZone: (auth: Auth) => string;
12
- /**
13
- * Return the customer Id based on the username.
14
- */
15
- export declare const getCustomerId: (auth: Auth, prefix?: string) => string;
1
+ export * from "./brightData";
@@ -1,15 +1 @@
1
- /**
2
- * Return the Zone based on the username.
3
- */
4
- export const getZone = (auth) => {
5
- const segments = auth.username.split("-");
6
- return segments[segments.length - 1];
7
- };
8
- /**
9
- * Return the customer Id based on the username.
10
- */
11
- export const getCustomerId = (auth, prefix) => {
12
- const segments = auth.username.split("-")[2];
13
- const customerId = segments[2].replace("hl_", "");
14
- return (prefix || "") + customerId;
15
- };
1
+ export * from "./brightData";
@@ -1,2 +1,2 @@
1
- export { getBatch } from "./getBatch";
2
- export { getRealtime } from "./getRealtime";
1
+ export * from "./getBatch";
2
+ export * from "./getRealtime";
@@ -1,2 +1,2 @@
1
- export { getBatch } from "./getBatch";
2
- export { getRealtime } from "./getRealtime";
1
+ export * from "./getBatch";
2
+ export * from "./getRealtime";
@@ -0,0 +1,7 @@
1
+ export type CacheEntry = {
2
+ data: any;
3
+ expires: number;
4
+ insertedAt: number;
5
+ };
6
+ export declare const getCache: (key: string) => any;
7
+ export declare const setCache: (key: string, data: any, expires?: number, force?: boolean) => any;
@@ -0,0 +1,43 @@
1
+ const cache = new Map();
2
+ export const getCache = (key) => {
3
+ let response = null;
4
+ if (cache.has(key)) {
5
+ const cacheItem = cache.get(key);
6
+ // Timed expiry
7
+ if (cacheItem.expires > 0) {
8
+ // https://ui.dev/get-current-timestamp-javascript
9
+ const expiresAt = Math.floor(cacheItem.insertedAt / 1000) + cacheItem.expires;
10
+ const now = Math.floor(Date.now() / 1000);
11
+ // If we are now beyond the expiry date, update the data
12
+ if (now < expiresAt) {
13
+ response = cacheItem;
14
+ }
15
+ }
16
+ // 0 - Never expires
17
+ else {
18
+ response = cacheItem;
19
+ }
20
+ }
21
+ return response;
22
+ };
23
+ export const setCache = (key, data, expires = 0, force = false) => {
24
+ const now = Math.floor(Date.now() / 1000);
25
+ if (cache.has(key) && !force) {
26
+ const cacheItem = cache.get(key);
27
+ // 0 - Never expires
28
+ if (cacheItem.expires > 0) {
29
+ // https://ui.dev/get-current-timestamp-javascript
30
+ const expiresAt = Math.floor(cacheItem.insertedAt / 1000) + cacheItem.expires;
31
+ // If we are now beyond the expiry date, update the data
32
+ if (now < expiresAt) {
33
+ return cacheItem;
34
+ }
35
+ }
36
+ }
37
+ cache.set(key, {
38
+ data,
39
+ expires,
40
+ insertedAt: now,
41
+ });
42
+ return data;
43
+ };
@@ -1,7 +1 @@
1
- export type CacheEntry = {
2
- data: any;
3
- expires: number;
4
- insertedAt: number;
5
- };
6
- export declare const getCache: (key: string) => any;
7
- export declare const setCache: (key: string, data: any, expires?: number, force?: boolean) => any;
1
+ export * from "./cache";