@8ms/helpers 1.40.0 → 1.40.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/api/ApiResponse.d.mts +73 -0
- package/dist/api/ApiResponse.mjs +91 -0
- package/dist/api/index.d.mts +1 -11
- package/dist/api/isError.d.mts +9 -0
- package/dist/api/isError.mjs +7 -0
- package/dist/api/isSuccess.d.mts +9 -0
- package/dist/api/isSuccess.mjs +7 -0
- package/dist/api/response.d.mts +2 -0
- package/dist/api/response.mjs +9 -0
- package/dist/array/contains.d.mts +11 -0
- package/dist/array/contains.mjs +7 -0
- package/dist/array/getArray.d.mts +10 -0
- package/dist/array/getArray.mjs +8 -0
- package/dist/atInternet/request.d.mts +31 -0
- package/dist/atInternet/request.mjs +1 -0
- package/dist/aws/athenaExpress/initClient.d.mts +15 -0
- package/dist/aws/athenaExpress/initClient.mjs +28 -0
- package/dist/aws/athenaExpress/query.d.mts +10 -0
- package/dist/aws/athenaExpress/query.mjs +13 -0
- package/dist/aws/ec2/initClient.d.mts +14 -0
- package/dist/aws/ec2/initClient.mjs +18 -0
- package/dist/aws/ec2/startInstances.d.mts +13 -0
- package/dist/aws/ec2/startInstances.mjs +17 -0
- package/dist/aws/ec2/stopInstances.d.mts +14 -0
- package/dist/aws/ec2/stopInstances.mjs +18 -0
- package/dist/aws/ecs/getClusters.d.mts +11 -0
- package/dist/aws/ecs/getClusters.mjs +23 -0
- package/dist/aws/ecs/getTaskDefinitions.d.mts +16 -0
- package/dist/aws/ecs/getTaskDefinitions.mjs +26 -0
- package/dist/aws/ecs/getTasks.d.mts +19 -0
- package/dist/aws/ecs/getTasks.mjs +29 -0
- package/dist/aws/ecs/initClient.d.mts +14 -0
- package/dist/aws/ecs/initClient.mjs +18 -0
- package/dist/aws/ecs/runTask.d.mts +19 -0
- package/dist/aws/ecs/runTask.mjs +24 -0
- package/dist/aws/getConfig.d.mts +18 -0
- package/dist/aws/getConfig.mjs +17 -0
- package/dist/aws/glue/initClient.d.mts +13 -0
- package/dist/aws/glue/initClient.mjs +17 -0
- package/dist/aws/glue/invoke.d.mts +11 -0
- package/dist/aws/glue/invoke.mjs +14 -0
- package/dist/aws/isResponse200.d.mts +11 -0
- package/dist/aws/isResponse200.mjs +16 -0
- package/dist/aws/lambda/getHandlerPath.d.mts +7 -0
- package/dist/aws/lambda/getHandlerPath.mjs +6 -0
- package/dist/aws/lambda/initClient.d.mts +13 -0
- package/dist/aws/lambda/initClient.mjs +17 -0
- package/dist/aws/lambda/invoke.d.mts +15 -0
- package/dist/aws/lambda/invoke.mjs +31 -0
- package/dist/aws/s3/copyFile.d.mts +18 -0
- package/dist/aws/s3/copyFile.mjs +15 -0
- package/dist/aws/s3/deleteFile.d.mts +14 -0
- package/dist/aws/s3/deleteFile.mjs +14 -0
- package/dist/aws/s3/deleteFiles.d.mts +14 -0
- package/dist/aws/s3/deleteFiles.mjs +14 -0
- package/dist/aws/s3/deleteFolder.d.mts +14 -0
- package/dist/aws/s3/deleteFolder.mjs +26 -0
- package/dist/aws/s3/getGlueJson.d.mts +12 -0
- package/dist/aws/s3/getGlueJson.mjs +8 -0
- package/dist/aws/s3/getPresignedPost.d.mts +28 -0
- package/dist/aws/s3/getPresignedPost.mjs +19 -0
- package/dist/aws/s3/getSignedUrl.d.mts +19 -0
- package/dist/aws/s3/getSignedUrl.mjs +17 -0
- package/dist/aws/s3/initClient.d.mts +15 -0
- package/dist/aws/s3/initClient.mjs +17 -0
- package/dist/aws/s3/isFileExists.d.mts +11 -0
- package/dist/aws/s3/isFileExists.mjs +21 -0
- package/dist/aws/s3/listFiles.d.mts +14 -0
- package/dist/aws/s3/listFiles.mjs +27 -0
- package/dist/aws/s3/listFilesIteratively.d.mts +11 -0
- package/dist/aws/s3/listFilesIteratively.mjs +40 -0
- package/dist/aws/s3/listFolders.d.mts +14 -0
- package/dist/aws/s3/listFolders.mjs +23 -0
- package/dist/aws/s3/moveFile.d.mts +16 -0
- package/dist/aws/s3/moveFile.mjs +18 -0
- package/dist/aws/s3/readBrotli.d.mts +18 -0
- package/dist/aws/s3/readBrotli.mjs +20 -0
- package/dist/aws/s3/readBuffer.d.mts +19 -0
- package/dist/aws/s3/readBuffer.mjs +29 -0
- package/dist/aws/s3/readFile.d.mts +38 -0
- package/dist/aws/s3/readFile.mjs +64 -0
- package/dist/aws/s3/readGzip.d.mts +18 -0
- package/dist/aws/s3/readGzip.mjs +20 -0
- package/dist/aws/s3/writeBrotli.d.mts +20 -0
- package/dist/aws/s3/writeBrotli.mjs +18 -0
- package/dist/aws/s3/writeFile.d.mts +18 -0
- package/dist/aws/s3/writeFile.mjs +16 -0
- package/dist/aws/s3/writeGzip.d.mts +20 -0
- package/dist/aws/s3/writeGzip.mjs +18 -0
- package/dist/aws/s3/writePresignedPost.d.mts +24 -0
- package/dist/aws/s3/writePresignedPost.mjs +28 -0
- package/dist/aws/s3/writeUrlContents.d.mts +16 -0
- package/dist/aws/s3/writeUrlContents.mjs +19 -0
- package/dist/aws/s3cache/getCache.d.mts +19 -0
- package/dist/aws/s3cache/getCache.mjs +25 -0
- package/dist/aws/s3cache/getKey.d.mts +15 -0
- package/dist/aws/s3cache/getKey.mjs +15 -0
- package/dist/aws/s3cache/index.d.mts +1 -1
- package/dist/aws/s3cache/saveCache.d.mts +16 -0
- package/dist/aws/s3cache/saveCache.mjs +14 -0
- package/dist/aws/s3cache/updateCache.d.mts +18 -0
- package/dist/aws/s3cache/updateCache.mjs +26 -0
- package/dist/aws/ses/SimpleEmail.d.mts +79 -0
- package/dist/aws/ses/SimpleEmail.mjs +122 -0
- package/dist/aws/ses/initClient.d.mts +15 -0
- package/dist/aws/ses/initClient.mjs +17 -0
- package/dist/aws/sqs/addToQueue.d.mts +35 -0
- package/dist/aws/sqs/addToQueue.mjs +20 -0
- package/dist/aws/sqs/deleteFromQueue.d.mts +16 -0
- package/dist/aws/sqs/deleteFromQueue.mjs +15 -0
- package/dist/aws/sqs/index.d.mts +18 -0
- package/dist/aws/sqs/initClient.d.mts +15 -0
- package/dist/aws/sqs/initClient.mjs +17 -0
- package/dist/aws/sqs/isEventSqs.d.mts +1 -0
- package/dist/aws/sqs/isEventSqs.mjs +1 -0
- package/dist/aws/ssm/getParameter.d.mts +16 -0
- package/dist/aws/ssm/getParameter.mjs +22 -0
- package/dist/aws/ssm/initClient.d.mts +15 -0
- package/dist/aws/ssm/initClient.mjs +17 -0
- package/dist/axios/delete.d.mts +14 -0
- package/dist/axios/delete.mjs +25 -0
- package/dist/axios/get.d.mts +16 -0
- package/dist/axios/get.mjs +24 -0
- package/dist/axios/post.d.mts +18 -0
- package/dist/axios/post.mjs +25 -0
- package/dist/boolean/getBoolean.d.mts +11 -0
- package/dist/boolean/getBoolean.mjs +11 -0
- package/dist/brightData/getCustomerId.d.mts +13 -0
- package/dist/brightData/getCustomerId.mjs +10 -0
- package/dist/brightData/getZone.d.mts +12 -0
- package/dist/brightData/getZone.mjs +10 -0
- package/dist/brightData/param.d.mts +11 -0
- package/dist/brightData/param.mjs +4 -0
- package/dist/brightData/serpApi/buildGoogleSerpUrl.d.mts +34 -0
- package/dist/brightData/serpApi/buildGoogleSerpUrl.mjs +100 -0
- package/dist/brightData/serpApi/buildGoogleTrendsUrl.d.mts +24 -0
- package/dist/brightData/serpApi/buildGoogleTrendsUrl.mjs +51 -0
- package/dist/brightData/serpApi/getAsyncRequestId.d.mts +17 -0
- package/dist/brightData/serpApi/getAsyncRequestId.mjs +35 -0
- package/dist/brightData/serpApi/getAsyncResults.d.mts +15 -0
- package/dist/brightData/serpApi/getAsyncResults.mjs +25 -0
- package/dist/brightData/serpApi/getRealtime.d.mts +13 -0
- package/dist/brightData/serpApi/getRealtime.mjs +25 -0
- package/dist/brightData/serpApi/type.d.mts +13 -0
- package/dist/brightData/serpApi/type.mjs +14 -0
- package/dist/brightData/webScraperIde/getBatch.d.mts +17 -0
- package/dist/brightData/webScraperIde/getBatch.mjs +22 -0
- package/dist/brightData/webScraperIde/getRealtime.d.mts +16 -0
- package/dist/brightData/webScraperIde/getRealtime.mjs +44 -0
- package/dist/chunk-y_GBKt04.mjs +5 -0
- package/dist/class/BaseClass.d.mts +45 -0
- package/dist/class/BaseClass.mjs +46 -0
- package/dist/crypto/getDecrypt.d.mts +16 -0
- package/dist/crypto/getDecrypt.mjs +13 -0
- package/dist/crypto/getEncrypt.d.mts +16 -0
- package/dist/crypto/getEncrypt.mjs +13 -0
- package/dist/crypto/getRandom.d.mts +12 -0
- package/dist/crypto/getRandom.mjs +10 -0
- package/dist/crypto/getSha256.d.mts +12 -0
- package/dist/crypto/getSha256.mjs +13 -0
- package/dist/date/format.d.mts +13 -0
- package/dist/date/format.mjs +17 -0
- package/dist/date/getDate.d.mts +17 -0
- package/dist/date/getDate.mjs +107 -0
- package/dist/date/getDatesBetween.d.mts +16 -0
- package/dist/date/getDatesBetween.mjs +37 -0
- package/dist/date/getDurationHours.d.mts +11 -0
- package/dist/date/getDurationHours.mjs +24 -0
- package/dist/date/getDurationMinutes.d.mts +11 -0
- package/dist/date/getDurationMinutes.mjs +22 -0
- package/dist/date/getFinancialYear.d.mts +12 -0
- package/dist/date/getFinancialYear.mjs +31 -0
- package/dist/date/getFinancialYearToDate.d.mts +10 -0
- package/dist/date/getFinancialYearToDate.mjs +15 -0
- package/dist/date/getFinancialYearToYesterday.d.mts +10 -0
- package/dist/date/getFinancialYearToYesterday.mjs +15 -0
- package/dist/date/getFinancialYearWeeks.d.mts +12 -0
- package/dist/date/getFinancialYearWeeks.mjs +23 -0
- package/dist/date/getLastWeek.d.mts +16 -0
- package/dist/date/getLastWeek.mjs +30 -0
- package/dist/date/getMax.d.mts +16 -0
- package/dist/date/getMax.mjs +21 -0
- package/dist/date/getMidnight.d.mts +2 -0
- package/dist/date/getMidnight.mjs +11 -0
- package/dist/date/getMin.d.mts +16 -0
- package/dist/date/getMin.mjs +21 -0
- package/dist/date/getMonday.d.mts +18 -0
- package/dist/date/getMonday.mjs +31 -0
- package/dist/date/getNumber.d.mts +10 -0
- package/dist/date/getNumber.mjs +17 -0
- package/dist/date/getPredefinedTimeframe.d.mts +13 -0
- package/dist/date/getPredefinedTimeframe.mjs +15 -0
- package/dist/date/getSunday.d.mts +18 -0
- package/dist/date/getSunday.mjs +27 -0
- package/dist/date/getThisWeek.d.mts +16 -0
- package/dist/date/getThisWeek.mjs +36 -0
- package/dist/date/getTimeZoned.d.mts +2 -0
- package/dist/date/getTimeZoned.mjs +53 -0
- package/dist/date/getToday.d.mts +12 -0
- package/dist/date/getToday.mjs +21 -0
- package/dist/date/getTodayYmd.d.mts +7 -0
- package/dist/date/getTodayYmd.mjs +16 -0
- package/dist/date/getTodayYmdhis.d.mts +7 -0
- package/dist/date/getTodayYmdhis.mjs +16 -0
- package/dist/date/getTwoWeeksAgo.d.mts +16 -0
- package/dist/date/getTwoWeeksAgo.mjs +36 -0
- package/dist/date/getWeeksAgo.d.mts +22 -0
- package/dist/date/getWeeksAgo.mjs +22 -0
- package/dist/date/getYesterday.d.mts +15 -0
- package/dist/date/getYesterday.mjs +24 -0
- package/dist/date/index.d.mts +1 -57
- package/dist/date/isDateValid.d.mts +11 -0
- package/dist/date/isDateValid.mjs +16 -0
- package/dist/date/isLastWeek.d.mts +12 -0
- package/dist/date/isLastWeek.mjs +11 -0
- package/dist/date/isThisWeek.d.mts +12 -0
- package/dist/date/isThisWeek.mjs +11 -0
- package/dist/date/parseExcelDate.d.mts +12 -0
- package/dist/date/parseExcelDate.mjs +18 -0
- package/dist/environment/getEnvironment.d.mts +9 -0
- package/dist/environment/getEnvironment.mjs +27 -0
- package/dist/environment/isAws.d.mts +7 -0
- package/dist/environment/isAws.mjs +8 -0
- package/dist/environment/isDevelopment.d.mts +4 -0
- package/dist/environment/isDevelopment.mjs +6 -0
- package/dist/environment/isLocalhost.d.mts +7 -0
- package/dist/environment/isLocalhost.mjs +15 -0
- package/dist/environment/isProduction.d.mts +4 -0
- package/dist/environment/isProduction.mjs +6 -0
- package/dist/environment/isStaging.d.mts +4 -0
- package/dist/environment/isStaging.mjs +6 -0
- package/dist/environment/isVercel.d.mts +7 -0
- package/dist/environment/isVercel.mjs +7 -0
- package/dist/eskimi/ageGroups.d.mts +7 -0
- package/dist/eskimi/ageGroups.mjs +41 -0
- package/dist/eskimi/campaign.d.mts +22 -0
- package/dist/eskimi/campaign.mjs +1 -0
- package/dist/eskimi/devices.d.mts +7 -0
- package/dist/eskimi/devices.mjs +10 -0
- package/dist/eskimi/endpoints.d.mts +18 -0
- package/dist/eskimi/endpoints.mjs +16 -0
- package/dist/eskimi/genders.d.mts +7 -0
- package/dist/eskimi/genders.mjs +10 -0
- package/dist/eskimi/getAccessToken.d.mts +14 -0
- package/dist/eskimi/getAccessToken.mjs +19 -0
- package/dist/eskimi/getAgeGroup.d.mts +11 -0
- package/dist/eskimi/getAgeGroup.mjs +12 -0
- package/dist/eskimi/getCampaignIds.d.mts +11 -0
- package/dist/eskimi/getCampaignIds.mjs +9 -0
- package/dist/eskimi/getData.d.mts +13 -0
- package/dist/eskimi/getData.mjs +20 -0
- package/dist/eskimi/getDevice.d.mts +11 -0
- package/dist/eskimi/getDevice.mjs +12 -0
- package/dist/eskimi/getGender.d.mts +11 -0
- package/dist/eskimi/getGender.mjs +12 -0
- package/dist/file/createDirectory.d.mts +13 -0
- package/dist/file/createDirectory.mjs +16 -0
- package/dist/file/writeFile.d.mts +1 -0
- package/dist/file/writeFile.mjs +1 -0
- package/dist/getMidnight-Cr5sAuOj.d.mts +12 -0
- package/dist/getTimeZoned-D7uY_mE6.d.mts +15 -0
- package/dist/global/forceUpdate.d.mts +12 -0
- package/dist/global/forceUpdate.mjs +16 -0
- package/dist/global/init.d.mts +16 -0
- package/dist/global/init.mjs +16 -0
- package/dist/global/isSet.d.mts +12 -0
- package/dist/global/isSet.mjs +9 -0
- package/dist/global/maxCache.d.mts +12 -0
- package/dist/global/maxCache.mjs +15 -0
- package/dist/global/read.d.mts +12 -0
- package/dist/global/read.mjs +15 -0
- package/dist/global.d.mts +42 -0
- package/dist/google/bigQuery/IsTableExists.d.mts +17 -0
- package/dist/google/bigQuery/IsTableExists.mjs +19 -0
- package/dist/google/bigQuery/createDataset.d.mts +17 -0
- package/dist/google/bigQuery/createDataset.mjs +15 -0
- package/dist/google/bigQuery/createTable.d.mts +20 -0
- package/dist/google/bigQuery/createTable.mjs +21 -0
- package/dist/google/bigQuery/getClient.d.mts +11 -0
- package/dist/google/bigQuery/getClient.mjs +19 -0
- package/dist/google/bigQuery/getDatasets.d.mts +17 -0
- package/dist/google/bigQuery/getDatasets.mjs +17 -0
- package/dist/google/bigQuery/getTables.d.mts +14 -0
- package/dist/google/bigQuery/getTables.mjs +13 -0
- package/dist/google/bigQuery/initClient.d.mts +17 -0
- package/dist/google/bigQuery/initClient.mjs +27 -0
- package/dist/google/bigQuery/isDatasetExists.d.mts +16 -0
- package/dist/google/bigQuery/isDatasetExists.mjs +20 -0
- package/dist/google/bigQuery/loadData.d.mts +23 -0
- package/dist/google/bigQuery/loadData.mjs +20 -0
- package/dist/google/bigQuery/query.d.mts +24 -0
- package/dist/google/bigQuery/query.mjs +10 -0
- package/dist/google/getConfig.d.mts +24 -0
- package/dist/google/getConfig.mjs +21 -0
- package/dist/google/sheets/getAssociatedData.d.mts +18 -0
- package/dist/google/sheets/getAssociatedData.mjs +35 -0
- package/dist/google/sheets/getBatchData.d.mts +23 -0
- package/dist/google/sheets/getBatchData.mjs +15 -0
- package/dist/google/sheets/initClient.d.mts +16 -0
- package/dist/google/sheets/initClient.mjs +21 -0
- package/dist/google/sheets/isCellNa.d.mts +11 -0
- package/dist/google/sheets/isCellNa.mjs +7 -0
- package/dist/google/storage/copyToCloud.d.mts +18 -0
- package/dist/google/storage/copyToCloud.mjs +10 -0
- package/dist/google/storage/getClient.d.mts +12 -0
- package/dist/google/storage/getClient.mjs +19 -0
- package/dist/google/storage/initClient.d.mts +18 -0
- package/dist/google/storage/initClient.mjs +27 -0
- package/dist/google/storage/isFileExists.d.mts +12 -0
- package/dist/google/storage/isFileExists.mjs +11 -0
- package/dist/google/storage/writeFile.d.mts +13 -0
- package/dist/google/storage/writeFile.mjs +28 -0
- package/dist/googleAds/getCustomer.d.mts +12 -0
- package/dist/googleAds/getCustomer.mjs +13 -0
- package/dist/googleAds/initClient.d.mts +20 -0
- package/dist/googleAds/initClient.mjs +25 -0
- package/dist/googleAds/keywordPlanner/request.d.mts +21 -0
- package/dist/googleAds/keywordPlanner/request.mjs +13 -0
- package/dist/googleAds/keywordPlanner/response.d.mts +28 -0
- package/dist/googleAds/keywordPlanner/response.mjs +1 -0
- package/dist/index-CiGy7MyK.d.mts +58 -0
- package/dist/index-gGQBTUJU.d.mts +12 -0
- package/dist/initClients.d.mts +46 -0
- package/dist/initClients.mjs +56 -0
- package/dist/json/getJsonNewline.d.mts +9 -0
- package/dist/json/getJsonNewline.mjs +7 -0
- package/dist/json/isJson.d.mts +12 -0
- package/dist/json/isJson.mjs +17 -0
- package/dist/littleWarden/getUrlStatus.d.mts +14 -0
- package/dist/littleWarden/getUrlStatus.mjs +16 -0
- package/dist/littleWarden/isAllGood.d.mts +11 -0
- package/dist/littleWarden/isAllGood.mjs +12 -0
- package/dist/littleWarden/isDanger.d.mts +11 -0
- package/dist/littleWarden/isDanger.mjs +12 -0
- package/dist/littleWarden/isWarning.d.mts +11 -0
- package/dist/littleWarden/isWarning.mjs +12 -0
- package/dist/lumar/api/buildRequest.d.mts +28 -0
- package/dist/lumar/api/buildRequest.mjs +58 -0
- package/dist/lumar/api/filter.d.mts +8 -0
- package/dist/lumar/api/filter.mjs +1 -0
- package/dist/lumar/api/getData.d.mts +11 -0
- package/dist/lumar/api/getData.mjs +10 -0
- package/dist/lumar/api/initClient.d.mts +17 -0
- package/dist/lumar/api/initClient.mjs +28 -0
- package/dist/lumar/api/operands.d.mts +13 -0
- package/dist/lumar/api/operands.mjs +13 -0
- package/dist/lumar/api/orders.d.mts +11 -0
- package/dist/lumar/api/orders.mjs +7 -0
- package/dist/lumar/api/reports.d.mts +13 -0
- package/dist/lumar/api/reports.mjs +13 -0
- package/dist/lumar/graphql/columns.d.mts +31 -0
- package/dist/lumar/graphql/columns.mjs +31 -0
- package/dist/lumar/graphql/getData.d.mts +15 -0
- package/dist/lumar/graphql/getData.mjs +18 -0
- package/dist/lumar/graphql/getReportKey.d.mts +14 -0
- package/dist/lumar/graphql/getReportKey.mjs +9 -0
- package/dist/lumar/graphql/initClient.d.mts +16 -0
- package/dist/lumar/graphql/initClient.mjs +34 -0
- package/dist/lumar/graphql/operands.d.mts +18 -0
- package/dist/lumar/graphql/operands.mjs +18 -0
- package/dist/lumar/graphql/queries/crawl.d.mts +8 -0
- package/dist/lumar/graphql/queries/crawl.mjs +1 -0
- package/dist/lumar/graphql/queries/getCrawls.d.mts +23 -0
- package/dist/lumar/graphql/queries/getCrawls.mjs +33 -0
- package/dist/lumar/graphql/queries/getReportDifferences.d.mts +30 -0
- package/dist/lumar/graphql/queries/getReportDifferences.mjs +37 -0
- package/dist/lumar/graphql/queries/getRows.d.mts +50 -0
- package/dist/lumar/graphql/queries/getRows.mjs +57 -0
- package/dist/lumar/graphql/queries/getTotals.d.mts +33 -0
- package/dist/lumar/graphql/queries/getTotals.mjs +40 -0
- package/dist/lumar/graphql/queries/row.d.mts +159 -0
- package/dist/lumar/graphql/queries/row.mjs +1 -0
- package/dist/lumar/graphql/reportTemplates.d.mts +70 -0
- package/dist/lumar/graphql/reportTemplates.mjs +70 -0
- package/dist/lumar/graphql/reportTypes.d.mts +9 -0
- package/dist/lumar/graphql/reportTypes.mjs +9 -0
- package/dist/myTarget/getAccessToken.d.mts +14 -0
- package/dist/myTarget/getAccessToken.mjs +19 -0
- package/dist/myTarget/request.d.mts +15 -0
- package/dist/myTarget/request.mjs +17 -0
- package/dist/nextAuth/isSessionReady.d.mts +8 -0
- package/dist/nextAuth/isSessionReady.mjs +10 -0
- package/dist/nextJs/getIp.d.mts +11 -0
- package/dist/nextJs/getIp.mjs +11 -0
- package/dist/nextJs/getUserAgent.d.mts +11 -0
- package/dist/nextJs/getUserAgent.mjs +7 -0
- package/dist/number/format.d.mts +13 -0
- package/dist/number/format.mjs +16 -0
- package/dist/number/getCurrency.d.mts +15 -0
- package/dist/number/getCurrency.mjs +17 -0
- package/dist/number/getDecimal.d.mts +11 -0
- package/dist/number/getDecimal.mjs +11 -0
- package/dist/number/getDivide.d.mts +13 -0
- package/dist/number/getDivide.mjs +17 -0
- package/dist/number/getNumber.d.mts +13 -0
- package/dist/number/getNumber.mjs +23 -0
- package/dist/number/getPercentIncrease.d.mts +16 -0
- package/dist/number/getPercentIncrease.mjs +13 -0
- package/dist/object/replaceKeys.d.mts +15 -0
- package/dist/object/replaceKeys.mjs +27 -0
- package/dist/prisma/getDecimal.d.mts +11 -0
- package/dist/prisma/getDecimal.mjs +17 -0
- package/dist/prisma/initClient.d.mts +8 -0
- package/dist/prisma/initClient.mjs +25 -0
- package/dist/response-CKsarnP-.d.mts +11 -0
- package/dist/snapchat/getAccessToken.d.mts +14 -0
- package/dist/snapchat/getAccessToken.mjs +29 -0
- package/dist/sorting/byNumberAscending.d.mts +13 -0
- package/dist/sorting/byNumberAscending.mjs +13 -0
- package/dist/sorting/byNumberDescending.d.mts +13 -0
- package/dist/sorting/byNumberDescending.mjs +13 -0
- package/dist/sorting/byStringAscending.d.mts +13 -0
- package/dist/sorting/byStringAscending.mjs +13 -0
- package/dist/sorting/byStringDescending.d.mts +13 -0
- package/dist/sorting/byStringDescending.mjs +13 -0
- package/dist/stream/sort.d.mts +16 -0
- package/dist/stream/sort.mjs +46 -0
- package/dist/string/getCapitalised.d.mts +15 -0
- package/dist/string/getCapitalised.mjs +13 -0
- package/dist/string/getClean.d.mts +32 -0
- package/dist/string/getClean.mjs +28 -0
- package/dist/string/getDecoded.d.mts +14 -0
- package/dist/string/getDecoded.mjs +19 -0
- package/dist/string/getFolder.d.mts +12 -0
- package/dist/string/getFolder.mjs +10 -0
- package/dist/string/getProperCase.d.mts +13 -0
- package/dist/string/getProperCase.mjs +14 -0
- package/dist/string/getString.d.mts +11 -0
- package/dist/string/getString.mjs +18 -0
- package/dist/string/getStringFromStream.d.mts +12 -0
- package/dist/string/getStringFromStream.mjs +15 -0
- package/dist/string/getWithoutAccents.d.mts +13 -0
- package/dist/string/getWithoutAccents.mjs +11 -0
- package/dist/string/getWithoutHtmlTags.d.mts +13 -0
- package/dist/string/getWithoutHtmlTags.mjs +11 -0
- package/dist/string/getWithoutPunctuation.d.mts +13 -0
- package/dist/string/getWithoutPunctuation.mjs +11 -0
- package/dist/string/getWithoutUnderscores.d.mts +12 -0
- package/dist/string/getWithoutUnderscores.mjs +10 -0
- package/dist/string/getWithoutWhitespaces.d.mts +13 -0
- package/dist/string/getWithoutWhitespaces.mjs +11 -0
- package/dist/swr/isAllData.d.mts +11 -0
- package/dist/swr/isAllData.mjs +12 -0
- package/dist/swr/isAnyError.d.mts +11 -0
- package/dist/swr/isAnyError.mjs +12 -0
- package/dist/swr/isAnyLoading.d.mts +11 -0
- package/dist/swr/isAnyLoading.mjs +12 -0
- package/dist/swr/isData.d.mts +11 -0
- package/dist/swr/isData.mjs +7 -0
- package/dist/swr/isError.d.mts +11 -0
- package/dist/swr/isError.mjs +7 -0
- package/dist/swr/isLoading.d.mts +11 -0
- package/dist/swr/isLoading.mjs +9 -0
- package/dist/upTimeRobot/getMonitors.d.mts +1 -0
- package/dist/upTimeRobot/getMonitors.mjs +3 -0
- package/dist/upTimeRobot/logTypes.d.mts +9 -0
- package/dist/upTimeRobot/logTypes.mjs +9 -0
- package/dist/upTimeRobot/monitorStatuses.d.mts +10 -0
- package/dist/upTimeRobot/monitorStatuses.mjs +10 -0
- package/dist/upTimeRobot/monitorSubTypes.d.mts +12 -0
- package/dist/upTimeRobot/monitorSubTypes.mjs +12 -0
- package/dist/upTimeRobot/monitorTypes.d.mts +10 -0
- package/dist/upTimeRobot/monitorTypes.mjs +10 -0
- package/dist/upTimeRobot/requestStatuses.d.mts +7 -0
- package/dist/upTimeRobot/requestStatuses.mjs +7 -0
- package/dist/url/buildParameters.d.mts +13 -0
- package/dist/url/buildParameters.mjs +17 -0
- package/dist/url/buildRelative.d.mts +13 -0
- package/dist/url/buildRelative.mjs +13 -0
- package/dist/url/buildUrl.d.mts +16 -0
- package/dist/url/buildUrl.mjs +18 -0
- package/dist/url/isAbsolute.d.mts +11 -0
- package/dist/url/isAbsolute.mjs +14 -0
- package/dist/url/isRelative.d.mts +11 -0
- package/dist/url/isRelative.mjs +7 -0
- package/dist/url/url.d.mts +9 -0
- package/dist/url/url.mjs +1 -0
- package/dist/url/writeUrlContents.d.mts +16 -0
- package/dist/url/writeUrlContents.mjs +30 -0
- package/dist/util/defaultTo.d.mts +12 -0
- package/dist/util/defaultTo.mjs +20 -0
- package/dist/util/getBrotliCompressed.d.mts +14 -0
- package/dist/util/getBrotliCompressed.mjs +15 -0
- package/dist/util/getBrotliDecompressed.d.mts +14 -0
- package/dist/util/getBrotliDecompressed.mjs +17 -0
- package/dist/util/getClean.d.mts +18 -0
- package/dist/util/getClean.mjs +15 -0
- package/dist/util/getGzipCompressed.d.mts +14 -0
- package/dist/util/getGzipCompressed.mjs +15 -0
- package/dist/util/getGzipDecompressed.d.mts +14 -0
- package/dist/util/getGzipDecompressed.mjs +17 -0
- package/dist/util/getWithoutHash.d.mts +12 -0
- package/dist/util/getWithoutHash.mjs +14 -0
- package/dist/util/getWithoutParameter.d.mts +12 -0
- package/dist/util/getWithoutParameter.mjs +14 -0
- package/dist/util/isUndefined.d.mts +14 -0
- package/dist/util/isUndefined.mjs +15 -0
- package/dist/util/promiseChunks.d.mts +12 -0
- package/dist/util/promiseChunks.mjs +18 -0
- package/dist/util/sleep.d.mts +7 -0
- package/dist/util/sleep.mjs +6 -0
- package/dist/xml/getXml.d.mts +7 -0
- package/dist/xml/getXml.mjs +14 -0
- package/package.json +247 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LaunchType, NetworkConfiguration, TaskOverride } from "@aws-sdk/client-ecs";
|
|
2
|
+
|
|
3
|
+
//#region src/aws/ecs/runTask.d.ts
|
|
4
|
+
type RunTask = {
|
|
5
|
+
cluster?: string;
|
|
6
|
+
count?: number;
|
|
7
|
+
launchType?: LaunchType;
|
|
8
|
+
networkConfiguration?: NetworkConfiguration;
|
|
9
|
+
overrides?: TaskOverride;
|
|
10
|
+
taskDefinition?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Initialise and run a task
|
|
14
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/RunTaskCommand/
|
|
15
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/RunTaskCommandInput/
|
|
16
|
+
*/
|
|
17
|
+
declare const runTask: (props: RunTask) => Promise<boolean>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { runTask };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
import isResponse200 from "../isResponse200.mjs";
|
|
3
|
+
//#region src/aws/ecs/runTask.ts
|
|
4
|
+
/**
|
|
5
|
+
* Initialise and run a task
|
|
6
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecs/command/RunTaskCommand/
|
|
7
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecs/Interface/RunTaskCommandInput/
|
|
8
|
+
*/
|
|
9
|
+
const runTask = async (props) => {
|
|
10
|
+
let response = false;
|
|
11
|
+
const { RunTaskCommand } = __require("@aws-sdk/client-ecs");
|
|
12
|
+
const runtTaskCommand = new RunTaskCommand({
|
|
13
|
+
cluster: props?.cluster,
|
|
14
|
+
launchType: props?.launchType,
|
|
15
|
+
networkConfiguration: props?.networkConfiguration,
|
|
16
|
+
overrides: props?.overrides,
|
|
17
|
+
taskDefinition: props?.taskDefinition
|
|
18
|
+
});
|
|
19
|
+
const apiResponse = await global.awsEcsClient.send(runtTaskCommand);
|
|
20
|
+
if (isResponse200({ apiResponse })) response = apiResponse;
|
|
21
|
+
return response;
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { runTask };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/aws/getConfig.d.ts
|
|
2
|
+
type Config = {
|
|
3
|
+
accessKeyId: string;
|
|
4
|
+
region: string;
|
|
5
|
+
secretAccessKey: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The config must be in a specific structure, if the properties aren't defined don't specify them as they could be inferred (e.g. Lambda).
|
|
9
|
+
*/
|
|
10
|
+
declare const getConfig: ({
|
|
11
|
+
config,
|
|
12
|
+
isAthenaExpress
|
|
13
|
+
}: {
|
|
14
|
+
config: Config;
|
|
15
|
+
isAthenaExpress?: boolean;
|
|
16
|
+
}) => object;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Config, getConfig as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/aws/getConfig.ts
|
|
2
|
+
/**
|
|
3
|
+
* The config must be in a specific structure, if the properties aren't defined don't specify them as they could be inferred (e.g. Lambda).
|
|
4
|
+
*/
|
|
5
|
+
const getConfig = ({ config, isAthenaExpress }) => {
|
|
6
|
+
let response = { region: config.region };
|
|
7
|
+
if ("" !== config.accessKeyId && "" !== config.secretAccessKey) if (true === isAthenaExpress) {
|
|
8
|
+
response["accessKeyId"] = config.accessKeyId;
|
|
9
|
+
response["secretAccessKey"] = config.secretAccessKey;
|
|
10
|
+
} else response["credentials"] = {
|
|
11
|
+
accessKeyId: config.accessKeyId,
|
|
12
|
+
secretAccessKey: config.secretAccessKey
|
|
13
|
+
};
|
|
14
|
+
return response;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { getConfig as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Config } from "../getConfig.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/aws/glue/initClient.d.ts
|
|
4
|
+
type InitClient = {
|
|
5
|
+
config: Config;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Shorthand function to get the Glue Client.
|
|
9
|
+
* Library: @aws-sdk/client-glue
|
|
10
|
+
*/
|
|
11
|
+
declare const initClient: (props: InitClient) => void;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { initClient as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
import getConfig from "../getConfig.mjs";
|
|
3
|
+
//#region src/aws/glue/initClient.ts
|
|
4
|
+
global.awsGlueClient = null;
|
|
5
|
+
/**
|
|
6
|
+
* Shorthand function to get the Glue Client.
|
|
7
|
+
* Library: @aws-sdk/client-glue
|
|
8
|
+
*/
|
|
9
|
+
const initClient = (props) => {
|
|
10
|
+
if (!global.awsGlueClient) {
|
|
11
|
+
const { GlueClient } = __require("@aws-sdk/client-glue");
|
|
12
|
+
const formattedConfig = getConfig({ config: props.config });
|
|
13
|
+
global.awsGlueClient = new GlueClient(formattedConfig);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { initClient as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/aws/glue/invoke.d.ts
|
|
2
|
+
type Invoke = {
|
|
3
|
+
crawler: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Invoke an AWS Glue Crawler by passing in the name of the Crawler.
|
|
7
|
+
* Library: @aws-sdk/client-glue
|
|
8
|
+
*/
|
|
9
|
+
declare const invoke: (props: Invoke) => Promise<boolean>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { invoke as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
import isResponse200 from "../isResponse200.mjs";
|
|
3
|
+
//#region src/aws/glue/invoke.ts
|
|
4
|
+
/**
|
|
5
|
+
* Invoke an AWS Glue Crawler by passing in the name of the Crawler.
|
|
6
|
+
* Library: @aws-sdk/client-glue
|
|
7
|
+
*/
|
|
8
|
+
const invoke = async (props) => {
|
|
9
|
+
const { StartCrawlerCommand } = __require("@aws-sdk/client-glue");
|
|
10
|
+
const command = new StartCrawlerCommand({ Name: props.crawler });
|
|
11
|
+
return isResponse200({ apiResponse: await global.awsGlueClient.send(command) });
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { invoke as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import defaultTo from "../util/defaultTo.mjs";
|
|
2
|
+
//#region src/aws/isResponse200.ts
|
|
3
|
+
/**
|
|
4
|
+
* Was the API response a 200?
|
|
5
|
+
*/
|
|
6
|
+
const isResponse200 = ({ apiResponse }) => {
|
|
7
|
+
let response = false;
|
|
8
|
+
if (200 === defaultTo({
|
|
9
|
+
defaultValue: 0,
|
|
10
|
+
instance: apiResponse,
|
|
11
|
+
keys: ["$metadata", "httpStatusCode"]
|
|
12
|
+
})) response = true;
|
|
13
|
+
return response;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { isResponse200 as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Config } from "../getConfig.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/aws/lambda/initClient.d.ts
|
|
4
|
+
type InitClient = {
|
|
5
|
+
config: Config;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Shorthand function to get the Lambda Client.
|
|
9
|
+
* Library: @aws-sdk/client-lambda
|
|
10
|
+
*/
|
|
11
|
+
declare const initClient: (props: InitClient) => void;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { initClient as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
import getConfig from "../getConfig.mjs";
|
|
3
|
+
//#region src/aws/lambda/initClient.ts
|
|
4
|
+
global.awsLambdaClient = null;
|
|
5
|
+
/**
|
|
6
|
+
* Shorthand function to get the Lambda Client.
|
|
7
|
+
* Library: @aws-sdk/client-lambda
|
|
8
|
+
*/
|
|
9
|
+
const initClient = (props) => {
|
|
10
|
+
if (!global.awsLambdaClient) {
|
|
11
|
+
const { LambdaClient } = __require("@aws-sdk/client-lambda");
|
|
12
|
+
const formattedConfig = getConfig({ config: props.config });
|
|
13
|
+
global.awsLambdaClient = new LambdaClient(formattedConfig);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { initClient as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/aws/lambda/invoke.d.ts
|
|
2
|
+
type Invoke = {
|
|
3
|
+
awaitResponse?: boolean;
|
|
4
|
+
functionName: string;
|
|
5
|
+
isJson?: boolean;
|
|
6
|
+
payload?: object;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Invoke a AWS Lambda function by passing in the Function name and optional Payload data.
|
|
10
|
+
* Runs asynchronously, doesn't wait for function to fully end.
|
|
11
|
+
* Library: @aws-sdk/client-lambda
|
|
12
|
+
*/
|
|
13
|
+
declare const invoke: (props: Invoke) => Promise<any>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { invoke as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
import ApiResponse from "../../api/ApiResponse.mjs";
|
|
3
|
+
import isResponse200 from "../isResponse200.mjs";
|
|
4
|
+
//#region src/aws/lambda/invoke.ts
|
|
5
|
+
/**
|
|
6
|
+
* Invoke a AWS Lambda function by passing in the Function name and optional Payload data.
|
|
7
|
+
* Runs asynchronously, doesn't wait for function to fully end.
|
|
8
|
+
* Library: @aws-sdk/client-lambda
|
|
9
|
+
*/
|
|
10
|
+
const invoke = async (props) => {
|
|
11
|
+
let response = false;
|
|
12
|
+
const params = {
|
|
13
|
+
FunctionName: props.functionName,
|
|
14
|
+
InvocationType: true === props.awaitResponse ? "RequestResponse" : "Event"
|
|
15
|
+
};
|
|
16
|
+
if (void 0 !== props.payload) params["Payload"] = new Uint8Array(Buffer.from(JSON.stringify(props.payload)));
|
|
17
|
+
const { InvokeCommand } = __require("@aws-sdk/client-lambda");
|
|
18
|
+
const command = new InvokeCommand(params);
|
|
19
|
+
const apiResponse = await global.awsLambdaClient.send(command);
|
|
20
|
+
if (isResponse200({ apiResponse })) if (props.awaitResponse && void 0 !== apiResponse.Payload) {
|
|
21
|
+
response = new TextDecoder("ascii").decode(apiResponse.Payload);
|
|
22
|
+
if (true === props.isJson) {
|
|
23
|
+
response = JSON.parse(response);
|
|
24
|
+
if ("string" === typeof response) response = JSON.parse(response);
|
|
25
|
+
if (void 0 !== response && void 0 !== response?.error && void 0 !== response?.state) response = new ApiResponse().fromJson({ input: response });
|
|
26
|
+
}
|
|
27
|
+
} else response = true;
|
|
28
|
+
return response;
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { invoke as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/aws/s3/copyFile.d.ts
|
|
2
|
+
type File = {
|
|
3
|
+
bucket: string;
|
|
4
|
+
key: string;
|
|
5
|
+
};
|
|
6
|
+
type CopyFile = {
|
|
7
|
+
from: File;
|
|
8
|
+
to: File;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Copy a file from one bucket/path to another bucket/path.
|
|
12
|
+
*/
|
|
13
|
+
declare const copyFile: ({
|
|
14
|
+
from,
|
|
15
|
+
to
|
|
16
|
+
}: CopyFile) => Promise<void>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { File, copyFile as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
//#region src/aws/s3/copyFile.ts
|
|
3
|
+
/**
|
|
4
|
+
* Copy a file from one bucket/path to another bucket/path.
|
|
5
|
+
*/
|
|
6
|
+
const copyFile = async ({ from, to }) => {
|
|
7
|
+
const { CopyObjectCommand } = __require("@aws-sdk/client-s3");
|
|
8
|
+
await global.awsS3Client.send(new CopyObjectCommand({
|
|
9
|
+
Bucket: to.bucket,
|
|
10
|
+
CopySource: encodeURIComponent(`${from.bucket}/${from.key}`),
|
|
11
|
+
Key: to.key
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { copyFile as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/aws/s3/deleteFile.d.ts
|
|
2
|
+
type DeleteFile = {
|
|
3
|
+
bucket: string;
|
|
4
|
+
key: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Delete a single file.
|
|
8
|
+
*/
|
|
9
|
+
declare const deleteFile: ({
|
|
10
|
+
bucket,
|
|
11
|
+
key
|
|
12
|
+
}: DeleteFile) => Promise<void>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { deleteFile as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
//#region src/aws/s3/deleteFile.ts
|
|
3
|
+
/**
|
|
4
|
+
* Delete a single file.
|
|
5
|
+
*/
|
|
6
|
+
const deleteFile = async ({ bucket, key }) => {
|
|
7
|
+
const { DeleteObjectCommand } = __require("@aws-sdk/client-s3");
|
|
8
|
+
await global.awsS3Client.send(new DeleteObjectCommand({
|
|
9
|
+
Bucket: bucket,
|
|
10
|
+
Key: key
|
|
11
|
+
}));
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { deleteFile as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/aws/s3/deleteFiles.d.ts
|
|
2
|
+
type DeleteFiles = {
|
|
3
|
+
bucket: string;
|
|
4
|
+
keys: string[];
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Delete multiple files.
|
|
8
|
+
*/
|
|
9
|
+
declare const deleteFiles: ({
|
|
10
|
+
bucket,
|
|
11
|
+
keys
|
|
12
|
+
}: DeleteFiles) => Promise<void>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { deleteFiles as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
//#region src/aws/s3/deleteFiles.ts
|
|
3
|
+
/**
|
|
4
|
+
* Delete multiple files.
|
|
5
|
+
*/
|
|
6
|
+
const deleteFiles = async ({ bucket, keys }) => {
|
|
7
|
+
const { DeleteObjectsCommand } = __require("@aws-sdk/client-s3");
|
|
8
|
+
await global.awsS3Client.send(new DeleteObjectsCommand({
|
|
9
|
+
Bucket: bucket,
|
|
10
|
+
Delete: { Objects: keys.map((key) => ({ Key: key })) }
|
|
11
|
+
}));
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { deleteFiles as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/aws/s3/deleteFolder.d.ts
|
|
2
|
+
type DeleteFolder = {
|
|
3
|
+
bucket: string;
|
|
4
|
+
folder: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Iteratively delete all the files within a directory and delete the directory.
|
|
8
|
+
*/
|
|
9
|
+
declare const deleteFolder: ({
|
|
10
|
+
bucket,
|
|
11
|
+
folder
|
|
12
|
+
}: DeleteFolder) => Promise<void>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { deleteFolder as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
import getFolder from "../../string/getFolder.mjs";
|
|
3
|
+
//#region src/aws/s3/deleteFolder.ts
|
|
4
|
+
/**
|
|
5
|
+
* Iteratively delete all the files within a directory and delete the directory.
|
|
6
|
+
*/
|
|
7
|
+
const deleteFolder = async ({ bucket, folder }) => {
|
|
8
|
+
const cleanFolder = getFolder({ input: folder });
|
|
9
|
+
const { ListObjectsV2Command, DeleteObjectsCommand } = __require("@aws-sdk/client-s3");
|
|
10
|
+
const apiResponse = await global.awsS3Client.send(new ListObjectsV2Command({
|
|
11
|
+
Bucket: bucket,
|
|
12
|
+
Prefix: "" === cleanFolder ? "" : cleanFolder + "/"
|
|
13
|
+
}));
|
|
14
|
+
if (apiResponse.Contents.length === 0) return;
|
|
15
|
+
const keys = apiResponse.Contents.map((file) => ({ Key: file.Key }));
|
|
16
|
+
await global.awsS3Client.send(new DeleteObjectsCommand({
|
|
17
|
+
Bucket: bucket,
|
|
18
|
+
Delete: { Objects: keys }
|
|
19
|
+
}));
|
|
20
|
+
if (apiResponse.IsTruncated) await deleteFolder({
|
|
21
|
+
bucket,
|
|
22
|
+
folder
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { deleteFolder as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import GetJsonNewline from "../../json/getJsonNewline.mjs";
|
|
2
|
+
//#region src/aws/s3/getGlueJson.ts
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated in favour of getJsonNewline
|
|
5
|
+
*/
|
|
6
|
+
const getGlueJson = ({ data }) => GetJsonNewline({ data });
|
|
7
|
+
//#endregion
|
|
8
|
+
export { getGlueJson as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/aws/s3/getPresignedPost.d.ts
|
|
2
|
+
type PresignedPost = {
|
|
3
|
+
url: string;
|
|
4
|
+
fields: any;
|
|
5
|
+
};
|
|
6
|
+
type GetPresignedPost = {
|
|
7
|
+
bucket: string;
|
|
8
|
+
conditions: any[];
|
|
9
|
+
expires: number;
|
|
10
|
+
fields: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
};
|
|
13
|
+
key: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Returns a presigned post to upload a file directly to S3.
|
|
17
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_s3_presigned_post.html
|
|
18
|
+
* https://github.com/8millionstories-organisation/test-vercel-upload-2/blob/50eb12fcb3870a59ab455811bfaa1bdcb886edf2/pages/api/upload-url.js
|
|
19
|
+
*/
|
|
20
|
+
declare const getPresignedPost: ({
|
|
21
|
+
bucket,
|
|
22
|
+
conditions,
|
|
23
|
+
expires,
|
|
24
|
+
fields,
|
|
25
|
+
key
|
|
26
|
+
}: GetPresignedPost) => Promise<PresignedPost>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { getPresignedPost as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
//#region src/aws/s3/getPresignedPost.ts
|
|
3
|
+
/**
|
|
4
|
+
* Returns a presigned post to upload a file directly to S3.
|
|
5
|
+
* https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_s3_presigned_post.html
|
|
6
|
+
* https://github.com/8millionstories-organisation/test-vercel-upload-2/blob/50eb12fcb3870a59ab455811bfaa1bdcb886edf2/pages/api/upload-url.js
|
|
7
|
+
*/
|
|
8
|
+
const getPresignedPost = async ({ bucket, conditions, expires, fields, key }) => {
|
|
9
|
+
const { createPresignedPost } = __require("@aws-sdk/client-s3");
|
|
10
|
+
return await createPresignedPost(global.awsS3Client, {
|
|
11
|
+
Bucket: bucket,
|
|
12
|
+
Key: key,
|
|
13
|
+
Conditions: void 0 === conditions ? [] : conditions,
|
|
14
|
+
Fields: void 0 === fields ? {} : fields,
|
|
15
|
+
Expires: void 0 === expires ? 60 : expires
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { getPresignedPost as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as Response } from "../../response-CKsarnP-.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/aws/s3/getSignedUrl.d.ts
|
|
4
|
+
type GetSignedUrl = {
|
|
5
|
+
bucket: string;
|
|
6
|
+
expires: number;
|
|
7
|
+
key: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Returns a signed for URL to allow download of private buckets for a given duration.
|
|
11
|
+
* Library: @aws-sdk/s3-request-presigner
|
|
12
|
+
*/
|
|
13
|
+
declare const getSignedUrl: ({
|
|
14
|
+
bucket,
|
|
15
|
+
expires,
|
|
16
|
+
key
|
|
17
|
+
}: GetSignedUrl) => Promise<Response>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { getSignedUrl as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
//#region src/aws/s3/getSignedUrl.ts
|
|
3
|
+
/**
|
|
4
|
+
* Returns a signed for URL to allow download of private buckets for a given duration.
|
|
5
|
+
* Library: @aws-sdk/s3-request-presigner
|
|
6
|
+
*/
|
|
7
|
+
const getSignedUrl = async ({ bucket, expires, key }) => {
|
|
8
|
+
const { GetObjectCommand } = __require("@aws-sdk/client-s3");
|
|
9
|
+
const { getSignedUrl } = __require("@aws-sdk/s3-request-presigner");
|
|
10
|
+
const command = new GetObjectCommand({
|
|
11
|
+
Bucket: bucket,
|
|
12
|
+
Key: key
|
|
13
|
+
});
|
|
14
|
+
return await getSignedUrl(global.awsS3Client, command, { expiresIn: expires });
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { getSignedUrl as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Config } from "../getConfig.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/aws/s3/initClient.d.ts
|
|
4
|
+
type InitClient = {
|
|
5
|
+
config: Config;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Shorthand function to get the Lambda Client.
|
|
9
|
+
* Library: @aws-sdk/client-s3
|
|
10
|
+
*/
|
|
11
|
+
declare const initClient: ({
|
|
12
|
+
config
|
|
13
|
+
}: InitClient) => void;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { initClient as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
import getConfig from "../getConfig.mjs";
|
|
3
|
+
//#region src/aws/s3/initClient.ts
|
|
4
|
+
global.awsS3Client = null;
|
|
5
|
+
/**
|
|
6
|
+
* Shorthand function to get the Lambda Client.
|
|
7
|
+
* Library: @aws-sdk/client-s3
|
|
8
|
+
*/
|
|
9
|
+
const initClient = ({ config }) => {
|
|
10
|
+
if (!global.awsS3Client) {
|
|
11
|
+
const { S3Client } = __require("@aws-sdk/client-s3");
|
|
12
|
+
const formattedConfig = getConfig({ config });
|
|
13
|
+
global.awsS3Client = new S3Client(formattedConfig);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { initClient as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/aws/s3/isFileExists.d.ts
|
|
2
|
+
type IsFileExists = {
|
|
3
|
+
bucket: string;
|
|
4
|
+
key: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Check to see if a file exists but don't get the contents.
|
|
8
|
+
*/
|
|
9
|
+
declare const isFileExists: (props: IsFileExists) => Promise<boolean>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { isFileExists as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
import isResponse200 from "../isResponse200.mjs";
|
|
3
|
+
//#region src/aws/s3/isFileExists.ts
|
|
4
|
+
/**
|
|
5
|
+
* Check to see if a file exists but don't get the contents.
|
|
6
|
+
*/
|
|
7
|
+
const isFileExists = async (props) => {
|
|
8
|
+
let response = false;
|
|
9
|
+
try {
|
|
10
|
+
const { HeadObjectCommand } = __require("@aws-sdk/client-s3");
|
|
11
|
+
response = isResponse200({ apiResponse: await global.awsS3Client.send(new HeadObjectCommand({
|
|
12
|
+
Bucket: props.bucket,
|
|
13
|
+
Key: props.key
|
|
14
|
+
})) });
|
|
15
|
+
} catch (exception) {
|
|
16
|
+
response = false;
|
|
17
|
+
}
|
|
18
|
+
return response;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { isFileExists as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/aws/s3/listFiles.d.ts
|
|
2
|
+
type ListFiles = {
|
|
3
|
+
bucket: string;
|
|
4
|
+
folder: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* List the files in the given bucket and option folder
|
|
8
|
+
*/
|
|
9
|
+
declare const listFiles: ({
|
|
10
|
+
bucket,
|
|
11
|
+
folder
|
|
12
|
+
}: ListFiles) => Promise<string[]>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { listFiles as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { t as __require } from "../../chunk-y_GBKt04.mjs";
|
|
2
|
+
import getFolder from "../../string/getFolder.mjs";
|
|
3
|
+
//#region src/aws/s3/listFiles.ts
|
|
4
|
+
/**
|
|
5
|
+
* List the files in the given bucket and option folder
|
|
6
|
+
*/
|
|
7
|
+
const listFiles = async ({ bucket, folder = "" }) => {
|
|
8
|
+
const cleanFolder = getFolder({ input: folder });
|
|
9
|
+
let response = [];
|
|
10
|
+
let valid = [];
|
|
11
|
+
const { ListObjectsV2Command } = __require("@aws-sdk/client-s3");
|
|
12
|
+
const apiResponse = await global.awsS3Client.send(new ListObjectsV2Command({
|
|
13
|
+
Bucket: bucket,
|
|
14
|
+
Delimiter: "/",
|
|
15
|
+
Prefix: "" === cleanFolder ? "" : cleanFolder + "/"
|
|
16
|
+
}));
|
|
17
|
+
if (void 0 !== apiResponse["Contents"]) {
|
|
18
|
+
valid = apiResponse["Contents"].filter((content) => {
|
|
19
|
+
const keyExploded = content["Key"].split("/");
|
|
20
|
+
return keyExploded[keyExploded.length - 1].indexOf(".") > -1;
|
|
21
|
+
});
|
|
22
|
+
if (valid.length) response = valid.map((entry) => entry["Key"]);
|
|
23
|
+
}
|
|
24
|
+
return response;
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { listFiles as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/aws/s3/listFilesIteratively.d.ts
|
|
2
|
+
type ListFilesIteratively = {
|
|
3
|
+
bucket: string;
|
|
4
|
+
folder: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Fetch all the files within a given directory recursively
|
|
8
|
+
*/
|
|
9
|
+
declare const listFilesIteratively: (props: ListFilesIteratively) => Promise<string[]>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { listFilesIteratively as default };
|