Skip to content

Commit 250759f

Browse files
BRBussyclaude
andauthored
Add server-side streaming support and improve documentation infrastructure (#52)
* extend transaction * start transaction service * start * Add streaming support with base client integration across all SDKs Implement production-ready streaming method support with proper validation, authentication, timeout handling, and error management across Go, Java, Python, and TypeScript SDKs. Key changes: - Go: Add ExecuteStream[T,R]() for streaming methods with validation, auth, timeout, tracing - Java: Add executeStream() with validation, timeout, enhanced error context - Python: Add _execute_streaming_method() with validation, auth metadata injection - TypeScript: Add validateRequest() and manual metadata handling for streaming - Update all code generators to use new streaming execution methods - Regenerate SDKs to use ExecuteStream/executeStream/_execute_streaming_method 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add server-side streaming support to protoc-gen-meshdoc Implement streaming detection and documentation generation for gRPC server-side streaming methods in the protoc-gen-meshdoc tool. Changes: - Add IsServerStreaming detection in parser using method.Desc.IsStreamingServer() - Create streaming-specific templates for Go, Python, and Java - Update template selection logic to route streaming methods correctly - Enhance method documentation template with streaming semantics - Regenerate MonitorTransactionState examples with proper streaming patterns Features: - Go streaming: stream.Recv() loop with io.EOF handling - Python streaming: iterator pattern with for...in loop - Java streaming: Iterator<Response> with hasNext()/next() - Stream lifecycle documentation (initiation, data reception, completion) - Clear distinction between stream errors and normal completion 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix documentation broken links by mapping footer to existing architecture files Updated Docusaurus footer configuration to reference correct architecture documentation files: - Group Ownership → resource-hierarchy.mdx - Role-Based Access → method-permissions.mdx - Client Structuring → legal-entities.mdx - Authentication → api-access.mdx Fixed internal cross-references within architecture docs to use correct file paths. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Upgrade Docusaurus to v3.9.1 and fix deprecated config warning - Updated all Docusaurus packages from 3.8.1 to 3.9.1 - Migrated onBrokenMarkdownLinks from top-level config to markdown.hooks.onBrokenMarkdownLinks - Eliminates deprecation warning about Docusaurus v4 compatibility - Build completes successfully with no warnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Disable git-based last update metadata to eliminate build warnings - Set showLastUpdateAuthor and showLastUpdateTime to false - Eliminates "Cannot infer the update date for some files" warning - Removes dependency on git history for documentation metadata - Documentation pages will no longer show last update info 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Rename studio instrument type.proto to instrument_type.proto for clarity Refactored protobuf file naming to be more descriptive: - Renamed type.proto → instrument_type.proto in studio/instrument/v1 - Updated import in wallet/account proto to reference new filename - Regenerated all SDK code (Go, Python, TypeScript) with updated imports This makes the file purpose clearer and follows naming best practices for protobuf definitions containing domain-specific types. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent f646542 commit 250759f

File tree

50 files changed

+3562
-1482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3562
-1482
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Ledger Transaction v1 Service
6+
7+
#### Skip The Details?
8+
- 👉 Jump to **[Package Types](/docs/api-reference/ledger/transaction/v1/type)**
9+
- 👉 Jump to **[Service Methods](/docs/api-reference/ledger/transaction/v1/service)**
10+
11+
{/*
12+
Generated by protoc-gen-meshdoc the first time.
13+
-> This file can be edited manually to add information about the Ledger Transaction Service.
14+
15+
THIS COMMENT AND EVERYTHING ABOVE IT IS AUTOGENERATED
16+
*/}
17+
18+
:::warning[SDK and Documentation Under Construction 🚧]
19+
This warning will be removed once complete and ready for use.
20+
:::
21+
22+
## Overview
23+
24+
TransactionService manages Transaction lifecycle.
25+
26+
Add your custom documentation for the Ledger Transaction v1 service here.
27+
This file is generated once and can be manually edited to provide
28+
service-specific information, examples, and usage guidance.
29+
30+
## Quick Start
31+
32+
1. **Configure your client** with the appropriate credentials
33+
2. **Choose your operations** from the available service methods
34+
3. **Review the types** to understand request/response structures
35+
36+
## Common Workflows
37+
38+
Add common workflow documentation here specific to this service.
39+
40+
## Authentication & Authorization
41+
42+
This service requires appropriate role-based permissions.
43+
See the individual method documentation for specific role requirements.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package main
2+
3+
import (
4+
"context"
5+
"log"
6+
7+
transactionv1 "github.com/meshtrade/api/go/ledger/transaction/v1"
8+
)
9+
10+
func main() {
11+
ctx := context.Background()
12+
13+
// Default configuration is used and credentials come from MESH_API_CREDENTIALS
14+
// environment variable or default discovery methods. Zero config required
15+
// unless you want custom configuration.
16+
service, err := transactionv1.NewTransactionService()
17+
if err != nil {
18+
log.Fatalf("Failed to create service: %v", err)
19+
}
20+
defer service.Close()
21+
22+
// Create request with service-specific parameters
23+
request := &transactionv1.GetTransactionStateRequest{
24+
// FIXME: Populate service-specific request fields
25+
}
26+
27+
// Call the GetTransactionState method
28+
response, err := service.GetTransactionState(ctx, request)
29+
if err != nil {
30+
log.Fatalf("GetTransactionState failed: %v", err)
31+
}
32+
33+
// FIXME: Add relevant response object usage
34+
log.Printf("GetTransactionState successful: %+v", response)
35+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import co.meshtrade.api.ledger.transaction.v1.TransactionService;
2+
import co.meshtrade.api.ledger.transaction.v1.Service.GetTransactionStateRequest;
3+
import co.meshtrade.api.ledger.transaction.v1.Service.GetTransactionStateResponse;
4+
5+
import java.util.Optional;
6+
7+
public class GetTransactionStateExample {
8+
public static void main(String[] args) {
9+
// Default configuration is used and credentials come from MESH_API_CREDENTIALS
10+
// environment variable or default discovery methods. Zero config required
11+
// unless you want custom configuration.
12+
try (TransactionService service = new TransactionService()) {
13+
// Create request with service-specific parameters
14+
GetTransactionStateRequest request = GetTransactionStateRequest.newBuilder()
15+
// FIXME: Populate service-specific request fields
16+
.build();
17+
18+
// Call the GetTransactionState method
19+
GetTransactionStateResponse response = service.getTransactionState(request, Optional.empty());
20+
21+
// FIXME: Add relevant response object usage
22+
System.out.println("GetTransactionState successful: " + response);
23+
} catch (Exception e) {
24+
System.err.println("GetTransactionState failed: " + e.getMessage());
25+
e.printStackTrace();
26+
}
27+
}
28+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from meshtrade.ledger.transaction.v1 import (
2+
GetTransactionStateRequest,
3+
TransactionService,
4+
)
5+
6+
7+
def main():
8+
# Default configuration is used and credentials come from MESH_API_CREDENTIALS
9+
# environment variable or default discovery methods. Zero config required
10+
# unless you want custom configuration.
11+
service = TransactionService()
12+
13+
with service:
14+
# Create request with service-specific parameters
15+
request = GetTransactionStateRequest(
16+
# FIXME: Populate service-specific request fields
17+
)
18+
19+
# Call the GetTransactionState method
20+
response = service.get_transaction_state(request)
21+
22+
# FIXME: Add relevant response object usage
23+
print("GetTransactionState successful:", response)
24+
25+
26+
if __name__ == "__main__":
27+
main()
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package main
2+
3+
import (
4+
"context"
5+
"io"
6+
"log"
7+
8+
transactionv1 "github.com/meshtrade/api/go/ledger/transaction/v1"
9+
)
10+
11+
func main() {
12+
ctx := context.Background()
13+
14+
// Default configuration is used and credentials come from MESH_API_CREDENTIALS
15+
// environment variable or default discovery methods. Zero config required
16+
// unless you want custom configuration.
17+
service, err := transactionv1.NewTransactionService()
18+
if err != nil {
19+
log.Fatalf("Failed to create service: %v", err)
20+
}
21+
defer service.Close()
22+
23+
// Create request with service-specific parameters
24+
request := &transactionv1.MonitorTransactionStateRequest{
25+
// FIXME: Populate service-specific request fields
26+
}
27+
28+
// Call the MonitorTransactionState streaming method
29+
stream, err := service.MonitorTransactionState(ctx, request)
30+
if err != nil {
31+
log.Fatalf("Failed to initiate stream: %v", err)
32+
}
33+
34+
// Consume stream responses
35+
for {
36+
response, err := stream.Recv()
37+
if err == io.EOF {
38+
break // Stream completed normally
39+
}
40+
if err != nil {
41+
log.Fatalf("Stream error: %v", err)
42+
}
43+
44+
// Process each response as it arrives
45+
log.Printf("Received: %+v", response)
46+
}
47+
48+
log.Println("Stream completed successfully")
49+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import co.meshtrade.api.ledger.transaction.v1.TransactionService;
2+
import co.meshtrade.api.ledger.transaction.v1.Service.MonitorTransactionStateRequest;
3+
import co.meshtrade.api.ledger.transaction.v1.Service.MonitorTransactionStateResponse;
4+
5+
import java.util.Iterator;
6+
import java.util.Optional;
7+
8+
public class MonitorTransactionStateExample {
9+
public static void main(String[] args) {
10+
// Default configuration is used and credentials come from MESH_API_CREDENTIALS
11+
// environment variable or default discovery methods. Zero config required
12+
// unless you want custom configuration.
13+
try (TransactionService service = new TransactionService()) {
14+
// Create request with service-specific parameters
15+
MonitorTransactionStateRequest request = MonitorTransactionStateRequest.newBuilder()
16+
// FIXME: Populate service-specific request fields
17+
.build();
18+
19+
// Call the MonitorTransactionState streaming method
20+
Iterator<MonitorTransactionStateResponse> stream = service.monitorTransactionState(request, Optional.empty());
21+
22+
// Consume stream responses using iterator pattern
23+
while (stream.hasNext()) {
24+
MonitorTransactionStateResponse response = stream.next();
25+
26+
// Process each response as it arrives
27+
System.out.println("Received: " + response);
28+
}
29+
30+
System.out.println("Stream completed successfully");
31+
} catch (Exception e) {
32+
System.err.println("MonitorTransactionState stream failed: " + e.getMessage());
33+
e.printStackTrace();
34+
}
35+
}
36+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from meshtrade.ledger.transaction.v1 import (
2+
MonitorTransactionStateRequest,
3+
TransactionService,
4+
)
5+
6+
7+
def main():
8+
# Default configuration is used and credentials come from MESH_API_CREDENTIALS
9+
# environment variable or default discovery methods. Zero config required
10+
# unless you want custom configuration.
11+
service = TransactionService()
12+
13+
with service:
14+
# Create request with service-specific parameters
15+
request = MonitorTransactionStateRequest(
16+
# FIXME: Populate service-specific request fields
17+
)
18+
19+
# Call the MonitorTransactionState streaming method
20+
stream = service.monitor_transaction_state(request)
21+
22+
try:
23+
# Consume stream responses using iterator pattern
24+
for response in stream:
25+
# Process each response as it arrives
26+
print("Received:", response)
27+
28+
print("Stream completed successfully")
29+
except Exception as e:
30+
print("Stream error:", e)
31+
raise
32+
33+
34+
if __name__ == "__main__":
35+
main()

docs/docs/architecture/api-access.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ x-group: groups/{group_ulid}
1616

1717
**Key Characteristics:**
1818
API keys are generated when creating API users.
19-
- See **[Introduction](/docs/architecture/group-ownership)** or **[IAM API User Service Reference](/docs/api-reference/iam/api_user/v1)** for more.
19+
- See **[Resource Hierarchy](/docs/architecture/resource-hierarchy)** or **[IAM API User Service Reference](/docs/api-reference/iam/api_user/v1)** for more.
2020

2121
### Group Context
2222

docs/docs/architecture/legal-entities.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Understanding how clients define legal entity boundaries within Mesh's hierarchi
77
Clients in Mesh serve as **legal entity boundaries** that define where one legal entity ends and another begins within the hierarchical group structure. Each client represents a distinct legal entity (individual, company, fund, or trust) that has undergone compliance verification and establishes the scope of role assignments for users and API users operating within that entity's organizational structure.
88

99
**The Three-Layer Architecture:**
10-
- **Groups** ([Group Ownership](./group-ownership)): Control resource ownership and access hierarchy
10+
- **Groups** ([Resource Hierarchy](./resource-hierarchy)): Control resource ownership and access hierarchy
1111
- **Clients** (this document): Define legal entity boundaries and available role types
12-
- **Roles** ([Role-Based Access](./role-based-access)): Control method-level API access permissions
12+
- **Roles** ([Role-Based Access Control](./method-permissions)): Control method-level API access permissions
1313

1414
## What are Clients?
1515

@@ -605,14 +605,14 @@ Client verification status provides the compliance foundation for the entire org
605605
## Related Documentation
606606

607607
### Core Architecture Components
608-
- **[Group Ownership Structure](./group-ownership)** - Understanding the hierarchical resource ownership system that provides the foundation for client positioning
609-
- **[Role-Based Access Control](./role-based-access)** - Understanding the role system that clients control and how method-level permissions work
608+
- **[Resource Hierarchy](./resource-hierarchy)** - Understanding the hierarchical resource ownership system that provides the foundation for client positioning
609+
- **[Role-Based Access Control](./method-permissions)** - Understanding the role system that clients control and how method-level permissions work
610610

611611
### API Reference Documentation
612612
- **[Compliance Client Service API Reference](/docs/api-reference/compliance/client/v1)** - Complete API documentation for client management operations and legal entity types
613613
- **[IAM Group Service API Reference](/docs/api-reference/iam/group/v1)** - Complete API documentation for group management operations that own clients
614614
- **[IAM API User Service Reference](/docs/api-reference/iam/api_user/v1)** - Complete API documentation for managing API users and role assignments within client boundaries
615615

616616
### Implementation Guides
617-
- **[Authentication](./authentication)** - API key and group context authentication mechanisms that work with client role boundaries
617+
- **[Authentication](./api-access)** - API key and group context authentication mechanisms that work with client role boundaries
618618
- **[Service Structure](./service-structure)** - Understanding API organization and method patterns that clients control access to

docs/docs/architecture/method-permissions.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Role-Based Access Control (RBAC) in Mesh operates as a **two-layer security mode
88

99
**The Dual Authorization Model:**
1010
- **Roles** (this document): Control method-level access to API operations
11-
- **Groups** ([Group Ownership](./group-ownership)): Control resource-level access through ownership hierarchy
11+
- **Groups** ([Resource Hierarchy](./resource-hierarchy)): Control resource-level access through ownership hierarchy
1212

1313
Our guiding principle is using the **Protobuf schema as the single source of truth** for all authorization rules, ensuring our security model is self-documenting, automatically verifiable, and always in sync with the API contract.
1414

@@ -388,8 +388,8 @@ graph LR
388388

389389
## Related Documentation
390390

391-
- **[Group Ownership Structure](./group-ownership)** - Understanding the resource ownership and hierarchy system that works with roles
392-
- **[Authentication](./authentication)** - API key and group context authentication mechanisms
391+
- **[Resource Hierarchy](./resource-hierarchy)** - Understanding the resource ownership and hierarchy system that works with roles
392+
- **[Authentication](./api-access)** - API key and group context authentication mechanisms
393393
- **[Service Structure](./service-structure)** - Understanding API organization and method patterns
394394
- **[IAM API User Service Reference](/docs/api-reference/iam/api_user/v1)** - Complete API documentation for managing API users and role assignments
395395
- **[IAM Group Service Reference](/docs/api-reference/iam/group/v1)** - Complete API documentation for group management operations

0 commit comments

Comments
 (0)