@8ms/helpers 2.4.6 → 2.4.8

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.
@@ -1,4 +1,4 @@
1
- import { t as get } from "../../get-B9XztVOu.mjs";
1
+ import { t as get } from "../../get-fmxmkk1P.mjs";
2
2
  import { getLuxonDate, getToday, getYesterday, getYmdString } from "../../date/index.mjs";
3
3
  //#region src/adverity/server/getJobs.ts
4
4
  /**
@@ -1,13 +1,13 @@
1
1
  import { i as ApiResponseClass, n as defaultResponse, r as unexpectedError, t as apiState } from "../api-BJgcoGmU.mjs";
2
- import { t as get } from "../get-B9XztVOu.mjs";
3
- import { t as post } from "../post-DiwZvONk.mjs";
4
- import ky from "ky";
2
+ import { t as get } from "../get-fmxmkk1P.mjs";
3
+ import { t as post } from "../post-DLC6iSd9.mjs";
5
4
  //#region src/api/deleteRequest.ts
6
5
  /**
7
6
  * Make a DELETE request.
8
7
  * Can't use the function name delete as it's reserved
9
8
  */
10
9
  const deleteRequest = async (url, config = {}) => {
10
+ const { default: ky } = await import("ky");
11
11
  return await ky.delete(url, {
12
12
  throwHttpErrors: false,
13
13
  ...config
@@ -4,7 +4,6 @@ import { getFolder, getStringFromStream } from "../../../string/index.mjs";
4
4
  import { n as isResponse200, t as getConfig } from "../../../server-CCX9gh5k.mjs";
5
5
  import { getBrotliCompressed, getBrotliDecompressed, getGzipCompressed, getGzipDecompressed } from "../../../util/server/index.mjs";
6
6
  import { z } from "zod/v4";
7
- import ky from "ky";
8
7
  //#region src/aws/s3/server/AwsS3Namespace.ts
9
8
  var AwsS3Namespace = class extends BaseNamespace {
10
9
  ensureInit = async () => {
@@ -289,6 +288,7 @@ var AwsS3Namespace = class extends BaseNamespace {
289
288
  */
290
289
  urlContents = async (bucket, key, url) => {
291
290
  await this.ensureInit();
291
+ const { default: ky } = await import("ky");
292
292
  const response = await ky.get(url);
293
293
  const arrayBuffer = await response.arrayBuffer();
294
294
  const data = Buffer.from(arrayBuffer);
@@ -1,6 +1,6 @@
1
1
  import { i as ApiResponseClass } from "../../../api-BJgcoGmU.mjs";
2
- import { t as get } from "../../../get-B9XztVOu.mjs";
3
- import { t as post } from "../../../post-DiwZvONk.mjs";
2
+ import { t as get } from "../../../get-fmxmkk1P.mjs";
3
+ import { t as post } from "../../../post-DLC6iSd9.mjs";
4
4
  import "../../../api/index.mjs";
5
5
  import { getCustomerId, getZone } from "../../server/index.mjs";
6
6
  //#region src/brightData/serpApi/server/brightDataSerpApi.ts
@@ -1,7 +1,7 @@
1
1
  import { sleep } from "../../../util/index.mjs";
2
2
  import { t as apiState } from "../../../api-BJgcoGmU.mjs";
3
- import { t as get } from "../../../get-B9XztVOu.mjs";
4
- import { t as post } from "../../../post-DiwZvONk.mjs";
3
+ import { t as get } from "../../../get-fmxmkk1P.mjs";
4
+ import { t as post } from "../../../post-DLC6iSd9.mjs";
5
5
  //#region src/brightData/webScraperIde/server/getBatch.ts
6
6
  /**
7
7
  * Depends on the Scraper setup!
@@ -1,15 +1,3 @@
1
- //#region src/crypto/server/getDecrypt.d.ts
2
- /**
3
- * Decrypt an encoding string using a salt.
4
- */
5
- declare const getDecrypt: (appSalt: string, input: string) => string;
6
- //#endregion
7
- //#region src/crypto/server/getEncrypt.d.ts
8
- /**
9
- * Encrypt an encoding string using a salt.
10
- */
11
- declare const getEncrypt: (appSalt: string, input: string) => string;
12
- //#endregion
13
1
  //#region src/crypto/server/getMd5.d.ts
14
2
  /**
15
3
  * Encrypt a string using md5.
@@ -28,4 +16,4 @@ declare const getRandom: (length: number) => string;
28
16
  */
29
17
  declare const getSha256: (input: any) => string;
30
18
  //#endregion
31
- export { getDecrypt, getEncrypt, getMd5, getRandom, getSha256 };
19
+ export { getMd5, getRandom, getSha256 };
@@ -1,24 +1,5 @@
1
1
  import { t as __require } from "../../chunk-y_GBKt04.mjs";
2
2
  import { getString } from "../../string/index.mjs";
3
- import * as crypto from "crypto";
4
- //#region src/crypto/server/getDecrypt.ts
5
- /**
6
- * Decrypt an encoding string using a salt.
7
- */
8
- const getDecrypt = (appSalt, input) => {
9
- const decipher = crypto.createDecipheriv("aes-256-ecb", appSalt, null);
10
- return decipher.update(input, "hex", "utf8") + decipher.final("utf8");
11
- };
12
- //#endregion
13
- //#region src/crypto/server/getEncrypt.ts
14
- /**
15
- * Encrypt an encoding string using a salt.
16
- */
17
- const getEncrypt = (appSalt, input) => {
18
- const cipher = crypto.createCipheriv("aes-256-ecb", appSalt, null);
19
- return cipher.update(input, "utf8", "hex") + cipher.final("hex");
20
- };
21
- //#endregion
22
3
  //#region src/crypto/server/getMd5.ts
23
4
  /**
24
5
  * Encrypt a string using md5.
@@ -47,4 +28,4 @@ const getSha256 = (input) => {
47
28
  return crypto.createHash("sha256").update(inputString).digest("hex");
48
29
  };
49
30
  //#endregion
50
- export { getDecrypt, getEncrypt, getMd5, getRandom, getSha256 };
31
+ export { getMd5, getRandom, getSha256 };
@@ -1,4 +1,4 @@
1
- import { t as post } from "../../post-DiwZvONk.mjs";
1
+ import { t as post } from "../../post-DLC6iSd9.mjs";
2
2
  import { ageGroups, devices, genders } from "../index.mjs";
3
3
  //#region src/eskimi/server/getAgeGroup.ts
4
4
  /**
@@ -1,10 +1,10 @@
1
1
  import { i as ApiResponseClass } from "./api-BJgcoGmU.mjs";
2
- import ky from "ky";
3
2
  //#region src/api/get.ts
4
3
  /**
5
4
  * Make a GET request.
6
5
  */
7
6
  const get = async (url, config = {}) => {
7
+ const { default: ky } = await import("ky");
8
8
  return await ky.get(url, {
9
9
  throwHttpErrors: false,
10
10
  ...config
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class/index.mjs";
2
- import { t as get } from "../../get-B9XztVOu.mjs";
2
+ import { t as get } from "../../get-fmxmkk1P.mjs";
3
3
  import { onePasswordClient } from "../../onePassword/server/index.mjs";
4
4
  //#region src/googlePageSpeed/server/GooglePageSpeedNamespace.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { t as get } from "../../get-B9XztVOu.mjs";
1
+ import { t as get } from "../../get-fmxmkk1P.mjs";
2
2
  import { z } from "zod/v4";
3
3
  //#region src/googleSearchIncidents/server/googleSearchIncidents.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { t as get } from "../../get-B9XztVOu.mjs";
1
+ import { t as get } from "../../get-fmxmkk1P.mjs";
2
2
  import { z } from "zod/v4";
3
3
  //#region src/greenDomain/server/greenDomain.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class/index.mjs";
2
- import { t as get } from "../../get-B9XztVOu.mjs";
2
+ import { t as get } from "../../get-fmxmkk1P.mjs";
3
3
  import { onePasswordClient } from "../../onePassword/server/index.mjs";
4
4
  //#region src/littleWarden/server/LittleWardenNamespace.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { t as get } from "../../../get-B9XztVOu.mjs";
2
- import { t as post } from "../../../post-DiwZvONk.mjs";
1
+ import { t as get } from "../../../get-fmxmkk1P.mjs";
2
+ import { t as post } from "../../../post-DLC6iSd9.mjs";
3
3
  //#region src/lumar/api/server/lumarApi.ts
4
4
  const operand = {
5
5
  EQUALS: "eql",
@@ -1,4 +1,4 @@
1
- import { t as post } from "../../../post-DiwZvONk.mjs";
1
+ import { t as post } from "../../../post-DLC6iSd9.mjs";
2
2
  //#region src/lumar/graphql/server/lumarGraphql.ts
3
3
  const operand = {
4
4
  CONTAINS: "contains",
@@ -1,4 +1,4 @@
1
- import { t as post } from "../../post-DiwZvONk.mjs";
1
+ import { t as post } from "../../post-DLC6iSd9.mjs";
2
2
  //#region src/myTarget/server/myTarget.ts
3
3
  /**
4
4
  * Make the request to MyTarget API using the access token.
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class/index.mjs";
2
- import { t as post } from "../../post-DiwZvONk.mjs";
2
+ import { t as post } from "../../post-DLC6iSd9.mjs";
3
3
  import { onePasswordClient } from "../../onePassword/server/index.mjs";
4
4
  //#region src/openAi/server/OpenAiNamespace.ts
5
5
  var OpenAiNamespace = class extends BaseNamespace {
@@ -1,10 +1,10 @@
1
1
  import { i as ApiResponseClass } from "./api-BJgcoGmU.mjs";
2
- import ky from "ky";
3
2
  //#region src/api/post.ts
4
3
  /**
5
4
  * Make a POST request.
6
5
  */
7
6
  const post = async (url, data = {}, config = {}) => {
7
+ const { default: ky } = await import("ky");
8
8
  return await ky.post(url, {
9
9
  throwHttpErrors: false,
10
10
  json: data,
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class/index.mjs";
2
- import { t as post } from "../../post-DiwZvONk.mjs";
2
+ import { t as post } from "../../post-DLC6iSd9.mjs";
3
3
  import { onePasswordClient } from "../../onePassword/server/index.mjs";
4
4
  import { DateTime } from "luxon";
5
5
  //#region src/snapchat/server/SnapchatNamespace.ts
@@ -1,5 +1,5 @@
1
1
  import { BaseNamespace } from "../../_class/index.mjs";
2
- import { t as post } from "../../post-DiwZvONk.mjs";
2
+ import { t as post } from "../../post-DLC6iSd9.mjs";
3
3
  import { onePasswordClient } from "../../onePassword/server/index.mjs";
4
4
  //#region src/upTimeRobot/server/UpTimeRobotNamespace.ts
5
5
  /**
@@ -1,5 +1,4 @@
1
1
  import { createDirectory } from "../../file/server/index.mjs";
2
- import ky from "ky";
3
2
  import { Readable } from "stream";
4
3
  //#region src/url/server/writeUrlContents.ts
5
4
  /**
@@ -8,6 +7,7 @@ import { Readable } from "stream";
8
7
  * Requires fs-extra
9
8
  */
10
9
  const writeUrlContents = async (filePath, url) => {
10
+ const { default: ky } = await import("ky");
11
11
  const fs = await import("fs-extra");
12
12
  await createDirectory(filePath);
13
13
  const writer = fs.createWriteStream(filePath);
@@ -1,4 +1,4 @@
1
- import { t as get } from "../../get-B9XztVOu.mjs";
1
+ import { t as get } from "../../get-fmxmkk1P.mjs";
2
2
  //#region src/xml/server/getXml.ts
3
3
  const getXml = async (url) => {
4
4
  let response = "";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "2.4.6",
4
+ "version": "2.4.8",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"