@devite/shopware-client 1.7.8 → 1.7.9
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 +3 -2
- package/dist/index.d.cts +4 -2
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.mjs +3 -2
- package/dist/types/api/admin/document/ShopwareDocument.d.ts +3 -0
- package/dist/types/clients/admin/MailClient.d.ts +2 -0
- package/dist/types/clients/admin/OrderClient.d.ts +13 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -513,7 +513,7 @@ let DocumentClient$1 = class DocumentClient extends Client {
|
|
|
513
513
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
514
514
|
*/
|
|
515
515
|
async reserveNumber(salesChannelId, type, preview) {
|
|
516
|
-
const response = await this.
|
|
516
|
+
const response = await this.get(`/_action/number-range/reserve/${type}/${salesChannelId}`, {
|
|
517
517
|
query: { preview },
|
|
518
518
|
headers: { Accept: "application/json" }
|
|
519
519
|
});
|
|
@@ -766,7 +766,8 @@ let OrderClient$1 = class OrderClient extends Client {
|
|
|
766
766
|
const response = await this.post(`/_action/order/document/${documentTypeName}/create`, {
|
|
767
767
|
body: new JsonPayload(request)
|
|
768
768
|
});
|
|
769
|
-
if (response.statusCode === 200)
|
|
769
|
+
if (response.statusCode === 200)
|
|
770
|
+
return response.body.data;
|
|
770
771
|
throw new ShopwareError("Failed to create documents", response);
|
|
771
772
|
}
|
|
772
773
|
/** Order Management **/
|
package/dist/index.d.cts
CHANGED
|
@@ -121,7 +121,7 @@ import { MediaThumbnail as MediaThumbnail$2 } from '#types/api/store/media/Media
|
|
|
121
121
|
import { ShopwareDocumentBaseConfig as ShopwareDocumentBaseConfig$2 } from '#types/api/store/document/ShopwareDocumentBaseConfig';
|
|
122
122
|
import { ShopwareDocumentType as ShopwareDocumentType$2 } from '#types/api/store/document/ShopwareDocumentType';
|
|
123
123
|
import { ShopwareDocument as ShopwareDocument$2 } from '#types/api/store/document/ShopwareDocument';
|
|
124
|
-
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest, StateTransitionRequest, StateTransitionResponse } from '#types/clients/admin/OrderClient';
|
|
124
|
+
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest, DocumentListCreateResponse, StateTransitionRequest, StateTransitionResponse } from '#types/clients/admin/OrderClient';
|
|
125
125
|
import { Order as Order$2 } from '#types/api/admin/order/Order';
|
|
126
126
|
import { OrderAddress as OrderAddress$2 } from '#types/api/admin/order/OrderAddress';
|
|
127
127
|
import { OrderCustomer as OrderCustomer$2 } from '#types/api/admin/order/OrderCustomer';
|
|
@@ -3097,6 +3097,8 @@ type ShopwareDocument = ShopwareDocument$2 & {
|
|
|
3097
3097
|
referencedDocument?: ShopwareDocument;
|
|
3098
3098
|
dependantDocuments?: Array<ShopwareDocument>;
|
|
3099
3099
|
documentMediaFile?: Media;
|
|
3100
|
+
documentA11yMediaFile?: Media;
|
|
3101
|
+
order?: Order;
|
|
3100
3102
|
};
|
|
3101
3103
|
|
|
3102
3104
|
interface ShopwareDocumentBaseConfigSalesChannel {
|
|
@@ -3780,7 +3782,7 @@ declare class OrderClient$1 extends Client {
|
|
|
3780
3782
|
* @param request
|
|
3781
3783
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
3782
3784
|
*/
|
|
3783
|
-
createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<
|
|
3785
|
+
createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<DocumentListCreateResponse>;
|
|
3784
3786
|
/** Order Management **/
|
|
3785
3787
|
/**
|
|
3786
3788
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
package/dist/index.d.mts
CHANGED
|
@@ -121,7 +121,7 @@ import { MediaThumbnail as MediaThumbnail$2 } from '#types/api/store/media/Media
|
|
|
121
121
|
import { ShopwareDocumentBaseConfig as ShopwareDocumentBaseConfig$2 } from '#types/api/store/document/ShopwareDocumentBaseConfig';
|
|
122
122
|
import { ShopwareDocumentType as ShopwareDocumentType$2 } from '#types/api/store/document/ShopwareDocumentType';
|
|
123
123
|
import { ShopwareDocument as ShopwareDocument$2 } from '#types/api/store/document/ShopwareDocument';
|
|
124
|
-
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest, StateTransitionRequest, StateTransitionResponse } from '#types/clients/admin/OrderClient';
|
|
124
|
+
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest, DocumentListCreateResponse, StateTransitionRequest, StateTransitionResponse } from '#types/clients/admin/OrderClient';
|
|
125
125
|
import { Order as Order$2 } from '#types/api/admin/order/Order';
|
|
126
126
|
import { OrderAddress as OrderAddress$2 } from '#types/api/admin/order/OrderAddress';
|
|
127
127
|
import { OrderCustomer as OrderCustomer$2 } from '#types/api/admin/order/OrderCustomer';
|
|
@@ -3097,6 +3097,8 @@ type ShopwareDocument = ShopwareDocument$2 & {
|
|
|
3097
3097
|
referencedDocument?: ShopwareDocument;
|
|
3098
3098
|
dependantDocuments?: Array<ShopwareDocument>;
|
|
3099
3099
|
documentMediaFile?: Media;
|
|
3100
|
+
documentA11yMediaFile?: Media;
|
|
3101
|
+
order?: Order;
|
|
3100
3102
|
};
|
|
3101
3103
|
|
|
3102
3104
|
interface ShopwareDocumentBaseConfigSalesChannel {
|
|
@@ -3780,7 +3782,7 @@ declare class OrderClient$1 extends Client {
|
|
|
3780
3782
|
* @param request
|
|
3781
3783
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
3782
3784
|
*/
|
|
3783
|
-
createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<
|
|
3785
|
+
createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<DocumentListCreateResponse>;
|
|
3784
3786
|
/** Order Management **/
|
|
3785
3787
|
/**
|
|
3786
3788
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
package/dist/index.d.ts
CHANGED
|
@@ -121,7 +121,7 @@ import { MediaThumbnail as MediaThumbnail$2 } from '#types/api/store/media/Media
|
|
|
121
121
|
import { ShopwareDocumentBaseConfig as ShopwareDocumentBaseConfig$2 } from '#types/api/store/document/ShopwareDocumentBaseConfig';
|
|
122
122
|
import { ShopwareDocumentType as ShopwareDocumentType$2 } from '#types/api/store/document/ShopwareDocumentType';
|
|
123
123
|
import { ShopwareDocument as ShopwareDocument$2 } from '#types/api/store/document/ShopwareDocument';
|
|
124
|
-
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest, StateTransitionRequest, StateTransitionResponse } from '#types/clients/admin/OrderClient';
|
|
124
|
+
import { DownloadMergedRequest, DownloadMergedResponse, DocumentListCreateRequest, DocumentListCreateResponse, StateTransitionRequest, StateTransitionResponse } from '#types/clients/admin/OrderClient';
|
|
125
125
|
import { Order as Order$2 } from '#types/api/admin/order/Order';
|
|
126
126
|
import { OrderAddress as OrderAddress$2 } from '#types/api/admin/order/OrderAddress';
|
|
127
127
|
import { OrderCustomer as OrderCustomer$2 } from '#types/api/admin/order/OrderCustomer';
|
|
@@ -3097,6 +3097,8 @@ type ShopwareDocument = ShopwareDocument$2 & {
|
|
|
3097
3097
|
referencedDocument?: ShopwareDocument;
|
|
3098
3098
|
dependantDocuments?: Array<ShopwareDocument>;
|
|
3099
3099
|
documentMediaFile?: Media;
|
|
3100
|
+
documentA11yMediaFile?: Media;
|
|
3101
|
+
order?: Order;
|
|
3100
3102
|
};
|
|
3101
3103
|
|
|
3102
3104
|
interface ShopwareDocumentBaseConfigSalesChannel {
|
|
@@ -3780,7 +3782,7 @@ declare class OrderClient$1 extends Client {
|
|
|
3780
3782
|
* @param request
|
|
3781
3783
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
3782
3784
|
*/
|
|
3783
|
-
createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<
|
|
3785
|
+
createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<DocumentListCreateResponse>;
|
|
3784
3786
|
/** Order Management **/
|
|
3785
3787
|
/**
|
|
3786
3788
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
package/dist/index.mjs
CHANGED
|
@@ -511,7 +511,7 @@ let DocumentClient$1 = class DocumentClient extends Client {
|
|
|
511
511
|
* @throws {ShopwareError | import('ofetch').FetchError} if the request failed
|
|
512
512
|
*/
|
|
513
513
|
async reserveNumber(salesChannelId, type, preview) {
|
|
514
|
-
const response = await this.
|
|
514
|
+
const response = await this.get(`/_action/number-range/reserve/${type}/${salesChannelId}`, {
|
|
515
515
|
query: { preview },
|
|
516
516
|
headers: { Accept: "application/json" }
|
|
517
517
|
});
|
|
@@ -764,7 +764,8 @@ let OrderClient$1 = class OrderClient extends Client {
|
|
|
764
764
|
const response = await this.post(`/_action/order/document/${documentTypeName}/create`, {
|
|
765
765
|
body: new JsonPayload(request)
|
|
766
766
|
});
|
|
767
|
-
if (response.statusCode === 200)
|
|
767
|
+
if (response.statusCode === 200)
|
|
768
|
+
return response.body.data;
|
|
768
769
|
throw new ShopwareError("Failed to create documents", response);
|
|
769
770
|
}
|
|
770
771
|
/** Order Management **/
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ShopwareDocument as StoreApiShopwareDocument } from "#types/api/store/document/ShopwareDocument";
|
|
2
2
|
import { ShopwareDocumentType } from "./ShopwareDocumentType";
|
|
3
3
|
import { Media } from "../media/Media";
|
|
4
|
+
import { Order } from "../order/Order";
|
|
4
5
|
export type ShopwareDocument = StoreApiShopwareDocument & {
|
|
5
6
|
documentType?: ShopwareDocumentType;
|
|
6
7
|
referencedDocument?: ShopwareDocument;
|
|
7
8
|
dependantDocuments?: Array<ShopwareDocument>;
|
|
8
9
|
documentMediaFile?: Media;
|
|
10
|
+
documentA11yMediaFile?: Media;
|
|
11
|
+
order?: Order;
|
|
9
12
|
};
|
|
@@ -17,6 +17,8 @@ export interface MailSendRequest {
|
|
|
17
17
|
recipientsCc?: Record<string, string>;
|
|
18
18
|
replyTo?: Record<string, string>;
|
|
19
19
|
returnPath?: Record<string, string>;
|
|
20
|
+
documentIds?: Array<string>;
|
|
21
|
+
mailTemplateData?: Record<string, any>;
|
|
20
22
|
}
|
|
21
23
|
export interface MailSendResponse {
|
|
22
24
|
size?: number;
|
|
@@ -7,12 +7,23 @@ export interface DownloadMergedRequest {
|
|
|
7
7
|
export type DownloadMergedResponse = Blob;
|
|
8
8
|
export type DocumentListCreateRequest = Array<{
|
|
9
9
|
orderId: string;
|
|
10
|
-
type: string;
|
|
11
10
|
fileType?: string;
|
|
12
|
-
|
|
11
|
+
documentNumber?: string;
|
|
12
|
+
documentDate?: string;
|
|
13
13
|
referencedDocumentId?: string;
|
|
14
14
|
config?: ShopwareDocumentBaseConfig;
|
|
15
|
+
custom?: Record<string, any>;
|
|
15
16
|
}>;
|
|
17
|
+
export type DocumentListCreateResponse = {
|
|
18
|
+
data: Array<{
|
|
19
|
+
documentId: string;
|
|
20
|
+
a11yDocumentId?: string;
|
|
21
|
+
}>;
|
|
22
|
+
errors: Array<{
|
|
23
|
+
code?: string;
|
|
24
|
+
detail?: string;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
16
27
|
/** Order Management **/
|
|
17
28
|
export interface StateTransitionRequest {
|
|
18
29
|
sendMail?: boolean;
|