@8ms/helpers 2.3.46 → 2.3.48
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.
- package/dist/adverity/server/index.mjs +1 -1
- package/dist/api/index.d.mts +1 -1
- package/dist/api/index.mjs +1 -1
- package/dist/{api-DGKJDAfb.mjs → api-D7uUBIq4.mjs} +12 -0
- package/dist/aws/lambda/server/index.mjs +1 -1
- package/dist/axios/index.d.mts +1 -1
- package/dist/axios/index.mjs +1 -1
- package/dist/brightData/serpApi/server/index.d.mts +1 -1
- package/dist/brightData/serpApi/server/index.mjs +1 -1
- package/dist/brightData/webScraperIde/server/index.mjs +1 -1
- package/dist/date/index.mjs +5 -2
- package/dist/eskimi/server/index.mjs +1 -1
- package/dist/googlePageSpeed/server/index.mjs +1 -1
- package/dist/googleSearchIncidents/server/index.mjs +1 -1
- package/dist/greenDomain/server/index.mjs +1 -1
- package/dist/{index-DW9yJLtI.d.mts → index-c5HdwLaY.d.mts} +2 -0
- package/dist/littleWarden/server/index.mjs +1 -1
- package/dist/lumar/api/server/index.d.mts +1 -1
- package/dist/lumar/api/server/index.mjs +1 -1
- package/dist/lumar/graphql/server/index.d.mts +1 -1
- package/dist/lumar/graphql/server/index.mjs +1 -1
- package/dist/myTarget/server/index.d.mts +1 -1
- package/dist/myTarget/server/index.mjs +1 -1
- package/dist/openAi/server/index.mjs +1 -1
- package/dist/snapchat/server/index.mjs +1 -1
- package/dist/swr/client/index.d.mts +1 -1
- package/dist/upTimeRobot/server/index.mjs +1 -1
- package/dist/xml/server/index.mjs +1 -1
- package/package.json +1 -1
package/dist/api/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as isSuccess, c as ApiState, d as unexpectedError, f as ApiResponseClass, i as isPending, l as apiState, n as isError, o as isValidationError, r as isIdle, s as ApiResponse, t as isCancelled, u as defaultResponse } from "../index-
|
|
1
|
+
import { a as isSuccess, c as ApiState, d as unexpectedError, f as ApiResponseClass, i as isPending, l as apiState, n as isError, o as isValidationError, r as isIdle, s as ApiResponse, t as isCancelled, u as defaultResponse } from "../index-c5HdwLaY.mjs";
|
|
2
2
|
export { ApiResponse, ApiResponseClass, ApiState, apiState, defaultResponse, isCancelled, isError, isIdle, isPending, isSuccess, isValidationError, unexpectedError };
|
package/dist/api/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as isSuccess, c as defaultResponse, i as isPending, l as unexpectedError, n as isError, o as isValidationError, r as isIdle, s as apiState, t as isCancelled, u as ApiResponseClass } from "../api-
|
|
1
|
+
import { a as isSuccess, c as defaultResponse, i as isPending, l as unexpectedError, n as isError, o as isValidationError, r as isIdle, s as apiState, t as isCancelled, u as ApiResponseClass } from "../api-D7uUBIq4.mjs";
|
|
2
2
|
|
|
3
3
|
export { ApiResponseClass, apiState, defaultResponse, isCancelled, isError, isIdle, isPending, isSuccess, isValidationError, unexpectedError };
|
|
@@ -65,6 +65,18 @@ var ApiResponseClass = class ApiResponseClass {
|
|
|
65
65
|
this.state = apiState.ERROR;
|
|
66
66
|
return this;
|
|
67
67
|
};
|
|
68
|
+
setToZodSafeError = (zodResult, body) => {
|
|
69
|
+
let errors = [];
|
|
70
|
+
if (zodResult?.error?.issues) for (const singleError of zodResult.error.issues) {
|
|
71
|
+
const finalPath = singleError.path.map((singlePath) => singlePath.toString()).join(".");
|
|
72
|
+
errors.push(`${finalPath}: ${singleError.message}`);
|
|
73
|
+
}
|
|
74
|
+
else errors = ["An unexpected error occurred, please try again."];
|
|
75
|
+
this.body = body || null;
|
|
76
|
+
this.error = errors.join(", ");
|
|
77
|
+
this.state = apiState.ERROR;
|
|
78
|
+
return this;
|
|
79
|
+
};
|
|
68
80
|
setToSuccess = (body) => {
|
|
69
81
|
this.body = body;
|
|
70
82
|
this.state = apiState.SUCCESS;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../../_class/index.mjs";
|
|
2
|
-
import { u as ApiResponseClass } from "../../../api-
|
|
2
|
+
import { u as ApiResponseClass } from "../../../api-D7uUBIq4.mjs";
|
|
3
3
|
import { n as isResponse200, t as getConfig } from "../../../server-Bwy4JI8Z.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/aws/lambda/server/AwsLambdaNamespace.ts
|
package/dist/axios/index.d.mts
CHANGED
package/dist/axios/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sleep } from "../../../util/index.mjs";
|
|
2
|
-
import { s as apiState } from "../../../api-
|
|
2
|
+
import { s as apiState } from "../../../api-D7uUBIq4.mjs";
|
|
3
3
|
import { get, post } from "../../../axios/index.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/brightData/webScraperIde/server/getBatch.ts
|
package/dist/date/index.mjs
CHANGED
|
@@ -52,8 +52,11 @@ const getLuxonDate = (input, setMidnight) => {
|
|
|
52
52
|
} else if (input < 1e10) instance = DateTime.fromSeconds(input, { zone: "utc" });
|
|
53
53
|
else instance = DateTime.fromMillis(input, { zone: "utc" });
|
|
54
54
|
else {
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
const inputString = input.toString().toLowerCase();
|
|
56
|
+
instance = DateTime.fromISO(inputString, { zone: "utc" });
|
|
57
|
+
if (!instance.isValid) instance = DateTime.fromFormat(inputString, "yyyy-MM-dd HH:mm:ss", { zone: "utc" });
|
|
58
|
+
if (!instance.isValid) instance = DateTime.fromFormat(inputString, "yyyy MMMM dd", { zone: "utc" });
|
|
59
|
+
if (!instance.isValid) instance = DateTime.fromFormat(inputString, "yyyy-MMMM-dd", { zone: "utc" });
|
|
57
60
|
}
|
|
58
61
|
instance = instance.setZone("utc", { keepLocalTime: false });
|
|
59
62
|
if (setMidnight) instance = instance.set({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
|
+
import { ZodSafeParseResult } from "zod";
|
|
2
3
|
|
|
3
4
|
//#region src/api/ApiResponseClass.d.ts
|
|
4
5
|
type ConstructorProps = {
|
|
@@ -31,6 +32,7 @@ declare class ApiResponseClass<T = any, E = any> {
|
|
|
31
32
|
setToIdle: () => this;
|
|
32
33
|
setToPending: () => this;
|
|
33
34
|
setToError: (error: any, body?: any) => this;
|
|
35
|
+
setToZodSafeError: (zodResult: ZodSafeParseResult<any>, body?: any) => this;
|
|
34
36
|
setToSuccess: (body: any) => this;
|
|
35
37
|
setBody: (body: any) => this;
|
|
36
38
|
setError: (error: any) => this;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../_class/index.mjs";
|
|
2
|
-
import "../../api-
|
|
2
|
+
import "../../api-D7uUBIq4.mjs";
|
|
3
3
|
import { post } from "../../axios/index.mjs";
|
|
4
4
|
import { onePasswordClient } from "../../onePassword/server/index.mjs";
|
|
5
5
|
import { DateTime } from "luxon";
|