@adtrackify/at-service-common 2.0.12 → 2.0.13
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/dist/cjs/__tests__/helpers/subscription-helper.spec.d.ts +1 -1
- package/dist/cjs/__tests__/helpers/subscription-helper.spec.js +52 -52
- package/dist/cjs/__tests__/s3-client/s3-client.spec.d.ts +1 -1
- package/dist/cjs/__tests__/s3-client/s3-client.spec.js +26 -26
- package/dist/cjs/clients/generic/cognito-client.d.ts +19 -19
- package/dist/cjs/clients/generic/cognito-client.js +144 -144
- package/dist/cjs/clients/generic/dynamodb-client.d.ts +15 -15
- package/dist/cjs/clients/generic/dynamodb-client.js +124 -124
- package/dist/cjs/clients/generic/eventbridge-client.d.ts +14 -14
- package/dist/cjs/clients/generic/eventbridge-client.js +49 -49
- package/dist/cjs/clients/generic/http-client.d.ts +30 -30
- package/dist/cjs/clients/generic/http-client.js +35 -35
- package/dist/cjs/clients/generic/index.d.ts +6 -6
- package/dist/cjs/clients/generic/index.js +22 -22
- package/dist/cjs/clients/generic/s3-client.d.ts +14 -14
- package/dist/cjs/clients/generic/s3-client.js +82 -82
- package/dist/cjs/clients/generic/sqs-client.d.ts +14 -14
- package/dist/cjs/clients/generic/sqs-client.js +38 -38
- package/dist/cjs/clients/index.d.ts +3 -3
- package/dist/cjs/clients/index.js +19 -19
- package/dist/cjs/clients/internal-api/accounts-client.d.ts +82 -82
- package/dist/cjs/clients/internal-api/accounts-client.js +82 -82
- package/dist/cjs/clients/internal-api/destinations-client.d.ts +54 -54
- package/dist/cjs/clients/internal-api/destinations-client.js +40 -40
- package/dist/cjs/clients/internal-api/identity-client.d.ts +7 -7
- package/dist/cjs/clients/internal-api/identity-client.js +41 -41
- package/dist/cjs/clients/internal-api/index.d.ts +5 -5
- package/dist/cjs/clients/internal-api/index.js +21 -21
- package/dist/cjs/clients/internal-api/shopify-app-install-client.d.ts +57 -57
- package/dist/cjs/clients/internal-api/shopify-app-install-client.js +49 -49
- package/dist/cjs/clients/internal-api/users-auth-client.d.ts +61 -61
- package/dist/cjs/clients/internal-api/users-auth-client.js +77 -77
- package/dist/cjs/clients/third-party/index.d.ts +1 -1
- package/dist/cjs/clients/third-party/index.js +17 -17
- package/dist/cjs/clients/third-party/shopify-client.d.ts +90 -90
- package/dist/cjs/clients/third-party/shopify-client.js +125 -125
- package/dist/cjs/helpers/index.d.ts +5 -5
- package/dist/cjs/helpers/index.js +21 -21
- package/dist/cjs/helpers/input-validation-helper.d.ts +2 -2
- package/dist/cjs/helpers/input-validation-helper.js +22 -22
- package/dist/cjs/helpers/logging-helper.d.ts +15 -15
- package/dist/cjs/helpers/logging-helper.js +80 -80
- package/dist/cjs/helpers/response-helper.d.ts +36 -36
- package/dist/cjs/helpers/response-helper.js +41 -41
- package/dist/cjs/helpers/shopify-helper.d.ts +9 -9
- package/dist/cjs/helpers/shopify-helper.js +28 -28
- package/dist/cjs/helpers/subscription-helper.d.ts +8 -8
- package/dist/cjs/helpers/subscription-helper.js +104 -104
- package/dist/cjs/index.d.ts +5 -5
- package/dist/cjs/index.js +21 -21
- package/dist/cjs/libs/clickId-parser.d.ts +23 -18
- package/dist/cjs/libs/clickId-parser.js +49 -38
- package/dist/cjs/libs/clickId-parser.js.map +1 -1
- package/dist/cjs/libs/crypto.d.ts +1 -1
- package/dist/cjs/libs/crypto.js +12 -12
- package/dist/cjs/libs/dates.d.ts +3 -3
- package/dist/cjs/libs/dates.js +16 -16
- package/dist/cjs/libs/http-error.d.ts +21 -21
- package/dist/cjs/libs/http-error.js +59 -59
- package/dist/cjs/libs/http-status-codes.d.ts +58 -58
- package/dist/cjs/libs/http-status-codes.js +62 -62
- package/dist/cjs/libs/index.d.ts +8 -8
- package/dist/cjs/libs/index.js +24 -24
- package/dist/cjs/libs/referrer-parser/index.d.ts +2 -2
- package/dist/cjs/libs/referrer-parser/index.js +18 -18
- package/dist/cjs/libs/referrer-parser/referrer-data.d.ts +9 -9
- package/dist/cjs/libs/referrer-parser/referrer-data.js +4712 -4712
- package/dist/cjs/libs/referrer-parser/referrer-parser-util.d.ts +20 -20
- package/dist/cjs/libs/referrer-parser/referrer-parser-util.js +123 -123
- package/dist/cjs/libs/url.d.ts +1 -1
- package/dist/cjs/libs/url.js +13 -13
- package/dist/cjs/services/eventbridge-integration-service.d.ts +9 -9
- package/dist/cjs/services/eventbridge-integration-service.js +28 -28
- package/dist/cjs/services/index.d.ts +4 -4
- package/dist/cjs/services/index.js +20 -20
- package/dist/cjs/services/ipdata-lookup-service.d.ts +8 -8
- package/dist/cjs/services/ipdata-lookup-service.js +59 -59
- package/dist/cjs/services/log-event-service.d.ts +9 -9
- package/dist/cjs/services/log-event-service.js +50 -50
- package/dist/cjs/services/metric-event-service.d.ts +9 -9
- package/dist/cjs/services/metric-event-service.js +49 -49
- package/dist/cjs/types/api-response.d.ts +6 -6
- package/dist/cjs/types/api-response.js +2 -2
- package/dist/cjs/types/index.d.ts +1 -1
- package/dist/cjs/types/index.js +17 -17
- package/dist/cjs/types/internal-events/event-detail-types.d.ts +20 -20
- package/dist/cjs/types/internal-events/event-detail-types.js +27 -27
- package/dist/cjs/types/internal-events/index.d.ts +1 -1
- package/dist/cjs/types/internal-events/index.js +17 -17
- package/dist/esm/__tests__/helpers/subscription-helper.spec.d.ts +1 -1
- package/dist/esm/__tests__/helpers/subscription-helper.spec.js +27 -27
- package/dist/esm/__tests__/s3-client/s3-client.spec.d.ts +1 -1
- package/dist/esm/__tests__/s3-client/s3-client.spec.js +24 -24
- package/dist/esm/clients/generic/cognito-client.d.ts +19 -19
- package/dist/esm/clients/generic/cognito-client.js +139 -139
- package/dist/esm/clients/generic/dynamodb-client.d.ts +15 -15
- package/dist/esm/clients/generic/dynamodb-client.js +120 -120
- package/dist/esm/clients/generic/eventbridge-client.d.ts +14 -14
- package/dist/esm/clients/generic/eventbridge-client.js +45 -45
- package/dist/esm/clients/generic/http-client.d.ts +30 -30
- package/dist/esm/clients/generic/http-client.js +28 -28
- package/dist/esm/clients/generic/index.d.ts +6 -6
- package/dist/esm/clients/generic/index.js +6 -6
- package/dist/esm/clients/generic/s3-client.d.ts +14 -14
- package/dist/esm/clients/generic/s3-client.js +78 -78
- package/dist/esm/clients/generic/sqs-client.d.ts +14 -14
- package/dist/esm/clients/generic/sqs-client.js +34 -34
- package/dist/esm/clients/index.d.ts +3 -3
- package/dist/esm/clients/index.js +3 -3
- package/dist/esm/clients/internal-api/accounts-client.d.ts +82 -82
- package/dist/esm/clients/internal-api/accounts-client.js +78 -78
- package/dist/esm/clients/internal-api/destinations-client.d.ts +54 -54
- package/dist/esm/clients/internal-api/destinations-client.js +36 -36
- package/dist/esm/clients/internal-api/identity-client.d.ts +7 -7
- package/dist/esm/clients/internal-api/identity-client.js +37 -37
- package/dist/esm/clients/internal-api/index.d.ts +5 -5
- package/dist/esm/clients/internal-api/index.js +5 -5
- package/dist/esm/clients/internal-api/shopify-app-install-client.d.ts +57 -57
- package/dist/esm/clients/internal-api/shopify-app-install-client.js +42 -42
- package/dist/esm/clients/internal-api/users-auth-client.d.ts +61 -61
- package/dist/esm/clients/internal-api/users-auth-client.js +73 -73
- package/dist/esm/clients/third-party/index.d.ts +1 -1
- package/dist/esm/clients/third-party/index.js +1 -1
- package/dist/esm/clients/third-party/shopify-client.d.ts +90 -90
- package/dist/esm/clients/third-party/shopify-client.js +121 -121
- package/dist/esm/helpers/index.d.ts +5 -5
- package/dist/esm/helpers/index.js +5 -5
- package/dist/esm/helpers/input-validation-helper.d.ts +2 -2
- package/dist/esm/helpers/input-validation-helper.js +18 -18
- package/dist/esm/helpers/logging-helper.d.ts +15 -15
- package/dist/esm/helpers/logging-helper.js +53 -53
- package/dist/esm/helpers/response-helper.d.ts +36 -36
- package/dist/esm/helpers/response-helper.js +35 -35
- package/dist/esm/helpers/shopify-helper.d.ts +9 -9
- package/dist/esm/helpers/shopify-helper.js +23 -23
- package/dist/esm/helpers/subscription-helper.d.ts +8 -8
- package/dist/esm/helpers/subscription-helper.js +99 -99
- package/dist/esm/index.d.ts +5 -5
- package/dist/esm/index.js +5 -5
- package/dist/esm/libs/clickId-parser.d.ts +23 -18
- package/dist/esm/libs/clickId-parser.js +45 -34
- package/dist/esm/libs/clickId-parser.js.map +1 -1
- package/dist/esm/libs/crypto.d.ts +1 -1
- package/dist/esm/libs/crypto.js +5 -5
- package/dist/esm/libs/dates.d.ts +3 -3
- package/dist/esm/libs/dates.js +10 -10
- package/dist/esm/libs/http-error.d.ts +21 -21
- package/dist/esm/libs/http-error.js +55 -55
- package/dist/esm/libs/http-status-codes.d.ts +58 -58
- package/dist/esm/libs/http-status-codes.js +59 -59
- package/dist/esm/libs/index.d.ts +8 -8
- package/dist/esm/libs/index.js +8 -8
- package/dist/esm/libs/referrer-parser/index.d.ts +2 -2
- package/dist/esm/libs/referrer-parser/index.js +2 -2
- package/dist/esm/libs/referrer-parser/referrer-data.d.ts +9 -9
- package/dist/esm/libs/referrer-parser/referrer-data.js +4709 -4709
- package/dist/esm/libs/referrer-parser/referrer-parser-util.d.ts +20 -20
- package/dist/esm/libs/referrer-parser/referrer-parser-util.js +116 -116
- package/dist/esm/libs/url.d.ts +1 -1
- package/dist/esm/libs/url.js +9 -9
- package/dist/esm/services/eventbridge-integration-service.d.ts +9 -9
- package/dist/esm/services/eventbridge-integration-service.js +24 -24
- package/dist/esm/services/index.d.ts +4 -4
- package/dist/esm/services/index.js +4 -4
- package/dist/esm/services/ipdata-lookup-service.d.ts +8 -8
- package/dist/esm/services/ipdata-lookup-service.js +55 -55
- package/dist/esm/services/log-event-service.d.ts +9 -9
- package/dist/esm/services/log-event-service.js +46 -46
- package/dist/esm/services/metric-event-service.d.ts +9 -9
- package/dist/esm/services/metric-event-service.js +45 -45
- package/dist/esm/types/api-response.d.ts +6 -6
- package/dist/esm/types/api-response.js +1 -1
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/internal-events/event-detail-types.d.ts +20 -20
- package/dist/esm/types/internal-events/event-detail-types.js +24 -24
- package/dist/esm/types/internal-events/index.d.ts +1 -1
- package/dist/esm/types/internal-events/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildResponse = exports.failure = exports.success = void 0;
|
|
4
|
-
const success = (body) => {
|
|
5
|
-
return (0, exports.buildResponse)(200, body);
|
|
6
|
-
};
|
|
7
|
-
exports.success = success;
|
|
8
|
-
const defaultError = {
|
|
9
|
-
message: 'internalServerError'
|
|
10
|
-
};
|
|
11
|
-
const failure = (error, statusCode = 500) => {
|
|
12
|
-
statusCode = error?.statusCode ?? statusCode;
|
|
13
|
-
let body = defaultError;
|
|
14
|
-
if (error?.body) {
|
|
15
|
-
body = error.body;
|
|
16
|
-
}
|
|
17
|
-
else if (error?.message) {
|
|
18
|
-
body = { message: error.message };
|
|
19
|
-
}
|
|
20
|
-
else if (statusCode === 500) {
|
|
21
|
-
body = defaultError;
|
|
22
|
-
}
|
|
23
|
-
return (0, exports.buildResponse)(statusCode, body);
|
|
24
|
-
};
|
|
25
|
-
exports.failure = failure;
|
|
26
|
-
const buildResponse = (statusCode, body = {}) => {
|
|
27
|
-
delete body.stack;
|
|
28
|
-
return {
|
|
29
|
-
statusCode: statusCode,
|
|
30
|
-
headers: {
|
|
31
|
-
'Access-Control-Allow-Origin': '*',
|
|
32
|
-
'Access-Control-Allow-Credentials': true,
|
|
33
|
-
'cache-control': 'max-age=86400',
|
|
34
|
-
Date: new Date(),
|
|
35
|
-
'Last-Modified': new Date(),
|
|
36
|
-
'Access-Control-Allow-Headers': 'Content-Type, Content-Encoding'
|
|
37
|
-
},
|
|
38
|
-
body: JSON.stringify(body),
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
exports.buildResponse = buildResponse;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildResponse = exports.failure = exports.success = void 0;
|
|
4
|
+
const success = (body) => {
|
|
5
|
+
return (0, exports.buildResponse)(200, body);
|
|
6
|
+
};
|
|
7
|
+
exports.success = success;
|
|
8
|
+
const defaultError = {
|
|
9
|
+
message: 'internalServerError'
|
|
10
|
+
};
|
|
11
|
+
const failure = (error, statusCode = 500) => {
|
|
12
|
+
statusCode = error?.statusCode ?? statusCode;
|
|
13
|
+
let body = defaultError;
|
|
14
|
+
if (error?.body) {
|
|
15
|
+
body = error.body;
|
|
16
|
+
}
|
|
17
|
+
else if (error?.message) {
|
|
18
|
+
body = { message: error.message };
|
|
19
|
+
}
|
|
20
|
+
else if (statusCode === 500) {
|
|
21
|
+
body = defaultError;
|
|
22
|
+
}
|
|
23
|
+
return (0, exports.buildResponse)(statusCode, body);
|
|
24
|
+
};
|
|
25
|
+
exports.failure = failure;
|
|
26
|
+
const buildResponse = (statusCode, body = {}) => {
|
|
27
|
+
delete body.stack;
|
|
28
|
+
return {
|
|
29
|
+
statusCode: statusCode,
|
|
30
|
+
headers: {
|
|
31
|
+
'Access-Control-Allow-Origin': '*',
|
|
32
|
+
'Access-Control-Allow-Credentials': true,
|
|
33
|
+
'cache-control': 'max-age=86400',
|
|
34
|
+
Date: new Date(),
|
|
35
|
+
'Last-Modified': new Date(),
|
|
36
|
+
'Access-Control-Allow-Headers': 'Content-Type, Content-Encoding'
|
|
37
|
+
},
|
|
38
|
+
body: JSON.stringify(body),
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
exports.buildResponse = buildResponse;
|
|
42
42
|
//# sourceMappingURL=response-helper.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export interface ShopifyRequestValidationParameters {
|
|
2
|
-
code: string;
|
|
3
|
-
hmac?: string;
|
|
4
|
-
shop: string;
|
|
5
|
-
state: string;
|
|
6
|
-
timestamp: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const isShopifyRequestValid: (validationParams: ShopifyRequestValidationParameters, validationHmac: string, shopifyAppApiSecret: string) => boolean;
|
|
9
|
-
export declare const validateShopifyRequest: (validationParams: ShopifyRequestValidationParameters, validationHmac: string, shopifyAppApiSecret: string) => boolean;
|
|
1
|
+
export interface ShopifyRequestValidationParameters {
|
|
2
|
+
code: string;
|
|
3
|
+
hmac?: string;
|
|
4
|
+
shop: string;
|
|
5
|
+
state: string;
|
|
6
|
+
timestamp: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const isShopifyRequestValid: (validationParams: ShopifyRequestValidationParameters, validationHmac: string, shopifyAppApiSecret: string) => boolean;
|
|
9
|
+
export declare const validateShopifyRequest: (validationParams: ShopifyRequestValidationParameters, validationHmac: string, shopifyAppApiSecret: string) => boolean;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateShopifyRequest = exports.isShopifyRequestValid = void 0;
|
|
4
|
-
const crypto_1 = require("crypto");
|
|
5
|
-
const logging_helper_js_1 = require("./logging-helper.js");
|
|
6
|
-
const http_error_js_1 = require("../libs/http-error.js");
|
|
7
|
-
const url_js_1 = require("../libs/url.js");
|
|
8
|
-
const isShopifyRequestValid = (validationParams, validationHmac, shopifyAppApiSecret) => {
|
|
9
|
-
delete validationParams.hmac;
|
|
10
|
-
const hmacString = (0, url_js_1.mapObjectToQueryString)(validationParams);
|
|
11
|
-
const generatedHash = (0, crypto_1.createHmac)('sha256', shopifyAppApiSecret)
|
|
12
|
-
.update(hmacString)
|
|
13
|
-
.digest('hex');
|
|
14
|
-
return generatedHash === validationHmac;
|
|
15
|
-
};
|
|
16
|
-
exports.isShopifyRequestValid = isShopifyRequestValid;
|
|
17
|
-
const validateShopifyRequest = (validationParams, validationHmac, shopifyAppApiSecret) => {
|
|
18
|
-
logging_helper_js_1.Logger.info('Validating shopify request is authentic', { validationParams });
|
|
19
|
-
const isValid = (0, exports.isShopifyRequestValid)(validationParams, validationHmac, shopifyAppApiSecret);
|
|
20
|
-
if (!isValid) {
|
|
21
|
-
const message = 'Failed: Shopify Request hmac validation';
|
|
22
|
-
logging_helper_js_1.Logger.error(message);
|
|
23
|
-
throw http_error_js_1.HttpError.badRequest(message);
|
|
24
|
-
}
|
|
25
|
-
logging_helper_js_1.Logger.info('Sucess: Shopify Request hmac validation');
|
|
26
|
-
return true;
|
|
27
|
-
};
|
|
28
|
-
exports.validateShopifyRequest = validateShopifyRequest;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateShopifyRequest = exports.isShopifyRequestValid = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const logging_helper_js_1 = require("./logging-helper.js");
|
|
6
|
+
const http_error_js_1 = require("../libs/http-error.js");
|
|
7
|
+
const url_js_1 = require("../libs/url.js");
|
|
8
|
+
const isShopifyRequestValid = (validationParams, validationHmac, shopifyAppApiSecret) => {
|
|
9
|
+
delete validationParams.hmac;
|
|
10
|
+
const hmacString = (0, url_js_1.mapObjectToQueryString)(validationParams);
|
|
11
|
+
const generatedHash = (0, crypto_1.createHmac)('sha256', shopifyAppApiSecret)
|
|
12
|
+
.update(hmacString)
|
|
13
|
+
.digest('hex');
|
|
14
|
+
return generatedHash === validationHmac;
|
|
15
|
+
};
|
|
16
|
+
exports.isShopifyRequestValid = isShopifyRequestValid;
|
|
17
|
+
const validateShopifyRequest = (validationParams, validationHmac, shopifyAppApiSecret) => {
|
|
18
|
+
logging_helper_js_1.Logger.info('Validating shopify request is authentic', { validationParams });
|
|
19
|
+
const isValid = (0, exports.isShopifyRequestValid)(validationParams, validationHmac, shopifyAppApiSecret);
|
|
20
|
+
if (!isValid) {
|
|
21
|
+
const message = 'Failed: Shopify Request hmac validation';
|
|
22
|
+
logging_helper_js_1.Logger.error(message);
|
|
23
|
+
throw http_error_js_1.HttpError.badRequest(message);
|
|
24
|
+
}
|
|
25
|
+
logging_helper_js_1.Logger.info('Sucess: Shopify Request hmac validation');
|
|
26
|
+
return true;
|
|
27
|
+
};
|
|
28
|
+
exports.validateShopifyRequest = validateShopifyRequest;
|
|
29
29
|
//# sourceMappingURL=shopify-helper.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SubscriptionPlan } from '@adtrackify/at-tracking-event-types';
|
|
2
|
-
export declare const StripeBillingMap: any;
|
|
3
|
-
export declare const CommonPlanInfo: string[];
|
|
4
|
-
export declare const SubscriptionPlanSeedItems: {
|
|
5
|
-
items: SubscriptionPlan[];
|
|
6
|
-
};
|
|
7
|
-
export declare const getPlanDetails: (planId: number, stage: string) => SubscriptionPlan;
|
|
8
|
-
export declare const getPlanByStripePriceId: (stripePriceId: string, stage: string) => SubscriptionPlan;
|
|
1
|
+
import { SubscriptionPlan } from '@adtrackify/at-tracking-event-types';
|
|
2
|
+
export declare const StripeBillingMap: any;
|
|
3
|
+
export declare const CommonPlanInfo: string[];
|
|
4
|
+
export declare const SubscriptionPlanSeedItems: {
|
|
5
|
+
items: SubscriptionPlan[];
|
|
6
|
+
};
|
|
7
|
+
export declare const getPlanDetails: (planId: number, stage: string) => SubscriptionPlan;
|
|
8
|
+
export declare const getPlanByStripePriceId: (stripePriceId: string, stage: string) => SubscriptionPlan;
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPlanByStripePriceId = exports.getPlanDetails = exports.SubscriptionPlanSeedItems = exports.CommonPlanInfo = exports.StripeBillingMap = void 0;
|
|
4
|
-
const at_tracking_event_types_1 = require("@adtrackify/at-tracking-event-types");
|
|
5
|
-
exports.StripeBillingMap = {
|
|
6
|
-
dev2: {
|
|
7
|
-
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
8
|
-
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
9
|
-
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
10
|
-
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
11
|
-
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
12
|
-
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
13
|
-
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
14
|
-
},
|
|
15
|
-
qa2: {
|
|
16
|
-
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
17
|
-
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
18
|
-
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
19
|
-
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
20
|
-
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
21
|
-
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
22
|
-
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
23
|
-
},
|
|
24
|
-
prod2: {
|
|
25
|
-
'free': 'price_1KAFsIK7krGh4037RsaAYMEl',
|
|
26
|
-
'starter_monthly': 'price_1KAFsMK7krGh4037Lz3P0ksU',
|
|
27
|
-
'starter_yearly': 'price_1KAFsMK7krGh4037Dj1WmSi8',
|
|
28
|
-
'scale_monthly': 'price_1KAFrxK7krGh4037zWCdaTly',
|
|
29
|
-
'scale_yearly': 'price_1KAFrxK7krGh40375fhymyWP',
|
|
30
|
-
'growth_monthly': 'price_1KAFs7K7krGh4037JChjz5Cr',
|
|
31
|
-
'growth_yearly': 'price_1KAFs7K7krGh4037rZElg12s'
|
|
32
|
-
},
|
|
33
|
-
dev: {
|
|
34
|
-
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
35
|
-
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
36
|
-
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
37
|
-
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
38
|
-
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
39
|
-
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
40
|
-
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
41
|
-
},
|
|
42
|
-
qa: {
|
|
43
|
-
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
44
|
-
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
45
|
-
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
46
|
-
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
47
|
-
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
48
|
-
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
49
|
-
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
50
|
-
},
|
|
51
|
-
prod: {
|
|
52
|
-
'free': 'price_1KAFsIK7krGh4037RsaAYMEl',
|
|
53
|
-
'starter_monthly': 'price_1KAFsMK7krGh4037Lz3P0ksU',
|
|
54
|
-
'starter_yearly': 'price_1KAFsMK7krGh4037Dj1WmSi8',
|
|
55
|
-
'scale_monthly': 'price_1KAFrxK7krGh4037zWCdaTly',
|
|
56
|
-
'scale_yearly': 'price_1KAFrxK7krGh40375fhymyWP',
|
|
57
|
-
'growth_monthly': 'price_1KAFs7K7krGh4037JChjz5Cr',
|
|
58
|
-
'growth_yearly': 'price_1KAFs7K7krGh4037rZElg12s'
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
exports.CommonPlanInfo = [
|
|
62
|
-
'Free Server Side Tracking & Conversion API',
|
|
63
|
-
'MultiPixel Support (Multiple facebook, tiktok, etc)',
|
|
64
|
-
'Corrects Facebook Conversion Tracking post IOS14',
|
|
65
|
-
'Increase ROAS & Attribution Data',
|
|
66
|
-
'Enhanced Fingerprinting & Identity Resolution',
|
|
67
|
-
'Unlimited Integrations',
|
|
68
|
-
'Advanced Integrations (Webhooks, Custom JS/HTML, Hubspot)'
|
|
69
|
-
];
|
|
70
|
-
exports.SubscriptionPlanSeedItems = {
|
|
71
|
-
items: [{
|
|
72
|
-
id: 1,
|
|
73
|
-
planName: 'free',
|
|
74
|
-
displayName: 'Free',
|
|
75
|
-
sku: 'ADT-001',
|
|
76
|
-
description: 'Free Plan - Monthly',
|
|
77
|
-
price: '0',
|
|
78
|
-
displayPrice: '$0',
|
|
79
|
-
billingFrequency: at_tracking_event_types_1.PLAN_BILLING_FREQUENCY.MONTHLY,
|
|
80
|
-
trialLengthDays: 0,
|
|
81
|
-
trialRequiresCreditCard: false,
|
|
82
|
-
planDesc: [
|
|
83
|
-
...exports.CommonPlanInfo,
|
|
84
|
-
],
|
|
85
|
-
unitPriceText: 'try now - free plan',
|
|
86
|
-
isHighlighted: false,
|
|
87
|
-
isBanner: false
|
|
88
|
-
},
|
|
89
|
-
]
|
|
90
|
-
};
|
|
91
|
-
const getPlanDetails = (planId, stage) => {
|
|
92
|
-
const plan = exports.SubscriptionPlanSeedItems.items.filter(x => x.id === planId)[0];
|
|
93
|
-
plan.stripePriceId = exports.StripeBillingMap[stage][plan.planName];
|
|
94
|
-
return plan;
|
|
95
|
-
};
|
|
96
|
-
exports.getPlanDetails = getPlanDetails;
|
|
97
|
-
const getPlanByStripePriceId = (stripePriceId, stage) => {
|
|
98
|
-
const stripePriceIds = exports.StripeBillingMap[stage];
|
|
99
|
-
const planName = Object.keys(stripePriceIds).find(key => stripePriceIds[key] === stripePriceId);
|
|
100
|
-
const plan = exports.SubscriptionPlanSeedItems.items.filter(x => x.planName === planName)[0];
|
|
101
|
-
plan.stripePriceId = stripePriceId;
|
|
102
|
-
return plan;
|
|
103
|
-
};
|
|
104
|
-
exports.getPlanByStripePriceId = getPlanByStripePriceId;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPlanByStripePriceId = exports.getPlanDetails = exports.SubscriptionPlanSeedItems = exports.CommonPlanInfo = exports.StripeBillingMap = void 0;
|
|
4
|
+
const at_tracking_event_types_1 = require("@adtrackify/at-tracking-event-types");
|
|
5
|
+
exports.StripeBillingMap = {
|
|
6
|
+
dev2: {
|
|
7
|
+
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
8
|
+
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
9
|
+
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
10
|
+
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
11
|
+
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
12
|
+
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
13
|
+
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
14
|
+
},
|
|
15
|
+
qa2: {
|
|
16
|
+
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
17
|
+
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
18
|
+
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
19
|
+
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
20
|
+
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
21
|
+
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
22
|
+
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
23
|
+
},
|
|
24
|
+
prod2: {
|
|
25
|
+
'free': 'price_1KAFsIK7krGh4037RsaAYMEl',
|
|
26
|
+
'starter_monthly': 'price_1KAFsMK7krGh4037Lz3P0ksU',
|
|
27
|
+
'starter_yearly': 'price_1KAFsMK7krGh4037Dj1WmSi8',
|
|
28
|
+
'scale_monthly': 'price_1KAFrxK7krGh4037zWCdaTly',
|
|
29
|
+
'scale_yearly': 'price_1KAFrxK7krGh40375fhymyWP',
|
|
30
|
+
'growth_monthly': 'price_1KAFs7K7krGh4037JChjz5Cr',
|
|
31
|
+
'growth_yearly': 'price_1KAFs7K7krGh4037rZElg12s'
|
|
32
|
+
},
|
|
33
|
+
dev: {
|
|
34
|
+
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
35
|
+
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
36
|
+
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
37
|
+
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
38
|
+
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
39
|
+
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
40
|
+
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
41
|
+
},
|
|
42
|
+
qa: {
|
|
43
|
+
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
44
|
+
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
45
|
+
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
46
|
+
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
47
|
+
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
48
|
+
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
49
|
+
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
50
|
+
},
|
|
51
|
+
prod: {
|
|
52
|
+
'free': 'price_1KAFsIK7krGh4037RsaAYMEl',
|
|
53
|
+
'starter_monthly': 'price_1KAFsMK7krGh4037Lz3P0ksU',
|
|
54
|
+
'starter_yearly': 'price_1KAFsMK7krGh4037Dj1WmSi8',
|
|
55
|
+
'scale_monthly': 'price_1KAFrxK7krGh4037zWCdaTly',
|
|
56
|
+
'scale_yearly': 'price_1KAFrxK7krGh40375fhymyWP',
|
|
57
|
+
'growth_monthly': 'price_1KAFs7K7krGh4037JChjz5Cr',
|
|
58
|
+
'growth_yearly': 'price_1KAFs7K7krGh4037rZElg12s'
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.CommonPlanInfo = [
|
|
62
|
+
'Free Server Side Tracking & Conversion API',
|
|
63
|
+
'MultiPixel Support (Multiple facebook, tiktok, etc)',
|
|
64
|
+
'Corrects Facebook Conversion Tracking post IOS14',
|
|
65
|
+
'Increase ROAS & Attribution Data',
|
|
66
|
+
'Enhanced Fingerprinting & Identity Resolution',
|
|
67
|
+
'Unlimited Integrations',
|
|
68
|
+
'Advanced Integrations (Webhooks, Custom JS/HTML, Hubspot)'
|
|
69
|
+
];
|
|
70
|
+
exports.SubscriptionPlanSeedItems = {
|
|
71
|
+
items: [{
|
|
72
|
+
id: 1,
|
|
73
|
+
planName: 'free',
|
|
74
|
+
displayName: 'Free',
|
|
75
|
+
sku: 'ADT-001',
|
|
76
|
+
description: 'Free Plan - Monthly',
|
|
77
|
+
price: '0',
|
|
78
|
+
displayPrice: '$0',
|
|
79
|
+
billingFrequency: at_tracking_event_types_1.PLAN_BILLING_FREQUENCY.MONTHLY,
|
|
80
|
+
trialLengthDays: 0,
|
|
81
|
+
trialRequiresCreditCard: false,
|
|
82
|
+
planDesc: [
|
|
83
|
+
...exports.CommonPlanInfo,
|
|
84
|
+
],
|
|
85
|
+
unitPriceText: 'try now - free plan',
|
|
86
|
+
isHighlighted: false,
|
|
87
|
+
isBanner: false
|
|
88
|
+
},
|
|
89
|
+
]
|
|
90
|
+
};
|
|
91
|
+
const getPlanDetails = (planId, stage) => {
|
|
92
|
+
const plan = exports.SubscriptionPlanSeedItems.items.filter(x => x.id === planId)[0];
|
|
93
|
+
plan.stripePriceId = exports.StripeBillingMap[stage][plan.planName];
|
|
94
|
+
return plan;
|
|
95
|
+
};
|
|
96
|
+
exports.getPlanDetails = getPlanDetails;
|
|
97
|
+
const getPlanByStripePriceId = (stripePriceId, stage) => {
|
|
98
|
+
const stripePriceIds = exports.StripeBillingMap[stage];
|
|
99
|
+
const planName = Object.keys(stripePriceIds).find(key => stripePriceIds[key] === stripePriceId);
|
|
100
|
+
const plan = exports.SubscriptionPlanSeedItems.items.filter(x => x.planName === planName)[0];
|
|
101
|
+
plan.stripePriceId = stripePriceId;
|
|
102
|
+
return plan;
|
|
103
|
+
};
|
|
104
|
+
exports.getPlanByStripePriceId = getPlanByStripePriceId;
|
|
105
105
|
//# sourceMappingURL=subscription-helper.js.map
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './clients/index.js';
|
|
2
|
-
export * from './helpers/index.js';
|
|
3
|
-
export * from './libs/index.js';
|
|
4
|
-
export * from './types/index.js';
|
|
5
|
-
export * from './services/index.js';
|
|
1
|
+
export * from './clients/index.js';
|
|
2
|
+
export * from './helpers/index.js';
|
|
3
|
+
export * from './libs/index.js';
|
|
4
|
+
export * from './types/index.js';
|
|
5
|
+
export * from './services/index.js';
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./clients/index.js"), exports);
|
|
18
|
-
__exportStar(require("./helpers/index.js"), exports);
|
|
19
|
-
__exportStar(require("./libs/index.js"), exports);
|
|
20
|
-
__exportStar(require("./types/index.js"), exports);
|
|
21
|
-
__exportStar(require("./services/index.js"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./clients/index.js"), exports);
|
|
18
|
+
__exportStar(require("./helpers/index.js"), exports);
|
|
19
|
+
__exportStar(require("./libs/index.js"), exports);
|
|
20
|
+
__exportStar(require("./types/index.js"), exports);
|
|
21
|
+
__exportStar(require("./services/index.js"), exports);
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
export
|
|
15
|
-
mktClickParam
|
|
16
|
-
mktClickId
|
|
17
|
-
|
|
18
|
-
}
|
|
1
|
+
export declare enum CLICK_NETWORK {
|
|
2
|
+
GOOGLE = "Google",
|
|
3
|
+
FACEBOOK = "Facebook",
|
|
4
|
+
TIKTOK = "TikTok",
|
|
5
|
+
TWITTER = "Twitter",
|
|
6
|
+
SNAPCHAT = "Snapchat",
|
|
7
|
+
TABOOLA = "Taboola",
|
|
8
|
+
OUTBRAIN = "Outbrain",
|
|
9
|
+
MICROSOFT = "Microsoft"
|
|
10
|
+
}
|
|
11
|
+
export declare const ClickIdDictionary: {
|
|
12
|
+
[key: string]: CLICK_NETWORK;
|
|
13
|
+
};
|
|
14
|
+
export interface ParsedClickId {
|
|
15
|
+
mktClickParam?: string;
|
|
16
|
+
mktClickId?: string;
|
|
17
|
+
mkyClickNetwork?: CLICK_NETWORK;
|
|
18
|
+
}
|
|
19
|
+
export declare const parseClickId: (qsp: URLSearchParams) => {
|
|
20
|
+
mktClickParam: string;
|
|
21
|
+
mktClickId: string | null;
|
|
22
|
+
mktClickNetwork: CLICK_NETWORK;
|
|
23
|
+
} | undefined;
|
|
@@ -1,39 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseClickId = exports.ClickIdDictionary = void 0;
|
|
4
|
-
const at_shared_utils_1 = require("@adtrackify/at-shared-utils");
|
|
5
|
-
const helpers_1 = require("../helpers");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseClickId = exports.ClickIdDictionary = exports.CLICK_NETWORK = void 0;
|
|
4
|
+
const at_shared_utils_1 = require("@adtrackify/at-shared-utils");
|
|
5
|
+
const helpers_1 = require("../helpers");
|
|
6
|
+
var CLICK_NETWORK;
|
|
7
|
+
(function (CLICK_NETWORK) {
|
|
8
|
+
CLICK_NETWORK["GOOGLE"] = "Google";
|
|
9
|
+
CLICK_NETWORK["FACEBOOK"] = "Facebook";
|
|
10
|
+
CLICK_NETWORK["TIKTOK"] = "TikTok";
|
|
11
|
+
CLICK_NETWORK["TWITTER"] = "Twitter";
|
|
12
|
+
CLICK_NETWORK["SNAPCHAT"] = "Snapchat";
|
|
13
|
+
CLICK_NETWORK["TABOOLA"] = "Taboola";
|
|
14
|
+
CLICK_NETWORK["OUTBRAIN"] = "Outbrain";
|
|
15
|
+
CLICK_NETWORK["MICROSOFT"] = "Microsoft";
|
|
16
|
+
})(CLICK_NETWORK = exports.CLICK_NETWORK || (exports.CLICK_NETWORK = {}));
|
|
17
|
+
exports.ClickIdDictionary = {
|
|
18
|
+
'gclid': CLICK_NETWORK.GOOGLE,
|
|
19
|
+
'dclid': CLICK_NETWORK.GOOGLE,
|
|
20
|
+
'gbraid': CLICK_NETWORK.GOOGLE,
|
|
21
|
+
'wbraid': CLICK_NETWORK.GOOGLE,
|
|
22
|
+
'fbclid': CLICK_NETWORK.FACEBOOK,
|
|
23
|
+
'ttclid': CLICK_NETWORK.TIKTOK,
|
|
24
|
+
'twclid': CLICK_NETWORK.TWITTER,
|
|
25
|
+
'sccid': CLICK_NETWORK.SNAPCHAT,
|
|
26
|
+
'taboola_click_id': CLICK_NETWORK.TABOOLA,
|
|
27
|
+
'ob_click_id': CLICK_NETWORK.OUTBRAIN,
|
|
28
|
+
'microsoftclickid': CLICK_NETWORK.MICROSOFT,
|
|
29
|
+
};
|
|
30
|
+
const parseClickId = (qsp) => {
|
|
31
|
+
try {
|
|
32
|
+
if (!(0, at_shared_utils_1.isEmpty)(qsp)) {
|
|
33
|
+
for (const item of Object.entries(exports.ClickIdDictionary)) {
|
|
34
|
+
if (qsp.has(item?.[0])) {
|
|
35
|
+
return {
|
|
36
|
+
mktClickParam: item[0],
|
|
37
|
+
mktClickId: qsp.get(item[0]),
|
|
38
|
+
mktClickNetwork: item[1]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
helpers_1.Logger.warn('Unable to parse click ID', { error });
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.parseClickId = parseClickId;
|
|
39
50
|
//# sourceMappingURL=clickId-parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clickId-parser.js","sourceRoot":"","sources":["../../../src/libs/clickId-parser.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AACtD,wCAAoC;
|
|
1
|
+
{"version":3,"file":"clickId-parser.js","sourceRoot":"","sources":["../../../src/libs/clickId-parser.ts"],"names":[],"mappings":";;;AAAA,iEAAsD;AACtD,wCAAoC;AAEpC,IAAY,aASX;AATD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,wCAAuB,CAAA;AACzB,CAAC,EATW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QASxB;AAEY,QAAA,iBAAiB,GAE1B;IACF,OAAO,EAAE,aAAa,CAAC,MAAM;IAC7B,OAAO,EAAE,aAAa,CAAC,MAAM;IAC7B,QAAQ,EAAE,aAAa,CAAC,MAAM;IAC9B,QAAQ,EAAE,aAAa,CAAC,MAAM;IAC9B,QAAQ,EAAE,aAAa,CAAC,QAAQ;IAChC,QAAQ,EAAE,aAAa,CAAC,MAAM;IAC9B,QAAQ,EAAE,aAAa,CAAC,OAAO;IAC/B,OAAO,EAAE,aAAa,CAAC,QAAQ;IAC/B,kBAAkB,EAAE,aAAa,CAAC,OAAO;IACzC,aAAa,EAAE,aAAa,CAAC,QAAQ;IACrC,kBAAkB,EAAE,aAAa,CAAC,SAAS;CAC5C,CAAC;AASK,MAAM,YAAY,GAAG,CAAC,GAAoB,EAAE,EAAE;IACnD,IAAI;QACF,IAAI,CAAC,IAAA,yBAAO,EAAC,GAAG,CAAC,EAAE;YACjB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,OAAO,CAAC,yBAAiB,CAAC,EAAE;gBACpD,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;oBACtB,OAAO;wBACL,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;wBACtB,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;wBAC5B,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC;qBACzB,CAAC;iBACH;aACF;SACF;KACF;IAAC,OAAO,KAAK,EAAE;QACd,gBAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;QAClD,OAAO,SAAS,CAAA;KACjB;AACH,CAAC,CAAC;AAjBW,QAAA,YAAY,gBAiBvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const generatePublicKey: () => string;
|
|
1
|
+
export declare const generatePublicKey: () => string;
|
package/dist/cjs/libs/crypto.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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
|
-
exports.generatePublicKey = void 0;
|
|
7
|
-
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
-
const generatePublicKey = () => {
|
|
9
|
-
const publicKey = crypto_1.default.randomBytes(26);
|
|
10
|
-
return publicKey.toString('utf8');
|
|
11
|
-
};
|
|
12
|
-
exports.generatePublicKey = generatePublicKey;
|
|
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
|
+
exports.generatePublicKey = void 0;
|
|
7
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
8
|
+
const generatePublicKey = () => {
|
|
9
|
+
const publicKey = crypto_1.default.randomBytes(26);
|
|
10
|
+
return publicKey.toString('utf8');
|
|
11
|
+
};
|
|
12
|
+
exports.generatePublicKey = generatePublicKey;
|
|
13
13
|
//# sourceMappingURL=crypto.js.map
|
package/dist/cjs/libs/dates.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const getCurrentTimestamp: () => string;
|
|
2
|
-
export declare const getDateFromTimestamp: (timestamp: string) => string;
|
|
3
|
-
export declare const getCurrentDate: () => string;
|
|
1
|
+
export declare const getCurrentTimestamp: () => string;
|
|
2
|
+
export declare const getDateFromTimestamp: (timestamp: string) => string;
|
|
3
|
+
export declare const getCurrentDate: () => string;
|