This repository has been archived by the owner on Dec 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
465 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,45 @@ | ||
# canva | ||
# Canva Module | ||
|
||
> TODO: this module needs to be finished, just rough start | ||
To get started | ||
|
||
```vlang | ||
This module provides a V client for interacting with the Canva API, enabling programmatic access to Canva's platform features. | ||
|
||
## Setup | ||
|
||
1. Create an account on [Canva Developer Portal](https://www.canva.com/developers/) | ||
2. Create or select your application | ||
3. Generate an API token | ||
4. Configure the client using heroscript: | ||
```v | ||
import freeflowuniverse.crystallib.clients.canva | ||
mut client:= canva.get()! | ||
heroscript := " | ||
!!canva.configure | ||
name:'my_instance' | ||
secret:'your-api-token-here' | ||
" | ||
client... | ||
// Apply the configuration (only needs to be done once) | ||
canva.play(heroscript: heroscript)! | ||
``` | ||
|
||
## Usage | ||
|
||
### Initialize Client | ||
```v | ||
// Get a configured client instance | ||
mut cl := canva.get(name: 'my_instance')! | ||
``` | ||
|
||
## example heroscript | ||
### Examples | ||
|
||
```hero | ||
!!canva.configure | ||
secret: '...' | ||
``` | ||
#### Download a Design | ||
```v | ||
// Get client instance | ||
mut cl := canva.get('my_instance')! | ||
// Download a design by ID | ||
design_result := cl.download('your-design-id')! | ||
println('Design downloaded: ${design_result}') | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
!!hero_code.generate_client | ||
name:'openai' | ||
classname:'OpenAIClient' | ||
singleton:0 | ||
default:1 | ||
hasconfig:1 | ||
reset:0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.