Merge pull request #29902 from woocommerce/packages/api-prep-release

update api package readme & changelog to prep for release
This commit is contained in:
Ron Rennick 2021-05-13 16:35:36 -03:00 committed by GitHub
commit 6d17a722b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 6 deletions

View File

@ -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

View File

@ -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,7 +98,7 @@ 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';