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
//! PCS External API client for Ppoppo Chat System.
//!
//! Provides a domain-typed gRPC client for the PCS External Developer
//! Platform (`chat.external` package).
//!
//! # Hot path (v0.2.0+)
//!
//! Most consumers want [`pcs_port::GrpcPcsAdapter`] — a port abstraction
//! that hides tonic/prost types behind two domain-typed methods
//! (`send_alert`, `get_send_status`) plus an explicit escape hatch
//! ([`pcs_port::RawPcsChannel`]) for the long tail of admin / template /
//! polling RPCs.
//!
//! ```no_run
//! # async fn example() -> Result<(), pcs_external::Error> {
//! use pcs_external::pcs_port::{
//! GrpcPcsAdapter, PcsExternalPort, RecipientList, Ppnum, TemplateId,
//! };
//!
//! let pcs = GrpcPcsAdapter::from_env().await?;
//! let recipients = RecipientList::from_ppnums(vec![
//! Ppnum::try_new("12345678901").map_err(|e| pcs_external::Error::External(e.to_string()))?,
//! ])
//! .map_err(|e| pcs_external::Error::External(e.to_string()))?;
//! let _ = pcs
//! .send_alert(&TemplateId::new("tmpl_attendance_v1"), &recipients, None)
//! .await;
//! # Ok(())
//! # }
//! ```
//!
//! # Tests
//!
//! Behind `test-support`, [`pcs_port::MemoryPcsExternal`] is an
//! in-process fake of [`pcs_port::PcsExternalPort`] suitable for
//! consumer-side integration tests without a live PCS endpoint.
//!
//! # Legacy surface
//!
//! [`connect`], [`auth_request`], [`ExternalChannel`] remain available
//! for v0.1.0 consumers and for the [`pcs_port::RawPcsChannel`] escape
//! hatch. The free `connect` / `auth_request` entry points are marked
//! `#[deprecated]` and slated for removal in v0.3.0.
// Re-exports
pub use Error;
pub use ;
pub use connect;
pub use prost_types;
pub use tonic;