@devite/shopware-client 1.7.9 → 1.8.0

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
@@ -770,7 +770,7 @@ let OrderClient$1 = class OrderClient extends Client {
770
770
  return response.body.data;
771
771
  throw new ShopwareError("Failed to create documents", response);
772
772
  }
773
- /** Order Management **/
773
+ /** Order State Management **/
774
774
  /**
775
775
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
776
776
  */
@@ -827,6 +827,25 @@ let OrderClient$1 = class OrderClient extends Client {
827
827
  return response.body.data;
828
828
  throw new ShopwareError("Failed to transition delivery state", response);
829
829
  }
830
+ /** Order Tags Management **/
831
+ /**
832
+ * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
833
+ */
834
+ async addTag(orderId, tagId) {
835
+ const response = await this.post(`/order/${orderId}/tags`, {
836
+ body: new JsonPayload({ id: tagId })
837
+ });
838
+ if (response.statusCode === 204) return;
839
+ throw new ShopwareError("Failed to add tag to order", response);
840
+ }
841
+ /**
842
+ * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
843
+ */
844
+ async removeTag(orderId, tagId) {
845
+ const response = await this.delete(`/order/${orderId}/tags/${tagId}`);
846
+ if (response.statusCode === 204) return;
847
+ throw new ShopwareError("Failed to remove tag from order", response);
848
+ }
830
849
  /** Rest Endpoints **/
831
850
  orders = createRestEndpoint(this, "order", "order");
832
851
  addresses = createRestEndpoint(this, "order-address", "order address");
package/dist/index.d.cts CHANGED
@@ -3721,6 +3721,7 @@ type Order = Order$1 & {
3721
3721
  tags?: Array<Tag>;
3722
3722
  createdBy?: User;
3723
3723
  updatedBy?: User;
3724
+ internalComment?: string;
3724
3725
  };
3725
3726
 
