@8ms/helpers 2.3.49 → 2.4.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.
- package/dist/_class/index.d.mts +1 -1
- package/dist/_class/index.mjs +1 -4
- package/dist/adverity/index.d.mts +1 -1
- package/dist/adverity/index.mjs +1 -3
- package/dist/adverity/server/index.d.mts +2 -2
- package/dist/adverity/server/index.mjs +2 -5
- package/dist/api/index.d.mts +3 -2
- package/dist/api/index.mjs +44 -3
- package/dist/{api-D7uUBIq4.mjs → api-BJgcoGmU.mjs} +1 -25
- package/dist/{index-c5HdwLaY.d.mts → api-DoLMPDFM.d.mts} +1 -9
- package/dist/array/index.mjs +1 -2
- package/dist/atInternet/index.mjs +1 -3
- package/dist/aws/cloudWatchLog/server/index.d.mts +8 -8
- package/dist/aws/cloudWatchLog/server/index.mjs +2 -6
- package/dist/aws/cloudWatchMetric/server/index.d.mts +5 -5
- package/dist/aws/cloudWatchMetric/server/index.mjs +2 -5
- package/dist/aws/ec2/server/index.d.mts +5 -5
- package/dist/aws/ec2/server/index.mjs +2 -5
- package/dist/aws/ecs/server/index.d.mts +2 -2
- package/dist/aws/ecs/server/index.mjs +2 -5
- package/dist/aws/glue/server/index.d.mts +2 -2
- package/dist/aws/glue/server/index.mjs +2 -5
- package/dist/aws/lambda/server/index.d.mts +2 -2
- package/dist/aws/lambda/server/index.mjs +4 -6
- package/dist/aws/s3/server/index.d.mts +10 -10
- package/dist/aws/s3/server/index.mjs +28 -37
- package/dist/aws/server/index.d.mts +1 -1
- package/dist/aws/server/index.mjs +2 -3
- package/dist/aws/ses/server/index.d.mts +8 -8
- package/dist/aws/ses/server/index.mjs +2 -6
- package/dist/aws/sqs/server/index.d.mts +5 -5
- package/dist/aws/sqs/server/index.mjs +2 -5
- package/dist/aws/ssm/server/index.d.mts +2 -2
- package/dist/aws/ssm/server/index.mjs +2 -5
- package/dist/boolean/index.mjs +1 -2
- package/dist/brightData/serpApi/server/index.d.mts +3 -3
- package/dist/brightData/serpApi/server/index.mjs +5 -10
- package/dist/brightData/server/index.d.mts +1 -1
- package/dist/brightData/server/index.mjs +1 -2
- package/dist/brightData/webScraperIde/server/index.d.mts +1 -1
- package/dist/brightData/webScraperIde/server/index.mjs +4 -6
- package/dist/cache/server/index.mjs +1 -2
- package/dist/{chunk-DDarj8oW.mjs → chunk-y_GBKt04.mjs} +1 -3
- package/dist/crud/index.mjs +1 -2
- package/dist/crypto/server/index.mjs +2 -8
- package/dist/date/index.d.mts +1 -1
- package/dist/date/index.mjs +2 -7
- package/dist/drizzle/server/index.d.mts +1 -1
- package/dist/drizzle/server/index.mjs +1 -4
- package/dist/environment/index.mjs +1 -2
- package/dist/eskimi/index.mjs +1 -3
- package/dist/eskimi/server/index.mjs +2 -8
- package/dist/file/index.mjs +1 -3
- package/dist/file/server/index.mjs +1 -2
- package/dist/geo/index.mjs +1 -3
- package/dist/get-B9XztVOu.mjs +21 -0
- package/dist/{getDecimal-CafxtLhH.mjs → getDecimal-B9S_nqSJ.mjs} +1 -4
- package/dist/googleAds/keywordPlanner/server/index.mjs +1 -3
- package/dist/googleAds/server/index.d.mts +7 -5
- package/dist/googleAds/server/index.mjs +5 -9
- package/dist/googleCloud/bigquery/server/index.d.mts +4 -4
- package/dist/googleCloud/bigquery/server/index.mjs +1 -5
- package/dist/googleCloud/server/index.d.mts +1 -1
- package/dist/googleCloud/server/index.mjs +1 -2
- package/dist/googleCloud/sheets/server/index.d.mts +4 -4
- package/dist/googleCloud/sheets/server/index.mjs +1 -3
- package/dist/googleCloud/storage/server/index.d.mts +5 -5
- package/dist/googleCloud/storage/server/index.mjs +1 -4
- package/dist/googlePageSpeed/server/index.d.mts +1 -1
- package/dist/googlePageSpeed/server/index.mjs +2 -6
- package/dist/googleSearchIncidents/server/index.mjs +2 -5
- package/dist/greenDomain/server/index.mjs +2 -5
- package/dist/{index-1fBbJGQz.d.mts → index-BAU-daxD.d.mts} +12 -12
- package/dist/index-BlUxbvhl.d.mts +30 -0
- package/dist/inngest/index.mjs +1 -2
- package/dist/json/index.mjs +1 -4
- package/dist/littleWarden/server/index.d.mts +1 -1
- package/dist/littleWarden/server/index.mjs +2 -7
- package/dist/lodash/index.d.mts +11 -1
- package/dist/lodash/index.mjs +17 -15
- package/dist/lumar/api/server/index.d.mts +1 -2
- package/dist/lumar/api/server/index.mjs +3 -8
- package/dist/lumar/graphql/server/index.d.mts +1 -2
- package/dist/lumar/graphql/server/index.mjs +2 -9
- package/dist/myTarget/server/index.d.mts +1 -1
- package/dist/myTarget/server/index.mjs +2 -5
- package/dist/nextAuth/index.mjs +1 -3
- package/dist/nextJs/client/index.mjs +1 -3
- package/dist/nextJs/index.mjs +1 -2
- package/dist/number/index.mjs +2 -9
- package/dist/object/index.mjs +1 -2
- package/dist/onePassword/server/index.d.mts +7 -7
- package/dist/onePassword/server/index.mjs +1 -5
- package/dist/openAi/server/index.d.mts +1 -1
- package/dist/openAi/server/index.mjs +2 -6
- package/dist/post-DiwZvONk.mjs +22 -0
- package/dist/prisma/index.mjs +2 -4
- package/dist/prisma/server/index.d.mts +1 -1
- package/dist/prisma/server/index.mjs +1 -4
- package/dist/{server-Bwy4JI8Z.mjs → server-CCX9gh5k.mjs} +1 -4
- package/dist/snapchat/server/index.d.mts +1 -1
- package/dist/snapchat/server/index.mjs +2 -6
- package/dist/sorting/index.mjs +1 -5
- package/dist/stream/server/index.mjs +2 -4
- package/dist/string/index.d.mts +1 -1
- package/dist/string/index.mjs +1 -15
- package/dist/swr/client/index.d.mts +1 -2
- package/dist/swr/client/index.mjs +1 -2
- package/dist/upTimeRobot/server/index.d.mts +1 -1
- package/dist/upTimeRobot/server/index.mjs +2 -6
- package/dist/url/index.mjs +1 -3
- package/dist/url/server/index.mjs +15 -20
- package/dist/util/index.d.mts +1 -1
- package/dist/util/index.mjs +1 -10
- package/dist/util/server/index.mjs +1 -6
- package/dist/webWorker/index.mjs +1 -2
- package/dist/xml/server/index.mjs +2 -5
- package/package.json +34 -45
- package/dist/axios/index.d.mts +0 -22
- package/dist/axios/index.mjs +0 -50
- /package/dist/{index-DwB8X1lz.d.mts → index-1SE8er2n.d.mts} +0 -0
- /package/dist/{index-BHuvb_7y.d.mts → index-CXrNMYVx.d.mts} +0 -0
- /package/dist/{index-CqTOMR8f.d.mts → index-D-8_Li4c.d.mts} +0 -0
- /package/dist/{index-DDH4qfj3.d.mts → index-DVYYb5tw.d.mts} +0 -0
- /package/dist/{index-DInsoSQm.d.mts → index-DwYd5z_c.d.mts} +0 -0
package/dist/lodash/index.mjs
CHANGED
|
@@ -4,11 +4,25 @@ const chunk = (array, size) => {
|
|
|
4
4
|
for (let i = 0; i < array.length; i += size) result.push(array.slice(i, i + size));
|
|
5
5
|
return result;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/lodash/findKey.ts
|
|
9
|
+
/**
|
|
10
|
+
* Finds the first key in an object that satisfies the provided predicate function.
|
|
11
|
+
*
|
|
12
|
+
* @param object - The object to inspect.
|
|
13
|
+
* @param predicate - The function invoked per iteration (value, key, object).
|
|
14
|
+
* @returns The key of the matched element, else undefined.
|
|
15
|
+
*/
|
|
16
|
+
const findKey = (object, predicate) => {
|
|
17
|
+
if (object == null) return;
|
|
18
|
+
for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
19
|
+
const value = object[key];
|
|
20
|
+
if (predicate(value, key, object)) return key;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
8
23
|
//#endregion
|
|
9
24
|
//#region src/lodash/flatten.ts
|
|
10
25
|
const flatten = (array) => [].concat(...array);
|
|
11
|
-
|
|
12
26
|
//#endregion
|
|
13
27
|
//#region src/lodash/set.ts
|
|
14
28
|
const set = (obj, path, value) => {
|
|
@@ -25,7 +39,6 @@ const set = (obj, path, value) => {
|
|
|
25
39
|
current[keys[keys.length - 1]] = value;
|
|
26
40
|
return obj;
|
|
27
41
|
};
|
|
28
|
-
|
|
29
42
|
//#endregion
|
|
30
43
|
//#region src/lodash/trim.ts
|
|
31
44
|
const trim = (str, chars) => {
|
|
@@ -34,13 +47,11 @@ const trim = (str, chars) => {
|
|
|
34
47
|
const pattern = new RegExp(`^[${escaped}]+|[${escaped}]+$`, "g");
|
|
35
48
|
return str.replace(pattern, "");
|
|
36
49
|
};
|
|
37
|
-
|
|
38
50
|
//#endregion
|
|
39
51
|
//#region src/lodash/isDate.ts
|
|
40
52
|
const isDate = (value) => {
|
|
41
53
|
return value instanceof Date && !isNaN(value.getTime());
|
|
42
54
|
};
|
|
43
|
-
|
|
44
55
|
//#endregion
|
|
45
56
|
//#region src/lodash/isEmpty.ts
|
|
46
57
|
const isEmpty = (value) => {
|
|
@@ -51,7 +62,6 @@ const isEmpty = (value) => {
|
|
|
51
62
|
if (typeof value === "object") return Object.keys(value).length === 0;
|
|
52
63
|
return true;
|
|
53
64
|
};
|
|
54
|
-
|
|
55
65
|
//#endregion
|
|
56
66
|
//#region src/lodash/isEqual.ts
|
|
57
67
|
const isEqual = (a, b) => {
|
|
@@ -83,18 +93,15 @@ const isEqual = (a, b) => {
|
|
|
83
93
|
}
|
|
84
94
|
return false;
|
|
85
95
|
};
|
|
86
|
-
|
|
87
96
|
//#endregion
|
|
88
97
|
//#region src/lodash/isFunction.ts
|
|
89
98
|
const isFunction = (value) => typeof value === "function";
|
|
90
|
-
|
|
91
99
|
//#endregion
|
|
92
100
|
//#region src/lodash/isObject.ts
|
|
93
101
|
const isObject = (value) => {
|
|
94
102
|
const type = typeof value;
|
|
95
103
|
return value != null && (type === "object" || type === "function");
|
|
96
104
|
};
|
|
97
|
-
|
|
98
105
|
//#endregion
|
|
99
106
|
//#region src/lodash/merge.ts
|
|
100
107
|
const merge = (target, ...sources) => {
|
|
@@ -114,7 +121,6 @@ const merge = (target, ...sources) => {
|
|
|
114
121
|
}
|
|
115
122
|
return target;
|
|
116
123
|
};
|
|
117
|
-
|
|
118
124
|
//#endregion
|
|
119
125
|
//#region src/lodash/orderBy.ts
|
|
120
126
|
const orderBy = (collection, iteratees, orders = "asc") => {
|
|
@@ -139,7 +145,6 @@ const orderBy = (collection, iteratees, orders = "asc") => {
|
|
|
139
145
|
return 0;
|
|
140
146
|
});
|
|
141
147
|
};
|
|
142
|
-
|
|
143
148
|
//#endregion
|
|
144
149
|
//#region src/lodash/unescape.ts
|
|
145
150
|
const unescape = (str) => {
|
|
@@ -152,11 +157,9 @@ const unescape = (str) => {
|
|
|
152
157
|
};
|
|
153
158
|
return str.replace(/&(?:amp|lt|gt|quot|#39);/g, (match) => htmlEntities[match]);
|
|
154
159
|
};
|
|
155
|
-
|
|
156
160
|
//#endregion
|
|
157
161
|
//#region src/lodash/uniq.ts
|
|
158
162
|
const uniq = (arr) => [...new Set(arr)];
|
|
159
|
-
|
|
160
163
|
//#endregion
|
|
161
164
|
//#region src/lodash/uniqBy.ts
|
|
162
165
|
const uniqBy = (collection, iteratee) => {
|
|
@@ -172,6 +175,5 @@ const uniqBy = (collection, iteratee) => {
|
|
|
172
175
|
return true;
|
|
173
176
|
});
|
|
174
177
|
};
|
|
175
|
-
|
|
176
178
|
//#endregion
|
|
177
|
-
export { chunk, flatten, isDate, isEmpty, isEqual, isFunction, isObject, merge, orderBy, set, trim, unescape, uniq, uniqBy };
|
|
179
|
+
export { chunk, findKey, flatten, isDate, isEmpty, isEqual, isFunction, isObject, merge, orderBy, set, trim, unescape, uniq, uniqBy };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import "../../../
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { t as get } from "../../../get-B9XztVOu.mjs";
|
|
2
|
+
import { t as post } from "../../../post-DiwZvONk.mjs";
|
|
4
3
|
//#region src/lumar/api/server/lumarApi.ts
|
|
5
4
|
const operand = {
|
|
6
5
|
EQUALS: "eql",
|
|
@@ -26,7 +25,6 @@ const report = {
|
|
|
26
25
|
REPORT_STATISTICS: "report_statistics",
|
|
27
26
|
REPORT_SUMMARY: "report_summary"
|
|
28
27
|
};
|
|
29
|
-
|
|
30
28
|
//#endregion
|
|
31
29
|
//#region src/lumar/api/server/buildRequest.ts
|
|
32
30
|
const buildRequest = (props) => {
|
|
@@ -82,13 +80,11 @@ const buildRequest = (props) => {
|
|
|
82
80
|
}
|
|
83
81
|
return url;
|
|
84
82
|
};
|
|
85
|
-
|
|
86
83
|
//#endregion
|
|
87
84
|
//#region src/lumar/api/server/getData.ts
|
|
88
85
|
const getData = async (url, accessToken) => {
|
|
89
86
|
return await get(url, { headers: { "X-AUTH-TOKEN": accessToken } });
|
|
90
87
|
};
|
|
91
|
-
|
|
92
88
|
//#endregion
|
|
93
89
|
//#region src/lumar/api/server/initClient.ts
|
|
94
90
|
const lumarApis = /* @__PURE__ */ new Map();
|
|
@@ -106,6 +102,5 @@ const initClient = async (apiId, apiKey) => {
|
|
|
106
102
|
lumarApis.set(apiId, token);
|
|
107
103
|
return token;
|
|
108
104
|
};
|
|
109
|
-
|
|
110
105
|
//#endregion
|
|
111
|
-
export { buildRequest, getData, initClient, operand, order, report };
|
|
106
|
+
export { buildRequest, getData, initClient, operand, order, report };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import "../../../
|
|
2
|
-
import { post } from "../../../axios/index.mjs";
|
|
3
|
-
|
|
1
|
+
import { t as post } from "../../../post-DiwZvONk.mjs";
|
|
4
2
|
//#region src/lumar/graphql/server/lumarGraphql.ts
|
|
5
3
|
const operand = {
|
|
6
4
|
CONTAINS: "contains",
|
|
@@ -29,7 +27,6 @@ const reportType = {
|
|
|
29
27
|
const getReportKey = (templateCode, typeCode) => {
|
|
30
28
|
return `${templateCode}-${typeCode}`.toLowerCase();
|
|
31
29
|
};
|
|
32
|
-
|
|
33
30
|
//#endregion
|
|
34
31
|
//#region src/lumar/graphql/server/columns.ts
|
|
35
32
|
const column = {
|
|
@@ -60,7 +57,6 @@ const column = {
|
|
|
60
57
|
URL_TO: "urlTo",
|
|
61
58
|
URL_TO_STATUS_CODE: "urlToStatusCode"
|
|
62
59
|
};
|
|
63
|
-
|
|
64
60
|
//#endregion
|
|
65
61
|
//#region src/lumar/graphql/server/getData.ts
|
|
66
62
|
const getData = async (query, variables, accessToken) => {
|
|
@@ -73,7 +69,6 @@ const getData = async (query, variables, accessToken) => {
|
|
|
73
69
|
variables
|
|
74
70
|
}, { headers: { "x-auth-token": accessToken } });
|
|
75
71
|
};
|
|
76
|
-
|
|
77
72
|
//#endregion
|
|
78
73
|
//#region src/lumar/graphql/server/initClient.ts
|
|
79
74
|
const lumarGraphQls = /* @__PURE__ */ new Map();
|
|
@@ -97,7 +92,6 @@ const initClient = async (id, secret) => {
|
|
|
97
92
|
lumarGraphQls.set(id, token);
|
|
98
93
|
return token;
|
|
99
94
|
};
|
|
100
|
-
|
|
101
95
|
//#endregion
|
|
102
96
|
//#region src/lumar/graphql/server/reportTemplates.ts
|
|
103
97
|
const reportTemplate = {
|
|
@@ -167,6 +161,5 @@ const reportTemplate = {
|
|
|
167
161
|
UNIQUE_INTERNAL_LINKS: "unique_internal_links",
|
|
168
162
|
XML_SITEMAPS: "xml_sitemaps"
|
|
169
163
|
};
|
|
170
|
-
|
|
171
164
|
//#endregion
|
|
172
|
-
export { column, getData, getReportKey, initClient, operand, reportTemplate, reportType };
|
|
165
|
+
export { column, getData, getReportKey, initClient, operand, reportTemplate, reportType };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import { post } from "../../axios/index.mjs";
|
|
3
|
-
|
|
1
|
+
import { t as post } from "../../post-DiwZvONk.mjs";
|
|
4
2
|
//#region src/myTarget/server/myTarget.ts
|
|
5
3
|
/**
|
|
6
4
|
* Make the request to MyTarget API using the access token.
|
|
@@ -11,6 +9,5 @@ const request = async (data, url, accessToken) => {
|
|
|
11
9
|
"Content-Type": "application/json"
|
|
12
10
|
} });
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
//#endregion
|
|
16
|
-
export { request };
|
|
13
|
+
export { request };
|
package/dist/nextAuth/index.mjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
const isSessionReady = (session) => {
|
|
3
3
|
return null !== session?.user;
|
|
4
4
|
};
|
|
5
|
-
|
|
6
5
|
//#endregion
|
|
7
6
|
//#region src/nextAuth/nextAuth.ts
|
|
8
7
|
const NextAuthState = {
|
|
@@ -10,6 +9,5 @@ const NextAuthState = {
|
|
|
10
9
|
PENDING: "loading",
|
|
11
10
|
UNAUTHENTICATED: "unauthenticated"
|
|
12
11
|
};
|
|
13
|
-
|
|
14
12
|
//#endregion
|
|
15
|
-
export { NextAuthState, isSessionReady };
|
|
13
|
+
export { NextAuthState, isSessionReady };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { useInView } from "react-intersection-observer";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/nextJs/client/LazyLoad.tsx
|
|
5
4
|
const LazyLoad = (props) => {
|
|
6
5
|
const { children, ...propsRest } = props;
|
|
7
6
|
const { ref, inView } = useInView(propsRest);
|
|
8
7
|
return /* @__PURE__ */ React.createElement("div", { ref }, inView && children);
|
|
9
8
|
};
|
|
10
|
-
|
|
11
9
|
//#endregion
|
|
12
|
-
export { LazyLoad };
|
|
10
|
+
export { LazyLoad };
|
package/dist/nextJs/index.mjs
CHANGED
|
@@ -7,6 +7,5 @@ const getIp = ({ req }) => String(req.headers?.["x-real-ip"] || "unset");
|
|
|
7
7
|
* Get the user's User Agent
|
|
8
8
|
*/
|
|
9
9
|
const getUserAgent = ({ req }) => String(req.headers["user-agent"] || "unset");
|
|
10
|
-
|
|
11
10
|
//#endregion
|
|
12
|
-
export { getIp, getUserAgent };
|
|
11
|
+
export { getIp, getUserAgent };
|
package/dist/number/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { n as getNumber, t as getDecimal } from "../getDecimal-
|
|
2
|
-
|
|
1
|
+
import { n as getNumber, t as getDecimal } from "../getDecimal-B9S_nqSJ.mjs";
|
|
3
2
|
//#region src/number/formatCompact.ts
|
|
4
3
|
/**
|
|
5
4
|
* Take a given number and format as a compact number.
|
|
@@ -12,7 +11,6 @@ const formatCompact = (input, minDp, maxDp) => {
|
|
|
12
11
|
notation: "compact"
|
|
13
12
|
}).format(inputValue);
|
|
14
13
|
};
|
|
15
|
-
|
|
16
14
|
//#endregion
|
|
17
15
|
//#region src/number/formatCurrency.ts
|
|
18
16
|
/**
|
|
@@ -31,7 +29,6 @@ const formatCurrency = (input, currency = "GBP", minDp, maxDp) => {
|
|
|
31
29
|
if ("USD" === currencyClean) formatted = formatted.replace("US$", "$");
|
|
32
30
|
return formatted;
|
|
33
31
|
};
|
|
34
|
-
|
|
35
32
|
//#endregion
|
|
36
33
|
//#region src/number/formatStandard.ts
|
|
37
34
|
/**
|
|
@@ -45,7 +42,6 @@ const formatStandard = (input, minDp, maxDp) => {
|
|
|
45
42
|
notation: "standard"
|
|
46
43
|
}).format(inputValue);
|
|
47
44
|
};
|
|
48
|
-
|
|
49
45
|
//#endregion
|
|
50
46
|
//#region src/number/getSafeDivide.ts
|
|
51
47
|
/**
|
|
@@ -58,7 +54,6 @@ const getSafeDivide = (props) => {
|
|
|
58
54
|
if (divisorInt === 0 || !Number.isFinite(divisorInt)) return props?.defaultValue ?? 0;
|
|
59
55
|
return getDecimal(numeratorInt / divisorInt, props?.dp);
|
|
60
56
|
};
|
|
61
|
-
|
|
62
57
|
//#endregion
|
|
63
58
|
//#region src/number/getPercent.ts
|
|
64
59
|
const getPercent = (numerator, divisor, dp) => {
|
|
@@ -71,7 +66,6 @@ const getPercent = (numerator, divisor, dp) => {
|
|
|
71
66
|
divisor: finalDivisor
|
|
72
67
|
}) * 100).toFixed(finalDp));
|
|
73
68
|
};
|
|
74
|
-
|
|
75
69
|
//#endregion
|
|
76
70
|
//#region src/number/getPercentIncrease.ts
|
|
77
71
|
/**
|
|
@@ -83,6 +77,5 @@ const getPercentIncrease = (current, comparison, defaultValue) => {
|
|
|
83
77
|
if (0 === comparisonValue) return defaultValue;
|
|
84
78
|
return (currentValue - comparisonValue) / comparisonValue * 100;
|
|
85
79
|
};
|
|
86
|
-
|
|
87
80
|
//#endregion
|
|
88
|
-
export { formatCompact, formatCurrency, formatStandard, getDecimal, getNumber, getPercent, getPercentIncrease, getSafeDivide };
|
|
81
|
+
export { formatCompact, formatCurrency, formatStandard, getDecimal, getNumber, getPercent, getPercentIncrease, getSafeDivide };
|
package/dist/object/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BaseNamespace } from "../../index-
|
|
2
|
-
import * as _1password_sdk0 from "@1password/sdk";
|
|
1
|
+
import { t as BaseNamespace } from "../../index-1SE8er2n.mjs";
|
|
2
|
+
import * as _$_1password_sdk0 from "@1password/sdk";
|
|
3
3
|
import { Client } from "@1password/sdk";
|
|
4
4
|
|
|
5
5
|
//#region src/onePassword/server/getIdsFromUrl.d.ts
|
|
@@ -8,8 +8,8 @@ import { Client } from "@1password/sdk";
|
|
|
8
8
|
* Eg. https://start.1password.com/open/i?a=AAA&v=VVV&i=III&h=HHH would return vaultId = VVV and itemId = III.
|
|
9
9
|
*/
|
|
10
10
|
declare const getIdsFromUrl: (url: string) => {
|
|
11
|
-
vaultId: string;
|
|
12
|
-
itemId: string;
|
|
11
|
+
vaultId: string | null;
|
|
12
|
+
itemId: string | null;
|
|
13
13
|
};
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/onePassword/server/OnePasswordNamespace.d.ts
|
|
@@ -17,10 +17,10 @@ declare class OnePasswordNamespace extends BaseNamespace {
|
|
|
17
17
|
client: Client;
|
|
18
18
|
config: OnePasswordConfig;
|
|
19
19
|
ensureInit: () => Promise<void>;
|
|
20
|
-
listVaults: () => Promise<_1password_sdk0.VaultOverview[]>;
|
|
21
|
-
getItem: (vaultId: string, itemId: string) => Promise<_1password_sdk0.Item>;
|
|
20
|
+
listVaults: () => Promise<_$_1password_sdk0.VaultOverview[]>;
|
|
21
|
+
getItem: (vaultId: string, itemId: string) => Promise<_$_1password_sdk0.Item>;
|
|
22
22
|
getJsonNote: (vaultId: string, itemId: string) => Promise<any>;
|
|
23
|
-
listItems: (vaultId: string) => Promise<_1password_sdk0.ItemOverview[]>;
|
|
23
|
+
listItems: (vaultId: string) => Promise<_$_1password_sdk0.ItemOverview[]>;
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/onePassword/server/onePassword.d.ts
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../_class/index.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/onePassword/server/getIdsFromUrl.ts
|
|
4
3
|
/**
|
|
5
4
|
* Return the vault ID and item ID from an internal secret URL.
|
|
@@ -12,7 +11,6 @@ const getIdsFromUrl = (url) => {
|
|
|
12
11
|
itemId: parsedUrl.searchParams.get("i")
|
|
13
12
|
};
|
|
14
13
|
};
|
|
15
|
-
|
|
16
14
|
//#endregion
|
|
17
15
|
//#region src/onePassword/server/OnePasswordNamespace.ts
|
|
18
16
|
var OnePasswordNamespace = class extends BaseNamespace {
|
|
@@ -47,7 +45,6 @@ var OnePasswordNamespace = class extends BaseNamespace {
|
|
|
47
45
|
return this.client.items.list(vaultId);
|
|
48
46
|
};
|
|
49
47
|
};
|
|
50
|
-
|
|
51
48
|
//#endregion
|
|
52
49
|
//#region src/onePassword/server/onePassword.ts
|
|
53
50
|
const onePasswordNamespaces = /* @__PURE__ */ new Map();
|
|
@@ -59,6 +56,5 @@ const onePasswordClient = async (key = "default", config) => {
|
|
|
59
56
|
onePasswordNamespaces.set(key, namespace);
|
|
60
57
|
return namespace;
|
|
61
58
|
};
|
|
62
|
-
|
|
63
59
|
//#endregion
|
|
64
|
-
export { OnePasswordNamespace, getIdsFromUrl, onePasswordClient };
|
|
60
|
+
export { OnePasswordNamespace, getIdsFromUrl, onePasswordClient };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../_class/index.mjs";
|
|
2
|
-
import "../../
|
|
3
|
-
import { post } from "../../axios/index.mjs";
|
|
2
|
+
import { t as post } from "../../post-DiwZvONk.mjs";
|
|
4
3
|
import { onePasswordClient } from "../../onePassword/server/index.mjs";
|
|
5
|
-
|
|
6
4
|
//#region src/openAi/server/OpenAiNamespace.ts
|
|
7
5
|
var OpenAiNamespace = class extends BaseNamespace {
|
|
8
6
|
/**
|
|
@@ -26,7 +24,6 @@ var OpenAiNamespace = class extends BaseNamespace {
|
|
|
26
24
|
return response;
|
|
27
25
|
};
|
|
28
26
|
};
|
|
29
|
-
|
|
30
27
|
//#endregion
|
|
31
28
|
//#region src/openAi/server/openAi.ts
|
|
32
29
|
const openAiNamespaces = /* @__PURE__ */ new Map();
|
|
@@ -41,6 +38,5 @@ const openAiClient = async (key = "default", config, vaultId, itemId) => {
|
|
|
41
38
|
openAiNamespaces.set(key, namespace);
|
|
42
39
|
return namespace;
|
|
43
40
|
};
|
|
44
|
-
|
|
45
41
|
//#endregion
|
|
46
|
-
export { OpenAiNamespace, openAiClient };
|
|
42
|
+
export { OpenAiNamespace, openAiClient };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { i as ApiResponseClass } from "./api-BJgcoGmU.mjs";
|
|
2
|
+
import ky from "ky";
|
|
3
|
+
//#region src/api/post.ts
|
|
4
|
+
/**
|
|
5
|
+
* Make a POST request.
|
|
6
|
+
*/
|
|
7
|
+
const post = async (url, data = {}, config = {}) => {
|
|
8
|
+
return await ky.post(url, {
|
|
9
|
+
throwHttpErrors: false,
|
|
10
|
+
json: data,
|
|
11
|
+
...config
|
|
12
|
+
}).then(async (response) => {
|
|
13
|
+
const responseData = await response.json();
|
|
14
|
+
if (void 0 !== responseData.body && void 0 !== responseData.error && void 0 !== responseData.state) return new ApiResponseClass(responseData);
|
|
15
|
+
else if (response.status >= 200 && response.status <= 299) return new ApiResponseClass().setToSuccess(responseData);
|
|
16
|
+
return new ApiResponseClass().setToError(responseData, response.statusText);
|
|
17
|
+
}).catch((error) => {
|
|
18
|
+
return new ApiResponseClass().setToError(null, error.message);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { post as t };
|
package/dist/prisma/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as getDecimal$1 } from "../getDecimal-
|
|
2
|
-
|
|
1
|
+
import { t as getDecimal$1 } from "../getDecimal-B9S_nqSJ.mjs";
|
|
3
2
|
//#region src/prisma/getDecimal.ts
|
|
4
3
|
/**
|
|
5
4
|
* Fetch the number from a prisma decimal (comes through as an object).
|
|
@@ -10,6 +9,5 @@ const getDecimal = (input, dp = 2) => {
|
|
|
10
9
|
else numberString = input.toString();
|
|
11
10
|
return getDecimal$1(numberString, dp);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
12
|
//#endregion
|
|
15
|
-
export { getDecimal };
|
|
13
|
+
export { getDecimal };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getError } from "../../util/index.mjs";
|
|
2
2
|
import { BaseNamespace } from "../../_class/index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/prisma/server/PrismaNamespace.ts
|
|
5
4
|
var PrismaNamespace = class extends BaseNamespace {
|
|
6
5
|
ensureInit = async () => {
|
|
@@ -40,7 +39,6 @@ var PrismaNamespace = class extends BaseNamespace {
|
|
|
40
39
|
}
|
|
41
40
|
};
|
|
42
41
|
};
|
|
43
|
-
|
|
44
42
|
//#endregion
|
|
45
43
|
//#region src/prisma/server/prisma.ts
|
|
46
44
|
const prismaNamespaces = /* @__PURE__ */ new Map();
|
|
@@ -59,6 +57,5 @@ const prismaClient = async (key = "default", config) => {
|
|
|
59
57
|
prismaNamespaces.set(key, namespace);
|
|
60
58
|
return namespace;
|
|
61
59
|
};
|
|
62
|
-
|
|
63
60
|
//#endregion
|
|
64
|
-
export { PrismaNamespace, prismaClient };
|
|
61
|
+
export { PrismaNamespace, prismaClient };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { defaultTo } from "./util/index.mjs";
|
|
2
2
|
import { onePasswordClient } from "./onePassword/server/index.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/aws/server/isResponse200.ts
|
|
5
4
|
/**
|
|
6
5
|
* Was the API response a 200?
|
|
@@ -10,7 +9,6 @@ const isResponse200 = (apiResponse) => {
|
|
|
10
9
|
if (200 === defaultTo(apiResponse, ["$metadata", "httpStatusCode"], 0)) response = true;
|
|
11
10
|
return response;
|
|
12
11
|
};
|
|
13
|
-
|
|
14
12
|
//#endregion
|
|
15
13
|
//#region src/aws/server/aws.ts
|
|
16
14
|
const getConfig = async (key, config, vaultId, itemId) => {
|
|
@@ -28,6 +26,5 @@ const getConfig = async (key, config, vaultId, itemId) => {
|
|
|
28
26
|
else throw new Error(`Config required for namespace '${key}'`);
|
|
29
27
|
return response;
|
|
30
28
|
};
|
|
31
|
-
|
|
32
29
|
//#endregion
|
|
33
|
-
export { isResponse200 as n, getConfig as t };
|
|
30
|
+
export { isResponse200 as n, getConfig as t };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../_class/index.mjs";
|
|
2
|
-
import "../../
|
|
3
|
-
import { post } from "../../axios/index.mjs";
|
|
2
|
+
import { t as post } from "../../post-DiwZvONk.mjs";
|
|
4
3
|
import { onePasswordClient } from "../../onePassword/server/index.mjs";
|
|
5
4
|
import { DateTime } from "luxon";
|
|
6
|
-
|
|
7
5
|
//#region src/snapchat/server/SnapchatNamespace.ts
|
|
8
6
|
var SnapchatNamespace = class extends BaseNamespace {
|
|
9
7
|
/**
|
|
@@ -19,7 +17,6 @@ var SnapchatNamespace = class extends BaseNamespace {
|
|
|
19
17
|
}
|
|
20
18
|
};
|
|
21
19
|
};
|
|
22
|
-
|
|
23
20
|
//#endregion
|
|
24
21
|
//#region src/snapchat/server/snapchat.ts
|
|
25
22
|
const snapchatNamespaces = /* @__PURE__ */ new Map();
|
|
@@ -34,6 +31,5 @@ const snapchatClient = async (key = "default", config, vaultId, itemId) => {
|
|
|
34
31
|
snapchatNamespaces.set(key, namespace);
|
|
35
32
|
return namespace;
|
|
36
33
|
};
|
|
37
|
-
|
|
38
34
|
//#endregion
|
|
39
|
-
export { SnapchatNamespace, snapchatClient };
|
|
35
|
+
export { SnapchatNamespace, snapchatClient };
|
package/dist/sorting/index.mjs
CHANGED
|
@@ -10,7 +10,6 @@ const byNumberAscending = (valueA, valueB) => {
|
|
|
10
10
|
if (isNaN(b)) return -1;
|
|
11
11
|
return a - b;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
13
|
//#endregion
|
|
15
14
|
//#region src/sorting/byNumberDescending.ts
|
|
16
15
|
/**
|
|
@@ -24,7 +23,6 @@ const byNumberDescending = (valueA, valueB) => {
|
|
|
24
23
|
if (isNaN(b)) return -1;
|
|
25
24
|
return b - a;
|
|
26
25
|
};
|
|
27
|
-
|
|
28
26
|
//#endregion
|
|
29
27
|
//#region src/sorting/byStringAscending.ts
|
|
30
28
|
/**
|
|
@@ -35,7 +33,6 @@ const byStringAscending = (valueA, valueB) => {
|
|
|
35
33
|
const valueBClean = valueB.toString().trim().toLowerCase();
|
|
36
34
|
return valueAClean.localeCompare(valueBClean);
|
|
37
35
|
};
|
|
38
|
-
|
|
39
36
|
//#endregion
|
|
40
37
|
//#region src/sorting/byStringDescending.ts
|
|
41
38
|
/**
|
|
@@ -45,6 +42,5 @@ const byStringDescending = (valueA, valueB) => {
|
|
|
45
42
|
const valueAClean = valueA.toString().trim().toLowerCase();
|
|
46
43
|
return valueB.toString().trim().toLowerCase().localeCompare(valueAClean);
|
|
47
44
|
};
|
|
48
|
-
|
|
49
45
|
//#endregion
|
|
50
|
-
export { byNumberAscending, byNumberDescending, byStringAscending, byStringDescending };
|
|
46
|
+
export { byNumberAscending, byNumberDescending, byStringAscending, byStringDescending };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as __require } from "../../chunk-
|
|
2
|
-
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
3
2
|
//#region src/stream/server/sort.ts
|
|
4
3
|
const Transform = __require("stream").Transform;
|
|
5
4
|
const batch = 15e3;
|
|
@@ -43,6 +42,5 @@ const sort = (comp, options) => {
|
|
|
43
42
|
options = options || { objectMode: true };
|
|
44
43
|
return new SortStreamer(options, comp);
|
|
45
44
|
};
|
|
46
|
-
|
|
47
45
|
//#endregion
|
|
48
|
-
export { sort };
|
|
46
|
+
export { sort };
|
package/dist/string/index.d.mts
CHANGED
|
@@ -102,6 +102,6 @@ declare const reservedWords: string[];
|
|
|
102
102
|
/**
|
|
103
103
|
* Check if its a reserved word, the casing may be specific eg, OpenAI.
|
|
104
104
|
*/
|
|
105
|
-
declare const isReservedWord: (word: string) =>
|
|
105
|
+
declare const isReservedWord: (word: string) => string | null;
|
|
106
106
|
//#endregion
|
|
107
107
|
export { getCapitalised, getClean, getFolder, getProperCase, getString, getStringFromStream, getUnescaped, getWithoutAccents, getWithoutHtmlTags, getWithoutPunctuation, getWithoutUnderscores, getWithoutWhitespaces, isReservedWord, reservedWords };
|