@adtrackify/at-service-common 3.2.11 → 3.2.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/clients/internal-api/destinations-client.d.ts +7 -9
- package/dist/cjs/clients/internal-api/destinations-client.js +19 -22
- package/dist/cjs/clients/internal-api/destinations-client.js.map +1 -1
- package/dist/cjs/clients/internal-api/shopify-app-install-client.d.ts +1 -1
- package/dist/cjs/clients/internal-api/shopify-app-install-client.js +3 -3
- package/dist/cjs/clients/internal-api/shopify-app-install-client.js.map +1 -1
- package/dist/cjs/clients/internal-api/subscriptions-client.d.ts +2 -1
- package/dist/cjs/clients/internal-api/subscriptions-client.js +10 -5
- package/dist/cjs/clients/internal-api/subscriptions-client.js.map +1 -1
- package/dist/esm/clients/internal-api/destinations-client.d.ts +7 -9
- package/dist/esm/clients/internal-api/destinations-client.js +19 -22
- package/dist/esm/clients/internal-api/destinations-client.js.map +1 -1
- package/dist/esm/clients/internal-api/shopify-app-install-client.d.ts +1 -1
- package/dist/esm/clients/internal-api/shopify-app-install-client.js +3 -3
- package/dist/esm/clients/internal-api/shopify-app-install-client.js.map +1 -1
- package/dist/esm/clients/internal-api/subscriptions-client.d.ts +2 -1
- package/dist/esm/clients/internal-api/subscriptions-client.js +10 -5
- package/dist/esm/clients/internal-api/subscriptions-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiResponse } from '../../types/api-response.js';
|
|
2
|
+
import { GenericHttpClient } from '../generic/http-client.js';
|
|
2
3
|
import { DESTINATION_TYPE, Destination } from '@adtrackify/at-tracking-event-types';
|
|
3
4
|
export interface GetDestinationsResponseData {
|
|
4
5
|
destinations: Destination[];
|
|
@@ -11,17 +12,14 @@ export interface CreateDestinationResponseData {
|
|
|
11
12
|
export declare class DestinationsClient {
|
|
12
13
|
BASE_API_URL: string;
|
|
13
14
|
DESTINATIONS_API_KEY: string;
|
|
14
|
-
client:
|
|
15
|
+
client: GenericHttpClient;
|
|
16
|
+
SERVICE_API_ROOT_URL: string;
|
|
15
17
|
constructor(baseApiUrl: string, destinationsApiKey: string);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'x-api-key': string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
18
|
+
getHeaders: () => {
|
|
19
|
+
'x-api-key': string;
|
|
20
|
+
} | {
|
|
21
|
+
'x-api-key'?: undefined;
|
|
23
22
|
};
|
|
24
|
-
getClient: () => any;
|
|
25
23
|
createDestination: (createDestinationRequest: any) => Promise<ApiResponse<CreateDestinationResponseData>>;
|
|
26
24
|
updateDestination: (destinationId: string, body: any, notifyCustomerIO?: boolean) => Promise<ApiResponse<CreateDestinationResponseData>>;
|
|
27
25
|
getPixelDestinations: (pixelId: string) => Promise<ApiResponse<GetDestinationsResponseData>>;
|
|
@@ -3,50 +3,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DestinationsClient = void 0;
|
|
4
4
|
const index_js_1 = require("../../index.js");
|
|
5
5
|
const http_client_js_1 = require("../generic/http-client.js");
|
|
6
|
+
const client = (0, http_client_js_1.axiosHttpService)({
|
|
7
|
+
headers: {
|
|
8
|
+
'Content-Type': 'application/json',
|
|
9
|
+
},
|
|
10
|
+
});
|
|
6
11
|
class DestinationsClient {
|
|
7
12
|
BASE_API_URL;
|
|
8
13
|
DESTINATIONS_API_KEY;
|
|
9
14
|
client;
|
|
15
|
+
SERVICE_API_ROOT_URL;
|
|
10
16
|
constructor(baseApiUrl, destinationsApiKey) {
|
|
11
17
|
this.BASE_API_URL = baseApiUrl;
|
|
12
18
|
this.DESTINATIONS_API_KEY = destinationsApiKey;
|
|
19
|
+
this.SERVICE_API_ROOT_URL = `${this.BASE_API_URL}/destinations`;
|
|
20
|
+
this.client = client;
|
|
13
21
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
getClient = () => {
|
|
26
|
-
this.client = this.client ?? (0, http_client_js_1.axiosHttpService)(this.getConfig());
|
|
27
|
-
return this.client;
|
|
22
|
+
getHeaders = () => {
|
|
23
|
+
if (this.DESTINATIONS_API_KEY) {
|
|
24
|
+
return {
|
|
25
|
+
'x-api-key': this.DESTINATIONS_API_KEY
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return {};
|
|
28
29
|
};
|
|
29
30
|
createDestination = async (createDestinationRequest) => {
|
|
30
|
-
const
|
|
31
|
-
const response = await client.post('/admin', createDestinationRequest);
|
|
31
|
+
const response = await client.post(`${this.SERVICE_API_ROOT_URL}/admin`, createDestinationRequest, { headers: this.getHeaders() });
|
|
32
32
|
index_js_1.Logger.debug('createDestinationResponse', { response });
|
|
33
33
|
return response;
|
|
34
34
|
};
|
|
35
35
|
updateDestination = async (destinationId, body, notifyCustomerIO = true) => {
|
|
36
|
-
const
|
|
37
|
-
const response = await client.patch(`/${destinationId}/private?notifyCustomerIO=${notifyCustomerIO}`, body);
|
|
36
|
+
const response = await client.patch(`${this.SERVICE_API_ROOT_URL}/${destinationId}/private?notifyCustomerIO=${notifyCustomerIO}`, body, { headers: this.getHeaders() });
|
|
38
37
|
index_js_1.Logger.debug('updateDestinationResponse', { response });
|
|
39
38
|
return response;
|
|
40
39
|
};
|
|
41
40
|
getPixelDestinations = async (pixelId) => {
|
|
42
|
-
const
|
|
43
|
-
const response = await client.get(`/?pixelId=${pixelId}`);
|
|
41
|
+
const response = await client.get(`${this.SERVICE_API_ROOT_URL}/?pixelId=${pixelId}`, { headers: this.getHeaders() });
|
|
44
42
|
index_js_1.Logger.debug('getPixelResponse', { response });
|
|
45
43
|
return response;
|
|
46
44
|
};
|
|
47
45
|
getAllDestinationByDestinationType = async (destinationType, start) => {
|
|
48
|
-
const
|
|
49
|
-
const response = await client.get(`/list?destinationType=${destinationType}&start=${start}`);
|
|
46
|
+
const response = await client.get(`${this.SERVICE_API_ROOT_URL}/list?destinationType=${destinationType}&start=${start}`, { headers: this.getHeaders() });
|
|
50
47
|
index_js_1.Logger.debug('getAllDestinationByDestinationType', { response });
|
|
51
48
|
return response;
|
|
52
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destinations-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/destinations-client.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"destinations-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/destinations-client.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAExC,8DAAgF;AAYhF,MAAM,MAAM,GAAG,IAAA,iCAAgB,EAAC;IAE9B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAEH,MAAa,kBAAkB;IACtB,YAAY,CAAS;IACrB,oBAAoB,CAAS;IAC7B,MAAM,CAAoB;IAC1B,oBAAoB,CAAS;IACpC,YAAY,UAAkB,EAAE,kBAA0B;QACxD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC/B,IAAI,CAAC,oBAAoB,GAAG,kBAAkB,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,GAAG,IAAI,CAAC,YAAY,eAAe,CAAC;QAChE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,UAAU,GAAG,GAAG,EAAE;QAChB,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC7B,OAAO;gBACL,WAAW,EAAE,IAAI,CAAC,oBAAoB;aACvC,CAAC;SACH;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;IAGF,iBAAiB,GAAG,KAAK,EAAE,wBAA6B,EAAuD,EAAE;QAC/G,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,oB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K,CAAC,oCAAoC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACjE,OAAO,QAAoD,CAAC;IAC9D,CAAC,CAAA;CACF;AA7CD,gDA6CC"}
|
|
@@ -27,6 +27,6 @@ export declare class ShopifyAppInstallClient {
|
|
|
27
27
|
getShopifyAppInstall: (shopifyAppInstallId: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
|
|
28
28
|
getAllShopifyAppInstalls: (active?: boolean) => Promise<ApiResponse<ListShopifyAppInstallResponseData>>;
|
|
29
29
|
getShopifyAppInstallByShop: (shop: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
|
|
30
|
-
|
|
30
|
+
activateShopifyAppInstallPixelIdByShop: (shop: string, pixelId: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
|
|
31
31
|
cancelShopifyAppInstall: (shopifyAppInstallId: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
|
|
32
32
|
}
|
|
@@ -52,9 +52,9 @@ class ShopifyAppInstallClient {
|
|
|
52
52
|
lambda_log_1.default.info('getShopifyAppInstallByShop', { response });
|
|
53
53
|
return response;
|
|
54
54
|
};
|
|
55
|
-
|
|
56
|
-
const response = await client.post(`${this.SERVICE_API_ROOT_URL}/
|
|
57
|
-
lambda_log_1.default.info('
|
|
55
|
+
activateShopifyAppInstallPixelIdByShop = async (shop, pixelId) => {
|
|
56
|
+
const response = await client.post(`${this.SERVICE_API_ROOT_URL}/activate-pixel-id-by-shop`, { shop, pixelId }, { headers: this.getHeaders() });
|
|
57
|
+
lambda_log_1.default.info('activateShopifyAppInstallPixelIdByShop', { response });
|
|
58
58
|
return response;
|
|
59
59
|
};
|
|
60
60
|
cancelShopifyAppInstall = async (shopifyAppInstallId) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopify-app-install-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/shopify-app-install-client.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA6B;AAE7B,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G,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxD,OAAO,QAAsD,CAAC;IAChE,CAAC,CAAC;IAEF,oBAAoB,GAAG,KAAK,EAAE,mBAA2B,EAAuD,EAAE;QAChH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,oBAAoB,IAAI,mBAAmB,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACzH,oBAAG,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC/C,OAAO,QAAsD,CAAC;IAChE,CAAC,CAAC;IAEF,wBAAwB,GAAG,KAAK,EAAE,MAAM,GAAG,IAAI,EAA2D,EAAE;QAC1G,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,oBAAoB,gBAAgB,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACxH,oBAAG,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACrC,OAAO,QAA0D,CAAC;IACpE,CAAC,CAAC;IAEF,0BAA0B,GAAG,KAAK,EAAE,IAAY,EAAuD,EAAE;QACvG,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,oBAAoB,UAAU,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAChH,oBAAG,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrD,OAAO,QAAsD,CAAC;IAChE,CAAC,CAAC;IACF,
|
|
1
|
+
{"version":3,"file":"shopify-app-install-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/shopify-app-install-client.ts"],"names":[],"mappings":";;;;;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AAM,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,4BAA4B,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAChJ,oBAAG,CAAC,IAAI,CAAC,wCAAwC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACjE,OAAO,QAAsD,CAAC;IAChE,CAAC,CAAC;IACF,uBAAuB,GAAG,KAAK,EAAE,mBAA2B,EAAuD,EAAE;QACnH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,UAAU,mBAAmB,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAC9I,oBAAG,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAClD,OAAO,QAAsD,CAAC;IAChE,CAAC,CAAC;CACH;AA5DD,0DA4DC"}
|
|
@@ -15,7 +15,8 @@ export declare class SubscriptionsClient {
|
|
|
15
15
|
'x-api-key': string;
|
|
16
16
|
};
|
|
17
17
|
getSubscriptionByShopifyAppInstallId: (shopifyAppInstallId: string) => Promise<ApiResponse<SubscriptionResponseData>>;
|
|
18
|
+
cancelSubscriptionByShopifyAppInstallId: (shopifyAppInstallId: string) => Promise<ApiResponse<SubscriptionResponseData>>;
|
|
18
19
|
getSubscriptionById: (subscriptionId: string) => Promise<ApiResponse<SubscriptionResponseData>>;
|
|
19
|
-
cancelSubscription: (subscriptionId: string) => Promise<ApiResponse<SubscriptionResponseData>>;
|
|
20
20
|
updateSubscriptionStatus: (subscriptionId: string, status: SUBSCRIPTION_STATUS) => Promise<ApiResponse<SubscriptionResponseData>>;
|
|
21
|
+
cancelSubscription: (subscriptionId: string) => Promise<ApiResponse<SubscriptionResponseData>>;
|
|
21
22
|
}
|
|
@@ -33,21 +33,26 @@ class SubscriptionsClient {
|
|
|
33
33
|
lambda_log_1.default.debug('subscriptionResponse', { subscriptionResponse });
|
|
34
34
|
return subscriptionResponse;
|
|
35
35
|
};
|
|
36
|
+
cancelSubscriptionByShopifyAppInstallId = async (shopifyAppInstallId) => {
|
|
37
|
+
const subscriptionResponse = await client.post(`${this.SERVICE_API_ROOT_URL}/shopifyAppInstallId/${shopifyAppInstallId}/cancel`, { headers: this.getHeaders() });
|
|
38
|
+
index_js_1.Logger.debug('cancel subscription by shopify app install id response', { subscriptionResponse });
|
|
39
|
+
return subscriptionResponse;
|
|
40
|
+
};
|
|
36
41
|
getSubscriptionById = async (subscriptionId) => {
|
|
37
42
|
const subscriptionResponse = await client.get(`${this.SERVICE_API_ROOT_URL}/${subscriptionId}`, { headers: this.getHeaders() });
|
|
38
43
|
index_js_1.Logger.debug('subscriptionResponse', { subscriptionResponse });
|
|
39
44
|
return subscriptionResponse;
|
|
40
45
|
};
|
|
41
|
-
cancelSubscription = async (subscriptionId) => {
|
|
42
|
-
const subscriptionResponse = await client.post(`${this.SERVICE_API_ROOT_URL}/admin/${subscriptionId}/cancel`, { headers: this.getHeaders() });
|
|
43
|
-
index_js_1.Logger.debug('cancel subscription response', { subscriptionResponse });
|
|
44
|
-
return subscriptionResponse;
|
|
45
|
-
};
|
|
46
46
|
updateSubscriptionStatus = async (subscriptionId, status) => {
|
|
47
47
|
const subscriptionResponse = await client.post(`${this.SERVICE_API_ROOT_URL}/admin/${subscriptionId}/status`, { status }, { headers: this.getHeaders() });
|
|
48
48
|
index_js_1.Logger.debug('update subscription status response', { subscriptionResponse });
|
|
49
49
|
return subscriptionResponse;
|
|
50
50
|
};
|
|
51
|
+
cancelSubscription = async (subscriptionId) => {
|
|
52
|
+
const subscriptionResponse = await client.post(`${this.SERVICE_API_ROOT_URL}/admin/${subscriptionId}/cancel`, { headers: this.getHeaders() });
|
|
53
|
+
index_js_1.Logger.debug('cancel subscription response', { subscriptionResponse });
|
|
54
|
+
return subscriptionResponse;
|
|
55
|
+
};
|
|
51
56
|
}
|
|
52
57
|
exports.SubscriptionsClient = SubscriptionsClient;
|
|
53
58
|
//# sourceMappingURL=subscriptions-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/subscriptions-client.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA6B;AAC7B,8DAAgF;AAEhF,qDAAgD;AAGhD,MAAM,MAAM,GAAG,IAAA,iCAAgB,EAAC;IAE9B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAKH,MAAa,mBAAmB;IAEvB,YAAY,CAAS;IACrB,qBAAqB,CAAS;IAC9B,MAAM,CAAoB;IAC1B,oBAAoB,CAAS;IAEpC,YAAY,UAAkB,EAAE,mBAA2B;QACzD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC/B,IAAI,CAAC,qBAAqB,GAAG,mBAAmB,CAAC;QACjD,IAAI,CAAC,oBAAoB,GAAG,GAAG,IAAI,CAAC,YAAY,gBAAgB,CAAC;QACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,UAAU,GAAG,GAAG,EAAE;QAChB,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,qBAAqB;SACxC,CAAC;IACJ,CAAC,CAAC;IAEK,oCAAoC,GAAG,KAAK,EAAE,mBAA2B,EAAkD,EAAE;QAClI,MAAM,oBAAoB,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,oBAAoB,wBAAwB,mBAAmB,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACzJ,oBAAG,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,oBAAoB,EAAE,CAAC,CAAC;QAC5D,OAAO,oBAA6D,CAAC;IACvE,CAAC,CAAC;IACF,
|
|
1
|
+
{"version":3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,CAAA;CACF;AA7CD,kDA6CC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiResponse } from '../../types/api-response.js';
|
|
2
|
+
import { GenericHttpClient } from '../generic/http-client.js';
|
|
2
3
|
import { DESTINATION_TYPE, Destination } from '@adtrackify/at-tracking-event-types';
|
|
3
4
|
export interface GetDestinationsResponseData {
|
|
4
5
|
destinations: Destination[];
|
|
@@ -11,17 +12,14 @@ export interface CreateDestinationResponseData {
|
|
|
11
12
|
export declare class DestinationsClient {
|
|
12
13
|
BASE_API_URL: string;
|
|
13
14
|
DESTINATIONS_API_KEY: string;
|
|
14
|
-
client:
|
|
15
|
+
client: GenericHttpClient;
|
|
16
|
+
SERVICE_API_ROOT_URL: string;
|
|
15
17
|
constructor(baseApiUrl: string, destinationsApiKey: string);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
'x-api-key': string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
18
|
+
getHeaders: () => {
|
|
19
|
+
'x-api-key': string;
|
|
20
|
+
} | {
|
|
21
|
+
'x-api-key'?: undefined;
|
|
23
22
|
};
|
|
24
|
-
getClient: () => any;
|
|
25
23
|
createDestination: (createDestinationRequest: any) => Promise<ApiResponse<CreateDestinationResponseData>>;
|
|
26
24
|
updateDestination: (destinationId: string, body: any, notifyCustomerIO?: boolean) => Promise<ApiResponse<CreateDestinationResponseData>>;
|
|
27
25
|
getPixelDestinations: (pixelId: string) => Promise<ApiResponse<GetDestinationsResponseData>>;
|
|
@@ -1,49 +1,46 @@
|
|
|
1
1
|
import { Logger } from '../../index.js';
|
|
2
2
|
import { axiosHttpService } from '../generic/http-client.js';
|
|
3
|
+
const client = axiosHttpService({
|
|
4
|
+
headers: {
|
|
5
|
+
'Content-Type': 'application/json',
|
|
6
|
+
},
|
|
7
|
+
});
|
|
3
8
|
export class DestinationsClient {
|
|
4
9
|
BASE_API_URL;
|
|
5
10
|
DESTINATIONS_API_KEY;
|
|
6
11
|
client;
|
|
12
|
+
SERVICE_API_ROOT_URL;
|
|
7
13
|
constructor(baseApiUrl, destinationsApiKey) {
|
|
8
14
|
this.BASE_API_URL = baseApiUrl;
|
|
9
15
|
this.DESTINATIONS_API_KEY = destinationsApiKey;
|
|
16
|
+
this.SERVICE_API_ROOT_URL = `${this.BASE_API_URL}/destinations`;
|
|
17
|
+
this.client = client;
|
|
10
18
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
getClient = () => {
|
|
23
|
-
this.client = this.client ?? axiosHttpService(this.getConfig());
|
|
24
|
-
return this.client;
|
|
19
|
+
getHeaders = () => {
|
|
20
|
+
if (this.DESTINATIONS_API_KEY) {
|
|
21
|
+
return {
|
|
22
|
+
'x-api-key': this.DESTINATIONS_API_KEY
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return {};
|
|
25
26
|
};
|
|
26
27
|
createDestination = async (createDestinationRequest) => {
|
|
27
|
-
const
|
|
28
|
-
const response = await client.post('/admin', createDestinationRequest);
|
|
28
|
+
const response = await client.post(`${this.SERVICE_API_ROOT_URL}/admin`, createDestinationRequest, { headers: this.getHeaders() });
|
|
29
29
|
Logger.debug('createDestinationResponse', { response });
|
|
30
30
|
return response;
|
|
31
31
|
};
|
|
32
32
|
updateDestination = async (destinationId, body, notifyCustomerIO = true) => {
|
|
33
|
-
const
|
|
34
|
-
const response = await client.patch(`/${destinationId}/private?notifyCustomerIO=${notifyCustomerIO}`, body);
|
|
33
|
+
const response = await client.patch(`${this.SERVICE_API_ROOT_URL}/${destinationId}/private?notifyCustomerIO=${notifyCustomerIO}`, body, { headers: this.getHeaders() });
|
|
35
34
|
Logger.debug('updateDestinationResponse', { response });
|
|
36
35
|
return response;
|
|
37
36
|
};
|
|
38
37
|
getPixelDestinations = async (pixelId) => {
|
|
39
|
-
const
|
|
40
|
-
const response = await client.get(`/?pixelId=${pixelId}`);
|
|
38
|
+
const response = await client.get(`${this.SERVICE_API_ROOT_URL}/?pixelId=${pixelId}`, { headers: this.getHeaders() });
|
|
41
39
|
Logger.debug('getPixelResponse', { response });
|
|
42
40
|
return response;
|
|
43
41
|
};
|
|
44
42
|
getAllDestinationByDestinationType = async (destinationType, start) => {
|
|
45
|
-
const
|
|
46
|
-
const response = await client.get(`/list?destinationType=${destinationType}&start=${start}`);
|
|
43
|
+
const response = await client.get(`${this.SERVICE_API_ROOT_URL}/list?destinationType=${destinationType}&start=${start}`, { headers: this.getHeaders() });
|
|
47
44
|
Logger.debug('getAllDestinationByDestinationType', { response });
|
|
48
45
|
return response;
|
|
49
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destinations-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/destinations-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"destinations-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/destinations-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAqB,MAAM,2BAA2B,CAAC;AAYhF,MAAM,MAAM,GAAG,gBAAgB,CAAC;IAE9B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAEH,MAAM,OAAO,kBAAkB;IACtB,YAAY,CAAS;IACrB,oBAAoB,CAAS;IAC7B,MAAM,CAAoB;IAC1B,oBAAoB,CAAS;IACpC,YAAY,UAAkB,EAAE,kBAA0B;QACxD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC/B,IAAI,CAAC,oBAAoB,GAAG,kBAAkB,CAAC;QAC/C,IAAI,CAAC,oBAAoB,G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,CAAC;QACtH,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC/C,OAAO,QAAoD,CAAC;IAC9D,CAAC,CAAC;IAEF,kCAAkC,GAAG,KAAK,EAAE,eAAiC,EAAE,KAAa,EAAqD,EAAE;QACjJ,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,oBAAoB,yBAAyB,eAAe,UAAU,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACzJ,MAAM,CAAC,KAAK,CAAC,oCAAoC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACjE,OAAO,QAAoD,CAAC;IAC9D,CAAC,CAAA;CACF"}
|
|
@@ -27,6 +27,6 @@ export declare class ShopifyAppInstallClient {
|
|
|
27
27
|
getShopifyAppInstall: (shopifyAppInstallId: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
|
|
28
28
|
getAllShopifyAppInstalls: (active?: boolean) => Promise<ApiResponse<ListShopifyAppInstallResponseData>>;
|
|
29
29
|
getShopifyAppInstallByShop: (shop: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
|
|
30
|
-
|
|
30
|
+
activateShopifyAppInstallPixelIdByShop: (shop: string, pixelId: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
|
|
31
31
|
cancelShopifyAppInstall: (shopifyAppInstallId: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
|
|
32
32
|
}
|
|
@@ -46,9 +46,9 @@ export class ShopifyAppInstallClient {
|
|
|
46
46
|
log.info('getShopifyAppInstallByShop', { response });
|
|
47
47
|
return response;
|
|
48
48
|
};
|
|
49
|
-
|
|
50
|
-
const response = await client.post(`${this.SERVICE_API_ROOT_URL}/
|
|
51
|
-
log.info('
|
|
49
|
+
activateShopifyAppInstallPixelIdByShop = async (shop, pixelId) => {
|
|
50
|
+
const response = await client.post(`${this.SERVICE_API_ROOT_URL}/activate-pixel-id-by-shop`, { shop, pixelId }, { headers: this.getHeaders() });
|
|
51
|
+
log.info('activateShopifyAppInstallPixelIdByShop', { response });
|
|
52
52
|
return response;
|
|
53
53
|
};
|
|
54
54
|
cancelShopifyAppInstall = async (shopifyAppInstallId) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopify-app-install-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/shopify-app-install-client.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAqB,MAAM,2BAA2B,CAAC;AAgBhF,MAAM,MAAM,GAAG,gBAAgB,CAAC;IAE9B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAEH,MAAM,OAAO,uBAAuB;IAE3B,YAAY,CAAS;IACrB,2BAA2B,CAAS;IACpC,MAAM,CAAoB;IAC1B,oBAAoB,CAAS;IAEpC,YAAY,UAAkB,EAAE,uBAA+B;QAC7D,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC/B,IAAI,CAAC,2BAA2B,GAAG,uBAAuB,CAAC;QAC3D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,oBAAoB,GAAG,GAAG,IAAI,CAAC,YAAY,uBAAuB,CAAC;IAC1E,CAAC;IAED,UAAU,GAAG,GAAG,EAAE;QAChB,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,2BAA2B;SAC9C,CAAC;IACJ,CAAC,CAAC;IAGF,uBAAuB,GAAG,KAAK,EAAE,mBAA2B,EAAE,8BAA8D,EAAuD,EAAE;QACnL,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,oBAAoB,IAAI,mBAAmB,EAAE,EAAE,8BAA8B,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,E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,EAAE;QACvG,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,oBAAoB,UAAU,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAChH,GAAG,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrD,OAAO,QAAsD,CAAC;IAChE,CAAC,CAAC;IACF,
|
|
1
|
+
{"version":3,"file":"shopify-app-install-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/shopify-app-install-client.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAqB,MAAM,2BAA2B,CAAC;AAgBhF,MAAM,MAAM,GAAG,gBAAgB,CAAC;IAE9B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAEH,MAAM,OAAO,uBAAuB;IAE3B,YAAY,CAAS;IACrB,2BAA2B,CAAS;IACpC,MAAM,CAAoB;IAC1B,oBAAoB,CAAS;IAEpC,YAAY,UAAkB,EAAE,uBAA+B;QAC7D,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC/B,IAAI,CAAC,2BAA2B,GAAG,uBAAuB,CAAC;QAC3D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,oBAAoB,GAAG,GAAG,IAAI,CAAC,YAAY,uBAAuB,CAAC;IAC1E,CAAC;IAED,UAAU,GAAG,GAAG,EAAE;QAChB,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,2BAA2B;SAC9C,CAAC;IACJ,CAAC,CAAC;IAGF,uBAAuB,GAAG,KAAK,EAAE,mBAA2B,EAAE,8BAA8D,EAAuD,EAAE;QACnL,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,oBAAoB,IAAI,mBAAm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ApiResponse<SubscriptionResponseData>>;
|
|
18
|
+
cancelSubscriptionByShopifyAppInstallId: (shopifyAppInstallId: string) => Promise<ApiResponse<SubscriptionResponseData>>;
|
|
18
19
|
getSubscriptionById: (subscriptionId: string) => Promise<ApiResponse<SubscriptionResponseData>>;
|
|
19
|
-
cancelSubscription: (subscriptionId: string) => Promise<ApiResponse<SubscriptionResponseData>>;
|
|
20
20
|
updateSubscriptionStatus: (subscriptionId: string, status: SUBSCRIPTION_STATUS) => Promise<ApiResponse<SubscriptionResponseData>>;
|
|
21
|
+
cancelSubscription: (subscriptionId: string) => Promise<ApiResponse<SubscriptionResponseData>>;
|
|
21
22
|
}
|
|
@@ -27,20 +27,25 @@ export class SubscriptionsClient {
|
|
|
27
27
|
log.debug('subscriptionResponse', { subscriptionResponse });
|
|
28
28
|
return subscriptionResponse;
|
|
29
29
|
};
|
|
30
|
+
cancelSubscriptionByShopifyAppInstallId = async (shopifyAppInstallId) => {
|
|
31
|
+
const subscriptionResponse = await client.post(`${this.SERVICE_API_ROOT_URL}/shopifyAppInstallId/${shopifyAppInstallId}/cancel`, { headers: this.getHeaders() });
|
|
32
|
+
Logger.debug('cancel subscription by shopify app install id response', { subscriptionResponse });
|
|
33
|
+
return subscriptionResponse;
|
|
34
|
+
};
|
|
30
35
|
getSubscriptionById = async (subscriptionId) => {
|
|
31
36
|
const subscriptionResponse = await client.get(`${this.SERVICE_API_ROOT_URL}/${subscriptionId}`, { headers: this.getHeaders() });
|
|
32
37
|
Logger.debug('subscriptionResponse', { subscriptionResponse });
|
|
33
38
|
return subscriptionResponse;
|
|
34
39
|
};
|
|
35
|
-
cancelSubscription = async (subscriptionId) => {
|
|
36
|
-
const subscriptionResponse = await client.post(`${this.SERVICE_API_ROOT_URL}/admin/${subscriptionId}/cancel`, { headers: this.getHeaders() });
|
|
37
|
-
Logger.debug('cancel subscription response', { subscriptionResponse });
|
|
38
|
-
return subscriptionResponse;
|
|
39
|
-
};
|
|
40
40
|
updateSubscriptionStatus = async (subscriptionId, status) => {
|
|
41
41
|
const subscriptionResponse = await client.post(`${this.SERVICE_API_ROOT_URL}/admin/${subscriptionId}/status`, { status }, { headers: this.getHeaders() });
|
|
42
42
|
Logger.debug('update subscription status response', { subscriptionResponse });
|
|
43
43
|
return subscriptionResponse;
|
|
44
44
|
};
|
|
45
|
+
cancelSubscription = async (subscriptionId) => {
|
|
46
|
+
const subscriptionResponse = await client.post(`${this.SERVICE_API_ROOT_URL}/admin/${subscriptionId}/cancel`, { headers: this.getHeaders() });
|
|
47
|
+
Logger.debug('cancel subscription response', { subscriptionResponse });
|
|
48
|
+
return subscriptionResponse;
|
|
49
|
+
};
|
|
45
50
|
}
|
|
46
51
|
//# sourceMappingURL=subscriptions-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/subscriptions-client.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAqB,MAAM,2BAA2B,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,MAAM,MAAM,GAAG,gBAAgB,CAAC;IAE9B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAKH,MAAM,OAAO,mBAAmB;IAEvB,YAAY,CAAS;IACrB,qBAAqB,CAAS;IAC9B,MAAM,CAAoB;IAC1B,oBAAoB,CAAS;IAEpC,YAAY,UAAkB,EAAE,mBAA2B;QACzD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC/B,IAAI,CAAC,qBAAqB,GAAG,mBAAmB,CAAC;QACjD,IAAI,CAAC,oBAAoB,GAAG,GAAG,IAAI,CAAC,YAAY,gBAAgB,CAAC;QACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,UAAU,GAAG,GAAG,EAAE;QAChB,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,qBAAqB;SACxC,CAAC;IACJ,CAAC,CAAC;IAEK,oCAAoC,GAAG,KAAK,EAAE,mBAA2B,EAAkD,EAAE;QAClI,MAAM,oBAAoB,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,oBAAoB,wBAAwB,mBAAmB,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACzJ,GAAG,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,oBAAoB,EAAE,CAAC,CAAC;QAC5D,OAAO,oBAA6D,CAAC;IACvE,CAAC,CAAC;IACF,
|
|
1
|
+
{"version":3,"file":"subscriptions-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/subscriptions-client.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAqB,MAAM,2BAA2B,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,MAAM,MAAM,GAAG,gBAAgB,CAAC;IAE9B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAKH,MAAM,OAAO,mBAAmB;IAEvB,YAAY,CAAS;IACrB,qBAAqB,CAAS;IAC9B,MAAM,CAAoB;IAC1B,oBAAoB,CAAS;IAEpC,YAAY,UAAkB,EAAE,mBAA2B;QACzD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC/B,IAAI,CAAC,qBAAqB,GAAG,mBAAmB,CAAC;QACjD,IAAI,CAAC,oBAAoB,GAAG,GAAG,IAAI,CAAC,YAAY,gBAAgB,CAAC;QACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,UAAU,GAAG,GAAG,EAAE;QAChB,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,qBAAqB;SACxC,CAAC;IACJ,CAAC,CA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