@8ms/helpers 2.3.4 → 2.3.6
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/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 +70 -1066
- package/tsdown.config.ts +10 -0
- package/.github/generate-exports.js +0 -69
- 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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isJson } from "./json/index.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/number/getNumber.ts
|
|
4
|
+
/**
|
|
5
|
+
* Take an input and return a number.
|
|
6
|
+
*/
|
|
7
|
+
const getNumber = (input, defaultValue = 0) => {
|
|
8
|
+
if (input == null) return defaultValue;
|
|
9
|
+
let response = input;
|
|
10
|
+
if (typeof input === "string" && isJson(input)) try {
|
|
11
|
+
response = JSON.parse(input);
|
|
12
|
+
} catch {
|
|
13
|
+
response = input;
|
|
14
|
+
}
|
|
15
|
+
if (typeof response === "number") return isNaN(response) ? defaultValue : response;
|
|
16
|
+
if (typeof response === "string") {
|
|
17
|
+
const directConversion = Number(response.trim());
|
|
18
|
+
if (!isNaN(directConversion)) return directConversion;
|
|
19
|
+
const match = response.match(/^\D*([0-9]*\.?[0-9]+)\D*$/);
|
|
20
|
+
if (match && match[1]) {
|
|
21
|
+
const extracted = Number(match[1]);
|
|
22
|
+
if (!isNaN(extracted)) return extracted;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const converted = Number(response);
|
|
26
|
+
return isNaN(converted) ? defaultValue : converted;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/number/getDecimal.ts
|
|
31
|
+
/**
|
|
32
|
+
* Return a decimal number after rounding.
|
|
33
|
+
*/
|
|
34
|
+
const getDecimal = (input, dp = 2) => {
|
|
35
|
+
const number = getNumber(input);
|
|
36
|
+
return Number(number.toFixed(dp));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { getNumber as n, getDecimal as t };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
|
|
3
|
+
//#region src/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.d.ts
|
|
4
|
+
declare const network: {
|
|
5
|
+
readonly GOOGLE_SEARCH_ONLY: 2;
|
|
6
|
+
readonly GOOGLE_SEARCH_AND_PARTNERS: 3;
|
|
7
|
+
};
|
|
8
|
+
type Network = typeof network[keyof typeof network];
|
|
9
|
+
declare const requestSchema: z.ZodObject<{
|
|
10
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
11
|
+
customerId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
historicalMetricsOptions: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
startMonth: z.ZodString;
|
|
14
|
+
startYear: z.ZodNumber;
|
|
15
|
+
endMonth: z.ZodString;
|
|
16
|
+
endYear: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
includeAdultKeywords: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
keywordPlanNetwork: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
queries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
language: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
url: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
type RequestSchemaType = z.infer<typeof requestSchema>;
|
|
25
|
+
declare const defaultRequest: RequestSchemaType;
|
|
26
|
+
declare const responseSchema: z.ZodObject<{
|
|
27
|
+
payload: z.ZodObject<{}, z.core.$strip>;
|
|
28
|
+
keyword: z.ZodString;
|
|
29
|
+
avgCpc: z.ZodNumber;
|
|
30
|
+
avgSearchVolume: z.ZodNumber;
|
|
31
|
+
competition: z.ZodNumber;
|
|
32
|
+
competitionIndex: z.ZodNumber;
|
|
33
|
+
months: z.ZodArray<z.ZodObject<{
|
|
34
|
+
date: z.ZodString;
|
|
35
|
+
month: z.ZodNumber;
|
|
36
|
+
searchVolume: z.ZodNumber;
|
|
37
|
+
year: z.ZodNumber;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
topOfPageBidHigh: z.ZodNumber;
|
|
40
|
+
topOfPageBidLow: z.ZodNumber;
|
|
41
|
+
totalSearchVolume: z.ZodNumber;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
type ResponseSchemaType = z.infer<typeof responseSchema>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { Network, RequestSchemaType, ResponseSchemaType, defaultRequest, network, requestSchema, responseSchema };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
|
|
3
|
+
//#region src/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.ts
|
|
4
|
+
const network = {
|
|
5
|
+
GOOGLE_SEARCH_ONLY: 2,
|
|
6
|
+
GOOGLE_SEARCH_AND_PARTNERS: 3
|
|
7
|
+
};
|
|
8
|
+
const requestSchema = z.object({
|
|
9
|
+
countries: z.array(z.number()).optional(),
|
|
10
|
+
customerId: z.string().optional(),
|
|
11
|
+
historicalMetricsOptions: z.object({
|
|
12
|
+
startMonth: z.string(),
|
|
13
|
+
startYear: z.number(),
|
|
14
|
+
endMonth: z.string(),
|
|
15
|
+
endYear: z.number()
|
|
16
|
+
}).optional(),
|
|
17
|
+
includeAdultKeywords: z.boolean().optional(),
|
|
18
|
+
keywordPlanNetwork: z.number().optional(),
|
|
19
|
+
queries: z.array(z.string()).optional(),
|
|
20
|
+
language: z.number().optional(),
|
|
21
|
+
url: z.string().optional()
|
|
22
|
+
});
|
|
23
|
+
const defaultRequest = {
|
|
24
|
+
countries: [],
|
|
25
|
+
customerId: "",
|
|
26
|
+
historicalMetricsOptions: null,
|
|
27
|
+
includeAdultKeywords: false,
|
|
28
|
+
keywordPlanNetwork: network.GOOGLE_SEARCH_ONLY,
|
|
29
|
+
queries: [],
|
|
30
|
+
language: null
|
|
31
|
+
};
|
|
32
|
+
const responseSchema = z.object({
|
|
33
|
+
payload: z.object(),
|
|
34
|
+
keyword: z.string(),
|
|
35
|
+
avgCpc: z.number(),
|
|
36
|
+
avgSearchVolume: z.number(),
|
|
37
|
+
competition: z.number(),
|
|
38
|
+
competitionIndex: z.number(),
|
|
39
|
+
months: z.object({
|
|
40
|
+
date: z.string(),
|
|
41
|
+
month: z.number(),
|
|
42
|
+
searchVolume: z.number(),
|
|
43
|
+
year: z.number()
|
|
44
|
+
}).array(),
|
|
45
|
+
topOfPageBidHigh: z.number(),
|
|
46
|
+
topOfPageBidLow: z.number(),
|
|
47
|
+
totalSearchVolume: z.number()
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { defaultRequest, network, requestSchema, responseSchema };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { t as BaseNamespace } from "../../index-CFaAdPAh.mjs";
|
|
2
|
+
import * as google_ads_api0 from "google-ads-api";
|
|
3
|
+
import { GoogleAdsApi } from "google-ads-api";
|
|
4
|
+
|
|
5
|
+
//#region src/googleAds/server/GoogleAdsNamespace.d.ts
|
|
6
|
+
declare class GoogleAdsNamespace extends BaseNamespace {
|
|
7
|
+
client: GoogleAdsApi;
|
|
8
|
+
config: Config;
|
|
9
|
+
mccAccountId: string;
|
|
10
|
+
refreshToken: string;
|
|
11
|
+
ensureInit: () => Promise<void>;
|
|
12
|
+
getCustomer: (customerId: string) => Promise<google_ads_api0.Customer>;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/googleAds/server/googleAds.d.ts
|
|
16
|
+
type Config = {
|
|
17
|
+
client: {
|
|
18
|
+
clientId: string;
|
|
19
|
+
clientSecret: string;
|
|
20
|
+
developerToken: string;
|
|
21
|
+
};
|
|
22
|
+
mccAccountId: string;
|
|
23
|
+
refreshToken: string;
|
|
24
|
+
};
|
|
25
|
+
declare const googleAdsClient: (key?: string, config?: Config, vaultId?: string, itemId?: string) => Promise<GoogleAdsNamespace>;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { Config, GoogleAdsNamespace, googleAdsClient };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BaseNamespace } from "../../_class/index.mjs";
|
|
2
|
+
import { onePasswordClient } from "../../onePassword/server/index.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/googleAds/server/GoogleAdsNamespace.ts
|
|
5
|
+
var GoogleAdsNamespace = class extends BaseNamespace {
|
|
6
|
+
mccAccountId = "";
|
|
7
|
+
refreshToken = "";
|
|
8
|
+
ensureInit = async () => {
|
|
9
|
+
if (!this.client) try {
|
|
10
|
+
const { GoogleAdsApi } = await import("google-ads-api");
|
|
11
|
+
this.client = new GoogleAdsApi({
|
|
12
|
+
client_id: this.config.client.clientId,
|
|
13
|
+
client_secret: this.config.client.clientSecret,
|
|
14
|
+
developer_token: this.config.client.developerToken
|
|
15
|
+
});
|
|
16
|
+
this.mccAccountId = this.config.mccAccountId;
|
|
17
|
+
this.refreshToken = this.config.refreshToken;
|
|
18
|
+
} catch (e) {
|
|
19
|
+
throw new Error("Google Sheets Client not installed");
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
getCustomer = async (customerId) => {
|
|
23
|
+
await this.ensureInit();
|
|
24
|
+
return this.client.Customer({
|
|
25
|
+
customer_id: customerId,
|
|
26
|
+
login_customer_id: this.mccAccountId,
|
|
27
|
+
refresh_token: this.refreshToken
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/googleAds/server/googleAds.ts
|
|
34
|
+
const googleAdsNamespaces = /* @__PURE__ */ new Map();
|
|
35
|
+
const googleAdsClient = async (key = "default", config, vaultId, itemId) => {
|
|
36
|
+
if (googleAdsNamespaces.has(key)) return googleAdsNamespaces.get(key);
|
|
37
|
+
let instanceConfig;
|
|
38
|
+
if (config) instanceConfig = config;
|
|
39
|
+
else if (vaultId && itemId) instanceConfig = await (await onePasswordClient()).getJsonNote(vaultId, itemId);
|
|
40
|
+
else if (process.env.GOOGLE_ADS_VAULT_ID && process.env.GOOGLE_ADS_ITEM_ID) instanceConfig = await (await onePasswordClient()).getJsonNote(process.env.GOOGLE_ADS_VAULT_ID, process.env.GOOGLE_ADS_ITEM_ID);
|
|
41
|
+
else throw new Error(`Config required for namespace '${key}'`);
|
|
42
|
+
const namespace = new GoogleAdsNamespace(key, instanceConfig);
|
|
43
|
+
googleAdsNamespaces.set(key, namespace);
|
|
44
|
+
return namespace;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { GoogleAdsNamespace, googleAdsClient };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { t as BaseNamespace } from "../../../index-CFaAdPAh.mjs";
|
|
2
|
+
import { t as GoogleCloudConfig } from "../../../index-CIG08fpw.mjs";
|
|
3
|
+
import { BigQuery, DatasetResource, QueryOptions } from "@google-cloud/bigquery";
|
|
4
|
+
import { GoogleAuthOptions } from "@google-cloud/common";
|
|
5
|
+
|
|
6
|
+
//#region src/googleCloud/bigquery/server/GoogleCloudBigqueryNamespace.d.ts
|
|
7
|
+
type QueryInput = string | {
|
|
8
|
+
query: string;
|
|
9
|
+
location?: string;
|
|
10
|
+
params: QueryOptions;
|
|
11
|
+
};
|
|
12
|
+
type Dataset = {
|
|
13
|
+
id: string;
|
|
14
|
+
location: string;
|
|
15
|
+
projectId: string;
|
|
16
|
+
};
|
|
17
|
+
type Table = {
|
|
18
|
+
id: string;
|
|
19
|
+
};
|
|
20
|
+
declare class GoogleCloudBigqueryNamespace extends BaseNamespace {
|
|
21
|
+
client: BigQuery;
|
|
22
|
+
config: GoogleCloudConfig & {
|
|
23
|
+
projectId?: string;
|
|
24
|
+
};
|
|
25
|
+
ensureInit: () => Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Create a Dataset if it doesn't already exist.
|
|
28
|
+
* Returns table instance.
|
|
29
|
+
*/
|
|
30
|
+
createDataset: (datasetId: string, options?: DatasetResource) => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Check to see whether a given Bigquery dataset exists.
|
|
33
|
+
* Based off:
|
|
34
|
+
* https://github.com/googleapis/nodejs-bigquery/blob/main/samples/getDataset.js
|
|
35
|
+
*/
|
|
36
|
+
datasetExists: (datasetId: string) => Promise<any>;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieve all the Datasets
|
|
39
|
+
*/
|
|
40
|
+
getDatasets: () => Promise<Dataset[]>;
|
|
41
|
+
query: (props: QueryInput) => Promise<any>;
|
|
42
|
+
/**
|
|
43
|
+
* Create a Table if it doesn't already exist.
|
|
44
|
+
*/
|
|
45
|
+
createTable: (datasetId: string, datasetOptions: object, tableId: string, options?: object) => Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Check to see whether a given BigQuery table exists.
|
|
48
|
+
* https://cloud.google.com/bigquery/docs/samples/bigquery-table-exists
|
|
49
|
+
*/
|
|
50
|
+
tableExists: (datasetId: string, tableId: string) => Promise<boolean>;
|
|
51
|
+
getTables: (datasetId: string) => Promise<Table[]>;
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/googleCloud/bigquery/server/googleCloudBigquery.d.ts
|
|
55
|
+
declare const googleCloudBigqueryClient$1: (key?: string, projectId?: string, config?: GoogleAuthOptions, vaultId?: string, itemId?: string) => Promise<GoogleCloudBigqueryNamespace>;
|
|
56
|
+
declare const getHandlerPath: (input: string) => string;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/googleCloud/bigquery/server/loadData.d.ts
|
|
59
|
+
type LoadData = {
|
|
60
|
+
googleCloudBigqueryClient: GoogleCloudBigqueryNamespace;
|
|
61
|
+
googleCloudStorageClient: any;
|
|
62
|
+
file: {
|
|
63
|
+
bucket: string;
|
|
64
|
+
key: string;
|
|
65
|
+
metadata: object;
|
|
66
|
+
};
|
|
67
|
+
table: {
|
|
68
|
+
datasetId: string;
|
|
69
|
+
tableId: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Load data into a given table using Google Cloud Storage.
|
|
74
|
+
*/
|
|
75
|
+
declare const loadData: ({
|
|
76
|
+
file,
|
|
77
|
+
googleCloudBigqueryClient,
|
|
78
|
+
googleCloudStorageClient,
|
|
79
|
+
table
|
|
80
|
+
}: LoadData) => Promise<void>;
|
|
81
|
+
//#endregion
|
|
82
|
+
export { type GoogleCloudBigqueryNamespace, QueryInput, getHandlerPath, googleCloudBigqueryClient$1 as googleCloudBigqueryClient, loadData };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { BaseNamespace } from "../../../_class/index.mjs";
|
|
2
|
+
import { onePasswordClient } from "../../../onePassword/server/index.mjs";
|
|
3
|
+
import { getConfig } from "../../server/index.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/googleCloud/bigquery/server/GoogleCloudBigqueryNamespace.ts
|
|
6
|
+
var GoogleCloudBigqueryNamespace = class extends BaseNamespace {
|
|
7
|
+
ensureInit = async () => {
|
|
8
|
+
if (!this.client) try {
|
|
9
|
+
const { BigQuery } = await import("@google-cloud/bigquery");
|
|
10
|
+
this.client = new BigQuery(getConfig(this.config, this.config?.projectId));
|
|
11
|
+
} catch (e) {
|
|
12
|
+
throw new Error("Google BigQuery Client not installed");
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Create a Dataset if it doesn't already exist.
|
|
17
|
+
* Returns table instance.
|
|
18
|
+
*/
|
|
19
|
+
createDataset = async (datasetId, options = {}) => {
|
|
20
|
+
await this.ensureInit();
|
|
21
|
+
if (!await this.datasetExists(datasetId)) await this.client.createDataset(datasetId);
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Check to see whether a given Bigquery dataset exists.
|
|
25
|
+
* Based off:
|
|
26
|
+
* https://github.com/googleapis/nodejs-bigquery/blob/main/samples/getDataset.js
|
|
27
|
+
*/
|
|
28
|
+
datasetExists = async (datasetId) => {
|
|
29
|
+
await this.ensureInit();
|
|
30
|
+
let response;
|
|
31
|
+
try {
|
|
32
|
+
await this.client.dataset(datasetId).get();
|
|
33
|
+
response = true;
|
|
34
|
+
} catch (exception) {
|
|
35
|
+
response = false;
|
|
36
|
+
}
|
|
37
|
+
return response;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Retrieve all the Datasets
|
|
41
|
+
*/
|
|
42
|
+
getDatasets = async () => {
|
|
43
|
+
await this.ensureInit();
|
|
44
|
+
let response = [];
|
|
45
|
+
const datasets = await this.client.getDatasets();
|
|
46
|
+
if (datasets?.[0]) for (let i = 0; i < datasets[0].length; i++) response.push({
|
|
47
|
+
id: datasets[0][i].id,
|
|
48
|
+
location: datasets[0][i].location,
|
|
49
|
+
projectId: datasets[0][i].bigQuery.projectId
|
|
50
|
+
});
|
|
51
|
+
return response;
|
|
52
|
+
};
|
|
53
|
+
query = async (props) => {
|
|
54
|
+
await this.ensureInit();
|
|
55
|
+
let queryString = "string" === typeof props ? props : props.query;
|
|
56
|
+
let options = "string" === typeof props ? {} : props?.params;
|
|
57
|
+
return await this.client.query(queryString, options);
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Create a Table if it doesn't already exist.
|
|
61
|
+
*/
|
|
62
|
+
createTable = async (datasetId, datasetOptions = {}, tableId, options = {}) => {
|
|
63
|
+
await this.ensureInit();
|
|
64
|
+
await this.createDataset(datasetId, datasetOptions);
|
|
65
|
+
if (!await this.tableExists(datasetId, tableId)) await this.client.dataset(datasetId).createTable(tableId, options || {});
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Check to see whether a given BigQuery table exists.
|
|
69
|
+
* https://cloud.google.com/bigquery/docs/samples/bigquery-table-exists
|
|
70
|
+
*/
|
|
71
|
+
tableExists = async (datasetId, tableId) => {
|
|
72
|
+
await this.ensureInit();
|
|
73
|
+
let response = false;
|
|
74
|
+
const tables = await this.getTables(datasetId);
|
|
75
|
+
for (let i = 0; i < tables.length; i++) if (tables[i].id === tableId) {
|
|
76
|
+
response = true;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
return response;
|
|
80
|
+
};
|
|
81
|
+
getTables = async (datasetId) => {
|
|
82
|
+
await this.ensureInit();
|
|
83
|
+
let response = [];
|
|
84
|
+
const tables = await this.client.dataset(datasetId).getTables();
|
|
85
|
+
if (tables?.[0]) for (let i = 0; i < tables[0].length; i++) response.push({ id: tables[0][i].id });
|
|
86
|
+
return response;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/googleCloud/bigquery/server/googleCloudBigquery.ts
|
|
92
|
+
const googleCloudBigqueryNamespaces = /* @__PURE__ */ new Map();
|
|
93
|
+
const googleCloudBigqueryClient = async (key = "default", projectId, config, vaultId, itemId) => {
|
|
94
|
+
if (googleCloudBigqueryNamespaces.has(key)) return googleCloudBigqueryNamespaces.get(key);
|
|
95
|
+
let instanceConfig;
|
|
96
|
+
if (config) instanceConfig = {
|
|
97
|
+
...config,
|
|
98
|
+
projectId
|
|
99
|
+
};
|
|
100
|
+
else if (vaultId && itemId) instanceConfig = {
|
|
101
|
+
...await (await onePasswordClient()).getJsonNote(vaultId, itemId),
|
|
102
|
+
projectId
|
|
103
|
+
};
|
|
104
|
+
else if (process.env.GOOGLE_CLOUD_VAULT_ID && process.env.GOOGLE_CLOUD_ITEM_ID) instanceConfig = {
|
|
105
|
+
...await (await onePasswordClient()).getJsonNote(process.env.GOOGLE_CLOUD_VAULT_ID, process.env.GOOGLE_CLOUD_ITEM_ID),
|
|
106
|
+
projectId
|
|
107
|
+
};
|
|
108
|
+
else throw new Error(`Config required for namespace '${key}'`);
|
|
109
|
+
const namespace = new GoogleCloudBigqueryNamespace(key, instanceConfig);
|
|
110
|
+
googleCloudBigqueryNamespaces.set(key, namespace);
|
|
111
|
+
return namespace;
|
|
112
|
+
};
|
|
113
|
+
const getHandlerPath = (input) => {
|
|
114
|
+
return `${input.split(process.cwd())[1].substring(1).replace(/\\/g, "/")}`;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/googleCloud/bigquery/server/loadData.ts
|
|
119
|
+
/**
|
|
120
|
+
* Load data into a given table using Google Cloud Storage.
|
|
121
|
+
*/
|
|
122
|
+
const loadData = async ({ file, googleCloudBigqueryClient, googleCloudStorageClient, table }) => {
|
|
123
|
+
if (await googleCloudBigqueryClient.tableExists(table.datasetId, table.tableId)) await googleCloudBigqueryClient.client.dataset(table.datasetId).table(table.tableId).load(googleCloudStorageClient.client.bucket(file.bucket).file(file.key), file.metadata);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
//#endregion
|
|
127
|
+
export { GoogleCloudBigqueryNamespace, getHandlerPath, googleCloudBigqueryClient, loadData };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/googleCloud/server/googleCloud.ts
|
|
2
|
+
/**
|
|
3
|
+
* Using the response from Parameter Store and format it ready to be used with Google API.
|
|
4
|
+
*/
|
|
5
|
+
const getConfig = (parameter, projectId) => {
|
|
6
|
+
const privateKey = parameter["private_key"].replace(/\\n/g, "\n");
|
|
7
|
+
let response = { credentials: {
|
|
8
|
+
type: parameter["type"],
|
|
9
|
+
project_id: parameter["project_id"],
|
|
10
|
+
private_key_id: parameter["private_key_id"],
|
|
11
|
+
private_key: privateKey,
|
|
12
|
+
client_email: parameter["client_email"],
|
|
13
|
+
client_id: parameter["client_id"],
|
|
14
|
+
auth_uri: parameter["auth_uri"],
|
|
15
|
+
token_uri: parameter["token_uri"],
|
|
16
|
+
auth_provider_x509_cert_url: parameter["auth_provider_x509_cert_url"],
|
|
17
|
+
client_x509_cert_url: parameter["client_x509_cert_url"]
|
|
18
|
+
} };
|
|
19
|
+
if (projectId) response["projectId"] = projectId;
|
|
20
|
+
return response;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { getConfig };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as BaseNamespace } from "../../../index-CFaAdPAh.mjs";
|
|
2
|
+
import { t as GoogleCloudConfig } from "../../../index-CIG08fpw.mjs";
|
|
3
|
+
import * as _googleapis_sheets0 from "@googleapis/sheets";
|
|
4
|
+
import { GoogleAuth } from "googleapis-common";
|
|
5
|
+
|
|
6
|
+
//#region src/googleCloud/sheets/server/GoogleCloudSheetsNamespace.d.ts
|
|
7
|
+
type GetBatchDataProps = {
|
|
8
|
+
spreadsheetId: string;
|
|
9
|
+
ranges: string[];
|
|
10
|
+
dateTimeRender?: string;
|
|
11
|
+
valueRender?: string;
|
|
12
|
+
};
|
|
13
|
+
declare class GoogleCloudSheetsNamespace extends BaseNamespace {
|
|
14
|
+
client: GoogleAuth;
|
|
15
|
+
config: GoogleCloudConfig & {
|
|
16
|
+
projectId?: string;
|
|
17
|
+
};
|
|
18
|
+
ensureInit: () => Promise<void>;
|
|
19
|
+
getBatchData: (props: GetBatchDataProps) => Promise<_googleapis_sheets0.sheets_v4.Schema$BatchGetValuesResponse>;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { GoogleCloudSheetsNamespace };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseNamespace } from "../../../_class/index.mjs";
|
|
2
|
+
import { getConfig } from "../../server/index.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/googleCloud/sheets/server/GoogleCloudSheetsNamespace.ts
|
|
5
|
+
var GoogleCloudSheetsNamespace = class extends BaseNamespace {
|
|
6
|
+
ensureInit = async () => {
|
|
7
|
+
if (!this.client) try {
|
|
8
|
+
const googleApisSheets = await import("@googleapis/sheets");
|
|
9
|
+
const formattedConfig = getConfig(this.config, this.config?.projectId);
|
|
10
|
+
this.client = new googleApisSheets.auth.GoogleAuth({
|
|
11
|
+
...formattedConfig,
|
|
12
|
+
scopes: ["https://www.googleapis.com/auth/spreadsheets"]
|
|
13
|
+
});
|
|
14
|
+
} catch (e) {
|
|
15
|
+
throw new Error("Google Sheets Client not installed");
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
getBatchData = async (props) => {
|
|
19
|
+
await this.ensureInit();
|
|
20
|
+
return (await (await import("@googleapis/sheets")).sheets("v4").spreadsheets.values.batchGet({
|
|
21
|
+
auth: this.client,
|
|
22
|
+
dateTimeRenderOption: props?.dateTimeRender || "FORMATTED_STRING",
|
|
23
|
+
ranges: props.ranges,
|
|
24
|
+
spreadsheetId: props.spreadsheetId,
|
|
25
|
+
valueRenderOption: props?.valueRender || "UNFORMATTED_VALUE"
|
|
26
|
+
})).data;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { GoogleCloudSheetsNamespace };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { t as BaseNamespace } from "../../../index-CFaAdPAh.mjs";
|
|
2
|
+
import { t as GoogleCloudConfig } from "../../../index-CIG08fpw.mjs";
|
|
3
|
+
import * as _google_cloud_storage0 from "@google-cloud/storage";
|
|
4
|
+
import { Storage } from "@google-cloud/storage";
|
|
5
|
+
import { GoogleAuthOptions } from "@google-cloud/common";
|
|
6
|
+
|
|
7
|
+
//#region src/googleCloud/storage/server/GoogleCloudStorageNamespace.d.ts
|
|
8
|
+
declare class GoogleCloudStorageNamespace extends BaseNamespace {
|
|
9
|
+
client: Storage;
|
|
10
|
+
config: GoogleCloudConfig & {
|
|
11
|
+
projectId?: string;
|
|
12
|
+
};
|
|
13
|
+
ensureInit: () => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Copy a local file to Google Cloud Storage.
|
|
16
|
+
*/
|
|
17
|
+
copyToCloud: (bucket: string, localFile: string, options?: {}) => Promise<_google_cloud_storage0.UploadResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Check to see if a file exists but don't get the contents.
|
|
20
|
+
*/
|
|
21
|
+
fileExists: (bucket: string, key: string) => Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Write a file to Google Cloud Storage.
|
|
24
|
+
*/
|
|
25
|
+
writeFile: (bucket: string, key: string, data: any, options?: {}) => Promise<unknown>;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/googleCloud/storage/server/googleCloudStorage.d.ts
|
|
29
|
+
declare const googleCloudStorageClient: (key?: string, projectId?: string, config?: GoogleAuthOptions, vaultId?: string, itemId?: string) => Promise<GoogleCloudStorageNamespace>;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { GoogleCloudStorageNamespace, googleCloudStorageClient };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { BaseNamespace } from "../../../_class/index.mjs";
|
|
2
|
+
import { onePasswordClient } from "../../../onePassword/server/index.mjs";
|
|
3
|
+
import { getConfig } from "../../server/index.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/googleCloud/storage/server/GoogleCloudStorageNamespace.ts
|
|
6
|
+
var GoogleCloudStorageNamespace = class extends BaseNamespace {
|
|
7
|
+
ensureInit = async () => {
|
|
8
|
+
if (!this.client) try {
|
|
9
|
+
const { Storage } = await import("@google-cloud/storage");
|
|
10
|
+
this.client = new Storage(getConfig(this.config, this.config?.projectId));
|
|
11
|
+
} catch (e) {
|
|
12
|
+
throw new Error("Google Cloud Storage Client not installed");
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Copy a local file to Google Cloud Storage.
|
|
17
|
+
*/
|
|
18
|
+
copyToCloud = async (bucket, localFile, options = {}) => {
|
|
19
|
+
await this.ensureInit();
|
|
20
|
+
return await this.client.bucket(bucket).upload(localFile, options);
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Check to see if a file exists but don't get the contents.
|
|
24
|
+
*/
|
|
25
|
+
fileExists = async (bucket, key) => {
|
|
26
|
+
await this.ensureInit();
|
|
27
|
+
return (await this.client.bucket(bucket).file(key).exists())?.[0];
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Write a file to Google Cloud Storage.
|
|
31
|
+
*/
|
|
32
|
+
writeFile = async (bucket, key, data, options = {}) => {
|
|
33
|
+
await this.ensureInit();
|
|
34
|
+
const dataStream = new (await (import("stream"))).PassThrough();
|
|
35
|
+
const googleFile = this.client.bucket(bucket).file(key);
|
|
36
|
+
dataStream.push(data);
|
|
37
|
+
dataStream.push(null);
|
|
38
|
+
return await new Promise((resolve, reject) => {
|
|
39
|
+
dataStream.pipe(googleFile.createWriteStream({
|
|
40
|
+
contentType: "auto",
|
|
41
|
+
resumable: false,
|
|
42
|
+
validation: false,
|
|
43
|
+
metadata: {},
|
|
44
|
+
...options
|
|
45
|
+
})).on("error", (error) => {
|
|
46
|
+
reject(error);
|
|
47
|
+
}).on("finish", () => {
|
|
48
|
+
resolve(true);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/googleCloud/storage/server/googleCloudStorage.ts
|
|
56
|
+
const googleCloudStorageNamespaces = /* @__PURE__ */ new Map();
|
|
57
|
+
const googleCloudStorageClient = async (key = "default", projectId, config, vaultId, itemId) => {
|
|
58
|
+
if (googleCloudStorageNamespaces.has(key)) return googleCloudStorageNamespaces.get(key);
|
|
59
|
+
let instanceConfig;
|
|
60
|
+
if (config) instanceConfig = {
|
|
61
|
+
...config,
|
|
62
|
+
projectId
|
|
63
|
+
};
|
|
64
|
+
else if (vaultId && itemId) instanceConfig = {
|
|
65
|
+
...await (await onePasswordClient()).getJsonNote(vaultId, itemId),
|
|
66
|
+
projectId
|
|
67
|
+
};
|
|
68
|
+
else if (process.env.GOOGLE_CLOUD_VAULT_ID && process.env.GOOGLE_CLOUD_ITEM_ID) instanceConfig = {
|
|
69
|
+
...await (await onePasswordClient()).getJsonNote(process.env.GOOGLE_CLOUD_VAULT_ID, process.env.GOOGLE_CLOUD_ITEM_ID),
|
|
70
|
+
projectId
|
|
71
|
+
};
|
|
72
|
+
else throw new Error(`Config required for namespace '${key}'`);
|
|
73
|
+
const namespace = new GoogleCloudStorageNamespace(key, instanceConfig);
|
|
74
|
+
googleCloudStorageNamespaces.set(key, namespace);
|
|
75
|
+
return namespace;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
export { GoogleCloudStorageNamespace, googleCloudStorageClient };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { t as BaseNamespace } from "../../index-CFaAdPAh.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/googlePageSpeed/server/GooglePageSpeedNamespace.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Based on https://developers.google.com/speed/docs/insights/rest/v5/pagespeedapi/runpagespeed
|
|
6
|
+
*/
|
|
7
|
+
declare class GooglePageSpeedNamespace extends BaseNamespace {
|
|
8
|
+
client: boolean;
|
|
9
|
+
config: GooglePageSpeedConfig;
|
|
10
|
+
ensureInit: () => Promise<void>;
|
|
11
|
+
getReport: (url: string, inputCategory?: Category, inputStrategy?: Strategy) => Promise<any>;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/googlePageSpeed/server/googlePageSpeed.d.ts
|
|
15
|
+
type GooglePageSpeedConfig = {
|
|
16
|
+
apiKey: string;
|
|
17
|
+
};
|
|
18
|
+
declare const googlePageSpeedClient: (key?: string, config?: GooglePageSpeedConfig, vaultId?: string, itemId?: string) => Promise<GooglePageSpeedNamespace>;
|
|
19
|
+
declare const category: {
|
|
20
|
+
readonly CATEGORY_UNSPECIFIED: "CATEGORY_UNSPECIFIED";
|
|
21
|
+
readonly ACCESSIBILITY: "ACCESSIBILITY";
|
|
22
|
+
readonly BEST_PRACTICES: "BEST_PRACTICES";
|
|
23
|
+
readonly PERFORMANCE: "PERFORMANCE";
|
|
24
|
+
readonly SEO: "SEO";
|
|
25
|
+
};
|
|
26
|
+
type Category = typeof category[keyof typeof category];
|
|
27
|
+
declare const strategy: {
|
|
28
|
+
readonly STRATEGY_UNSPECIFIED: "STRATEGY_UNSPECIFIED";
|
|
29
|
+
readonly DESKTOP: "DESKTOP";
|
|
30
|
+
readonly MOBILE: "MOBILE";
|
|
31
|
+
};
|
|
32
|
+
type Strategy = typeof strategy[keyof typeof strategy];
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Category, GooglePageSpeedConfig, GooglePageSpeedNamespace, Strategy, category, googlePageSpeedClient, strategy };
|