@devite/shopware-client 1.7.7 → 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 CHANGED
@@ -477,7 +477,11 @@ class CustomerClient extends Client {
477
477
  }
478
478
  /** Rest Endpoints **/
479
479
  customers = createRestEndpoint(this, "customer", "customer");
480
- addresses = createRestEndpoint(this, "address", "customer address");
480
+ addresses = createRestEndpoint(
481
+ this,
482
+ "customer-address",
483
+ "customer address"
484
+ );
481
485
  groups = createRestEndpoint(this, "customer-group", "customer group");
482
486
  recoveries = createRestEndpoint(
483
487
  this,
@@ -509,7 +513,7 @@ let DocumentClient$1 = class DocumentClient extends Client {
509
513
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
510
514
  */
511
515
  async reserveNumber(salesChannelId, type, preview) {
512
- const response = await this.post(`/_action/number-range/reserve/${type}/${salesChannelId}`, {
516
+ const response = await this.get(`/_action/number-range/reserve/${type}/${salesChannelId}`, {
513
517
  query: { preview },
514
518
  headers: { Accept: "application/json" }
515
519
  });
@@ -762,7 +766,8 @@ let OrderClient$1 = class OrderClient extends Client {
762
766
  const response = await this.post(`/_action/order/document/${documentTypeName}/create`, {
763
767
  body: new JsonPayload(request)
764
768
  });
765
- if (response.statusCode === 200) return;
769
+ if (response.statusCode === 200)
770
+ return response.body.data;
766
771
  throw new ShopwareError("Failed to create documents", response);
767
772
  }
768
773
  /** Order Management **/
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@ export * from '#types/index';
3
3
  import { ClientResponse } from '#types/ClientResponse';
4
4
  import { ClientRequestOptions } from '#types/ClientRequestOptions';
5
5
  import { OAuthScope } from '#types/OAuthScope';
6
- import { Aggregation as Aggregation$1 } from '#types/api/global';
6
+ import { Aggregation as Aggregation$1, Price } from '#types/api/global';
7
7
  import { App as App$1 } from '#types/api/admin/app/App';
8
8
  import { AppActionButton as AppActionButton$1 } from '#types/api/admin/app/AppActionButton';
9
9
  import { AppAdministrationSnippet } from '#types/api/admin/app/AppAdministrationSnippet';
@@ -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';
@@ -2938,7 +2938,7 @@ interface CustomerWishlist {
2938
2938
 
2939
2939
  type Product = Product$1 & {
2940
2940
  featureSetId?: string;
2941
- price?: Array<CalculatedPrice>;
2941
+ price?: Array<Price>;
2942
2942
  readonly autoIncrement?: number;
2943
2943
  variantRestrictions?: object;
2944
2944
  purchasePrices?: Array<CalculatedPrice>;
@@ -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<void>;
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
@@ -3,7 +3,7 @@ export * from '#types/index';
3
3
  import { ClientResponse } from '#types/ClientResponse';
4
4
  import { ClientRequestOptions } from '#types/ClientRequestOptions';
5
5
  import { OAuthScope } from '#types/OAuthScope';
6
- import { Aggregation as Aggregation$1 } from '#types/api/global';
6
+ import { Aggregation as Aggregation$1, Price } from '#types/api/global';
7
7
  import { App as App$1 } from '#types/api/admin/app/App';
8
8
  import { AppActionButton as AppActionButton$1 } from '#types/api/admin/app/AppActionButton';
9
9
  import { AppAdministrationSnippet } from '#types/api/admin/app/AppAdministrationSnippet';
@@ -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';
@@ -2938,7 +2938,7 @@ interface CustomerWishlist {
2938
2938
 
2939
2939
  type Product = Product$1 & {
2940
2940
  featureSetId?: string;
2941
- price?: Array<CalculatedPrice>;
2941
+ price?: Array<Price>;
2942
2942
  readonly autoIncrement?: number;
2943
2943
  variantRestrictions?: object;
2944
2944
  purchasePrices?: Array<CalculatedPrice>;
@@ -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<void>;
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
@@ -3,7 +3,7 @@ export * from '#types/index';
3
3
  import { ClientResponse } from '#types/ClientResponse';
4
4
  import { ClientRequestOptions } from '#types/ClientRequestOptions';
5
5
  import { OAuthScope } from '#types/OAuthScope';
6
- import { Aggregation as Aggregation$1 } from '#types/api/global';
6
+ import { Aggregation as Aggregation$1, Price } from '#types/api/global';
7
7
  import { App as App$1 } from '#types/api/admin/app/App';
8
8
  import { AppActionButton as AppActionButton$1 } from '#types/api/admin/app/AppActionButton';
9
9
  import { AppAdministrationSnippet } from '#types/api/admin/app/AppAdministrationSnippet';
@@ -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';
@@ -2938,7 +2938,7 @@ interface CustomerWishlist {
2938
2938
 
2939
2939
  type Product = Product$1 & {
2940
2940
  featureSetId?: string;
2941
- price?: Array<CalculatedPrice>;
2941
+ price?: Array<Price>;
2942
2942
  readonly autoIncrement?: number;
2943
2943
  variantRestrictions?: object;
2944
2944
  purchasePrices?: Array<CalculatedPrice>;
@@ -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<void>;
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
@@ -475,7 +475,11 @@ class CustomerClient extends Client {
475
475
  }
476
476
  /** Rest Endpoints **/
477
477
  customers = createRestEndpoint(this, "customer", "customer");
478
- addresses = createRestEndpoint(this, "address", "customer address");
478
+ addresses = createRestEndpoint(
479
+ this,
480
+ "customer-address",
481
+ "customer address"
482
+ );
479
483
  groups = createRestEndpoint(this, "customer-group", "customer group");
480
484
  recoveries = createRestEndpoint(
481
485
  this,
@@ -507,7 +511,7 @@ let DocumentClient$1 = class DocumentClient extends Client {
507
511
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
508
512
  */
509
513
  async reserveNumber(salesChannelId, type, preview) {
510
- const response = await this.post(`/_action/number-range/reserve/${type}/${salesChannelId}`, {
514
+ const response = await this.get(`/_action/number-range/reserve/${type}/${salesChannelId}`, {
511
515
  query: { preview },
512
516
  headers: { Accept: "application/json" }
513
517
  });
@@ -760,7 +764,8 @@ let OrderClient$1 = class OrderClient extends Client {
760
764
  const response = await this.post(`/_action/order/document/${documentTypeName}/create`, {
761
765
  body: new JsonPayload(request)
762
766
  });
763
- if (response.statusCode === 200) return;
767
+ if (response.statusCode === 200)
768
+ return response.body.data;
764
769
  throw new ShopwareError("Failed to create documents", response);
765
770
  }
766
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
  };
@@ -23,9 +23,10 @@ import { ProductStream } from "./stream/ProductStream";
23
23
  import { Tag } from "../Tag";
24
24
  import { CustomFieldSet } from "../custom/field/set/CustomFieldSet";
25
25
  import { CalculatedPrice } from "#types/api/store/price/CalculatedPrice";
26
+ import { Price } from "#types/api/global";
26
27
  export type Product = StoreApiProduct & {
27
28
  featureSetId?: string;
28
- price?: Array<CalculatedPrice>;
29
+ price?: Array<Price>;
29
30
  readonly autoIncrement?: number;
30
31
  variantRestrictions?: object;
31
32
  purchasePrices?: Array<CalculatedPrice>;
@@ -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
- static: boolean;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devite/shopware-client",
3
- "version": "1.7.7",
3
+ "version": "1.7.9",
4
4
  "description": "Third party API client for Shopware 6.",
5
5
  "repository": "devite-io/shopware-client",
6
6
  "license": "MIT",