@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
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Country, Month, Network } from "./";
|
|
2
|
-
export type Request = {
|
|
3
|
-
countries?: Country[] | null;
|
|
4
|
-
customerId?: string;
|
|
5
|
-
historicalMetricsOptions?: {
|
|
6
|
-
startMonth: Month;
|
|
7
|
-
startYear: number;
|
|
8
|
-
endMonth: Month;
|
|
9
|
-
endYear: number;
|
|
10
|
-
};
|
|
11
|
-
includeAdultKeywords?: boolean;
|
|
12
|
-
keywordPlanNetwork?: Network;
|
|
13
|
-
queries?: string[];
|
|
14
|
-
language?: number | null;
|
|
15
|
-
url?: string;
|
|
16
|
-
};
|
|
17
|
-
declare const request: Request;
|
|
18
|
-
export default request;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const _1 = require("./");
|
|
4
|
-
const request = {
|
|
5
|
-
countries: [],
|
|
6
|
-
customerId: "",
|
|
7
|
-
historicalMetricsOptions: null,
|
|
8
|
-
includeAdultKeywords: false,
|
|
9
|
-
keywordPlanNetwork: _1.Network.GOOGLE_SEARCH_ONLY,
|
|
10
|
-
queries: [],
|
|
11
|
-
language: null,
|
|
12
|
-
};
|
|
13
|
-
exports.default = request;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { State } from '../../api';
|
|
2
|
-
type Month = {
|
|
3
|
-
date: string;
|
|
4
|
-
month: number;
|
|
5
|
-
searchVolume: number;
|
|
6
|
-
year: number;
|
|
7
|
-
};
|
|
8
|
-
type Keyword = {
|
|
9
|
-
payload: object;
|
|
10
|
-
keyword: string;
|
|
11
|
-
avgCpc: number;
|
|
12
|
-
avgSearchVolume: number;
|
|
13
|
-
competition: number;
|
|
14
|
-
competitionIndex: number;
|
|
15
|
-
months: Month[];
|
|
16
|
-
topOfPageBidHigh: number;
|
|
17
|
-
topOfPageBidLow: number;
|
|
18
|
-
totalSearchVolume: number;
|
|
19
|
-
};
|
|
20
|
-
export type Response = {
|
|
21
|
-
body: Keyword[];
|
|
22
|
-
error: null | string;
|
|
23
|
-
state: State;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
package/initClients.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Config as AwsConfig } from "./aws/getConfig";
|
|
2
|
-
type InitClients = {
|
|
3
|
-
athenaExpress?: {
|
|
4
|
-
database: string;
|
|
5
|
-
s3Bucket: string;
|
|
6
|
-
s3Key: string;
|
|
7
|
-
};
|
|
8
|
-
awsConfig?: AwsConfig;
|
|
9
|
-
awsEc2?: boolean;
|
|
10
|
-
awsEcs?: boolean;
|
|
11
|
-
awsGlue?: boolean;
|
|
12
|
-
awsLambda?: boolean;
|
|
13
|
-
awsS3?: boolean;
|
|
14
|
-
awsSes?: boolean;
|
|
15
|
-
awsSsm?: boolean;
|
|
16
|
-
lumarApi?: {
|
|
17
|
-
parameterName: string;
|
|
18
|
-
};
|
|
19
|
-
lumarGraphql?: {
|
|
20
|
-
parameterName: string;
|
|
21
|
-
};
|
|
22
|
-
eskimi?: boolean;
|
|
23
|
-
googleAds?: {
|
|
24
|
-
parameterName: string;
|
|
25
|
-
};
|
|
26
|
-
googleConfig?: {
|
|
27
|
-
parameterName: string;
|
|
28
|
-
projectId: string;
|
|
29
|
-
};
|
|
30
|
-
googleBigQuery?: boolean;
|
|
31
|
-
googleSheets?: boolean;
|
|
32
|
-
googleStorage?: boolean;
|
|
33
|
-
prisma?: {
|
|
34
|
-
debug?: boolean;
|
|
35
|
-
planetScale?: boolean;
|
|
36
|
-
};
|
|
37
|
-
myTarget?: boolean;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Function to simplify initialising the clients.
|
|
41
|
-
*/
|
|
42
|
-
declare const initClients: (props: InitClients) => Promise<void>;
|
|
43
|
-
export default initClients;
|
package/initClients.js
DELETED
|
@@ -1,131 +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 initClient_1 = __importDefault(require("./aws/athenaExpress/initClient"));
|
|
7
|
-
const initClient_2 = require("./aws/ec2/initClient");
|
|
8
|
-
const initClient_3 = require("./aws/ecs/initClient");
|
|
9
|
-
const initClient_4 = __importDefault(require("./aws/glue/initClient"));
|
|
10
|
-
const initClient_5 = __importDefault(require("./aws/lambda/initClient"));
|
|
11
|
-
const initClient_6 = __importDefault(require("./aws/s3/initClient"));
|
|
12
|
-
const initClient_7 = __importDefault(require("./aws/ses/initClient"));
|
|
13
|
-
const getParameter_1 = __importDefault(require("./aws/ssm/getParameter"));
|
|
14
|
-
const initClient_8 = __importDefault(require("./aws/ssm/initClient"));
|
|
15
|
-
const initClient_9 = __importDefault(require("./lumar/api/initClient"));
|
|
16
|
-
const initClient_10 = __importDefault(require("./lumar/graphql/initClient"));
|
|
17
|
-
const initClient_11 = __importDefault(require("./google/bigQuery/initClient"));
|
|
18
|
-
const initClient_12 = __importDefault(require("./google/sheets/initClient"));
|
|
19
|
-
const initClient_13 = __importDefault(require("./google/storage/initClient"));
|
|
20
|
-
const initClient_14 = __importDefault(require("./googleAds/initClient"));
|
|
21
|
-
const initClient_15 = __importDefault(require("./prisma/initClient"));
|
|
22
|
-
/**
|
|
23
|
-
* Function to simplify initialising the clients.
|
|
24
|
-
*/
|
|
25
|
-
const initClients = async (props) => {
|
|
26
|
-
if (props?.athenaExpress) {
|
|
27
|
-
(0, initClient_1.default)({
|
|
28
|
-
config: props.awsConfig,
|
|
29
|
-
database: props.athenaExpress.database,
|
|
30
|
-
s3Bucket: props.athenaExpress.s3Bucket,
|
|
31
|
-
s3Key: props.athenaExpress.s3Key,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
if (props?.awsEc2) {
|
|
35
|
-
(0, initClient_2.initClient)({
|
|
36
|
-
config: props.awsConfig,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
if (props?.awsEcs) {
|
|
40
|
-
(0, initClient_3.initClient)({
|
|
41
|
-
config: props.awsConfig,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
if (props?.awsGlue) {
|
|
45
|
-
(0, initClient_4.default)({
|
|
46
|
-
config: props.awsConfig,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
if (props?.awsLambda) {
|
|
50
|
-
(0, initClient_5.default)({
|
|
51
|
-
config: props.awsConfig,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
if (props?.awsS3) {
|
|
55
|
-
(0, initClient_6.default)({
|
|
56
|
-
config: props.awsConfig,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
if (props?.awsSes) {
|
|
60
|
-
(0, initClient_7.default)({
|
|
61
|
-
config: props.awsConfig,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
if (props?.awsSsm || props?.lumarApi || props?.lumarGraphql || props?.googleAds || props?.googleConfig) {
|
|
65
|
-
(0, initClient_8.default)({
|
|
66
|
-
config: props.awsConfig,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
// Lumar (API) authentication using SSM Parameter
|
|
70
|
-
if (props?.lumarApi) {
|
|
71
|
-
const lumarApiParameter = await (0, getParameter_1.default)({
|
|
72
|
-
name: props.lumarApi.parameterName,
|
|
73
|
-
});
|
|
74
|
-
await (0, initClient_9.default)({
|
|
75
|
-
auth: lumarApiParameter
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
// Lumar (GraphQL) authentication using SSM Parameter
|
|
79
|
-
if (props?.lumarGraphql) {
|
|
80
|
-
const lumarGraphqlParameter = await (0, getParameter_1.default)({
|
|
81
|
-
name: props.lumarGraphql.parameterName,
|
|
82
|
-
});
|
|
83
|
-
await (0, initClient_10.default)({
|
|
84
|
-
auth: lumarGraphqlParameter
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
// Google authentication using SSM
|
|
88
|
-
if (props?.googleConfig) {
|
|
89
|
-
// Google Parameter
|
|
90
|
-
const googleParameter = await (0, getParameter_1.default)({
|
|
91
|
-
name: props.googleConfig.parameterName,
|
|
92
|
-
});
|
|
93
|
-
// BigQuery
|
|
94
|
-
if (props?.googleBigQuery && props?.googleConfig?.projectId) {
|
|
95
|
-
(0, initClient_11.default)({
|
|
96
|
-
parameter: googleParameter,
|
|
97
|
-
projectId: props.googleConfig.projectId,
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
// Google Sheets
|
|
101
|
-
if (props?.googleSheets) {
|
|
102
|
-
(0, initClient_12.default)({
|
|
103
|
-
parameter: googleParameter,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
// Google Storage
|
|
107
|
-
if (props?.googleStorage && props?.googleConfig?.projectId) {
|
|
108
|
-
(0, initClient_13.default)({
|
|
109
|
-
parameter: googleParameter,
|
|
110
|
-
projectId: props.googleConfig.projectId,
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
// Google Ads authentication using SSM Parameter
|
|
115
|
-
if (props?.googleAds) {
|
|
116
|
-
const googleAdsParameter = await (0, getParameter_1.default)({
|
|
117
|
-
name: props.googleAds.parameterName,
|
|
118
|
-
});
|
|
119
|
-
await (0, initClient_14.default)({
|
|
120
|
-
parameter: googleAdsParameter,
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
// Initialise Prisma
|
|
124
|
-
if (props?.prisma) {
|
|
125
|
-
(0, initClient_15.default)({
|
|
126
|
-
debug: props?.prisma?.debug ?? false,
|
|
127
|
-
planetScale: props?.prisma?.planetScale ?? false,
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
exports.default = initClients;
|
package/json/getJsonNewline.d.ts
DELETED
package/json/getJsonNewline.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 getArray_1 = __importDefault(require("../array/getArray"));
|
|
7
|
-
const GetJsonNewline = ({ data }) => {
|
|
8
|
-
// Must be an array
|
|
9
|
-
const inputArray = (0, getArray_1.default)({
|
|
10
|
-
input: data
|
|
11
|
-
});
|
|
12
|
-
// For each array row convert the row
|
|
13
|
-
const stringRows = inputArray.map(row => JSON.stringify(row));
|
|
14
|
-
// Combine each row with a line separator
|
|
15
|
-
return stringRows.join("\n");
|
|
16
|
-
};
|
|
17
|
-
exports.default = GetJsonNewline;
|
package/json/isJson.d.ts
DELETED
package/json/isJson.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* Is the provided input JSON?
|
|
5
|
-
* https://stackoverflow.com/a/33369954
|
|
6
|
-
*/
|
|
7
|
-
const isJson = ({ input }) => {
|
|
8
|
-
input = 'string' === typeof input ? input : JSON.stringify(input);
|
|
9
|
-
try {
|
|
10
|
-
input = JSON.parse(input);
|
|
11
|
-
}
|
|
12
|
-
catch (e) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
if ('object' === typeof input && null !== input) {
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
return false;
|
|
19
|
-
};
|
|
20
|
-
exports.default = isJson;
|
|
@@ -1,21 +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 get_1 = __importDefault(require("../axios/get"));
|
|
7
|
-
/**
|
|
8
|
-
* Get the URL Status for a given URL ID from Little Warden.
|
|
9
|
-
*/
|
|
10
|
-
const getUrlStatus = async ({ apiKey, urlId }) => {
|
|
11
|
-
const response = await (0, get_1.default)({
|
|
12
|
-
config: {
|
|
13
|
-
headers: {
|
|
14
|
-
'Authorization': `Token token="${apiKey}"`,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
url: `https://littlewarden.com/api/sites/${urlId}`,
|
|
18
|
-
});
|
|
19
|
-
return response.getBodyDefaultTo({ defaultValue: {}, keys: ['data', 'site'] });
|
|
20
|
-
};
|
|
21
|
-
exports.default = getUrlStatus;
|
package/littleWarden/index.d.ts
DELETED
package/littleWarden/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.State = void 0;
|
|
4
|
-
var State;
|
|
5
|
-
(function (State) {
|
|
6
|
-
State["ALL_GOOD"] = "all_good";
|
|
7
|
-
State["DANGER"] = "danger";
|
|
8
|
-
State["WARNING"] = "warning";
|
|
9
|
-
})(State || (exports.State = State = {}));
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const _1 = require("./");
|
|
4
|
-
/**
|
|
5
|
-
* Check if the field is All Good.
|
|
6
|
-
*/
|
|
7
|
-
const isAllGood = ({ field }) => {
|
|
8
|
-
let response = false;
|
|
9
|
-
// Check that the status field exists
|
|
10
|
-
if (undefined !== field && undefined !== field["status"]) {
|
|
11
|
-
response = _1.State.ALL_GOOD === field["status"];
|
|
12
|
-
}
|
|
13
|
-
return response;
|
|
14
|
-
};
|
|
15
|
-
exports.default = isAllGood;
|
package/littleWarden/isDanger.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const _1 = require("./");
|
|
4
|
-
/**
|
|
5
|
-
* Check if the field is Danger.
|
|
6
|
-
*/
|
|
7
|
-
const isDanger = ({ field }) => {
|
|
8
|
-
let response = false;
|
|
9
|
-
// Check that the status field exists
|
|
10
|
-
if (undefined !== field && undefined !== field['status']) {
|
|
11
|
-
response = _1.State.DANGER === field['status'];
|
|
12
|
-
}
|
|
13
|
-
return response;
|
|
14
|
-
};
|
|
15
|
-
exports.default = isDanger;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const _1 = require("./");
|
|
4
|
-
/**
|
|
5
|
-
* Check if the field is Warning.
|
|
6
|
-
*/
|
|
7
|
-
const isWarning = ({ field }) => {
|
|
8
|
-
let response = false;
|
|
9
|
-
// Check that the status field exists
|
|
10
|
-
if (undefined !== field && undefined !== field['status']) {
|
|
11
|
-
response = _1.State.WARNING === field['status'];
|
|
12
|
-
}
|
|
13
|
-
return response;
|
|
14
|
-
};
|
|
15
|
-
exports.default = isWarning;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Filter } from './filter';
|
|
2
|
-
import { Order } from './orders';
|
|
3
|
-
export type Request = {
|
|
4
|
-
crawlId?: number;
|
|
5
|
-
customPath?: string;
|
|
6
|
-
filters?: Filter[];
|
|
7
|
-
limit?: number;
|
|
8
|
-
orders?: Order[];
|
|
9
|
-
page?: number;
|
|
10
|
-
projectId?: number;
|
|
11
|
-
report?: string;
|
|
12
|
-
subReport?: string;
|
|
13
|
-
};
|
|
14
|
-
declare const buildRequest: ({ crawlId, customPath, filters, limit, orders, page, projectId, report, subReport, }: Request) => string;
|
|
15
|
-
export default buildRequest;
|
|
@@ -1,83 +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 reports_1 = __importDefault(require("./reports"));
|
|
7
|
-
const orders_1 = __importDefault(require("./orders"));
|
|
8
|
-
const buildRequest = ({ crawlId, customPath, filters, limit, orders, page, projectId, report, subReport, }) => {
|
|
9
|
-
let url = `https://api.deepcrawl.com/accounts/37204`;
|
|
10
|
-
// Limit must be greater than 0 but also less than 200
|
|
11
|
-
if (undefined !== limit) {
|
|
12
|
-
if (limit > 200) {
|
|
13
|
-
throw `Maximum row limit is 200.`;
|
|
14
|
-
}
|
|
15
|
-
else if (0 === limit) {
|
|
16
|
-
throw `Row limit must be greater than 0.`;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
// Set limit to 200 by default
|
|
20
|
-
else {
|
|
21
|
-
limit = 200;
|
|
22
|
-
}
|
|
23
|
-
// If a report other than List Crawls is selected, Crawl ID must be defined
|
|
24
|
-
if (undefined !== report && reports_1.default.LIST_CRAWLS !== report && undefined == crawlId) {
|
|
25
|
-
throw `Crawl ID must be defined.`;
|
|
26
|
-
}
|
|
27
|
-
switch (report) {
|
|
28
|
-
case reports_1.default.LIST_CRAWLS:
|
|
29
|
-
url += `/projects/${projectId}/crawls`;
|
|
30
|
-
break;
|
|
31
|
-
case reports_1.default.LIST_PROJECTS:
|
|
32
|
-
url += `/projects`;
|
|
33
|
-
break;
|
|
34
|
-
case reports_1.default.CUSTOM:
|
|
35
|
-
url += customPath;
|
|
36
|
-
url = url.replace('[PROJECT]', projectId.toString());
|
|
37
|
-
url = url.replace('[CRAWL]', crawlId.toString());
|
|
38
|
-
break;
|
|
39
|
-
case reports_1.default.CRAWL_STATISTICS:
|
|
40
|
-
url += `/projects/${projectId}/crawls/${crawlId}/statistics`;
|
|
41
|
-
break;
|
|
42
|
-
case reports_1.default.LIST_REPORTS:
|
|
43
|
-
url += `/projects/${projectId}/crawls/${crawlId}/reports`;
|
|
44
|
-
break;
|
|
45
|
-
case reports_1.default.REPORT_ROWS:
|
|
46
|
-
case reports_1.default.REPORT_STATISTICS:
|
|
47
|
-
case reports_1.default.REPORT_SUMMARY:
|
|
48
|
-
url += `/projects/${projectId}/crawls/${crawlId}/reports/${subReport}`;
|
|
49
|
-
if (reports_1.default.REPORT_ROWS === report) {
|
|
50
|
-
url += `/report_rows`;
|
|
51
|
-
}
|
|
52
|
-
else if (reports_1.default.REPORT_STATISTICS === report) {
|
|
53
|
-
url += `/statistics`;
|
|
54
|
-
}
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
// Specify the limit
|
|
58
|
-
url += -1 === url.indexOf('?') ? '?' : '&';
|
|
59
|
-
url += `per_page=${limit}`;
|
|
60
|
-
// Set the page number
|
|
61
|
-
if (undefined !== page) {
|
|
62
|
-
url += -1 === url.indexOf('?') ? '?' : '&';
|
|
63
|
-
url += `page=${page}`;
|
|
64
|
-
}
|
|
65
|
-
// Apply any filters
|
|
66
|
-
if (undefined !== filters) {
|
|
67
|
-
filters.map(filter => {
|
|
68
|
-
url += -1 === url.indexOf('?') ? '?' : '&';
|
|
69
|
-
url += `q[${filter.field}_${filter.operand}]=${filter.value}`;
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
// Order the data
|
|
73
|
-
if (undefined !== orders) {
|
|
74
|
-
url += -1 === url.indexOf('?') ? '?' : '&';
|
|
75
|
-
orders.map((order, index) => {
|
|
76
|
-
url += 0 === index ? 'sort=' : ',';
|
|
77
|
-
url += orders_1.default.DESCENDING === order.direction ? '-' : '';
|
|
78
|
-
url += order.field;
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
return url;
|
|
82
|
-
};
|
|
83
|
-
exports.default = buildRequest;
|
package/lumar/api/filter.d.ts
DELETED
package/lumar/api/filter.js
DELETED
package/lumar/api/getData.d.ts
DELETED
package/lumar/api/getData.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 get_1 = __importDefault(require("../../axios/get"));
|
|
7
|
-
const getData = async ({ url }) => {
|
|
8
|
-
const apiResponse = await (0, get_1.default)({
|
|
9
|
-
config: {
|
|
10
|
-
headers: {
|
|
11
|
-
'X-AUTH-TOKEN': global.deepcrawlApi.token,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
url,
|
|
15
|
-
});
|
|
16
|
-
return apiResponse;
|
|
17
|
-
};
|
|
18
|
-
exports.default = getData;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type InitClient = {
|
|
2
|
-
auth: {
|
|
3
|
-
apiId: string;
|
|
4
|
-
apiKey: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* http://api-docs.deepcrawl.com/
|
|
9
|
-
* Renew the Lumar user token.
|
|
10
|
-
* Token lasts for 6 hours.
|
|
11
|
-
*/
|
|
12
|
-
declare const initClient: ({ auth }: InitClient) => Promise<void>;
|
|
13
|
-
export default initClient;
|
package/lumar/api/initClient.js
DELETED
|
@@ -1,38 +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 post_1 = __importDefault(require("../../axios/post"));
|
|
7
|
-
global.lumarApi = {
|
|
8
|
-
token: null,
|
|
9
|
-
updatedAt: null,
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* http://api-docs.deepcrawl.com/
|
|
13
|
-
* Renew the Lumar user token.
|
|
14
|
-
* Token lasts for 6 hours.
|
|
15
|
-
*/
|
|
16
|
-
const initClient = async ({ auth }) => {
|
|
17
|
-
// todo: Or was more than 6 hours ago
|
|
18
|
-
if (null === global.lumarApi.token) {
|
|
19
|
-
const apiResponse = await (0, post_1.default)({
|
|
20
|
-
config: {
|
|
21
|
-
auth: {
|
|
22
|
-
username: auth.apiId,
|
|
23
|
-
password: auth.apiKey,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
url: `https://api.deepcrawl.com/sessions`,
|
|
27
|
-
});
|
|
28
|
-
// Ensure the value exists
|
|
29
|
-
const token = apiResponse.getBodyDefaultTo({
|
|
30
|
-
defaultValue: null,
|
|
31
|
-
keys: ['token'],
|
|
32
|
-
});
|
|
33
|
-
if (token) {
|
|
34
|
-
global.lumarApi.token = token;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.default = initClient;
|
package/lumar/api/operands.d.ts
DELETED
package/lumar/api/operands.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const operands = {
|
|
4
|
-
EQUALS: 'eql',
|
|
5
|
-
CONTAINS: 'cont',
|
|
6
|
-
LESS_THAN: 'lt',
|
|
7
|
-
LESS_THAN_OR_EQUAL: 'lte',
|
|
8
|
-
GREATER_THAN: 'gt',
|
|
9
|
-
GREATER_THAN_OR_EQUAL: 'gte',
|
|
10
|
-
REGEX: 'rgx',
|
|
11
|
-
NOT_REGEX: 'nrgx',
|
|
12
|
-
};
|
|
13
|
-
exports.default = operands;
|
package/lumar/api/orders.d.ts
DELETED