Merge pull request #29902 from woocommerce/packages/api-prep-release
update api package readme & changelog to prep for release
This commit is contained in:
commit
6d17a722b1
|
@ -1,5 +1,12 @@
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Support for orders.
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- `delete()` now deletes products and coupons instead of moving to `trash`.
|
||||||
|
|
||||||
# 0.1.2
|
# 0.1.2
|
||||||
|
|
||||||
|
@ -14,7 +21,7 @@
|
||||||
|
|
||||||
## Breaking Changes
|
## 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
|
## Added
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ features:
|
||||||
- [x] TypeScript Definitions
|
- [x] TypeScript Definitions
|
||||||
- [x] Axios API Client with support for OAuth & basic auth
|
- [x] Axios API Client with support for OAuth & basic auth
|
||||||
- [x] Repositories to simplify interaction with basic data types
|
- [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
|
## 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:
|
As a convenience utility we've created repositories for core data types that can simplify interacting with the API:
|
||||||
|
|
||||||
|
#### Parent/Base Repositories
|
||||||
|
|
||||||
- `SimpleProduct`
|
- `SimpleProduct`
|
||||||
- `ExternalProduct`
|
- `ExternalProduct`
|
||||||
- `GroupedProduct`
|
- `GroupedProduct`
|
||||||
- `VariableProduct`
|
- `VariableProduct`
|
||||||
- `ProductVariation`
|
|
||||||
- `Coupon`
|
- `Coupon`
|
||||||
|
- `Order`
|
||||||
|
- `SettingsGroup`
|
||||||
|
|
||||||
|
#### Child Repositories
|
||||||
|
|
||||||
|
- `ProductVariation`
|
||||||
|
- `Setting`
|
||||||
|
|
||||||
These repositories provide CRUD methods for ease-of-use:
|
These repositories provide CRUD methods for ease-of-use:
|
||||||
|
|
||||||
|
@ -80,7 +88,7 @@ product.id;
|
||||||
|
|
||||||
#### Repository Methods
|
#### 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
|
- `create( {...properties} )` - Create a single object of the model type
|
||||||
- `delete( objectId )` - Delete 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
|
#### 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
|
```javascript
|
||||||
import { HTTPClientFactory, VariableProduct, ProductVariation } from '@woocommerce/api';
|
import { HTTPClientFactory, VariableProduct, ProductVariation } from '@woocommerce/api';
|
||||||
|
|
Loading…
Reference in New Issue