@8ms/helpers 2.3.5 → 2.3.7
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 +0 -3
- package/.yarn/install-state.gz +0 -0
- package/dist/_class/index.d.mts +2 -0
- package/dist/_class/index.mjs +62 -0
- package/dist/adverity/index.d.mts +2 -0
- package/dist/adverity/index.mjs +64 -0
- package/{adverity/server/getJobs.d.ts → dist/adverity/server/index.d.mts} +11 -8
- package/dist/adverity/server/index.mjs +25 -0
- package/dist/api/index.d.mts +2 -0
- package/dist/api/index.mjs +3 -0
- package/dist/api-DGKJDAfb.mjs +139 -0
- package/dist/array/index.d.mts +11 -0
- package/dist/array/index.mjs +14 -0
- package/dist/atInternet/index.d.mts +20 -0
- package/dist/atInternet/index.mjs +18 -0
- package/dist/aws/ec2/server/index.d.mts +18 -0
- package/dist/aws/ec2/server/index.mjs +48 -0
- package/dist/aws/ecs/server/index.d.mts +59 -0
- package/dist/aws/ecs/server/index.mjs +113 -0
- package/dist/aws/glue/server/index.d.mts +19 -0
- package/dist/aws/glue/server/index.mjs +36 -0
- package/dist/aws/lambda/server/index.d.mts +28 -0
- package/dist/aws/lambda/server/index.mjs +57 -0
- package/dist/aws/s3/server/index.d.mts +124 -0
- package/dist/aws/s3/server/index.mjs +361 -0
- package/dist/aws/server/index.d.mts +2 -0
- package/dist/aws/server/index.mjs +3 -0
- package/dist/aws/ses/server/index.d.mts +105 -0
- package/dist/aws/ses/server/index.mjs +269 -0
- package/dist/aws/sqs/server/index.d.mts +41 -0
- package/dist/aws/sqs/server/index.mjs +56 -0
- package/dist/aws/ssm/server/index.d.mts +18 -0
- package/dist/aws/ssm/server/index.mjs +47 -0
- package/dist/axios/index.d.mts +22 -0
- package/dist/axios/index.mjs +50 -0
- package/dist/boolean/index.d.mts +7 -0
- package/dist/boolean/index.mjs +15 -0
- package/dist/brightData/serpApi/server/index.d.mts +93 -0
- package/dist/brightData/serpApi/server/index.mjs +229 -0
- package/dist/brightData/server/index.d.mts +2 -0
- package/dist/brightData/server/index.mjs +18 -0
- package/dist/brightData/webScraperIde/server/index.d.mts +19 -0
- package/dist/brightData/webScraperIde/server/index.mjs +50 -0
- package/dist/cache/server/index.d.mts +10 -0
- package/dist/cache/server/index.mjs +31 -0
- package/dist/chunk-CgI6uo-e.mjs +32 -0
- package/dist/crud/index.d.mts +10 -0
- package/dist/crud/index.mjs +10 -0
- package/dist/crypto/index.d.mts +28 -0
- package/dist/crypto/index.mjs +47 -0
- package/dist/date/index.d.mts +2 -0
- package/dist/date/index.mjs +471 -0
- package/dist/environment/index.d.mts +37 -0
- package/dist/environment/index.mjs +60 -0
- package/dist/eskimi/index.d.mts +52 -0
- package/dist/eskimi/index.mjs +90 -0
- package/dist/eskimi/server/index.d.mts +25 -0
- package/dist/eskimi/server/index.mjs +50 -0
- package/dist/file/index.d.mts +7 -0
- package/dist/file/index.mjs +20 -0
- package/dist/file/server/index.d.mts +8 -0
- package/dist/file/server/index.mjs +16 -0
- package/dist/from-9s4TjsYv.mjs +3878 -0
- package/dist/geo/index.d.mts +26 -0
- package/dist/geo/index.mjs +1591 -0
- package/dist/getDecimal-CafxtLhH.mjs +40 -0
- package/dist/googleAds/keywordPlanner/server/index.d.mts +45 -0
- package/dist/googleAds/keywordPlanner/server/index.mjs +51 -0
- package/dist/googleAds/server/index.d.mts +27 -0
- package/dist/googleAds/server/index.mjs +48 -0
- package/dist/googleCloud/bigquery/server/index.d.mts +82 -0
- package/dist/googleCloud/bigquery/server/index.mjs +127 -0
- package/dist/googleCloud/server/index.d.mts +2 -0
- package/dist/googleCloud/server/index.mjs +24 -0
- package/dist/googleCloud/sheets/server/index.d.mts +22 -0
- package/dist/googleCloud/sheets/server/index.mjs +31 -0
- package/dist/googleCloud/storage/server/index.d.mts +31 -0
- package/dist/googleCloud/storage/server/index.mjs +79 -0
- package/dist/googlePageSpeed/server/index.d.mts +34 -0
- package/dist/googlePageSpeed/server/index.mjs +53 -0
- package/dist/googleSearchIncidents/server/index.d.mts +73 -0
- package/dist/googleSearchIncidents/server/index.mjs +55 -0
- package/dist/greenDomain/server/index.d.mts +25 -0
- package/dist/greenDomain/server/index.mjs +31 -0
- package/dist/index-B20FTOvk.d.mts +67 -0
- package/dist/index-B4K9Z1U-.d.mts +17 -0
- package/dist/index-CFaAdPAh.d.mts +32 -0
- package/dist/index-CIG08fpw.d.mts +32 -0
- package/dist/index-CMfxuwL1.d.mts +246 -0
- package/dist/index-DEm1Wodf.d.mts +116 -0
- package/dist/index-sfVt7tI_.d.mts +18 -0
- package/dist/inngest/index.d.mts +10 -0
- package/dist/inngest/index.mjs +10 -0
- package/dist/json/index.d.mts +7 -0
- package/dist/json/index.mjs +27 -0
- package/dist/littleWarden/server/index.d.mts +56 -0
- package/dist/littleWarden/server/index.mjs +79 -0
- package/dist/lumar/api/server/index.d.mts +66 -0
- package/dist/lumar/api/server/index.mjs +111 -0
- package/dist/lumar/graphql/server/index.d.mts +308 -0
- package/dist/lumar/graphql/server/index.mjs +172 -0
- package/dist/multipart-parser-BC14QSvI.mjs +290 -0
- package/dist/myTarget/server/index.d.mts +9 -0
- package/dist/myTarget/server/index.mjs +16 -0
- package/dist/nextAuth/index.d.mts +12 -0
- package/dist/nextAuth/index.mjs +15 -0
- package/dist/nextJs/client/index.d.mts +10 -0
- package/dist/nextJs/client/index.mjs +12 -0
- package/dist/nextJs/index.d.mts +19 -0
- package/dist/nextJs/index.mjs +12 -0
- package/dist/number/index.d.mts +54 -0
- package/dist/number/index.mjs +75 -0
- package/{object/replaceKeys.d.ts → dist/object/index.d.mts} +4 -1
- package/dist/object/index.mjs +22 -0
- package/dist/onePassword/server/index.d.mts +24 -0
- package/dist/onePassword/server/index.mjs +50 -0
- package/dist/openAi/server/index.d.mts +20 -0
- package/dist/openAi/server/index.mjs +46 -0
- package/dist/prisma/index.d.mts +7 -0
- package/dist/prisma/index.mjs +16 -0
- package/dist/prisma/server/index.d.mts +31 -0
- package/dist/prisma/server/index.mjs +72 -0
- package/dist/server-Bwy4JI8Z.mjs +33 -0
- package/dist/snapchat/server/index.d.mts +25 -0
- package/dist/snapchat/server/index.mjs +39 -0
- package/dist/sorting/index.d.mts +25 -0
- package/dist/sorting/index.mjs +50 -0
- package/dist/src-BeXFXTgz.mjs +1272 -0
- package/dist/stream/server/index.d.mts +15 -0
- package/dist/stream/server/index.mjs +48 -0
- package/dist/string/index.d.mts +107 -0
- package/dist/string/index.mjs +191 -0
- package/dist/swr/client/index.d.mts +46 -0
- package/dist/swr/client/index.mjs +40 -0
- package/dist/upTimeRobot/server/index.d.mts +72 -0
- package/dist/upTimeRobot/server/index.mjs +83 -0
- package/dist/url/index.d.mts +29 -0
- package/dist/url/index.mjs +52 -0
- package/dist/url/server/index.d.mts +9 -0
- package/dist/url/server/index.mjs +35 -0
- package/dist/util/index.d.mts +47 -0
- package/dist/util/index.mjs +99 -0
- package/dist/util/server/index.d.mts +27 -0
- package/dist/util/server/index.mjs +61 -0
- package/dist/webWorker/index.d.mts +11 -0
- package/dist/webWorker/index.mjs +11 -0
- package/dist/xml/server/index.d.mts +4 -0
- package/dist/xml/server/index.mjs +17 -0
- package/package.json +71 -1066
- package/tsdown.config.ts +10 -0
- package/.github/generate-exports.js +0 -111
- package/_class/BaseClass.d.ts +0 -18
- package/_class/BaseClass.js +0 -44
- package/_class/BaseNamespace.d.ts +0 -9
- package/_class/BaseNamespace.js +0 -24
- package/_class/index.d.ts +0 -2
- package/_class/index.js +0 -2
- package/adverity/adverity.d.ts +0 -112
- package/adverity/adverity.js +0 -58
- package/adverity/index.d.ts +0 -1
- package/adverity/index.js +0 -1
- package/adverity/server/getJobs.js +0 -26
- package/adverity/server/index.d.ts +0 -1
- package/adverity/server/index.js +0 -1
- package/api/ApiResponseClass.d.ts +0 -35
- package/api/ApiResponseClass.js +0 -93
- package/api/api.d.ts +0 -17
- package/api/api.js +0 -15
- package/api/functions.d.ts +0 -7
- package/api/functions.js +0 -19
- package/api/index.d.ts +0 -3
- package/api/index.js +0 -3
- package/array/array.d.ts +0 -8
- package/array/array.js +0 -9
- package/array/index.d.ts +0 -1
- package/array/index.js +0 -1
- package/atInternet/atInternet.d.ts +0 -16
- package/atInternet/atInternet.js +0 -15
- package/atInternet/index.d.ts +0 -1
- package/atInternet/index.js +0 -1
- package/aws/ec2/server/AwsEc2Namespace.d.ts +0 -10
- package/aws/ec2/server/AwsEc2Namespace.js +0 -37
- package/aws/ec2/server/awsEc2.d.ts +0 -3
- package/aws/ec2/server/awsEc2.js +0 -12
- package/aws/ec2/server/index.d.ts +0 -2
- package/aws/ec2/server/index.js +0 -2
- package/aws/ecs/server/AwsEcsNamespace.d.ts +0 -53
- package/aws/ecs/server/AwsEcsNamespace.js +0 -118
- package/aws/ecs/server/awsEcs.d.ts +0 -3
- package/aws/ecs/server/awsEcs.js +0 -12
- package/aws/ecs/server/index.d.ts +0 -2
- package/aws/ecs/server/index.js +0 -2
- package/aws/glue/server/AwsGlueNamespace.d.ts +0 -12
- package/aws/glue/server/AwsGlueNamespace.js +0 -29
- package/aws/glue/server/awsGlue.d.ts +0 -3
- package/aws/glue/server/awsGlue.js +0 -12
- package/aws/glue/server/index.d.ts +0 -2
- package/aws/glue/server/index.js +0 -2
- package/aws/lambda/server/AwsLambdaNamespace.d.ts +0 -21
- package/aws/lambda/server/AwsLambdaNamespace.js +0 -69
- package/aws/lambda/server/awsLambda.d.ts +0 -4
- package/aws/lambda/server/awsLambda.js +0 -16
- package/aws/lambda/server/index.d.ts +0 -2
- package/aws/lambda/server/index.js +0 -2
- package/aws/s3/server/AwsS3Namespace.d.ts +0 -65
- package/aws/s3/server/AwsS3Namespace.js +0 -364
- package/aws/s3/server/awsS3.d.ts +0 -13
- package/aws/s3/server/awsS3.js +0 -20
- package/aws/s3/server/index.d.ts +0 -3
- package/aws/s3/server/index.js +0 -3
- package/aws/s3/server/payload.d.ts +0 -42
- package/aws/s3/server/payload.js +0 -43
- package/aws/server/aws.d.ts +0 -9
- package/aws/server/aws.js +0 -29
- package/aws/server/index.d.ts +0 -2
- package/aws/server/index.js +0 -2
- package/aws/server/isResponse200.d.ts +0 -4
- package/aws/server/isResponse200.js +0 -12
- package/aws/ses/server/AwsSesNamespace.d.ts +0 -9
- package/aws/ses/server/AwsSesNamespace.js +0 -41
- package/aws/ses/server/SimpleEmail.d.ts +0 -81
- package/aws/ses/server/SimpleEmail.js +0 -296
- package/aws/ses/server/awsSes.d.ts +0 -4
- package/aws/ses/server/awsSes.js +0 -13
- package/aws/ses/server/index.d.ts +0 -3
- package/aws/ses/server/index.js +0 -3
- package/aws/sqs/server/AwsSqsNamespace.d.ts +0 -34
- package/aws/sqs/server/AwsSqsNamespace.js +0 -55
- package/aws/sqs/server/awsSqs.d.ts +0 -3
- package/aws/sqs/server/awsSqs.js +0 -12
- package/aws/sqs/server/index.d.ts +0 -2
- package/aws/sqs/server/index.js +0 -2
- package/aws/ssm/server/AwsSsmNamespace.d.ts +0 -11
- package/aws/ssm/server/AwsSsmNamespace.js +0 -52
- package/aws/ssm/server/awsSsm.d.ts +0 -3
- package/aws/ssm/server/awsSsm.js +0 -12
- package/aws/ssm/server/index.d.ts +0 -2
- package/aws/ssm/server/index.js +0 -2
- package/axios/deleteRequest.d.ts +0 -6
- package/axios/deleteRequest.js +0 -26
- package/axios/get.d.ts +0 -5
- package/axios/get.js +0 -24
- package/axios/index.d.ts +0 -3
- package/axios/index.js +0 -3
- package/axios/post.d.ts +0 -5
- package/axios/post.js +0 -25
- package/boolean/boolean.d.ts +0 -4
- package/boolean/boolean.js +0 -16
- package/boolean/index.d.ts +0 -1
- package/boolean/index.js +0 -1
- package/brightData/serpApi/server/brightDataSerpApi.d.ts +0 -10
- package/brightData/serpApi/server/brightDataSerpApi.js +0 -9
- package/brightData/serpApi/server/buildGoogleSerpUrl.d.ts +0 -32
- package/brightData/serpApi/server/buildGoogleSerpUrl.js +0 -112
- package/brightData/serpApi/server/buildGoogleTrendsUrl.d.ts +0 -22
- package/brightData/serpApi/server/buildGoogleTrendsUrl.js +0 -57
- package/brightData/serpApi/server/getAsyncRequestId.d.ts +0 -8
- package/brightData/serpApi/server/getAsyncRequestId.js +0 -32
- package/brightData/serpApi/server/getAsyncResults.d.ts +0 -7
- package/brightData/serpApi/server/getAsyncResults.js +0 -31
- package/brightData/serpApi/server/getRealtime.d.ts +0 -5
- package/brightData/serpApi/server/getRealtime.js +0 -26
- package/brightData/serpApi/server/index.d.ts +0 -6
- package/brightData/serpApi/server/index.js +0 -6
- package/brightData/server/brightData.d.ts +0 -15
- package/brightData/server/brightData.js +0 -15
- package/brightData/server/index.d.ts +0 -1
- package/brightData/server/index.js +0 -1
- package/brightData/webScraperIde/server/getBatch.d.ts +0 -7
- package/brightData/webScraperIde/server/getBatch.js +0 -24
- package/brightData/webScraperIde/server/getRealtime.d.ts +0 -7
- package/brightData/webScraperIde/server/getRealtime.js +0 -45
- package/brightData/webScraperIde/server/index.d.ts +0 -2
- package/brightData/webScraperIde/server/index.js +0 -2
- package/cache/server/cache.d.ts +0 -7
- package/cache/server/cache.js +0 -43
- package/cache/server/index.d.ts +0 -1
- package/cache/server/index.js +0 -1
- package/cache/server/test/cache.test.d.ts +0 -1
- package/cache/server/test/cache.test.js +0 -8
- package/crud/crud.d.ts +0 -7
- package/crud/crud.js +0 -6
- package/crud/index.d.ts +0 -1
- package/crud/index.js +0 -1
- package/crypto/getDecrypt.d.ts +0 -5
- package/crypto/getDecrypt.js +0 -10
- package/crypto/getEncrypt.d.ts +0 -5
- package/crypto/getEncrypt.js +0 -10
- package/crypto/getRandom.d.ts +0 -4
- package/crypto/getRandom.js +0 -8
- package/crypto/getSha256.d.ts +0 -5
- package/crypto/getSha256.js +0 -11
- package/crypto/index.d.ts +0 -4
- package/crypto/index.js +0 -4
- package/date/calculation.d.ts +0 -102
- package/date/calculation.js +0 -272
- package/date/date.d.ts +0 -36
- package/date/date.js +0 -20
- package/date/financialYear.d.ts +0 -19
- package/date/financialYear.js +0 -78
- package/date/format.d.ts +0 -85
- package/date/format.js +0 -160
- package/date/index.d.ts +0 -4
- package/date/index.js +0 -4
- package/environment/environment.d.ts +0 -34
- package/environment/environment.js +0 -79
- package/environment/index.d.ts +0 -1
- package/environment/index.js +0 -1
- package/eskimi/eskimi.d.ts +0 -49
- package/eskimi/eskimi.js +0 -93
- package/eskimi/index.d.ts +0 -1
- package/eskimi/index.js +0 -1
- package/eskimi/server/getAgeGroup.d.ts +0 -4
- package/eskimi/server/getAgeGroup.js +0 -11
- package/eskimi/server/getData.d.ts +0 -4
- package/eskimi/server/getData.js +0 -13
- package/eskimi/server/getDevice.d.ts +0 -4
- package/eskimi/server/getDevice.js +0 -11
- package/eskimi/server/getGender.d.ts +0 -4
- package/eskimi/server/getGender.js +0 -11
- package/eskimi/server/index.d.ts +0 -4
- package/eskimi/server/index.js +0 -4
- package/file/getFileKey.d.ts +0 -4
- package/file/getFileKey.js +0 -23
- package/file/index.d.ts +0 -1
- package/file/index.js +0 -1
- package/file/server/createDirectory.d.ts +0 -5
- package/file/server/createDirectory.js +0 -13
- package/file/server/index.d.ts +0 -1
- package/file/server/index.js +0 -1
- package/geo/countries.d.ts +0 -12
- package/geo/countries.js +0 -219
- package/geo/index.d.ts +0 -2
- package/geo/index.js +0 -2
- package/geo/languages.d.ts +0 -9
- package/geo/languages.js +0 -55
- package/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.d.ts +0 -41
- package/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.js +0 -55
- package/googleAds/keywordPlanner/server/index.d.ts +0 -1
- package/googleAds/keywordPlanner/server/index.js +0 -1
- package/googleAds/server/GoogleAdsNamespace.d.ts +0 -11
- package/googleAds/server/GoogleAdsNamespace.js +0 -30
- package/googleAds/server/googleAds.d.ts +0 -11
- package/googleAds/server/googleAds.js +0 -26
- package/googleAds/server/index.d.ts +0 -2
- package/googleAds/server/index.js +0 -2
- package/googleCloud/bigquery/server/GoogleCloudBigqueryNamespace.d.ts +0 -50
- package/googleCloud/bigquery/server/GoogleCloudBigqueryNamespace.js +0 -115
- package/googleCloud/bigquery/server/googleCloudBigquery.d.ts +0 -5
- package/googleCloud/bigquery/server/googleCloudBigquery.js +0 -41
- package/googleCloud/bigquery/server/index.d.ts +0 -3
- package/googleCloud/bigquery/server/index.js +0 -3
- package/googleCloud/bigquery/server/loadData.d.ts +0 -19
- package/googleCloud/bigquery/server/loadData.js +0 -14
- package/googleCloud/server/googleCloud.d.ts +0 -29
- package/googleCloud/server/googleCloud.js +0 -25
- package/googleCloud/server/index.d.ts +0 -1
- package/googleCloud/server/index.js +0 -1
- package/googleCloud/sheets/server/GoogleCloudSheetsNamespace.d.ts +0 -18
- package/googleCloud/sheets/server/GoogleCloudSheetsNamespace.js +0 -37
- package/googleCloud/sheets/server/getAssociatedData.d.ts +0 -10
- package/googleCloud/sheets/server/getAssociatedData.js +0 -39
- package/googleCloud/sheets/server/index.d.ts +0 -1
- package/googleCloud/sheets/server/index.js +0 -1
- package/googleCloud/storage/server/GoogleCloudStorageNamespace.d.ts +0 -22
- package/googleCloud/storage/server/GoogleCloudStorageNamespace.js +0 -66
- package/googleCloud/storage/server/googleCloudStorage.d.ts +0 -3
- package/googleCloud/storage/server/googleCloudStorage.js +0 -37
- package/googleCloud/storage/server/index.d.ts +0 -2
- package/googleCloud/storage/server/index.js +0 -2
- package/googlePageSpeed/server/GooglePageSpeedNamespace.d.ts +0 -11
- package/googlePageSpeed/server/GooglePageSpeedNamespace.js +0 -27
- package/googlePageSpeed/server/googlePageSpeed.d.ts +0 -19
- package/googlePageSpeed/server/googlePageSpeed.js +0 -38
- package/googlePageSpeed/server/index.d.ts +0 -2
- package/googlePageSpeed/server/index.js +0 -2
- package/googleSearchIncidents/server/googleSearchIncidents.d.ts +0 -69
- package/googleSearchIncidents/server/googleSearchIncidents.js +0 -42
- package/googleSearchIncidents/server/index.d.ts +0 -1
- package/googleSearchIncidents/server/index.js +0 -1
- package/greenDomain/server/greenDomain.d.ts +0 -21
- package/greenDomain/server/greenDomain.js +0 -37
- package/greenDomain/server/index.d.ts +0 -1
- package/greenDomain/server/index.js +0 -1
- package/inngest/index.d.ts +0 -1
- package/inngest/index.js +0 -1
- package/inngest/inngest.d.ts +0 -7
- package/inngest/inngest.js +0 -6
- package/json/getJsonNewline.d.ts +0 -1
- package/json/getJsonNewline.js +0 -9
- package/json/index.d.ts +0 -2
- package/json/index.js +0 -2
- package/json/isJson.d.ts +0 -1
- package/json/isJson.js +0 -22
- package/littleWarden/server/LittleWardenNamespace.d.ts +0 -11
- package/littleWarden/server/LittleWardenNamespace.js +0 -30
- package/littleWarden/server/getUrlStatus.d.ts +0 -4
- package/littleWarden/server/getUrlStatus.js +0 -12
- package/littleWarden/server/index.d.ts +0 -2
- package/littleWarden/server/index.js +0 -2
- package/littleWarden/server/littleWarden.d.ts +0 -30
- package/littleWarden/server/littleWarden.js +0 -65
- package/lumar/api/server/buildRequest.d.ts +0 -13
- package/lumar/api/server/buildRequest.js +0 -76
- package/lumar/api/server/getData.d.ts +0 -1
- package/lumar/api/server/getData.js +0 -9
- package/lumar/api/server/index.d.ts +0 -4
- package/lumar/api/server/index.js +0 -4
- package/lumar/api/server/initClient.d.ts +0 -6
- package/lumar/api/server/initClient.js +0 -22
- package/lumar/api/server/lumarApi.d.ts +0 -36
- package/lumar/api/server/lumarApi.js +0 -24
- package/lumar/graphql/server/columns.d.ts +0 -29
- package/lumar/graphql/server/columns.js +0 -28
- package/lumar/graphql/server/getData.d.ts +0 -1
- package/lumar/graphql/server/getData.js +0 -15
- package/lumar/graphql/server/index.d.ts +0 -11
- package/lumar/graphql/server/index.js +0 -11
- package/lumar/graphql/server/initClient.d.ts +0 -5
- package/lumar/graphql/server/initClient.js +0 -21
- package/lumar/graphql/server/lumarGraphql.d.ts +0 -27
- package/lumar/graphql/server/lumarGraphql.js +0 -27
- package/lumar/graphql/server/queries/crawl.d.ts +0 -5
- package/lumar/graphql/server/queries/crawl.js +0 -1
- package/lumar/graphql/server/queries/getCrawls.d.ts +0 -18
- package/lumar/graphql/server/queries/getCrawls.js +0 -31
- package/lumar/graphql/server/queries/getReportDifferences.d.ts +0 -24
- package/lumar/graphql/server/queries/getReportDifferences.js +0 -35
- package/lumar/graphql/server/queries/getRows.d.ts +0 -38
- package/lumar/graphql/server/queries/getRows.js +0 -55
- package/lumar/graphql/server/queries/getTotals.d.ts +0 -25
- package/lumar/graphql/server/queries/getTotals.js +0 -38
- package/lumar/graphql/server/queries/row.d.ts +0 -157
- package/lumar/graphql/server/queries/row.js +0 -1
- package/lumar/graphql/server/reportTemplates.d.ts +0 -68
- package/lumar/graphql/server/reportTemplates.js +0 -67
- package/myTarget/server/index.d.ts +0 -1
- package/myTarget/server/index.js +0 -1
- package/myTarget/server/myTarget.d.ts +0 -5
- package/myTarget/server/myTarget.js +0 -13
- package/nextAuth/index.d.ts +0 -2
- package/nextAuth/index.js +0 -2
- package/nextAuth/isSessionReady.d.ts +0 -1
- package/nextAuth/isSessionReady.js +0 -3
- package/nextAuth/nextAuth.d.ts +0 -7
- package/nextAuth/nextAuth.js +0 -6
- package/nextJs/client/LazyLoad.d.ts +0 -8
- package/nextJs/client/LazyLoad.js +0 -7
- package/nextJs/client/index.d.ts +0 -1
- package/nextJs/client/index.js +0 -1
- package/nextJs/index.d.ts +0 -1
- package/nextJs/index.js +0 -1
- package/nextJs/nextJs.d.ts +0 -12
- package/nextJs/nextJs.js +0 -8
- package/number/format.d.ts +0 -12
- package/number/format.js +0 -16
- package/number/formatCurrency.d.ts +0 -5
- package/number/formatCurrency.js +0 -17
- package/number/getDecimal.d.ts +0 -4
- package/number/getDecimal.js +0 -8
- package/number/getNumber.d.ts +0 -4
- package/number/getNumber.js +0 -44
- package/number/getPercent.d.ts +0 -1
- package/number/getPercent.js +0 -11
- package/number/getPercentIncrease.d.ts +0 -4
- package/number/getPercentIncrease.js +0 -12
- package/number/getSafeDivide.d.ts +0 -11
- package/number/getSafeDivide.js +0 -16
- package/number/index.d.ts +0 -7
- package/number/index.js +0 -7
- package/object/index.d.ts +0 -1
- package/object/index.js +0 -1
- package/object/replaceKeys.js +0 -21
- package/onePassword/server/OnePasswordNamespace.d.ts +0 -12
- package/onePassword/server/OnePasswordNamespace.js +0 -39
- package/onePassword/server/index.d.ts +0 -2
- package/onePassword/server/index.js +0 -2
- package/onePassword/server/onePassword.d.ts +0 -8
- package/onePassword/server/onePassword.js +0 -21
- package/openAi/server/OpenAiNamespace.d.ts +0 -11
- package/openAi/server/OpenAiNamespace.js +0 -35
- package/openAi/server/index.d.ts +0 -2
- package/openAi/server/index.js +0 -2
- package/openAi/server/openAi.d.ts +0 -6
- package/openAi/server/openAi.js +0 -26
- package/prisma/getDecimal.d.ts +0 -4
- package/prisma/getDecimal.js +0 -16
- package/prisma/index.d.ts +0 -1
- package/prisma/index.js +0 -1
- package/prisma/server/PrismaNamespace.d.ts +0 -7
- package/prisma/server/PrismaNamespace.js +0 -62
- package/prisma/server/index.d.ts +0 -2
- package/prisma/server/index.js +0 -2
- package/prisma/server/prisma.d.ts +0 -20
- package/prisma/server/prisma.js +0 -26
- package/snapchat/server/SnapchatNamespace.d.ts +0 -15
- package/snapchat/server/SnapchatNamespace.js +0 -22
- package/snapchat/server/index.d.ts +0 -2
- package/snapchat/server/index.js +0 -2
- package/snapchat/server/snapchat.d.ts +0 -7
- package/snapchat/server/snapchat.js +0 -26
- package/sorting/byNumberAscending.d.ts +0 -4
- package/sorting/byNumberAscending.js +0 -15
- package/sorting/byNumberDescending.d.ts +0 -4
- package/sorting/byNumberDescending.js +0 -18
- package/sorting/byStringAscending.d.ts +0 -4
- package/sorting/byStringAscending.js +0 -12
- package/sorting/byStringDescending.d.ts +0 -4
- package/sorting/byStringDescending.js +0 -12
- package/sorting/index.d.ts +0 -1
- package/sorting/index.js +0 -1
- package/sorting/sorting.d.ts +0 -4
- package/sorting/sorting.js +0 -4
- package/stream/server/index.d.ts +0 -1
- package/stream/server/index.js +0 -1
- package/stream/server/sort.d.ts +0 -13
- package/stream/server/sort.js +0 -47
- package/string/getCapitalised.d.ts +0 -5
- package/string/getCapitalised.js +0 -21
- package/string/getClean.d.ts +0 -18
- package/string/getClean.js +0 -47
- package/string/getFolder.d.ts +0 -4
- package/string/getFolder.js +0 -8
- package/string/getProperCase.d.ts +0 -11
- package/string/getProperCase.js +0 -43
- package/string/getString.d.ts +0 -4
- package/string/getString.js +0 -27
- package/string/getStringFromStream.d.ts +0 -5
- package/string/getStringFromStream.js +0 -13
- package/string/getUnescaped.d.ts +0 -6
- package/string/getUnescaped.js +0 -19
- package/string/getWithoutAccents.d.ts +0 -5
- package/string/getWithoutAccents.js +0 -9
- package/string/getWithoutHtmlTags.d.ts +0 -5
- package/string/getWithoutHtmlTags.js +0 -8
- package/string/getWithoutPunctuation.d.ts +0 -5
- package/string/getWithoutPunctuation.js +0 -9
- package/string/getWithoutUnderscores.d.ts +0 -4
- package/string/getWithoutUnderscores.js +0 -7
- package/string/getWithoutWhitespaces.d.ts +0 -5
- package/string/getWithoutWhitespaces.js +0 -9
- package/string/index.d.ts +0 -13
- package/string/index.js +0 -13
- package/string/reservedWords.d.ts +0 -5
- package/string/reservedWords.js +0 -22
- package/swr/client/index.d.ts +0 -1
- package/swr/client/index.js +0 -1
- package/swr/client/swr.d.ts +0 -42
- package/swr/client/swr.js +0 -50
- package/upTimeRobot/server/UpTimeRobotNamespace.d.ts +0 -31
- package/upTimeRobot/server/UpTimeRobotNamespace.js +0 -40
- package/upTimeRobot/server/index.d.ts +0 -2
- package/upTimeRobot/server/index.js +0 -2
- package/upTimeRobot/server/upTimeRobot.d.ts +0 -38
- package/upTimeRobot/server/upTimeRobot.js +0 -59
- package/url/index.d.ts +0 -1
- package/url/index.js +0 -1
- package/url/server/index.d.ts +0 -1
- package/url/server/index.js +0 -1
- package/url/server/writeUrlContents.d.ts +0 -6
- package/url/server/writeUrlContents.js +0 -35
- package/url/url.d.ts +0 -26
- package/url/url.js +0 -59
- package/util/defaultTo.d.ts +0 -4
- package/util/defaultTo.js +0 -37
- package/util/getClean.d.ts +0 -11
- package/util/getClean.js +0 -19
- package/util/getError.d.ts +0 -1
- package/util/getError.js +0 -10
- package/util/getWithoutHash.d.ts +0 -4
- package/util/getWithoutHash.js +0 -14
- package/util/getWithoutParameter.d.ts +0 -4
- package/util/getWithoutParameter.js +0 -14
- package/util/index.d.ts +0 -7
- package/util/index.js +0 -7
- package/util/isUndefined.d.ts +0 -4
- package/util/isUndefined.js +0 -9
- package/util/promiseChunks.d.ts +0 -5
- package/util/promiseChunks.js +0 -21
- package/util/server/getBrotliCompressed.d.ts +0 -5
- package/util/server/getBrotliCompressed.js +0 -16
- package/util/server/getBrotliDecompressed.d.ts +0 -5
- package/util/server/getBrotliDecompressed.js +0 -17
- package/util/server/getGzipCompressed.d.ts +0 -5
- package/util/server/getGzipCompressed.js +0 -16
- package/util/server/getGzipDecompressed.d.ts +0 -5
- package/util/server/getGzipDecompressed.js +0 -17
- package/util/server/index.d.ts +0 -4
- package/util/server/index.js +0 -4
- package/util/sleep.d.ts +0 -1
- package/util/sleep.js +0 -3
- package/webWorker/index.d.ts +0 -1
- package/webWorker/index.js +0 -1
- package/webWorker/webWorker.d.ts +0 -8
- package/webWorker/webWorker.js +0 -7
- package/xml/server/getXml.d.ts +0 -1
- package/xml/server/getXml.js +0 -14
- package/xml/server/index.d.ts +0 -1
- package/xml/server/index.js +0 -1
package/cache/server/cache.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const cache = new Map();
|
|
2
|
-
export const getCache = (key) => {
|
|
3
|
-
let response = null;
|
|
4
|
-
if (cache.has(key)) {
|
|
5
|
-
const cacheItem = cache.get(key);
|
|
6
|
-
// Timed expiry
|
|
7
|
-
if (cacheItem.expires > 0) {
|
|
8
|
-
// https://ui.dev/get-current-timestamp-javascript
|
|
9
|
-
const expiresAt = Math.floor(cacheItem.insertedAt / 1000) + cacheItem.expires;
|
|
10
|
-
const now = Math.floor(Date.now() / 1000);
|
|
11
|
-
// If we are now beyond the expiry date, update the data
|
|
12
|
-
if (now < expiresAt) {
|
|
13
|
-
response = cacheItem;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
// 0 - Never expires
|
|
17
|
-
else {
|
|
18
|
-
response = cacheItem;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return response;
|
|
22
|
-
};
|
|
23
|
-
export const setCache = (key, data, expires = 0, force = false) => {
|
|
24
|
-
const now = Math.floor(Date.now() / 1000);
|
|
25
|
-
if (cache.has(key) && !force) {
|
|
26
|
-
const cacheItem = cache.get(key);
|
|
27
|
-
// 0 - Never expires
|
|
28
|
-
if (cacheItem.expires > 0) {
|
|
29
|
-
// https://ui.dev/get-current-timestamp-javascript
|
|
30
|
-
const expiresAt = Math.floor(cacheItem.insertedAt / 1000) + cacheItem.expires;
|
|
31
|
-
// If we are now beyond the expiry date, update the data
|
|
32
|
-
if (now < expiresAt) {
|
|
33
|
-
return cacheItem;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
cache.set(key, {
|
|
38
|
-
data,
|
|
39
|
-
expires,
|
|
40
|
-
insertedAt: now,
|
|
41
|
-
});
|
|
42
|
-
return data;
|
|
43
|
-
};
|
package/cache/server/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./cache";
|
package/cache/server/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./cache";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/crud/crud.d.ts
DELETED
package/crud/crud.js
DELETED
package/crud/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./crud";
|
package/crud/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./crud";
|
package/crypto/getDecrypt.d.ts
DELETED
package/crypto/getDecrypt.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Decrypt an encoding string using a salt
|
|
3
|
-
* Library: crypto-js
|
|
4
|
-
*/
|
|
5
|
-
export const getDecrypt = async (appSalt, input, salt) => {
|
|
6
|
-
const { AES, enc } = await import("crypto-js");
|
|
7
|
-
const customSalt = `${appSalt}-${salt}`;
|
|
8
|
-
return AES.decrypt(input, customSalt)
|
|
9
|
-
.toString(enc.Utf8);
|
|
10
|
-
};
|
package/crypto/getEncrypt.d.ts
DELETED
package/crypto/getEncrypt.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Encrypt an encoding string using a salt
|
|
3
|
-
* Library: crypto-js
|
|
4
|
-
*/
|
|
5
|
-
export const getEncrypt = async (appSalt, input, salt) => {
|
|
6
|
-
const { AES } = await import("crypto-js");
|
|
7
|
-
const customSalt = `${appSalt}-${salt}`;
|
|
8
|
-
return AES.encrypt(input, customSalt)
|
|
9
|
-
.toString();
|
|
10
|
-
};
|
package/crypto/getRandom.d.ts
DELETED
package/crypto/getRandom.js
DELETED
package/crypto/getSha256.d.ts
DELETED
package/crypto/getSha256.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { getString } from "../string";
|
|
2
|
-
/**
|
|
3
|
-
* Encrypt a string using sha256
|
|
4
|
-
* Library: crypto-js
|
|
5
|
-
*/
|
|
6
|
-
export const getSha256 = async (input) => {
|
|
7
|
-
const { SHA256 } = await import("crypto-js");
|
|
8
|
-
const inputString = getString(input);
|
|
9
|
-
return SHA256(inputString)
|
|
10
|
-
.toString();
|
|
11
|
-
};
|
package/crypto/index.d.ts
DELETED
package/crypto/index.js
DELETED
package/date/calculation.d.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { DateTime } from "luxon";
|
|
2
|
-
import { InputDate, Timeframe } from "./date";
|
|
3
|
-
/**
|
|
4
|
-
* Return unix timestamp in seconds.
|
|
5
|
-
*/
|
|
6
|
-
export declare const getUnix: (input?: InputDate) => number;
|
|
7
|
-
/**
|
|
8
|
-
* Assume the input is always UTC.
|
|
9
|
-
*
|
|
10
|
-
* If it's not UTC, it needs to be converted to UTC before being used.
|
|
11
|
-
*/
|
|
12
|
-
export declare const getLuxonDate: (input?: InputDate, setMidnight?: boolean) => DateTime<boolean>;
|
|
13
|
-
export declare const isMonday: (input?: InputDate) => boolean;
|
|
14
|
-
export declare const isTuesday: (input?: InputDate) => boolean;
|
|
15
|
-
export declare const isWednesday: (input?: InputDate) => boolean;
|
|
16
|
-
export declare const isThursday: (input?: InputDate) => boolean;
|
|
17
|
-
export declare const isFriday: (input?: InputDate) => boolean;
|
|
18
|
-
export declare const isSaturday: (input?: InputDate) => boolean;
|
|
19
|
-
export declare const isSunday: (input?: InputDate) => boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Determines if a given date falls on a weekend.
|
|
22
|
-
*
|
|
23
|
-
* This function checks whether the day of the week for the provided input corresponds
|
|
24
|
-
* to Saturday or Sunday, where weekday values of 6 and 7 represent Saturday and Sunday, respectively.
|
|
25
|
-
*/
|
|
26
|
-
export declare const isWeekend: (input?: InputDate) => boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Calculates the difference in minutes between two provided dates.
|
|
29
|
-
*/
|
|
30
|
-
export declare const differenceInMinutes: (start: InputDate, end: InputDate) => number;
|
|
31
|
-
/**
|
|
32
|
-
* Calculates the difference in business days between two dates.
|
|
33
|
-
* Business days are considered as weekdays (Monday to Friday).
|
|
34
|
-
*/
|
|
35
|
-
export declare const differenceInBusinessDays: (start: InputDate, end: InputDate) => number;
|
|
36
|
-
/**
|
|
37
|
-
* Similar to date-fns' eachDayOfInterval, however the timezone messes this function up.
|
|
38
|
-
* https://date-fns.org/v2.28.0/docs/eachDayOfInterval
|
|
39
|
-
* https://www.gov.uk/when-do-the-clocks-change
|
|
40
|
-
*/
|
|
41
|
-
export declare const getDatesBetween: (start: InputDate, end: InputDate) => DateTime<true>[];
|
|
42
|
-
/**
|
|
43
|
-
* Get an array of DateTime objects representing the 1st of each month between start and end dates.
|
|
44
|
-
*/
|
|
45
|
-
export declare const getMonthsBetween: (start: InputDate, end: InputDate) => DateTime<boolean>[];
|
|
46
|
-
/**
|
|
47
|
-
* If a given date is beyond the maximum, return the maximum.
|
|
48
|
-
*/
|
|
49
|
-
export declare const getMax: (input: DateTime, max: DateTime) => DateTime<boolean>;
|
|
50
|
-
/**
|
|
51
|
-
* If a given date is before the minimum, return the minimum.
|
|
52
|
-
*/
|
|
53
|
-
export declare const getMin: (input: DateTime, min: DateTime) => DateTime<boolean>;
|
|
54
|
-
/**
|
|
55
|
-
* Retrieve the closest last Monday relative to the input or today.
|
|
56
|
-
* 0 weeksAgo - Tuesday (10th), return Monday (8th)
|
|
57
|
-
* 1 weeksAgo - Tuesday (10th), return Monday (1st)
|
|
58
|
-
*/
|
|
59
|
-
export declare const getMonday: (input?: InputDate, weeksAgo?: number) => DateTime<boolean>;
|
|
60
|
-
/**
|
|
61
|
-
* Retrieve the closest last Sunday relative to the input or today.
|
|
62
|
-
* 0 weeksAgo - Tuesday (17th), return Sunday (14th)
|
|
63
|
-
* 1 weeksAgo - Tuesday (17th), return Monday (7th)
|
|
64
|
-
*/
|
|
65
|
-
export declare const getSunday: (input?: InputDate, weeksAgo?: number) => DateTime<boolean>;
|
|
66
|
-
/**
|
|
67
|
-
* Return an object of start/end predefined date of Last Week.
|
|
68
|
-
* Creating a date from scratch (no user input), thus needs to be London time.
|
|
69
|
-
*/
|
|
70
|
-
export declare const getLastWeek: () => Timeframe;
|
|
71
|
-
/**
|
|
72
|
-
* Return an object of start/end predefined date of This Week.
|
|
73
|
-
* Creating a date from scratch (no user input), thus needs to be London time.
|
|
74
|
-
*/
|
|
75
|
-
export declare const getThisWeek: () => Timeframe;
|
|
76
|
-
/**
|
|
77
|
-
* Return an object of start/end predefined date of Two Weeks Ago.
|
|
78
|
-
* Creating a date from scratch (no user input), thus needs to be London time.
|
|
79
|
-
*/
|
|
80
|
-
export declare const getTwoWeeksAgo: () => Timeframe;
|
|
81
|
-
/**
|
|
82
|
-
* Shortcut to get today's date.
|
|
83
|
-
* Creating a date from scratch (no user input), thus needs to be London time.
|
|
84
|
-
*/
|
|
85
|
-
export declare const getToday: (setMidnight?: boolean) => DateTime<boolean>;
|
|
86
|
-
/**
|
|
87
|
-
* From a given input, move the date back X weeksAgo
|
|
88
|
-
*/
|
|
89
|
-
export declare const getWeeksAgo: (input?: InputDate, weeksAgo?: number) => DateTime<boolean>;
|
|
90
|
-
/**
|
|
91
|
-
* Shortcut to get yesterday's date.
|
|
92
|
-
* Creating a date from scratch (no user input), thus needs to be London time.
|
|
93
|
-
*/
|
|
94
|
-
export declare const getYesterday: (input?: InputDate) => DateTime<boolean>;
|
|
95
|
-
/**
|
|
96
|
-
* Check to see if a given timeframe is This Week.
|
|
97
|
-
*/
|
|
98
|
-
export declare const isThisWeek: (start: InputDate, end: InputDate) => boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Check to see if a given timeframe is Last Week.
|
|
101
|
-
*/
|
|
102
|
-
export declare const isLastWeek: (start: InputDate, end: InputDate) => boolean;
|
package/date/calculation.js
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { DateTime, Interval } from "luxon";
|
|
2
|
-
/**
|
|
3
|
-
* Return unix timestamp in seconds.
|
|
4
|
-
*/
|
|
5
|
-
export const getUnix = (input) => {
|
|
6
|
-
return getLuxonDate(input)
|
|
7
|
-
.toUnixInteger();
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Assume the input is always UTC.
|
|
11
|
-
*
|
|
12
|
-
* If it's not UTC, it needs to be converted to UTC before being used.
|
|
13
|
-
*/
|
|
14
|
-
export const getLuxonDate = (input, setMidnight) => {
|
|
15
|
-
let instance = DateTime.now()
|
|
16
|
-
.toUTC();
|
|
17
|
-
if (input) {
|
|
18
|
-
if (input instanceof Date) {
|
|
19
|
-
instance = DateTime.fromJSDate(input, { zone: "utc" });
|
|
20
|
-
}
|
|
21
|
-
else if (input instanceof DateTime) {
|
|
22
|
-
instance = input.toUTC();
|
|
23
|
-
}
|
|
24
|
-
else if ("number" === typeof input) {
|
|
25
|
-
// Handle different numeric formats
|
|
26
|
-
if (input >= 19000101 && input <= 99991231) {
|
|
27
|
-
// YYYYMMDD format (e.g., 20231225)
|
|
28
|
-
const dateStr = input.toString();
|
|
29
|
-
const year = parseInt(dateStr.substring(0, 4));
|
|
30
|
-
const month = parseInt(dateStr.substring(4, 6));
|
|
31
|
-
const day = parseInt(dateStr.substring(6, 8));
|
|
32
|
-
instance = DateTime.fromObject({ year, month, day }, { zone: "utc" });
|
|
33
|
-
}
|
|
34
|
-
else if (input < 10000000000) {
|
|
35
|
-
// Unix timestamp in seconds
|
|
36
|
-
instance = DateTime.fromSeconds(input, { zone: "utc" });
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
// Unix timestamp in milliseconds
|
|
40
|
-
instance = DateTime.fromMillis(input, { zone: "utc" });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
instance = DateTime.fromISO(input.toString(), { zone: "utc" });
|
|
45
|
-
if (!instance.isValid) {
|
|
46
|
-
instance = DateTime.fromFormat(input.toString(), "yyyy-MM-dd HH:mm:ss", { zone: "utc" });
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// Ensure the instance is in UTC timezone
|
|
51
|
-
instance = instance.setZone("utc", { keepLocalTime: false });
|
|
52
|
-
if (setMidnight) {
|
|
53
|
-
instance = instance.set({
|
|
54
|
-
hour: 0,
|
|
55
|
-
minute: 0,
|
|
56
|
-
second: 0,
|
|
57
|
-
millisecond: 0,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return instance;
|
|
61
|
-
};
|
|
62
|
-
export const isMonday = (input) => {
|
|
63
|
-
return getLuxonDate(input).weekday === 1;
|
|
64
|
-
};
|
|
65
|
-
export const isTuesday = (input) => {
|
|
66
|
-
return getLuxonDate(input).weekday === 2;
|
|
67
|
-
};
|
|
68
|
-
export const isWednesday = (input) => {
|
|
69
|
-
return getLuxonDate(input).weekday === 3;
|
|
70
|
-
};
|
|
71
|
-
export const isThursday = (input) => {
|
|
72
|
-
return getLuxonDate(input).weekday === 4;
|
|
73
|
-
};
|
|
74
|
-
export const isFriday = (input) => {
|
|
75
|
-
return getLuxonDate(input).weekday === 6;
|
|
76
|
-
};
|
|
77
|
-
export const isSaturday = (input) => {
|
|
78
|
-
return getLuxonDate(input).weekday === 6;
|
|
79
|
-
};
|
|
80
|
-
export const isSunday = (input) => {
|
|
81
|
-
return getLuxonDate(input).weekday === 7;
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Determines if a given date falls on a weekend.
|
|
85
|
-
*
|
|
86
|
-
* This function checks whether the day of the week for the provided input corresponds
|
|
87
|
-
* to Saturday or Sunday, where weekday values of 6 and 7 represent Saturday and Sunday, respectively.
|
|
88
|
-
*/
|
|
89
|
-
export const isWeekend = (input) => {
|
|
90
|
-
const luxonDate = getLuxonDate(input);
|
|
91
|
-
return 6 === luxonDate.weekday || 7 === luxonDate.weekday;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Calculates the difference in minutes between two provided dates.
|
|
95
|
-
*/
|
|
96
|
-
export const differenceInMinutes = (start, end) => {
|
|
97
|
-
const startDate = getLuxonDate(start);
|
|
98
|
-
const endDate = getLuxonDate(end);
|
|
99
|
-
return endDate.diff(startDate, "minutes").minutes;
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* Calculates the difference in business days between two dates.
|
|
103
|
-
* Business days are considered as weekdays (Monday to Friday).
|
|
104
|
-
*/
|
|
105
|
-
export const differenceInBusinessDays = (start, end) => {
|
|
106
|
-
const startDate = getLuxonDate(start);
|
|
107
|
-
const endDate = getLuxonDate(end);
|
|
108
|
-
let businessDays = 0;
|
|
109
|
-
let current = startDate.startOf("day");
|
|
110
|
-
while (current < endDate.startOf("day")) {
|
|
111
|
-
// weekday 1-5 are Monday-Friday (business days)
|
|
112
|
-
if (current.weekday <= 5) {
|
|
113
|
-
businessDays++;
|
|
114
|
-
}
|
|
115
|
-
current = current.plus({ days: 1 });
|
|
116
|
-
}
|
|
117
|
-
return businessDays;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Similar to date-fns' eachDayOfInterval, however the timezone messes this function up.
|
|
121
|
-
* https://date-fns.org/v2.28.0/docs/eachDayOfInterval
|
|
122
|
-
* https://www.gov.uk/when-do-the-clocks-change
|
|
123
|
-
*/
|
|
124
|
-
export const getDatesBetween = (start, end) => {
|
|
125
|
-
const startInstance = getLuxonDate(start);
|
|
126
|
-
const endInstance = getLuxonDate(end);
|
|
127
|
-
const response = Interval.fromDateTimes(startInstance.startOf("day"), endInstance.endOf("day"))
|
|
128
|
-
.splitBy({
|
|
129
|
-
day: 1
|
|
130
|
-
})
|
|
131
|
-
.map(d => d.start);
|
|
132
|
-
return response;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Get an array of DateTime objects representing the 1st of each month between start and end dates.
|
|
136
|
-
*/
|
|
137
|
-
export const getMonthsBetween = (start, end) => {
|
|
138
|
-
const months = [];
|
|
139
|
-
const endDate = getLuxonDate(end)
|
|
140
|
-
.startOf("month");
|
|
141
|
-
// Start from the 1st of the month containing startDate
|
|
142
|
-
let current = getLuxonDate(start)
|
|
143
|
-
.startOf("month");
|
|
144
|
-
while (current <= endDate) {
|
|
145
|
-
months.push(current);
|
|
146
|
-
// Move to next month
|
|
147
|
-
current = current.plus({ months: 1 });
|
|
148
|
-
}
|
|
149
|
-
return months;
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* If a given date is beyond the maximum, return the maximum.
|
|
153
|
-
*/
|
|
154
|
-
export const getMax = (input, max) => {
|
|
155
|
-
return input > max ? max : input;
|
|
156
|
-
};
|
|
157
|
-
/**
|
|
158
|
-
* If a given date is before the minimum, return the minimum.
|
|
159
|
-
*/
|
|
160
|
-
export const getMin = (input, min) => {
|
|
161
|
-
return input < min ? min : input;
|
|
162
|
-
};
|
|
163
|
-
/**
|
|
164
|
-
* Retrieve the closest last Monday relative to the input or today.
|
|
165
|
-
* 0 weeksAgo - Tuesday (10th), return Monday (8th)
|
|
166
|
-
* 1 weeksAgo - Tuesday (10th), return Monday (1st)
|
|
167
|
-
*/
|
|
168
|
-
export const getMonday = (input, weeksAgo) => {
|
|
169
|
-
let instance = getLuxonDate(input);
|
|
170
|
-
if ("Mon" !== instance.toFormat("EEE")) {
|
|
171
|
-
// Get the ISO Day of week (Monday - 1 to Sunday - 7)
|
|
172
|
-
const isoDay = Number(instance.toFormat("E")) - 1;
|
|
173
|
-
instance = instance.minus({ days: isoDay });
|
|
174
|
-
}
|
|
175
|
-
// Move it back weeks
|
|
176
|
-
instance = instance.minus({ weeks: weeksAgo ?? 0 });
|
|
177
|
-
return instance;
|
|
178
|
-
};
|
|
179
|
-
/**
|
|
180
|
-
* Retrieve the closest last Sunday relative to the input or today.
|
|
181
|
-
* 0 weeksAgo - Tuesday (17th), return Sunday (14th)
|
|
182
|
-
* 1 weeksAgo - Tuesday (17th), return Monday (7th)
|
|
183
|
-
*/
|
|
184
|
-
export const getSunday = (input, weeksAgo) => {
|
|
185
|
-
let instance = getLuxonDate(input);
|
|
186
|
-
if ("Sun" !== instance.toFormat("EEE")) {
|
|
187
|
-
// Get the ISO Day of week (Monday - 1 to Sunday - 7)
|
|
188
|
-
const isoDay = Number(instance.toFormat("E"));
|
|
189
|
-
instance = instance.minus({ days: isoDay });
|
|
190
|
-
}
|
|
191
|
-
// Move it back weeks
|
|
192
|
-
instance = instance.minus({ weeks: weeksAgo ?? 0 });
|
|
193
|
-
return instance;
|
|
194
|
-
};
|
|
195
|
-
/**
|
|
196
|
-
* Return an object of start/end predefined date of Last Week.
|
|
197
|
-
* Creating a date from scratch (no user input), thus needs to be London time.
|
|
198
|
-
*/
|
|
199
|
-
export const getLastWeek = () => {
|
|
200
|
-
return {
|
|
201
|
-
end: getMonday(undefined, 0),
|
|
202
|
-
start: getSunday(undefined, 1),
|
|
203
|
-
};
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* Return an object of start/end predefined date of This Week.
|
|
207
|
-
* Creating a date from scratch (no user input), thus needs to be London time.
|
|
208
|
-
*/
|
|
209
|
-
export const getThisWeek = () => {
|
|
210
|
-
return {
|
|
211
|
-
end: getMonday(undefined, 0),
|
|
212
|
-
start: getSunday(undefined, -1),
|
|
213
|
-
};
|
|
214
|
-
};
|
|
215
|
-
/**
|
|
216
|
-
* Return an object of start/end predefined date of Two Weeks Ago.
|
|
217
|
-
* Creating a date from scratch (no user input), thus needs to be London time.
|
|
218
|
-
*/
|
|
219
|
-
export const getTwoWeeksAgo = () => {
|
|
220
|
-
return {
|
|
221
|
-
end: getMonday(undefined, 1),
|
|
222
|
-
start: getSunday(undefined, 2),
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
/**
|
|
226
|
-
* Shortcut to get today's date.
|
|
227
|
-
* Creating a date from scratch (no user input), thus needs to be London time.
|
|
228
|
-
*/
|
|
229
|
-
export const getToday = (setMidnight) => {
|
|
230
|
-
return getLuxonDate(undefined, setMidnight);
|
|
231
|
-
};
|
|
232
|
-
/**
|
|
233
|
-
* From a given input, move the date back X weeksAgo
|
|
234
|
-
*/
|
|
235
|
-
export const getWeeksAgo = (input, weeksAgo) => {
|
|
236
|
-
let instance = getLuxonDate(input);
|
|
237
|
-
instance = instance.plus({ weeks: weeksAgo });
|
|
238
|
-
return instance;
|
|
239
|
-
};
|
|
240
|
-
/**
|
|
241
|
-
* Shortcut to get yesterday's date.
|
|
242
|
-
* Creating a date from scratch (no user input), thus needs to be London time.
|
|
243
|
-
*/
|
|
244
|
-
export const getYesterday = (input) => {
|
|
245
|
-
let instance = getLuxonDate(input);
|
|
246
|
-
instance = instance.minus({ days: 1 });
|
|
247
|
-
return instance;
|
|
248
|
-
};
|
|
249
|
-
/**
|
|
250
|
-
* Check to see if a given timeframe is This Week.
|
|
251
|
-
*/
|
|
252
|
-
export const isThisWeek = (start, end) => {
|
|
253
|
-
const inputWeek = {
|
|
254
|
-
start: getLuxonDate(start),
|
|
255
|
-
end: getLuxonDate(end),
|
|
256
|
-
};
|
|
257
|
-
const thisWeek = getThisWeek();
|
|
258
|
-
// Day confirms same year and month and day
|
|
259
|
-
return inputWeek.start.hasSame(thisWeek.start, "day") && inputWeek.end.hasSame(thisWeek.end, "day");
|
|
260
|
-
};
|
|
261
|
-
/**
|
|
262
|
-
* Check to see if a given timeframe is Last Week.
|
|
263
|
-
*/
|
|
264
|
-
export const isLastWeek = (start, end) => {
|
|
265
|
-
const inputWeek = {
|
|
266
|
-
start: getLuxonDate(start),
|
|
267
|
-
end: getLuxonDate(end),
|
|
268
|
-
};
|
|
269
|
-
const lastWeek = getLastWeek();
|
|
270
|
-
// Day confirms same year and month and day
|
|
271
|
-
return inputWeek.start.hasSame(lastWeek.start, "day") && inputWeek.end.hasSame(lastWeek.end, "day");
|
|
272
|
-
};
|
package/date/date.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { DateTime } from "luxon";
|
|
2
|
-
export type InputDate = Date | DateTime | string | number;
|
|
3
|
-
export type FinancialWeek = {
|
|
4
|
-
end: DateTime;
|
|
5
|
-
start: DateTime;
|
|
6
|
-
weekNumber: number;
|
|
7
|
-
year: number;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* A timeframe has a start and an end date.
|
|
11
|
-
*/
|
|
12
|
-
export type Timeframe = {
|
|
13
|
-
end: DateTime;
|
|
14
|
-
start: DateTime;
|
|
15
|
-
};
|
|
16
|
-
export declare const defaultDate: "1901-01-01";
|
|
17
|
-
export declare const defaultDateNumber: 19010101;
|
|
18
|
-
export declare const defaultDateTime: "1901-01-01 00:00:00";
|
|
19
|
-
/**
|
|
20
|
-
* Used by Google Ads API.
|
|
21
|
-
*/
|
|
22
|
-
export declare const month: {
|
|
23
|
-
readonly JANUARY: "JANUARY";
|
|
24
|
-
readonly FEBRUARY: "FEBRUARY";
|
|
25
|
-
readonly MARCH: "MARCH";
|
|
26
|
-
readonly APRIL: "APRIL";
|
|
27
|
-
readonly MAY: "MAY";
|
|
28
|
-
readonly JUNE: "JUNE";
|
|
29
|
-
readonly JULY: "JULY";
|
|
30
|
-
readonly AUGUST: "AUGUST";
|
|
31
|
-
readonly SEPTEMBER: "SEPTEMBER";
|
|
32
|
-
readonly OCTOBER: "OCTOBER";
|
|
33
|
-
readonly NOVEMBER: "NOVEMBER";
|
|
34
|
-
readonly DECEMBER: "DECEMBER";
|
|
35
|
-
};
|
|
36
|
-
export type Month = typeof month[keyof typeof month];
|
package/date/date.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const defaultDate = "1901-01-01";
|
|
2
|
-
export const defaultDateNumber = 19010101;
|
|
3
|
-
export const defaultDateTime = "1901-01-01 00:00:00";
|
|
4
|
-
/**
|
|
5
|
-
* Used by Google Ads API.
|
|
6
|
-
*/
|
|
7
|
-
export const month = {
|
|
8
|
-
JANUARY: "JANUARY",
|
|
9
|
-
FEBRUARY: "FEBRUARY",
|
|
10
|
-
MARCH: "MARCH",
|
|
11
|
-
APRIL: "APRIL",
|
|
12
|
-
MAY: "MAY",
|
|
13
|
-
JUNE: "JUNE",
|
|
14
|
-
JULY: "JULY",
|
|
15
|
-
AUGUST: "AUGUST",
|
|
16
|
-
SEPTEMBER: "SEPTEMBER",
|
|
17
|
-
OCTOBER: "OCTOBER",
|
|
18
|
-
NOVEMBER: "NOVEMBER",
|
|
19
|
-
DECEMBER: "DECEMBER",
|
|
20
|
-
};
|
package/date/financialYear.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Timeframe } from "./date";
|
|
2
|
-
import { Interval } from "luxon";
|
|
3
|
-
/**
|
|
4
|
-
* Get the financial year based on an optional year.
|
|
5
|
-
*/
|
|
6
|
-
export declare const getFinancialYear: (year?: number) => Timeframe;
|
|
7
|
-
/**
|
|
8
|
-
* Return the current financial year up to today.
|
|
9
|
-
*/
|
|
10
|
-
export declare const getFinancialYearToDate: () => Timeframe;
|
|
11
|
-
/**
|
|
12
|
-
* Return the current financial year up to yesterday.
|
|
13
|
-
* Timezone should always be London based
|
|
14
|
-
*/
|
|
15
|
-
export declare const getFinancialYearToYesterday: () => Timeframe;
|
|
16
|
-
/**
|
|
17
|
-
* Get the current financial year.
|
|
18
|
-
*/
|
|
19
|
-
export declare const getFinancialYearWeeks: (year?: number) => Interval<boolean>[];
|