3726
3727
  type OrderTransaction = OrderTransaction$1 & {
@@ -3783,7 +3784,7 @@ declare class OrderClient$1 extends Client {
3783
3784
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3784
3785
  */
3785
3786
  createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<DocumentListCreateResponse>;
3786
- /** Order Management **/
3787
+ /** Order State Management **/
3787
3788
  /**
3788
3789
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3789
3790
  */
@@ -3809,6 +3810,15 @@ declare class OrderClient$1 extends Client {
3809
3810
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3810
3811
  */
3811
3812
  transitionDeliveryState(deliveryId: string, transition: string, request: StateTransitionRequest): Promise<StateMachineTransition>;
3813
+ /** Order Tags Management **/
3814
+ /**
3815
+ * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3816
+ */
3817
+ addTag(orderId: string, tagId: string): Promise<void>;
3818
+ /**
3819
+ * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3820
+ */
3821
+ removeTag(orderId: string, tagId: string): Promise<void>;
3812
3822
  /** Rest Endpoints **/
3813
3823
  orders: {
3814
3824
  getList: (query?: Criteria) => Promise<{
package/dist/index.d.mts CHANGED
@@ -3721,6 +3721,7 @@ type Order = Order$1 & {
3721
3721
  tags?: Array<Tag>;
3722
3722
  createdBy?: User;
3723
3723
  updatedBy?: User;
3724
+ internalComment?: string;
3724
3725
  };
3725
3726
 
3726
3727
  type OrderTransaction = OrderTransaction$1 & {
@@ -3783,7 +3784,7 @@ declare class OrderClient$1 extends Client {
3783
3784
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3784
3785
  */
3785
3786
  createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<DocumentListCreateResponse>;
3786
- /** Order Management **/
3787
+ /** Order State Management **/
3787
3788
  /**
3788
3789
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3789
3790
  */
@@ -3809,6 +3810,15 @@ declare class OrderClient$1 extends Client {
3809
3810
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3810
3811
  */
3811
3812
  transitionDeliveryState(deliveryId: string, transition: string, request: StateTransitionRequest): Promise<StateMachineTransition>;
3813
+ /** Order Tags Management **/
3814
+ /**
3815
+ * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3816
+ */
3817
+ addTag(orderId: string, tagId: string): Promise<void>;
3818
+ /**
3819
+ * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3820
+ */
3821
+ removeTag(orderId: string, tagId: string): Promise<void>;
3812
3822
  /** Rest Endpoints **/
3813
3823
  orders: {
3814
3824
  getList: (query?: Criteria) => Promise<{
package/dist/index.d.ts CHANGED
@@ -3721,6 +3721,7 @@ type Order = Order$1 & {
3721
3721
  tags?: Array<Tag>;
3722
3722
  createdBy?: User;
3723
3723
  updatedBy?: User;
3724
+ internalComment?: string;
3724
3725
  };
3725
3726
 
3726
3727
  type OrderTransaction = OrderTransaction$1 & {
@@ -3783,7 +3784,7 @@ declare class OrderClient$1 extends Client {
3783
3784
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3784
3785
  */
3785
3786
  createDocuments(documentTypeName: string, request: DocumentListCreateRequest): Promise<DocumentListCreateResponse>;
3786
- /** Order Management **/
3787
+ /** Order State Management **/
3787
3788
  /**
3788
3789
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3789
3790
  */
@@ -3809,6 +3810,15 @@ declare class OrderClient$1 extends Client {
3809
3810
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3810
3811
  */
3811
3812
  transitionDeliveryState(deliveryId: string, transition: string, request: StateTransitionRequest): Promise<StateMachineTransition>;
3813
+ /** Order Tags Management **/
3814
+ /**
3815
+ * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3816
+ */
3817
+ addTag(orderId: string, tagId: string): Promise<void>;
3818
+ /**
3819
+ * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
3820
+ */
3821
+ removeTag(orderId: string, tagId: string): Promise<void>;
3812
3822
  /** Rest Endpoints **/
3813
3823
  orders: {
3814
3824
  getList: (query?: Criteria) => Promise<{
package/dist/index.mjs CHANGED
@@ -768,7 +768,7 @@ let OrderClient$1 = class OrderClient extends Client {
768
768
  return response.body.data;
769
769
  throw new ShopwareError("Failed to create documents", response);
770
770
  }
771
- /** Order Management **/
771
+ /** Order State Management **/
772
772
  /**
773
773
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
774
774
  */
@@ -825,6 +825,25 @@ let OrderClient$1 = class OrderClient extends Client {
825
825
  return response.body.data;
826
826
  throw new ShopwareError("Failed to transition delivery state", response);
827
827
  }
828
+ /** Order Tags Management **/
829
+ /**
830
+ * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
831
+ */
832
+ async addTag(orderId, tagId) {
833
+ const response = await this.post(`/order/${orderId}/tags`, {
834
+ body: new JsonPayload({ id: tagId })
835
+ });
836
+ if (response.statusCode === 204) return;
837
+ throw new ShopwareError("Failed to add tag to order", response);
838
+ }
839
+ /**
840
+ * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
841
+ */
842
+ async removeTag(orderId, tagId) {
843
+ const response = await this.delete(`/order/${orderId}/tags/${tagId}`);
844
+ if (response.statusCode === 204) return;
845
+ throw new ShopwareError("Failed to remove tag from order", response);
846
+ }
828
847
  /** Rest Endpoints **/
829
848
  orders = createRestEndpoint(this, "order", "order");
830
849
  addresses = createRestEndpoint(this, "order-address", "order address");
@@ -30,4 +30,5 @@ export type Order = StoreApiOrder & {
30
30
  tags?: Array<Tag>;
31
31
  createdBy?: User;
32
32
  updatedBy?: User;
33
+ internalComment?: string;
33
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devite/shopware-client",
3
- "version": "1.7.9",
3
+ "version": "1.8.0",
4
4
  "description": "Third party API client for Shopware 6.",
5
5
  "repository": "devite-io/shopware-client",
6
6
  "license": "MIT",
@@ -41,20 +41,19 @@
41
41
  "dist"
42
42
  ],
43
43
  "devDependencies": {
44
- "@types/node": "^22.16.5",
44
+ "@types/node": "^22.19.3",
45
45
  "@types/qs": "^6.14.0",
46
- "changelogen": "^0.5.7",
47
- "eslint": "^9.32.0",
48
- "prettier": "^3.6.2",
49
- "typescript": "^5.8.3",
50
- "typescript-eslint": "^8.38.0",
51
- "unbuild": "^3.6.0",
52
- "vitest": "^2.1.9"
46
+ "changelogen": "^0.6.2",
47
+ "eslint": "^9.39.2",
48
+ "prettier": "^3.7.4",
49
+ "typescript": "^5.9.3",
50
+ "typescript-eslint": "^8.51.0",
51
+ "unbuild": "^3.6.1",
52
+ "vitest": "^3.2.4"
53
53
  },
54
54
  "dependencies": {
55
- "ofetch": "^1.4.1",
56
- "ohash": "^1.1.6",
57
- "qs": "^6.14.0"
55
+ "ofetch": "^1.5.1",
56
+ "qs": "^6.14.1"
58
57
  },
59
58
  "imports": {
60
59
  "#types/*": "./dist/types/*.d.ts"