Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0aba36d
feat: update js sdk to include advanced templating
K-Kumar-01 Jan 21, 2026
78b39f8
feat: add python sdk for advanced templating support
K-Kumar-01 Jan 21, 2026
02e5dee
feat: add go sdk for advanced templating support
K-Kumar-01 Jan 21, 2026
0c70065
feat: add java sdk for advanced templating
K-Kumar-01 Jan 22, 2026
25e0790
tests: add tests for each sdk
K-Kumar-01 Jan 22, 2026
41513b5
docs: add documentation for deliverable generation
K-Kumar-01 Jan 22, 2026
3d427f4
feat: make mimetype non optional
K-Kumar-01 Jan 22, 2026
ec2752e
fix: remove nested variable property
K-Kumar-01 Jan 22, 2026
0680a27
chore: rename functions to generate advanced engine variable
K-Kumar-01 Jan 22, 2026
3604a31
feat: make placeholder non optional field js and go-sdk
K-Kumar-01 Jan 24, 2026
5589a28
feat: make placeholder non optional field py-sdk
K-Kumar-01 Jan 24, 2026
61b5b8b
feat: make placeholder non optional field java-sdk
K-Kumar-01 Jan 24, 2026
d789c9c
docs: update readme for sdks
K-Kumar-01 Jan 24, 2026
15e909e
tests: update tests for python and go-sdks
K-Kumar-01 Jan 24, 2026
4c8718b
tests: update placeholder and name tests for variables
K-Kumar-01 Jan 24, 2026
9307738
chore: update version
K-Kumar-01 Jan 24, 2026
af2dfd2
fix: handle null/undefined values in generate
K-Kumar-01 Jan 25, 2026
e1ba808
fix: allow null/undefined values for variables
K-Kumar-01 Jan 25, 2026
8536a5c
fix: handle null/undefined values for go sdk
K-Kumar-01 Jan 25, 2026
1427785
fix: http client call
K-Kumar-01 Jan 25, 2026
29f91fd
fix: tests for go sdk
K-Kumar-01 Jan 25, 2026
0154849
fix: mimeTypeJson value
K-Kumar-01 Jan 25, 2026
0f36164
tests: pass mimetype during variable creation
K-Kumar-01 Jan 25, 2026
b71583c
refactor: remove JsonProperty decorator
K-Kumar-01 Jan 25, 2026
9f9e65f
tests: fix tests for java-sdk
K-Kumar-01 Jan 25, 2026
b2972e2
tests: fix test failures for java-sdk
K-Kumar-01 Jan 25, 2026
8273e0a
chore: remove filters reference
K-Kumar-01 Jan 25, 2026
afb8ca8
feat: update php sdk to include deliverbale generation
K-Kumar-01 Jan 25, 2026
5586846
chore: fix php-sdk ci issues
K-Kumar-01 Jan 25, 2026
f0138ce
docs: update php-sdk readme
K-Kumar-01 Jan 25, 2026
e9d8ac5
feat: add sdk for rust
K-Kumar-01 Jan 25, 2026
afba7a5
chore: add ci pipeline for rust
K-Kumar-01 Jan 25, 2026
1248db4
chore: fix formatting issues during ci
K-Kumar-01 Jan 25, 2026
6c83f4b
tests: add manual test suite for go
K-Kumar-01 Jan 29, 2026
2d89e64
tests: add manual test suite for java
K-Kumar-01 Jan 29, 2026
223fae6
tests: add manual test suite for js
K-Kumar-01 Jan 29, 2026
bb51eb4
tests: add manual test suite for php
K-Kumar-01 Jan 29, 2026
5b5ab5a
tests: add manual test suite for python
K-Kumar-01 Jan 29, 2026
8e9a982
tests: add manual test suite for rust
K-Kumar-01 Jan 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,47 @@ jobs:

- name: Run tests
run: mvn test -B

test-rust:
name: Test Rust SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/rust-sdk
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache target directory
uses: actions/cache@v4
with:
path: packages/rust-sdk/target
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}

- name: Check formatting
run: cargo fmt -- --check

