@8ms/helpers 2.3.24 → 2.3.26

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 (153) hide show
  1. package/package.json +118 -189
  2. package/.github/workflows/deploy_npmjs.yml +0 -41
  3. package/.yarn/install-state.gz +0 -0
  4. package/.yarn/releases/yarn-4.12.0.cjs +0 -942
  5. package/.yarnrc.yml +0 -2
  6. package/dist/_class/index.d.mts +0 -2
  7. package/dist/_class/index.mjs +0 -61
  8. package/dist/adverity/index.d.mts +0 -2
  9. package/dist/adverity/index.mjs +0 -64
  10. package/dist/adverity/server/index.d.mts +0 -18
  11. package/dist/adverity/server/index.mjs +0 -25
  12. package/dist/api/index.d.mts +0 -2
  13. package/dist/api/index.mjs +0 -3
  14. package/dist/api-DGKJDAfb.mjs +0 -139
  15. package/dist/array/index.d.mts +0 -11
  16. package/dist/array/index.mjs +0 -12
  17. package/dist/atInternet/index.d.mts +0 -20
  18. package/dist/atInternet/index.mjs +0 -18
  19. package/dist/aws/ec2/server/index.d.mts +0 -18
  20. package/dist/aws/ec2/server/index.mjs +0 -48
  21. package/dist/aws/ecs/server/index.d.mts +0 -59
  22. package/dist/aws/ecs/server/index.mjs +0 -113
  23. package/dist/aws/glue/server/index.d.mts +0 -19
  24. package/dist/aws/glue/server/index.mjs +0 -36
  25. package/dist/aws/lambda/server/index.d.mts +0 -28
  26. package/dist/aws/lambda/server/index.mjs +0 -57
  27. package/dist/aws/s3/server/index.d.mts +0 -124
  28. package/dist/aws/s3/server/index.mjs +0 -360
  29. package/dist/aws/server/index.d.mts +0 -2
  30. package/dist/aws/server/index.mjs +0 -3
  31. package/dist/aws/ses/server/index.d.mts +0 -105
  32. package/dist/aws/ses/server/index.mjs +0 -268
  33. package/dist/aws/sqs/server/index.d.mts +0 -41
  34. package/dist/aws/sqs/server/index.mjs +0 -56
  35. package/dist/aws/ssm/server/index.d.mts +0 -18
  36. package/dist/aws/ssm/server/index.mjs +0 -47
  37. package/dist/axios/index.d.mts +0 -22
  38. package/dist/axios/index.mjs +0 -50
  39. package/dist/boolean/index.d.mts +0 -7
  40. package/dist/boolean/index.mjs +0 -13
  41. package/dist/brightData/serpApi/server/index.d.mts +0 -93
  42. package/dist/brightData/serpApi/server/index.mjs +0 -229
  43. package/dist/brightData/server/index.d.mts +0 -2
  44. package/dist/brightData/server/index.mjs +0 -18
  45. package/dist/brightData/webScraperIde/server/index.d.mts +0 -19
  46. package/dist/brightData/webScraperIde/server/index.mjs +0 -50
  47. package/dist/cache/server/index.d.mts +0 -10
  48. package/dist/cache/server/index.mjs +0 -31
  49. package/dist/chunk-DDarj8oW.mjs +0 -7
  50. package/dist/crud/index.d.mts +0 -10
  51. package/dist/crud/index.mjs +0 -10
  52. package/dist/crypto/index.d.mts +0 -25
  53. package/dist/crypto/index.mjs +0 -57
  54. package/dist/date/index.d.mts +0 -2
  55. package/dist/date/index.mjs +0 -471
  56. package/dist/drizzle/server/index.d.mts +0 -22
  57. package/dist/drizzle/server/index.mjs +0 -69
  58. package/dist/environment/index.d.mts +0 -37
  59. package/dist/environment/index.mjs +0 -60
  60. package/dist/eskimi/index.d.mts +0 -52
  61. package/dist/eskimi/index.mjs +0 -90
  62. package/dist/eskimi/server/index.d.mts +0 -25
  63. package/dist/eskimi/server/index.mjs +0 -50
  64. package/dist/file/index.d.mts +0 -7
  65. package/dist/file/index.mjs +0 -20
  66. package/dist/file/server/index.d.mts +0 -8
  67. package/dist/file/server/index.mjs +0 -16
  68. package/dist/geo/index.d.mts +0 -26
  69. package/dist/geo/index.mjs +0 -1591
  70. package/dist/getDecimal-CafxtLhH.mjs +0 -40
  71. package/dist/googleAds/keywordPlanner/server/index.d.mts +0 -45
  72. package/dist/googleAds/keywordPlanner/server/index.mjs +0 -51
  73. package/dist/googleAds/server/index.d.mts +0 -27
  74. package/dist/googleAds/server/index.mjs +0 -48
  75. package/dist/googleCloud/bigquery/server/index.d.mts +0 -82
  76. package/dist/googleCloud/bigquery/server/index.mjs +0 -133
  77. package/dist/googleCloud/server/index.d.mts +0 -2
  78. package/dist/googleCloud/server/index.mjs +0 -24
  79. package/dist/googleCloud/sheets/server/index.d.mts +0 -22
  80. package/dist/googleCloud/sheets/server/index.mjs +0 -31
  81. package/dist/googleCloud/storage/server/index.d.mts +0 -31
  82. package/dist/googleCloud/storage/server/index.mjs +0 -79
  83. package/dist/googlePageSpeed/server/index.d.mts +0 -34
  84. package/dist/googlePageSpeed/server/index.mjs +0 -53
  85. package/dist/googleSearchIncidents/server/index.d.mts +0 -73
  86. package/dist/googleSearchIncidents/server/index.mjs +0 -55
  87. package/dist/greenDomain/server/index.d.mts +0 -25
  88. package/dist/greenDomain/server/index.mjs +0 -31
  89. package/dist/index-1fBbJGQz.d.mts +0 -246
  90. package/dist/index-BHuvb_7y.d.mts +0 -116
  91. package/dist/index-BfyGIdDD.d.mts +0 -18
  92. package/dist/index-CqTOMR8f.d.mts +0 -17
  93. package/dist/index-DW9yJLtI.d.mts +0 -67
  94. package/dist/index-DmCSxHCc.d.mts +0 -32
  95. package/dist/index-DwB8X1lz.d.mts +0 -32
  96. package/dist/inngest/index.d.mts +0 -10
  97. package/dist/inngest/index.mjs +0 -10
  98. package/dist/json/index.d.mts +0 -7
  99. package/dist/json/index.mjs +0 -27
  100. package/dist/littleWarden/server/index.d.mts +0 -56
  101. package/dist/littleWarden/server/index.mjs +0 -79
  102. package/dist/lodash/index.d.mts +0 -45
  103. package/dist/lodash/index.mjs +0 -176
  104. package/dist/lumar/api/server/index.d.mts +0 -66
  105. package/dist/lumar/api/server/index.mjs +0 -111
  106. package/dist/lumar/graphql/server/index.d.mts +0 -308
  107. package/dist/lumar/graphql/server/index.mjs +0 -172
  108. package/dist/myTarget/server/index.d.mts +0 -9
  109. package/dist/myTarget/server/index.mjs +0 -16
  110. package/dist/nextAuth/index.d.mts +0 -12
  111. package/dist/nextAuth/index.mjs +0 -15
  112. package/dist/nextJs/client/index.d.mts +0 -10
  113. package/dist/nextJs/client/index.mjs +0 -12
  114. package/dist/nextJs/index.d.mts +0 -19
  115. package/dist/nextJs/index.mjs +0 -12
  116. package/dist/number/index.d.mts +0 -54
  117. package/dist/number/index.mjs +0 -75
  118. package/dist/object/index.d.mts +0 -8
  119. package/dist/object/index.mjs +0 -22
  120. package/dist/onePassword/server/index.d.mts +0 -24
  121. package/dist/onePassword/server/index.mjs +0 -50
  122. package/dist/openAi/server/index.d.mts +0 -20
  123. package/dist/openAi/server/index.mjs +0 -46
  124. package/dist/prisma/index.d.mts +0 -7
  125. package/dist/prisma/index.mjs +0 -15
  126. package/dist/prisma/server/index.d.mts +0 -31
  127. package/dist/prisma/server/index.mjs +0 -64
  128. package/dist/server-Bwy4JI8Z.mjs +0 -33
  129. package/dist/snapchat/server/index.d.mts +0 -25
  130. package/dist/snapchat/server/index.mjs +0 -39
  131. package/dist/sorting/index.d.mts +0 -25
  132. package/dist/sorting/index.mjs +0 -50
  133. package/dist/stream/server/index.d.mts +0 -15
  134. package/dist/stream/server/index.mjs +0 -48
  135. package/dist/string/index.d.mts +0 -107
  136. package/dist/string/index.mjs +0 -187
  137. package/dist/swr/client/index.d.mts +0 -46
  138. package/dist/swr/client/index.mjs +0 -40
  139. package/dist/upTimeRobot/server/index.d.mts +0 -72
  140. package/dist/upTimeRobot/server/index.mjs +0 -82
  141. package/dist/url/index.d.mts +0 -29
  142. package/dist/url/index.mjs +0 -52
  143. package/dist/url/server/index.d.mts +0 -9
  144. package/dist/url/server/index.mjs +0 -35
  145. package/dist/util/index.d.mts +0 -50
  146. package/dist/util/index.mjs +0 -107
  147. package/dist/util/server/index.d.mts +0 -27
  148. package/dist/util/server/index.mjs +0 -61
  149. package/dist/webWorker/index.d.mts +0 -11
  150. package/dist/webWorker/index.mjs +0 -11
  151. package/dist/xml/server/index.d.mts +0 -4
  152. package/dist/xml/server/index.mjs +0 -17
  153. package/tsdown.config.ts +0 -11
