refactor(shorebird_code_push_client): rename package and support getApps (#64)

This commit is contained in:
Felix Angelov
2023-03-14 12:07:29 -05:00
committed by GitHub
parent 25231b36c7
commit c20190600c
20 changed files with 461 additions and 281 deletions
@@ -0,0 +1,45 @@
## Shorebird CodePush Client
The Shorebird CodePush Client is a Dart library which allows Dart applications to interact with the ShoreBird CodePush API.
### Installing
To get started, add the library to your `pubspec.yaml`:
```yaml
dependencies:
shorebird_code_push_client:
git:
url: https://github.com/shorebirdtech/shorebird
path: packages/shorebird_code_push_client
```
### Usage
```dart
import 'package:shorebird_code_push_client/shorebird_code_push_client.dart';
Future<void> main() async {
final client = CodePushClient(apiKey: '<API KEY>');
// Download the latest engine revision.
final engine = await client.downloadEngine('latest');
// Create a new Shorebird application.
await client.createApp(productId: '<PRODUCT ID>');
// List all apps.
final apps = await client.getApps();
// Create a new patch.
await client.createPatch(
artifactPath: '<PATH TO ARTIFACT>', // e.g. 'libapp.so'
baseVersion: '<BASE VERSION>', // e.g. '1.0.0'
productId: '<PRODUCT ID>', // e.g. 'shorebird-example'
channel: '<CHANNEL>', // e.g. 'stable'
);
// Close the client.
client.close();
}
```