Skip to content

Commit

Permalink
chore: cleanup readme and add zipline to examples (#54)
Browse files Browse the repository at this point in the history
chore: cleanup readme and add zipline to examples
  • Loading branch information
castdrian committed Dec 30, 2023
2 parents 9a69986 + 9f07637 commit 20c4260
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 31 deletions.
63 changes: 32 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
</p>

## 🚀 Features

1. **Versatile Screen Capture**:
1. **Versatile Screen Capture**:
- **Custom Region**: Instantly and easily define and capture specific portions of your screen.
- **Window Capture**: Capture individual application windows without any clutter.
- **Entire Display Capture**: Snapshot your whole screen with a single action.
Expand All @@ -80,6 +79,7 @@

![ishare_menu](https://github.com/iGerman00/ishare/assets/36676880/3a546afb-90ee-4b85-8b38-6029ccd67565)


## 🛠 Custom Uploader Setup

If you're looking to integrate a custom endpoint for uploads using ishare, you're in the right place! By default, ishare supports and opens `.iscu` files for configuration. They are text files containing JSON data and you can make your own:
Expand All @@ -88,88 +88,89 @@ If you're looking to integrate a custom endpoint for uploads using ishare, you'r

<details>
<summary>
📝 Specification (Version 2.0.0)
📝 Specification (2.0.0 and newer)
</summary>

The custom uploader specification in version 2.0.0 has the following structure:
The custom uploader specification since version 2.0.0 has the following structure:

```json
```jsonc
{
"name": "Custom Uploader Name",
"requestURL": "https://your-upload-url.com/upload",
"requestURL": "https://uploader.com/upload",
"headers": { // optional
"Authorization": "Bearer YOUR_AUTH_TOKEN"
},
"formData": { // optional
"additionalData": "value"
},
"fileFormName": "file", // optional
"requestBodyType": "multipartFormData", // optional, choice of multipartFormData and binary
"responseURL": "https://your-upload-url.com/{{jsonproperty}}",
"deletionURL": "https://your-upload-url.com/delete/{{jsonproperty}}" // optional
"requestBodyType": "multipartFormData", // optional, can be "multipartFormData" or "binary"
"responseURL": "https://uploader.com/{{jsonproperty}}",
"deletionURL": "https://uploader.com/{{jsonproperty}}" // optional
}
```
<sup>All properties are case insensitive.</sup>

This new specification allows for more dynamic URL construction and handling deletion URLs.
This new specification allows for more dynamic URL construction and handles deletion URLs.
For `responseURL` and `deletionURL`, JSON properties that are derived from the response payload can be defined as `{{jsonProperty}}`. There is support for nesting (`upload.url`) and arrays (`files[0].url`).

</details>

## ⚙️ Migration Guide from Previous Specification

## ⚙️ Migration from Previous Specification
<details>
<summary>Click to expand</summary>

### Key Changes in Specification

### Key changes
- `responseURL` replaces `responseProp`.
- New optional field `deletionURL`.
- Updated URL templating syntax.

### Migration Steps

### Migration steps
1. Replace `responseProp` with `responseURL`, ensuring the URL includes placeholders for dynamic values.
2. If your service supports deletion, add the `deletionURL` field.
3. Update URL placeholders to match the new syntax. For instance, `{fileId}` replaces `{responsePropName}`.
2. If your service provides a deletion link, add the `deletionURL` field.
3. Update URL placeholders to match the new syntax:

### Example Migration
For example,
```json
"responseProp": "fileId"
```
Turns into:
```json
"responseURL": "{{fileId}}"
```

Previous spec:
### Example migration
Before:

```json
{
"name": "uploader",
"requestUrl": "https://uploader.com/upload",
"requestURL": "https://uploader.com/upload",
"responseProp": "fileUrl"
}
```

New spec:

```json
After:
```jsonc
{
"name": "uploader",
"requestURL": "https://uploader.com/upload",
"responseURL": "{{fileUrl}}" // can be concatenated: "https://uploader.com/{{property}}"
"responseURL": "{{fileUrl}}" // also supported: "https://uploader.com/{{fileId}}"
}
```

</details>

## 📤 Compatible Uploader Services

ishare is confirmed to be compatible with the following uploader services:

- [chibisafe](https://github.com/chibisafe/chibisafe)
- [lumen](https://github.com/ChecksumDev/lumen)
- [zipline](https://github.com/diced/zipline)

## 🤝 Contributors

[![Contributors](https://contrib.rocks/image?repo=castdrian/ishare)](https://github.com/castdrian/ishare/graphs/contributors)

## 🙌 Credits

- Special thanks to [Inna Strazhnik](https://www.behance.net/strazhnik) for the app icon

## 📜 License

Released under [GPL-3.0](/LICENSE) by [@castdrian](https://github.com/castdrian)
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ ishare is confirmed to be compatible with the following uploader services:

- [chibisafe](https://github.com/chibisafe/chibisafe)
- [lumen](https://github.com/ChecksumDev/lumen)
- [zipline](https://github.com/diced/zipline)
9 changes: 9 additions & 0 deletions examples/zipline.iscu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Zipline",
"requestURL": "https://your-zipline-host.com/api/upload",
"headers": {
"Authorization": "YOUR.TOKEN",
},
"responseURL": "{{files[0]}}",
"fileFormName": "file"
}

0 comments on commit 20c4260

Please sign in to comment.