@8ms/helpers 2.0.0 → 2.0.1
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 +7 -0
- package/.yarn/install-state.gz +0 -0
- package/_class/BaseClass.d.ts +18 -0
- package/_class/BaseClass.js +53 -0
- package/_class/BaseNamespace.d.ts +9 -0
- package/_class/BaseNamespace.js +27 -0
- package/_class/index.d.ts +2 -0
- package/_class/index.js +7 -0
- package/adverity/getJobs.d.ts +15 -0
- package/adverity/getJobs.js +30 -0
- package/adverity/index.d.ts +112 -0
- package/adverity/index.js +61 -0
- package/api/ApiResponseClass.d.ts +35 -0
- package/api/ApiResponseClass.js +97 -0
- package/api/index.d.ts +22 -0
- package/api/index.js +44 -0
- package/array/index.d.ts +8 -0
- package/array/index.js +17 -0
- package/atInternet/index.d.ts +16 -0
- package/atInternet/index.js +18 -0
- package/aws/athenaExpress/AwsAthenaNamespace.d.ts +8 -0
- package/aws/athenaExpress/AwsAthenaNamespace.js +82 -0
- package/aws/athenaExpress/index.d.ts +10 -0
- package/aws/athenaExpress/index.js +40 -0
- package/aws/ec2/AwsEc2Namespace.d.ts +10 -0
- package/aws/ec2/AwsEc2Namespace.js +78 -0
- package/aws/ec2/index.d.ts +3 -0
- package/aws/ec2/index.js +16 -0
- package/aws/ecs/AwsEcsNamespace.d.ts +53 -0
- package/aws/ecs/AwsEcsNamespace.js +159 -0
- package/aws/ecs/index.d.ts +3 -0
- package/aws/ecs/index.js +16 -0
- package/aws/glue/AwsGlueNamespace.d.ts +12 -0
- package/aws/glue/AwsGlueNamespace.js +70 -0
- package/aws/glue/index.d.ts +3 -0
- package/aws/glue/index.js +16 -0
- package/aws/index.d.ts +9 -0
- package/aws/index.js +34 -0
- package/aws/isResponse200.d.ts +4 -0
- package/aws/isResponse200.js +16 -0
- package/aws/lambda/AwsLambdaNamespace.d.ts +21 -0
- package/aws/lambda/AwsLambdaNamespace.js +110 -0
- package/aws/lambda/index.d.ts +4 -0
- package/aws/lambda/index.js +21 -0
- package/aws/s3/AwsS3Namespace.d.ts +60 -0
- package/aws/s3/AwsS3Namespace.js +401 -0
- package/aws/s3/index.d.ts +25 -0
- package/aws/s3/index.js +36 -0
- package/aws/s3/payload.d.ts +42 -0
- package/aws/s3/payload.js +46 -0
- package/aws/ses/AwsSesNamespace.d.ts +18 -0
- package/aws/ses/AwsSesNamespace.js +69 -0
- package/aws/ses/SimpleEmail.d.ts +56 -0
- package/aws/ses/SimpleEmail.js +106 -0
- package/aws/ses/index.d.ts +4 -0
- package/aws/ses/index.js +18 -0
- package/aws/sqs/AwsSqsNamespace.d.ts +34 -0
- package/aws/sqs/AwsSqsNamespace.js +96 -0
- package/aws/sqs/index.d.ts +3 -0
- package/aws/sqs/index.js +16 -0
- package/aws/ssm/AwsSsmNamespace.d.ts +11 -0
- package/aws/ssm/AwsSsmNamespace.js +89 -0
- package/aws/ssm/index.d.ts +3 -0
- package/aws/ssm/index.js +16 -0
- package/axios/deleteRequest.d.ts +6 -0
- package/axios/deleteRequest.js +33 -0
- package/axios/get.d.ts +5 -0
- package/axios/get.js +31 -0
- package/axios/index.d.ts +3 -0
- package/axios/index.js +9 -0
- package/axios/post.d.ts +5 -0
- package/axios/post.js +32 -0
- package/boolean/getBoolean.d.ts +4 -0
- package/boolean/getBoolean.js +23 -0
- package/boolean/index.d.ts +1 -0
- package/boolean/index.js +5 -0
- package/brightData/index.d.ts +15 -0
- package/brightData/index.js +20 -0
- package/brightData/serpApi/buildGoogleSerpUrl.d.ts +32 -0
- package/brightData/serpApi/buildGoogleSerpUrl.js +116 -0
- package/brightData/serpApi/buildGoogleTrendsUrl.d.ts +22 -0
- package/brightData/serpApi/buildGoogleTrendsUrl.js +61 -0
- package/brightData/serpApi/getAsyncRequestId.d.ts +8 -0
- package/brightData/serpApi/getAsyncRequestId.js +36 -0
- package/brightData/serpApi/getAsyncResults.d.ts +7 -0
- package/brightData/serpApi/getAsyncResults.js +35 -0
- package/brightData/serpApi/getRealtime.d.ts +5 -0
- package/brightData/serpApi/getRealtime.js +30 -0
- package/brightData/serpApi/index.d.ts +14 -0
- package/brightData/serpApi/index.js +23 -0
- package/brightData/webScraperIde/getBatch.d.ts +7 -0
- package/brightData/webScraperIde/getBatch.js +28 -0
- package/brightData/webScraperIde/getRealtime.d.ts +7 -0
- package/brightData/webScraperIde/getRealtime.js +49 -0
- package/brightData/webScraperIde/index.d.ts +2 -0
- package/brightData/webScraperIde/index.js +7 -0
- package/cache/index.d.ts +2 -0
- package/cache/index.js +48 -0
- package/cache/test/cache.test.d.ts +1 -0
- package/cache/test/cache.test.js +10 -0
- package/crud/index.d.ts +6 -0
- package/crud/index.js +10 -0
- package/crypto/getDecrypt.d.ts +5 -0
- package/crypto/getDecrypt.js +47 -0
- package/crypto/getEncrypt.d.ts +5 -0
- package/crypto/getEncrypt.js +47 -0
- package/crypto/getRandom.d.ts +4 -0
- package/crypto/getRandom.js +12 -0
- package/crypto/getSha256.d.ts +5 -0
- package/crypto/getSha256.js +48 -0
- package/crypto/index.d.ts +4 -0
- package/crypto/index.js +11 -0
- package/date/calculation.d.ts +75 -0
- package/date/calculation.js +207 -0
- package/date/financialYear.d.ts +19 -0
- package/date/financialYear.js +85 -0
- package/date/format.d.ts +68 -0
- package/date/format.js +150 -0
- package/date/index.d.ts +35 -0
- package/date/index.js +57 -0
- package/environment/index.d.ts +32 -0
- package/environment/index.js +92 -0
- package/eskimi/getAgeGroup.d.ts +4 -0
- package/eskimi/getAgeGroup.js +15 -0
- package/eskimi/getData.d.ts +4 -0
- package/eskimi/getData.js +17 -0
- package/eskimi/getDevice.d.ts +4 -0
- package/eskimi/getDevice.js +15 -0
- package/eskimi/getGender.d.ts +4 -0
- package/eskimi/getGender.js +15 -0
- package/eskimi/index.d.ts +49 -0
- package/eskimi/index.js +96 -0
- package/file/createDirectory.d.ts +5 -0
- package/file/createDirectory.js +50 -0
- package/file/index.d.ts +1 -0
- package/file/index.js +5 -0
- package/geo/countries.d.ts +12 -0
- package/geo/countries.js +222 -0
- package/geo/index.d.ts +2 -0
- package/geo/index.js +7 -0
- package/geo/languages.d.ts +9 -0
- package/geo/languages.js +58 -0
- package/google/bigQuery/GoogleBigQueryNamespace.d.ts +51 -0
- package/google/bigQuery/GoogleBigQueryNamespace.js +165 -0
- package/google/bigQuery/index.d.ts +5 -0
- package/google/bigQuery/index.js +37 -0
- package/google/bigQuery/loadData.d.ts +19 -0
- package/google/bigQuery/loadData.js +18 -0
- package/google/index.d.ts +27 -0
- package/google/index.js +24 -0
- package/google/sheets/GoogleSheetsNamespace.d.ts +16 -0
- package/google/sheets/GoogleSheetsNamespace.js +81 -0
- package/google/sheets/getAssociatedData.d.ts +10 -0
- package/google/sheets/getAssociatedData.js +43 -0
- package/google/sheets/index.d.ts +8 -0
- package/google/sheets/index.js +37 -0
- package/google/storage/GoogleCloudStorageNamespace.d.ts +20 -0
- package/google/storage/GoogleCloudStorageNamespace.js +108 -0
- package/google/storage/index.d.ts +3 -0
- package/google/storage/index.js +30 -0
- package/googleAds/GoogleAdsNamespace.d.ts +11 -0
- package/googleAds/GoogleAdsNamespace.js +73 -0
- package/googleAds/index.d.ts +11 -0
- package/googleAds/index.js +30 -0
- package/googleAds/keywordPlanner/index.d.ts +40 -0
- package/googleAds/keywordPlanner/index.js +59 -0
- package/googlePageSpeed/GooglePageSpeedNamespace.d.ts +11 -0
- package/googlePageSpeed/GooglePageSpeedNamespace.js +35 -0
- package/googlePageSpeed/index.d.ts +17 -0
- package/googlePageSpeed/index.js +44 -0
- package/googleSearchIncidents/index.d.ts +69 -0
- package/googleSearchIncidents/index.js +46 -0
- package/greenDomain/index.d.ts +21 -0
- package/greenDomain/index.js +41 -0
- package/inngest/index.d.ts +6 -0
- package/inngest/index.js +10 -0
- package/json/getJsonNewline.d.ts +1 -0
- package/json/getJsonNewline.js +13 -0
- package/json/index.d.ts +2 -0
- package/json/index.js +7 -0
- package/json/isJson.d.ts +1 -0
- package/json/isJson.js +26 -0
- package/littleWarden/LittleWardenNamespace.d.ts +11 -0
- package/littleWarden/LittleWardenNamespace.js +38 -0
- package/littleWarden/getUrlStatus.d.ts +4 -0
- package/littleWarden/getUrlStatus.js +16 -0
- package/littleWarden/index.d.ts +29 -0
- package/littleWarden/index.js +74 -0
- package/lumar/api/buildRequest.d.ts +13 -0
- package/lumar/api/buildRequest.js +80 -0
- package/lumar/api/getData.d.ts +5 -0
- package/lumar/api/getData.js +13 -0
- package/lumar/api/index.d.ts +36 -0
- package/lumar/api/index.js +33 -0
- package/lumar/api/initClient.d.ts +6 -0
- package/lumar/api/initClient.js +26 -0
- package/lumar/graphql/columns.d.ts +28 -0
- package/lumar/graphql/columns.js +31 -0
- package/lumar/graphql/getData.d.ts +1 -0
- package/lumar/graphql/getData.js +20 -0
- package/lumar/graphql/index.d.ts +29 -0
- package/lumar/graphql/index.js +39 -0
- package/lumar/graphql/initClient.d.ts +5 -0
- package/lumar/graphql/initClient.js +25 -0
- package/lumar/graphql/queries/crawl.d.ts +5 -0
- package/lumar/graphql/queries/crawl.js +2 -0
- package/lumar/graphql/queries/getCrawls.d.ts +18 -0
- package/lumar/graphql/queries/getCrawls.js +33 -0
- package/lumar/graphql/queries/getReportDifferences.d.ts +24 -0
- package/lumar/graphql/queries/getReportDifferences.js +37 -0
- package/lumar/graphql/queries/getRows.d.ts +38 -0
- package/lumar/graphql/queries/getRows.js +57 -0
- package/lumar/graphql/queries/getTotals.d.ts +25 -0
- package/lumar/graphql/queries/getTotals.js +40 -0
- package/lumar/graphql/queries/row.d.ts +157 -0
- package/lumar/graphql/queries/row.js +2 -0
- package/lumar/graphql/reportTemplates.d.ts +67 -0
- package/lumar/graphql/reportTemplates.js +70 -0
- package/myTarget/request.d.ts +5 -0
- package/myTarget/request.js +17 -0
- package/nextAuth/index.d.ts +6 -0
- package/nextAuth/index.js +11 -0
- package/nextAuth/isSessionReady.d.ts +1 -0
- package/nextAuth/isSessionReady.js +13 -0
- package/nextJs/getIp.d.ts +6 -0
- package/nextJs/getIp.js +14 -0
- package/nextJs/getUserAgent.d.ts +6 -0
- package/nextJs/getUserAgent.js +8 -0
- package/nextJs/index.d.ts +2 -0
- package/nextJs/index.js +7 -0
- package/number/format.d.ts +12 -0
- package/number/format.js +20 -0
- package/number/formatCurrency.d.ts +5 -0
- package/number/formatCurrency.js +21 -0
- package/number/getDecimal.d.ts +4 -0
- package/number/getDecimal.js +12 -0
- package/number/getNumber.d.ts +4 -0
- package/number/getNumber.js +48 -0
- package/number/getPercentIncrease.d.ts +4 -0
- package/number/getPercentIncrease.js +16 -0
- package/number/getSafeDivide.d.ts +11 -0
- package/number/getSafeDivide.js +20 -0
- package/number/index.d.ts +6 -0
- package/number/index.js +15 -0
- package/object/index.d.ts +1 -0
- package/object/index.js +5 -0
- package/object/replaceKeys.d.ts +5 -0
- package/object/replaceKeys.js +25 -0
- package/onePassword/OnePasswordNamespace.d.ts +13 -0
- package/onePassword/OnePasswordNamespace.js +81 -0
- package/onePassword/index.d.ts +7 -0
- package/onePassword/index.js +25 -0
- package/openAi/OpenAiNamespace.d.ts +11 -0
- package/openAi/OpenAiNamespace.js +44 -0
- package/openAi/index.d.ts +5 -0
- package/openAi/index.js +30 -0
- package/package.json +2 -2
- package/prisma/PrismaNamespace.d.ts +8 -0
- package/prisma/PrismaNamespace.js +79 -0
- package/prisma/getDecimal.d.ts +4 -0
- package/prisma/getDecimal.js +23 -0
- package/prisma/index.d.ts +8 -0
- package/prisma/index.js +29 -0
- package/snapchat/SnapchatNamespace.d.ts +15 -0
- package/snapchat/SnapchatNamespace.js +30 -0
- package/snapchat/index.d.ts +7 -0
- package/snapchat/index.js +30 -0
- package/sorting/byNumberAscending.d.ts +4 -0
- package/sorting/byNumberAscending.js +19 -0
- package/sorting/byNumberDescending.d.ts +4 -0
- package/sorting/byNumberDescending.js +22 -0
- package/sorting/byStringAscending.d.ts +4 -0
- package/sorting/byStringAscending.js +16 -0
- package/sorting/byStringDescending.d.ts +4 -0
- package/sorting/byStringDescending.js +16 -0
- package/sorting/index.d.ts +4 -0
- package/sorting/index.js +11 -0
- package/stream/index.d.ts +1 -0
- package/stream/index.js +5 -0
- package/stream/sort.d.ts +13 -0
- package/stream/sort.js +51 -0
- package/string/getCapitalised.d.ts +5 -0
- package/string/getCapitalised.js +18 -0
- package/string/getClean.d.ts +18 -0
- package/string/getClean.js +51 -0
- package/string/getFolder.d.ts +4 -0
- package/string/getFolder.js +15 -0
- package/string/getProperCase.d.ts +11 -0
- package/string/getProperCase.js +25 -0
- package/string/getString.d.ts +4 -0
- package/string/getString.js +34 -0
- package/string/getStringFromStream.d.ts +5 -0
- package/string/getStringFromStream.js +17 -0
- package/string/getUnescaped.d.ts +6 -0
- package/string/getUnescaped.js +26 -0
- package/string/getWithoutAccents.d.ts +5 -0
- package/string/getWithoutAccents.js +13 -0
- package/string/getWithoutHtmlTags.d.ts +5 -0
- package/string/getWithoutHtmlTags.js +12 -0
- package/string/getWithoutPunctuation.d.ts +5 -0
- package/string/getWithoutPunctuation.js +13 -0
- package/string/getWithoutUnderscores.d.ts +4 -0
- package/string/getWithoutUnderscores.js +11 -0
- package/string/getWithoutWhitespaces.d.ts +5 -0
- package/string/getWithoutWhitespaces.js +13 -0
- package/string/index.d.ts +12 -0
- package/string/index.js +27 -0
- package/swr/index.d.ts +42 -0
- package/swr/index.js +59 -0
- package/upTimeRobot/UpTimeRobotNamespace.d.ts +31 -0
- package/upTimeRobot/UpTimeRobotNamespace.js +52 -0
- package/upTimeRobot/index.d.ts +38 -0
- package/upTimeRobot/index.js +63 -0
- package/url/index.d.ts +19 -0
- package/url/index.js +70 -0
- package/url/writeUrlContents.d.ts +6 -0
- package/url/writeUrlContents.js +75 -0
- package/util/defaultTo.d.ts +4 -0
- package/util/defaultTo.js +44 -0
- package/util/getBrotliCompressed.d.ts +5 -0
- package/util/getBrotliCompressed.js +23 -0
- package/util/getBrotliDecompressed.d.ts +5 -0
- package/util/getBrotliDecompressed.js +24 -0
- package/util/getClean.d.ts +11 -0
- package/util/getClean.js +23 -0
- package/util/getGzipCompressed.d.ts +5 -0
- package/util/getGzipCompressed.js +23 -0
- package/util/getGzipDecompressed.d.ts +5 -0
- package/util/getGzipDecompressed.js +24 -0
- package/util/getWithoutHash.d.ts +4 -0
- package/util/getWithoutHash.js +18 -0
- package/util/getWithoutParameter.d.ts +4 -0
- package/util/getWithoutParameter.js +18 -0
- package/util/index.d.ts +11 -0
- package/util/index.js +25 -0
- package/util/isUndefined.d.ts +4 -0
- package/util/isUndefined.js +13 -0
- package/util/promiseChunks.d.ts +5 -0
- package/util/promiseChunks.js +19 -0
- package/util/sleep.d.ts +1 -0
- package/util/sleep.js +7 -0
- package/webWorker/index.d.ts +5 -0
- package/webWorker/index.js +9 -0
- package/xml/getXml.d.ts +1 -0
- package/xml/getXml.js +18 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWithoutHash = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Get a URL without the parameter query.
|
|
6
|
+
*/
|
|
7
|
+
const getWithoutHash = (input) => {
|
|
8
|
+
let response = input;
|
|
9
|
+
// Contains parameter query
|
|
10
|
+
if (-1 !== response.indexOf("#")) {
|
|
11
|
+
const split = response.split("#");
|
|
12
|
+
if (split.length > 1) {
|
|
13
|
+
response = split[0];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return response;
|
|
17
|
+
};
|
|
18
|
+
exports.getWithoutHash = getWithoutHash;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWithoutParameter = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Get a URL without the parameter query.
|
|
6
|
+
*/
|
|
7
|
+
const getWithoutParameter = (input) => {
|
|
8
|
+
let response = input;
|
|
9
|
+
// Contains parameter query
|
|
10
|
+
if (-1 !== response.indexOf("?")) {
|
|
11
|
+
const split = response.split("?");
|
|
12
|
+
if (split.length > 1) {
|
|
13
|
+
response = split[0];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return response;
|
|
17
|
+
};
|
|
18
|
+
exports.getWithoutParameter = getWithoutParameter;
|
package/util/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { defaultTo } from "./defaultTo";
|
|
2
|
+
export { getBrotliCompressed } from "./getBrotliCompressed";
|
|
3
|
+
export { getBrotliDecompressed } from "./getBrotliDecompressed";
|
|
4
|
+
export { getClean } from "./getClean";
|
|
5
|
+
export { getGzipCompressed } from "./getGzipCompressed";
|
|
6
|
+
export { getGzipDecompressed } from "./getGzipDecompressed";
|
|
7
|
+
export { getWithoutHash } from "./getWithoutHash";
|
|
8
|
+
export { getWithoutParameter } from "./getWithoutParameter";
|
|
9
|
+
export { isUndefined } from "./isUndefined";
|
|
10
|
+
export { promiseChunks } from "./promiseChunks";
|
|
11
|
+
export { sleep } from "./sleep";
|
package/util/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sleep = exports.promiseChunks = exports.isUndefined = exports.getWithoutParameter = exports.getWithoutHash = exports.getGzipDecompressed = exports.getGzipCompressed = exports.getClean = exports.getBrotliDecompressed = exports.getBrotliCompressed = exports.defaultTo = void 0;
|
|
4
|
+
var defaultTo_1 = require("./defaultTo");
|
|
5
|
+
Object.defineProperty(exports, "defaultTo", { enumerable: true, get: function () { return defaultTo_1.defaultTo; } });
|
|
6
|
+
var getBrotliCompressed_1 = require("./getBrotliCompressed");
|
|
7
|
+
Object.defineProperty(exports, "getBrotliCompressed", { enumerable: true, get: function () { return getBrotliCompressed_1.getBrotliCompressed; } });
|
|
8
|
+
var getBrotliDecompressed_1 = require("./getBrotliDecompressed");
|
|
9
|
+
Object.defineProperty(exports, "getBrotliDecompressed", { enumerable: true, get: function () { return getBrotliDecompressed_1.getBrotliDecompressed; } });
|
|
10
|
+
var getClean_1 = require("./getClean");
|
|
11
|
+
Object.defineProperty(exports, "getClean", { enumerable: true, get: function () { return getClean_1.getClean; } });
|
|
12
|
+
var getGzipCompressed_1 = require("./getGzipCompressed");
|
|
13
|
+
Object.defineProperty(exports, "getGzipCompressed", { enumerable: true, get: function () { return getGzipCompressed_1.getGzipCompressed; } });
|
|
14
|
+
var getGzipDecompressed_1 = require("./getGzipDecompressed");
|
|
15
|
+
Object.defineProperty(exports, "getGzipDecompressed", { enumerable: true, get: function () { return getGzipDecompressed_1.getGzipDecompressed; } });
|
|
16
|
+
var getWithoutHash_1 = require("./getWithoutHash");
|
|
17
|
+
Object.defineProperty(exports, "getWithoutHash", { enumerable: true, get: function () { return getWithoutHash_1.getWithoutHash; } });
|
|
18
|
+
var getWithoutParameter_1 = require("./getWithoutParameter");
|
|
19
|
+
Object.defineProperty(exports, "getWithoutParameter", { enumerable: true, get: function () { return getWithoutParameter_1.getWithoutParameter; } });
|
|
20
|
+
var isUndefined_1 = require("./isUndefined");
|
|
21
|
+
Object.defineProperty(exports, "isUndefined", { enumerable: true, get: function () { return isUndefined_1.isUndefined; } });
|
|
22
|
+
var promiseChunks_1 = require("./promiseChunks");
|
|
23
|
+
Object.defineProperty(exports, "promiseChunks", { enumerable: true, get: function () { return promiseChunks_1.promiseChunks; } });
|
|
24
|
+
var sleep_1 = require("./sleep");
|
|
25
|
+
Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return sleep_1.sleep; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isUndefined = void 0;
|
|
4
|
+
const defaultTo_1 = require("./defaultTo");
|
|
5
|
+
const undefinedValue = '__!!UNDEFINED!!__';
|
|
6
|
+
/**
|
|
7
|
+
* Check to see if a value is undefined.
|
|
8
|
+
*/
|
|
9
|
+
const isUndefined = (instance, keys) => {
|
|
10
|
+
const value = (0, defaultTo_1.defaultTo)(instance, keys, undefinedValue);
|
|
11
|
+
return undefinedValue === value;
|
|
12
|
+
};
|
|
13
|
+
exports.isUndefined = isUndefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.promiseChunks = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
/**
|
|
6
|
+
* Chunk a queue of promises into controlled chunks to prevent overloading.
|
|
7
|
+
* https://stackoverflow.com/a/53964407
|
|
8
|
+
*/
|
|
9
|
+
const promiseChunks = async (promises, size) => {
|
|
10
|
+
const batches = (0, lodash_1.chunk)(promises, size);
|
|
11
|
+
let results = [];
|
|
12
|
+
while (batches.length) {
|
|
13
|
+
const batch = batches.shift();
|
|
14
|
+
const result = await Promise.all(batch);
|
|
15
|
+
results.push(result);
|
|
16
|
+
}
|
|
17
|
+
return (0, lodash_1.flatten)(results);
|
|
18
|
+
};
|
|
19
|
+
exports.promiseChunks = promiseChunks;
|
package/util/sleep.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sleep: (seconds: number) => Promise<void>;
|
package/util/sleep.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebWorkerSta = void 0;
|
|
4
|
+
var WebWorkerSta;
|
|
5
|
+
(function (WebWorkerSta) {
|
|
6
|
+
WebWorkerSta["ERROR"] = "ERROR";
|
|
7
|
+
WebWorkerSta["SUCCESS"] = "SUCCESS";
|
|
8
|
+
WebWorkerSta["PROGRESS"] = "PROGRESS";
|
|
9
|
+
})(WebWorkerSta || (exports.WebWorkerSta = WebWorkerSta = {}));
|
package/xml/getXml.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getXml: (url: string) => Promise<string>;
|
package/xml/getXml.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getXml = void 0;
|
|
4
|
+
const axios_1 = require("../axios");
|
|
5
|
+
const getXml = async (url) => {
|
|
6
|
+
let response = '';
|
|
7
|
+
const apiResponse = await (0, axios_1.get)(url);
|
|
8
|
+
if (apiResponse.isSuccess()) {
|
|
9
|
+
response = apiResponse.getBody()
|
|
10
|
+
.toString();
|
|
11
|
+
// Trim the contents
|
|
12
|
+
response = response.trim();
|
|
13
|
+
// Remove tabs, new lines, double spaces
|
|
14
|
+
response = response.replace(/[ ]{2}|\r\n|\n|\r|\t/gm, '');
|
|
15
|
+
}
|
|
16
|
+
return response;
|
|
17
|
+
};
|
|
18
|
+
exports.getXml = getXml;
|