@8ms/helpers 3.0.22 → 3.0.24
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/_virtual/_rolldown/runtime.cjs +1 -1
- package/dist/adverity/adverity.d.cts +0 -1
- package/dist/adverity/adverity.d.mts +0 -1
- package/dist/adverity/server/getJobs.d.cts +2 -0
- package/dist/adverity/server/getJobs.d.mts +2 -0
- package/dist/api/ApiResponseClass.d.cts +1 -6
- package/dist/api/ApiResponseClass.d.mts +1 -6
- package/dist/api/api.d.cts +0 -1
- package/dist/api/api.d.mts +0 -1
- package/dist/api/deleteRequest.d.cts +0 -1
- package/dist/api/deleteRequest.d.mts +0 -1
- package/dist/api/functions.d.cts +0 -1
- package/dist/api/functions.d.mts +0 -1
- package/dist/api/get.d.cts +0 -1
- package/dist/api/get.d.mts +0 -1
- package/dist/api/post.d.cts +0 -1
- package/dist/api/post.d.mts +0 -1
- package/dist/atInternet/atInternet.d.cts +0 -1
- package/dist/atInternet/atInternet.d.mts +0 -1
- package/dist/aws/cloudWatchLog/server/AwsCloudWatchLog.d.cts +0 -1
- package/dist/aws/cloudWatchLog/server/AwsCloudWatchLog.d.mts +0 -1
- package/dist/aws/cloudWatchLog/server/logEvent.d.cts +1 -0
- package/dist/aws/cloudWatchLog/server/logEvent.d.mts +1 -0
- package/dist/aws/cloudWatchMetric/server/AwsCloudWatchMetric.d.cts +0 -1
- package/dist/aws/cloudWatchMetric/server/AwsCloudWatchMetric.d.mts +0 -1
- package/dist/aws/cloudWatchMetric/server/logMetric.d.cts +1 -1
- package/dist/aws/cloudWatchMetric/server/logMetric.d.mts +1 -1
- package/dist/aws/ec2/server/AwsEc2.d.cts +0 -1
- package/dist/aws/ec2/server/AwsEc2.d.mts +0 -1
- package/dist/aws/ecs/server/AwsEcs.d.cts +0 -1
- package/dist/aws/ecs/server/AwsEcs.d.mts +0 -1
- package/dist/aws/glue/server/AwsGlue.cjs +2 -1
- package/dist/aws/glue/server/AwsGlue.d.cts +0 -1
- package/dist/aws/glue/server/AwsGlue.d.mts +0 -1
- package/dist/aws/glue/server/AwsGlue.mjs +2 -1
- package/dist/aws/lambda/server/AwsLambda.cjs +10 -8
- package/dist/aws/lambda/server/AwsLambda.d.cts +0 -1
- package/dist/aws/lambda/server/AwsLambda.d.mts +0 -1
- package/dist/aws/lambda/server/AwsLambda.mjs +10 -8
- package/dist/aws/s3/server/AwsS3.cjs +3 -2
- package/dist/aws/s3/server/AwsS3.d.cts +1 -1
- package/dist/aws/s3/server/AwsS3.d.mts +1 -1
- package/dist/aws/s3/server/AwsS3.mjs +3 -2
- package/dist/aws/s3/server/payload.d.cts +0 -1
- package/dist/aws/s3/server/payload.d.mts +0 -1
- package/dist/aws/ses/server/AwsSes.cjs +4 -11
- package/dist/aws/ses/server/AwsSes.d.cts +3 -4
- package/dist/aws/ses/server/AwsSes.d.mts +3 -4
- package/dist/aws/ses/server/AwsSes.mjs +4 -11
- package/dist/aws/ses/server/SimpleEmail.cjs +10 -11
- package/dist/aws/ses/server/SimpleEmail.d.cts +3 -12
- package/dist/aws/ses/server/SimpleEmail.d.mts +3 -12
- package/dist/aws/ses/server/SimpleEmail.mjs +10 -11
- package/dist/aws/sqs/server/AwsSqs.d.cts +0 -1
- package/dist/aws/sqs/server/AwsSqs.d.mts +0 -1
- package/dist/aws/ssm/server/AwsSsm.cjs +5 -4
- package/dist/aws/ssm/server/AwsSsm.d.cts +0 -1
- package/dist/aws/ssm/server/AwsSsm.d.mts +0 -1
- package/dist/aws/ssm/server/AwsSsm.mjs +5 -4
- package/dist/brightData/serpApi/server/buildGoogleSerpUrl.cjs +0 -2
- package/dist/brightData/serpApi/server/buildGoogleSerpUrl.mjs +0 -2
- package/dist/brightData/serpApi/server/buildGoogleTrendsUrl.cjs +0 -1
- package/dist/brightData/serpApi/server/buildGoogleTrendsUrl.mjs +0 -1
- package/dist/brightData/serpApi/server/getAsyncRequestId.d.cts +1 -0
- package/dist/brightData/serpApi/server/getAsyncRequestId.d.mts +1 -0
- package/dist/brightData/serpApi/server/getAsyncResults.cjs +7 -4
- package/dist/brightData/serpApi/server/getAsyncResults.d.cts +1 -1
- package/dist/brightData/serpApi/server/getAsyncResults.d.mts +1 -1
- package/dist/brightData/serpApi/server/getAsyncResults.mjs +7 -4
- package/dist/brightData/serpApi/server/getRealtime.d.cts +0 -1
- package/dist/brightData/serpApi/server/getRealtime.d.mts +0 -1
- package/dist/brightData/webScraperIde/server/getBatch.d.cts +0 -1
- package/dist/brightData/webScraperIde/server/getBatch.d.mts +0 -1
- package/dist/brightData/webScraperIde/server/getRealtime.cjs +10 -6
- package/dist/brightData/webScraperIde/server/getRealtime.d.cts +0 -1
- package/dist/brightData/webScraperIde/server/getRealtime.d.mts +0 -1
- package/dist/brightData/webScraperIde/server/getRealtime.mjs +10 -6
- package/dist/date/calculation.cjs +27 -24
- package/dist/date/calculation.d.cts +0 -1
- package/dist/date/calculation.d.mts +0 -1
- package/dist/date/calculation.mjs +27 -24
- package/dist/date/date.d.cts +0 -1
- package/dist/date/date.d.mts +0 -1
- package/dist/date/financialYear.d.cts +0 -1
- package/dist/date/financialYear.d.mts +0 -1
- package/dist/date/format.d.cts +0 -1
- package/dist/date/format.d.mts +0 -1
- package/dist/drizzle/server/Drizzle.d.cts +0 -1
- package/dist/drizzle/server/Drizzle.d.mts +0 -1
- package/dist/emsApi/awsTs/get.cjs +2 -1
- package/dist/emsApi/awsTs/get.d.cts +1 -0
- package/dist/emsApi/awsTs/get.d.mts +1 -0
- package/dist/emsApi/awsTs/get.mjs +2 -1
- package/dist/emsApi/awsTs/post.cjs +2 -1
- package/dist/emsApi/awsTs/post.d.cts +1 -0
- package/dist/emsApi/awsTs/post.d.mts +1 -0
- package/dist/emsApi/awsTs/post.mjs +2 -1
- package/dist/emsApi/vercel/get.cjs +2 -1
- package/dist/emsApi/vercel/get.d.cts +1 -0
- package/dist/emsApi/vercel/get.d.mts +1 -0
- package/dist/emsApi/vercel/get.mjs +2 -1
- package/dist/emsApi/vercel/post.cjs +2 -1
- package/dist/emsApi/vercel/post.d.cts +1 -0
- package/dist/emsApi/vercel/post.d.mts +1 -0
- package/dist/emsApi/vercel/post.mjs +2 -1
- package/dist/eskimi/eskimi.d.cts +0 -1
- package/dist/eskimi/eskimi.d.mts +0 -1
- package/dist/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.d.cts +0 -1
- package/dist/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.d.mts +0 -1
- package/dist/googleAds/server/GoogleAds.d.cts +0 -1
- package/dist/googleAds/server/GoogleAds.d.mts +0 -1
- package/dist/googleCloud/bigquery/server/GoogleCloudBigquery.d.cts +0 -1
- package/dist/googleCloud/bigquery/server/GoogleCloudBigquery.d.mts +0 -1
- package/dist/googleCloud/bigquery/server/loadData.d.cts +1 -7
- package/dist/googleCloud/bigquery/server/loadData.d.mts +1 -7
- package/dist/googleCloud/sheets/server/GoogleCloudSheets.d.cts +1 -2
- package/dist/googleCloud/sheets/server/GoogleCloudSheets.d.mts +1 -2
- package/dist/googleCloud/storage/server/GoogleCloudStorage.d.cts +0 -1
- package/dist/googleCloud/storage/server/GoogleCloudStorage.d.mts +0 -1
- package/dist/googlePageSpeed/server/GooglePageSpeed.cjs +2 -1
- package/dist/googlePageSpeed/server/GooglePageSpeed.d.cts +0 -1
- package/dist/googlePageSpeed/server/GooglePageSpeed.d.mts +0 -1
- package/dist/googlePageSpeed/server/GooglePageSpeed.mjs +2 -1
- package/dist/googleSearchIncidents/server/googleSearchIncidents.d.cts +0 -1
- package/dist/googleSearchIncidents/server/googleSearchIncidents.d.mts +0 -1
- package/dist/greenDomain/server/greenDomain.cjs +2 -1
- package/dist/greenDomain/server/greenDomain.d.cts +0 -1
- package/dist/greenDomain/server/greenDomain.d.mts +0 -1
- package/dist/greenDomain/server/greenDomain.mjs +2 -1
- package/dist/littleWarden/server/LittleWarden.cjs +2 -1
- package/dist/littleWarden/server/LittleWarden.d.cts +0 -1
- package/dist/littleWarden/server/LittleWarden.d.mts +0 -1
- package/dist/littleWarden/server/LittleWarden.mjs +2 -1
- package/dist/littleWarden/server/littleWardenAttrs.d.cts +3 -10
- package/dist/littleWarden/server/littleWardenAttrs.d.mts +3 -10
- package/dist/lumar/api/server/buildRequest.cjs +0 -1
- package/dist/lumar/api/server/buildRequest.d.cts +1 -0
- package/dist/lumar/api/server/buildRequest.d.mts +1 -0
- package/dist/lumar/api/server/buildRequest.mjs +0 -1
- package/dist/lumar/api/server/getData.d.cts +1 -0
- package/dist/lumar/api/server/getData.d.mts +1 -0
- package/dist/lumar/graphql/server/getData.d.cts +1 -0
- package/dist/lumar/graphql/server/getData.d.mts +1 -0
- package/dist/lumar/graphql/server/queries/getCrawls.d.cts +1 -4
- package/dist/lumar/graphql/server/queries/getCrawls.d.mts +1 -4
- package/dist/lumar/graphql/server/queries/getReportDifferences.d.cts +1 -5
- package/dist/lumar/graphql/server/queries/getReportDifferences.d.mts +1 -5
- package/dist/lumar/graphql/server/queries/getRows.d.cts +1 -11
- package/dist/lumar/graphql/server/queries/getRows.d.mts +1 -11
- package/dist/lumar/graphql/server/queries/getTotals.d.cts +1 -7
- package/dist/lumar/graphql/server/queries/getTotals.d.mts +1 -7
- package/dist/myTarget/server/myTarget.d.cts +0 -1
- package/dist/myTarget/server/myTarget.d.mts +0 -1
- package/dist/nextAuth/nextAuth.d.cts +0 -1
- package/dist/nextAuth/nextAuth.d.mts +0 -1
- package/dist/nextJs/client/LazyLoad.d.cts +0 -1
- package/dist/nextJs/client/LazyLoad.d.mts +0 -1
- package/dist/onePassword/server/OnePassword.d.cts +0 -1
- package/dist/onePassword/server/OnePassword.d.mts +0 -1
- package/dist/openAi/server/OpenAi.d.cts +0 -1
- package/dist/openAi/server/OpenAi.d.mts +0 -1
- package/dist/prisma/server/Prisma.d.cts +0 -1
- package/dist/prisma/server/Prisma.d.mts +0 -1
- package/dist/snapchat/server/Snapchat.cjs +3 -2
- package/dist/snapchat/server/Snapchat.d.cts +0 -1
- package/dist/snapchat/server/Snapchat.d.mts +0 -1
- package/dist/snapchat/server/Snapchat.mjs +3 -2
- package/dist/stream/server/sort.d.cts +0 -1
- package/dist/stream/server/sort.d.mts +0 -1
- package/dist/swr/client/swr.d.cts +1 -0
- package/dist/swr/client/swr.d.mts +1 -0
- package/dist/upTimeRobot/server/UpTimeRobot.d.cts +0 -1
- package/dist/upTimeRobot/server/UpTimeRobot.d.mts +0 -1
- package/dist/util/defaultTo.cjs +6 -3
- package/dist/util/defaultTo.mjs +6 -3
- package/dist/util/server/getBrotliCompressed.d.cts +0 -1
- package/dist/util/server/getBrotliCompressed.d.mts +0 -1
- package/dist/util/server/getBrotliDecompressed.d.cts +0 -1
- package/dist/util/server/getBrotliDecompressed.d.mts +0 -1
- package/dist/util/server/getGzipCompressed.d.cts +0 -1
- package/dist/util/server/getGzipCompressed.d.mts +0 -1
- package/dist/util/server/getGzipDecompressed.d.cts +0 -1
- package/dist/util/server/getGzipDecompressed.d.mts +0 -1
- package/dist/xlsx/cell.cjs +102 -0
- package/dist/xlsx/cell.d.cts +38 -0
- package/dist/xlsx/cell.d.mts +38 -0
- package/dist/xlsx/cell.mjs +97 -0
- package/dist/xlsx/column.cjs +37 -0
- package/dist/xlsx/column.d.cts +23 -0
- package/dist/xlsx/column.d.mts +23 -0
- package/dist/xlsx/column.mjs +35 -0
- package/dist/xlsx/createXlsx.cjs +138 -0
- package/dist/xlsx/createXlsx.d.cts +18 -0
- package/dist/xlsx/createXlsx.d.mts +18 -0
- package/dist/xlsx/createXlsx.mjs +136 -0
- package/dist/xlsx/index.cjs +18 -0
- package/dist/xlsx/index.d.cts +6 -0
- package/dist/xlsx/index.d.mts +6 -0
- package/dist/xlsx/index.mjs +6 -0
- package/dist/xlsx/modifyXlsx.cjs +125 -0
- package/dist/xlsx/modifyXlsx.d.cts +24 -0
- package/dist/xlsx/modifyXlsx.d.mts +24 -0
- package/dist/xlsx/modifyXlsx.mjs +124 -0
- package/dist/xlsx/sheet.cjs +36 -0
- package/dist/xlsx/sheet.d.cts +29 -0
- package/dist/xlsx/sheet.d.mts +29 -0
- package/dist/xlsx/sheet.mjs +34 -0
- package/package.json +103 -57
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseClass } from "../../../_class/BaseClass.mjs";
|
|
2
|
-
import { SendEmailCommandInput
|
|
3
|
-
|
|
2
|
+
import { SendEmailCommandInput } from "@aws-sdk/client-sesv2";
|
|
4
3
|
//#region src/aws/ses/server/SimpleEmail.d.ts
|
|
5
4
|
type AttachmentSource = {
|
|
6
5
|
filename: string;
|
|
@@ -28,15 +27,7 @@ declare class SimpleEmail extends BaseClass {
|
|
|
28
27
|
html?: string;
|
|
29
28
|
subject?: string;
|
|
30
29
|
attachments: AttachmentSource[];
|
|
31
|
-
constructor({
|
|
32
|
-
bcc,
|
|
33
|
-
cc,
|
|
34
|
-
from,
|
|
35
|
-
html,
|
|
36
|
-
subject,
|
|
37
|
-
to,
|
|
38
|
-
attachments
|
|
39
|
-
}: ConstructorProps);
|
|
30
|
+
constructor({ bcc, cc, from, html, subject, to, attachments }: ConstructorProps);
|
|
40
31
|
setFrom: (from: string) => this;
|
|
41
32
|
setHtml: (html: string) => this;
|
|
42
33
|
setSubject: (subject: string) => this;
|
|
@@ -51,7 +42,7 @@ declare class SimpleEmail extends BaseClass {
|
|
|
51
42
|
setBcc: (recipient: string | string[]) => this;
|
|
52
43
|
setCc: (recipient: string | string[]) => this;
|
|
53
44
|
setTo: (recipient: string | string[]) => this;
|
|
54
|
-
getSendParam: () => Promise<SendEmailCommandInput
|
|
45
|
+
getSendParam: () => Promise<SendEmailCommandInput>;
|
|
55
46
|
private _getRawEmailParams;
|
|
56
47
|
private _isTextFile;
|
|
57
48
|
private _getAttachmentTextData;
|
|
@@ -82,7 +82,7 @@ var SimpleEmail = class extends BaseClass {
|
|
|
82
82
|
CcAddresses: this._filterRecipients("cc"),
|
|
83
83
|
ToAddresses: this._filterRecipients("to")
|
|
84
84
|
},
|
|
85
|
-
|
|
85
|
+
Content: { Simple: {
|
|
86
86
|
Body: {
|
|
87
87
|
Html: {
|
|
88
88
|
Charset: "UTF-8",
|
|
@@ -97,17 +97,12 @@ var SimpleEmail = class extends BaseClass {
|
|
|
97
97
|
Charset: "UTF-8",
|
|
98
98
|
Data: this.subject ?? ""
|
|
99
99
|
}
|
|
100
|
-
},
|
|
101
|
-
|
|
100
|
+
} },
|
|
101
|
+
FromEmailAddress: this.from ?? ""
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
104
|
_getRawEmailParams = async () => {
|
|
105
105
|
const boundary = `----=_NextPart_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
106
|
-
const allRecipients = [
|
|
107
|
-
...this._filterRecipients("to"),
|
|
108
|
-
...this._filterRecipients("cc"),
|
|
109
|
-
...this._filterRecipients("bcc")
|
|
110
|
-
];
|
|
111
106
|
let rawMessage = "";
|
|
112
107
|
rawMessage += `From: ${this.from}\r\n`;
|
|
113
108
|
if (this._filterRecipients("to").length > 0) rawMessage += `To: ${this._filterRecipients("to").join(", ")}\r\n`;
|
|
@@ -136,9 +131,13 @@ var SimpleEmail = class extends BaseClass {
|
|
|
136
131
|
}
|
|
137
132
|
rawMessage += `--${boundary}--\r\n`;
|
|
138
133
|
return {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
Destination: {
|
|
135
|
+
ToAddresses: this._filterRecipients("to"),
|
|
136
|
+
CcAddresses: this._filterRecipients("cc"),
|
|
137
|
+
BccAddresses: this._filterRecipients("bcc")
|
|
138
|
+
},
|
|
139
|
+
Content: { Raw: { Data: Buffer.from(rawMessage) } },
|
|
140
|
+
FromEmailAddress: this.from ?? ""
|
|
142
141
|
};
|
|
143
142
|
};
|
|
144
143
|
_isTextFile = (contentType) => {
|
|
@@ -24,10 +24,11 @@ var AwsSsm = class extends require__class_BaseNamespace.BaseNamespace {
|
|
|
24
24
|
Name: name,
|
|
25
25
|
WithDecryption: "undefined" === typeof withDecryption ? true : withDecryption
|
|
26
26
|
}));
|
|
27
|
-
if (apiResponse?.Parameter?.Value)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
if (apiResponse?.Parameter?.Value) {
|
|
28
|
+
if ("undefined" === typeof apiResponse?.Parameter?.Value) this.parameters.set(name, null);
|
|
29
|
+
else if ("undefined" === typeof isJson || true === isJson) this.parameters.set(name, JSON.parse(apiResponse.Parameter.Value) || null);
|
|
30
|
+
else this.parameters.set(name, apiResponse.Parameter.Value);
|
|
31
|
+
} else this.parameters.set(name, null);
|
|
31
32
|
}
|
|
32
33
|
return this.parameters.get(name);
|
|
33
34
|
};
|
|
@@ -23,10 +23,11 @@ var AwsSsm = class extends BaseNamespace {
|
|
|
23
23
|
Name: name,
|
|
24
24
|
WithDecryption: "undefined" === typeof withDecryption ? true : withDecryption
|
|
25
25
|
}));
|
|
26
|
-
if (apiResponse?.Parameter?.Value)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
if (apiResponse?.Parameter?.Value) {
|
|
27
|
+
if ("undefined" === typeof apiResponse?.Parameter?.Value) this.parameters.set(name, null);
|
|
28
|
+
else if ("undefined" === typeof isJson || true === isJson) this.parameters.set(name, JSON.parse(apiResponse.Parameter.Value) || null);
|
|
29
|
+
else this.parameters.set(name, apiResponse.Parameter.Value);
|
|
30
|
+
} else this.parameters.set(name, null);
|
|
30
31
|
}
|
|
31
32
|
return this.parameters.get(name);
|
|
32
33
|
};
|
|
@@ -35,7 +35,6 @@ const buildGoogleSerpUrl = (props) => {
|
|
|
35
35
|
case "iphone":
|
|
36
36
|
params.query["brd_mobile"] = "ios";
|
|
37
37
|
url.searchParams.append("brd_mobile", "ios");
|
|
38
|
-
break;
|
|
39
38
|
}
|
|
40
39
|
if (props?.geoLocation) {
|
|
41
40
|
params.query["uule"] = props.geoLocation;
|
|
@@ -75,7 +74,6 @@ const buildGoogleSerpUrl = (props) => {
|
|
|
75
74
|
case "video":
|
|
76
75
|
params.query["tbm"] = "vid";
|
|
77
76
|
url.searchParams.append("tbm", "vid");
|
|
78
|
-
break;
|
|
79
77
|
}
|
|
80
78
|
if (props?.pagination) {
|
|
81
79
|
if (props.pagination?.offset) {
|
|
@@ -34,7 +34,6 @@ const buildGoogleSerpUrl = (props) => {
|
|
|
34
34
|
case "iphone":
|
|
35
35
|
params.query["brd_mobile"] = "ios";
|
|
36
36
|
url.searchParams.append("brd_mobile", "ios");
|
|
37
|
-
break;
|
|
38
37
|
}
|
|
39
38
|
if (props?.geoLocation) {
|
|
40
39
|
params.query["uule"] = props.geoLocation;
|
|
@@ -74,7 +73,6 @@ const buildGoogleSerpUrl = (props) => {
|
|
|
74
73
|
case "video":
|
|
75
74
|
params.query["tbm"] = "vid";
|
|
76
75
|
url.searchParams.append("tbm", "vid");
|
|
77
|
-
break;
|
|
78
76
|
}
|
|
79
77
|
if (props?.pagination) {
|
|
80
78
|
if (props.pagination?.offset) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BrightDataSerpApiType } from "./brightDataSerpApi.cjs";
|
|
2
2
|
import { Auth } from "../../server/brightData.cjs";
|
|
3
|
+
import "./index.cjs";
|
|
3
4
|
//#region src/brightData/serpApi/server/getAsyncRequestId.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* Make an async request to the SERP API using the Bright Data proxy.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BrightDataSerpApiType } from "./brightDataSerpApi.mjs";
|
|
2
2
|
import { Auth } from "../../server/brightData.mjs";
|
|
3
|
+
import "./index.mjs";
|
|
3
4
|
//#region src/brightData/serpApi/server/getAsyncRequestId.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* Make an async request to the SERP API using the Bright Data proxy.
|
|
@@ -11,10 +11,13 @@ const require_brightData_server_brightData = require("../../server/brightData.cj
|
|
|
11
11
|
const getAsyncResults = async (auth, requestId) => {
|
|
12
12
|
let response = new require_api_ApiResponseClass.ApiResponseClass();
|
|
13
13
|
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0";
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const customerId = require_brightData_server_brightData.getCustomerId(auth);
|
|
15
|
+
const zone = require_brightData_server_brightData.getZone(auth);
|
|
16
|
+
const requestResponse = await require_api_get.get(`https://api.brightdata.com/serp/get_result?customer=${customerId}&zone=${zone}&response_id=${requestId}`, { headers: { Authorization: `Bearer ${auth.apiKey}` } });
|
|
17
|
+
if (requestResponse.isSuccess()) {
|
|
18
|
+
if ("Request is pending" === requestResponse.getBody()) response.setToPending();
|
|
19
|
+
else response.setToSuccess(requestResponse.getBody());
|
|
20
|
+
} else response.setToError(null, "Error in request");
|
|
18
21
|
return response;
|
|
19
22
|
};
|
|
20
23
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiResponseClass } from "../../../api/ApiResponseClass.cjs";
|
|
2
|
+
import "../../../api/index.cjs";
|
|
2
3
|
import { Auth } from "../../server/brightData.cjs";
|
|
3
|
-
|
|
4
4
|
//#region src/brightData/serpApi/server/getAsyncResults.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Using the request ID from getAsyncRequestId fetch to see if the data is available.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiResponseClass } from "../../../api/ApiResponseClass.mjs";
|
|
2
|
+
import "../../../api/index.mjs";
|
|
2
3
|
import { Auth } from "../../server/brightData.mjs";
|
|
3
|
-
|
|
4
4
|
//#region src/brightData/serpApi/server/getAsyncResults.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Using the request ID from getAsyncRequestId fetch to see if the data is available.
|
|
@@ -10,10 +10,13 @@ import { getCustomerId, getZone } from "../../server/brightData.mjs";
|
|
|
10
10
|
const getAsyncResults = async (auth, requestId) => {
|
|
11
11
|
let response = new ApiResponseClass();
|
|
12
12
|
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0";
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const customerId = getCustomerId(auth);
|
|
14
|
+
const zone = getZone(auth);
|
|
15
|
+
const requestResponse = await get(`https://api.brightdata.com/serp/get_result?customer=${customerId}&zone=${zone}&response_id=${requestId}`, { headers: { Authorization: `Bearer ${auth.apiKey}` } });
|
|
16
|
+
if (requestResponse.isSuccess()) {
|
|
17
|
+
if ("Request is pending" === requestResponse.getBody()) response.setToPending();
|
|
18
|
+
else response.setToSuccess(requestResponse.getBody());
|
|
19
|
+
} else response.setToError(null, "Error in request");
|
|
17
20
|
return response;
|
|
18
21
|
};
|
|
19
22
|
//#endregion
|
|
@@ -11,17 +11,21 @@ const require_api_post = require("../../../api/post.cjs");
|
|
|
11
11
|
*/
|
|
12
12
|
const getRealtime = async (auth, scraperId, data = {}) => {
|
|
13
13
|
let response = {};
|
|
14
|
-
const
|
|
14
|
+
const requestUrl = `https://api.brightdata.com/dca/trigger_immediate?collector=${scraperId}`;
|
|
15
|
+
const requestResponse = await require_api_post.post(requestUrl, data, { headers: { Authorization: `Bearer ${auth.apiKey}` } });
|
|
15
16
|
if (requestResponse.isSuccess()) {
|
|
16
17
|
const responseId = requestResponse.getBodyDefaultTo(["response_id"], "");
|
|
17
18
|
if ("" !== responseId) {
|
|
18
19
|
let state = require_api_api.apiState.PENDING;
|
|
19
20
|
while (require_api_api.apiState.PENDING === state) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
state = require_api_api.apiState.
|
|
24
|
-
|
|
21
|
+
const resultUrl = `https://api.brightdata.com/dca/get_result?response_id=${responseId}`;
|
|
22
|
+
const resultResponse = await require_api_get.get(resultUrl, { headers: { Authorization: `Bearer ${auth.apiKey}` } });
|
|
23
|
+
if (resultResponse.isSuccess()) {
|
|
24
|
+
if (void 0 !== resultResponse.body.pending && true === resultResponse.body.pending) state = require_api_api.apiState.PENDING;
|
|
25
|
+
else {
|
|
26
|
+
state = require_api_api.apiState.SUCCESS;
|
|
27
|
+
response = resultResponse.getBody();
|
|
28
|
+
}
|
|
25
29
|
}
|
|
26
30
|
await require_util_sleep.sleep(1);
|
|
27
31
|
}
|
|
@@ -10,17 +10,21 @@ import { post } from "../../../api/post.mjs";
|
|
|
10
10
|
*/
|
|
11
11
|
const getRealtime = async (auth, scraperId, data = {}) => {
|
|
12
12
|
let response = {};
|
|
13
|
-
const
|
|
13
|
+
const requestUrl = `https://api.brightdata.com/dca/trigger_immediate?collector=${scraperId}`;
|
|
14
|
+
const requestResponse = await post(requestUrl, data, { headers: { Authorization: `Bearer ${auth.apiKey}` } });
|
|
14
15
|
if (requestResponse.isSuccess()) {
|
|
15
16
|
const responseId = requestResponse.getBodyDefaultTo(["response_id"], "");
|
|
16
17
|
if ("" !== responseId) {
|
|
17
18
|
let state = apiState.PENDING;
|
|
18
19
|
while (apiState.PENDING === state) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
state = apiState.
|
|
23
|
-
|
|
20
|
+
const resultUrl = `https://api.brightdata.com/dca/get_result?response_id=${responseId}`;
|
|
21
|
+
const resultResponse = await get(resultUrl, { headers: { Authorization: `Bearer ${auth.apiKey}` } });
|
|
22
|
+
if (resultResponse.isSuccess()) {
|
|
23
|
+
if (void 0 !== resultResponse.body.pending && true === resultResponse.body.pending) state = apiState.PENDING;
|
|
24
|
+
else {
|
|
25
|
+
state = apiState.SUCCESS;
|
|
26
|
+
response = resultResponse.getBody();
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
29
|
await sleep(1);
|
|
26
30
|
}
|
|
@@ -14,30 +14,33 @@ const getUnix = (input) => {
|
|
|
14
14
|
*/
|
|
15
15
|
const getLuxonDate = (input, setMidnight) => {
|
|
16
16
|
let instance = luxon.DateTime.now().toUTC();
|
|
17
|
-
if (input)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
instance = luxon.DateTime.fromFormat(inputString, "yyyy
|
|
40
|
-
|
|
17
|
+
if (input) {
|
|
18
|
+
if (input instanceof Date) instance = luxon.DateTime.fromJSDate(input, { zone: "utc" });
|
|
19
|
+
else if (input instanceof luxon.DateTime) instance = input.toUTC();
|
|
20
|
+
else if ("number" === typeof input) {
|
|
21
|
+
if (input >= 19000101 && input <= 99991231) {
|
|
22
|
+
const dateStr = input.toString();
|
|
23
|
+
const year = parseInt(dateStr.substring(0, 4));
|
|
24
|
+
const month = parseInt(dateStr.substring(4, 6));
|
|
25
|
+
const day = parseInt(dateStr.substring(6, 8));
|
|
26
|
+
instance = luxon.DateTime.fromObject({
|
|
27
|
+
year,
|
|
28
|
+
month,
|
|
29
|
+
day
|
|
30
|
+
}, { zone: "utc" });
|
|
31
|
+
} else if (input < 1e10) instance = luxon.DateTime.fromSeconds(input, { zone: "utc" });
|
|
32
|
+
else instance = luxon.DateTime.fromMillis(input, { zone: "utc" });
|
|
33
|
+
} else {
|
|
34
|
+
const inputString = input.toString().toLowerCase();
|
|
35
|
+
instance = luxon.DateTime.fromISO(inputString, { zone: "utc" });
|
|
36
|
+
if (!instance.isValid) {
|
|
37
|
+
const len = inputString.length;
|
|
38
|
+
if (23 === len) instance = luxon.DateTime.fromFormat(inputString, "yyyy-MM-dd HH:mm:ss.SSS", { zone: "utc" });
|
|
39
|
+
else if (19 === len) instance = luxon.DateTime.fromFormat(inputString, "yyyy-MM-dd HH:mm:ss", { zone: "utc" });
|
|
40
|
+
else {
|
|
41
|
+
instance = luxon.DateTime.fromFormat(inputString, "yyyy MMMM dd", { zone: "utc" });
|
|
42
|
+
if (!instance.isValid) instance = luxon.DateTime.fromFormat(inputString, "yyyy-MMMM-dd", { zone: "utc" });
|
|
43
|
+
}
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
}
|
|
@@ -13,30 +13,33 @@ const getUnix = (input) => {
|
|
|
13
13
|
*/
|
|
14
14
|
const getLuxonDate = (input, setMidnight) => {
|
|
15
15
|
let instance = DateTime.now().toUTC();
|
|
16
|
-
if (input)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
instance = DateTime.fromFormat(inputString, "yyyy
|
|
39
|
-
|
|
16
|
+
if (input) {
|
|
17
|
+
if (input instanceof Date) instance = DateTime.fromJSDate(input, { zone: "utc" });
|
|
18
|
+
else if (input instanceof DateTime) instance = input.toUTC();
|
|
19
|
+
else if ("number" === typeof input) {
|
|
20
|
+
if (input >= 19000101 && input <= 99991231) {
|
|
21
|
+
const dateStr = input.toString();
|
|
22
|
+
const year = parseInt(dateStr.substring(0, 4));
|
|
23
|
+
const month = parseInt(dateStr.substring(4, 6));
|
|
24
|
+
const day = parseInt(dateStr.substring(6, 8));
|
|
25
|
+
instance = DateTime.fromObject({
|
|
26
|
+
year,
|
|
27
|
+
month,
|
|
28
|
+
day
|
|
29
|
+
}, { zone: "utc" });
|
|
30
|
+
} else if (input < 1e10) instance = DateTime.fromSeconds(input, { zone: "utc" });
|
|
31
|
+
else instance = DateTime.fromMillis(input, { zone: "utc" });
|
|
32
|
+
} else {
|
|
33
|
+
const inputString = input.toString().toLowerCase();
|
|
34
|
+
instance = DateTime.fromISO(inputString, { zone: "utc" });
|
|
35
|
+
if (!instance.isValid) {
|
|
36
|
+
const len = inputString.length;
|
|
37
|
+
if (23 === len) instance = DateTime.fromFormat(inputString, "yyyy-MM-dd HH:mm:ss.SSS", { zone: "utc" });
|
|
38
|
+
else if (19 === len) instance = DateTime.fromFormat(inputString, "yyyy-MM-dd HH:mm:ss", { zone: "utc" });
|
|
39
|
+
else {
|
|
40
|
+
instance = DateTime.fromFormat(inputString, "yyyy MMMM dd", { zone: "utc" });
|
|
41
|
+
if (!instance.isValid) instance = DateTime.fromFormat(inputString, "yyyy-MMMM-dd", { zone: "utc" });
|
|
42
|
+
}
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
}
|
package/dist/date/date.d.cts
CHANGED
package/dist/date/date.d.mts
CHANGED
package/dist/date/format.d.cts
CHANGED
package/dist/date/format.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../_class/BaseNamespace.cjs";
|
|
2
2
|
import { defineRelations } from "drizzle-orm";
|
|
3
|
-
|
|
4
3
|
//#region src/drizzle/server/Drizzle.d.ts
|
|
5
4
|
type DrizzleConfig<TSchema extends Record<string, unknown> = Record<string, unknown>> = {
|
|
6
5
|
schema?: TSchema;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../_class/BaseNamespace.mjs";
|
|
2
2
|
import { defineRelations } from "drizzle-orm";
|
|
3
|
-
|
|
4
3
|
//#region src/drizzle/server/Drizzle.d.ts
|
|
5
4
|
type DrizzleConfig<TSchema extends Record<string, unknown> = Record<string, unknown>> = {
|
|
6
5
|
schema?: TSchema;
|
|
@@ -3,7 +3,8 @@ const require_api_get = require("../../api/get.cjs");
|
|
|
3
3
|
const require_emsApi_awsTs_endpoint = require("./endpoint.cjs");
|
|
4
4
|
//#region src/emsApi/awsTs/get.ts
|
|
5
5
|
const getAwsTs = async (path, config = {}) => {
|
|
6
|
-
|
|
6
|
+
const endpoint = require_emsApi_awsTs_endpoint.getAwsTsEndpoint();
|
|
7
|
+
return require_api_get.get(`${endpoint}${path}`, {
|
|
7
8
|
...config,
|
|
8
9
|
headers: {
|
|
9
10
|
"x-api-key": process.env?.SERVER_EMS_API_KEY ?? process.env?.NEXT_PUBLIC_CLIENT_EMS_API_KEY ?? "",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiResponseClass } from "../../api/ApiResponseClass.cjs";
|
|
2
2
|
import { Config } from "../../api/config.cjs";
|
|
3
|
+
import "../../api/index.cjs";
|
|
3
4
|
//#region src/emsApi/awsTs/get.d.ts
|
|
4
5
|
declare const getAwsTs: (path: string, config?: Config) => Promise<ApiResponseClass<any, any>>;
|
|
5
6
|
//#endregion
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiResponseClass } from "../../api/ApiResponseClass.mjs";
|
|
2
2
|
import { Config } from "../../api/config.mjs";
|
|
3
|
+
import "../../api/index.mjs";
|
|
3
4
|
//#region src/emsApi/awsTs/get.d.ts
|
|
4
5
|
declare const getAwsTs: (path: string, config?: Config) => Promise<ApiResponseClass<any, any>>;
|
|
5
6
|
//#endregion
|
|
@@ -2,7 +2,8 @@ import { get } from "../../api/get.mjs";
|
|
|
2
2
|
import { getAwsTsEndpoint } from "./endpoint.mjs";
|
|
3
3
|
//#region src/emsApi/awsTs/get.ts
|
|
4
4
|
const getAwsTs = async (path, config = {}) => {
|
|
5
|
-
|
|
5
|
+
const endpoint = getAwsTsEndpoint();
|
|
6
|
+
return get(`${endpoint}${path}`, {
|
|
6
7
|
...config,
|
|
7
8
|
headers: {
|
|
8
9
|
"x-api-key": process.env?.SERVER_EMS_API_KEY ?? process.env?.NEXT_PUBLIC_CLIENT_EMS_API_KEY ?? "",
|