diff --git a/tests/e2e/api/CHANGELOG.md b/tests/e2e/api/CHANGELOG.md index a2c57debaf4..605741512f5 100644 --- a/tests/e2e/api/CHANGELOG.md +++ b/tests/e2e/api/CHANGELOG.md @@ -1,5 +1,12 @@ # Unreleased +## Added + +- Support for orders. + +## Changed + +- `delete()` now deletes products and coupons instead of moving to `trash`. # 0.1.2 @@ -14,7 +21,7 @@ ## Breaking Changes -- The `HTTPClientFactory` API was changed to make it easier to configure instances with +- The `HTTPClientFactory` API was changed to make it easier to configure instances ## Added diff --git a/tests/e2e/api/README.md b/tests/e2e/api/README.md index 7eadd2d5de1..21398557049 100644 --- a/tests/e2e/api/README.md +++ b/tests/e2e/api/README.md @@ -6,7 +6,7 @@ features: - [x] TypeScript Definitions - [x] Axios API Client with support for OAuth & basic auth - [x] Repositories to simplify interaction with basic data types -- [ ] Service classes for common activities such as changing settings +- [x] Service classes for common activities such as changing settings ## Usage @@ -51,12 +51,20 @@ httpClient.get( '/wc/v3/products' ).then( ( response ) => { As a convenience utility we've created repositories for core data types that can simplify interacting with the API: +#### Parent/Base Repositories + - `SimpleProduct` - `ExternalProduct` - `GroupedProduct` - `VariableProduct` -- `ProductVariation` - `Coupon` +- `Order` +- `SettingsGroup` + +#### Child Repositories + +- `ProductVariation` +- `Setting` These repositories provide CRUD methods for ease-of-use: @@ -80,7 +88,7 @@ product.id; #### Repository Methods -The following methods are available on all repositories: +The following methods are available on all repositories if the corresponding method is available on the API endpoint: - `create( {...properties} )` - Create a single object of the model type - `delete( objectId )` - Delete a single object of the model type @@ -90,14 +98,14 @@ The following methods are available on all repositories: #### Child Repositories -`ProductVariation` is a child model repository. In child model repositories, each method requires the `parentId` as the first parameter: +In child model repositories, each method requires the `parentId` as the first parameter: ```javascript import { HTTPClientFactory, VariableProduct, ProductVariation } from '@woocommerce/api'; const httpClient = HTTPClientFactory.build( 'https://example.com' ) .withBasicAuth( 'username', 'password' ) - .withIndexPermalinks() + .withIndexPermalinks() .create(); const productRepository = VariableProduct.restRepository( httpClient );