@@ -1,35 +0,0 @@
1
- import { createDirectory } from "../../file/server/index.mjs";
2
- import axios from "axios";
3
-
4
- //#region src/url/server/writeUrlContents.ts
5
- /**
6
- * Downloads a given URL's contents to a local file.
7
- *
8
- * Requires fs-extra
9
- */
10
- const writeUrlContents = async (filePath, url) => {
11
- const fs = await import("fs-extra");
12
- await createDirectory(filePath);
13
- const writer = fs.createWriteStream(filePath);
14
- await axios({
15
- method: "get",
16
- url,
17
- responseType: "stream"
18
- }).then((response) => {
19
- return new Promise(async (resolve, reject) => {
20
- response.data.pipe(writer);
21
- let error = null;
22
- writer.on("error", (err) => {
23
- error = err;
24
- writer.close();
25
- reject(err);
26
- });
27
- writer.on("close", () => {
28
- if (!error) resolve(true);
29
- });
30
- });
31
- });
32
- };
33
-
34
- //#endregion
35
- export { writeUrlContents };
@@ -1,50 +0,0 @@
1
- //#region src/util/defaultTo.d.ts
2
- /**
3
- * Function to default to a value, whilst filtering through an instance
4
- */
5
- declare const defaultTo: (instance: any, keys: any | any[], defaultValue?: any) => any;
6
- //#endregion
7
- //#region src/util/getClean.d.ts
8
- type GetClean = {
9
- hash?: boolean;
10
- input: any;
11
- lowercase?: boolean;
12
- parameter?: boolean;
13
- };
14
- /**
15
- * Return a clean URL with a few options.
16
- */
17
- declare const getClean: (props: GetClean) => string;
18
- //#endregion
19
- //#region src/util/getError.d.ts
20
- declare const getError: (error: any) => string;
21
- //#endregion
22
- //#region src/util/getWithoutHash.d.ts
23
- /**
24
- * Get a URL without the parameter query.
25
- */
26
- declare const getWithoutHash: (input: string) => string;
27
- //#endregion
28
- //#region src/util/getWithoutParameter.d.ts
29
- /**
30
- * Get a URL without the parameter query.
31
- */
32
- declare const getWithoutParameter: (input: string) => string;
33
- //#endregion
34
- //#region src/util/isUndefined.d.ts
35
- /**
36
- * Check to see if a value is undefined.
37
- */
38
- declare const isUndefined: (instance: any, keys: any | any[]) => boolean;
39
- //#endregion
40
- //#region src/util/promiseChunks.d.ts
41
- /**
42
- * Chunk a queue of promises into controlled chunks to prevent overloading.
43
- * https://stackoverflow.com/a/53964407
44
- */
45
- declare const promiseChunks: (promises: Promise<any>[], size: number, sleepSeconds?: number, callbackFunction?: Function) => Promise<unknown[]>;
46
- //#endregion
47
- //#region src/util/sleep.d.ts
48
- declare const sleep: (seconds: number) => Promise<void>;
49
- //#endregion
50
- export { defaultTo, getClean, getError, getWithoutHash, getWithoutParameter, isUndefined, promiseChunks, sleep };
@@ -1,107 +0,0 @@
1
- import { chunk, flatten, isObject } from "../lodash/index.mjs";
2
- import { getArray } from "../array/index.mjs";
3
-
4
- //#region src/util/defaultTo.ts
5
- /**
6
- * Function to default to a value, whilst filtering through an instance
7
- */
8
- const defaultTo = (instance, keys, defaultValue = null) => {
9
- const keysArray = getArray(keys);
10
- let found = true;
11
- let pointer = instance;
12
- if ("undefined" === typeof instance || null === pointer) found = false;
13
- else keysArray.forEach((key) => {
14
- if (found) if (isObject(pointer)) if (void 0 === pointer[key] || null === pointer[key]) found = false;
15
- else pointer = pointer[key];
16
- else found = false;
17
- });
18
- return found ? pointer : defaultValue;
19
- };
20
-
21
- //#endregion
22
- //#region src/util/getWithoutParameter.ts
23
- /**
24
- * Get a URL without the parameter query.
25
- */
26
- const getWithoutParameter = (input) => {
27
- let response = input;
28
- if (-1 !== response.indexOf("?")) {
29
- const split = response.split("?");
30
- if (split.length > 1) response = split[0];
31
- }
32
- return response;
33
- };
34
-
35
- //#endregion
36
- //#region src/util/getWithoutHash.ts
37
- /**
38
- * Get a URL without the parameter query.
39
- */
40
- const getWithoutHash = (input) => {
41
- let response = input;
42
- if (-1 !== response.indexOf("#")) {
43
- const split = response.split("#");
44
- if (split.length > 1) response = split[0];
45
- }
46
- return response;
47
- };
48
-
49
- //#endregion
50
- //#region src/util/getClean.ts
51
- /**
52
- * Return a clean URL with a few options.
53
- */
54
- const getClean = (props) => {
55
- let response = props.input.toString().trim();
56
- if (props.parameter) response = getWithoutParameter(response);
57
- if (props.hash) response = getWithoutHash(response);
58
- if (props.lowercase) response = response.toLowerCase();
59
- return response;
60
- };
61
-
62
- //#endregion
63
- //#region src/util/getError.ts
64
- const getError = (error) => {
65
- let response = "";
66
- if (typeof error === "string") response = error.toUpperCase();
67
- else if (error instanceof Error) response = error.message;
68
- return response;
69
- };
70
-
71
- //#endregion
72
- //#region src/util/isUndefined.ts
73
- const undefinedValue = "__!!UNDEFINED!!__";
74
- /**
75
- * Check to see if a value is undefined.
76
- */
77
- const isUndefined = (instance, keys) => {
78
- return undefinedValue === defaultTo(instance, keys, undefinedValue);
79
- };
80
-
81
- //#endregion
82
- //#region src/util/sleep.ts
83
- const sleep = (seconds) => {
84
- return new Promise((resolve) => setTimeout(resolve, seconds * 1e3));
85
- };
86
-
87
- //#endregion
88
- //#region src/util/promiseChunks.ts
89
- /**
90
- * Chunk a queue of promises into controlled chunks to prevent overloading.
91
- * https://stackoverflow.com/a/53964407
92
- */
93
- const promiseChunks = async (promises, size, sleepSeconds = 0, callbackFunction) => {
94
- const batches = chunk(promises, size);
95
- let results = [];
96
- while (batches.length) {
97
- const batch = batches.shift();
98
- const result = await Promise.all(batch);
99
- results.push(result);
100
- if (callbackFunction) await callbackFunction(result);
101
- await sleep(sleepSeconds);
102
- }
103
- return flatten(results);
104
- };
105
-
106
- //#endregion
107
- export { defaultTo, getClean, getError, getWithoutHash, getWithoutParameter, isUndefined, promiseChunks, sleep };
@@ -1,27 +0,0 @@
1
- import { BrotliOptions, ZlibOptions } from "zlib";
2
-
3
- //#region src/util/server/getBrotliCompressed.d.ts
4
- /**
5
- * Compress a given input using Brotli.
6
- */
7
- declare const getBrotliCompressed: (input: any, options?: BrotliOptions) => Promise<unknown>;
8
- //#endregion
9
- //#region src/util/server/getBrotliDecompressed.d.ts
10
- /**
11
- * Decompress a given Brotli input into a string.
12
- */
13
- declare const getBrotliDecompressed: (input: any, options?: BrotliOptions) => Promise<unknown>;
14
- //#endregion
15
- //#region src/util/server/getGzipCompressed.d.ts
16
- /**
17
- * Compress a given input using Gzip.
18
- */
19
- declare const getGzipCompressed: (input: any, options?: ZlibOptions) => Promise<string>;
20
- //#endregion
21
- //#region src/util/server/getGzipDecompressed.d.ts
22
- /**
23
- * Decompress a given Gzip input into a string.
24
- */
25
- declare const getGzipDecompressed: (input: any, options?: ZlibOptions) => Promise<unknown>;
26
- //#endregion
27
- export { getBrotliCompressed, getBrotliDecompressed, getGzipCompressed, getGzipDecompressed };
@@ -1,61 +0,0 @@
1
- import zlib from "zlib";
2
-
3
- //#region src/util/server/getBrotliCompressed.ts
4
- /**
5
- * Compress a given input using Brotli.
6
- */
7
- const getBrotliCompressed = async (input, options = {}) => {
8
- return new Promise(async (resolve, reject) => {
9
- zlib.brotliCompress(input || "", options || {}, (err, data) => {
10
- if (err) reject(`Error compressing - ${err.message}`);
11
- else resolve(data.toString("base64"));
12
- });
13
- });
14
- };
15
-
16
- //#endregion
17
- //#region src/util/server/getBrotliDecompressed.ts
18
- /**
19
- * Decompress a given Brotli input into a string.
20
- */
21
- const getBrotliDecompressed = async (input, options = {}) => {
22
- return new Promise(async (resolve, reject) => {
23
- const compressedData = Buffer.from(input || "", "base64");
24
- zlib.brotliDecompress(compressedData, options || {}, (err, data) => {
25
- if (err) reject(`Error decompressing - ${err.message}`);
26
- else resolve(data.toString("utf8"));
27
- });
28
- });
29
- };
30
-
31
- //#endregion
32
- //#region src/util/server/getGzipCompressed.ts
33
- /**
34
- * Compress a given input using Gzip.
35
- */
36
- const getGzipCompressed = async (input, options = {}) => {
37
- return new Promise(async (resolve, reject) => {
38
- zlib.gzip(input || "", options || {}, (err, data) => {
39
- if (err) reject(`Error compressing - ${err.message}`);
40
- else resolve(data.toString("base64"));
41
- });
42
- });
43
- };
44
-
45
- //#endregion
46
- //#region src/util/server/getGzipDecompressed.ts
47
- /**
48
- * Decompress a given Gzip input into a string.
49
- */
50
- const getGzipDecompressed = async (input, options = {}) => {
51
- return new Promise(async (resolve, reject) => {
52
- const compressedData = Buffer.from(input || "", "base64");
53
- zlib.gunzip(compressedData, options || {}, (err, data) => {
54
- if (err) reject(`Error decompressing - ${err.message}`);
55
- else resolve(data.toString("utf8"));
56
- });
57
- });
58
- };
59
-
60
- //#endregion
61
- export { getBrotliCompressed, getBrotliDecompressed, getGzipCompressed, getGzipDecompressed };
@@ -1,11 +0,0 @@
1
- //#region src/webWorker/webWorker.d.ts
2
- declare const WebWorkerState: {
3
- IDLE: string;
4
- CANCELLED: string;
5
- PENDING: string;
6
- ERROR: string;
7
- SUCCESS: string;
8
- };
9
- type WebWorkerState = typeof WebWorkerState[keyof typeof WebWorkerState];
10
- //#endregion
11
- export { WebWorkerState };
@@ -1,11 +0,0 @@
1
- //#region src/webWorker/webWorker.ts
2
- const WebWorkerState = {
3
- IDLE: "IDLE",
4
- CANCELLED: "CANCELLED",
5
- PENDING: "PENDING",
6
- ERROR: "ERROR",
7
- SUCCESS: "SUCCESS"
8
- };
9
-
10
- //#endregion
11
- export { WebWorkerState };
@@ -1,4 +0,0 @@
1
- //#region src/xml/server/getXml.d.ts
2
- declare const getXml: (url: string) => Promise<string>;
3
- //#endregion
4
- export { getXml };
@@ -1,17 +0,0 @@
1
- import "../../api-DGKJDAfb.mjs";
2
- import { get } from "../../axios/index.mjs";
3
-
4
- //#region src/xml/server/getXml.ts
5
- const getXml = async (url) => {
6
- let response = "";
7
- const apiResponse = await get(url);
8
- if (apiResponse.isSuccess()) {
9
- response = apiResponse.getBody().toString();
10
- response = response.trim();
11
- response = response.replace(/[ ]{2}|\r\n|\n|\r|\t/gm, "");
12
- }
13
- return response;
14
- };
15
-
16
- //#endregion
17
- export { getXml };
package/tsdown.config.ts DELETED
@@ -1,11 +0,0 @@
1
- import {defineConfig} from "tsdown";
2
-
3
- export default defineConfig({
4
- entry : ["src/**/index.ts", "src/**/index.tsx"],
5
- outDir : "dist",
6
- format : ["esm"],
7
- dts : true,
8
- clean : true,
9
- exports: true, // auto-generates the exports map in package.json
10
- skipNodeModulesBundle: true, // don't inline dependencies, let the consumer resolve them
11
- });