@mittwald/api-models 4.56.0 → 4.57.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.
@@ -41,6 +41,9 @@ export class Customer extends ReferenceModel {
41
41
  });
42
42
  getDetailed = provideReact(() => Customer.get(this.id), [this.id]);
43
43
  findDetailed = provideReact(() => Customer.find(this.id), [this.id]);
44
+ async update(data) {
45
+ await config.behaviors.customer.update(this.id, data);
46
+ }
44
47
  }
45
48
  // Common class for future extension
46
49
  class CustomerCommon extends classes((DataModel), Customer) {
@@ -20,4 +20,11 @@ export const apiCustomerBehaviors = (client) => ({
20
20
  totalCount: extractTotalCountHeader(response),
21
21
  };
22
22
  },
23
+ update: async (id, data) => {
24
+ const response = await client.customer.updateCustomer({
25
+ customerId: id,
26
+ data,
27
+ });
28
+ assertStatus(response, 200);
29
+ },
23
30
  });
@@ -1,7 +1,7 @@
1
1
  import { DataModel } from "../../base/DataModel.js";
2
2
  import { ReferenceModel } from "../../base/ReferenceModel.js";
3
3
  import { AsyncResourceVariant } from "../../lib/provideReact.js";
4
- import { CustomerListItemData, CustomerData, CustomerListQueryData } from "./types.js";
4
+ import { CustomerListItemData, CustomerData, CustomerListQueryData, CustomerUpdateRequestData } from "./types.js";
5
5
  import { ListQueryModel } from "../../base/ListQueryModel.js";
6
6
  import { ListDataModel } from "../../base/ListDataModel.js";
7
7
  import { ServerListQuery } from "../../server/index.js";
@@ -27,6 +27,7 @@ export declare class Customer extends ReferenceModel {
27
27
  };
28
28
  getDetailed: AsyncResourceVariant<CustomerDetailed, []>;
29
29
  findDetailed: AsyncResourceVariant<CustomerDetailed | undefined, []>;
30
+ update(data: CustomerUpdateRequestData): Promise<void>;
30
31
  }
31
32
  declare const CustomerCommon_base: import("polytype").Polytype.ClusteredConstructor<[{
32
33
  new (data: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.CustomerCustomer | {
@@ -1,6 +1,7 @@
1
- import { CustomerListItemData, CustomerData, CustomerListQueryData } from "../types.js";
1
+ import { CustomerListItemData, CustomerData, CustomerListQueryData, CustomerUpdateRequestData } from "../types.js";
2
2
  import { QueryResponseData } from "../../../base/index.js";
3
3
  export interface CustomerBehaviors {
4
4
  find: (id: string) => Promise<CustomerData | undefined>;
5
5
  list: (query?: CustomerListQueryData) => Promise<QueryResponseData<CustomerListItemData>>;
6
+ update: (id: string, data: CustomerUpdateRequestData) => Promise<void>;
6
7
  }
@@ -2,3 +2,4 @@ import { MittwaldAPIV2 } from "@mittwald/api-client";
2
2
  export type CustomerListQueryData = MittwaldAPIV2.Paths.V2Customers.Get.Parameters.Query;
3
3
  export type CustomerData = MittwaldAPIV2.Operations.CustomerGetCustomer.ResponseData;
4
4
  export type CustomerListItemData = MittwaldAPIV2.Operations.CustomerListCustomers.ResponseData[number];
5
+ export type CustomerUpdateRequestData = MittwaldAPIV2.Paths.V2CustomersCustomerId.Put.Parameters.RequestBody;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/api-models",
3
- "version": "4.56.0",
3
+ "version": "4.57.0",
4
4
  "author": "Mittwald CM Service GmbH & Co. KG <opensource@mittwald.de>",
5
5
  "type": "module",
6
6
  "description": "Collection of domain models for coherent interaction with the API",
@@ -74,5 +74,5 @@
74
74
  "optional": true
75
75
  }
76
76
  },
77
- "gitHead": "7ba998d037ca4a5284457033a7b45da9b683d477"
77
+ "gitHead": "8052a83b1cb4e9518f76cf296627ec14f46b3208"
78
78
  }