@8ms/helpers 2.1.4 → 2.2.10
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/.github/workflows/deploy_npmjs.yml +19 -14
- package/_class/BaseClass.js +43 -52
- package/_class/BaseNamespace.js +17 -20
- package/_class/index.js +2 -7
- package/adverity/getJobs.js +7 -11
- package/adverity/index.js +51 -54
- package/adverity/server.js +1 -5
- package/api/ApiResponseClass.js +84 -88
- package/api/functions.js +13 -22
- package/api/index.js +3 -19
- package/api/types.js +5 -9
- package/array/index.js +3 -11
- package/atInternet/index.js +10 -13
- package/aws/ec2/AwsEc2Namespace.js +34 -74
- package/aws/ec2/server.js +5 -9
- package/aws/ecs/AwsEcsNamespace.js +110 -150
- package/aws/ecs/server.js +5 -9
- package/aws/glue/AwsGlueNamespace.js +26 -66
- package/aws/glue/server.js +5 -9
- package/aws/isResponse200.js +3 -7
- package/aws/lambda/AwsLambdaNamespace.js +62 -102
- package/aws/lambda/server.js +6 -11
- package/aws/s3/AwsS3Namespace.js +347 -390
- package/aws/s3/payload.js +29 -32
- package/aws/s3/server.js +9 -14
- package/aws/server.js +5 -10
- package/aws/ses/AwsSesNamespace.js +36 -76
- package/aws/ses/SimpleEmail.js +267 -304
- package/aws/ses/server.js +6 -11
- package/aws/sqs/AwsSqsNamespace.js +49 -89
- package/aws/sqs/server.js +5 -9
- package/aws/ssm/AwsSsmNamespace.js +43 -79
- package/aws/ssm/server.js +5 -9
- package/axios/deleteRequest.js +8 -15
- package/axios/get.js +8 -15
- package/axios/index.js +3 -9
- package/axios/post.js +8 -15
- package/boolean/index.js +3 -10
- package/brightData/serpApi/buildGoogleSerpUrl.js +1 -5
- package/brightData/serpApi/buildGoogleTrendsUrl.js +1 -5
- package/brightData/serpApi/getAsyncRequestId.js +8 -12
- package/brightData/serpApi/getAsyncResults.js +8 -12
- package/brightData/serpApi/getRealtime.js +3 -7
- package/brightData/serpApi/server.js +6 -14
- package/brightData/server.js +2 -7
- package/brightData/webScraperIde/getBatch.js +3 -7
- package/brightData/webScraperIde/getRealtime.js +11 -15
- package/brightData/webScraperIde/server.js +2 -7
- package/cache/server.js +2 -7
- package/cache/test/cache.test.js +4 -6
- package/crud/index.js +1 -4
- package/crypto/getDecrypt.js +2 -39
- package/crypto/getEncrypt.js +2 -39
- package/crypto/getRandom.js +1 -5
- package/crypto/getSha256.js +4 -41
- package/crypto/index.js +4 -11
- package/date/calculation.js +70 -99
- package/date/financialYear.js +16 -23
- package/date/format.js +40 -61
- package/date/index.js +4 -20
- package/date/type.js +4 -7
- package/environment/index.js +15 -25
- package/eskimi/getAgeGroup.js +3 -7
- package/eskimi/getData.js +3 -7
- package/eskimi/getDevice.js +3 -7
- package/eskimi/getGender.js +3 -7
- package/eskimi/server.js +23 -26
- package/file/index.js +8 -46
- package/geo/countries.js +1 -4
- package/geo/index.js +2 -7
- package/geo/languages.js +1 -4
- package/google/bigQuery/GoogleBigQueryNamespace.js +108 -148
- package/google/bigQuery/loadData.js +1 -5
- package/google/bigQuery/server.js +8 -14
- package/google/server.js +1 -5
- package/google/sheets/GoogleSheetsNamespace.js +34 -74
- package/google/sheets/getAssociatedData.js +1 -5
- package/google/sheets/server.js +8 -14
- package/google/storage/GoogleCloudStorageNamespace.js +62 -102
- package/google/storage/server.js +6 -10
- package/googleAds/GoogleAdsNamespace.js +28 -68
- package/googleAds/keywordPlanner/server.js +32 -35
- package/googleAds/server.js +6 -10
- package/googlePageSpeed/GooglePageSpeedNamespace.js +21 -28
- package/googlePageSpeed/server.js +8 -12
- package/googleSearchIncidents/server.js +28 -32
- package/greenDomain/server.js +17 -21
- package/inngest/server.js +1 -4
- package/json/getJsonNewline.js +3 -7
- package/json/index.js +2 -7
- package/json/isJson.js +1 -5
- package/littleWarden/LittleWardenNamespace.js +24 -31
- package/littleWarden/getUrlStatus.js +3 -7
- package/littleWarden/server.js +14 -22
- package/lumar/api/buildRequest.js +14 -18
- package/lumar/api/getData.js +3 -7
- package/lumar/api/initClient.js +3 -7
- package/lumar/api/server.js +6 -12
- package/lumar/graphql/columns.js +1 -4
- package/lumar/graphql/getData.js +3 -7
- package/lumar/graphql/initClient.js +3 -7
- package/lumar/graphql/queries/crawl.js +1 -2
- package/lumar/graphql/queries/getCrawls.js +1 -3
- package/lumar/graphql/queries/getReportDifferences.js +3 -5
- package/lumar/graphql/queries/getRows.js +1 -3
- package/lumar/graphql/queries/getTotals.js +1 -3
- package/lumar/graphql/queries/row.js +1 -2
- package/lumar/graphql/reportTemplates.js +1 -4
- package/lumar/graphql/server.js +7 -15
- package/myTarget/server.js +3 -7
- package/nextAuth/index.js +2 -6
- package/nextAuth/isSessionReady.js +1 -5
- package/nextJs/client/LazyLoad.js +5 -12
- package/nextJs/client.js +1 -5
- package/nextJs/index.js +2 -7
- package/number/format.js +3 -7
- package/number/formatCurrency.js +1 -5
- package/number/getDecimal.js +3 -7
- package/number/getNumber.js +3 -7
- package/number/getPercentIncrease.js +4 -8
- package/number/getSafeDivide.js +6 -10
- package/number/index.js +6 -15
- package/object/index.js +1 -5
- package/object/replaceKeys.js +3 -7
- package/onePassword/OnePasswordNamespace.js +36 -76
- package/onePassword/server.js +3 -7
- package/openAi/OpenAiNamespace.js +32 -39
- package/openAi/server.js +6 -10
- package/package.json +136 -120
- package/prisma/PrismaNamespace.d.ts +3 -3
- package/prisma/PrismaNamespace.js +55 -81
- package/prisma/getDecimal.js +5 -12
- package/prisma/server.d.ts +13 -0
- package/prisma/server.js +6 -9
- package/snapchat/SnapchatNamespace.js +20 -27
- package/snapchat/server.js +6 -10
- package/sorting/byNumberAscending.js +1 -5
- package/sorting/byNumberDescending.js +1 -5
- package/sorting/byStringAscending.js +1 -5
- package/sorting/byStringDescending.js +1 -5
- package/sorting/index.js +4 -11
- package/stream/server.js +1 -5
- package/stream/sort.js +1 -5
- package/string/getCapitalised.js +3 -7
- package/string/getClean.js +17 -21
- package/string/getFolder.js +3 -10
- package/string/getProperCase.js +4 -8
- package/string/getString.js +8 -15
- package/string/getStringFromStream.js +1 -5
- package/string/getUnescaped.js +3 -10
- package/string/getWithoutAccents.js +1 -5
- package/string/getWithoutHtmlTags.js +1 -5
- package/string/getWithoutPunctuation.js +1 -5
- package/string/getWithoutUnderscores.js +1 -5
- package/string/getWithoutWhitespaces.js +1 -5
- package/string/index.js +12 -27
- package/string/reservedWords.js +5 -9
- package/swr/index.js +9 -18
- package/upTimeRobot/UpTimeRobotNamespace.js +32 -42
- package/upTimeRobot/server.js +11 -15
- package/url/index.js +12 -23
- package/url/server.js +1 -5
- package/url/writeUrlContents.js +6 -46
- package/util/defaultTo.js +5 -12
- package/util/getBrotliCompressed.js +3 -10
- package/util/getBrotliDecompressed.js +3 -10
- package/util/getClean.js +5 -9
- package/util/getError.js +1 -5
- package/util/getGzipCompressed.js +3 -10
- package/util/getGzipDecompressed.js +3 -10
- package/util/getWithoutHash.js +1 -5
- package/util/getWithoutParameter.js +1 -5
- package/util/index.js +7 -17
- package/util/isUndefined.js +3 -7
- package/util/promiseChunks.js +6 -10
- package/util/server.js +4 -11
- package/util/sleep.js +1 -5
- package/webWorker/index.js +1 -4
- package/xml/getXml.js +3 -7
- package/.yarn/install-state.gz +0 -0
- package/.yarn/releases/yarn-4.9.4.cjs +0 -942
- package/.yarnrc.yml +0 -3
- package/aws/athenaExpress/AwsAthenaNamespace.d.ts +0 -8
- package/aws/athenaExpress/AwsAthenaNamespace.js +0 -82
- package/aws/athenaExpress/server.d.ts +0 -10
- package/aws/athenaExpress/server.js +0 -40
package/aws/s3/payload.js
CHANGED
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.payloadSchema = void 0;
|
|
4
|
-
const v4_1 = require("zod/v4");
|
|
1
|
+
import { z } from "zod/v4";
|
|
5
2
|
/**
|
|
6
3
|
* https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-content-structure.html
|
|
7
4
|
*/
|
|
8
|
-
|
|
9
|
-
Records:
|
|
10
|
-
eventVersion:
|
|
11
|
-
eventSource:
|
|
12
|
-
awsRegion:
|
|
13
|
-
eventTime:
|
|
14
|
-
eventName:
|
|
15
|
-
userIdentity:
|
|
16
|
-
principalId:
|
|
5
|
+
export const payloadSchema = z.object({
|
|
6
|
+
Records: z.object({
|
|
7
|
+
eventVersion: z.string(),
|
|
8
|
+
eventSource: z.string(),
|
|
9
|
+
awsRegion: z.string(),
|
|
10
|
+
eventTime: z.string(),
|
|
11
|
+
eventName: z.string(),
|
|
12
|
+
userIdentity: z.object({
|
|
13
|
+
principalId: z.string(),
|
|
17
14
|
}),
|
|
18
|
-
requestParameters:
|
|
19
|
-
sourceIPAddress:
|
|
15
|
+
requestParameters: z.object({
|
|
16
|
+
sourceIPAddress: z.string(),
|
|
20
17
|
}),
|
|
21
|
-
responseElements:
|
|
22
|
-
"x-amz-request-id":
|
|
23
|
-
"x-amz-id-2":
|
|
18
|
+
responseElements: z.object({
|
|
19
|
+
"x-amz-request-id": z.string(),
|
|
20
|
+
"x-amz-id-2": z.string(),
|
|
24
21
|
}),
|
|
25
|
-
s3:
|
|
26
|
-
s3SchemaVersion:
|
|
27
|
-
configurationId:
|
|
28
|
-
bucket:
|
|
29
|
-
name:
|
|
30
|
-
ownerIdentity:
|
|
31
|
-
principalId:
|
|
22
|
+
s3: z.object({
|
|
23
|
+
s3SchemaVersion: z.string(),
|
|
24
|
+
configurationId: z.string(),
|
|
25
|
+
bucket: z.object({
|
|
26
|
+
name: z.string(),
|
|
27
|
+
ownerIdentity: z.object({
|
|
28
|
+
principalId: z.string(),
|
|
32
29
|
}),
|
|
33
|
-
arn:
|
|
30
|
+
arn: z.string(),
|
|
34
31
|
}),
|
|
35
|
-
object:
|
|
36
|
-
key:
|
|
37
|
-
size:
|
|
38
|
-
eTag:
|
|
39
|
-
versionId:
|
|
32
|
+
object: z.object({
|
|
33
|
+
key: z.string(),
|
|
34
|
+
size: z.string(),
|
|
35
|
+
eTag: z.string(),
|
|
36
|
+
versionId: z.string()
|
|
40
37
|
.optional(),
|
|
41
|
-
sequencer:
|
|
38
|
+
sequencer: z.string(),
|
|
42
39
|
})
|
|
43
40
|
}),
|
|
44
41
|
})
|
package/aws/s3/server.js
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const AwsS3Namespace_1 = require("./AwsS3Namespace");
|
|
5
|
-
const server_1 = require("../server");
|
|
6
|
-
const date_1 = require("../../date");
|
|
1
|
+
import { AwsS3Namespace } from "./AwsS3Namespace";
|
|
2
|
+
import { getConfig } from "../server";
|
|
3
|
+
import { defaultDateTime } from "../../date";
|
|
7
4
|
const awsS3Namespaces = new Map();
|
|
8
|
-
const awsS3Client = async (key = "default", config, vaultId, itemId) => {
|
|
5
|
+
export const awsS3Client = async (key = "default", config, vaultId, itemId) => {
|
|
9
6
|
if (awsS3Namespaces.has(key)) {
|
|
10
7
|
return awsS3Namespaces.get(key);
|
|
11
8
|
}
|
|
12
|
-
const instanceConfig = await
|
|
13
|
-
const namespace = new
|
|
9
|
+
const instanceConfig = await getConfig(key, config, vaultId, itemId);
|
|
10
|
+
const namespace = new AwsS3Namespace(key, instanceConfig);
|
|
14
11
|
awsS3Namespaces.set(key, namespace);
|
|
15
12
|
return namespace;
|
|
16
13
|
};
|
|
17
|
-
|
|
18
|
-
exports.readFileDefault = {
|
|
14
|
+
export const readFileDefault = {
|
|
19
15
|
body: undefined,
|
|
20
16
|
now: undefined,
|
|
21
17
|
error: undefined,
|
|
22
|
-
modified:
|
|
18
|
+
modified: defaultDateTime,
|
|
23
19
|
};
|
|
24
|
-
|
|
25
|
-
Object.defineProperty(exports, "payloadSchema", { enumerable: true, get: function () { return payload_1.payloadSchema; } });
|
|
20
|
+
export { payloadSchema } from "./payload";
|
package/aws/server.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isResponse200 = exports.getConfig = void 0;
|
|
4
|
-
const server_1 = require("../onePassword/server");
|
|
5
|
-
const getConfig = async (key, config, vaultId, itemId) => {
|
|
1
|
+
import { onePasswordClient } from "../onePassword/server";
|
|
2
|
+
export const getConfig = async (key, config, vaultId, itemId) => {
|
|
6
3
|
let response;
|
|
7
4
|
if (config) {
|
|
8
5
|
response = config;
|
|
9
6
|
}
|
|
10
7
|
else if (vaultId && itemId) {
|
|
11
|
-
response = await (await
|
|
8
|
+
response = await (await onePasswordClient())
|
|
12
9
|
.getJsonNote(vaultId, itemId);
|
|
13
10
|
}
|
|
14
11
|
else if (process.env.AWS_VAULT_ID && process.env.AWS_ITEM_ID) {
|
|
15
|
-
response = await (await
|
|
12
|
+
response = await (await onePasswordClient())
|
|
16
13
|
.getJsonNote(process.env.AWS_VAULT_ID, process.env.AWS_ITEM_ID);
|
|
17
14
|
}
|
|
18
15
|
else if (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_REGION && process.env.AWS_SECRET_ACCESS_KEY) {
|
|
@@ -29,6 +26,4 @@ const getConfig = async (key, config, vaultId, itemId) => {
|
|
|
29
26
|
}
|
|
30
27
|
return response;
|
|
31
28
|
};
|
|
32
|
-
|
|
33
|
-
var isResponse200_1 = require("./isResponse200");
|
|
34
|
-
Object.defineProperty(exports, "isResponse200", { enumerable: true, get: function () { return isResponse200_1.isResponse200; } });
|
|
29
|
+
export { isResponse200 } from "./isResponse200";
|
|
@@ -1,81 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
1
|
+
import { BaseNamespace } from "../../_class";
|
|
2
|
+
export class AwsSesNamespace extends BaseNamespace {
|
|
3
|
+
ensureInit = async () => {
|
|
4
|
+
if (!this.client) {
|
|
5
|
+
try {
|
|
6
|
+
const { SESClient } = await import("@aws-sdk/client-ses");
|
|
7
|
+
this.client = new SESClient(this.config);
|
|
8
|
+
}
|
|
9
|
+
catch (e) {
|
|
10
|
+
throw new Error("AWS SES Client not installed");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
33
13
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
try {
|
|
44
|
-
const { SESClient } = await Promise.resolve().then(() => __importStar(require("@aws-sdk/client-ses")));
|
|
45
|
-
this.client = new SESClient(this.config);
|
|
46
|
-
}
|
|
47
|
-
catch (e) {
|
|
48
|
-
throw new Error("AWS SES Client not installed");
|
|
49
|
-
}
|
|
14
|
+
send = async (input) => {
|
|
15
|
+
await this.ensureInit();
|
|
16
|
+
let response;
|
|
17
|
+
// For a simple message
|
|
18
|
+
if (input?.Message?.Body?.Html?.Data) {
|
|
19
|
+
try {
|
|
20
|
+
const { SendEmailCommand } = await import("@aws-sdk/client-ses");
|
|
21
|
+
const command = new SendEmailCommand(input);
|
|
22
|
+
response = await this.client.send(command);
|
|
50
23
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
await this.ensureInit();
|
|
54
|
-
let response;
|
|
55
|
-
// For a simple message
|
|
56
|
-
if (input?.Message?.Body?.Html?.Data) {
|
|
57
|
-
try {
|
|
58
|
-
const { SendEmailCommand } = await Promise.resolve().then(() => __importStar(require("@aws-sdk/client-ses")));
|
|
59
|
-
const command = new SendEmailCommand(input);
|
|
60
|
-
response = await this.client.send(command);
|
|
61
|
-
}
|
|
62
|
-
catch (exception) {
|
|
63
|
-
response = exception;
|
|
64
|
-
}
|
|
24
|
+
catch (exception) {
|
|
25
|
+
response = exception;
|
|
65
26
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
catch (exception) {
|
|
74
|
-
response = exception;
|
|
75
|
-
}
|
|
27
|
+
}
|
|
28
|
+
// For a message with attachments
|
|
29
|
+
else {
|
|
30
|
+
try {
|
|
31
|
+
const { SendRawEmailCommand } = await import("@aws-sdk/client-ses");
|
|
32
|
+
const command = new SendRawEmailCommand(input);
|
|
33
|
+
response = await this.client.send(command);
|
|
76
34
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
35
|
+
catch (exception) {
|
|
36
|
+
response = exception;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return response;
|
|
40
|
+
};
|
|
80
41
|
}
|
|
81
|
-
exports.AwsSesNamespace = AwsSesNamespace;
|