@8ms/helpers 1.1.71 → 1.1.73
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/api/response.js +1 -12
- package/api/states.js +1 -10
- package/api/unexpectedError.js +1 -4
- package/array/contains.js +2 -6
- package/array/getArray.js +2 -10
- package/atInternet/request.js +1 -2
- package/aws/athenaExpress/initClient.js +3 -27
- package/aws/athenaExpress/query.js +2 -9
- package/aws/getConfig.js +2 -26
- package/aws/glue/initClient.js +2 -17
- package/aws/glue/invoke.js +2 -22
- package/aws/isResponse200.js +2 -21
- package/aws/lambda/getHandlerPath.js +1 -7
- package/aws/lambda/initClient.js +2 -17
- package/aws/lambda/invoke.js +2 -39
- package/aws/s3/copyFile.js +2 -13
- package/aws/s3/deleteFile.js +2 -12
- package/aws/s3/deleteFiles.js +2 -16
- package/aws/s3/deleteFolder.js +2 -35
- package/aws/s3/getGlueJson.js +2 -15
- package/aws/s3/getPresignedPost.js +3 -16
- package/aws/s3/getSignedUrl.js +2 -15
- package/aws/s3/initClient.js +2 -17
- package/aws/s3/isFileExists.js +2 -26
- package/aws/s3/listFiles.js +2 -32
- package/aws/s3/listFolders.js +4 -31
- package/aws/s3/moveFile.js +2 -20
- package/aws/s3/readBuffer.js +2 -51
- package/aws/s3/readFile.js +2 -69
- package/aws/s3/writeFile.js +2 -15
- package/aws/s3/writePresignedPost.js +2 -30
- package/aws/s3cache/cache.js +1 -2
- package/aws/s3cache/getCache.js +2 -35
- package/aws/s3cache/getKey.js +2 -16
- package/aws/s3cache/saveCache.js +2 -12
- package/aws/s3cache/updateCache.js +2 -23
- package/aws/ses/SimpleEmail.js +2 -115
- package/aws/ses/initClient.js +2 -17
- package/aws/ssm/getParameter.js +2 -39
- package/aws/ssm/initClient.js +2 -17
- package/axios/get.js +1 -44
- package/axios/post.js +2 -46
- package/boolean/getBoolean.js +2 -15
- package/class/BaseClass.js +9 -50
- package/crud/actions.js +1 -10
- package/crypto/getDecrypt.js +2 -11
- package/crypto/getEncrypt.js +2 -11
- package/crypto/getRandom.js +2 -10
- package/crypto/getSha256.js +2 -15
- package/date/date.js +1 -2
- package/date/duration.js +1 -2
- package/date/durationComparisons.js +1 -7
- package/date/durations.js +1 -10
- package/date/financialYear.js +1 -2
- package/date/financialYearWeek.js +1 -2
- package/date/format.js +2 -18
- package/date/getDate.js +9 -96
- package/date/getDatesBetween.js +3 -25
- package/date/getDurationHours.js +2 -25
- package/date/getDurationMinutes.js +2 -24
- package/date/getFinancialYear.js +8 -48
- package/date/getFinancialYearToDate.js +2 -18
- package/date/getFinancialYearToYesterday.js +2 -18
- package/date/getFinancialYearWeeks.js +2 -29
- package/date/getLastWeek.js +2 -28
- package/date/getMax.js +2 -15
- package/date/getMidnight.js +2 -12
- package/date/getMin.js +2 -15
- package/date/getMonday.js +5 -32
- package/date/getNumber.js +2 -14
- package/date/getPredefinedTimeframe.js +2 -23
- package/date/getSunday.js +5 -32
- package/date/getThisWeek.js +2 -28
- package/date/getTimeZoned.js +5 -36
- package/date/getToday.js +2 -39
- package/date/getTwoWeeksAgo.js +2 -28
- package/date/getWeeksAgo.js +2 -16
- package/date/getYesterday.js +2 -40
- package/date/isDateValid.js +2 -22
- package/date/isLastWeek.js +2 -13
- package/date/isThisWeek.js +2 -13
- package/date/parseExcelDate.js +2 -17
- package/date/predefinedTimeframes.js +1 -9
- package/date/timeframe.js +1 -2
- package/date/timeframes.js +1 -7
- package/deepCrawl/buildRequest.js +4 -83
- package/deepCrawl/filter.js +1 -2
- package/deepCrawl/getData.js +1 -29
- package/deepCrawl/initClient.js +2 -31
- package/deepCrawl/operands.js +1 -13
- package/deepCrawl/orders.js +1 -7
- package/deepCrawl/reports.js +1 -13
- package/environment/environments.js +1 -8
- package/environment/getEnvironment.js +2 -42
- package/environment/isAws.js +2 -10
- package/environment/isDevelopment.js +1 -9
- package/environment/isLocalhost.js +2 -21
- package/environment/isProduction.js +1 -9
- package/environment/isStaging.js +1 -9
- package/environment/isVercel.js +2 -6
- package/environment/platforms.js +1 -7
- package/eskimi/ageGroups.js +1 -41
- package/eskimi/campaign.js +1 -2
- package/eskimi/devices.js +1 -13
- package/eskimi/endpoints.js +2 -17
- package/eskimi/genders.js +1 -13
- package/eskimi/getAccessToken.js +2 -22
- package/eskimi/getAgeGroup.js +2 -16
- package/eskimi/getCampaignIds.js +2 -11
- package/eskimi/getDevice.js +2 -16
- package/eskimi/getGender.js +2 -16
- package/eskimi/request.js +2 -23
- package/globals.d.js +1 -0
- package/google/bigQuery/initClient.js +2 -20
- package/google/bigQuery/query.js +2 -9
- package/google/getConfig.js +3 -21
- package/google/sheets/getAssociatedData.js +8 -52
- package/google/sheets/getBatchData.js +1 -19
- package/google/sheets/initClient.js +2 -22
- package/google/sheets/isCellNa.js +2 -6
- package/google/storage/initClient.js +2 -20
- package/google/storage/writeFile.js +2 -30
- package/googleAds/getCustomer.js +2 -14
- package/googleAds/initClient.js +2 -24
- package/initClients.js +5 -106
- package/json/isJson.js +2 -18
- package/littleWarden/getUrlStatus.js +2 -20
- package/littleWarden/isAllGood.js +2 -17
- package/littleWarden/isDanger.js +2 -17
- package/littleWarden/isWarning.js +2 -17
- package/littleWarden/states.js +1 -8
- package/myTarget/getAccessToken.js +2 -22
- package/myTarget/request.js +2 -23
- package/nextAuth/isSessionReady.js +1 -12
- package/nextAuth/states.js +2 -8
- package/nextJs/getIp.js +2 -12
- package/nextJs/getUserAgent.js +2 -6
- package/number/getDivide.js +2 -17
- package/number/getNumber.js +7 -50
- package/number/getPercent.js +2 -17
- package/number/getPercentIncrease.js +2 -17
- package/number/getRounded.js +2 -21
- package/package.json +47 -44
- package/prisma/initClient.js +3 -33
- package/snapchat/getAccessToken.js +2 -36
- package/sorting/byNumberAscending.js +2 -16
- package/sorting/byNumberDescending.js +2 -16
- package/sorting/byStringAscending.js +2 -20
- package/sorting/byStringDescending.js +2 -20
- package/string/formatCapitalise.js +2 -14
- package/string/getCleanFolder.js +2 -11
- package/string/getString.js +2 -35
- package/string/getStringFromStream.js +2 -14
- package/string/toProperCase.js +2 -17
- package/swr/isAllData.js +2 -18
- package/swr/isAnyError.js +2 -18
- package/swr/isAnyLoading.js +2 -20
- package/swr/isData.js +2 -6
- package/swr/isError.js +2 -6
- package/swr/isLoading.js +2 -11
- package/upTimeRobot/getMonitors.js +2 -31
- package/upTimeRobot/logTypes.js +1 -9
- package/upTimeRobot/monitorStatuses.js +1 -10
- package/upTimeRobot/monitorSubTypes.js +1 -12
- package/upTimeRobot/monitorTypes.js +1 -10
- package/upTimeRobot/requestStatuses.js +1 -7
- package/url/buildParameters.js +2 -21
- package/url/buildRelative.js +2 -12
- package/url/buildUrl.js +2 -28
- package/url/isAbsolute.js +2 -14
- package/url/isRelative.js +2 -7
- package/url/url.js +1 -2
- package/util/defaultTo.js +2 -34
- package/util/isUndefined.js +2 -18
- package/util/sleep.js +1 -6
- package/webWorker/states.js +1 -8
- package/xml/getXml.js +1 -14
- package/api/response.d.ts +0 -8
- package/api/states.d.ts +0 -9
- package/api/unexpectedError.d.ts +0 -2
- package/array/contains.d.ts +0 -8
- package/array/getArray.d.ts +0 -7
- package/atInternet/request.d.ts +0 -30
- package/aws/athenaExpress/initClient.d.ts +0 -12
- package/aws/athenaExpress/query.d.ts +0 -8
- package/aws/getConfig.d.ts +0 -13
- package/aws/glue/initClient.d.ts +0 -10
- package/aws/glue/invoke.d.ts +0 -9
- package/aws/isResponse200.d.ts +0 -7
- package/aws/lambda/getHandlerPath.d.ts +0 -5
- package/aws/lambda/initClient.d.ts +0 -10
- package/aws/lambda/invoke.d.ts +0 -12
- package/aws/s3/copyFile.d.ts +0 -13
- package/aws/s3/deleteFile.d.ts +0 -9
- package/aws/s3/deleteFiles.d.ts +0 -9
- package/aws/s3/deleteFolder.d.ts +0 -9
- package/aws/s3/getGlueJson.d.ts +0 -5
- package/aws/s3/getPresignedPost.d.ts +0 -20
- package/aws/s3/getSignedUrl.d.ts +0 -12
- package/aws/s3/initClient.d.ts +0 -10
- package/aws/s3/isFileExists.d.ts +0 -9
- package/aws/s3/listFiles.d.ts +0 -9
- package/aws/s3/listFolders.d.ts +0 -9
- package/aws/s3/moveFile.d.ts +0 -10
- package/aws/s3/readBuffer.d.ts +0 -13
- package/aws/s3/readFile.d.ts +0 -30
- package/aws/s3/writeFile.d.ts +0 -10
- package/aws/s3/writePresignedPost.d.ts +0 -14
- package/aws/s3cache/cache.d.ts +0 -7
- package/aws/s3cache/getCache.d.ts +0 -12
- package/aws/s3cache/getKey.d.ts +0 -10
- package/aws/s3cache/saveCache.d.ts +0 -10
- package/aws/s3cache/updateCache.d.ts +0 -10
- package/aws/ses/SimpleEmail.d.ts +0 -51
- package/aws/ses/initClient.d.ts +0 -10
- package/aws/ssm/getParameter.d.ts +0 -10
- package/aws/ssm/initClient.d.ts +0 -10
- package/axios/get.d.ts +0 -8
- package/axios/post.d.ts +0 -12
- package/boolean/getBoolean.d.ts +0 -7
- package/class/BaseClass.d.ts +0 -31
- package/crud/actions.d.ts +0 -8
- package/crypto/getDecrypt.d.ts +0 -10
- package/crypto/getEncrypt.d.ts +0 -10
- package/crypto/getRandom.d.ts +0 -8
- package/crypto/getSha256.d.ts +0 -8
- package/date/date.d.ts +0 -4
- package/date/duration.d.ts +0 -5
- package/date/durationComparisons.d.ts +0 -5
- package/date/durations.d.ts +0 -8
- package/date/financialYear.d.ts +0 -4
- package/date/financialYearWeek.d.ts +0 -6
- package/date/format.d.ts +0 -13
- package/date/getDate.d.ts +0 -12
- package/date/getDatesBetween.d.ts +0 -10
- package/date/getDurationHours.d.ts +0 -8
- package/date/getDurationMinutes.d.ts +0 -8
- package/date/getFinancialYear.d.ts +0 -9
- package/date/getFinancialYearToDate.d.ts +0 -7
- package/date/getFinancialYearToYesterday.d.ts +0 -7
- package/date/getFinancialYearWeeks.d.ts +0 -9
- package/date/getLastWeek.d.ts +0 -10
- package/date/getMax.d.ts +0 -12
- package/date/getMidnight.d.ts +0 -10
- package/date/getMin.d.ts +0 -12
- package/date/getMonday.d.ts +0 -14
- package/date/getNumber.d.ts +0 -11
- package/date/getPredefinedTimeframe.d.ts +0 -9
- package/date/getSunday.d.ts +0 -14
- package/date/getThisWeek.d.ts +0 -10
- package/date/getTimeZoned.d.ts +0 -13
- package/date/getToday.d.ts +0 -9
- package/date/getTwoWeeksAgo.d.ts +0 -10
- package/date/getWeeksAgo.d.ts +0 -12
- package/date/getYesterday.d.ts +0 -9
- package/date/isDateValid.d.ts +0 -7
- package/date/isLastWeek.d.ts +0 -6
- package/date/isThisWeek.d.ts +0 -6
- package/date/parseExcelDate.d.ts +0 -8
- package/date/predefinedTimeframes.d.ts +0 -7
- package/date/timeframe.d.ts +0 -8
- package/date/timeframes.d.ts +0 -4
- package/deepCrawl/buildRequest.d.ts +0 -15
- package/deepCrawl/filter.d.ts +0 -5
- package/deepCrawl/getData.d.ts +0 -5
- package/deepCrawl/initClient.d.ts +0 -13
- package/deepCrawl/operands.d.ts +0 -11
- package/deepCrawl/orders.d.ts +0 -9
- package/deepCrawl/reports.d.ts +0 -11
- package/environment/environments.d.ts +0 -7
- package/environment/getEnvironment.d.ts +0 -6
- package/environment/isAws.d.ts +0 -5
- package/environment/isDevelopment.d.ts +0 -2
- package/environment/isLocalhost.d.ts +0 -5
- package/environment/isProduction.d.ts +0 -2
- package/environment/isStaging.d.ts +0 -2
- package/environment/isVercel.d.ts +0 -5
- package/environment/platforms.d.ts +0 -6
- package/eskimi/ageGroups.d.ts +0 -5
- package/eskimi/campaign.d.ts +0 -19
- package/eskimi/devices.d.ts +0 -5
- package/eskimi/endpoints.d.ts +0 -16
- package/eskimi/genders.d.ts +0 -5
- package/eskimi/getAccessToken.d.ts +0 -9
- package/eskimi/getAgeGroup.d.ts +0 -7
- package/eskimi/getCampaignIds.d.ts +0 -7
- package/eskimi/getDevice.d.ts +0 -7
- package/eskimi/getGender.d.ts +0 -7
- package/eskimi/request.d.ts +0 -8
- package/google/bigQuery/initClient.d.ts +0 -11
- package/google/bigQuery/query.d.ts +0 -9
- package/google/getConfig.d.ts +0 -20
- package/google/sheets/getAssociatedData.d.ts +0 -16
- package/google/sheets/getBatchData.d.ts +0 -18
- package/google/sheets/initClient.d.ts +0 -11
- package/google/sheets/isCellNa.d.ts +0 -7
- package/google/storage/initClient.d.ts +0 -12
- package/google/storage/writeFile.d.ts +0 -12
- package/googleAds/getCustomer.d.ts +0 -7
- package/googleAds/initClient.d.ts +0 -16
- package/initClients.d.ts +0 -40
- package/json/isJson.d.ts +0 -8
- package/littleWarden/getUrlStatus.d.ts +0 -9
- package/littleWarden/isAllGood.d.ts +0 -7
- package/littleWarden/isDanger.d.ts +0 -7
- package/littleWarden/isWarning.d.ts +0 -7
- package/littleWarden/states.d.ts +0 -7
- package/myTarget/getAccessToken.d.ts +0 -9
- package/myTarget/request.d.ts +0 -8
- package/nextAuth/isSessionReady.d.ts +0 -4
- package/nextAuth/states.d.ts +0 -7
- package/nextJs/getIp.d.ts +0 -7
- package/nextJs/getUserAgent.d.ts +0 -7
- package/number/getDivide.d.ts +0 -9
- package/number/getNumber.d.ts +0 -8
- package/number/getPercent.d.ts +0 -9
- package/number/getPercentIncrease.d.ts +0 -9
- package/number/getRounded.d.ts +0 -9
- package/prisma/initClient.d.ts +0 -4
- package/snapchat/getAccessToken.d.ts +0 -9
- package/sorting/byNumberAscending.d.ts +0 -8
- package/sorting/byNumberDescending.d.ts +0 -8
- package/sorting/byStringAscending.d.ts +0 -8
- package/sorting/byStringDescending.d.ts +0 -8
- package/string/formatCapitalise.d.ts +0 -9
- package/string/getCleanFolder.d.ts +0 -7
- package/string/getString.d.ts +0 -7
- package/string/getStringFromStream.d.ts +0 -8
- package/string/toProperCase.d.ts +0 -7
- package/swr/isAllData.d.ts +0 -7
- package/swr/isAnyError.d.ts +0 -7
- package/swr/isAnyLoading.d.ts +0 -7
- package/swr/isData.d.ts +0 -7
- package/swr/isError.d.ts +0 -7
- package/swr/isLoading.d.ts +0 -7
- package/upTimeRobot/getMonitors.d.ts +0 -1
- package/upTimeRobot/logTypes.d.ts +0 -7
- package/upTimeRobot/monitorStatuses.d.ts +0 -8
- package/upTimeRobot/monitorSubTypes.d.ts +0 -10
- package/upTimeRobot/monitorTypes.d.ts +0 -8
- package/upTimeRobot/requestStatuses.d.ts +0 -5
- package/url/buildParameters.d.ts +0 -8
- package/url/buildRelative.d.ts +0 -8
- package/url/buildUrl.d.ts +0 -10
- package/url/isAbsolute.d.ts +0 -7
- package/url/isRelative.d.ts +0 -7
- package/url/url.d.ts +0 -6
- package/util/defaultTo.d.ts +0 -10
- package/util/isUndefined.d.ts +0 -9
- package/util/sleep.d.ts +0 -4
- package/webWorker/states.d.ts +0 -7
- package/xml/getXml.d.ts +0 -4
package/deepCrawl/operands.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const operands = {
|
|
4
|
-
EQUALS: 'eql',
|
|
5
|
-
CONTAINS: 'cont',
|
|
6
|
-
LESS_THAN: 'lt',
|
|
7
|
-
LESS_THAN_OR_EQUAL: 'lte',
|
|
8
|
-
GREATER_THAN: 'gt',
|
|
9
|
-
GREATER_THAN_OR_EQUAL: 'gte',
|
|
10
|
-
REGEX: 'rgx',
|
|
11
|
-
NOT_REGEX: 'nrgx',
|
|
12
|
-
};
|
|
13
|
-
exports.default = operands;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var operands={EQUALS:"eql",CONTAINS:"cont",LESS_THAN:"lt",LESS_THAN_OR_EQUAL:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL:"gte",REGEX:"rgx",NOT_REGEX:"nrgx"},_default=operands;exports["default"]=_default;
|
package/deepCrawl/orders.js
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const orders = {
|
|
4
|
-
ASCENDING: 'asc',
|
|
5
|
-
DESCENDING: 'desc',
|
|
6
|
-
};
|
|
7
|
-
exports.default = orders;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var orders={ASCENDING:"asc",DESCENDING:"desc"},_default=orders;exports["default"]=_default;
|
package/deepCrawl/reports.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const reports = {
|
|
4
|
-
CRAWL_STATISTICS: 'crawl_statistics',
|
|
5
|
-
CUSTOM: 'custom',
|
|
6
|
-
LIST_PROJECTS: 'list_projects',
|
|
7
|
-
LIST_CRAWLS: 'list_crawls',
|
|
8
|
-
LIST_REPORTS: 'list_reports',
|
|
9
|
-
REPORT_ROWS: 'report_rows',
|
|
10
|
-
REPORT_STATISTICS: 'report_statistics',
|
|
11
|
-
REPORT_SUMMARY: 'report_summary',
|
|
12
|
-
};
|
|
13
|
-
exports.default = reports;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var reports={CRAWL_STATISTICS:"crawl_statistics",CUSTOM:"custom",LIST_PROJECTS:"list_projects",LIST_CRAWLS:"list_crawls",LIST_REPORTS:"list_reports",REPORT_ROWS:"report_rows",REPORT_STATISTICS:"report_statistics",REPORT_SUMMARY:"report_summary"},_default=reports;exports["default"]=_default;
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const environments = {
|
|
4
|
-
DEVELOPMENT: 'development',
|
|
5
|
-
STAGING: 'staging',
|
|
6
|
-
PRODUCTION: 'production',
|
|
7
|
-
};
|
|
8
|
-
exports.default = environments;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var environments={DEVELOPMENT:"development",STAGING:"staging",PRODUCTION:"production"},_default=environments;exports["default"]=_default;
|
|
@@ -1,43 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const environments_1 = __importDefault(require("./environments"));
|
|
7
|
-
/**
|
|
1
|
+
"use strict";var _environments=_interopRequireDefault(require("./environments"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/**
|
|
8
2
|
* Determine the environment we're using.
|
|
9
|
-
*/
|
|
10
|
-
const getEnvironment = () => {
|
|
11
|
-
let platformEnvironment = process.env.ENVIRONMENT;
|
|
12
|
-
let response;
|
|
13
|
-
// Custom - Backend/AWS
|
|
14
|
-
if (process.env.EMS_ENVIRONMENT) {
|
|
15
|
-
platformEnvironment = process.env.EMS_ENVIRONMENT;
|
|
16
|
-
}
|
|
17
|
-
// Custom - Frontend
|
|
18
|
-
else if (process.env.NEXT_PUBLIC_EMS_ENVIRONMENT) {
|
|
19
|
-
platformEnvironment = process.env.NEXT_PUBLIC_EMS_ENVIRONMENT;
|
|
20
|
-
}
|
|
21
|
-
// Vercel - Frontend
|
|
22
|
-
else if (process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF) {
|
|
23
|
-
platformEnvironment = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF;
|
|
24
|
-
}
|
|
25
|
-
// Vercel - Backend
|
|
26
|
-
else if (process.env.VERCEL_GIT_COMMIT_REF) {
|
|
27
|
-
platformEnvironment = process.env.VERCEL_GIT_COMMIT_REF;
|
|
28
|
-
}
|
|
29
|
-
switch (platformEnvironment) {
|
|
30
|
-
case 'development':
|
|
31
|
-
response = environments_1.default.DEVELOPMENT;
|
|
32
|
-
break;
|
|
33
|
-
case 'demo':
|
|
34
|
-
case 'preview':
|
|
35
|
-
case 'staging':
|
|
36
|
-
response = environments_1.default.STAGING;
|
|
37
|
-
break;
|
|
38
|
-
default:
|
|
39
|
-
response = environments_1.default.PRODUCTION;
|
|
40
|
-
}
|
|
41
|
-
return response;
|
|
42
|
-
};
|
|
43
|
-
exports.default = getEnvironment;
|
|
3
|
+
*/var getEnvironment=function(){var a,b=process.env.ENVIRONMENT;return process.env.EMS_ENVIRONMENT?b=process.env.EMS_ENVIRONMENT:process.env.NEXT_PUBLIC_EMS_ENVIRONMENT?b=process.env.NEXT_PUBLIC_EMS_ENVIRONMENT:process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF?b=process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF:process.env.VERCEL_GIT_COMMIT_REF&&(b=process.env.VERCEL_GIT_COMMIT_REF),a="development"===b?_environments["default"].DEVELOPMENT:"demo"===b||"preview"===b||"staging"===b?_environments["default"].STAGING:_environments["default"].PRODUCTION,a},_default=getEnvironment;exports["default"]=_default;
|
package/environment/isAws.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const platforms_1 = __importDefault(require("./platforms"));
|
|
7
|
-
/**
|
|
1
|
+
"use strict";var _platforms=_interopRequireDefault(require("./platforms"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/**
|
|
8
2
|
* Check to see if we are working on AWS Lambda.
|
|
9
|
-
*/
|
|
10
|
-
const isAws = () => platforms_1.default.AWS === process.env['EMS_PLATFORM'];
|
|
11
|
-
exports.default = isAws;
|
|
3
|
+
*/var isAws=function(){return _platforms["default"].AWS===process.env.EMS_PLATFORM},_default=isAws;exports["default"]=_default;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const environments_1 = __importDefault(require("./environments"));
|
|
7
|
-
const getEnvironment_1 = __importDefault(require("./getEnvironment"));
|
|
8
|
-
const isDevelopment = () => environments_1.default.DEVELOPMENT === (0, getEnvironment_1.default)();
|
|
9
|
-
exports.default = isDevelopment;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _environments=_interopRequireDefault(require("./environments")),_getEnvironment=_interopRequireDefault(require("./getEnvironment"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var isDevelopment=function(){return _environments["default"].DEVELOPMENT===(0,_getEnvironment["default"])()},_default=isDevelopment;exports["default"]=_default;
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const isAws_1 = __importDefault(require("./isAws"));
|
|
7
|
-
const isVercel_1 = __importDefault(require("./isVercel"));
|
|
8
|
-
/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _isAws=_interopRequireDefault(require("./isAws")),_isVercel=_interopRequireDefault(require("./isVercel"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/**
|
|
9
2
|
* Check to see if we are developing locally or on the hosted platform.
|
|
10
|
-
*/
|
|
11
|
-
const isLocalhost = () => {
|
|
12
|
-
let response = false;
|
|
13
|
-
if ((0, isAws_1.default)()) {
|
|
14
|
-
response = 'true' === process.env['AWS_SAM_LOCAL'];
|
|
15
|
-
}
|
|
16
|
-
else if ((0, isVercel_1.default)()) {
|
|
17
|
-
// This value needs to only be included in Vercel but undefined in locally
|
|
18
|
-
response = undefined === process.env['NEXT_PUBLIC_VERCEL_GIT_REPO_ID'];
|
|
19
|
-
}
|
|
20
|
-
return response;
|
|
21
|
-
};
|
|
22
|
-
exports.default = isLocalhost;
|
|
3
|
+
*/var isLocalhost=function(){var a=!1;return(0,_isAws["default"])()?a="true"===process.env.AWS_SAM_LOCAL:(0,_isVercel["default"])()&&(a=void 0===process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_ID),a},_default=isLocalhost;exports["default"]=_default;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const environments_1 = __importDefault(require("./environments"));
|
|
7
|
-
const getEnvironment_1 = __importDefault(require("./getEnvironment"));
|
|
8
|
-
const isProduction = () => environments_1.default.PRODUCTION === (0, getEnvironment_1.default)();
|
|
9
|
-
exports.default = isProduction;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _environments=_interopRequireDefault(require("./environments")),_getEnvironment=_interopRequireDefault(require("./getEnvironment"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var isProduction=function(){return _environments["default"].PRODUCTION===(0,_getEnvironment["default"])()},_default=isProduction;exports["default"]=_default;
|
package/environment/isStaging.js
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const environments_1 = __importDefault(require("./environments"));
|
|
7
|
-
const getEnvironment_1 = __importDefault(require("./getEnvironment"));
|
|
8
|
-
const isStaging = () => environments_1.default.STAGING === (0, getEnvironment_1.default)();
|
|
9
|
-
exports.default = isStaging;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _environments=_interopRequireDefault(require("./environments")),_getEnvironment=_interopRequireDefault(require("./getEnvironment"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}var isStaging=function(){return _environments["default"].STAGING===(0,_getEnvironment["default"])()},_default=isStaging;exports["default"]=_default;
|
package/environment/isVercel.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;/**
|
|
4
2
|
* Check to see if we are working on Vercel.
|
|
5
|
-
*/
|
|
6
|
-
const isVercel = () => undefined !== process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF;
|
|
7
|
-
exports.default = isVercel;
|
|
3
|
+
*/var isVercel=function(){return void 0!==process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF},_default=isVercel;exports["default"]=_default;
|
package/environment/platforms.js
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const platforms = {
|
|
4
|
-
AWS: 'aws',
|
|
5
|
-
VERCEL: 'vercel',
|
|
6
|
-
};
|
|
7
|
-
exports.default = platforms;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var platforms={AWS:"aws",VERCEL:"vercel"},_default=platforms;exports["default"]=_default;
|
package/eskimi/ageGroups.js
CHANGED
|
@@ -1,41 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ageGroups = [
|
|
4
|
-
{
|
|
5
|
-
"id": 0,
|
|
6
|
-
"name": "0-17",
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"id": 1,
|
|
10
|
-
"name": "18-24",
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"id": 2,
|
|
14
|
-
"name": "25-29",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"id": 3,
|
|
18
|
-
"name": "30-34",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"id": 4,
|
|
22
|
-
"name": "35-39",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"id": 5,
|
|
26
|
-
"name": "40-44",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"id": 6,
|
|
30
|
-
"name": "45-54",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"id": 7,
|
|
34
|
-
"name": "55-64",
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"id": 8,
|
|
38
|
-
"name": "65+",
|
|
39
|
-
},
|
|
40
|
-
];
|
|
41
|
-
exports.default = ageGroups;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var ageGroups=[{id:0,name:"0-17"},{id:1,name:"18-24"},{id:2,name:"25-29"},{id:3,name:"30-34"},{id:4,name:"35-39"},{id:5,name:"40-44"},{id:6,name:"45-54"},{id:7,name:"55-64"},{id:8,name:"65+"}],_default=ageGroups;exports["default"]=_default;
|
package/eskimi/campaign.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
package/eskimi/devices.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const devices = [
|
|
4
|
-
{
|
|
5
|
-
"id": 2,
|
|
6
|
-
"name": "Personal Computer",
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"id": 3,
|
|
10
|
-
"name": "Connected TV",
|
|
11
|
-
},
|
|
12
|
-
];
|
|
13
|
-
exports.default = devices;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var devices=[{id:2,name:"Personal Computer"},{id:3,name:"Connected TV"}],_default=devices;exports["default"]=_default;
|
package/eskimi/endpoints.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;/**
|
|
4
2
|
* https://dsp-api.eskimi.com/docs/api/v1/#api-Report-GetCampaignReportByAgeGroups
|
|
5
|
-
*/
|
|
6
|
-
const endpoints = {
|
|
7
|
-
campaign: {
|
|
8
|
-
age: 'https://dsp-api.eskimi.com/api/v1/report/ageGroups/get',
|
|
9
|
-
gender: 'https://dsp-api.eskimi.com/api/v1/report/genders/get',
|
|
10
|
-
list: 'https://dsp-api.eskimi.com/api/v1/campaign/get',
|
|
11
|
-
performance: 'https://dsp-api.eskimi.com/api/v1/report/campaigns/get',
|
|
12
|
-
video: 'https://dsp-api.eskimi.com/api/v1/report/videoCampaigns/get',
|
|
13
|
-
},
|
|
14
|
-
site: {
|
|
15
|
-
list: 'https://dsp-api.eskimi.com/api/v1/report/sites/get',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
exports.default = endpoints;
|
|
3
|
+
*/var endpoints={campaign:{age:"https://dsp-api.eskimi.com/api/v1/report/ageGroups/get",gender:"https://dsp-api.eskimi.com/api/v1/report/genders/get",list:"https://dsp-api.eskimi.com/api/v1/campaign/get",performance:"https://dsp-api.eskimi.com/api/v1/report/campaigns/get",video:"https://dsp-api.eskimi.com/api/v1/report/videoCampaigns/get"},site:{list:"https://dsp-api.eskimi.com/api/v1/report/sites/get"}},_default=endpoints;exports["default"]=_default;
|
package/eskimi/genders.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const genders = [
|
|
4
|
-
{
|
|
5
|
-
"id": 1,
|
|
6
|
-
"name": "Male",
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"id": 2,
|
|
10
|
-
"name": "Female",
|
|
11
|
-
},
|
|
12
|
-
];
|
|
13
|
-
exports.default = genders;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var genders=[{id:1,name:"Male"},{id:2,name:"Female"}],_default=genders;exports["default"]=_default;
|
package/eskimi/getAccessToken.js
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const getParameter_1 = __importDefault(require("../aws/ssm/getParameter"));
|
|
7
|
-
global.eskimiAccessToken = null;
|
|
8
|
-
/**
|
|
1
|
+
"use strict";var _getParameter=_interopRequireDefault(require("../aws/ssm/getParameter"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}global.eskimiAccessToken=null;/**
|
|
9
2
|
* Retrieve the access token from SSM Parameter Store.
|
|
10
|
-
*/
|
|
11
|
-
const getAccessToken = async ({ force, parameterName }) => {
|
|
12
|
-
if (!global.eskimiAccessToken || force) {
|
|
13
|
-
// Get the credentials from SSM
|
|
14
|
-
const parameter = await (0, getParameter_1.default)({
|
|
15
|
-
name: parameterName,
|
|
16
|
-
withDecryption: true,
|
|
17
|
-
isJson: true,
|
|
18
|
-
});
|
|
19
|
-
global.eskimiAccessToken = parameter.accessToken;
|
|
20
|
-
}
|
|
21
|
-
return global.eskimiAccessToken;
|
|
22
|
-
};
|
|
23
|
-
exports.default = getAccessToken;
|
|
3
|
+
*/var getAccessToken=/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e;return _regeneratorRuntime().wrap(function f(b){for(;1;)switch(b.prev=b.next){case 0:if(c=a.force,d=a.parameterName,global.eskimiAccessToken&&!c){b.next=6;break}return b.next=4,(0,_getParameter["default"])({name:d,withDecryption:!0,isJson:!0});case 4:e=b.sent,global.eskimiAccessToken=e.accessToken;case 6:return b.abrupt("return",global.eskimiAccessToken);case 7:case"end":return b.stop();}},b)}));return function getAccessToken(b){return a.apply(this,arguments)}}(),_default=getAccessToken;exports["default"]=_default;
|
package/eskimi/getAgeGroup.js
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const ageGroups_1 = __importDefault(require("./ageGroups"));
|
|
7
|
-
/**
|
|
1
|
+
"use strict";var _ageGroups=_interopRequireDefault(require("./ageGroups"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/**
|
|
8
2
|
* Map the Age Group and return the user-friendly string.
|
|
9
|
-
*/
|
|
10
|
-
const getAgeGroup = ({ input }) => {
|
|
11
|
-
const matches = ageGroups_1.default.filter(group => group.id === input);
|
|
12
|
-
if (1 === matches.length) {
|
|
13
|
-
return matches[0].name;
|
|
14
|
-
}
|
|
15
|
-
return 'Undefined';
|
|
16
|
-
};
|
|
17
|
-
exports.default = getAgeGroup;
|
|
3
|
+
*/var getAgeGroup=function(a){var b=a.input,c=_ageGroups["default"].filter(function(a){return a.id===b});return 1===c.length?c[0].name:"Undefined"},_default=getAgeGroup;exports["default"]=_default;
|
package/eskimi/getCampaignIds.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;/**
|
|
4
2
|
* Convert the Regex of Campaign Ids into an array of integers.
|
|
5
|
-
*/
|
|
6
|
-
const getCampaignIds = ({ accounts }) => {
|
|
7
|
-
return accounts[0].campaignIdRegex.replace('(', '')
|
|
8
|
-
.replace(')', '')
|
|
9
|
-
.split('|')
|
|
10
|
-
.map(id => parseInt(id));
|
|
11
|
-
};
|
|
12
|
-
exports.default = getCampaignIds;
|
|
3
|
+
*/var getCampaignIds=function(a){var b=a.accounts;return b[0].campaignIdRegex.replace("(","").replace(")","").split("|").map(function(a){return parseInt(a)})},_default=getCampaignIds;exports["default"]=_default;
|
package/eskimi/getDevice.js
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const devices_1 = __importDefault(require("./devices"));
|
|
7
|
-
/**
|
|
1
|
+
"use strict";var _devices=_interopRequireDefault(require("./devices"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/**
|
|
8
2
|
* Map the Devices and return the user-friendly string.
|
|
9
|
-
*/
|
|
10
|
-
const getDevice = ({ input }) => {
|
|
11
|
-
const matches = devices_1.default.filter(device => device.id === input);
|
|
12
|
-
if (1 === matches.length) {
|
|
13
|
-
return matches[0].name;
|
|
14
|
-
}
|
|
15
|
-
return 'Undefined';
|
|
16
|
-
};
|
|
17
|
-
exports.default = getDevice;
|
|
3
|
+
*/var getDevice=function(a){var b=a.input,c=_devices["default"].filter(function(a){return a.id===b});return 1===c.length?c[0].name:"Undefined"},_default=getDevice;exports["default"]=_default;
|
package/eskimi/getGender.js
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const genders_1 = __importDefault(require("./genders"));
|
|
7
|
-
/**
|
|
1
|
+
"use strict";var _genders=_interopRequireDefault(require("./genders"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/**
|
|
8
2
|
* Map the Gender and return the user-friendly string.
|
|
9
|
-
*/
|
|
10
|
-
const getGender = ({ input }) => {
|
|
11
|
-
const matches = genders_1.default.filter(gender => gender.id === input);
|
|
12
|
-
if (1 === matches.length) {
|
|
13
|
-
return matches[0].name;
|
|
14
|
-
}
|
|
15
|
-
return 'Undefined';
|
|
16
|
-
};
|
|
17
|
-
exports.default = getGender;
|
|
3
|
+
*/var getGender=function(a){var b=a.input,c=_genders["default"].filter(function(a){return a.id===b});return 1===c.length?c[0].name:"Undefined"},_default=getGender;exports["default"]=_default;
|
package/eskimi/request.js
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const post_1 = __importDefault(require("../axios/post"));
|
|
7
|
-
/**
|
|
1
|
+
"use strict";var _post=_interopRequireDefault(require("../axios/post"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}/**
|
|
8
2
|
* Make the request to Eskimi API using the access token.
|
|
9
|
-
*/
|
|
10
|
-
const request = async ({ data, url }) => {
|
|
11
|
-
const response = await (0, post_1.default)({
|
|
12
|
-
config: {
|
|
13
|
-
headers: {
|
|
14
|
-
Authorization: `Bearer ${global.eskimiAccessToken}`,
|
|
15
|
-
"Content-Type": "application/json",
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
data: data,
|
|
19
|
-
onSuccess: response => response.data,
|
|
20
|
-
url: url,
|
|
21
|
-
});
|
|
22
|
-
return response;
|
|
23
|
-
};
|
|
24
|
-
exports.default = request;
|
|
3
|
+
*/var request=/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e;return _regeneratorRuntime().wrap(function f(b){for(;1;)switch(b.prev=b.next){case 0:return c=a.data,d=a.url,b.next=3,(0,_post["default"])({config:{headers:{Authorization:"Bearer ".concat(global.eskimiAccessToken),"Content-Type":"application/json"}},data:c,onSuccess:function b(a){return a.data},url:d});case 3:return e=b.sent,b.abrupt("return",e);case 5:case"end":return b.stop();}},b)}));return function request(b){return a.apply(this,arguments)}}(),_default=request;exports["default"]=_default;
|
package/globals.d.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -1,22 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const getConfig_1 = __importDefault(require("../getConfig"));
|
|
7
|
-
global.googleBigQueryClient = {};
|
|
8
|
-
/**
|
|
1
|
+
"use strict";var _getConfig=_interopRequireDefault(require("../getConfig"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}global.googleBigQueryClient={};/**
|
|
9
2
|
* Initialise the Big Query client.
|
|
10
3
|
* It's possible to use multiple clients, so we set one up per project id.
|
|
11
|
-
*/
|
|
12
|
-
const initClient = ({ parameter, projectId }) => {
|
|
13
|
-
if (!global.googleBigQueryClient[projectId]) {
|
|
14
|
-
const { BigQuery } = require('@google-cloud/bigquery');
|
|
15
|
-
const formattedConfig = (0, getConfig_1.default)({ parameter });
|
|
16
|
-
global.googleBigQueryClient[projectId] = new BigQuery({
|
|
17
|
-
credentials: formattedConfig,
|
|
18
|
-
projectId: projectId,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.default = initClient;
|
|
4
|
+
*/var initClient=function(a){var b=a.parameter,c=a.projectId;if(!global.googleBigQueryClient[c]){var d=require("@google-cloud/bigquery"),e=d.BigQuery,f=(0,_getConfig["default"])({parameter:b});global.googleBigQueryClient[c]=new e({credentials:f,projectId:c})}},_default=initClient;exports["default"]=_default;
|
package/google/bigQuery/query.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
1
|
+
"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}/**
|
|
4
2
|
* Build the query and return the data.
|
|
5
|
-
*/
|
|
6
|
-
const query = async ({ projectId, query }) => {
|
|
7
|
-
const apiResponse = await global.googleBigQueryClient[projectId].query(query);
|
|
8
|
-
return apiResponse;
|
|
9
|
-
};
|
|
10
|
-
exports.default = query;
|
|
3
|
+
*/var query=/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e;return _regeneratorRuntime().wrap(function f(b){for(;1;)switch(b.prev=b.next){case 0:return c=a.projectId,d=a.query,b.next=3,global.googleBigQueryClient[c].query(d);case 3:return e=b.sent,b.abrupt("return",e);case 5:case"end":return b.stop();}},b)}));return function query(b){return a.apply(this,arguments)}}(),_default=query;exports["default"]=_default;
|
package/google/getConfig.js
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;// Same input as output, except formatting differences for Private Key.
|
|
3
2
|
/**
|
|
4
3
|
* Using the response from Parameter Store and format it ready to be used with Google API.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// Format the private key to be in the same format as required by Google
|
|
8
|
-
const privateKey = parameter['private_key'].replace(/\\n/g, '\n');
|
|
9
|
-
const response = {
|
|
10
|
-
type: parameter['type'],
|
|
11
|
-
project_id: parameter['project_id'],
|
|
12
|
-
private_key_id: parameter['private_key_id'],
|
|
13
|
-
private_key: privateKey,
|
|
14
|
-
client_email: parameter['client_email'],
|
|
15
|
-
client_id: parameter['client_id'],
|
|
16
|
-
auth_uri: parameter['auth_uri'],
|
|
17
|
-
token_uri: parameter['token_uri'],
|
|
18
|
-
auth_provider_x509_cert_url: parameter['auth_provider_x509_cert_url'],
|
|
19
|
-
client_x509_cert_url: parameter['client_x509_cert_url'],
|
|
20
|
-
};
|
|
21
|
-
return response;
|
|
22
|
-
};
|
|
23
|
-
exports.default = getConfig;
|
|
4
|
+
*/var getConfig=function(a){// Format the private key to be in the same format as required by Google
|
|
5
|
+
var b=a.private_key.replace(/\\n/g,"\n"),c={type:a.type,project_id:a.project_id,private_key_id:a.private_key_id,private_key:b,client_email:a.client_email,client_id:a.client_id,auth_uri:a.auth_uri,token_uri:a.token_uri,auth_provider_x509_cert_url:a.auth_provider_x509_cert_url,client_x509_cert_url:a.client_x509_cert_url};return c},_default=getConfig;exports["default"]=_default;
|