- name: Run clippy
run: cargo clippy -- -D warnings

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose
50 changes: 50 additions & 0 deletions .github/workflows/publish-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish Rust SDK

on:
push:
tags:
- 'rust-v*'

jobs:
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/rust-sdk
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Check formatting
run: cargo fmt -- --check

- name: Run clippy
run: cargo clippy -- -D warnings

- name: Build
run: cargo build --release --verbose

- name: Run tests
run: cargo test --verbose

- name: Publish to crates.io
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 89 additions & 0 deletions packages/go-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,95 @@ err := client.TurboSign.Resend(ctx, "doc-uuid-here", []string{"recipient-uuid-1"

---

### TurboTemplate

Generate documents from templates with advanced variable substitution.

#### `TurboTemplate.Generate`

Generate a document from a template with variables.

```go
result, err := client.TurboTemplate.Generate(ctx, &turbodocx.GenerateTemplateRequest{
TemplateID: "your-template-uuid",
Name: stringPtr("Generated Contract"),
Description: stringPtr("Contract for Q4 2024"),
Variables: []turbodocx.TemplateVariable{
{Placeholder: "{customer_name}", Name: "customer_name", Value: "Acme Corp"},
{Placeholder: "{contract_date}", Name: "contract_date", Value: "2024-01-15"},
{Placeholder: "{total_amount}", Name: "total_amount", Value: 50000},
},
})

fmt.Printf("Document ID: %s\n", *result.DeliverableID)
```

#### Helper Functions

Use helper functions for cleaner variable creation:

```go
result, err := client.TurboTemplate.Generate(ctx, &turbodocx.GenerateTemplateRequest{
TemplateID: "invoice-template-uuid",
Name: stringPtr("Invoice #1234"),
Description: stringPtr("Monthly invoice"),
Variables: []turbodocx.TemplateVariable{
// Simple text/number variables
turbodocx.NewSimpleVariable("invoice_number", "INV-2024-001"),
turbodocx.NewSimpleVariable("total", 1500),

// Advanced engine variable (access with dot notation: {customer.name}, {customer.address.city})
turbodocx.NewAdvancedEngineVariable("customer", map[string]interface{}{
"name": "Acme Corp",
"email": "[email protected]",
"address": map[string]interface{}{
"street": "123 Main St",
"city": "New York",
"state": "NY",
},
}),

// Arrays for loops ({#items}...{/items})
turbodocx.NewLoopVariable("items", []interface{}{
map[string]interface{}{"name": "Widget A", "quantity": 5, "price": 100},
map[string]interface{}{"name": "Widget B", "quantity": 3, "price": 200},
}),

// Conditionals ({#is_premium}...{/is_premium})
turbodocx.NewConditionalVariable("is_premium", true),

// Images
turbodocx.NewImageVariable("logo", "https://example.com/logo.png"),
},
})
```

#### Advanced Templating Features

TurboTemplate supports Angular-like expressions:

| Feature | Template Syntax | Example |
|:--------|:----------------|:--------|
| Simple substitution | `{variable}` | `{customer_name}` |
| Nested objects | `{object.property}` | `{user.address.city}` |
| Loops | `{#array}...{/array}` | `{#items}{name}: ${price}{/items}` |
| Conditionals | `{#condition}...{/condition}` | `{#is_premium}Premium Member{/is_premium}` |
| Expressions | `{expression}` | `{price * quantity}` |

#### Variable Configuration

| Field | Type | Required | Description |
|:------|:-----|:---------|:------------|
| `Placeholder` | string | Yes | The placeholder in template (e.g., `{name}`) |
| `Name` | string | Yes | Variable name for the templating engine |
| `Value` | interface{} | Yes* | The value to substitute |
| `MimeType` | VariableMimeType | Yes | `MimeTypeText`, `MimeTypeJSON`, `MimeTypeHTML`, `MimeTypeImage`, `MimeTypeMarkdown` |
| `UsesAdvancedTemplatingEngine` | *bool | No | Enable for loops, conditionals, expressions |

*Either `Value` or `Text` must be provided.

---

## Field Types

| Type | Description | Required | Auto-filled |
Expand Down
Loading