1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//! Code generation from protobuf descriptors.
//!
//! `proto-gen` turns compiled protobuf descriptor bytes into Rust REST-API glue code
//! (Axum handlers, HTTP clients, PyO3 bindings, NAPI bindings, and TypeScript clients).
//!
//! ## Pipeline overview
//!
//! ```text
//! descriptor bytes
//! │
//! ▼
//! parse_file_descriptor_set ← parsing module
//! │ CodeGenMetadata
//! ▼
//! analyze_metadata ← analysis module
//! │ GenerationPlan
//! ▼
//! generate_code ← codegen module
//! │ writes files to CodeGenOutput dirs
//! ▼
//! (generated Rust / Python / TypeScript source files)
//! ```
//!
//! ## Quick-start example
//!
//! ```rust,ignore
//! use std::fs;
//! use olai_codegen::{CodeGenConfig, CodeGenOutput, generate_code, parse_file_descriptor_set};
//! use protobuf::Message;
//! use protobuf::descriptor::FileDescriptorSet;
//!
//! // 1. Load descriptor bytes (produced by `buf build`)
//! let bytes = fs::read("descriptors.bin").unwrap();
//! let fds = FileDescriptorSet::parse_from_bytes(&bytes).unwrap();
//!
//! // 2. Parse into metadata
//! let metadata = parse_file_descriptor_set(&fds).unwrap();
//!
//! // 3. Configure outputs
//! let output = CodeGenOutput {
//! common: "/tmp/out/common".into(),
//! models: Some("/tmp/out/models".into()),
//! models_subdir: "_gen".into(),
//! server: Some("/tmp/out/server".into()),
//! client: Some("/tmp/out/client".into()),
//! python: None,
//! node: None,
//! node_ts: None,
//! python_typings_filename: "client.pyi".into(),
//! };
//!
//! let config = CodeGenConfig {
//! context_type_path: "crate::api::RequestContext".into(),
//! result_type_path: "crate::Result".into(),
//! models_path_template: "my_crate::models::{service}::v1".into(),
//! models_path_crate_template: "crate::models::{service}::v1".into(),
//! output,
//! generate_resource_enum: true,
//! generate_store_integration: false,
//! error_type_path: None,
//! generate_object_conversions: false,
//! bindings: None,
//! models_gen_dir: None,
//! resource_store_crate_name: "olai_store".into(),
//! };
//!
//! // 4. Optionally validate before running
//! config.validate().unwrap();
//!
//! // 5. Generate
//! generate_code(&metadata, &config).unwrap();
//! ```
pub use *;
pub use ;
pub use ;
// Note: MethodPlanner is pub(crate) — it is an internal helper, not part of the public API.
pub use run as enrich_openapi;
pub use HttpPattern;
pub use ;
pub use ;
/// The `FieldBehavior` enum from `google.api.field_behavior`, re-exported for
/// consumers that need to inspect field behavior annotations (e.g. in tests).
pub use FieldBehavior;
// Prost-generated Google API proto types — internal only.
pub
pub