@8ms/helpers 1.38.0 → 2.0.0
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 +22 -14
- package/.yarn/install-state.gz +0 -0
- package/.yarn/releases/yarn-4.9.2.cjs +942 -0
- package/.yarnrc.yml +2 -0
- package/README.md +12 -0
- package/package.json +175 -46
- package/api/ApiResponse.d.ts +0 -50
- package/api/ApiResponse.js +0 -94
- package/api/index.d.ts +0 -9
- package/api/index.js +0 -13
- package/api/isError.d.ts +0 -6
- package/api/isError.js +0 -7
- package/api/isSuccess.d.ts +0 -6
- package/api/isSuccess.js +0 -7
- package/api/response.d.ts +0 -8
- package/api/response.js +0 -9
- package/array/contains.d.ts +0 -9
- package/array/contains.js +0 -7
- package/array/getArray.d.ts +0 -8
- package/array/getArray.js +0 -11
- package/atInternet/request.d.ts +0 -30
- package/atInternet/request.js +0 -2
- package/aws/athenaExpress/initClient.d.ts +0 -12
- package/aws/athenaExpress/initClient.js +0 -31
- package/aws/athenaExpress/query.d.ts +0 -8
- package/aws/athenaExpress/query.js +0 -16
- package/aws/ec2/initClient.d.ts +0 -11
- package/aws/ec2/initClient.js +0 -23
- package/aws/ec2/startInstances.d.ts +0 -11
- package/aws/ec2/startInstances.js +0 -18
- package/aws/ec2/stopInstances.d.ts +0 -12
- package/aws/ec2/stopInstances.js +0 -19
- package/aws/ecs/getClusters.d.ts +0 -9
- package/aws/ecs/getClusters.js +0 -32
- package/aws/ecs/getTaskDefinitions.d.ts +0 -13
- package/aws/ecs/getTaskDefinitions.js +0 -35
- package/aws/ecs/getTasks.d.ts +0 -16
- package/aws/ecs/getTasks.js +0 -38
- package/aws/ecs/initClient.d.ts +0 -11
- package/aws/ecs/initClient.js +0 -23
- package/aws/ecs/runTask.d.ts +0 -16
- package/aws/ecs/runTask.js +0 -30
- package/aws/getConfig.d.ts +0 -13
- package/aws/getConfig.js +0 -27
- package/aws/glue/initClient.d.ts +0 -10
- package/aws/glue/initClient.js +0 -21
- package/aws/glue/invoke.d.ts +0 -9
- package/aws/glue/invoke.js +0 -23
- package/aws/isResponse200.d.ts +0 -7
- package/aws/isResponse200.js +0 -22
- package/aws/lambda/getHandlerPath.d.ts +0 -5
- package/aws/lambda/getHandlerPath.js +0 -7
- package/aws/lambda/initClient.d.ts +0 -10
- package/aws/lambda/initClient.js +0 -21
- package/aws/lambda/invoke.d.ts +0 -13
- package/aws/lambda/invoke.js +0 -61
- package/aws/s3/copyFile.d.ts +0 -13
- package/aws/s3/copyFile.js +0 -14
- package/aws/s3/deleteFile.d.ts +0 -9
- package/aws/s3/deleteFile.js +0 -13
- package/aws/s3/deleteFiles.d.ts +0 -9
- package/aws/s3/deleteFiles.js +0 -17
- package/aws/s3/deleteFolder.d.ts +0 -9
- package/aws/s3/deleteFolder.js +0 -36
- package/aws/s3/getGlueJson.d.ts +0 -8
- package/aws/s3/getGlueJson.js +0 -11
- package/aws/s3/getPresignedPost.d.ts +0 -20
- package/aws/s3/getPresignedPost.js +0 -19
- package/aws/s3/getSignedUrl.d.ts +0 -12
- package/aws/s3/getSignedUrl.js +0 -17
- package/aws/s3/initClient.d.ts +0 -10
- package/aws/s3/initClient.js +0 -19
- package/aws/s3/isFileExists.d.ts +0 -9
- package/aws/s3/isFileExists.js +0 -27
- package/aws/s3/listFiles.d.ts +0 -9
- package/aws/s3/listFiles.js +0 -33
- package/aws/s3/listFilesIteratively.d.ts +0 -9
- package/aws/s3/listFilesIteratively.js +0 -44
- package/aws/s3/listFolders.d.ts +0 -9
- package/aws/s3/listFolders.js +0 -32
- package/aws/s3/moveFile.d.ts +0 -10
- package/aws/s3/moveFile.js +0 -21
- package/aws/s3/readBrotli.d.ts +0 -11
- package/aws/s3/readBrotli.js +0 -28
- package/aws/s3/readBuffer.d.ts +0 -13
- package/aws/s3/readBuffer.js +0 -39
- package/aws/s3/readFile.d.ts +0 -31
- package/aws/s3/readFile.js +0 -83
- package/aws/s3/readGzip.d.ts +0 -11
- package/aws/s3/readGzip.js +0 -28
- package/aws/s3/writeBrotli.d.ts +0 -12
- package/aws/s3/writeBrotli.js +0 -28
- package/aws/s3/writeFile.d.ts +0 -11
- package/aws/s3/writeFile.js +0 -16
- package/aws/s3/writeGzip.d.ts +0 -12
- package/aws/s3/writeGzip.js +0 -28
- package/aws/s3/writePresignedPost.d.ts +0 -14
- package/aws/s3/writePresignedPost.js +0 -31
- package/aws/s3/writeUrlContents.d.ts +0 -10
- package/aws/s3/writeUrlContents.js +0 -26
- package/aws/s3cache/getCache.d.ts +0 -11
- package/aws/s3cache/getCache.js +0 -37
- package/aws/s3cache/getKey.d.ts +0 -10
- package/aws/s3cache/getKey.js +0 -18
- package/aws/s3cache/index.d.ts +0 -6
- package/aws/s3cache/index.js +0 -2
- package/aws/s3cache/saveCache.d.ts +0 -10
- package/aws/s3cache/saveCache.js +0 -17
- package/aws/s3cache/updateCache.d.ts +0 -10
- package/aws/s3cache/updateCache.js +0 -24
- package/aws/ses/SimpleEmail.d.ts +0 -51
- package/aws/ses/SimpleEmail.js +0 -114
- package/aws/ses/initClient.d.ts +0 -10
- package/aws/ses/initClient.js +0 -19
- package/aws/sqs/addToQueue.d.ts +0 -27
- package/aws/sqs/addToQueue.js +0 -26
- package/aws/sqs/deleteFromQueue.d.ts +0 -10
- package/aws/sqs/deleteFromQueue.js +0 -15
- package/aws/sqs/initClient.d.ts +0 -10
- package/aws/sqs/initClient.js +0 -19
- package/aws/sqs/isEventSqs.d.ts +0 -1
- package/aws/sqs/isEventSqs.js +0 -13
- package/aws/ssm/getParameter.d.ts +0 -10
- package/aws/ssm/getParameter.js +0 -40
- package/aws/ssm/initClient.d.ts +0 -10
- package/aws/ssm/initClient.js +0 -19
- package/axios/delete.d.ts +0 -11
- package/axios/delete.js +0 -39
- package/axios/get.d.ts +0 -10
- package/axios/get.js +0 -38
- package/axios/post.d.ts +0 -11
- package/axios/post.js +0 -38
- package/boolean/getBoolean.d.ts +0 -7
- package/boolean/getBoolean.js +0 -16
- package/brightData/getCustomerId.d.ts +0 -10
- package/brightData/getCustomerId.js +0 -11
- package/brightData/getZone.d.ts +0 -9
- package/brightData/getZone.js +0 -10
- package/brightData/param.d.ts +0 -9
- package/brightData/param.js +0 -3
- package/brightData/serpApi/buildGoogleSerpUrl.d.ts +0 -32
- package/brightData/serpApi/buildGoogleSerpUrl.js +0 -115
- package/brightData/serpApi/buildGoogleTrendsUrl.d.ts +0 -22
- package/brightData/serpApi/buildGoogleTrendsUrl.js +0 -60
- package/brightData/serpApi/getAsyncRequestId.d.ts +0 -14
- package/brightData/serpApi/getAsyncRequestId.js +0 -50
- package/brightData/serpApi/getAsyncResults.d.ts +0 -12
- package/brightData/serpApi/getAsyncResults.js +0 -49
- package/brightData/serpApi/getRealtime.d.ts +0 -10
- package/brightData/serpApi/getRealtime.js +0 -35
- package/brightData/serpApi/type.d.ts +0 -11
- package/brightData/serpApi/type.js +0 -14
- package/brightData/webScraperIde/getBatch.d.ts +0 -14
- package/brightData/webScraperIde/getBatch.js +0 -34
- package/brightData/webScraperIde/getRealtime.d.ts +0 -13
- package/brightData/webScraperIde/getRealtime.js +0 -64
- package/class/BaseClass.d.ts +0 -31
- package/class/BaseClass.js +0 -50
- package/crud/index.d.ts +0 -6
- package/crud/index.js +0 -10
- package/crypto/getDecrypt.d.ts +0 -10
- package/crypto/getDecrypt.js +0 -13
- package/crypto/getEncrypt.d.ts +0 -10
- package/crypto/getEncrypt.js +0 -13
- package/crypto/getRandom.d.ts +0 -8
- package/crypto/getRandom.js +0 -12
- package/crypto/getSha256.d.ts +0 -8
- package/crypto/getSha256.js +0 -17
- package/date/format.d.ts +0 -10
- package/date/format.js +0 -21
- package/date/getDate.d.ts +0 -14
- package/date/getDate.js +0 -138
- package/date/getDatesBetween.d.ts +0 -13
- package/date/getDatesBetween.js +0 -54
- package/date/getDurationHours.d.ts +0 -9
- package/date/getDurationHours.js +0 -24
- package/date/getDurationMinutes.d.ts +0 -9
- package/date/getDurationMinutes.js +0 -22
- package/date/getFinancialYear.d.ts +0 -9
- package/date/getFinancialYear.js +0 -52
- package/date/getFinancialYearToDate.d.ts +0 -7
- package/date/getFinancialYearToDate.js +0 -20
- package/date/getFinancialYearToYesterday.d.ts +0 -7
- package/date/getFinancialYearToYesterday.js +0 -20
- package/date/getFinancialYearWeeks.d.ts +0 -9
- package/date/getFinancialYearWeeks.js +0 -33
- package/date/getLastWeek.d.ts +0 -10
- package/date/getLastWeek.js +0 -34
- package/date/getMax.d.ts +0 -13
- package/date/getMax.js +0 -24
- package/date/getMidnight.d.ts +0 -10
- package/date/getMidnight.js +0 -13
- package/date/getMin.d.ts +0 -13
- package/date/getMin.js +0 -24
- package/date/getMonday.d.ts +0 -15
- package/date/getMonday.js +0 -46
- package/date/getNumber.d.ts +0 -7
- package/date/getNumber.js +0 -20
- package/date/getPredefinedTimeframe.d.ts +0 -8
- package/date/getPredefinedTimeframe.js +0 -24
- package/date/getSunday.d.ts +0 -15
- package/date/getSunday.js +0 -42
- package/date/getThisWeek.d.ts +0 -10
- package/date/getThisWeek.js +0 -36
- package/date/getTimeZoned.d.ts +0 -13
- package/date/getTimeZoned.js +0 -55
- package/date/getToday.d.ts +0 -9
- package/date/getToday.js +0 -24
- package/date/getTodayYmd.d.ts +0 -5
- package/date/getTodayYmd.js +0 -21
- package/date/getTodayYmdhis.d.ts +0 -5
- package/date/getTodayYmdhis.js +0 -21
- package/date/getTwoWeeksAgo.d.ts +0 -10
- package/date/getTwoWeeksAgo.js +0 -36
- package/date/getWeeksAgo.d.ts +0 -13
- package/date/getWeeksAgo.js +0 -25
- package/date/getYesterday.d.ts +0 -9
- package/date/getYesterday.js +0 -52
- package/date/index.d.ts +0 -55
- package/date/index.js +0 -36
- package/date/isDateValid.d.ts +0 -7
- package/date/isDateValid.js +0 -20
- package/date/isLastWeek.d.ts +0 -6
- package/date/isLastWeek.js +0 -14
- package/date/isThisWeek.d.ts +0 -6
- package/date/isThisWeek.js +0 -14
- package/date/parseExcelDate.d.ts +0 -8
- package/date/parseExcelDate.js +0 -19
- package/environment/getEnvironment.d.ts +0 -6
- package/environment/getEnvironment.js +0 -43
- package/environment/index.d.ts +0 -9
- package/environment/index.js +0 -14
- package/environment/isAws.d.ts +0 -5
- package/environment/isAws.js +0 -8
- package/environment/isDevelopment.d.ts +0 -2
- package/environment/isDevelopment.js +0 -9
- package/environment/isLocalhost.d.ts +0 -5
- package/environment/isLocalhost.js +0 -25
- package/environment/isProduction.d.ts +0 -2
- package/environment/isProduction.js +0 -9
- package/environment/isStaging.d.ts +0 -2
- package/environment/isStaging.js +0 -9
- package/environment/isVercel.d.ts +0 -5
- package/environment/isVercel.js +0 -7
- package/eskimi/ageGroups.d.ts +0 -5
- package/eskimi/ageGroups.js +0 -41
- package/eskimi/campaign.d.ts +0 -19
- package/eskimi/campaign.js +0 -2
- package/eskimi/devices.d.ts +0 -5
- package/eskimi/devices.js +0 -13
- package/eskimi/endpoints.d.ts +0 -16
- package/eskimi/endpoints.js +0 -18
- package/eskimi/genders.d.ts +0 -5
- package/eskimi/genders.js +0 -13
- package/eskimi/getAccessToken.d.ts +0 -9
- package/eskimi/getAccessToken.js +0 -23
- package/eskimi/getAgeGroup.d.ts +0 -7
- package/eskimi/getAgeGroup.js +0 -17
- package/eskimi/getCampaignIds.d.ts +0 -7
- package/eskimi/getCampaignIds.js +0 -12
- package/eskimi/getData.d.ts +0 -8
- package/eskimi/getData.js +0 -23
- package/eskimi/getDevice.d.ts +0 -7
- package/eskimi/getDevice.js +0 -17
- package/eskimi/getGender.d.ts +0 -7
- package/eskimi/getGender.js +0 -17
- package/file/createDirectory.d.ts +0 -9
- package/file/createDirectory.js +0 -16
- package/file/writeFile.d.ts +0 -1
- package/file/writeFile.js +0 -2
- package/global/forceUpdate.d.ts +0 -8
- package/global/forceUpdate.js +0 -25
- package/global/init.d.ts +0 -10
- package/global/init.js +0 -18
- package/global/isSet.d.ts +0 -8
- package/global/isSet.js +0 -9
- package/global/maxCache.d.ts +0 -8
- package/global/maxCache.js +0 -17
- package/global/read.d.ts +0 -8
- package/global/read.js +0 -30
- package/google/bigQuery/IsTableExists.d.ts +0 -11
- package/google/bigQuery/IsTableExists.js +0 -25
- package/google/bigQuery/createDataset.d.ts +0 -11
- package/google/bigQuery/createDataset.js +0 -22
- package/google/bigQuery/createTable.d.ts +0 -12
- package/google/bigQuery/createTable.js +0 -31
- package/google/bigQuery/getClient.d.ts +0 -9
- package/google/bigQuery/getClient.js +0 -18
- package/google/bigQuery/getDatasets.d.ts +0 -13
- package/google/bigQuery/getDatasets.js +0 -27
- package/google/bigQuery/getTables.d.ts +0 -12
- package/google/bigQuery/getTables.js +0 -25
- package/google/bigQuery/initClient.d.ts +0 -11
- package/google/bigQuery/initClient.js +0 -29
- package/google/bigQuery/isDatasetExists.d.ts +0 -11
- package/google/bigQuery/isDatasetExists.js +0 -25
- package/google/bigQuery/loadData.d.ts +0 -18
- package/google/bigQuery/loadData.js +0 -32
- package/google/bigQuery/query.d.ts +0 -19
- package/google/bigQuery/query.js +0 -15
- package/google/getConfig.d.ts +0 -20
- package/google/getConfig.js +0 -23
- package/google/sheets/getAssociatedData.d.ts +0 -16
- package/google/sheets/getAssociatedData.js +0 -53
- package/google/sheets/getBatchData.d.ts +0 -18
- package/google/sheets/getBatchData.js +0 -19
- package/google/sheets/initClient.d.ts +0 -11
- package/google/sheets/initClient.js +0 -25
- package/google/sheets/isCellNa.d.ts +0 -7
- package/google/sheets/isCellNa.js +0 -7
- package/google/storage/copyToCloud.d.ts +0 -11
- package/google/storage/copyToCloud.js +0 -18
- package/google/storage/getClient.d.ts +0 -8
- package/google/storage/getClient.js +0 -18
- package/google/storage/initClient.d.ts +0 -12
- package/google/storage/initClient.js +0 -29
- package/google/storage/isFileExists.d.ts +0 -10
- package/google/storage/isFileExists.js +0 -19
- package/google/storage/writeFile.d.ts +0 -11
- package/google/storage/writeFile.js +0 -37
- package/googleAds/getCustomer.d.ts +0 -8
- package/googleAds/getCustomer.js +0 -14
- package/googleAds/initClient.d.ts +0 -16
- package/googleAds/initClient.js +0 -25
- package/googleAds/keywordPlanner/index.d.ts +0 -238
- package/googleAds/keywordPlanner/index.js +0 -244
- package/googleAds/keywordPlanner/request.d.ts +0 -18
- package/googleAds/keywordPlanner/request.js +0 -13
- package/googleAds/keywordPlanner/response.d.ts +0 -25
- package/googleAds/keywordPlanner/response.js +0 -2
- package/initClients.d.ts +0 -43
- package/initClients.js +0 -131
- package/json/getJsonNewline.d.ts +0 -5
- package/json/getJsonNewline.js +0 -17
- package/json/isJson.d.ts +0 -8
- package/json/isJson.js +0 -20
- package/littleWarden/getUrlStatus.d.ts +0 -9
- package/littleWarden/getUrlStatus.js +0 -21
- package/littleWarden/index.d.ts +0 -5
- package/littleWarden/index.js +0 -9
- package/littleWarden/isAllGood.d.ts +0 -7
- package/littleWarden/isAllGood.js +0 -15
- package/littleWarden/isDanger.d.ts +0 -7
- package/littleWarden/isDanger.js +0 -15
- package/littleWarden/isWarning.d.ts +0 -7
- package/littleWarden/isWarning.js +0 -15
- package/lumar/api/buildRequest.d.ts +0 -15
- package/lumar/api/buildRequest.js +0 -83
- package/lumar/api/filter.d.ts +0 -5
- package/lumar/api/filter.js +0 -2
- package/lumar/api/getData.d.ts +0 -6
- package/lumar/api/getData.js +0 -18
- package/lumar/api/initClient.d.ts +0 -13
- package/lumar/api/initClient.js +0 -38
- package/lumar/api/operands.d.ts +0 -11
- package/lumar/api/operands.js +0 -13
- package/lumar/api/orders.d.ts +0 -9
- package/lumar/api/orders.js +0 -7
- package/lumar/api/reports.d.ts +0 -11
- package/lumar/api/reports.js +0 -13
- package/lumar/graphql/columns.d.ts +0 -29
- package/lumar/graphql/columns.js +0 -31
- package/lumar/graphql/getData.d.ts +0 -9
- package/lumar/graphql/getData.js +0 -26
- package/lumar/graphql/getReportKey.d.ts +0 -9
- package/lumar/graphql/getReportKey.js +0 -9
- package/lumar/graphql/initClient.d.ts +0 -12
- package/lumar/graphql/initClient.js +0 -38
- package/lumar/graphql/operands.d.ts +0 -16
- package/lumar/graphql/operands.js +0 -18
- package/lumar/graphql/queries/crawl.d.ts +0 -5
- package/lumar/graphql/queries/crawl.js +0 -2
- package/lumar/graphql/queries/getCrawls.d.ts +0 -18
- package/lumar/graphql/queries/getCrawls.js +0 -33
- package/lumar/graphql/queries/getReportDifferences.d.ts +0 -24
- package/lumar/graphql/queries/getReportDifferences.js +0 -40
- package/lumar/graphql/queries/getRows.d.ts +0 -38
- package/lumar/graphql/queries/getRows.js +0 -57
- package/lumar/graphql/queries/getTotals.d.ts +0 -25
- package/lumar/graphql/queries/getTotals.js +0 -40
- package/lumar/graphql/queries/row.d.ts +0 -157
- package/lumar/graphql/queries/row.js +0 -2
- package/lumar/graphql/reportTemplates.d.ts +0 -68
- package/lumar/graphql/reportTemplates.js +0 -70
- package/lumar/graphql/reportTypes.d.ts +0 -7
- package/lumar/graphql/reportTypes.js +0 -9
- package/myTarget/getAccessToken.d.ts +0 -9
- package/myTarget/getAccessToken.js +0 -23
- package/myTarget/request.d.ts +0 -9
- package/myTarget/request.js +0 -23
- package/nextAuth/index.d.ts +0 -5
- package/nextAuth/index.js +0 -9
- package/nextAuth/isSessionReady.d.ts +0 -4
- package/nextAuth/isSessionReady.js +0 -12
- package/nextJs/getIp.d.ts +0 -7
- package/nextJs/getIp.js +0 -13
- package/nextJs/getUserAgent.d.ts +0 -7
- package/nextJs/getUserAgent.js +0 -7
- package/number/format.d.ts +0 -11
- package/number/format.js +0 -23
- package/number/getCurrency.d.ts +0 -10
- package/number/getCurrency.js +0 -20
- package/number/getDecimal.d.ts +0 -9
- package/number/getDecimal.js +0 -16
- package/number/getDivide.d.ts +0 -11
- package/number/getDivide.js +0 -26
- package/number/getNumber.d.ts +0 -8
- package/number/getNumber.js +0 -51
- package/number/getPercentIncrease.d.ts +0 -10
- package/number/getPercentIncrease.js +0 -22
- package/object/replaceKeys.d.ts +0 -10
- package/object/replaceKeys.js +0 -30
- package/prisma/getDecimal.d.ts +0 -9
- package/prisma/getDecimal.js +0 -18
- package/prisma/initClient.d.ts +0 -6
- package/prisma/initClient.js +0 -36
- package/snapchat/getAccessToken.d.ts +0 -9
- package/snapchat/getAccessToken.js +0 -35
- package/sorting/byNumberAscending.d.ts +0 -8
- package/sorting/byNumberAscending.js +0 -17
- package/sorting/byNumberDescending.d.ts +0 -8
- package/sorting/byNumberDescending.js +0 -17
- package/sorting/byStringAscending.d.ts +0 -8
- package/sorting/byStringAscending.js +0 -21
- package/sorting/byStringDescending.d.ts +0 -8
- package/sorting/byStringDescending.js +0 -21
- package/stream/sort.d.ts +0 -14
- package/stream/sort.js +0 -50
- package/string/getCapitalised.d.ts +0 -10
- package/string/getCapitalised.js +0 -17
- package/string/getClean.d.ts +0 -18
- package/string/getClean.js +0 -65
- package/string/getDecoded.d.ts +0 -10
- package/string/getDecoded.js +0 -26
- package/string/getFolder.d.ts +0 -8
- package/string/getFolder.js +0 -14
- package/string/getProperCase.d.ts +0 -11
- package/string/getProperCase.js +0 -27
- package/string/getString.d.ts +0 -7
- package/string/getString.js +0 -34
- package/string/getStringFromStream.d.ts +0 -8
- package/string/getStringFromStream.js +0 -16
- package/string/getWithoutAccents.d.ts +0 -9
- package/string/getWithoutAccents.js +0 -16
- package/string/getWithoutHtmlTags.d.ts +0 -9
- package/string/getWithoutHtmlTags.js +0 -15
- package/string/getWithoutPunctuation.d.ts +0 -9
- package/string/getWithoutPunctuation.js +0 -16
- package/string/getWithoutUnderscores.d.ts +0 -8
- package/string/getWithoutUnderscores.js +0 -14
- package/string/getWithoutWhitespaces.d.ts +0 -9
- package/string/getWithoutWhitespaces.js +0 -16
- package/swr/isAllData.d.ts +0 -7
- package/swr/isAllData.js +0 -19
- package/swr/isAnyError.d.ts +0 -7
- package/swr/isAnyError.js +0 -19
- package/swr/isAnyLoading.d.ts +0 -7
- package/swr/isAnyLoading.js +0 -21
- package/swr/isData.d.ts +0 -7
- package/swr/isData.js +0 -9
- package/swr/isError.d.ts +0 -7
- package/swr/isError.js +0 -7
- package/swr/isLoading.d.ts +0 -7
- package/swr/isLoading.js +0 -12
- package/upTimeRobot/getMonitors.d.ts +0 -1
- package/upTimeRobot/getMonitors.js +0 -33
- package/upTimeRobot/logTypes.d.ts +0 -7
- package/upTimeRobot/logTypes.js +0 -9
- package/upTimeRobot/monitorStatuses.d.ts +0 -8
- package/upTimeRobot/monitorStatuses.js +0 -10
- package/upTimeRobot/monitorSubTypes.d.ts +0 -10
- package/upTimeRobot/monitorSubTypes.js +0 -12
- package/upTimeRobot/monitorTypes.d.ts +0 -8
- package/upTimeRobot/monitorTypes.js +0 -10
- package/upTimeRobot/requestStatuses.d.ts +0 -5
- package/upTimeRobot/requestStatuses.js +0 -7
- package/url/buildParameters.d.ts +0 -8
- package/url/buildParameters.js +0 -22
- package/url/buildRelative.d.ts +0 -8
- package/url/buildRelative.js +0 -13
- package/url/buildUrl.d.ts +0 -10
- package/url/buildUrl.js +0 -29
- package/url/isAbsolute.d.ts +0 -7
- package/url/isAbsolute.js +0 -15
- package/url/isRelative.d.ts +0 -7
- package/url/isRelative.js +0 -8
- package/url/url.d.ts +0 -6
- package/url/url.js +0 -2
- package/url/writeUrlContents.d.ts +0 -11
- package/url/writeUrlContents.js +0 -43
- package/util/defaultTo.d.ts +0 -10
- package/util/defaultTo.js +0 -43
- package/util/getBrotliCompressed.d.ts +0 -9
- package/util/getBrotliCompressed.js +0 -19
- package/util/getBrotliDecompressed.d.ts +0 -9
- package/util/getBrotliDecompressed.js +0 -20
- package/util/getClean.d.ts +0 -11
- package/util/getClean.js +0 -28
- package/util/getGzipCompressed.d.ts +0 -9
- package/util/getGzipCompressed.js +0 -19
- package/util/getGzipDecompressed.d.ts +0 -9
- package/util/getGzipDecompressed.js +0 -20
- package/util/getWithoutHash.d.ts +0 -8
- package/util/getWithoutHash.js +0 -17
- package/util/getWithoutParameter.d.ts +0 -8
- package/util/getWithoutParameter.js +0 -17
- package/util/isUndefined.d.ts +0 -9
- package/util/isUndefined.js +0 -19
- package/util/promiseChunks.d.ts +0 -10
- package/util/promiseChunks.js +0 -18
- package/util/sleep.d.ts +0 -5
- package/util/sleep.js +0 -6
- package/webWorker/index.d.ts +0 -5
- package/webWorker/index.js +0 -9
- package/xml/getXml.d.ts +0 -5
- package/xml/getXml.js +0 -22
package/aws/s3/writeBrotli.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const getBrotliCompressed_1 = __importDefault(require("../../util/getBrotliCompressed"));
|
|
7
|
-
const writeFile_1 = __importDefault(require("./writeFile"));
|
|
8
|
-
/**
|
|
9
|
-
* Write a brotli file to S3.
|
|
10
|
-
*/
|
|
11
|
-
const writeBrotli = async ({ bucket, data, key, isJson, ...options }) => {
|
|
12
|
-
let finalData = data;
|
|
13
|
-
if (false !== isJson) {
|
|
14
|
-
finalData = JSON.stringify(data);
|
|
15
|
-
}
|
|
16
|
-
// Compress the data
|
|
17
|
-
const brotliData = await (0, getBrotliCompressed_1.default)({
|
|
18
|
-
input: finalData,
|
|
19
|
-
});
|
|
20
|
-
const apiResponse = await (0, writeFile_1.default)({
|
|
21
|
-
bucket,
|
|
22
|
-
data: brotliData,
|
|
23
|
-
key,
|
|
24
|
-
...options,
|
|
25
|
-
});
|
|
26
|
-
return apiResponse;
|
|
27
|
-
};
|
|
28
|
-
exports.default = writeBrotli;
|
package/aws/s3/writeFile.d.ts
DELETED
package/aws/s3/writeFile.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* Write a file to S3.
|
|
5
|
-
*/
|
|
6
|
-
const writeFile = async ({ bucket, data, key, ...options }) => {
|
|
7
|
-
const { PutObjectCommand } = require('@aws-sdk/client-s3');
|
|
8
|
-
const apiResponse = await global.awsS3Client.send(new PutObjectCommand({
|
|
9
|
-
Bucket: bucket,
|
|
10
|
-
Body: data,
|
|
11
|
-
Key: key,
|
|
12
|
-
...options,
|
|
13
|
-
}));
|
|
14
|
-
return apiResponse;
|
|
15
|
-
};
|
|
16
|
-
exports.default = writeFile;
|
package/aws/s3/writeGzip.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
type WriteGzip = {
|
|
2
|
-
bucket: string;
|
|
3
|
-
data: any;
|
|
4
|
-
key: string;
|
|
5
|
-
isJson?: boolean;
|
|
6
|
-
[options: string]: any;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Write a gzip file to S3.
|
|
10
|
-
*/
|
|
11
|
-
declare const writeGzip: ({ bucket, data, key, isJson, ...options }: WriteGzip) => Promise<any>;
|
|
12
|
-
export default writeGzip;
|
package/aws/s3/writeGzip.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const getGzipCompressed_1 = __importDefault(require("../../util/getGzipCompressed"));
|
|
7
|
-
const writeFile_1 = __importDefault(require("./writeFile"));
|
|
8
|
-
/**
|
|
9
|
-
* Write a gzip file to S3.
|
|
10
|
-
*/
|
|
11
|
-
const writeGzip = async ({ bucket, data, key, isJson, ...options }) => {
|
|
12
|
-
let finalData = data;
|
|
13
|
-
if (false !== isJson) {
|
|
14
|
-
finalData = JSON.stringify(data);
|
|
15
|
-
}
|
|
16
|
-
// Compress the data
|
|
17
|
-
const brotliData = await (0, getGzipCompressed_1.default)({
|
|
18
|
-
input: finalData,
|
|
19
|
-
});
|
|
20
|
-
const apiResponse = await (0, writeFile_1.default)({
|
|
21
|
-
bucket,
|
|
22
|
-
data: brotliData,
|
|
23
|
-
key,
|
|
24
|
-
...options,
|
|
25
|
-
});
|
|
26
|
-
return apiResponse;
|
|
27
|
-
};
|
|
28
|
-
exports.default = writeGzip;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Config } from '../getConfig';
|
|
2
|
-
type WritePresignedPost = {
|
|
3
|
-
bucket: string;
|
|
4
|
-
config: Config;
|
|
5
|
-
fields: any;
|
|
6
|
-
file: any;
|
|
7
|
-
key: string;
|
|
8
|
-
url: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Get a presigned post URL so we can upload directly to S3 via frontend.
|
|
12
|
-
*/
|
|
13
|
-
declare const writePresignedPost: ({ bucket, config, fields, file, key, url }: WritePresignedPost) => Promise<null | string>;
|
|
14
|
-
export default writePresignedPost;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* Get a presigned post URL so we can upload directly to S3 via frontend.
|
|
5
|
-
*/
|
|
6
|
-
const writePresignedPost = async ({ bucket, config, fields, file, key, url }) => {
|
|
7
|
-
return new Promise(async (resolve, reject) => {
|
|
8
|
-
let response;
|
|
9
|
-
const formData = new FormData();
|
|
10
|
-
Object.entries({ fields, file })
|
|
11
|
-
.forEach(([key, value]) => {
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
formData.append(key, value);
|
|
14
|
-
});
|
|
15
|
-
const upload = await fetch(url, {
|
|
16
|
-
method: 'POST',
|
|
17
|
-
body: formData,
|
|
18
|
-
});
|
|
19
|
-
// Uploaded to S3
|
|
20
|
-
if (upload.ok) {
|
|
21
|
-
response = `https://${bucket}.s3.${config.region}.amazonaws.com/${key}`;
|
|
22
|
-
resolve(response);
|
|
23
|
-
}
|
|
24
|
-
// Failed to upload to S3
|
|
25
|
-
else {
|
|
26
|
-
response = null;
|
|
27
|
-
reject(response);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
exports.default = writePresignedPost;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const axios_1 = __importDefault(require("axios"));
|
|
7
|
-
const writeFile_1 = __importDefault(require("./writeFile"));
|
|
8
|
-
/**
|
|
9
|
-
* Download a file and write to S3.
|
|
10
|
-
*/
|
|
11
|
-
const writeUrlContents = async ({ bucket, key, url }) => {
|
|
12
|
-
return (0, axios_1.default)(url, {
|
|
13
|
-
responseType: "arraybuffer",
|
|
14
|
-
responseEncoding: "binary",
|
|
15
|
-
})
|
|
16
|
-
.then(async (response) => {
|
|
17
|
-
await (0, writeFile_1.default)({
|
|
18
|
-
bucket,
|
|
19
|
-
data: response.data,
|
|
20
|
-
key,
|
|
21
|
-
ContentType: response.headers["content-type"],
|
|
22
|
-
ContentLength: response.headers["content-length"],
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
exports.default = writeUrlContents;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Cache } from "./";
|
|
2
|
-
import { GetKey } from "./getKey";
|
|
3
|
-
type GetCache = GetKey & {
|
|
4
|
-
bucket: string;
|
|
5
|
-
cache: Cache;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Get the stored cache if it exists.
|
|
9
|
-
*/
|
|
10
|
-
declare const getCache: ({ bucket, cache, fileName, folder }: GetCache) => Promise<any>;
|
|
11
|
-
export default getCache;
|
package/aws/s3cache/getCache.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const date_1 = require("../../date");
|
|
7
|
-
const getKey_1 = __importDefault(require("./getKey"));
|
|
8
|
-
const readGzip_1 = __importDefault(require("../s3/readGzip"));
|
|
9
|
-
/**
|
|
10
|
-
* Get the stored cache if it exists.
|
|
11
|
-
*/
|
|
12
|
-
const getCache = async ({ bucket, cache, fileName, folder }) => {
|
|
13
|
-
let response = undefined;
|
|
14
|
-
// Store the cache key
|
|
15
|
-
const s3CacheKey = (0, getKey_1.default)({ fileName, folder });
|
|
16
|
-
// If a cache timeframe is provided and we're not preloading this data
|
|
17
|
-
if (cache) {
|
|
18
|
-
// Try to get the cache
|
|
19
|
-
try {
|
|
20
|
-
const cached = await (0, readGzip_1.default)({
|
|
21
|
-
bucket,
|
|
22
|
-
key: s3CacheKey,
|
|
23
|
-
isJson: true,
|
|
24
|
-
});
|
|
25
|
-
// Cache exists and is still within our caching timeframe
|
|
26
|
-
if (undefined !== cached.body && (date_1.Interval.FOREVER === cache.timeframe || cached.modified[cache.from][cache.timeframe] < cache.duration)) {
|
|
27
|
-
response = cached.body;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
// sendError(error, req, res, next);
|
|
32
|
-
// console.log('s3 error - ', error.message);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return response;
|
|
36
|
-
};
|
|
37
|
-
exports.default = getCache;
|
package/aws/s3cache/getKey.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type GetKey = {
|
|
2
|
-
fileName: any;
|
|
3
|
-
folder: string;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Take an input and return the key.
|
|
7
|
-
* Always in the "_cache" folder with the "environment" followed by the optional folder then the key.
|
|
8
|
-
*/
|
|
9
|
-
declare const getKey: ({ fileName, folder }: GetKey) => string;
|
|
10
|
-
export default getKey;
|
package/aws/s3cache/getKey.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const trimStart_1 = __importDefault(require("lodash/trimStart"));
|
|
7
|
-
const getSha256_1 = __importDefault(require("../../crypto/getSha256"));
|
|
8
|
-
const getEnvironment_1 = __importDefault(require("../../environment/getEnvironment"));
|
|
9
|
-
/**
|
|
10
|
-
* Take an input and return the key.
|
|
11
|
-
* Always in the "_cache" folder with the "environment" followed by the optional folder then the key.
|
|
12
|
-
*/
|
|
13
|
-
const getKey = ({ fileName, folder }) => {
|
|
14
|
-
const fileNameString = (0, getSha256_1.default)({ input: fileName });
|
|
15
|
-
const folderPath = (0, trimStart_1.default)('' === folder ? '' : `${folder}/`, '/');
|
|
16
|
-
return `cache/${(0, getEnvironment_1.default)()}/${folderPath}${fileNameString}.json.gz`;
|
|
17
|
-
};
|
|
18
|
-
exports.default = getKey;
|
package/aws/s3cache/index.d.ts
DELETED
package/aws/s3cache/index.js
DELETED
package/aws/s3cache/saveCache.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const writeGzip_1 = __importDefault(require("../s3/writeGzip"));
|
|
7
|
-
/**
|
|
8
|
-
* Save the cache.
|
|
9
|
-
*/
|
|
10
|
-
const saveCache = async ({ bucket, data, key }) => {
|
|
11
|
-
return await (0, writeGzip_1.default)({
|
|
12
|
-
bucket,
|
|
13
|
-
data,
|
|
14
|
-
key,
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
exports.default = saveCache;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { GetKey } from './getKey';
|
|
2
|
-
type UpdateCache = GetKey & {
|
|
3
|
-
bucket: string;
|
|
4
|
-
data: any;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Delete other caches if present, then save the new file.
|
|
8
|
-
*/
|
|
9
|
-
declare const updateCache: ({ bucket, data, fileName, folder }: UpdateCache) => Promise<void>;
|
|
10
|
-
export default updateCache;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const deleteFile_1 = __importDefault(require("../s3/deleteFile"));
|
|
7
|
-
const getKey_1 = __importDefault(require("./getKey"));
|
|
8
|
-
const saveCache_1 = __importDefault(require("./saveCache"));
|
|
9
|
-
/**
|
|
10
|
-
* Delete other caches if present, then save the new file.
|
|
11
|
-
*/
|
|
12
|
-
const updateCache = async ({ bucket, data, fileName, folder }) => {
|
|
13
|
-
if (data && null !== data) {
|
|
14
|
-
const key = (0, getKey_1.default)({
|
|
15
|
-
fileName,
|
|
16
|
-
folder,
|
|
17
|
-
});
|
|
18
|
-
// Delete the existing file
|
|
19
|
-
await (0, deleteFile_1.default)({ bucket, key });
|
|
20
|
-
// Save the new file
|
|
21
|
-
await (0, saveCache_1.default)({ bucket, data, key });
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
exports.default = updateCache;
|
package/aws/ses/SimpleEmail.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import BaseClass from "../../class/BaseClass";
|
|
2
|
-
type Constructor = {
|
|
3
|
-
bcc?: string[];
|
|
4
|
-
cc?: string[];
|
|
5
|
-
from?: string;
|
|
6
|
-
html?: string;
|
|
7
|
-
subject?: string;
|
|
8
|
-
to?: string | string[];
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Class to build and send an AWS SES email.
|
|
12
|
-
*/
|
|
13
|
-
declare class SimpleEmail extends BaseClass {
|
|
14
|
-
from?: string;
|
|
15
|
-
to: string[];
|
|
16
|
-
cc: string[];
|
|
17
|
-
bcc: string[];
|
|
18
|
-
html?: string;
|
|
19
|
-
subject?: string;
|
|
20
|
-
constructor({ bcc, cc, from, html, subject, to }: Constructor);
|
|
21
|
-
setFrom({ from }: {
|
|
22
|
-
from: string;
|
|
23
|
-
}): this;
|
|
24
|
-
setHtml({ html }: {
|
|
25
|
-
html: string;
|
|
26
|
-
}): this;
|
|
27
|
-
setSubject({ subject }: {
|
|
28
|
-
subject: string;
|
|
29
|
-
}): this;
|
|
30
|
-
pushBcc({ recipient }: {
|
|
31
|
-
recipient: string | string[];
|
|
32
|
-
}): this;
|
|
33
|
-
pushCc({ recipient }: {
|
|
34
|
-
recipient: string | string[];
|
|
35
|
-
}): this;
|
|
36
|
-
pushTo({ recipient }: {
|
|
37
|
-
recipient: string | string[];
|
|
38
|
-
}): this;
|
|
39
|
-
setBcc({ recipient }: {
|
|
40
|
-
recipient: string | string[];
|
|
41
|
-
}): this;
|
|
42
|
-
setCc({ recipient }: {
|
|
43
|
-
recipient: string | string[];
|
|
44
|
-
}): this;
|
|
45
|
-
setTo({ recipient }: {
|
|
46
|
-
recipient: string | string[];
|
|
47
|
-
}): this;
|
|
48
|
-
send(): Promise<boolean>;
|
|
49
|
-
private _filterRecipients;
|
|
50
|
-
}
|
|
51
|
-
export default SimpleEmail;
|
package/aws/ses/SimpleEmail.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
7
|
-
const BaseClass_1 = __importDefault(require("../../class/BaseClass"));
|
|
8
|
-
/**
|
|
9
|
-
* Class to build and send an AWS SES email.
|
|
10
|
-
*/
|
|
11
|
-
class SimpleEmail extends BaseClass_1.default {
|
|
12
|
-
constructor({ bcc, cc, from, html, subject, to }) {
|
|
13
|
-
super();
|
|
14
|
-
this.to = [];
|
|
15
|
-
this.cc = [];
|
|
16
|
-
this.bcc = [];
|
|
17
|
-
if (bcc) {
|
|
18
|
-
this.setBcc({ recipient: bcc });
|
|
19
|
-
}
|
|
20
|
-
if (cc) {
|
|
21
|
-
this.setCc({ recipient: cc });
|
|
22
|
-
}
|
|
23
|
-
if (from) {
|
|
24
|
-
this.setFrom({ from });
|
|
25
|
-
}
|
|
26
|
-
if (html) {
|
|
27
|
-
this.setHtml({ html });
|
|
28
|
-
}
|
|
29
|
-
if (subject) {
|
|
30
|
-
this.setSubject({ subject });
|
|
31
|
-
}
|
|
32
|
-
if (to) {
|
|
33
|
-
this.setTo({ recipient: to });
|
|
34
|
-
}
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
setFrom({ from }) {
|
|
38
|
-
return this._setValue({ input: from, fields: "from" });
|
|
39
|
-
}
|
|
40
|
-
setHtml({ html }) {
|
|
41
|
-
return this._setValue({ input: html, fields: "html" });
|
|
42
|
-
}
|
|
43
|
-
setSubject({ subject }) {
|
|
44
|
-
return this._setValue({ input: subject, fields: "subject" });
|
|
45
|
-
}
|
|
46
|
-
pushBcc({ recipient }) {
|
|
47
|
-
return this._push({ input: recipient, fields: "bcc" });
|
|
48
|
-
}
|
|
49
|
-
pushCc({ recipient }) {
|
|
50
|
-
return this._push({ input: recipient, fields: "cc" });
|
|
51
|
-
}
|
|
52
|
-
pushTo({ recipient }) {
|
|
53
|
-
return this._push({ input: recipient, fields: "to" });
|
|
54
|
-
}
|
|
55
|
-
setBcc({ recipient }) {
|
|
56
|
-
return this._setArray({ input: recipient, fields: "bcc" });
|
|
57
|
-
}
|
|
58
|
-
setCc({ recipient }) {
|
|
59
|
-
return this._setArray({ input: recipient, fields: "cc" });
|
|
60
|
-
}
|
|
61
|
-
setTo({ recipient }) {
|
|
62
|
-
return this._setArray({ input: recipient, fields: "to" });
|
|
63
|
-
}
|
|
64
|
-
async send() {
|
|
65
|
-
const { SendEmailCommand } = require("@aws-sdk/client-ses");
|
|
66
|
-
let response;
|
|
67
|
-
// https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/ses-examples-sending-email.html
|
|
68
|
-
const params = {
|
|
69
|
-
Destination: {
|
|
70
|
-
BccAddresses: this._filterRecipients({ field: "bcc" }),
|
|
71
|
-
CcAddresses: this._filterRecipients({ field: "cc" }),
|
|
72
|
-
ToAddresses: this._filterRecipients({ field: "to" }),
|
|
73
|
-
},
|
|
74
|
-
Message: {
|
|
75
|
-
Body: {
|
|
76
|
-
Html: {
|
|
77
|
-
Charset: "UTF-8",
|
|
78
|
-
Data: this.html,
|
|
79
|
-
},
|
|
80
|
-
Text: {
|
|
81
|
-
Charset: "UTF-8",
|
|
82
|
-
Data: this.html,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
Subject: {
|
|
86
|
-
Charset: "UTF-8",
|
|
87
|
-
Data: this.subject,
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
Source: this.from,
|
|
91
|
-
};
|
|
92
|
-
const command = new SendEmailCommand(params);
|
|
93
|
-
try {
|
|
94
|
-
response = await global.awsSesClient.send(command);
|
|
95
|
-
}
|
|
96
|
-
catch (exception) {
|
|
97
|
-
response = exception;
|
|
98
|
-
}
|
|
99
|
-
return response;
|
|
100
|
-
}
|
|
101
|
-
_filterRecipients({ field }) {
|
|
102
|
-
// Remove all undefined and null values
|
|
103
|
-
let response = this[field].filter(recipient => recipient && null !== recipient);
|
|
104
|
-
// Clean all the values
|
|
105
|
-
response = response.map(recipient => recipient.toLowerCase()
|
|
106
|
-
.trim());
|
|
107
|
-
// Remove all empty values
|
|
108
|
-
response = response.filter(recipient => "" !== recipient);
|
|
109
|
-
// Return only unique values
|
|
110
|
-
response = (0, uniq_1.default)(response);
|
|
111
|
-
return response;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
exports.default = SimpleEmail;
|
package/aws/ses/initClient.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Config } from '../getConfig';
|
|
2
|
-
type InitClient = {
|
|
3
|
-
config: Config;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Shorthand function to get the Lambda Client.
|
|
7
|
-
* Library: @aws-sdk/client-ses
|
|
8
|
-
*/
|
|
9
|
-
declare const initClient: ({ config }: InitClient) => void;
|
|
10
|
-
export default initClient;
|
package/aws/ses/initClient.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const getConfig_1 = __importDefault(require("../getConfig"));
|
|
7
|
-
global.awsSesClient = null;
|
|
8
|
-
/**
|
|
9
|
-
* Shorthand function to get the Lambda Client.
|
|
10
|
-
* Library: @aws-sdk/client-ses
|
|
11
|
-
*/
|
|
12
|
-
const initClient = ({ config }) => {
|
|
13
|
-
if (!global.awsSesClient) {
|
|
14
|
-
const { SESClient } = require('@aws-sdk/client-ses');
|
|
15
|
-
const formattedConfig = (0, getConfig_1.default)({ config });
|
|
16
|
-
global.awsSesClient = new SESClient(formattedConfig);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
exports.default = initClient;
|
package/aws/sqs/addToQueue.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type AddedResponse = {
|
|
2
|
-
'$metadata': {
|
|
3
|
-
httpStatusCode: number;
|
|
4
|
-
requestId: string;
|
|
5
|
-
extendedRequestId: undefined | string;
|
|
6
|
-
cfId: undefined | string;
|
|
7
|
-
attempts: number;
|
|
8
|
-
totalRetryDelay: number;
|
|
9
|
-
};
|
|
10
|
-
MD5OfMessageBody: string;
|
|
11
|
-
MD5OfMessageAttributes: undefined | string;
|
|
12
|
-
MD5OfMessageSystemAttributes: undefined | string;
|
|
13
|
-
MessageId: string;
|
|
14
|
-
SequenceNumber: string;
|
|
15
|
-
};
|
|
16
|
-
type AddToQueue = {
|
|
17
|
-
data: any;
|
|
18
|
-
dedupeId: string;
|
|
19
|
-
groupId?: string;
|
|
20
|
-
queueId?: string;
|
|
21
|
-
queueUrl: string;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/sqs-examples-send-receive-messages.html
|
|
25
|
-
*/
|
|
26
|
-
declare const addToQueue: ({ data, dedupeId, groupId, queueId, queueUrl }: AddToQueue) => Promise<AddedResponse>;
|
|
27
|
-
export default addToQueue;
|
package/aws/sqs/addToQueue.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/sqs-examples-send-receive-messages.html
|
|
5
|
-
*/
|
|
6
|
-
const addToQueue = async ({ data, dedupeId, groupId, queueId, queueUrl }) => {
|
|
7
|
-
const { SendMessageCommand } = require('@aws-sdk/client-sqs');
|
|
8
|
-
let params = {
|
|
9
|
-
MessageBody: JSON.stringify({
|
|
10
|
-
queueId,
|
|
11
|
-
data,
|
|
12
|
-
}),
|
|
13
|
-
QueueUrl: queueUrl,
|
|
14
|
-
};
|
|
15
|
-
// Required for FIFO
|
|
16
|
-
if (undefined !== dedupeId) {
|
|
17
|
-
params["MessageDeduplicationId"] = dedupeId;
|
|
18
|
-
}
|
|
19
|
-
// Required for FIFO
|
|
20
|
-
if (undefined !== groupId) {
|
|
21
|
-
params["MessageGroupId"] = dedupeId;
|
|
22
|
-
}
|
|
23
|
-
const sendData = await global.awsSqsClient.send(new SendMessageCommand(params));
|
|
24
|
-
return sendData;
|
|
25
|
-
};
|
|
26
|
-
exports.default = addToQueue;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AddedResponse } from './addToQueue';
|
|
2
|
-
type DeleteFromQueue = {
|
|
3
|
-
queueUrl: string;
|
|
4
|
-
recipientHandle: string;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Delete a message from a queue.
|
|
8
|
-
*/
|
|
9
|
-
declare const deleteFromQueue: ({ queueUrl, recipientHandle }: DeleteFromQueue) => Promise<AddedResponse>;
|
|
10
|
-
export default deleteFromQueue;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* Delete a message from a queue.
|
|
5
|
-
*/
|
|
6
|
-
const deleteFromQueue = async ({ queueUrl, recipientHandle }) => {
|
|
7
|
-
const { DeleteMessageCommand } = require('@aws-sdk/client-sqs');
|
|
8
|
-
const params = {
|
|
9
|
-
QueueUrl: queueUrl,
|
|
10
|
-
ReceiptHandle: recipientHandle,
|
|
11
|
-
};
|
|
12
|
-
const sendData = await global.awsSqsClient.send(new DeleteMessageCommand(params));
|
|
13
|
-
return sendData;
|
|
14
|
-
};
|
|
15
|
-
exports.default = deleteFromQueue;
|
package/aws/sqs/initClient.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Config } from '../getConfig';
|
|
2
|
-
type InitClient = {
|
|
3
|
-
config: Config;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Shorthand function to get the Lambda Client.
|
|
7
|
-
* Library: @aws-sdk/client-lambda
|
|
8
|
-
*/
|
|
9
|
-
declare const initClient: ({ config }: InitClient) => void;
|
|
10
|
-
export default initClient;
|
package/aws/sqs/initClient.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const getConfig_1 = __importDefault(require("../getConfig"));
|
|
7
|
-
global.awsSqsClient = null;
|
|
8
|
-
/**
|
|
9
|
-
* Shorthand function to get the Lambda Client.
|
|
10
|
-
* Library: @aws-sdk/client-lambda
|
|
11
|
-
*/
|
|
12
|
-
const initClient = ({ config }) => {
|
|
13
|
-
if (!global.awsLambdaClient) {
|
|
14
|
-
const { SQSClient } = require('@aws-sdk/client-sqs');
|
|
15
|
-
const formattedConfig = (0, getConfig_1.default)({ config });
|
|
16
|
-
global.awsSqsClient = new SQSClient(formattedConfig);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
exports.default = initClient;
|
package/aws/sqs/isEventSqs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|