@devite/shopware-client 1.5.7 → 1.5.8
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/index.cjs +5 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +5 -2
- package/dist/types/clients/store/OrderClient.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -110,6 +110,9 @@ class ShopwareClient {
|
|
|
110
110
|
* @throws {import('ofetch').FetchError} if the request is invalid
|
|
111
111
|
*/
|
|
112
112
|
doRequest(path, options) {
|
|
113
|
+
if (path.length > 2048) {
|
|
114
|
+
throw new Error("Path may not exceed 2048 characters");
|
|
115
|
+
}
|
|
113
116
|
const serializedBody = options?.body?.serialize() || void 0;
|
|
114
117
|
let cacheKey = null;
|
|
115
118
|
if (options?.maxAge && options.maxAge > 0) {
|
|
@@ -13306,13 +13309,13 @@ class OrderClient extends Client {
|
|
|
13306
13309
|
/**
|
|
13307
13310
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
13308
13311
|
*/
|
|
13309
|
-
async
|
|
13312
|
+
async handlePayment(request) {
|
|
13310
13313
|
const response = await this.post("/handle-payment", {
|
|
13311
13314
|
body: new JsonPayload(request)
|
|
13312
13315
|
});
|
|
13313
13316
|
if (response.statusCode === 200)
|
|
13314
13317
|
return response.body.data;
|
|
13315
|
-
throw new ShopwareError("Failed to
|
|
13318
|
+
throw new ShopwareError("Failed to handle order payment", response);
|
|
13316
13319
|
}
|
|
13317
13320
|
/**
|
|
13318
13321
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
package/dist/index.d.cts
CHANGED
|
@@ -107,7 +107,7 @@ import { CustomerLoginRequest, CustomerLoginResponse, CustomerLoginImitateReques
|
|
|
107
107
|
import { DocumentDownloadRequest, DocumentDownloadResponse } from '#types/clients/store/DocumentClient';
|
|
108
108
|
import { GatewayCheckoutResponse } from '#types/clients/store/GatewayClient';
|
|
109
109
|
import { NewsletterConfirmRequest, NewsletterUpdateRequest, NewsletterUnsubscribeRequest } from '#types/clients/store/NewsletterClient';
|
|
110
|
-
import {
|
|
110
|
+
import { OrderPaymentHandleRequest, OrderPaymentHandleResponse, OrderCancelRequest, OrderCancelResponse, OrderListRequest, OrderListResponse as OrderListResponse$1, OrderUpdatePaymentMethodRequest, OrderUpdatePaymentMethodResponse, OrderDownloadFileResponse, OrderFromCartRequest, OrderFromCartResponse } from '#types/clients/store/OrderClient';
|
|
111
111
|
import { ProductListingListWithCategoryRequest, ProductListingListWithCategoryResponse, ProductCrossSellingGroupListResponse, ProductSingleRequest, ProductSingleResponse as ProductSingleResponse$1, ProductListRequest, ProductListResponse as ProductListResponse$1, ProductReviewListRequest, ProductReviewListResponse, ProductReviewSaveRequest, ProductVariantWithOptionsRequest, ProductVariantWithOptionsResponse, ProductSearchRequest, ProductSearchResponse, ProductSearchSuggestionListRequest, ProductSearchSuggestionListResponse } from '#types/clients/store/ProductClient';
|
|
112
112
|
import { SeoRouteListRequest, SeoRouteListResponse, SitemapListResponse, SitemapDownloadResponse } from '#types/clients/store/SeoClient';
|
|
113
113
|
import { LanguageListRequest, LanguageListResponse as LanguageListResponse$1, SalutationListRequest, SalutationListResponse as SalutationListResponse$1, CurrencyListRequest, CurrencyListResponse as CurrencyListResponse$1, CountryStateListRequest, CountryStateListResponse, CountryListRequest, CountryListResponse as CountryListResponse$1, ShippingMethodListRequest, ShippingMethodListResponse as ShippingMethodListResponse$2, PaymentMethodListRequest, PaymentMethodListResponse as PaymentMethodListResponse$2 } from '#types/clients/store/SystemClient';
|
|
@@ -7343,7 +7343,7 @@ declare class OrderClient extends Client {
|
|
|
7343
7343
|
/**
|
|
7344
7344
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
7345
7345
|
*/
|
|
7346
|
-
|
|
7346
|
+
handlePayment(request: OrderPaymentHandleRequest): Promise<OrderPaymentHandleResponse>;
|
|
7347
7347
|
/**
|
|
7348
7348
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
7349
7349
|
*/
|
package/dist/index.d.mts
CHANGED
|
@@ -107,7 +107,7 @@ import { CustomerLoginRequest, CustomerLoginResponse, CustomerLoginImitateReques
|
|
|
107
107
|
import { DocumentDownloadRequest, DocumentDownloadResponse } from '#types/clients/store/DocumentClient';
|
|
108
108
|
import { GatewayCheckoutResponse } from '#types/clients/store/GatewayClient';
|
|
109
109
|
import { NewsletterConfirmRequest, NewsletterUpdateRequest, NewsletterUnsubscribeRequest } from '#types/clients/store/NewsletterClient';
|
|
110
|
-
import {
|
|
110
|
+
import { OrderPaymentHandleRequest, OrderPaymentHandleResponse, OrderCancelRequest, OrderCancelResponse, OrderListRequest, OrderListResponse as OrderListResponse$1, OrderUpdatePaymentMethodRequest, OrderUpdatePaymentMethodResponse, OrderDownloadFileResponse, OrderFromCartRequest, OrderFromCartResponse } from '#types/clients/store/OrderClient';
|
|
111
111
|
import { ProductListingListWithCategoryRequest, ProductListingListWithCategoryResponse, ProductCrossSellingGroupListResponse, ProductSingleRequest, ProductSingleResponse as ProductSingleResponse$1, ProductListRequest, ProductListResponse as ProductListResponse$1, ProductReviewListRequest, ProductReviewListResponse, ProductReviewSaveRequest, ProductVariantWithOptionsRequest, ProductVariantWithOptionsResponse, ProductSearchRequest, ProductSearchResponse, ProductSearchSuggestionListRequest, ProductSearchSuggestionListResponse } from '#types/clients/store/ProductClient';
|
|
112
112
|
import { SeoRouteListRequest, SeoRouteListResponse, SitemapListResponse, SitemapDownloadResponse } from '#types/clients/store/SeoClient';
|
|
113
113
|
import { LanguageListRequest, LanguageListResponse as LanguageListResponse$1, SalutationListRequest, SalutationListResponse as SalutationListResponse$1, CurrencyListRequest, CurrencyListResponse as CurrencyListResponse$1, CountryStateListRequest, CountryStateListResponse, CountryListRequest, CountryListResponse as CountryListResponse$1, ShippingMethodListRequest, ShippingMethodListResponse as ShippingMethodListResponse$2, PaymentMethodListRequest, PaymentMethodListResponse as PaymentMethodListResponse$2 } from '#types/clients/store/SystemClient';
|
|
@@ -7343,7 +7343,7 @@ declare class OrderClient extends Client {
|
|
|
7343
7343
|
/**
|
|
7344
7344
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
7345
7345
|
*/
|
|
7346
|
-
|
|
7346
|
+
handlePayment(request: OrderPaymentHandleRequest): Promise<OrderPaymentHandleResponse>;
|
|
7347
7347
|
/**
|
|
7348
7348
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
7349
7349
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -107,7 +107,7 @@ import { CustomerLoginRequest, CustomerLoginResponse, CustomerLoginImitateReques
|
|
|
107
107
|
import { DocumentDownloadRequest, DocumentDownloadResponse } from '#types/clients/store/DocumentClient';
|
|
108
108
|
import { GatewayCheckoutResponse } from '#types/clients/store/GatewayClient';
|
|
109
109
|
import { NewsletterConfirmRequest, NewsletterUpdateRequest, NewsletterUnsubscribeRequest } from '#types/clients/store/NewsletterClient';
|
|
110
|
-
import {
|
|
110
|
+
import { OrderPaymentHandleRequest, OrderPaymentHandleResponse, OrderCancelRequest, OrderCancelResponse, OrderListRequest, OrderListResponse as OrderListResponse$1, OrderUpdatePaymentMethodRequest, OrderUpdatePaymentMethodResponse, OrderDownloadFileResponse, OrderFromCartRequest, OrderFromCartResponse } from '#types/clients/store/OrderClient';
|
|
111
111
|
import { ProductListingListWithCategoryRequest, ProductListingListWithCategoryResponse, ProductCrossSellingGroupListResponse, ProductSingleRequest, ProductSingleResponse as ProductSingleResponse$1, ProductListRequest, ProductListResponse as ProductListResponse$1, ProductReviewListRequest, ProductReviewListResponse, ProductReviewSaveRequest, ProductVariantWithOptionsRequest, ProductVariantWithOptionsResponse, ProductSearchRequest, ProductSearchResponse, ProductSearchSuggestionListRequest, ProductSearchSuggestionListResponse } from '#types/clients/store/ProductClient';
|
|
112
112
|
import { SeoRouteListRequest, SeoRouteListResponse, SitemapListResponse, SitemapDownloadResponse } from '#types/clients/store/SeoClient';
|
|
113
113
|
import { LanguageListRequest, LanguageListResponse as LanguageListResponse$1, SalutationListRequest, SalutationListResponse as SalutationListResponse$1, CurrencyListRequest, CurrencyListResponse as CurrencyListResponse$1, CountryStateListRequest, CountryStateListResponse, CountryListRequest, CountryListResponse as CountryListResponse$1, ShippingMethodListRequest, ShippingMethodListResponse as ShippingMethodListResponse$2, PaymentMethodListRequest, PaymentMethodListResponse as PaymentMethodListResponse$2 } from '#types/clients/store/SystemClient';
|
|
@@ -7343,7 +7343,7 @@ declare class OrderClient extends Client {
|
|
|
7343
7343
|
/**
|
|
7344
7344
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
7345
7345
|
*/
|
|
7346
|
-
|
|
7346
|
+
handlePayment(request: OrderPaymentHandleRequest): Promise<OrderPaymentHandleResponse>;
|
|
7347
7347
|
/**
|
|
7348
7348
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
7349
7349
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -108,6 +108,9 @@ class ShopwareClient {
|
|
|
108
108
|
* @throws {import('ofetch').FetchError} if the request is invalid
|
|
109
109
|
*/
|
|
110
110
|
doRequest(path, options) {
|
|
111
|
+
if (path.length > 2048) {
|
|
112
|
+
throw new Error("Path may not exceed 2048 characters");
|
|
113
|
+
}
|
|
111
114
|
const serializedBody = options?.body?.serialize() || void 0;
|
|
112
115
|
let cacheKey = null;
|
|
113
116
|
if (options?.maxAge && options.maxAge > 0) {
|
|
@@ -13304,13 +13307,13 @@ class OrderClient extends Client {
|
|
|
13304
13307
|
/**
|
|
13305
13308
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
13306
13309
|
*/
|
|
13307
|
-
async
|
|
13310
|
+
async handlePayment(request) {
|
|
13308
13311
|
const response = await this.post("/handle-payment", {
|
|
13309
13312
|
body: new JsonPayload(request)
|
|
13310
13313
|
});
|
|
13311
13314
|
if (response.statusCode === 200)
|
|
13312
13315
|
return response.body.data;
|
|
13313
|
-
throw new ShopwareError("Failed to
|
|
13316
|
+
throw new ShopwareError("Failed to handle order payment", response);
|
|
13314
13317
|
}
|
|
13315
13318
|
/**
|
|
13316
13319
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
@@ -2,13 +2,13 @@ import { StateMachineState } from "#types/api/store/StateMachineState";
|
|
|
2
2
|
import { Order } from "#types/api/store/order/Order";
|
|
3
3
|
import { Criteria } from "#types/api/global/query/Criteria";
|
|
4
4
|
import { EntitySearchResult } from "#types/api/store";
|
|
5
|
-
export interface
|
|
5
|
+
export interface OrderPaymentHandleRequest {
|
|
6
6
|
orderId: string;
|
|
7
7
|
finishUrl?: string;
|
|
8
8
|
errorUrl?: string;
|
|
9
9
|
paymentDetails?: Record<string, any>;
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface OrderPaymentHandleResponse {
|
|
12
12
|
redirectUrl: string | null;
|
|
13
13
|
}
|
|
14
14
|
export interface OrderCancelRequest {
|