···
+
// @generated by jacquard-lexicon. DO NOT EDIT.
+
// Lexicon: place.wisp.settings
+
// This file was automatically generated from Lexicon schemas.
+
// Any manual changes will be overwritten on the next regeneration.
+
/// Custom HTTP header configuration
+
#[jacquard_derive::lexicon]
+
jacquard_derive::IntoStatic,
+
#[serde(rename_all = "camelCase")]
+
pub struct CustomHeader<'a> {
+
/// HTTP header name (e.g., 'Cache-Control', 'X-Frame-Options')
+
pub name: jacquard_common::CowStr<'a>,
+
/// Optional glob pattern to apply this header to specific paths (e.g., '*.html', '/assets/*'). If not specified, applies to all paths.
+
#[serde(skip_serializing_if = "std::option::Option::is_none")]
+
pub path: std::option::Option<jacquard_common::CowStr<'a>>,
+
pub value: jacquard_common::CowStr<'a>,
+
fn lexicon_doc_place_wisp_settings() -> ::jacquard_lexicon::lexicon::LexiconDoc<
+
::jacquard_lexicon::lexicon::LexiconDoc {
+
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
+
id: ::jacquard_common::CowStr::new_static("place.wisp.settings"),
+
let mut map = ::std::collections::BTreeMap::new();
+
::jacquard_common::smol_str::SmolStr::new_static("customHeader"),
+
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
+
::jacquard_common::CowStr::new_static(
+
"Custom HTTP header configuration",
+
::jacquard_common::smol_str::SmolStr::new_static("name"),
+
::jacquard_common::smol_str::SmolStr::new_static("value")
+
let mut map = ::std::collections::BTreeMap::new();
+
::jacquard_common::smol_str::SmolStr::new_static("name"),
+
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
+
::jacquard_common::CowStr::new_static(
+
"HTTP header name (e.g., 'Cache-Control', 'X-Frame-Options')",
+
max_length: Some(100usize),
+
::jacquard_common::smol_str::SmolStr::new_static("path"),
+
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
+
::jacquard_common::CowStr::new_static(
+
"Optional glob pattern to apply this header to specific paths (e.g., '*.html', '/assets/*'). If not specified, applies to all paths.",
+
max_length: Some(500usize),
+
::jacquard_common::smol_str::SmolStr::new_static("value"),
+
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
+
::jacquard_common::CowStr::new_static("HTTP header value"),
+
max_length: Some(1000usize),
+
::jacquard_common::smol_str::SmolStr::new_static("main"),
+
::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
+
::jacquard_common::CowStr::new_static(
+
"Configuration settings for a static site hosted on wisp.place",
+
key: Some(::jacquard_common::CowStr::new_static("any")),
+
record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
+
let mut map = ::std::collections::BTreeMap::new();
+
::jacquard_common::smol_str::SmolStr::new_static(
+
::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
+
::jacquard_common::smol_str::SmolStr::new_static(
+
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
+
::jacquard_common::CowStr::new_static(
+
"Custom 404 error page file path. Incompatible with directoryListing and spaMode.",
+
max_length: Some(500usize),
+
::jacquard_common::smol_str::SmolStr::new_static(
+
::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
+
::jacquard_common::smol_str::SmolStr::new_static("headers"),
+
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
+
::jacquard_common::CowStr::new_static(
+
"Custom HTTP headers to set on responses",
+
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
+
r#ref: ::jacquard_common::CowStr::new_static(
+
max_length: Some(50usize),
+
::jacquard_common::smol_str::SmolStr::new_static(
+
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
+
::jacquard_common::CowStr::new_static(
+
"Ordered list of files to try when serving a directory. Defaults to ['index.html'] if not specified.",
+
items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
+
max_length: Some(255usize),
+
max_length: Some(10usize),
+
::jacquard_common::smol_str::SmolStr::new_static("spaMode"),
+
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
+
::jacquard_common::CowStr::new_static(
+
"File to serve for all routes (e.g., 'index.html'). When set, enables SPA mode where all non-file requests are routed to this file. Incompatible with directoryListing and custom404.",
+
max_length: Some(500usize),
+
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CustomHeader<'a> {
+
fn nsid() -> &'static str {
+
fn def_name() -> &'static str {
+
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
+
lexicon_doc_place_wisp_settings()
+
) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
+
let value = &self.name;
+
#[allow(unused_comparisons)]
+
if <str>::len(value.as_ref()) > 100usize {
+
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
+
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
+
actual: <str>::len(value.as_ref()),
+
if let Some(ref value) = self.path {
+
#[allow(unused_comparisons)]
+
if <str>::len(value.as_ref()) > 500usize {
+
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
+
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
+
actual: <str>::len(value.as_ref()),
+
let value = &self.value;
+
#[allow(unused_comparisons)]
+
if <str>::len(value.as_ref()) > 1000usize {
+
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
+
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
+
actual: <str>::len(value.as_ref()),
+
/// Configuration settings for a static site hosted on wisp.place
+
#[jacquard_derive::lexicon]
+
jacquard_derive::IntoStatic
+
#[serde(rename_all = "camelCase")]
+
pub struct Settings<'a> {
+
/// Enable clean URL routing. When enabled, '/about' will attempt to serve '/about.html' or '/about/index.html' automatically.
+
#[serde(skip_serializing_if = "std::option::Option::is_none")]
+
pub clean_urls: std::option::Option<bool>,
+
/// Custom 404 error page file path. Incompatible with directoryListing and spaMode.
+
#[serde(skip_serializing_if = "std::option::Option::is_none")]
+
pub custom404: std::option::Option<jacquard_common::CowStr<'a>>,
+
/// Enable directory listing mode for paths that resolve to directories without an index file. Incompatible with spaMode.
+
#[serde(skip_serializing_if = "std::option::Option::is_none")]
+
pub directory_listing: std::option::Option<bool>,
+
/// Custom HTTP headers to set on responses
+
#[serde(skip_serializing_if = "std::option::Option::is_none")]
+
pub headers: std::option::Option<Vec<crate::place_wisp::settings::CustomHeader<'a>>>,
+
/// Ordered list of files to try when serving a directory. Defaults to ['index.html'] if not specified.
+
#[serde(skip_serializing_if = "std::option::Option::is_none")]
+
pub index_files: std::option::Option<Vec<jacquard_common::CowStr<'a>>>,
+
/// File to serve for all routes (e.g., 'index.html'). When set, enables SPA mode where all non-file requests are routed to this file. Incompatible with directoryListing and custom404.
+
#[serde(skip_serializing_if = "std::option::Option::is_none")]
+
pub spa_mode: std::option::Option<jacquard_common::CowStr<'a>>,
+
pub mod settings_state {
+
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
+
use ::core::marker::PhantomData;
+
/// State trait tracking which required fields have been set
+
pub trait State: sealed::Sealed {}
+
/// Empty state - all required fields are unset
+
impl sealed::Sealed for Empty {}
+
impl State for Empty {}
+
/// Marker types for field names
+
#[allow(non_camel_case_types)]
+
/// Builder for constructing an instance of this type
+
pub struct SettingsBuilder<'a, S: settings_state::State> {
+
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
+
__unsafe_private_named: (
+
::core::option::Option<bool>,
+
::core::option::Option<jacquard_common::CowStr<'a>>,
+
::core::option::Option<bool>,
+
::core::option::Option<Vec<crate::place_wisp::settings::CustomHeader<'a>>>,
+
::core::option::Option<Vec<jacquard_common::CowStr<'a>>>,
+
::core::option::Option<jacquard_common::CowStr<'a>>,
+
_phantom: ::core::marker::PhantomData<&'a ()>,
+
impl<'a> Settings<'a> {
+
/// Create a new builder for this type
+
pub fn new() -> SettingsBuilder<'a, settings_state::Empty> {
+
impl<'a> SettingsBuilder<'a, settings_state::Empty> {
+
/// Create a new builder with all fields unset
+
_phantom_state: ::core::marker::PhantomData,
+
__unsafe_private_named: (None, None, None, None, None, None),
+
_phantom: ::core::marker::PhantomData,
+
impl<'a, S: settings_state::State> SettingsBuilder<'a, S> {
+
/// Set the `cleanUrls` field (optional)
+
pub fn clean_urls(mut self, value: impl Into<Option<bool>>) -> Self {
+
self.__unsafe_private_named.0 = value.into();
+
/// Set the `cleanUrls` field to an Option value (optional)
+
pub fn maybe_clean_urls(mut self, value: Option<bool>) -> Self {
+
self.__unsafe_private_named.0 = value;
+
impl<'a, S: settings_state::State> SettingsBuilder<'a, S> {
+
/// Set the `custom404` field (optional)
+
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
+
self.__unsafe_private_named.1 = value.into();
+
/// Set the `custom404` field to an Option value (optional)
+
pub fn maybe_custom404(
+
value: Option<jacquard_common::CowStr<'a>>,
+
self.__unsafe_private_named.1 = value;
+
impl<'a, S: settings_state::State> SettingsBuilder<'a, S> {
+
/// Set the `directoryListing` field (optional)
+
pub fn directory_listing(mut self, value: impl Into<Option<bool>>) -> Self {
+
self.__unsafe_private_named.2 = value.into();
+
/// Set the `directoryListing` field to an Option value (optional)
+
pub fn maybe_directory_listing(mut self, value: Option<bool>) -> Self {
+
self.__unsafe_private_named.2 = value;
+
impl<'a, S: settings_state::State> SettingsBuilder<'a, S> {
+
/// Set the `headers` field (optional)
+
value: impl Into<Option<Vec<crate::place_wisp::settings::CustomHeader<'a>>>>,
+
self.__unsafe_private_named.3 = value.into();
+
/// Set the `headers` field to an Option value (optional)
+
value: Option<Vec<crate::place_wisp::settings::CustomHeader<'a>>>,
+
self.__unsafe_private_named.3 = value;
+
impl<'a, S: settings_state::State> SettingsBuilder<'a, S> {
+
/// Set the `indexFiles` field (optional)
+
value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>,
+
self.__unsafe_private_named.4 = value.into();
+
/// Set the `indexFiles` field to an Option value (optional)
+
pub fn maybe_index_files(
+
value: Option<Vec<jacquard_common::CowStr<'a>>>,
+
self.__unsafe_private_named.4 = value;
+
impl<'a, S: settings_state::State> SettingsBuilder<'a, S> {
+
/// Set the `spaMode` field (optional)
+
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
+
self.__unsafe_private_named.5 = value.into();
+
/// Set the `spaMode` field to an Option value (optional)
+
pub fn maybe_spa_mode(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
+
self.__unsafe_private_named.5 = value;
+
impl<'a, S> SettingsBuilder<'a, S>
+
S: settings_state::State,
+
/// Build the final struct
+
pub fn build(self) -> Settings<'a> {
+
clean_urls: self.__unsafe_private_named.0,
+
custom404: self.__unsafe_private_named.1,
+
directory_listing: self.__unsafe_private_named.2,
+
headers: self.__unsafe_private_named.3,
+
index_files: self.__unsafe_private_named.4,
+
spa_mode: self.__unsafe_private_named.5,
+
extra_data: Default::default(),
+
/// Build the final struct with custom extra_data
+
pub fn build_with_data(
+
extra_data: std::collections::BTreeMap<
+
jacquard_common::smol_str::SmolStr,
+
jacquard_common::types::value::Data<'a>,
+
clean_urls: self.__unsafe_private_named.0,
+
custom404: self.__unsafe_private_named.1,
+
directory_listing: self.__unsafe_private_named.2,
+
headers: self.__unsafe_private_named.3,
+
index_files: self.__unsafe_private_named.4,
+
spa_mode: self.__unsafe_private_named.5,
+
extra_data: Some(extra_data),
+
impl<'a> Settings<'a> {
+
uri: impl Into<jacquard_common::CowStr<'a>>,
+
jacquard_common::types::uri::RecordUri<'a, SettingsRecord>,
+
jacquard_common::types::uri::UriError,
+
jacquard_common::types::uri::RecordUri::try_from_uri(
+
jacquard_common::types::string::AtUri::new_cow(uri.into())?,
+
/// Typed wrapper for GetRecord response with this collection's record type.
+
jacquard_derive::IntoStatic
+
#[serde(rename_all = "camelCase")]
+
pub struct SettingsGetRecordOutput<'a> {
+
#[serde(skip_serializing_if = "std::option::Option::is_none")]
+
pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
+
pub uri: jacquard_common::types::string::AtUri<'a>,
+
pub value: Settings<'a>,
+
impl From<SettingsGetRecordOutput<'_>> for Settings<'_> {
+
fn from(output: SettingsGetRecordOutput<'_>) -> Self {
+
use jacquard_common::IntoStatic;
+
output.value.into_static()
+
impl jacquard_common::types::collection::Collection for Settings<'_> {
+
const NSID: &'static str = "place.wisp.settings";
+
type Record = SettingsRecord;
+
/// Marker type for deserializing records from this collection.
+
#[derive(Debug, serde::Serialize, serde::Deserialize)]
+
pub struct SettingsRecord;
+
impl jacquard_common::xrpc::XrpcResp for SettingsRecord {
+
const NSID: &'static str = "place.wisp.settings";
+
const ENCODING: &'static str = "application/json";
+
type Output<'de> = SettingsGetRecordOutput<'de>;
+
type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
+
impl jacquard_common::types::collection::Collection for SettingsRecord {
+
const NSID: &'static str = "place.wisp.settings";
+
type Record = SettingsRecord;
+
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Settings<'a> {
+
fn nsid() -> &'static str {
+
fn def_name() -> &'static str {
+
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
+
lexicon_doc_place_wisp_settings()
+
) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
+
if let Some(ref value) = self.custom404 {
+
#[allow(unused_comparisons)]
+
if <str>::len(value.as_ref()) > 500usize {
+
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
+
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
+
actual: <str>::len(value.as_ref()),
+
if let Some(ref value) = self.headers {
+
#[allow(unused_comparisons)]
+
if value.len() > 50usize {
+
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
+
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
+
if let Some(ref value) = self.index_files {
+
#[allow(unused_comparisons)]
+
if value.len() > 10usize {
+
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
+
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
+
if let Some(ref value) = self.spa_mode {
+
#[allow(unused_comparisons)]
+
if <str>::len(value.as_ref()) > 500usize {
+
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
+
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
+
actual: <str>::len(value.as_ref()),