@adtrackify/at-service-common 3.1.21 → 3.1.22
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/third-party/shopify/shopify-graphql-client.d.ts +3 -3
- package/dist/cjs/clients/third-party/shopify/shopify-graphql-client.js +18 -19
- package/dist/cjs/clients/third-party/shopify/shopify-graphql-client.js.map +1 -1
- package/dist/cjs/services/shopify/products/shopify-products-serviceV2.d.ts +6 -1
- package/dist/cjs/services/shopify/products/shopify-products-serviceV2.js +24 -15
- package/dist/cjs/services/shopify/products/shopify-products-serviceV2.js.map +1 -1
- package/dist/esm/clients/third-party/shopify/shopify-graphql-client.d.ts +3 -3
- package/dist/esm/clients/third-party/shopify/shopify-graphql-client.js +18 -19
- package/dist/esm/clients/third-party/shopify/shopify-graphql-client.js.map +1 -1
- package/dist/esm/services/shopify/products/shopify-products-serviceV2.d.ts +6 -1
- package/dist/esm/services/shopify/products/shopify-products-serviceV2.js +24 -15
- package/dist/esm/services/shopify/products/shopify-products-serviceV2.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AdminApiClient } from '@shopify/admin-api-client';
|
|
2
|
-
import {
|
|
1
|
+
import { AdminApiClient, ClientResponse } from '@shopify/admin-api-client';
|
|
2
|
+
import { GetProductQuery } from '../../../types';
|
|
3
3
|
export declare class ShopifyGraphQLClient {
|
|
4
4
|
static _shopify_api_version: string;
|
|
5
5
|
static getClient: (shop: string, accessToken: string) => AdminApiClient;
|
|
6
|
-
static getProductWithVariantsGraphQL: (shop: string, accessToken: string, productId: string, pageSize?: number) => Promise<
|
|
6
|
+
static getProductWithVariantsGraphQL: (shop: string, accessToken: string, productId: string, pageSize?: number) => Promise<ClientResponse<GetProductQuery>>;
|
|
7
7
|
private static executePagedProductQuery;
|
|
8
8
|
private static executeProductQuery;
|
|
9
9
|
}
|
|
@@ -18,8 +18,8 @@ class ShopifyGraphQLClient {
|
|
|
18
18
|
static getProductWithVariantsGraphQL = async (shop, accessToken, productId, pageSize = 100) => {
|
|
19
19
|
try {
|
|
20
20
|
const client = this.getClient(shop, accessToken);
|
|
21
|
-
const
|
|
22
|
-
return
|
|
21
|
+
const result = await this.executePagedProductQuery(client, productId, pageSize, null);
|
|
22
|
+
return result;
|
|
23
23
|
}
|
|
24
24
|
catch (error) {
|
|
25
25
|
helpers_1.Logger.error('Failed getProductWithVariantsGraphQL', {
|
|
@@ -28,32 +28,38 @@ class ShopifyGraphQLClient {
|
|
|
28
28
|
accessToken,
|
|
29
29
|
productId
|
|
30
30
|
});
|
|
31
|
-
|
|
31
|
+
throw error;
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
static executePagedProductQuery = async (client, productId, pageSize, cursor) => {
|
|
35
35
|
try {
|
|
36
|
+
let result = {};
|
|
36
37
|
let product = null;
|
|
37
38
|
const allVariants = [];
|
|
38
39
|
let hasNextPage = true;
|
|
39
40
|
while (hasNextPage) {
|
|
40
41
|
helpers_1.Logger.debug('executePagedProductQuery', { productId, pageSize, cursor });
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
helpers_1.Logger.error('executePagedProductQuery:
|
|
42
|
+
result = await this.executeProductQuery(client, productId, pageSize, cursor ?? null);
|
|
43
|
+
if (result?.errors) {
|
|
44
|
+
helpers_1.Logger.error('executePagedProductQuery: Failed to execute product query', { result, shop: client.config.storeDomain, productId, accessToken: client.config.accessToken });
|
|
44
45
|
break;
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
else if (result?.data?.product) {
|
|
48
|
+
product = result.data.product;
|
|
49
|
+
allVariants.push(...(product?.variants?.nodes ?? []));
|
|
50
|
+
hasNextPage = product?.variants?.pageInfo?.hasNextPage;
|
|
51
|
+
cursor = product?.variants?.pageInfo?.endCursor;
|
|
52
|
+
}
|
|
49
53
|
if (hasNextPage) {
|
|
50
54
|
helpers_1.Logger.info('executePagedProductQuery: hasNextPage product variants', { hasNextPage, shop: client.config.storeDomain, productId, accessToken: client.config.accessToken });
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
if (product) {
|
|
54
58
|
product.variants.nodes = allVariants;
|
|
59
|
+
result.data = result?.data ?? {};
|
|
60
|
+
result.data.product = product;
|
|
55
61
|
}
|
|
56
|
-
return
|
|
62
|
+
return result;
|
|
57
63
|
}
|
|
58
64
|
catch (error) {
|
|
59
65
|
helpers_1.Logger.error('executePagedProductQuery:Failed to execute paged product query', { error, shop: client.config.storeDomain, productId, accessToken: client.config.accessToken });
|
|
@@ -62,7 +68,6 @@ class ShopifyGraphQLClient {
|
|
|
62
68
|
};
|
|
63
69
|
static executeProductQuery = async (client, productId, pageSize, cursor) => {
|
|
64
70
|
try {
|
|
65
|
-
let product = null;
|
|
66
71
|
const result = await client.request(graphql_product_queries_1.graphqlProductQueryByProductId, {
|
|
67
72
|
variables: {
|
|
68
73
|
id: `gid://shopify/Product/${productId}`,
|
|
@@ -78,18 +83,12 @@ class ShopifyGraphQLClient {
|
|
|
78
83
|
productId,
|
|
79
84
|
cursor
|
|
80
85
|
});
|
|
81
|
-
throw result.errors;
|
|
82
86
|
}
|
|
83
|
-
|
|
84
|
-
if (!product) {
|
|
85
|
-
helpers_1.Logger.error('Failed to get product', { result, shop: client.config.storeDomain, productId, accessToken: client.config.accessToken });
|
|
86
|
-
throw new Error('Failed to get product - No product found');
|
|
87
|
-
}
|
|
88
|
-
return product;
|
|
87
|
+
return result;
|
|
89
88
|
}
|
|
90
89
|
catch (error) {
|
|
91
90
|
helpers_1.Logger.error('Failed to executeProductQuery -- exception', { error, shop: client.config.storeDomain, productId, accessToken: client.config.accessToken });
|
|
92
|
-
|
|
91
|
+
return {};
|
|
93
92
|
}
|
|
94
93
|
};
|
|
95
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopify-graphql-client.js","sourceRoot":"","sources":["../../../../../src/clients/third-party/shopify/shopify-graphql-client.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"shopify-graphql-client.js","sourceRoot":"","sources":["../../../../../src/clients/third-party/shopify/shopify-graphql-client.ts"],"names":[],"mappings":";;;AAAA,gEAAiG;AACjG,8CAA0C;AAE1C,uEAA2E;AAE3E,MAAa,oBAAoB;IAC/B,MAAM,CAAC,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAA6B,CAAC;IAExE,MAAM,CAAC,SAAS,GAAG,CAAC,IAAY,EAAE,WAAmB,EAAE,EAAE;QACvD,MAAM,MAAM,GAAG,IAAA,uCAAoB,EAAC;YAClC,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,WAAW;YACxB,UAAU,EAAE,SAAS;YACrB,OAAO,EAAE,CAAC;SACX,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IAEF,MAAM,CAAC,6BAA6B,GAAG,KAAK,EAAE,IAAY,EAAE,WAAmB,EAAE,SAAiB,EAAE,QAAQ,GAAG,GAAG,EAA4C,EAAE;QAC9J,IAAI;YACF,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YACjD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;YACtF,OAAO,MAAM,CAAC;SACf;QAAC,OAAO,KAAK,EAAE;YACd,gBAAM,CAAC,KAAK,CAAC,sCAAsC,EAAE;gBACnD,KAAK;gBACL,IAAI;gBACJ,WAAW;gBACX,SAAS;aACV,CAAC,CAAC;YACH,MAAM,KAAK,CAAC;SACb;IACH,CAAC,CAAC;IAEM,MAAM,CAAC,wBAAwB,GAAG,KAAK,EAAE,MAAsB,EAAE,SAAiB,EAAE,QAAgB,EAAE,MAAiC,EAA4C,EAAE;QAC3L,IAAI;YACF,IAAI,MAAM,GAAoC,EAAE,CAAC;YACjD,IAAI,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CAAC;SACX;IACH,CAAC,CAAC;;AAvFJ,oDAwFC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { InternalProduct } from '../types/product';
|
|
2
|
+
import { GetProductQuery } from '../../../types';
|
|
3
|
+
import { ClientResponse } from '@shopify/admin-api-client';
|
|
4
|
+
export interface GetShopifyProductResponse extends ClientResponse<GetProductQuery> {
|
|
5
|
+
transformedProduct?: InternalProduct;
|
|
6
|
+
}
|
|
2
7
|
export declare class ShopifyProductsServiceV2 {
|
|
3
8
|
private productCacheService;
|
|
4
9
|
constructor(cacheLambdaFunctionArn: string);
|
|
5
|
-
getShopifyProduct: (pixelId: string, shop: string, accessToken: string, productId: string, useCache?: boolean, updateCache?: boolean) => Promise<
|
|
10
|
+
getShopifyProduct: (pixelId: string, shop: string, accessToken: string, productId: string, useCache?: boolean, updateCache?: boolean) => Promise<GetShopifyProductResponse | null>;
|
|
6
11
|
private getShopifyProductFromAPI;
|
|
7
12
|
}
|
|
@@ -12,24 +12,26 @@ class ShopifyProductsServiceV2 {
|
|
|
12
12
|
}
|
|
13
13
|
getShopifyProduct = async (pixelId, shop, accessToken, productId, useCache = true, updateCache = true) => {
|
|
14
14
|
try {
|
|
15
|
-
let
|
|
15
|
+
let getShopifyProductResponse = {};
|
|
16
16
|
if (useCache) {
|
|
17
|
-
product = await this.productCacheService.getProductFromCache(pixelId, productId);
|
|
17
|
+
const product = await this.productCacheService.getProductFromCache(pixelId, productId);
|
|
18
18
|
if (product) {
|
|
19
19
|
helpers_1.Logger.debug('getShopifyProduct: Product found in cache', { pixelId, shop, productId, product });
|
|
20
|
-
|
|
20
|
+
getShopifyProductResponse.transformedProduct = product;
|
|
21
|
+
return getShopifyProductResponse;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
if (
|
|
24
|
+
getShopifyProductResponse = await this.getShopifyProductFromAPI(pixelId, shop, accessToken, productId, true);
|
|
25
|
+
if (getShopifyProductResponse?.transformedProduct && updateCache) {
|
|
26
|
+
const product = getShopifyProductResponse.transformedProduct;
|
|
25
27
|
helpers_1.Logger.debug('getShopifyProduct: Product found in ShopifyAPI, putting in cache', { pixelId, productId, product });
|
|
26
28
|
await this.productCacheService.putProductInCache(pixelId, productId, product);
|
|
27
29
|
}
|
|
28
|
-
if (!
|
|
30
|
+
if (!getShopifyProductResponse?.transformedProduct) {
|
|
29
31
|
helpers_1.Logger.error('getShopifyProduct: Product not found in ShopifyAPI or cache', { pixelId, shop, productId });
|
|
30
32
|
}
|
|
31
|
-
helpers_1.Logger.debug('getShopifyProduct: Returning product', { pixelId, shop, productId, product });
|
|
32
|
-
return
|
|
33
|
+
helpers_1.Logger.debug('getShopifyProduct: Returning product', { pixelId, shop, productId, product: getShopifyProductResponse?.transformedProduct });
|
|
34
|
+
return getShopifyProductResponse;
|
|
33
35
|
}
|
|
34
36
|
catch (error) {
|
|
35
37
|
helpers_1.Logger.error('getShopifyProduct: Failed getShopifyProductWithCachingGraphQL', { error });
|
|
@@ -38,15 +40,22 @@ class ShopifyProductsServiceV2 {
|
|
|
38
40
|
};
|
|
39
41
|
getShopifyProductFromAPI = async (pixelId, shop, accessToken, productId, useTransformer = true) => {
|
|
40
42
|
try {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
+
const response = await shopify_graphql_client_1.ShopifyGraphQLClient.getProductWithVariantsGraphQL(shop, accessToken, productId, 100);
|
|
44
|
+
const getShopifyProductResponse = response;
|
|
45
|
+
if (response?.data?.product) {
|
|
46
|
+
const product = response.data.product;
|
|
43
47
|
helpers_1.Logger.debug('getShopifyProductFromAPI: Product found in ShopifyAPI', { pixelId, shop, productId, product });
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
if (useTransformer) {
|
|
49
|
+
const transformedProduct = shopify_graphql_transformer_1.ShopifyGraphQLTransformer.transformToInternalProduct(product);
|
|
50
|
+
getShopifyProductResponse.transformedProduct = transformedProduct;
|
|
51
|
+
helpers_1.Logger.info('getShopifyProductFromAPI: Product transformed', { pixelId, shop, productId, transformedProduct: getShopifyProductResponse.transformedProduct });
|
|
52
|
+
}
|
|
53
|
+
return getShopifyProductResponse;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
helpers_1.Logger.error('getShopifyProductFromAPI: Product not found in ShopifyAPI', { pixelId, shop, productId });
|
|
57
|
+
return getShopifyProductResponse;
|
|
47
58
|
}
|
|
48
|
-
helpers_1.Logger.error('getShopifyProductFromAPI: Product not found in ShopifyAPI', { pixelId, shop, productId });
|
|
49
|
-
return null;
|
|
50
59
|
}
|
|
51
60
|
catch (error) {
|
|
52
61
|
helpers_1.Logger.error('getShopifyProductFromAPI: Failed getShopifyProductFromAPI', { e: error, pixelId, shop, accessToken, productId, useTransformer, error });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopify-products-serviceV2.js","sourceRoot":"","sources":["../../../../../src/services/shopify/products/shopify-products-serviceV2.ts"],"names":[],"mappings":";;;AAAA,8CAA0C;AAG1C,6EAAwE;AACxE,gFAA2E;AAC3E,wGAAmG;
|
|
1
|
+
{"version":3,"file":"shopify-products-serviceV2.js","sourceRoot":"","sources":["../../../../../src/services/shopify/products/shopify-products-serviceV2.ts"],"names":[],"mappings":";;;AAAA,8CAA0C;AAG1C,6EAAwE;AACxE,gFAA2E;AAC3E,wGAAmG;AAQnG,MAAa,wBAAwB;IAE3B,mBAAmB,CAAsB;IACjD,YAAY,sBAA8B;QACxC,IAAI,CAAC,mBAAmB,GAAG,IAAI,2CAAmB,CAAC,sBAAsB,CAAC,CAAC;IAC7E,CAAC;IAEM,iBAAiB,GAAG,KAAK,EAAE,OAAe,EAAE,IAAY,EAAE,WAAmB,EAAE,SAAiB,EAAE,QAAQ,GAAG,IAAI,EAAE,WAAW,GAAG,IAAI,EAA6C,EAAE;QACzL,IAAI;YACF,IAAI,yBAAyB,GAAqC,EAAE,CAAC;YACrE,IAAI,QAAQ,EAAE;gBAEZ,MAAM,OAAO,GAAG,MAAM,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@@
|
|
|
1
|
-
import { AdminApiClient } from '@shopify/admin-api-client';
|
|
2
|
-
import {
|
|
1
|
+
import { AdminApiClient, ClientResponse } from '@shopify/admin-api-client';
|
|
2
|
+
import { GetProductQuery } from '../../../types';
|
|
3
3
|
export declare class ShopifyGraphQLClient {
|
|
4
4
|
static _shopify_api_version: string;
|
|
5
5
|
static getClient: (shop: string, accessToken: string) => AdminApiClient;
|
|
6
|
-
static getProductWithVariantsGraphQL: (shop: string, accessToken: string, productId: string, pageSize?: number) => Promise<
|
|
6
|
+
static getProductWithVariantsGraphQL: (shop: string, accessToken: string, productId: string, pageSize?: number) => Promise<ClientResponse<GetProductQuery>>;
|
|
7
7
|
private static executePagedProductQuery;
|
|
8
8
|
private static executeProductQuery;
|
|
9
9
|
}
|
|
@@ -15,8 +15,8 @@ export class ShopifyGraphQLClient {
|
|
|
15
15
|
static getProductWithVariantsGraphQL = async (shop, accessToken, productId, pageSize = 100) => {
|
|
16
16
|
try {
|
|
17
17
|
const client = this.getClient(shop, accessToken);
|
|
18
|
-
const
|
|
19
|
-
return
|
|
18
|
+
const result = await this.executePagedProductQuery(client, productId, pageSize, null);
|
|
19
|
+
return result;
|
|
20
20
|
}
|
|
21
21
|
catch (error) {
|
|
22
22
|
Logger.error('Failed getProductWithVariantsGraphQL', {
|
|
@@ -25,32 +25,38 @@ export class ShopifyGraphQLClient {
|
|
|
25
25
|
accessToken,
|
|
26
26
|
productId
|
|
27
27
|
});
|
|
28
|
-
|
|
28
|
+
throw error;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
static executePagedProductQuery = async (client, productId, pageSize, cursor) => {
|
|
32
32
|
try {
|
|
33
|
+
let result = {};
|
|
33
34
|
let product = null;
|
|
34
35
|
const allVariants = [];
|
|
35
36
|
let hasNextPage = true;
|
|
36
37
|
while (hasNextPage) {
|
|
37
38
|
Logger.debug('executePagedProductQuery', { productId, pageSize, cursor });
|
|
38
|
-
|
|
39
|
-
if (
|
|
40
|
-
Logger.error('executePagedProductQuery:
|
|
39
|
+
result = await this.executeProductQuery(client, productId, pageSize, cursor ?? null);
|
|
40
|
+
if (result?.errors) {
|
|
41
|
+
Logger.error('executePagedProductQuery: Failed to execute product query', { result, shop: client.config.storeDomain, productId, accessToken: client.config.accessToken });
|
|
41
42
|
break;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
else if (result?.data?.product) {
|
|
45
|
+
product = result.data.product;
|
|
46
|
+
allVariants.push(...(product?.variants?.nodes ?? []));
|
|
47
|
+
hasNextPage = product?.variants?.pageInfo?.hasNextPage;
|
|
48
|
+
cursor = product?.variants?.pageInfo?.endCursor;
|
|
49
|
+
}
|
|
46
50
|
if (hasNextPage) {
|
|
47
51
|
Logger.info('executePagedProductQuery: hasNextPage product variants', { hasNextPage, shop: client.config.storeDomain, productId, accessToken: client.config.accessToken });
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
if (product) {
|
|
51
55
|
product.variants.nodes = allVariants;
|
|
56
|
+
result.data = result?.data ?? {};
|
|
57
|
+
result.data.product = product;
|
|
52
58
|
}
|
|
53
|
-
return
|
|
59
|
+
return result;
|
|
54
60
|
}
|
|
55
61
|
catch (error) {
|
|
56
62
|
Logger.error('executePagedProductQuery:Failed to execute paged product query', { error, shop: client.config.storeDomain, productId, accessToken: client.config.accessToken });
|
|
@@ -59,7 +65,6 @@ export class ShopifyGraphQLClient {
|
|
|
59
65
|
};
|
|
60
66
|
static executeProductQuery = async (client, productId, pageSize, cursor) => {
|
|
61
67
|
try {
|
|
62
|
-
let product = null;
|
|
63
68
|
const result = await client.request(graphqlProductQueryByProductId, {
|
|
64
69
|
variables: {
|
|
65
70
|
id: `gid://shopify/Product/${productId}`,
|
|
@@ -75,18 +80,12 @@ export class ShopifyGraphQLClient {
|
|
|
75
80
|
productId,
|
|
76
81
|
cursor
|
|
77
82
|
});
|
|
78
|
-
throw result.errors;
|
|
79
83
|
}
|
|
80
|
-
|
|
81
|
-
if (!product) {
|
|
82
|
-
Logger.error('Failed to get product', { result, shop: client.config.storeDomain, productId, accessToken: client.config.accessToken });
|
|
83
|
-
throw new Error('Failed to get product - No product found');
|
|
84
|
-
}
|
|
85
|
-
return product;
|
|
84
|
+
return result;
|
|
86
85
|
}
|
|
87
86
|
catch (error) {
|
|
88
87
|
Logger.error('Failed to executeProductQuery -- exception', { error, shop: client.config.storeDomain, productId, accessToken: client.config.accessToken });
|
|
89
|
-
|
|
88
|
+
return {};
|
|
90
89
|
}
|
|
91
90
|
};
|
|
92
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopify-graphql-client.js","sourceRoot":"","sources":["../../../../../src/clients/third-party/shopify/shopify-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"shopify-graphql-client.js","sourceRoot":"","sources":["../../../../../src/clients/third-party/shopify/shopify-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjG,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,MAAM,OAAO,oBAAoB;IAC/B,MAAM,CAAC,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAA6B,CAAC;IAExE,MAAM,CAAC,SAAS,GAAG,CAAC,IAAY,EAAE,WAAmB,EAAE,EAAE;QACvD,MAAM,MAAM,GAAG,oBAAoB,CAAC;YAClC,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,WAAW;YACxB,UAAU,EAAE,SAAS;YACrB,OAAO,EAAE,CAAC;SACX,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IAEF,MAAM,CAAC,6BAA6B,GAAG,KAAK,EAAE,IAAY,EAAE,WAAmB,EAAE,SAAiB,EAAE,QAAQ,GAAG,GAAG,EAA4C,EAAE;QA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,EAAE;oBACxC,KAAK,EAAE,QAAQ;oBACf,KAAK,EAAE,MAAM;iBACd;aACF,CAAC,CAAC;YACH,IAAI,MAAM,EAAE,MAAM,EAAE;gBAClB,MAAM,CAAC,KAAK,CAAC,kDAAkD,EAAE;oBAC/D,MAAM;oBACN,cAAc,EAAE,MAAM,CAAC,MAAM;oBAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW;oBAC/B,SAAS;oBACT,MAAM;iBACP,CAAC,CAAC;aACJ;YACD,OAAO,MAAM,CAAC;SACf;QAAC,OAAO,KAAU,EAAE;YACnB,MAAM,CAAC,KAAK,CAAC,4CAA4C,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;YAC1J,OAAO,EAAE,CAAC;SACX;IACH,CAAC,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { InternalProduct } from '../types/product';
|
|
2
|
+
import { GetProductQuery } from '../../../types';
|
|
3
|
+
import { ClientResponse } from '@shopify/admin-api-client';
|
|
4
|
+
export interface GetShopifyProductResponse extends ClientResponse<GetProductQuery> {
|
|
5
|
+
transformedProduct?: InternalProduct;
|
|
6
|
+
}
|
|
2
7
|
export declare class ShopifyProductsServiceV2 {
|
|
3
8
|
private productCacheService;
|
|
4
9
|
constructor(cacheLambdaFunctionArn: string);
|
|
5
|
-
getShopifyProduct: (pixelId: string, shop: string, accessToken: string, productId: string, useCache?: boolean, updateCache?: boolean) => Promise<
|
|
10
|
+
getShopifyProduct: (pixelId: string, shop: string, accessToken: string, productId: string, useCache?: boolean, updateCache?: boolean) => Promise<GetShopifyProductResponse | null>;
|
|
6
11
|
private getShopifyProductFromAPI;
|
|
7
12
|
}
|
|
@@ -9,24 +9,26 @@ export class ShopifyProductsServiceV2 {
|
|
|
9
9
|
}
|
|
10
10
|
getShopifyProduct = async (pixelId, shop, accessToken, productId, useCache = true, updateCache = true) => {
|
|
11
11
|
try {
|
|
12
|
-
let
|
|
12
|
+
let getShopifyProductResponse = {};
|
|
13
13
|
if (useCache) {
|
|
14
|
-
product = await this.productCacheService.getProductFromCache(pixelId, productId);
|
|
14
|
+
const product = await this.productCacheService.getProductFromCache(pixelId, productId);
|
|
15
15
|
if (product) {
|
|
16
16
|
Logger.debug('getShopifyProduct: Product found in cache', { pixelId, shop, productId, product });
|
|
17
|
-
|
|
17
|
+
getShopifyProductResponse.transformedProduct = product;
|
|
18
|
+
return getShopifyProductResponse;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
if (
|
|
21
|
+
getShopifyProductResponse = await this.getShopifyProductFromAPI(pixelId, shop, accessToken, productId, true);
|
|
22
|
+
if (getShopifyProductResponse?.transformedProduct && updateCache) {
|
|
23
|
+
const product = getShopifyProductResponse.transformedProduct;
|
|
22
24
|
Logger.debug('getShopifyProduct: Product found in ShopifyAPI, putting in cache', { pixelId, productId, product });
|
|
23
25
|
await this.productCacheService.putProductInCache(pixelId, productId, product);
|
|
24
26
|
}
|
|
25
|
-
if (!
|
|
27
|
+
if (!getShopifyProductResponse?.transformedProduct) {
|
|
26
28
|
Logger.error('getShopifyProduct: Product not found in ShopifyAPI or cache', { pixelId, shop, productId });
|
|
27
29
|
}
|
|
28
|
-
Logger.debug('getShopifyProduct: Returning product', { pixelId, shop, productId, product });
|
|
29
|
-
return
|
|
30
|
+
Logger.debug('getShopifyProduct: Returning product', { pixelId, shop, productId, product: getShopifyProductResponse?.transformedProduct });
|
|
31
|
+
return getShopifyProductResponse;
|
|
30
32
|
}
|
|
31
33
|
catch (error) {
|
|
32
34
|
Logger.error('getShopifyProduct: Failed getShopifyProductWithCachingGraphQL', { error });
|
|
@@ -35,15 +37,22 @@ export class ShopifyProductsServiceV2 {
|
|
|
35
37
|
};
|
|
36
38
|
getShopifyProductFromAPI = async (pixelId, shop, accessToken, productId, useTransformer = true) => {
|
|
37
39
|
try {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
+
const response = await ShopifyGraphQLClient.getProductWithVariantsGraphQL(shop, accessToken, productId, 100);
|
|
41
|
+
const getShopifyProductResponse = response;
|
|
42
|
+
if (response?.data?.product) {
|
|
43
|
+
const product = response.data.product;
|
|
40
44
|
Logger.debug('getShopifyProductFromAPI: Product found in ShopifyAPI', { pixelId, shop, productId, product });
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
if (useTransformer) {
|
|
46
|
+
const transformedProduct = ShopifyGraphQLTransformer.transformToInternalProduct(product);
|
|
47
|
+
getShopifyProductResponse.transformedProduct = transformedProduct;
|
|
48
|
+
Logger.info('getShopifyProductFromAPI: Product transformed', { pixelId, shop, productId, transformedProduct: getShopifyProductResponse.transformedProduct });
|
|
49
|
+
}
|
|
50
|
+
return getShopifyProductResponse;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
Logger.error('getShopifyProductFromAPI: Product not found in ShopifyAPI', { pixelId, shop, productId });
|
|
54
|
+
return getShopifyProductResponse;
|
|
44
55
|
}
|
|
45
|
-
Logger.error('getShopifyProductFromAPI: Product not found in ShopifyAPI', { pixelId, shop, productId });
|
|
46
|
-
return null;
|
|
47
56
|
}
|
|
48
57
|
catch (error) {
|
|
49
58
|
Logger.error('getShopifyProductFromAPI: Failed getShopifyProductFromAPI', { e: error, pixelId, shop, accessToken, productId, useTransformer, error });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shopify-products-serviceV2.js","sourceRoot":"","sources":["../../../../../src/services/shopify/products/shopify-products-serviceV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;
|
|
1
|
+
{"version":3,"file":"shopify-products-serviceV2.js","sourceRoot":"","sources":["../../../../../src/services/shopify/products/shopify-products-serviceV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AAQnG,MAAM,OAAO,wBAAwB;IAE3B,mBAAmB,CAAsB;IACjD,YAAY,sBAA8B;QACxC,IAAI,CAAC,mBAAmB,GAAG,IAAI,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;IAC7E,CAAC;IAEM,iBAAiB,GAAG,KAAK,EAAE,OAAe,EAAE,IAAY,EAAE,WAAmB,EAAE,SAAiB,EAAE,QAAQ,GAAG,IAAI,EAAE,WAAW,GAAG,IAAI,EAA6C,EAAE;QACzL,IAAI;YACF,IAAI,yBAAyB,GAAqC,EAAE,CAAC;YACrE,IAAI,QAAQ,EAAE;gBAEZ,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;gBACvF,IAAI,OAAO,EAAE;oBACX,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;oBACjG,yBAAyB,CAAC,kBAAkB,GAAG,OAAO,CAAC;oBACvD,OAAO,yBAAyB,CAAC;iBAClC;aACF;YAED,yBAAyB,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;YAC7G,IAAI,yBAAyB,EAAE,kBAAkB,IAAI,WAAW,EAAE;gBAChE,MAAM,OAAO,G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