@sommpicks/sommpicks-shopify 24.12.3 → 24.12.5
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.
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/// <reference path="../typings/index.d.ts"/>
|
|
2
|
+
import CacheWrapper from './services/CacheWrapper';
|
|
3
|
+
import HmacValidator from './shopify/router/services/HmacValidator';
|
|
4
|
+
import RestUtils from './shopify/router/services/RestUtils';
|
|
5
|
+
import { ShopifyAssetService } from './shopify/ShopifyAssetService';
|
|
6
|
+
import { ShopifyBillingService } from './shopify/ShopifyBillingService';
|
|
7
|
+
import { ShopifyCollectionService } from './shopify/ShopifyCollectionService';
|
|
8
|
+
import { ShopifyCustomerService } from './shopify/ShopifyCustomerService';
|
|
9
|
+
import { ShopifyDraftOrderService } from './shopify/ShopifyDraftOrderService';
|
|
10
|
+
import { ShopifyFulfillmentService } from './shopify/ShopifyFulfillmentService';
|
|
11
|
+
import { ShopifyInventoryService } from './shopify/ShopifyInventoryService';
|
|
12
|
+
import { ShopifyLocationService } from './shopify/ShopifyLocationService';
|
|
13
|
+
import { ShopifyMandatoryRouter } from './shopify/router/ShopifyMandatoryRouter';
|
|
14
|
+
import { ShopifyOrderRiskService } from './shopify/ShopifyOrderRiskService';
|
|
15
|
+
import { ShopifyOrderService } from './shopify/ShopifyOrderService';
|
|
16
|
+
import { ShopifyPageService } from './shopify/ShopifyPageService';
|
|
17
|
+
import { ShopifyProductService } from './shopify/ShopifyProductService';
|
|
18
|
+
import { ShopifyShopService } from './shopify/ShopifyShopService';
|
|
19
|
+
import { ShopifyTemplateService } from './shopify/ShopifyTemplateService';
|
|
20
|
+
import { ShopifyThemeService } from './shopify/ShopifyThemeService';
|
|
21
|
+
import { ShopifyWebhookService } from './shopify/ShopifyWebhookService';
|
|
22
|
+
import StoreRateLimiter from './shopify/router/services/rateLimiter/StoreRateLimiter';
|
|
23
|
+
import { ShopifyDiscountService } from './shopify/ShopifyDiscountService';
|
|
24
|
+
import { ShopifyOrderRefundsService } from './shopify/ShopifyOrderRefundsService';
|
|
25
|
+
import WebhookSkipMiddleware from './shopify/router/WebhookSkipMiddleware';
|
|
26
|
+
import InspiraShopifyUnableToReserveInventoryError from './shopify/errors/InspiraShopifyUnableToReserveInventoryError';
|
|
27
|
+
import { ShopifyRouter } from './shopify/router/ShopifyRouter';
|
|
28
|
+
import ShopifyRouterBis from './shopify/router/ShopifyRouterBis';
|
|
29
|
+
import ShopifyRouterBisBis from './shopify/router/ShopifyRouterBisBis';
|
|
30
|
+
import ShopifyRouterBisBisBis from './shopify/router/ShopifyRouterBisBisBis';
|
|
31
|
+
import ShopifyRouterBisBisBisBis from './shopify/router/ShopifyRouterBisBisBisBis';
|
|
32
|
+
import { ShopifyDeliveryCustomisationService } from './shopify/ShopifyDeliveryCustomisationService';
|
|
33
|
+
import { ShopifyShippingZonesService } from './shopify/ShopifyShippingZonesService';
|
|
34
|
+
import { ShopifyCartTrasnformationService } from './shopify/ShopifyCartTrasnformationService';
|
|
35
|
+
import { ShopifyFunctionsProductDiscountsService } from './shopify/ShopifyFunctionsProductDiscountsService';
|
|
36
|
+
import { ShopifyAppService } from './shopify/ShopifyAppService';
|
|
37
|
+
export interface ILogger {
|
|
38
|
+
error: (...restOfName: any[]) => void;
|
|
39
|
+
info: (...restOfName: any[]) => void;
|
|
40
|
+
}
|
|
41
|
+
export interface IRest_Options {
|
|
42
|
+
timeout: number;
|
|
43
|
+
retries: number;
|
|
44
|
+
logger: ILogger;
|
|
45
|
+
debug: boolean;
|
|
46
|
+
max_requests_per_sec: number;
|
|
47
|
+
enableCache: boolean;
|
|
48
|
+
cacheTimeInMiliseconds: number;
|
|
49
|
+
}
|
|
50
|
+
export default class ShopifyRest {
|
|
51
|
+
customer: ShopifyCustomerService;
|
|
52
|
+
inventory: ShopifyInventoryService;
|
|
53
|
+
order: ShopifyOrderService;
|
|
54
|
+
product: ShopifyProductService;
|
|
55
|
+
webhook: ShopifyWebhookService;
|
|
56
|
+
fulfillment: ShopifyFulfillmentService;
|
|
57
|
+
store: ShopifyShopService;
|
|
58
|
+
collections: ShopifyCollectionService;
|
|
59
|
+
themes: ShopifyThemeService;
|
|
60
|
+
templates: ShopifyTemplateService;
|
|
61
|
+
assets: ShopifyAssetService;
|
|
62
|
+
billing: ShopifyBillingService;
|
|
63
|
+
draftOrders: ShopifyDraftOrderService;
|
|
64
|
+
locations: ShopifyLocationService;
|
|
65
|
+
orderRisks: ShopifyOrderRiskService;
|
|
66
|
+
shippingZonesService: ShopifyShippingZonesService;
|
|
67
|
+
pages: ShopifyPageService;
|
|
68
|
+
app: ShopifyAppService;
|
|
69
|
+
discounts: ShopifyDiscountService;
|
|
70
|
+
refunds: ShopifyOrderRefundsService;
|
|
71
|
+
shopifyDeliveryCustomisationService: ShopifyDeliveryCustomisationService;
|
|
72
|
+
shopifyCartTrasnformationService: ShopifyCartTrasnformationService;
|
|
73
|
+
shopifyFunctionsProductDiscountsService: ShopifyFunctionsProductDiscountsService;
|
|
74
|
+
private instance;
|
|
75
|
+
constructor(shop: string, token: string, privateAppApiKey: string, privateAppPassword: string, options: IRest_Options);
|
|
76
|
+
/**
|
|
77
|
+
* Enables or disables logging.
|
|
78
|
+
*/
|
|
79
|
+
logging: (enable: boolean) => Promise<void>;
|
|
80
|
+
getQueueInfo: () => {
|
|
81
|
+
request_within_last_second: number;
|
|
82
|
+
apiQueue: number;
|
|
83
|
+
graphQueue: number;
|
|
84
|
+
apiProcessed: number;
|
|
85
|
+
graphProcessed: number;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export declare const Router: typeof ShopifyRouter;
|
|
89
|
+
export declare const RouterBis: typeof ShopifyRouterBis;
|
|
90
|
+
export declare const RouterBisBis: typeof ShopifyRouterBisBis;
|
|
91
|
+
export declare const RouterBisBisBis: typeof ShopifyRouterBisBisBis;
|
|
92
|
+
export declare const RouterBisBisBisBis: typeof ShopifyRouterBisBisBisBis;
|
|
93
|
+
export declare const MandatoryRoutes: typeof ShopifyMandatoryRouter;
|
|
94
|
+
export declare const HmacUtils: typeof HmacValidator;
|
|
95
|
+
export declare const ShopifyRestUtils: typeof RestUtils;
|
|
96
|
+
export declare const RestCacheWrapper: typeof CacheWrapper;
|
|
97
|
+
export declare const RateLimiter: typeof StoreRateLimiter;
|
|
98
|
+
export declare const ShopifyWebhookSkipMiddleware: typeof WebhookSkipMiddleware;
|
|
99
|
+
export declare const Error_InspiraShopifyUnableToReserveInventoryError: typeof InspiraShopifyUnableToReserveInventoryError;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sommpicks/sommpicks-shopify",
|
|
3
|
-
"version": "24.12.
|
|
3
|
+
"version": "24.12.5",
|
|
4
4
|
"publishConfig": { "access": "restricted" },
|
|
5
5
|
"description": "Shopify REST API & GraphQL calls",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"homepage": "https://bitbucket.org/inspiradigital/inspira-shopify#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@sommpicks/sommpicks-shopify-rate-limit": "^3.0.
|
|
22
|
+
"@sommpicks/sommpicks-shopify-rate-limit": "^3.0.3",
|
|
23
23
|
"axios-cache-interceptor": "^1.5.1",
|
|
24
24
|
"axios": "^1.6.8",
|
|
25
25
|
"axios-retry": "^4.1.0",
|
|
@@ -32,7 +32,7 @@ export class ShopifyRouter {
|
|
|
32
32
|
const hmac = expresRequest.query.hmac as string;
|
|
33
33
|
const code = expresRequest.query.code as string;
|
|
34
34
|
const host = expresRequest.query.host as string;
|
|
35
|
-
|
|
35
|
+
console.log(`ShopifyRouter - callBackRoute From shopify ${code}`);
|
|
36
36
|
if (shop && hmac && code) {
|
|
37
37
|
const map = Object.assign({}, expresRequest.query);
|
|
38
38
|
delete map['signature'];
|
|
@@ -42,7 +42,7 @@ export class ShopifyRouter {
|
|
|
42
42
|
|
|
43
43
|
const hashEquals = this.cryptoService.checkHash(this.cryptoService.generateHash(message, this.shop_secret), hmac);
|
|
44
44
|
if (!hashEquals) { expresResponse.status(401).send('HMAC validation failed'); return; }
|
|
45
|
-
|
|
45
|
+
console.log(`getOathToken From shopify ${code}`);
|
|
46
46
|
OauthService.getOathToken(shop, this.shop_key, this.shop_secret, code,
|
|
47
47
|
(accessToken: string) => {
|
|
48
48
|
this.callback(accessToken, shop, host, expresResponse, secFetchDest === 'iframe', null);
|