Compare commits

..

No commits in common. "c9d37f41ac95bce180cd7b5699185ef945d82ea1" and "e4ab3769ba84a46e23c43a563b199cfcb56aa360" have entirely different histories.

361 changed files with 20090 additions and 6522 deletions

View File

@ -1,73 +0,0 @@
on:
push:
branches:
master
env:
CARGO_TERM_COLOR: always
jobs:
build_x64:
runs_on: docker
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Rust toolchain
uses: https://github.com/actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install additional dependencies
run: apt update && apt-get install -y libclang-dev clang sshpass rsync
- name: Compile release binary
uses: https://github.com/actions-rs/cargo@v1
with:
command: build
args: --bin trifid-api --profile release-ci
- name: Upload binary
run: sshpass -p "${{ secrets.TRIFID_DLCDN_PASSWORD }}" rsync --mkpath -e 'ssh -p ${{ secrets.TRIFID_DLCDN_PORT }} -o StrictHostKeyChecking=no' target/release-ci/trifid-api ${{ secrets.TRIFID_DLCDN_USER }}@${{ secrets.TRIFID_DLCDN_IP }}:${{ secrets.TRIFID_DLCDN_PATH }}/trifid-api/amd64/$GITHUB_SHA/trifid-api
build_arm64:
runs_on: docker-arm64
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Rust toolchain
uses: https://github.com/actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install aarch64 target
run: rustup target add aarch64-unknown-linux-gnu
- name: Install additional dependencies
run: apt update && apt-get install -y libclang-dev clang sshpass rsync gcc-arm-linux-gnueabi gcc-aarch64-linux-gnu
- name: Compile release binary
uses: https://github.com/actions-rs/cargo@v1
env:
RUSTFLAGS: "-C linker=aarch64-linux-gnu-gcc"
with:
command: build
args: --bin trifid-api --target aarch64-unknown-linux-gnu --profile release-ci
- name: Upload binary
run: sshpass -p "${{ secrets.TRIFID_DLCDN_PASSWORD }}" rsync --mkpath -e 'ssh -p ${{ secrets.TRIFID_DLCDN_PORT }} -o StrictHostKeyChecking=no' target/aarch64-unknown-linux-gnu/release-ci/trifid-api ${{ secrets.TRIFID_DLCDN_USER }}@${{ secrets.TRIFID_DLCDN_IP }}:${{ secrets.TRIFID_DLCDN_PATH }}/trifid-api/arm64/$GITHUB_SHA/trifid-api
build_win64:
runs_on: docker
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Rust toolchain
uses: https://github.com/actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install cross-compilation toolchain
run: rustup target add x86_64-pc-windows-gnu
- name: Install additional dependencies
run: apt update && apt-get install -y libclang-dev clang sshpass rsync mingw-w64 zip
- name: Compile release binary
uses: https://github.com/actions-rs/cargo@v1
with:
command: build
args: --bin trifid-api --target x86_64-pc-windows-gnu --profile release-ci
- name: Upload binary
run: sshpass -p "${{ secrets.TRIFID_DLCDN_PASSWORD }}" rsync --mkpath -e 'ssh -p ${{ secrets.TRIFID_DLCDN_PORT }} -o StrictHostKeyChecking=no' target/x86_64-pc-windows-gnu/release-ci/trifid-api.zip ${{ secrets.TRIFID_DLCDN_USER }}@${{ secrets.TRIFID_DLCDN_IP }}:${{ secrets.TRIFID_DLCDN_PATH }}/trifid-api/win64/$GITHUB_SHA/trifid-api.zip

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="trifid@localhost" uuid="39c81b89-3fc4-493f-b203-7a00527cffe6">
<data-source source="LOCAL" name="trifidapi@localhost" uuid="39c81b89-3fc4-493f-b203-7a00527cffe6">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>

View File

@ -13,7 +13,6 @@
<sourceFolder url="file://$MODULE_DIR$/trifid-api-old/trifid_api_entities/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/trifid-api-old/trifid_api_migration/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/trifid-api-derive/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/nebula-config/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />

18
Cargo.lock generated
View File

@ -1025,7 +1025,7 @@ dependencies = [
[[package]]
name = "dnapi-rs"
version = "0.2.3"
version = "0.2.1"
dependencies = [
"base64 0.21.5",
"base64-serde",
@ -1831,14 +1831,6 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "nebula-config"
version = "0.1.0"
dependencies = [
"ipnet",
"serde",
]
[[package]]
name = "nebula-ffi"
version = "1.7.3"
@ -3083,28 +3075,22 @@ dependencies = [
[[package]]
name = "trifid-api"
version = "0.3.0-alpha1"
version = "0.3.0"
dependencies = [
"actix-cors",
"actix-web",
"base64 0.21.5",
"bb8",
"chacha20poly1305",
"chrono",
"diesel",
"diesel-async",
"diesel_migrations",
"dnapi-rs",
"env_logger",
"hex",
"ipnet",
"log",
"mail-send",
"nebula-config",
"rand",
"serde",
"serde_json",
"serde_yaml",
"thiserror",
"toml 0.8.5",
"totp-rs",

View File

@ -5,7 +5,7 @@ members = [
"dnapi-rs",
"tfcli",
"nebula-ffi",
"nebula-config",
"trifid-api",
"trifid-api-derive"
]

View File

@ -1,6 +1,6 @@
[package]
name = "dnapi-rs"
version = "0.2.3"
version = "0.2.1"
edition = "2021"
description = "A rust client for the Defined Networking API"
license = "AGPL-3.0-or-later"

View File

@ -13,7 +13,6 @@ use log::{debug, error};
use reqwest::StatusCode;
use serde::{Deserialize, Serialize};
use std::error::Error;
use reqwest::header::HeaderValue;
use trifid_pki::cert::serialize_ed25519_public;
use trifid_pki::ed25519_dalek::{Signature, Signer, SigningKey, Verifier};
use url::Url;
@ -90,15 +89,10 @@ impl Client {
.send()
.await?;
let empty_hval;
#[allow(clippy::unwrap_used)] {
empty_hval = HeaderValue::from_str("").unwrap();
};
let req_id = resp
.headers()
.get("X-Request-ID")
.unwrap_or(&empty_hval)
.ok_or("Response missing X-Request-ID")?
.to_str()?;
debug!("enrollment request complete {{req_id: {}}}", req_id);

View File

@ -13,7 +13,6 @@ use log::{debug, error, trace};
use reqwest::StatusCode;
use serde::{Deserialize, Serialize};
use std::error::Error;
use reqwest::header::HeaderValue;
use trifid_pki::cert::serialize_ed25519_public;
use trifid_pki::ed25519_dalek::{Signature, Signer, SigningKey, Verifier};
use url::Url;
@ -91,15 +90,10 @@ impl Client {
.body(req_json)
.send()?;
let empty_hval;
#[allow(clippy::unwrap_used)] {
empty_hval = HeaderValue::from_str("").unwrap();
};
let req_id = resp
.headers()
.get("X-Request-ID")
.unwrap_or(&empty_hval)
.ok_or("Response missing X-Request-ID")?
.to_str()?;
debug!("enrollment request complete {{req_id: {}}}", req_id);

View File

@ -13,7 +13,7 @@ pub const DO_UPDATE: &str = "DoUpdate";
base64_serde_type!(Base64Standard, base64::engine::general_purpose::STANDARD);
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
/// `RequestV1` is the version 1 `DNClient` request message.
pub struct RequestV1 {
/// Version is always 1
@ -30,7 +30,7 @@ pub struct RequestV1 {
pub signature: Vec<u8>,
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
/// `RequestWrapper` wraps a `DNClient` request message. It consists of a
/// type and value, with the type string indicating how to interpret the value blob.
pub struct RequestWrapper {
@ -48,14 +48,14 @@ pub struct RequestWrapper {
pub timestamp: String,
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
/// `SignedResponseWrapper` contains a response message and a signature to validate inside `data`.
pub struct SignedResponseWrapper {
/// The response data contained in this message
pub data: SignedResponse,
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
/// `SignedResponse` contains a response message and a signature to validate.
pub struct SignedResponse {
/// The API version - always 1
@ -68,14 +68,14 @@ pub struct SignedResponse {
pub signature: Vec<u8>,
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
/// `CheckForUpdateResponseWrapper` contains a response to `CheckForUpdate` inside "data."
pub struct CheckForUpdateResponseWrapper {
/// The response data contained in this message
pub data: CheckForUpdateResponse,
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
/// `CheckForUpdateResponse` is the response generated for a `CheckForUpdate` request.
pub struct CheckForUpdateResponse {
#[serde(rename = "updateAvailable")]
@ -83,7 +83,7 @@ pub struct CheckForUpdateResponse {
pub update_available: bool,
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
/// `DoUpdateRequest` is the request sent for a `DoUpdate` request.
pub struct DoUpdateRequest {
#[serde(rename = "edPubkeyPEM")]
@ -100,7 +100,7 @@ pub struct DoUpdateRequest {
pub nonce: Vec<u8>,
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
/// A server response to a `DoUpdateRequest`, with the updated config and key information
pub struct DoUpdateResponse {
#[serde(with = "Base64Standard")]
@ -141,7 +141,7 @@ pub struct EnrollRequest {
pub timestamp: String,
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
#[serde(untagged)]
/// The response to an `EnrollRequest`
pub enum EnrollResponse {
@ -157,7 +157,7 @@ pub enum EnrollResponse {
},
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
/// The data included in an successful enrollment.
pub struct EnrollResponseData {
#[serde(with = "Base64Standard")]
@ -176,7 +176,7 @@ pub struct EnrollResponseData {
pub organization: EnrollResponseDataOrg,
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
/// The organization data that this node is now a part of
pub struct EnrollResponseDataOrg {
/// The organization ID that this node is now a part of
@ -185,7 +185,7 @@ pub struct EnrollResponseDataOrg {
pub name: String,
}
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize)]
/// `APIError` represents a single error returned in an API error response.
pub struct APIError {
/// The error code

View File

@ -1,10 +0,0 @@
[package]
name = "nebula-config"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = { version = "1", features = ["derive"] }
ipnet = { version = "2.9", features = ["serde"] }

View File

@ -1,532 +0,0 @@
use std::collections::HashMap;
use std::net::{Ipv4Addr, SocketAddrV4};
use ipnet::{IpNet, Ipv4Net};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfig {
pub pki: NebulaConfigPki,
#[serde(default = "empty_hashmap")]
#[serde(skip_serializing_if = "is_empty_hashmap")]
pub static_host_map: HashMap<Ipv4Addr, Vec<SocketAddrV4>>,
#[serde(skip_serializing_if = "is_none")]
pub lighthouse: Option<NebulaConfigLighthouse>,
#[serde(skip_serializing_if = "is_none")]
pub listen: Option<NebulaConfigListen>,
#[serde(skip_serializing_if = "is_none")]
pub punchy: Option<NebulaConfigPunchy>,
#[serde(default = "cipher_aes")]
#[serde(skip_serializing_if = "is_cipher_aes")]
pub cipher: NebulaConfigCipher,
#[serde(default = "empty_vec")]
#[serde(skip_serializing_if = "is_empty_vec")]
pub preferred_ranges: Vec<IpNet>,
#[serde(skip_serializing_if = "is_none")]
pub relay: Option<NebulaConfigRelay>,
#[serde(skip_serializing_if = "is_none")]
pub tun: Option<NebulaConfigTun>,
#[serde(skip_serializing_if = "is_none")]
pub logging: Option<NebulaConfigLogging>,
#[serde(skip_serializing_if = "is_none")]
pub sshd: Option<NebulaConfigSshd>,
#[serde(skip_serializing_if = "is_none")]
pub firewall: Option<NebulaConfigFirewall>,
#[serde(default = "u64_1")]
#[serde(skip_serializing_if = "is_u64_1")]
pub routines: u64,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub stats: Option<NebulaConfigStats>,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub local_range: Option<Ipv4Net>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigPki {
pub ca: String,
pub cert: String,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub key: Option<String>,
#[serde(default = "empty_vec")]
#[serde(skip_serializing_if = "is_empty_vec")]
pub blocklist: Vec<String>,
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub disconnect_invalid: bool,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigLighthouse {
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub am_lighthouse: bool,
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub serve_dns: bool,
#[serde(skip_serializing_if = "is_none")]
pub dns: Option<NebulaConfigLighthouseDns>,
#[serde(default = "u32_10")]
#[serde(skip_serializing_if = "is_u32_10")]
pub interval: u32,
#[serde(default = "empty_vec")]
#[serde(skip_serializing_if = "is_empty_vec")]
pub hosts: Vec<Ipv4Addr>,
#[serde(default = "empty_hashmap")]
#[serde(skip_serializing_if = "is_empty_hashmap")]
pub remote_allow_list: HashMap<Ipv4Net, bool>,
#[serde(default = "empty_hashmap")]
#[serde(skip_serializing_if = "is_empty_hashmap")]
pub local_allow_list: HashMap<Ipv4Net, bool>, // `interfaces` is not supported
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigLighthouseDns {
#[serde(default = "string_empty")]
#[serde(skip_serializing_if = "is_string_empty")]
pub host: String,
#[serde(default = "u16_53")]
#[serde(skip_serializing_if = "is_u16_53")]
pub port: u16,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigListen {
#[serde(default = "string_empty")]
#[serde(skip_serializing_if = "is_string_empty")]
pub host: String,
#[serde(default = "u16_0")]
#[serde(skip_serializing_if = "is_u16_0")]
pub port: u16,
#[serde(default = "u32_64")]
#[serde(skip_serializing_if = "is_u32_64")]
pub batch: u32,
#[serde(skip_serializing_if = "is_none")]
pub read_buffer: Option<u32>,
#[serde(skip_serializing_if = "is_none")]
pub write_buffer: Option<u32>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigPunchy {
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub punch: bool,
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub respond: bool,
#[serde(default = "string_1s")]
#[serde(skip_serializing_if = "is_string_1s")]
pub delay: String,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum NebulaConfigCipher {
#[serde(rename = "aes")]
Aes,
#[serde(rename = "chachapoly")]
ChaChaPoly,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigRelay {
#[serde(default = "empty_vec")]
#[serde(skip_serializing_if = "is_empty_vec")]
pub relays: Vec<Ipv4Addr>,
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub am_relay: bool,
#[serde(default = "bool_true")]
#[serde(skip_serializing_if = "is_bool_true")]
pub use_relays: bool,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigTun {
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub disabled: bool,
#[serde(skip_serializing_if = "is_none")]
pub dev: Option<String>,
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub drop_local_broadcast: bool,
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub drop_multicast: bool,
#[serde(default = "u64_500")]
#[serde(skip_serializing_if = "is_u64_500")]
pub tx_queue: u64,
#[serde(default = "u64_1300")]
#[serde(skip_serializing_if = "is_u64_1300")]
pub mtu: u64,
#[serde(default = "empty_vec")]
#[serde(skip_serializing_if = "is_empty_vec")]
pub routes: Vec<NebulaConfigTunRouteOverride>,
#[serde(default = "empty_vec")]
#[serde(skip_serializing_if = "is_empty_vec")]
pub unsafe_routes: Vec<NebulaConfigTunUnsafeRoute>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigTunRouteOverride {
pub mtu: u64,
pub route: Ipv4Net,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigTunUnsafeRoute {
pub route: Ipv4Net,
pub via: Ipv4Addr,
#[serde(default = "u64_1300")]
#[serde(skip_serializing_if = "is_u64_1300")]
pub mtu: u64,
#[serde(default = "i64_100")]
#[serde(skip_serializing_if = "is_i64_100")]
pub metric: i64,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigLogging {
#[serde(default = "loglevel_info")]
#[serde(skip_serializing_if = "is_loglevel_info")]
pub level: NebulaConfigLoggingLevel,
#[serde(default = "format_text")]
#[serde(skip_serializing_if = "is_format_text")]
pub format: NebulaConfigLoggingFormat,
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub disable_timestamp: bool,
#[serde(default = "timestamp")]
#[serde(skip_serializing_if = "is_timestamp")]
pub timestamp_format: String,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum NebulaConfigLoggingLevel {
#[serde(rename = "panic")]
Panic,
#[serde(rename = "fatal")]
Fatal,
#[serde(rename = "error")]
Error,
#[serde(rename = "warning")]
Warning,
#[serde(rename = "info")]
Info,
#[serde(rename = "debug")]
Debug,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum NebulaConfigLoggingFormat {
#[serde(rename = "json")]
Json,
#[serde(rename = "text")]
Text,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigSshd {
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub enabled: bool,
pub listen: SocketAddrV4,
pub host_key: String,
#[serde(default = "empty_vec")]
#[serde(skip_serializing_if = "is_empty_vec")]
pub authorized_users: Vec<NebulaConfigSshdAuthorizedUser>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigSshdAuthorizedUser {
pub user: String,
#[serde(default = "empty_vec")]
#[serde(skip_serializing_if = "is_empty_vec")]
pub keys: Vec<String>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(tag = "type")]
pub enum NebulaConfigStats {
#[serde(rename = "graphite")]
Graphite(NebulaConfigStatsGraphite),
#[serde(rename = "prometheus")]
Prometheus(NebulaConfigStatsPrometheus),
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigStatsGraphite {
#[serde(default = "string_nebula")]
#[serde(skip_serializing_if = "is_string_nebula")]
pub prefix: String,
#[serde(default = "protocol_tcp")]
#[serde(skip_serializing_if = "is_protocol_tcp")]
pub protocol: NebulaConfigStatsGraphiteProtocol,
pub host: SocketAddrV4,
pub interval: String,
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub message_metrics: bool,
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub lighthouse_metrics: bool,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub enum NebulaConfigStatsGraphiteProtocol {
#[serde(rename = "tcp")]
Tcp,
#[serde(rename = "udp")]
Udp,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigStatsPrometheus {
pub listen: String,
pub path: String,
#[serde(default = "string_nebula")]
#[serde(skip_serializing_if = "is_string_nebula")]
pub namespace: String,
#[serde(default = "string_nebula")]
#[serde(skip_serializing_if = "is_string_nebula")]
pub subsystem: String,
pub interval: String,
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub message_metrics: bool,
#[serde(default = "bool_false")]
#[serde(skip_serializing_if = "is_bool_false")]
pub lighthouse_metrics: bool,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigFirewall {
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub conntrack: Option<NebulaConfigFirewallConntrack>,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub inbound: Option<Vec<NebulaConfigFirewallRule>>,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub outbound: Option<Vec<NebulaConfigFirewallRule>>,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigFirewallConntrack {
#[serde(default = "string_12m")]
#[serde(skip_serializing_if = "is_string_12m")]
pub tcp_timeout: String,
#[serde(default = "string_3m")]
#[serde(skip_serializing_if = "is_string_3m")]
pub udp_timeout: String,
#[serde(default = "string_10m")]
#[serde(skip_serializing_if = "is_string_10m")]
pub default_timeout: String,
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct NebulaConfigFirewallRule {
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub port: Option<String>,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub proto: Option<String>,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub ca_name: Option<String>,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub ca_sha: Option<String>,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub host: Option<String>,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub group: Option<String>,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub groups: Option<Vec<String>>,
#[serde(default = "none")]
#[serde(skip_serializing_if = "is_none")]
pub cidr: Option<String>,
}
// Default values for serde
fn string_12m() -> String {
"12m".to_string()
}
fn is_string_12m(s: &str) -> bool {
s == "12m"
}
fn string_3m() -> String {
"3m".to_string()
}
fn is_string_3m(s: &str) -> bool {
s == "3m"
}
fn string_10m() -> String {
"10m".to_string()
}
fn is_string_10m(s: &str) -> bool {
s == "10m"
}
fn empty_vec<T>() -> Vec<T> {
vec![]
}
fn is_empty_vec<T>(v: &Vec<T>) -> bool {
v.is_empty()
}
fn empty_hashmap<A, B>() -> HashMap<A, B> {
HashMap::new()
}
fn is_empty_hashmap<A, B>(h: &HashMap<A, B>) -> bool {
h.is_empty()
}
fn bool_false() -> bool {
false
}
fn is_bool_false(b: &bool) -> bool {
!*b
}
fn bool_true() -> bool {
true
}
fn is_bool_true(b: &bool) -> bool {
*b
}
fn u16_53() -> u16 {
53
}
fn is_u16_53(u: &u16) -> bool {
*u == 53
}
fn u32_10() -> u32 {
10
}
fn is_u32_10(u: &u32) -> bool {
*u == 10
}
fn u16_0() -> u16 {
0
}
fn is_u16_0(u: &u16) -> bool {
*u == 0
}
fn u32_64() -> u32 {
64
}
fn is_u32_64(u: &u32) -> bool {
*u == 64
}
fn string_1s() -> String {
"1s".to_string()
}
fn is_string_1s(s: &str) -> bool {
s == "1s"
}
fn cipher_aes() -> NebulaConfigCipher {
NebulaConfigCipher::Aes
}
fn is_cipher_aes(c: &NebulaConfigCipher) -> bool {
matches!(c, NebulaConfigCipher::Aes)
}
fn u64_500() -> u64 {
500
}
fn is_u64_500(u: &u64) -> bool {
*u == 500
}
fn u64_1300() -> u64 {
1300
}
fn is_u64_1300(u: &u64) -> bool {
*u == 1300
}
fn i64_100() -> i64 {
100
}
fn is_i64_100(i: &i64) -> bool {
*i == 100
}
fn loglevel_info() -> NebulaConfigLoggingLevel {
NebulaConfigLoggingLevel::Info
}
fn is_loglevel_info(l: &NebulaConfigLoggingLevel) -> bool {
matches!(l, NebulaConfigLoggingLevel::Info)
}
fn format_text() -> NebulaConfigLoggingFormat {
NebulaConfigLoggingFormat::Text
}
fn is_format_text(f: &NebulaConfigLoggingFormat) -> bool {
matches!(f, NebulaConfigLoggingFormat::Text)
}
fn timestamp() -> String {
"2006-01-02T15:04:05Z07:00".to_string()
}
fn is_timestamp(s: &str) -> bool {
s == "2006-01-02T15:04:05Z07:00"
}
fn u64_1() -> u64 {
1
}
fn is_u64_1(u: &u64) -> bool {
*u == 1
}
fn string_nebula() -> String {
"nebula".to_string()
}
fn is_string_nebula(s: &str) -> bool {
s == "nebula"
}
fn string_empty() -> String {
String::new()
}
fn is_string_empty(s: &str) -> bool {
s.is_empty()
}
fn protocol_tcp() -> NebulaConfigStatsGraphiteProtocol {
NebulaConfigStatsGraphiteProtocol::Tcp
}
fn is_protocol_tcp(p: &NebulaConfigStatsGraphiteProtocol) -> bool {
matches!(p, NebulaConfigStatsGraphiteProtocol::Tcp)
}
fn none<T>() -> Option<T> {
None
}
fn is_none<T>(o: &Option<T>) -> bool {
o.is_none()
}

View File

@ -1,7 +1,7 @@
use bindgen::CargoCallbacks;
use std::path::Path;
use std::path::PathBuf;
use std::{env, process};
use bindgen::CargoCallbacks;
fn get_cargo_target_dir() -> Result<std::path::PathBuf, Box<dyn std::error::Error>> {
let skip_triple = std::env::var("TARGET")? == std::env::var("HOST")?;
@ -69,7 +69,10 @@ fn main() {
println!("Go compile success");
println!("cargo:rustc-link-search={}", env::var("OUT_DIR").unwrap());
println!(
"cargo:rustc-link-search={}",
env::var("OUT_DIR").unwrap()
);
if compile_config.link_type == "c-shared" {
copy_shared_lib(&compile_config);
@ -88,12 +91,7 @@ fn main() {
println!("Generating bindings");
let bindings = bindgen::Builder::default()
.header(
out_path
.join(compile_config.header_filename)
.display()
.to_string(),
)
.header(out_path.join(compile_config.header_filename).display().to_string())
.parse_callbacks(Box::new(CargoCallbacks::new()))
.generate()
.expect("Error generating CFFI bindings");
@ -132,44 +130,31 @@ struct GoCompileConfig {
goos: String,
link_type: String,
lib_filename: String,
header_filename: String,
header_filename: String
}
fn get_compile_config() -> GoCompileConfig {
let goarch = goarch();
let goos = goos();
let platform_value = format!("{}/{}", goos, goarch);
let (preferred_link_type, lib_filename, header_filename) =
match (goos.as_str(), goarch.as_str()) {
("darwin", _) => ("c-archive", "libnebula.a", "libnebula.h"),
("windows", _) => ("c-archive", "libnebula.a", "libnebula.h"),
("linux", "386")
| ("linux", "amd64")
| ("linux", "arm")
| ("linux", "armbe")
| ("linux", "arm64")
| ("linux", "arm64be")
| ("linux", "loong64")
| ("linux", "ppc64le")
| ("linux", "riscv64")
| ("linux", "s390x") => ("c-archive", "libnebula.a", "libnebula.h"),
("freebsd", "amd64") => ("c-archive", "libnebula.a", "libnebula.h"),
_ => panic!(
"unsupported platform {} / {}",
env::var("TARGET").unwrap(),
platform_value
),
};
let (preferred_link_type, lib_filename, header_filename) = match (goos.as_str(), goarch.as_str()) {
("darwin", _) => ("c-archive", "libnebula.a", "libnebula.h"),
("windows", _) => ("c-archive", "libnebula.a", "libnebula.h"),
("linux", "386") | ("linux", "amd64") | ("linux", "arm") | ("linux", "armbe") | ("linux", "arm64") | ("linux", "arm64be") | ("linux", "loong64") | ("linux", "ppc64le") | ("linux", "riscv64") | ("linux", "s390x") => ("c-archive", "libnebula.a", "libnebula.h"),
("freebsd", "amd64") => ("c-archive", "libnebula.a", "libnebula.h"),
_ => panic!("unsupported platform {} / {}", env::var("TARGET").unwrap(), platform_value)
};
GoCompileConfig {
goarch,
goos,
link_type: preferred_link_type.to_string(),
lib_filename: lib_filename.to_string(),
header_filename: header_filename.to_string(),
header_filename: header_filename.to_string()
}
}
fn goarch() -> String {
match env::var("CARGO_CFG_TARGET_ARCH").unwrap().as_str() {
"x86" => "386",

View File

@ -1,12 +1,12 @@
use crate::api::APIErrorResponse;
use crate::{HostCommands, HostOverrideCommands, TableStyle};
use comfy_table::modifiers::UTF8_ROUND_CORNERS;
use comfy_table::presets::UTF8_FULL;
use comfy_table::Table;
use serde::{Deserialize, Serialize};
use std::error::Error;
use std::fs;
use std::net::{Ipv4Addr, SocketAddrV4};
use comfy_table::modifiers::UTF8_ROUND_CORNERS;
use comfy_table::presets::UTF8_FULL;
use comfy_table::Table;
use url::Url;
pub async fn host_main(command: HostCommands, server: Url) -> Result<(), Box<dyn Error>> {
@ -172,55 +172,18 @@ pub async fn list_hosts(server: Url, table_style: TableStyle) -> Result<(), Box<
match table_style {
TableStyle::List => unreachable!(),
TableStyle::Basic => (),
TableStyle::Pretty => {
table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS);
}
TableStyle::Pretty => { table.load_preset(UTF8_FULL).apply_modifier(UTF8_ROUND_CORNERS) ; },
};
table.set_header(vec![
"ID",
"Name",
"Organization ID",
"Network ID",
"Role ID",
"IP Address",
"Static Addresses",
"Listen Port",
"Type",
"Blocked",
"Last Seen",
]);
table.set_header(vec!["ID", "Name", "Organization ID", "Network ID", "Role ID", "IP Address", "Static Addresses", "Listen Port", "Type", "Blocked", "Last Seen"]);
for host in &resp.data {
table.add_row(vec![
host.id.as_str(),
&host.name,
&host.organization_id,
&host.network_id,
&host.role_id,
&host.ip_address,
&host
.static_addresses
.iter()
.map(|u| u.to_string())
.collect::<Vec<_>>()
.join(" "),
&host.listen_port.to_string(),
if host.is_lighthouse {
"Lighthouse"
} else if host.is_relay {
"Relay"
} else {
"Host"
},
if host.is_blocked { "true" } else { "false" },
&host.metadata.last_seen_at,
]);
table.add_row(vec![host.id.as_str(), &host.name, &host.organization_id, &host.network_id, &host.role_id, &host.ip_address, &host.static_addresses.iter().map(|u| u.to_string()).collect::<Vec<_>>().join(" "), &host.listen_port.to_string(), if host.is_lighthouse { "Lighthouse" } else if host.is_relay { "Relay" } else { "Host" }, if host.is_blocked { "true" } else { "false" }, &host.metadata.last_seen_at]);
}
println!("{table}");
} else {
let resp: APIErrorResponse = res.json().await?;

View File

@ -1,15 +1,15 @@
use std::error::Error;
use std::fmt::{Display, Formatter};
use std::fs;
use std::net::{Ipv4Addr, SocketAddrV4};
use clap::{Parser, Subcommand, ValueEnum};
use ipnet::Ipv4Net;
use url::Url;
use crate::account::account_main;
use crate::host::host_main;
use crate::network::network_main;
use crate::org::org_main;
use crate::role::role_main;
use clap::{Parser, Subcommand, ValueEnum};
use ipnet::Ipv4Net;
use std::error::Error;
use std::fmt::{Display, Formatter};
use std::fs;
use std::net::{Ipv4Addr, SocketAddrV4};
use url::Url;
pub mod account;
pub mod api;
@ -96,7 +96,7 @@ pub enum NetworkCommands {
/// List all networks associated with your trifid account.
List {
#[clap(short = 'T', long, default_value_t = TableStyle::Basic)]
table_style: TableStyle,
table_style: TableStyle
},
/// Lookup a specific network by ID.
Lookup {
@ -129,7 +129,7 @@ pub enum RoleCommands {
/// List all roles attached to your organization
List {
#[clap(short = 'T', long, default_value_t = TableStyle::Basic)]
table_style: TableStyle,
table_style: TableStyle
},
/// Lookup a specific role by it's ID
Lookup {
@ -177,7 +177,7 @@ pub enum HostCommands {
/// List all hosts on your network
List {
#[clap(short = 'T', long, default_value_t = TableStyle::Basic)]
table_style: TableStyle,
table_style: TableStyle
},
/// Lookup a specific host by it's ID
Lookup {
@ -254,7 +254,7 @@ pub enum HostOverrideCommands {
pub enum TableStyle {
List,
Basic,
Pretty,
Pretty
}
impl Default for TableStyle {
fn default() -> Self {
@ -266,7 +266,7 @@ impl Display for TableStyle {
match self {
Self::List => write!(f, "list"),
Self::Basic => write!(f, "basic"),
Self::Pretty => write!(f, "pretty"),
Self::Pretty => write!(f, "pretty")
}
}
}

View File

@ -1,17 +1,17 @@
use crate::api::APIErrorResponse;
use crate::{NetworkCommands, TableStyle};
use std::error::Error;
use std::fs;
use comfy_table::modifiers::UTF8_ROUND_CORNERS;
use comfy_table::presets::UTF8_FULL;
use comfy_table::Table;
use serde::Deserialize;
use std::error::Error;
use std::fs;
use url::Url;
use crate::api::APIErrorResponse;
use crate::{NetworkCommands, TableStyle};
pub async fn network_main(command: NetworkCommands, server: Url) -> Result<(), Box<dyn Error>> {
match command {
NetworkCommands::List { table_style } => list_networks(server, table_style).await,
NetworkCommands::Lookup { id } => get_network(id, server).await,
NetworkCommands::Lookup {id} => get_network(id, server).await
}
}
@ -78,33 +78,13 @@ pub async fn list_networks(server: Url, table_style: TableStyle) -> Result<(), B
match table_style {
TableStyle::List => unreachable!(),
TableStyle::Basic => (),
TableStyle::Pretty => {
table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS);
}
TableStyle::Pretty => { table.load_preset(UTF8_FULL).apply_modifier(UTF8_ROUND_CORNERS) ; },
};
table.set_header(vec![
"ID",
"Name",
"CIDR",
"Organization ID",
"Signing CA ID",
"Dedicated Relays",
"Created At",
]);
table.set_header(vec!["ID", "Name", "CIDR", "Organization ID", "Signing CA ID", "Dedicated Relays", "Created At"]);
for network in &resp.data {
table.add_row(vec![
&network.id,
&network.name,
&network.cidr,
&network.organization_id,
&network.signing_ca_id,
(!network.lighthouses_as_relays).to_string().as_str(),
&network.created_at,
]);
table.add_row(vec![&network.id, &network.name, &network.cidr, &network.organization_id, &network.signing_ca_id, (!network.lighthouses_as_relays).to_string().as_str(), &network.created_at]);
}
println!("{table}");

View File

@ -1,22 +1,18 @@
use crate::api::APIErrorResponse;
use crate::{RoleCommands, TableStyle};
use std::error::Error;
use std::fs;
use comfy_table::modifiers::UTF8_ROUND_CORNERS;
use comfy_table::presets::UTF8_FULL;
use comfy_table::Table;
use serde::{Deserialize, Serialize};
use std::error::Error;
use std::fs;
use url::Url;
use crate::api::APIErrorResponse;
use crate::{RoleCommands, TableStyle};
pub async fn role_main(command: RoleCommands, server: Url) -> Result<(), Box<dyn Error>> {
match command {
RoleCommands::List { table_style } => list_roles(server, table_style).await,
RoleCommands::Lookup { id } => get_role(id, server).await,
RoleCommands::Create {
name,
description,
rules_json,
} => create_role(name, description, rules_json, server).await,
RoleCommands::Lookup {id} => get_role(id, server).await,
RoleCommands::Create { name, description, rules_json } => create_role(name, description, rules_json, server).await,
RoleCommands::Delete { id } => delete_role(id, server).await,
RoleCommands::Update {
id,
@ -89,21 +85,9 @@ pub async fn list_roles(server: Url, table_style: TableStyle) -> Result<(), Box<
println!(" Description: {}", role.description);
for rule in &role.firewall_rules {
println!("Rule Description: {}", rule.description);
println!(
" Allowed Role: {}",
rule.allowed_role_id
.as_ref()
.unwrap_or(&"All roles".to_string())
);
println!(" Allowed Role: {}", rule.allowed_role_id.as_ref().unwrap_or(&"All roles".to_string()));
println!(" Protocol: {}", rule.protocol);
println!(
" Port Range: {}",
if let Some(pr) = rule.port_range.as_ref() {
format!("{}-{}", pr.from, pr.to)
} else {
"Any".to_string()
}
);
println!(" Port Range: {}", if let Some(pr) = rule.port_range.as_ref() { format!("{}-{}", pr.from, pr.to) } else { "Any".to_string() });
}
println!(" Created: {}", role.created_at);
println!(" Updated: {}", role.modified_at);
@ -115,30 +99,12 @@ pub async fn list_roles(server: Url, table_style: TableStyle) -> Result<(), Box<
match table_style {
TableStyle::List => unreachable!(),
TableStyle::Basic => (),
TableStyle::Pretty => {
table
.load_preset(UTF8_FULL)
.apply_modifier(UTF8_ROUND_CORNERS);
}
TableStyle::Pretty => { table.load_preset(UTF8_FULL).apply_modifier(UTF8_ROUND_CORNERS); },
};
table.set_header(vec![
"ID",
"Name",
"Description",
"Rule Count",
"Created",
"Updated",
]);
table.set_header(vec!["ID", "Name", "Description", "Rule Count", "Created", "Updated"]);
for role in &resp.data {
table.add_row(vec![
&role.id,
&role.name,
&role.description,
role.firewall_rules.len().to_string().as_str(),
&role.created_at,
&role.modified_at,
]);
table.add_row(vec![&role.id, &role.name, &role.description, role.firewall_rules.len().to_string().as_str(), &role.created_at, &role.modified_at]);
}
println!("{table}");

View File

@ -28,7 +28,7 @@ fn insert_private_key(instance: &str) -> Result<(), Box<dyn Error>> {
config.pki.key = Some(String::from_utf8(key)?);
debug!("inserted private key into config");
debug!("inserted private key into config: {:?}", config);
let config_str = serde_yaml::to_string(&config)?;
fs::write(nebula_yml(instance), config_str)?;

View File

@ -1,11 +1,9 @@
/** @type { import("eslint").Linter.FlatConfig } */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
'plugin:svelte/recommended'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],

1
tfweb/.gitignore vendored
View File

@ -8,3 +8,4 @@ node_modules
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.idea

View File

@ -1 +1,2 @@
engine-strict=true
resolution-mode=highest

View File

@ -1,4 +0,0 @@
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

View File

@ -1,18 +0,0 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": [
"prettier-plugin-svelte",
"prettier-plugin-tailwindcss"
],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}

View File

@ -1,13 +0,0 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app.pcss",
"baseColor": "zinc"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
}
}

1928
tfweb/openapi.yaml Normal file

File diff suppressed because it is too large Load Diff

7
tfweb/openapitools.json Normal file
View File

@ -0,0 +1,7 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "6.6.0"
}
}

View File

@ -8,41 +8,30 @@
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
"lint": "eslint ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"autoprefixer": "^10.4.16",
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-node": "^1.3.1",
"@sveltejs/kit": "^1.5.0",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.30.0",
"postcss": "^8.4.32",
"postcss-load-config": "^5.0.2",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"prettier-plugin-tailwindcss": "^0.5.9",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"tailwindcss": "^3.3.6",
"eslint-plugin-svelte": "^2.26.0",
"svelte": "^3.54.0",
"svelte-check": "^3.0.1",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3"
"vite": "^4.3.0"
},
"type": "module",
"dependencies": {
"bits-ui": "^0.11.8",
"clsx": "^2.0.0",
"formsnap": "^0.4.1",
"lucide-svelte": "^0.298.0",
"mode-watcher": "^0.1.2",
"sveltekit-superforms": "^1.12.0",
"tailwind-merge": "^2.1.0",
"tailwind-variants": "^0.1.19",
"zod": "^3.22.4"
"@fortawesome/fontawesome-free": "^6.4.2",
"@popperjs/core": "^2.11.8",
"@types/qrcode": "^1.5.0",
"bootstrap": "^5.3.2",
"bootswatch": "^5.3.2",
"qrcode": "^1.5.3",
"sveltekit-i18n": "^2.4.2"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +0,0 @@
const tailwindcss = require("tailwindcss");
const autoprefixer = require("autoprefixer");
const config = {
plugins: [
//Some plugins, like tailwindcss/nesting, need to run before Tailwind,
tailwindcss(),
//But others, like autoprefixer, need to run after,
autoprefixer
]
};
module.exports = config;

1
tfweb/src/app.d.ts vendored
View File

@ -5,7 +5,6 @@ declare global {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}

View File

@ -1,12 +1,12 @@
<!doctype html>
<html lang="en">
<!DOCTYPE html>
<html lang="en" style="height: 100%;">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
<body data-sveltekit-preload-data="hover" style="height: 100%;">
%sveltekit.body%
</body>
</html>

View File

@ -1,78 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--border: 240 5.9% 90%;
--input: 240 5.9% 90%;
--primary: 240 5.9% 10%;
--primary-foreground: 0 0% 98%;
--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;
--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;
--destructive: 0 72.2% 50.6%;
--destructive-foreground: 0 0% 98%;
--ring: 240 10% 3.9%;
--radius: 0.5rem;
}
.dark {
--background: 240 10% 3.9%;
--foreground: 0 0% 98%;
--muted: 240 3.7% 15.9%;
--muted-foreground: 240 5% 64.9%;
--popover: 240 10% 3.9%;
--popover-foreground: 0 0% 98%;
--card: 240 10% 3.9%;
--card-foreground: 0 0% 98%;
--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;
--primary: 0 0% 98%;
--primary-foreground: 240 5.9% 10%;
--secondary: 240 3.7% 15.9%;
--secondary-foreground: 0 0% 98%;
--accent: 240 3.7% 15.9%;
--accent-foreground: 0 0% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;
--ring: 240 4.9% 83.9%;
}
}
@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}

View File

@ -0,0 +1,16 @@
<script lang="ts">
import Sidebar from "$components/Sidebar.svelte";
export let selected;
</script>
<div class="container-fluid g-0">
<div class="row">
<div class="col-sm-3 col-md-3 col-lg-3 col-xl-2">
<Sidebar bind:selected={selected} />
</div>
<div class="col me-3 mt-2">
<slot></slot>
</div>
</div>
</div>

View File

@ -0,0 +1,42 @@
<script lang="ts">
import {logDeltaReset, Logger, logSetup} from "$lib/logger";
import {t} from "$lib/i18n/translations";
export let isLoading;
export let isError;
export let error;
logSetup();
let logger = new Logger("LoadingWrapper.svelte");
function loadingproclog() {
if (!isLoading) {
logger.info("page loaded - content paint");
logDeltaReset();
}
}
$: isLoading, loadingproclog();
</script>
{#if isLoading}
<div class="h-100 d-flex align-items-center justify-content-center">
<div class="card">
<div class="card-body text-center">
<h4 class="card-title mb-0">{$t("common.loading")} <i class="fas fa-gear fa-spin"></i></h4>
</div>
</div>
</div>
{:else}
{#if isError}
<div class="h-100 d-flex align-items-center justify-content-center">
<div class="card w-25">
<div class="card-body text-center">
<h4 class="card-title mb-0 text-danger">{error}</h4>
</div>
</div>
</div>
{:else}
<slot></slot>
{/if}
{/if}

View File

@ -0,0 +1,35 @@
<script lang="ts">
import {Logger, logSetup} from "$lib/logger";
import QRCode from "qrcode";
import {onMount} from "svelte";
export let value;
let canvas;
logSetup();
let logger = new Logger("QrCode.svelte");
function updateQrCode() {
if (canvas === undefined) {
logger.warn(`component has not yet mounted, delaying 500ms and trying again`);
setTimeout(() => {
updateQrCode();
}, 500);
return;
}
logger.info(`updating qrcode to ${value}`);
QRCode.toCanvas(canvas, value, (err) => {
if (err) {
logger.error(`error updating qrcode: ${err}`);
} else {
logger.info(`qrcode updated successfully`);
}
})
}
$: value, updateQrCode();
</script>
<canvas bind:this={canvas} id="canvas"></canvas>

View File

@ -0,0 +1,48 @@
<script lang="ts">
import {t} from "$lib/i18n/translations";
export let selected;
</script>
<div class="sticky-top d-flex flex-column flex-shrink-0 p-3 vh-100 bg-dark">
<p class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none ml-5 fs-4">
<i class="fas fa-satellite fa-fw bi me-2"></i>
Trifid
</p>
<hr>
<ul class="nav nav-pills flex-column mb-auto">
<li class="nav-item">
<a class="nav-link py-2 px-4" class:active={selected === 'hosts'} href="/hosts">
<i class="bi me-2 fas fa-computer fa-fw"></i>
{$t("common.page.hosts")}
</a>
</li>
<li class="nav-item">
<a class="nav-link py-2 px-4" class:active={selected === 'lighthouses'} href="/lighthouses">
<i class="bi me-2 fas fa-server fa-fw"></i>
{$t("common.page.lighthouses")}
</a>
</li>
<li class="nav-item">
<a class="nav-link py-2 px-4" class:active={selected === 'relays'} href="/relays">
<i class="bi me-2 fas fa-network-wired fa=fw"></i>
{$t("common.page.relays")}
</a>
</li>
<li class="nav-item">
<a class="nav-link py-2 px-4" class:active={selected === 'roles'} href="/roles">
<i class="bi me-2 fas fa-address-book fa-fw"></i>
{$t("common.page.roles")}
</a>
</li>
</ul>
<hr>
<div class="nav-item">
<button class="nav-link py-2 px-4" on:click={() => {window.localStorage.setItem("mfa", ""); window.location.href = "/2fa"}}>
<i class="me-2 fas fa-right-from-bracket fa-fw"></i>
{$t("common.logout")}
</button>
</div>
</div>

View File

@ -0,0 +1,11 @@
import { writable } from "svelte/store";
import { browser } from "$app/environment";
export function persist(name, def_val = "") {
const store = writable(browser && localStorage.getItem(name) || def_val);
store.subscribe((value) => {
if (browser)
return (localStorage.setItem(name, value));
});
return store;
}
//# sourceMappingURL=PersistentStore.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"PersistentStore.js","sourceRoot":"","sources":["PersistentStore.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAEzC,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,OAAO,GAAG,EAAE;IAC9C,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC;IACzE,KAAK,CAAC,SAAS,CAAC,CAAC,KAAU,EAAE,EAAE;QAC3B,IAAI,OAAO;YAAE,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACjB,CAAC"}

View File

@ -0,0 +1,11 @@
import type { Writable } from "svelte/store";
import {writable} from "svelte/store";
import {browser} from "$app/environment";
export function persist(name: string, def_val = ""): Writable<any> {
const store = writable(browser && localStorage.getItem(name) || def_val);
store.subscribe((value: any) => {
if (browser) return (localStorage.setItem(name, value));
});
return store;
}

17
tfweb/src/lib/Tooltips.js Normal file
View File

@ -0,0 +1,17 @@
import {browser} from "$app/environment";
export function updateTooltips() {
if (browser) {
setTimeout(() => {
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => {
let tooltip = new document.B.Tooltip(tooltipTriggerEl, {trigger: 'hover'})
tooltipTriggerEl.addEventListener('click', () => {
tooltip.hide();
tooltip.dispose();
})
});
console.log(tooltipList);
});
}
}

View File

@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,61 @@
.openapi-generator-ignore
apis/AuditLogsApi.ts
apis/DownloadsApi.ts
apis/HostsApi.ts
apis/NetworksApi.ts
apis/RolesApi.ts
apis/index.ts
index.ts
models/Actor.ts
models/ActorAPIKey.ts
models/ActorHost.ts
models/ActorOIDCUser.ts
models/ActorSupport.ts
models/ActorSystem.ts
models/ActorUser.ts
models/AuditLog.ts
models/AuditLogsList200Response.ts
models/Downloads.ts
models/DownloadsDNClientLinks.ts
models/DownloadsDnclient.ts
models/DownloadsList200Response.ts
models/DownloadsMobile.ts
models/DownloadsVersionInfo.ts
models/DownloadsVersionInfoDnclientValue.ts
models/DownloadsVersionInfoLatest.ts
models/Event.ts
models/FirewallRule.ts
models/FirewallRulePortRange.ts
models/Host.ts
models/HostAndEnrollCodeCreate200Response.ts
models/HostAndEnrollCodeCreate200ResponseData.ts
models/HostAndEnrollCodeCreate200ResponseDataEnrollmentCode.ts
models/HostAndEnrollCodeCreate400Response.ts
models/HostBlock200Response.ts
models/HostBlock200ResponseData.ts
models/HostCreate200Response.ts
models/HostCreate400Response.ts
models/HostCreateRequest.ts
models/HostDelete200Response.ts
models/HostEdit200Response.ts
models/HostEditRequest.ts
models/HostEnrollCodeCreate200Response.ts
models/HostEnrollCodeCreate200ResponseData.ts
models/HostEnrollCodeCreate200ResponseDataEnrollmentCode.ts
models/HostGet200Response.ts
models/HostMetadata.ts
models/HostsList200Response.ts
models/ModelError.ts
models/Network.ts
models/NetworkGet200Response.ts
models/NetworksList200Response.ts
models/PaginationMetadata.ts
models/PaginationMetadataPage.ts
models/Role.ts
models/RoleCreate200Response.ts
models/RoleCreateRequest.ts
models/RoleEditRequest.ts
models/RolesList200Response.ts
models/Target.ts
models/index.ts
runtime.ts

View File

@ -0,0 +1 @@
6.6.0

View File

@ -0,0 +1,78 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import { AuditLogsList200ResponseFromJSON, AuditLogsList200ResponseToJSON, } from '../models';
/**
*
*/
export class AuditLogsApi extends runtime.BaseAPI {
/**
* Get a paginated list of audit logs. Token scope required: `audit-logs:list` ### Request
* List audit logs
*/
async auditLogsListRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters.includeCounts !== undefined) {
queryParameters['includeCounts'] = requestParameters.includeCounts;
}
if (requestParameters.cursor !== undefined) {
queryParameters['cursor'] = requestParameters.cursor;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.filterTargetID !== undefined) {
queryParameters['filter.targetID'] = requestParameters.filterTargetID;
}
if (requestParameters.filterTargetType !== undefined) {
queryParameters['filter.targetType'] = requestParameters.filterTargetType;
}
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/audit-logs`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => AuditLogsList200ResponseFromJSON(jsonValue));
}
/**
* Get a paginated list of audit logs. Token scope required: `audit-logs:list` ### Request
* List audit logs
*/
async auditLogsList(requestParameters = {}, initOverrides) {
const response = await this.auditLogsListRaw(requestParameters, initOverrides);
return await response.value();
}
}
/**
* @export
*/
export const AuditLogsListFilterTargetTypeEnum = {
ApiKey: 'apiKey',
Host: 'host',
Network: 'network',
Role: 'role',
User: 'user',
Ca: 'ca',
OidcProvider: 'oidcProvider'
};
//# sourceMappingURL=AuditLogsApi.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuditLogsApi.js","sourceRoot":"","sources":["AuditLogsApi.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAItC,OAAO,EACH,gCAAgC,EAChC,8BAA8B,GACjC,MAAM,WAAW,CAAC;AAUnB;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,OAAO,CAAC,OAAO;IAE7C;;;OAGG;IACH,KAAK,CAAC,gBAAgB,CAAC,iBAAuC,EAAE,aAA0D;QACtH,MAAM,eAAe,GAAQ,EAAE,CAAC;QAEhC,IAAI,iBAAiB,CAAC,aAAa,KAAK,SAAS,EAAE;YAC/C,eAAe,CAAC,eAAe,CAAC,GAAG,iBAAiB,CAAC,aAAa,CAAC;SACtE;QAED,IAAI,iBAAiB,CAAC,MAAM,KAAK,SAAS,EAAE;YACxC,eAAe,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC;SACxD;QAED,IAAI,iBAAiB,CAAC,QAAQ,KAAK,SAAS,EAAE;YAC1C,eAAe,CAAC,UAAU,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC;SAC5D;QAED,IAAI,iBAAiB,CAAC,cAAc,KAAK,SAAS,EAAE;YAChD,eAAe,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC,cAAc,CAAC;SACzE;QAED,IAAI,iBAAiB,CAAC,gBAAgB,KAAK,SAAS,EAAE;YAClD,eAAe,CAAC,mBAAmB,CAAC,GAAG,iBAAiB,CAAC,gBAAgB,CAAC;SAC7E;QAED,MAAM,gBAAgB,GAAwB,EAAE,CAAC;QAEjD,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE;YACtD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YAC7C,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAEhD,IAAI,WAAW,EAAE;gBACb,gBAAgB,CAAC,eAAe,CAAC,GAAG,UAAU,WAAW,EAAE,CAAC;aAC/D;SACJ;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC;YAChC,IAAI,EAAE,gBAAgB;YACtB,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,gBAAgB;YACzB,KAAK,EAAE,eAAe;SACzB,EAAE,aAAa,CAAC,CAAC;QAElB,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,gCAAgC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7G,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,aAAa,CAAC,oBAA0C,EAAE,EAAE,aAA0D;QACxH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;QAC/E,OAAO,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;CAEJ;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC7C,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,EAAE,EAAE,IAAI;IACR,YAAY,EAAE,cAAc;CACtB,CAAC"}

View File

@ -0,0 +1,108 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
AuditLogsList200Response,
} from '../models';
import {
AuditLogsList200ResponseFromJSON,
AuditLogsList200ResponseToJSON,
} from '../models';
export interface AuditLogsListRequest {
includeCounts?: boolean;
cursor?: string;
pageSize?: number;
filterTargetID?: string;
filterTargetType?: AuditLogsListFilterTargetTypeEnum;
}
/**
*
*/
export class AuditLogsApi extends runtime.BaseAPI {
/**
* Get a paginated list of audit logs. Token scope required: `audit-logs:list` ### Request
* List audit logs
*/
async auditLogsListRaw(requestParameters: AuditLogsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuditLogsList200Response>> {
const queryParameters: any = {};
if (requestParameters.includeCounts !== undefined) {
queryParameters['includeCounts'] = requestParameters.includeCounts;
}
if (requestParameters.cursor !== undefined) {
queryParameters['cursor'] = requestParameters.cursor;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.filterTargetID !== undefined) {
queryParameters['filter.targetID'] = requestParameters.filterTargetID;
}
if (requestParameters.filterTargetType !== undefined) {
queryParameters['filter.targetType'] = requestParameters.filterTargetType;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/audit-logs`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => AuditLogsList200ResponseFromJSON(jsonValue));
}
/**
* Get a paginated list of audit logs. Token scope required: `audit-logs:list` ### Request
* List audit logs
*/
async auditLogsList(requestParameters: AuditLogsListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuditLogsList200Response> {
const response = await this.auditLogsListRaw(requestParameters, initOverrides);
return await response.value();
}
}
/**
* @export
*/
export const AuditLogsListFilterTargetTypeEnum = {
ApiKey: 'apiKey',
Host: 'host',
Network: 'network',
Role: 'role',
User: 'user',
Ca: 'ca',
OidcProvider: 'oidcProvider'
} as const;
export type AuditLogsListFilterTargetTypeEnum = typeof AuditLogsListFilterTargetTypeEnum[keyof typeof AuditLogsListFilterTargetTypeEnum];

View File

@ -0,0 +1,51 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import { DownloadsList200ResponseFromJSON, DownloadsList200ResponseToJSON, } from '../models';
/**
*
*/
export class DownloadsApi extends runtime.BaseAPI {
/**
* Get a list of recently released software download links and basic info. This endpoint is unauthenticated. ### Request
* List software downloads
*/
async downloadsListRaw(initOverrides) {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/downloads`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DownloadsList200ResponseFromJSON(jsonValue));
}
/**
* Get a list of recently released software download links and basic info. This endpoint is unauthenticated. ### Request
* List software downloads
*/
async downloadsList(initOverrides) {
const response = await this.downloadsListRaw(initOverrides);
return await response.value();
}
}
//# sourceMappingURL=DownloadsApi.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"DownloadsApi.js","sourceRoot":"","sources":["DownloadsApi.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAItC,OAAO,EACH,gCAAgC,EAChC,8BAA8B,GACjC,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,OAAO,CAAC,OAAO;IAE7C;;;OAGG;IACH,KAAK,CAAC,gBAAgB,CAAC,aAA0D;QAC7E,MAAM,eAAe,GAAQ,EAAE,CAAC;QAEhC,MAAM,gBAAgB,GAAwB,EAAE,CAAC;QAEjD,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE;YACtD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YAC7C,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAEhD,IAAI,WAAW,EAAE;gBACb,gBAAgB,CAAC,eAAe,CAAC,GAAG,UAAU,WAAW,EAAE,CAAC;aAC/D;SACJ;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC;YAChC,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,gBAAgB;YACzB,KAAK,EAAE,eAAe;SACzB,EAAE,aAAa,CAAC,CAAC;QAElB,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,gCAAgC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7G,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,aAAa,CAAC,aAA0D;QAC1E,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;QAC5D,OAAO,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;CAEJ"}

View File

@ -0,0 +1,66 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
DownloadsList200Response,
} from '../models';
import {
DownloadsList200ResponseFromJSON,
DownloadsList200ResponseToJSON,
} from '../models';
/**
*
*/
export class DownloadsApi extends runtime.BaseAPI {
/**
* Get a list of recently released software download links and basic info. This endpoint is unauthenticated. ### Request
* List software downloads
*/
async downloadsListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DownloadsList200Response>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/downloads`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DownloadsList200ResponseFromJSON(jsonValue));
}
/**
* Get a list of recently released software download links and basic info. This endpoint is unauthenticated. ### Request
* List software downloads
*/
async downloadsList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DownloadsList200Response> {
const response = await this.downloadsListRaw(initOverrides);
return await response.value();
}
}

View File

@ -0,0 +1,332 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import { HostAndEnrollCodeCreate200ResponseFromJSON, HostAndEnrollCodeCreate200ResponseToJSON, HostAndEnrollCodeCreate400ResponseFromJSON, HostAndEnrollCodeCreate400ResponseToJSON, HostBlock200ResponseFromJSON, HostBlock200ResponseToJSON, HostCreate200ResponseFromJSON, HostCreate200ResponseToJSON, HostCreate400ResponseFromJSON, HostCreate400ResponseToJSON, HostCreateRequestFromJSON, HostCreateRequestToJSON, HostDelete200ResponseFromJSON, HostDelete200ResponseToJSON, HostEdit200ResponseFromJSON, HostEdit200ResponseToJSON, HostEditRequestFromJSON, HostEditRequestToJSON, HostEnrollCodeCreate200ResponseFromJSON, HostEnrollCodeCreate200ResponseToJSON, HostGet200ResponseFromJSON, HostGet200ResponseToJSON, HostsList200ResponseFromJSON, HostsList200ResponseToJSON, } from '../models';
/**
*
*/
export class HostsApi extends runtime.BaseAPI {
/**
* Token scopes required: `hosts:create`, `hosts:enroll` ### Request
* Create host & enrollment code
*/
async hostAndEnrollCodeCreateRaw(requestParameters, initOverrides) {
if (requestParameters.hostCreateRequest === null || requestParameters.hostCreateRequest === undefined) {
throw new runtime.RequiredError('hostCreateRequest', 'Required parameter requestParameters.hostCreateRequest was null or undefined when calling hostAndEnrollCodeCreate.');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/host-and-enrollment-code`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: HostCreateRequestToJSON(requestParameters.hostCreateRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostAndEnrollCodeCreate200ResponseFromJSON(jsonValue));
}
/**
* Token scopes required: `hosts:create`, `hosts:enroll` ### Request
* Create host & enrollment code
*/
async hostAndEnrollCodeCreate(requestParameters, initOverrides) {
const response = await this.hostAndEnrollCodeCreateRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Prevent a host from being able to interact with other nodes on your network. See https://www.defined.net/blog/blocklisting/ for more details. To unblock, re-enroll the host. Token scope required: `hosts:block` ### Request
* Block host
*/
async hostBlockRaw(requestParameters, initOverrides) {
if (requestParameters.hostID === null || requestParameters.hostID === undefined) {
throw new runtime.RequiredError('hostID', 'Required parameter requestParameters.hostID was null or undefined when calling hostBlock.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts/{hostID}/block`.replace(`{${"hostID"}}`, encodeURIComponent(String(requestParameters.hostID))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostBlock200ResponseFromJSON(jsonValue));
}
/**
* Prevent a host from being able to interact with other nodes on your network. See https://www.defined.net/blog/blocklisting/ for more details. To unblock, re-enroll the host. Token scope required: `hosts:block` ### Request
* Block host
*/
async hostBlock(requestParameters, initOverrides) {
const response = await this.hostBlockRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Create a new host, lighthouse, or relay. Token scope required: `hosts:create` ### Request
* Create host
*/
async hostCreateRaw(requestParameters, initOverrides) {
if (requestParameters.hostCreateRequest === null || requestParameters.hostCreateRequest === undefined) {
throw new runtime.RequiredError('hostCreateRequest', 'Required parameter requestParameters.hostCreateRequest was null or undefined when calling hostCreate.');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: HostCreateRequestToJSON(requestParameters.hostCreateRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostCreate200ResponseFromJSON(jsonValue));
}
/**
* Create a new host, lighthouse, or relay. Token scope required: `hosts:create` ### Request
* Create host
*/
async hostCreate(requestParameters, initOverrides) {
const response = await this.hostCreateRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Token scope required: `hosts:delete` ### Request
* Delete host
*/
async hostDeleteRaw(requestParameters, initOverrides) {
if (requestParameters.hostID === null || requestParameters.hostID === undefined) {
throw new runtime.RequiredError('hostID', 'Required parameter requestParameters.hostID was null or undefined when calling hostDelete.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts/{hostID}`.replace(`{${"hostID"}}`, encodeURIComponent(String(requestParameters.hostID))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostDelete200ResponseFromJSON(jsonValue));
}
/**
* Token scope required: `hosts:delete` ### Request
* Delete host
*/
async hostDelete(requestParameters, initOverrides) {
const response = await this.hostDeleteRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Token scope required: `hosts:update` :::caution Any properties not provided in the request will be reset to their default values. ::: ### Request
* Edit host
*/
async hostEditRaw(requestParameters, initOverrides) {
if (requestParameters.hostID === null || requestParameters.hostID === undefined) {
throw new runtime.RequiredError('hostID', 'Required parameter requestParameters.hostID was null or undefined when calling hostEdit.');
}
if (requestParameters.hostEditRequest === null || requestParameters.hostEditRequest === undefined) {
throw new runtime.RequiredError('hostEditRequest', 'Required parameter requestParameters.hostEditRequest was null or undefined when calling hostEdit.');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts/{hostID}`.replace(`{${"hostID"}}`, encodeURIComponent(String(requestParameters.hostID))),
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: HostEditRequestToJSON(requestParameters.hostEditRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostEdit200ResponseFromJSON(jsonValue));
}
/**
* Token scope required: `hosts:update` :::caution Any properties not provided in the request will be reset to their default values. ::: ### Request
* Edit host
*/
async hostEdit(requestParameters, initOverrides) {
const response = await this.hostEditRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Obtain a code that can be used with the `dnclient enroll` command on a host, lighthouse, or relay to enroll it into your Managed Nebula network. Token scope required: `hosts:enroll` ### Request
* Create enrollment code
*/
async hostEnrollCodeCreateRaw(requestParameters, initOverrides) {
if (requestParameters.hostID === null || requestParameters.hostID === undefined) {
throw new runtime.RequiredError('hostID', 'Required parameter requestParameters.hostID was null or undefined when calling hostEnrollCodeCreate.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts/{hostID}/enrollment-code`.replace(`{${"hostID"}}`, encodeURIComponent(String(requestParameters.hostID))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostEnrollCodeCreate200ResponseFromJSON(jsonValue));
}
/**
* Obtain a code that can be used with the `dnclient enroll` command on a host, lighthouse, or relay to enroll it into your Managed Nebula network. Token scope required: `hosts:enroll` ### Request
* Create enrollment code
*/
async hostEnrollCodeCreate(requestParameters, initOverrides) {
const response = await this.hostEnrollCodeCreateRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Fetch information about a particular host, lighthouse, or relay. Token scope required: `hosts:read` ### Request
* Get host
*/
async hostGetRaw(requestParameters, initOverrides) {
if (requestParameters.hostID === null || requestParameters.hostID === undefined) {
throw new runtime.RequiredError('hostID', 'Required parameter requestParameters.hostID was null or undefined when calling hostGet.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts/{hostID}`.replace(`{${"hostID"}}`, encodeURIComponent(String(requestParameters.hostID))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostGet200ResponseFromJSON(jsonValue));
}
/**
* Fetch information about a particular host, lighthouse, or relay. Token scope required: `hosts:read` ### Request
* Get host
*/
async hostGet(requestParameters, initOverrides) {
const response = await this.hostGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get a paginated list of hosts, lighthouses, and relays. Token scope required: `hosts:list` ### Request
* List hosts
*/
async hostsListRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters.includeCounts !== undefined) {
queryParameters['includeCounts'] = requestParameters.includeCounts;
}
if (requestParameters.cursor !== undefined) {
queryParameters['cursor'] = requestParameters.cursor;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.filterIsBlocked !== undefined) {
queryParameters['filter.isBlocked'] = requestParameters.filterIsBlocked;
}
if (requestParameters.filterIsLighthouse !== undefined) {
queryParameters['filter.isLighthouse'] = requestParameters.filterIsLighthouse;
}
if (requestParameters.filterIsRelay !== undefined) {
queryParameters['filter.isRelay'] = requestParameters.filterIsRelay;
}
if (requestParameters.filterMetadataLastSeenAt !== undefined) {
queryParameters['filter.metadata.lastSeenAt'] = requestParameters.filterMetadataLastSeenAt;
}
if (requestParameters.filterMetadataPlatform !== undefined) {
queryParameters['filter.metadata.platform'] = requestParameters.filterMetadataPlatform;
}
if (requestParameters.filterMetadataUpdateAvailable !== undefined) {
queryParameters['filter.metadata.updateAvailable'] = requestParameters.filterMetadataUpdateAvailable;
}
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostsList200ResponseFromJSON(jsonValue));
}
/**
* Get a paginated list of hosts, lighthouses, and relays. Token scope required: `hosts:list` ### Request
* List hosts
*/
async hostsList(requestParameters = {}, initOverrides) {
const response = await this.hostsListRaw(requestParameters, initOverrides);
return await response.value();
}
}
/**
* @export
*/
export const HostsListFilterMetadataLastSeenAtEnum = {
Null: 'null'
};
/**
* @export
*/
export const HostsListFilterMetadataPlatformEnum = {
Mobile: 'mobile',
Dnclient: 'dnclient',
Null: 'null'
};
//# sourceMappingURL=HostsApi.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,486 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
HostAndEnrollCodeCreate200Response,
HostAndEnrollCodeCreate400Response,
HostBlock200Response,
HostCreate200Response,
HostCreate400Response,
HostCreateRequest,
HostDelete200Response,
HostEdit200Response,
HostEditRequest,
HostEnrollCodeCreate200Response,
HostGet200Response,
HostsList200Response,
} from '../models';
import {
HostAndEnrollCodeCreate200ResponseFromJSON,
HostAndEnrollCodeCreate200ResponseToJSON,
HostAndEnrollCodeCreate400ResponseFromJSON,
HostAndEnrollCodeCreate400ResponseToJSON,
HostBlock200ResponseFromJSON,
HostBlock200ResponseToJSON,
HostCreate200ResponseFromJSON,
HostCreate200ResponseToJSON,
HostCreate400ResponseFromJSON,
HostCreate400ResponseToJSON,
HostCreateRequestFromJSON,
HostCreateRequestToJSON,
HostDelete200ResponseFromJSON,
HostDelete200ResponseToJSON,
HostEdit200ResponseFromJSON,
HostEdit200ResponseToJSON,
HostEditRequestFromJSON,
HostEditRequestToJSON,
HostEnrollCodeCreate200ResponseFromJSON,
HostEnrollCodeCreate200ResponseToJSON,
HostGet200ResponseFromJSON,
HostGet200ResponseToJSON,
HostsList200ResponseFromJSON,
HostsList200ResponseToJSON,
} from '../models';
export interface HostAndEnrollCodeCreateRequest {
hostCreateRequest: HostCreateRequest;
}
export interface HostBlockRequest {
hostID: string;
}
export interface HostCreateOperationRequest {
hostCreateRequest: HostCreateRequest;
}
export interface HostDeleteRequest {
hostID: string;
}
export interface HostEditOperationRequest {
hostID: string;
hostEditRequest: HostEditRequest;
}
export interface HostEnrollCodeCreateRequest {
hostID: string;
}
export interface HostGetRequest {
hostID: string;
}
export interface HostsListRequest {
includeCounts?: boolean;
cursor?: string;
pageSize?: number;
filterIsBlocked?: boolean;
filterIsLighthouse?: boolean;
filterIsRelay?: boolean;
filterMetadataLastSeenAt?: HostsListFilterMetadataLastSeenAtEnum;
filterMetadataPlatform?: HostsListFilterMetadataPlatformEnum;
filterMetadataUpdateAvailable?: boolean;
}
/**
*
*/
export class HostsApi extends runtime.BaseAPI {
/**
* Token scopes required: `hosts:create`, `hosts:enroll` ### Request
* Create host & enrollment code
*/
async hostAndEnrollCodeCreateRaw(requestParameters: HostAndEnrollCodeCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HostAndEnrollCodeCreate200Response>> {
if (requestParameters.hostCreateRequest === null || requestParameters.hostCreateRequest === undefined) {
throw new runtime.RequiredError('hostCreateRequest','Required parameter requestParameters.hostCreateRequest was null or undefined when calling hostAndEnrollCodeCreate.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/host-and-enrollment-code`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: HostCreateRequestToJSON(requestParameters.hostCreateRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostAndEnrollCodeCreate200ResponseFromJSON(jsonValue));
}
/**
* Token scopes required: `hosts:create`, `hosts:enroll` ### Request
* Create host & enrollment code
*/
async hostAndEnrollCodeCreate(requestParameters: HostAndEnrollCodeCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HostAndEnrollCodeCreate200Response> {
const response = await this.hostAndEnrollCodeCreateRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Prevent a host from being able to interact with other nodes on your network. See https://www.defined.net/blog/blocklisting/ for more details. To unblock, re-enroll the host. Token scope required: `hosts:block` ### Request
* Block host
*/
async hostBlockRaw(requestParameters: HostBlockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HostBlock200Response>> {
if (requestParameters.hostID === null || requestParameters.hostID === undefined) {
throw new runtime.RequiredError('hostID','Required parameter requestParameters.hostID was null or undefined when calling hostBlock.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts/{hostID}/block`.replace(`{${"hostID"}}`, encodeURIComponent(String(requestParameters.hostID))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostBlock200ResponseFromJSON(jsonValue));
}
/**
* Prevent a host from being able to interact with other nodes on your network. See https://www.defined.net/blog/blocklisting/ for more details. To unblock, re-enroll the host. Token scope required: `hosts:block` ### Request
* Block host
*/
async hostBlock(requestParameters: HostBlockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HostBlock200Response> {
const response = await this.hostBlockRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Create a new host, lighthouse, or relay. Token scope required: `hosts:create` ### Request
* Create host
*/
async hostCreateRaw(requestParameters: HostCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HostCreate200Response>> {
if (requestParameters.hostCreateRequest === null || requestParameters.hostCreateRequest === undefined) {
throw new runtime.RequiredError('hostCreateRequest','Required parameter requestParameters.hostCreateRequest was null or undefined when calling hostCreate.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: HostCreateRequestToJSON(requestParameters.hostCreateRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostCreate200ResponseFromJSON(jsonValue));
}
/**
* Create a new host, lighthouse, or relay. Token scope required: `hosts:create` ### Request
* Create host
*/
async hostCreate(requestParameters: HostCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HostCreate200Response> {
const response = await this.hostCreateRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Token scope required: `hosts:delete` ### Request
* Delete host
*/
async hostDeleteRaw(requestParameters: HostDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HostDelete200Response>> {
if (requestParameters.hostID === null || requestParameters.hostID === undefined) {
throw new runtime.RequiredError('hostID','Required parameter requestParameters.hostID was null or undefined when calling hostDelete.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts/{hostID}`.replace(`{${"hostID"}}`, encodeURIComponent(String(requestParameters.hostID))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostDelete200ResponseFromJSON(jsonValue));
}
/**
* Token scope required: `hosts:delete` ### Request
* Delete host
*/
async hostDelete(requestParameters: HostDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HostDelete200Response> {
const response = await this.hostDeleteRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Token scope required: `hosts:update` :::caution Any properties not provided in the request will be reset to their default values. ::: ### Request
* Edit host
*/
async hostEditRaw(requestParameters: HostEditOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HostEdit200Response>> {
if (requestParameters.hostID === null || requestParameters.hostID === undefined) {
throw new runtime.RequiredError('hostID','Required parameter requestParameters.hostID was null or undefined when calling hostEdit.');
}
if (requestParameters.hostEditRequest === null || requestParameters.hostEditRequest === undefined) {
throw new runtime.RequiredError('hostEditRequest','Required parameter requestParameters.hostEditRequest was null or undefined when calling hostEdit.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts/{hostID}`.replace(`{${"hostID"}}`, encodeURIComponent(String(requestParameters.hostID))),
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: HostEditRequestToJSON(requestParameters.hostEditRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostEdit200ResponseFromJSON(jsonValue));
}
/**
* Token scope required: `hosts:update` :::caution Any properties not provided in the request will be reset to their default values. ::: ### Request
* Edit host
*/
async hostEdit(requestParameters: HostEditOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HostEdit200Response> {
const response = await this.hostEditRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Obtain a code that can be used with the `dnclient enroll` command on a host, lighthouse, or relay to enroll it into your Managed Nebula network. Token scope required: `hosts:enroll` ### Request
* Create enrollment code
*/
async hostEnrollCodeCreateRaw(requestParameters: HostEnrollCodeCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HostEnrollCodeCreate200Response>> {
if (requestParameters.hostID === null || requestParameters.hostID === undefined) {
throw new runtime.RequiredError('hostID','Required parameter requestParameters.hostID was null or undefined when calling hostEnrollCodeCreate.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts/{hostID}/enrollment-code`.replace(`{${"hostID"}}`, encodeURIComponent(String(requestParameters.hostID))),
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostEnrollCodeCreate200ResponseFromJSON(jsonValue));
}
/**
* Obtain a code that can be used with the `dnclient enroll` command on a host, lighthouse, or relay to enroll it into your Managed Nebula network. Token scope required: `hosts:enroll` ### Request
* Create enrollment code
*/
async hostEnrollCodeCreate(requestParameters: HostEnrollCodeCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HostEnrollCodeCreate200Response> {
const response = await this.hostEnrollCodeCreateRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Fetch information about a particular host, lighthouse, or relay. Token scope required: `hosts:read` ### Request
* Get host
*/
async hostGetRaw(requestParameters: HostGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HostGet200Response>> {
if (requestParameters.hostID === null || requestParameters.hostID === undefined) {
throw new runtime.RequiredError('hostID','Required parameter requestParameters.hostID was null or undefined when calling hostGet.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts/{hostID}`.replace(`{${"hostID"}}`, encodeURIComponent(String(requestParameters.hostID))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostGet200ResponseFromJSON(jsonValue));
}
/**
* Fetch information about a particular host, lighthouse, or relay. Token scope required: `hosts:read` ### Request
* Get host
*/
async hostGet(requestParameters: HostGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HostGet200Response> {
const response = await this.hostGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get a paginated list of hosts, lighthouses, and relays. Token scope required: `hosts:list` ### Request
* List hosts
*/
async hostsListRaw(requestParameters: HostsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HostsList200Response>> {
const queryParameters: any = {};
if (requestParameters.includeCounts !== undefined) {
queryParameters['includeCounts'] = requestParameters.includeCounts;
}
if (requestParameters.cursor !== undefined) {
queryParameters['cursor'] = requestParameters.cursor;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
if (requestParameters.filterIsBlocked !== undefined) {
queryParameters['filter.isBlocked'] = requestParameters.filterIsBlocked;
}
if (requestParameters.filterIsLighthouse !== undefined) {
queryParameters['filter.isLighthouse'] = requestParameters.filterIsLighthouse;
}
if (requestParameters.filterIsRelay !== undefined) {
queryParameters['filter.isRelay'] = requestParameters.filterIsRelay;
}
if (requestParameters.filterMetadataLastSeenAt !== undefined) {
queryParameters['filter.metadata.lastSeenAt'] = requestParameters.filterMetadataLastSeenAt;
}
if (requestParameters.filterMetadataPlatform !== undefined) {
queryParameters['filter.metadata.platform'] = requestParameters.filterMetadataPlatform;
}
if (requestParameters.filterMetadataUpdateAvailable !== undefined) {
queryParameters['filter.metadata.updateAvailable'] = requestParameters.filterMetadataUpdateAvailable;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/hosts`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostsList200ResponseFromJSON(jsonValue));
}
/**
* Get a paginated list of hosts, lighthouses, and relays. Token scope required: `hosts:list` ### Request
* List hosts
*/
async hostsList(requestParameters: HostsListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HostsList200Response> {
const response = await this.hostsListRaw(requestParameters, initOverrides);
return await response.value();
}
}
/**
* @export
*/
export const HostsListFilterMetadataLastSeenAtEnum = {
Null: 'null'
} as const;
export type HostsListFilterMetadataLastSeenAtEnum = typeof HostsListFilterMetadataLastSeenAtEnum[keyof typeof HostsListFilterMetadataLastSeenAtEnum];
/**
* @export
*/
export const HostsListFilterMetadataPlatformEnum = {
Mobile: 'mobile',
Dnclient: 'dnclient',
Null: 'null'
} as const;
export type HostsListFilterMetadataPlatformEnum = typeof HostsListFilterMetadataPlatformEnum[keyof typeof HostsListFilterMetadataPlatformEnum];

View File

@ -0,0 +1,93 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import { NetworkGet200ResponseFromJSON, NetworkGet200ResponseToJSON, NetworksList200ResponseFromJSON, NetworksList200ResponseToJSON, } from '../models';
/**
*
*/
export class NetworksApi extends runtime.BaseAPI {
/**
* Fetch information about a particular network. Token scope required: `networks:read` ### Request
* Get network
*/
async networkGetRaw(requestParameters, initOverrides) {
if (requestParameters.networkID === null || requestParameters.networkID === undefined) {
throw new runtime.RequiredError('networkID', 'Required parameter requestParameters.networkID was null or undefined when calling networkGet.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/networks/{networkID}`.replace(`{${"networkID"}}`, encodeURIComponent(String(requestParameters.networkID))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => NetworkGet200ResponseFromJSON(jsonValue));
}
/**
* Fetch information about a particular network. Token scope required: `networks:read` ### Request
* Get network
*/
async networkGet(requestParameters, initOverrides) {
const response = await this.networkGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get a paginated list of networks. :::note Currently, there is a limit of one network per Defined Networking account. ::: Token scope required: `networks:list` ### Request
* List networks
*/
async networksListRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters.includeCounts !== undefined) {
queryParameters['includeCounts'] = requestParameters.includeCounts;
}
if (requestParameters.cursor !== undefined) {
queryParameters['cursor'] = requestParameters.cursor;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/networks`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => NetworksList200ResponseFromJSON(jsonValue));
}
/**
* Get a paginated list of networks. :::note Currently, there is a limit of one network per Defined Networking account. ::: Token scope required: `networks:list` ### Request
* List networks
*/
async networksList(requestParameters = {}, initOverrides) {
const response = await this.networksListRaw(requestParameters, initOverrides);
return await response.value();
}
}
//# sourceMappingURL=NetworksApi.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"NetworksApi.js","sourceRoot":"","sources":["NetworksApi.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAKtC,OAAO,EACH,6BAA6B,EAC7B,2BAA2B,EAC3B,+BAA+B,EAC/B,6BAA6B,GAChC,MAAM,WAAW,CAAC;AAYnB;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,OAAO,CAAC,OAAO;IAE5C;;;OAGG;IACH,KAAK,CAAC,aAAa,CAAC,iBAAoC,EAAE,aAA0D;QAChH,IAAI,iBAAiB,CAAC,SAAS,KAAK,IAAI,IAAI,iBAAiB,CAAC,SAAS,KAAK,SAAS,EAAE;YACnF,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC,WAAW,EAAC,+FAA+F,CAAC,CAAC;SAChJ;QAED,MAAM,eAAe,GAAQ,EAAE,CAAC;QAEhC,MAAM,gBAAgB,GAAwB,EAAE,CAAC;QAEjD,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE;YACtD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YAC7C,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAEhD,IAAI,WAAW,EAAE;gBACb,gBAAgB,CAAC,eAAe,CAAC,GAAG,UAAU,WAAW,EAAE,CAAC;aAC/D;SACJ;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC;YAChC,IAAI,EAAE,0BAA0B,CAAC,OAAO,CAAC,IAAI,WAAW,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;YACrH,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,gBAAgB;YACzB,KAAK,EAAE,eAAe;SACzB,EAAE,aAAa,CAAC,CAAC;QAElB,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1G,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU,CAAC,iBAAoC,EAAE,aAA0D;QAC7G,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;QAC5E,OAAO,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,eAAe,CAAC,iBAAsC,EAAE,aAA0D;QACpH,MAAM,eAAe,GAAQ,EAAE,CAAC;QAEhC,IAAI,iBAAiB,CAAC,aAAa,KAAK,SAAS,EAAE;YAC/C,eAAe,CAAC,eAAe,CAAC,GAAG,iBAAiB,CAAC,aAAa,CAAC;SACtE;QAED,IAAI,iBAAiB,CAAC,MAAM,KAAK,SAAS,EAAE;YACxC,eAAe,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC;SACxD;QAED,IAAI,iBAAiB,CAAC,QAAQ,KAAK,SAAS,EAAE;YAC1C,eAAe,CAAC,UAAU,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC;SAC5D;QAED,MAAM,gBAAgB,GAAwB,EAAE,CAAC;QAEjD,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE;YACtD,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YAC7C,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAEhD,IAAI,WAAW,EAAE;gBACb,gBAAgB,CAAC,eAAe,CAAC,GAAG,UAAU,WAAW,EAAE,CAAC;aAC/D;SACJ;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC;YAChC,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,gBAAgB;YACzB,KAAK,EAAE,eAAe;SACzB,EAAE,aAAa,CAAC,CAAC;QAElB,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5G,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,YAAY,CAAC,oBAAyC,EAAE,EAAE,aAA0D;QACtH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;QAC9E,OAAO,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;CAEJ"}

View File

@ -0,0 +1,131 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
NetworkGet200Response,
NetworksList200Response,
} from '../models';
import {
NetworkGet200ResponseFromJSON,
NetworkGet200ResponseToJSON,
NetworksList200ResponseFromJSON,
NetworksList200ResponseToJSON,
} from '../models';
export interface NetworkGetRequest {
networkID: string;
}
export interface NetworksListRequest {
includeCounts?: boolean;
cursor?: string;
pageSize?: number;
}
/**
*
*/
export class NetworksApi extends runtime.BaseAPI {
/**
* Fetch information about a particular network. Token scope required: `networks:read` ### Request
* Get network
*/
async networkGetRaw(requestParameters: NetworkGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NetworkGet200Response>> {
if (requestParameters.networkID === null || requestParameters.networkID === undefined) {
throw new runtime.RequiredError('networkID','Required parameter requestParameters.networkID was null or undefined when calling networkGet.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/networks/{networkID}`.replace(`{${"networkID"}}`, encodeURIComponent(String(requestParameters.networkID))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => NetworkGet200ResponseFromJSON(jsonValue));
}
/**
* Fetch information about a particular network. Token scope required: `networks:read` ### Request
* Get network
*/
async networkGet(requestParameters: NetworkGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NetworkGet200Response> {
const response = await this.networkGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get a paginated list of networks. :::note Currently, there is a limit of one network per Defined Networking account. ::: Token scope required: `networks:list` ### Request
* List networks
*/
async networksListRaw(requestParameters: NetworksListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NetworksList200Response>> {
const queryParameters: any = {};
if (requestParameters.includeCounts !== undefined) {
queryParameters['includeCounts'] = requestParameters.includeCounts;
}
if (requestParameters.cursor !== undefined) {
queryParameters['cursor'] = requestParameters.cursor;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/networks`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => NetworksList200ResponseFromJSON(jsonValue));
}
/**
* Get a paginated list of networks. :::note Currently, there is a limit of one network per Defined Networking account. ::: Token scope required: `networks:list` ### Request
* List networks
*/
async networksList(requestParameters: NetworksListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NetworksList200Response> {
const response = await this.networksListRaw(requestParameters, initOverrides);
return await response.value();
}
}

View File

@ -0,0 +1,199 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import { HostAndEnrollCodeCreate400ResponseFromJSON, HostAndEnrollCodeCreate400ResponseToJSON, HostDelete200ResponseFromJSON, HostDelete200ResponseToJSON, RoleCreate200ResponseFromJSON, RoleCreate200ResponseToJSON, RoleCreateRequestFromJSON, RoleCreateRequestToJSON, RoleEditRequestFromJSON, RoleEditRequestToJSON, RolesList200ResponseFromJSON, RolesList200ResponseToJSON, } from '../models';
/**
*
*/
export class RolesApi extends runtime.BaseAPI {
/**
* Create a new role. Token scope required: `roles:create` ### Request
* Create role
*/
async roleCreateRaw(requestParameters, initOverrides) {
if (requestParameters.roleCreateRequest === null || requestParameters.roleCreateRequest === undefined) {
throw new runtime.RequiredError('roleCreateRequest', 'Required parameter requestParameters.roleCreateRequest was null or undefined when calling roleCreate.');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/roles`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: RoleCreateRequestToJSON(requestParameters.roleCreateRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RoleCreate200ResponseFromJSON(jsonValue));
}
/**
* Create a new role. Token scope required: `roles:create` ### Request
* Create role
*/
async roleCreate(requestParameters, initOverrides) {
const response = await this.roleCreateRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Token scope required: `roles:delete` ### Request
* Delete role
*/
async roleDeleteRaw(requestParameters, initOverrides) {
if (requestParameters.roleID === null || requestParameters.roleID === undefined) {
throw new runtime.RequiredError('roleID', 'Required parameter requestParameters.roleID was null or undefined when calling roleDelete.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/roles/{roleID}`.replace(`{${"roleID"}}`, encodeURIComponent(String(requestParameters.roleID))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostDelete200ResponseFromJSON(jsonValue));
}
/**
* Token scope required: `roles:delete` ### Request
* Delete role
*/
async roleDelete(requestParameters, initOverrides) {
const response = await this.roleDeleteRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Token scope required: `roles:update` :::caution Any properties not provided in the request will be reset to their default values. If only changing one firewall rule, be sure to include the others as well, otherwise they will be removed. ::: ### Request
* Edit role
*/
async roleEditRaw(requestParameters, initOverrides) {
if (requestParameters.roleID === null || requestParameters.roleID === undefined) {
throw new runtime.RequiredError('roleID', 'Required parameter requestParameters.roleID was null or undefined when calling roleEdit.');
}
if (requestParameters.roleEditRequest === null || requestParameters.roleEditRequest === undefined) {
throw new runtime.RequiredError('roleEditRequest', 'Required parameter requestParameters.roleEditRequest was null or undefined when calling roleEdit.');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/roles/{roleID}`.replace(`{${"roleID"}}`, encodeURIComponent(String(requestParameters.roleID))),
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: RoleEditRequestToJSON(requestParameters.roleEditRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RoleCreate200ResponseFromJSON(jsonValue));
}
/**
* Token scope required: `roles:update` :::caution Any properties not provided in the request will be reset to their default values. If only changing one firewall rule, be sure to include the others as well, otherwise they will be removed. ::: ### Request
* Edit role
*/
async roleEdit(requestParameters, initOverrides) {
const response = await this.roleEditRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Fetch information about a particular role. Token scope required: `roles:read` ### Request
* Get role
*/
async roleGetRaw(requestParameters, initOverrides) {
if (requestParameters.roleID === null || requestParameters.roleID === undefined) {
throw new runtime.RequiredError('roleID', 'Required parameter requestParameters.roleID was null or undefined when calling roleGet.');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/roles/{roleID}`.replace(`{${"roleID"}}`, encodeURIComponent(String(requestParameters.roleID))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RoleCreate200ResponseFromJSON(jsonValue));
}
/**
* Fetch information about a particular role. Token scope required: `roles:read` ### Request
* Get role
*/
async roleGet(requestParameters, initOverrides) {
const response = await this.roleGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get a paginated list of roles. Token scope required: `roles:list` ### Request
* List roles
*/
async rolesListRaw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters.includeCounts !== undefined) {
queryParameters['includeCounts'] = requestParameters.includeCounts;
}
if (requestParameters.cursor !== undefined) {
queryParameters['cursor'] = requestParameters.cursor;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
const headerParameters = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/roles`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RolesList200ResponseFromJSON(jsonValue));
}
/**
* Get a paginated list of roles. Token scope required: `roles:list` ### Request
* List roles
*/
async rolesList(requestParameters = {}, initOverrides) {
const response = await this.rolesListRaw(requestParameters, initOverrides);
return await response.value();
}
}
//# sourceMappingURL=RolesApi.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,286 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
HostAndEnrollCodeCreate400Response,
HostDelete200Response,
RoleCreate200Response,
RoleCreateRequest,
RoleEditRequest,
RolesList200Response,
} from '../models';
import {
HostAndEnrollCodeCreate400ResponseFromJSON,
HostAndEnrollCodeCreate400ResponseToJSON,
HostDelete200ResponseFromJSON,
HostDelete200ResponseToJSON,
RoleCreate200ResponseFromJSON,
RoleCreate200ResponseToJSON,
RoleCreateRequestFromJSON,
RoleCreateRequestToJSON,
RoleEditRequestFromJSON,
RoleEditRequestToJSON,
RolesList200ResponseFromJSON,
RolesList200ResponseToJSON,
} from '../models';
export interface RoleCreateOperationRequest {
roleCreateRequest: RoleCreateRequest;
}
export interface RoleDeleteRequest {
roleID: string;
}
export interface RoleEditOperationRequest {
roleID: string;
roleEditRequest: RoleEditRequest;
}
export interface RoleGetRequest {
roleID: string;
}
export interface RolesListRequest {
includeCounts?: boolean;
cursor?: string;
pageSize?: number;
}
/**
*
*/
export class RolesApi extends runtime.BaseAPI {
/**
* Create a new role. Token scope required: `roles:create` ### Request
* Create role
*/
async roleCreateRaw(requestParameters: RoleCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RoleCreate200Response>> {
if (requestParameters.roleCreateRequest === null || requestParameters.roleCreateRequest === undefined) {
throw new runtime.RequiredError('roleCreateRequest','Required parameter requestParameters.roleCreateRequest was null or undefined when calling roleCreate.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/roles`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: RoleCreateRequestToJSON(requestParameters.roleCreateRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RoleCreate200ResponseFromJSON(jsonValue));
}
/**
* Create a new role. Token scope required: `roles:create` ### Request
* Create role
*/
async roleCreate(requestParameters: RoleCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RoleCreate200Response> {
const response = await this.roleCreateRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Token scope required: `roles:delete` ### Request
* Delete role
*/
async roleDeleteRaw(requestParameters: RoleDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HostDelete200Response>> {
if (requestParameters.roleID === null || requestParameters.roleID === undefined) {
throw new runtime.RequiredError('roleID','Required parameter requestParameters.roleID was null or undefined when calling roleDelete.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/roles/{roleID}`.replace(`{${"roleID"}}`, encodeURIComponent(String(requestParameters.roleID))),
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HostDelete200ResponseFromJSON(jsonValue));
}
/**
* Token scope required: `roles:delete` ### Request
* Delete role
*/
async roleDelete(requestParameters: RoleDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HostDelete200Response> {
const response = await this.roleDeleteRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Token scope required: `roles:update` :::caution Any properties not provided in the request will be reset to their default values. If only changing one firewall rule, be sure to include the others as well, otherwise they will be removed. ::: ### Request
* Edit role
*/
async roleEditRaw(requestParameters: RoleEditOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RoleCreate200Response>> {
if (requestParameters.roleID === null || requestParameters.roleID === undefined) {
throw new runtime.RequiredError('roleID','Required parameter requestParameters.roleID was null or undefined when calling roleEdit.');
}
if (requestParameters.roleEditRequest === null || requestParameters.roleEditRequest === undefined) {
throw new runtime.RequiredError('roleEditRequest','Required parameter requestParameters.roleEditRequest was null or undefined when calling roleEdit.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/roles/{roleID}`.replace(`{${"roleID"}}`, encodeURIComponent(String(requestParameters.roleID))),
method: 'PUT',
headers: headerParameters,
query: queryParameters,
body: RoleEditRequestToJSON(requestParameters.roleEditRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RoleCreate200ResponseFromJSON(jsonValue));
}
/**
* Token scope required: `roles:update` :::caution Any properties not provided in the request will be reset to their default values. If only changing one firewall rule, be sure to include the others as well, otherwise they will be removed. ::: ### Request
* Edit role
*/
async roleEdit(requestParameters: RoleEditOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RoleCreate200Response> {
const response = await this.roleEditRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Fetch information about a particular role. Token scope required: `roles:read` ### Request
* Get role
*/
async roleGetRaw(requestParameters: RoleGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RoleCreate200Response>> {
if (requestParameters.roleID === null || requestParameters.roleID === undefined) {
throw new runtime.RequiredError('roleID','Required parameter requestParameters.roleID was null or undefined when calling roleGet.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/roles/{roleID}`.replace(`{${"roleID"}}`, encodeURIComponent(String(requestParameters.roleID))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RoleCreate200ResponseFromJSON(jsonValue));
}
/**
* Fetch information about a particular role. Token scope required: `roles:read` ### Request
* Get role
*/
async roleGet(requestParameters: RoleGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RoleCreate200Response> {
const response = await this.roleGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get a paginated list of roles. Token scope required: `roles:list` ### Request
* List roles
*/
async rolesListRaw(requestParameters: RolesListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RolesList200Response>> {
const queryParameters: any = {};
if (requestParameters.includeCounts !== undefined) {
queryParameters['includeCounts'] = requestParameters.includeCounts;
}
if (requestParameters.cursor !== undefined) {
queryParameters['cursor'] = requestParameters.cursor;
}
if (requestParameters.pageSize !== undefined) {
queryParameters['pageSize'] = requestParameters.pageSize;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("ApiToken", []);
if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/v1/roles`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RolesList200ResponseFromJSON(jsonValue));
}
/**
* Get a paginated list of roles. Token scope required: `roles:list` ### Request
* List roles
*/
async rolesList(requestParameters: RolesListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RolesList200Response> {
const response = await this.rolesListRaw(requestParameters, initOverrides);
return await response.value();
}
}

View File

@ -0,0 +1,8 @@
/* tslint:disable */
/* eslint-disable */
export * from './AuditLogsApi';
export * from './DownloadsApi';
export * from './HostsApi';
export * from './NetworksApi';
export * from './RolesApi';
//# sourceMappingURL=index.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}

View File

@ -0,0 +1,7 @@
/* tslint:disable */
/* eslint-disable */
export * from './AuditLogsApi';
export * from './DownloadsApi';
export * from './HostsApi';
export * from './NetworksApi';
export * from './RolesApi';

View File

@ -0,0 +1,6 @@
/* tslint:disable */
/* eslint-disable */
export * from './runtime';
export * from './apis';
export * from './models';
//# sourceMappingURL=index.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}

View File

@ -0,0 +1,5 @@
/* tslint:disable */
/* eslint-disable */
export * from './runtime';
export * from './apis';
export * from './models';

View File

@ -0,0 +1,56 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { instanceOfActorAPIKey, ActorAPIKeyFromJSON, ActorAPIKeyFromJSONTyped, ActorAPIKeyToJSON, } from './ActorAPIKey';
import { instanceOfActorHost, ActorHostFromJSON, ActorHostFromJSONTyped, ActorHostToJSON, } from './ActorHost';
import { instanceOfActorOIDCUser, ActorOIDCUserFromJSON, ActorOIDCUserFromJSONTyped, ActorOIDCUserToJSON, } from './ActorOIDCUser';
import { instanceOfActorSupport, ActorSupportFromJSON, ActorSupportFromJSONTyped, ActorSupportToJSON, } from './ActorSupport';
import { instanceOfActorSystem, ActorSystemFromJSON, ActorSystemFromJSONTyped, ActorSystemToJSON, } from './ActorSystem';
import { instanceOfActorUser, ActorUserFromJSON, ActorUserFromJSONTyped, ActorUserToJSON, } from './ActorUser';
export function ActorFromJSON(json) {
return ActorFromJSONTyped(json, false);
}
export function ActorFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return { ...ActorAPIKeyFromJSONTyped(json, true), ...ActorHostFromJSONTyped(json, true), ...ActorOIDCUserFromJSONTyped(json, true), ...ActorSupportFromJSONTyped(json, true), ...ActorSystemFromJSONTyped(json, true), ...ActorUserFromJSONTyped(json, true) };
}
export function ActorToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
if (instanceOfActorAPIKey(value)) {
return ActorAPIKeyToJSON(value);
}
if (instanceOfActorHost(value)) {
return ActorHostToJSON(value);
}
if (instanceOfActorOIDCUser(value)) {
return ActorOIDCUserToJSON(value);
}
if (instanceOfActorSupport(value)) {
return ActorSupportToJSON(value);
}
if (instanceOfActorSystem(value)) {
return ActorSystemToJSON(value);
}
if (instanceOfActorUser(value)) {
return ActorUserToJSON(value);
}
return {};
}
//# sourceMappingURL=Actor.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Actor.js","sourceRoot":"","sources":["Actor.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAGH,OAAO,EACH,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,GACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,GAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACH,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACH,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,GACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACH,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,GAClB,MAAM,aAAa,CAAC;AASrB,MAAM,UAAU,aAAa,CAAC,IAAS;IACnC,OAAO,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAS,EAAE,mBAA4B;IACtE,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO,EAAE,GAAG,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,0BAA0B,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,yBAAyB,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;AACnQ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAoB;IAC5C,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IAED,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE;QAC9B,OAAO,iBAAiB,CAAC,KAAoB,CAAC,CAAC;KAClD;IACD,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE;QAC5B,OAAO,eAAe,CAAC,KAAkB,CAAC,CAAC;KAC9C;IACD,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAAE;QAChC,OAAO,mBAAmB,CAAC,KAAsB,CAAC,CAAC;KACtD;IACD,IAAI,sBAAsB,CAAC,KAAK,CAAC,EAAE;QAC/B,OAAO,kBAAkB,CAAC,KAAqB,CAAC,CAAC;KACpD;IACD,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE;QAC9B,OAAO,iBAAiB,CAAC,KAAoB,CAAC,CAAC;KAClD;IACD,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE;QAC5B,OAAO,eAAe,CAAC,KAAkB,CAAC,CAAC;KAC9C;IAED,OAAO,EAAE,CAAC;AACd,CAAC"}

View File

@ -0,0 +1,105 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type {ActorAPIKey} from './ActorAPIKey';
import {
instanceOfActorAPIKey,
ActorAPIKeyFromJSON,
ActorAPIKeyFromJSONTyped,
ActorAPIKeyToJSON,
} from './ActorAPIKey';
import type {ActorHost} from './ActorHost';
import {
instanceOfActorHost,
ActorHostFromJSON,
ActorHostFromJSONTyped,
ActorHostToJSON,
} from './ActorHost';
import type {ActorOIDCUser} from './ActorOIDCUser';
import {
instanceOfActorOIDCUser,
ActorOIDCUserFromJSON,
ActorOIDCUserFromJSONTyped,
ActorOIDCUserToJSON,
} from './ActorOIDCUser';
import type {ActorSupport} from './ActorSupport';
import {
instanceOfActorSupport,
ActorSupportFromJSON,
ActorSupportFromJSONTyped,
ActorSupportToJSON,
} from './ActorSupport';
import type {ActorSystem} from './ActorSystem';
import {
instanceOfActorSystem,
ActorSystemFromJSON,
ActorSystemFromJSONTyped,
ActorSystemToJSON,
} from './ActorSystem';
import type {ActorUser} from './ActorUser';
import {
instanceOfActorUser,
ActorUserFromJSON,
ActorUserFromJSONTyped,
ActorUserToJSON,
} from './ActorUser';
/**
* @type Actor
* The entity performing the action which caused a change.
* @export
*/
export type Actor = ActorAPIKey | ActorHost | ActorOIDCUser | ActorSupport | ActorSystem | ActorUser;
export function ActorFromJSON(json: any): Actor {
return ActorFromJSONTyped(json, false);
}
export function ActorFromJSONTyped(json: any, ignoreDiscriminator: boolean): Actor {
if ((json === undefined) || (json === null)) {
return json;
}
return { ...ActorAPIKeyFromJSONTyped(json, true), ...ActorHostFromJSONTyped(json, true), ...ActorOIDCUserFromJSONTyped(json, true), ...ActorSupportFromJSONTyped(json, true), ...ActorSystemFromJSONTyped(json, true), ...ActorUserFromJSONTyped(json, true) };
}
export function ActorToJSON(value?: Actor | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
if (instanceOfActorAPIKey(value)) {
return ActorAPIKeyToJSON(value as ActorAPIKey);
}
if (instanceOfActorHost(value)) {
return ActorHostToJSON(value as ActorHost);
}
if (instanceOfActorOIDCUser(value)) {
return ActorOIDCUserToJSON(value as ActorOIDCUser);
}
if (instanceOfActorSupport(value)) {
return ActorSupportToJSON(value as ActorSupport);
}
if (instanceOfActorSystem(value)) {
return ActorSystemToJSON(value as ActorSystem);
}
if (instanceOfActorUser(value)) {
return ActorUserToJSON(value as ActorUser);
}
return {};
}

View File

@ -0,0 +1,54 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
* @export
*/
export const ActorAPIKeyTypeEnum = {
ApiKey: 'apiKey'
};
/**
* Check if a given object implements the ActorAPIKey interface.
*/
export function instanceOfActorAPIKey(value) {
let isInstance = true;
return isInstance;
}
export function ActorAPIKeyFromJSON(json) {
return ActorAPIKeyFromJSONTyped(json, false);
}
export function ActorAPIKeyFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
};
}
export function ActorAPIKeyToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'id': value.id,
'name': value.name,
};
}
//# sourceMappingURL=ActorAPIKey.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ActorAPIKey.js","sourceRoot":"","sources":["ActorAPIKey.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4B/C;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,MAAM,EAAE,QAAQ;CACV,CAAC;AAIX;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa;IAC/C,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,IAAS;IACzC,OAAO,wBAAwB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAAS,EAAE,mBAA4B;IAC5E,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QACxD,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAClD,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;KAC3D,CAAC;AACN,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAA0B;IACxD,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,KAAK,CAAC,IAAI;QAClB,IAAI,EAAE,KAAK,CAAC,EAAE;QACd,MAAM,EAAE,KAAK,CAAC,IAAI;KACrB,CAAC;AACN,CAAC"}

View File

@ -0,0 +1,91 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface ActorAPIKey
*/
export interface ActorAPIKey {
/**
* An API key which used to perform the action.
* @type {string}
* @memberof ActorAPIKey
*/
type?: ActorAPIKeyTypeEnum;
/**
*
* @type {string}
* @memberof ActorAPIKey
*/
id?: string;
/**
*
* @type {string}
* @memberof ActorAPIKey
*/
name?: string | null;
}
/**
* @export
*/
export const ActorAPIKeyTypeEnum = {
ApiKey: 'apiKey'
} as const;
export type ActorAPIKeyTypeEnum = typeof ActorAPIKeyTypeEnum[keyof typeof ActorAPIKeyTypeEnum];
/**
* Check if a given object implements the ActorAPIKey interface.
*/
export function instanceOfActorAPIKey(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function ActorAPIKeyFromJSON(json: any): ActorAPIKey {
return ActorAPIKeyFromJSONTyped(json, false);
}
export function ActorAPIKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActorAPIKey {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
};
}
export function ActorAPIKeyToJSON(value?: ActorAPIKey | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'id': value.id,
'name': value.name,
};
}

View File

@ -0,0 +1,54 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
* @export
*/
export const ActorHostTypeEnum = {
Host: 'host'
};
/**
* Check if a given object implements the ActorHost interface.
*/
export function instanceOfActorHost(value) {
let isInstance = true;
return isInstance;
}
export function ActorHostFromJSON(json) {
return ActorHostFromJSONTyped(json, false);
}
export function ActorHostFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
};
}
export function ActorHostToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'id': value.id,
'name': value.name,
};
}
//# sourceMappingURL=ActorHost.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ActorHost.js","sourceRoot":"","sources":["ActorHost.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4B/C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,IAAI,EAAE,MAAM;CACN,CAAC;AAIX;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC7C,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAS;IACvC,OAAO,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAS,EAAE,mBAA4B;IAC1E,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QACxD,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAClD,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;KAC3D,CAAC;AACN,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAwB;IACpD,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,KAAK,CAAC,IAAI;QAClB,IAAI,EAAE,KAAK,CAAC,EAAE;QACd,MAAM,EAAE,KAAK,CAAC,IAAI;KACrB,CAAC;AACN,CAAC"}

View File

@ -0,0 +1,91 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface ActorHost
*/
export interface ActorHost {
/**
* A host. Used for example when hosts are enrolled.
* @type {string}
* @memberof ActorHost
*/
type?: ActorHostTypeEnum;
/**
*
* @type {string}
* @memberof ActorHost
*/
id?: string;
/**
*
* @type {string}
* @memberof ActorHost
*/
name?: string | null;
}
/**
* @export
*/
export const ActorHostTypeEnum = {
Host: 'host'
} as const;
export type ActorHostTypeEnum = typeof ActorHostTypeEnum[keyof typeof ActorHostTypeEnum];
/**
* Check if a given object implements the ActorHost interface.
*/
export function instanceOfActorHost(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function ActorHostFromJSON(json: any): ActorHost {
return ActorHostFromJSONTyped(json, false);
}
export function ActorHostFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActorHost {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
};
}
export function ActorHostToJSON(value?: ActorHost | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'id': value.id,
'name': value.name,
};
}

View File

@ -0,0 +1,56 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
* @export
*/
export const ActorOIDCUserTypeEnum = {
OidcUser: 'oidcUser'
};
/**
* Check if a given object implements the ActorOIDCUser interface.
*/
export function instanceOfActorOIDCUser(value) {
let isInstance = true;
return isInstance;
}
export function ActorOIDCUserFromJSON(json) {
return ActorOIDCUserFromJSONTyped(json, false);
}
export function ActorOIDCUserFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
'email': !exists(json, 'email') ? undefined : json['email'],
'issuer': !exists(json, 'issuer') ? undefined : json['issuer'],
'subject': !exists(json, 'subject') ? undefined : json['subject'],
};
}
export function ActorOIDCUserToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'email': value.email,
'issuer': value.issuer,
'subject': value.subject,
};
}
//# sourceMappingURL=ActorOIDCUser.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ActorOIDCUser.js","sourceRoot":"","sources":["ActorOIDCUser.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAkC/C;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,QAAQ,EAAE,UAAU;CACd,CAAC;AAIX;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAa;IACjD,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAS;IAC3C,OAAO,0BAA0B,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,IAAS,EAAE,mBAA4B;IAC9E,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QACxD,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QAC3D,QAAQ,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC9D,SAAS,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;KACpE,CAAC;AACN,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAA4B;IAC5D,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,KAAK,CAAC,IAAI;QAClB,OAAO,EAAE,KAAK,CAAC,KAAK;QACpB,QAAQ,EAAE,KAAK,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK,CAAC,OAAO;KAC3B,CAAC;AACN,CAAC"}

View File

@ -0,0 +1,99 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface ActorOIDCUser
*/
export interface ActorOIDCUser {
/**
* A user who logged in using SSO.
* @type {string}
* @memberof ActorOIDCUser
*/
type?: ActorOIDCUserTypeEnum;
/**
*
* @type {string}
* @memberof ActorOIDCUser
*/
email?: string;
/**
*
* @type {string}
* @memberof ActorOIDCUser
*/
issuer?: string;
/**
*
* @type {string}
* @memberof ActorOIDCUser
*/
subject?: string;
}
/**
* @export
*/
export const ActorOIDCUserTypeEnum = {
OidcUser: 'oidcUser'
} as const;
export type ActorOIDCUserTypeEnum = typeof ActorOIDCUserTypeEnum[keyof typeof ActorOIDCUserTypeEnum];
/**
* Check if a given object implements the ActorOIDCUser interface.
*/
export function instanceOfActorOIDCUser(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function ActorOIDCUserFromJSON(json: any): ActorOIDCUser {
return ActorOIDCUserFromJSONTyped(json, false);
}
export function ActorOIDCUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActorOIDCUser {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
'email': !exists(json, 'email') ? undefined : json['email'],
'issuer': !exists(json, 'issuer') ? undefined : json['issuer'],
'subject': !exists(json, 'subject') ? undefined : json['subject'],
};
}
export function ActorOIDCUserToJSON(value?: ActorOIDCUser | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'email': value.email,
'issuer': value.issuer,
'subject': value.subject,
};
}

View File

@ -0,0 +1,50 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
* @export
*/
export const ActorSupportTypeEnum = {
Support: 'support'
};
/**
* Check if a given object implements the ActorSupport interface.
*/
export function instanceOfActorSupport(value) {
let isInstance = true;
return isInstance;
}
export function ActorSupportFromJSON(json) {
return ActorSupportFromJSONTyped(json, false);
}
export function ActorSupportFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
};
}
export function ActorSupportToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
};
}
//# sourceMappingURL=ActorSupport.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ActorSupport.js","sourceRoot":"","sources":["ActorSupport.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAgB/C;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,OAAO,EAAE,SAAS;CACZ,CAAC;AAIX;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAChD,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAS;IAC1C,OAAO,yBAAyB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,IAAS,EAAE,mBAA4B;IAC7E,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;KAC3D,CAAC;AACN,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAA2B;IAC1D,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,KAAK,CAAC,IAAI;KACrB,CAAC;AACN,CAAC"}

View File

@ -0,0 +1,75 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface ActorSupport
*/
export interface ActorSupport {
/**
* A member of Defined Networking support staff.
* @type {string}
* @memberof ActorSupport
*/
type?: ActorSupportTypeEnum;
}
/**
* @export
*/
export const ActorSupportTypeEnum = {
Support: 'support'
} as const;
export type ActorSupportTypeEnum = typeof ActorSupportTypeEnum[keyof typeof ActorSupportTypeEnum];
/**
* Check if a given object implements the ActorSupport interface.
*/
export function instanceOfActorSupport(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function ActorSupportFromJSON(json: any): ActorSupport {
return ActorSupportFromJSONTyped(json, false);
}
export function ActorSupportFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActorSupport {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
};
}
export function ActorSupportToJSON(value?: ActorSupport | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
};
}

View File

@ -0,0 +1,50 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
* @export
*/
export const ActorSystemTypeEnum = {
System: 'system'
};
/**
* Check if a given object implements the ActorSystem interface.
*/
export function instanceOfActorSystem(value) {
let isInstance = true;
return isInstance;
}
export function ActorSystemFromJSON(json) {
return ActorSystemFromJSONTyped(json, false);
}
export function ActorSystemFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
};
}
export function ActorSystemToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
};
}
//# sourceMappingURL=ActorSystem.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ActorSystem.js","sourceRoot":"","sources":["ActorSystem.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAgB/C;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,MAAM,EAAE,QAAQ;CACV,CAAC;AAIX;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa;IAC/C,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,IAAS;IACzC,OAAO,wBAAwB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAAS,EAAE,mBAA4B;IAC5E,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;KAC3D,CAAC;AACN,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAA0B;IACxD,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,KAAK,CAAC,IAAI;KACrB,CAAC;AACN,CAAC"}

View File

@ -0,0 +1,75 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface ActorSystem
*/
export interface ActorSystem {
/**
* System actor, used for events such as creation or rotation of Certificate Authorities.
* @type {string}
* @memberof ActorSystem
*/
type?: ActorSystemTypeEnum;
}
/**
* @export
*/
export const ActorSystemTypeEnum = {
System: 'system'
} as const;
export type ActorSystemTypeEnum = typeof ActorSystemTypeEnum[keyof typeof ActorSystemTypeEnum];
/**
* Check if a given object implements the ActorSystem interface.
*/
export function instanceOfActorSystem(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function ActorSystemFromJSON(json: any): ActorSystem {
return ActorSystemFromJSONTyped(json, false);
}
export function ActorSystemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActorSystem {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
};
}
export function ActorSystemToJSON(value?: ActorSystem | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
};
}

View File

@ -0,0 +1,54 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
* @export
*/
export const ActorUserTypeEnum = {
User: 'user'
};
/**
* Check if a given object implements the ActorUser interface.
*/
export function instanceOfActorUser(value) {
let isInstance = true;
return isInstance;
}
export function ActorUserFromJSON(json) {
return ActorUserFromJSONTyped(json, false);
}
export function ActorUserFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
'id': !exists(json, 'id') ? undefined : json['id'],
'email': !exists(json, 'email') ? undefined : json['email'],
};
}
export function ActorUserToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'id': value.id,
'email': value.email,
};
}
//# sourceMappingURL=ActorUser.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ActorUser.js","sourceRoot":"","sources":["ActorUser.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4B/C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,IAAI,EAAE,MAAM;CACN,CAAC;AAIX;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC7C,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAS;IACvC,OAAO,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAS,EAAE,mBAA4B;IAC1E,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;QACxD,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAClD,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;KAC9D,CAAC;AACN,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAwB;IACpD,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,KAAK,CAAC,IAAI;QAClB,IAAI,EAAE,KAAK,CAAC,EAAE;QACd,OAAO,EAAE,KAAK,CAAC,KAAK;KACvB,CAAC;AACN,CAAC"}

View File

@ -0,0 +1,91 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface ActorUser
*/
export interface ActorUser {
/**
* A logged-in user.
* @type {string}
* @memberof ActorUser
*/
type?: ActorUserTypeEnum;
/**
*
* @type {string}
* @memberof ActorUser
*/
id?: string;
/**
*
* @type {string}
* @memberof ActorUser
*/
email?: string;
}
/**
* @export
*/
export const ActorUserTypeEnum = {
User: 'user'
} as const;
export type ActorUserTypeEnum = typeof ActorUserTypeEnum[keyof typeof ActorUserTypeEnum];
/**
* Check if a given object implements the ActorUser interface.
*/
export function instanceOfActorUser(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function ActorUserFromJSON(json: any): ActorUser {
return ActorUserFromJSONTyped(json, false);
}
export function ActorUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): ActorUser {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': !exists(json, 'type') ? undefined : json['type'],
'id': !exists(json, 'id') ? undefined : json['id'],
'email': !exists(json, 'email') ? undefined : json['email'],
};
}
export function ActorUserToJSON(value?: ActorUser | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'id': value.id,
'email': value.email,
};
}

View File

@ -0,0 +1,57 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import { ActorFromJSON, ActorFromJSONTyped, ActorToJSON, } from './Actor';
import { EventFromJSON, EventFromJSONTyped, EventToJSON, } from './Event';
import { TargetFromJSON, TargetFromJSONTyped, TargetToJSON, } from './Target';
/**
* Check if a given object implements the AuditLog interface.
*/
export function instanceOfAuditLog(value) {
let isInstance = true;
return isInstance;
}
export function AuditLogFromJSON(json) {
return AuditLogFromJSONTyped(json, false);
}
export function AuditLogFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'organizationID': !exists(json, 'organizationID') ? undefined : json['organizationID'],
'timestamp': !exists(json, 'timestamp') ? undefined : (new Date(json['timestamp'])),
'actor': !exists(json, 'actor') ? undefined : ActorFromJSON(json['actor']),
'target': !exists(json, 'target') ? undefined : TargetFromJSON(json['target']),
'event': !exists(json, 'event') ? undefined : EventFromJSON(json['event']),
};
}
export function AuditLogToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'organizationID': value.organizationID,
'timestamp': value.timestamp === undefined ? undefined : (value.timestamp.toISOString()),
'actor': ActorToJSON(value.actor),
'target': TargetToJSON(value.target),
'event': EventToJSON(value.event),
};
}
//# sourceMappingURL=AuditLog.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuditLog.js","sourceRoot":"","sources":["AuditLog.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EACH,aAAa,EACb,kBAAkB,EAClB,WAAW,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EACH,aAAa,EACb,kBAAkB,EAClB,WAAW,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EACH,cAAc,EACd,mBAAmB,EACnB,YAAY,GACf,MAAM,UAAU,CAAC;AA8ClB;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC5C,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAS;IACtC,OAAO,qBAAqB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAS,EAAE,mBAA4B;IACzE,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAClD,gBAAgB,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;QACtF,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QACnF,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1E,QAAQ,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9E,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC7E,CAAC;AACN,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAuB;IAClD,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,IAAI,EAAE,KAAK,CAAC,EAAE;QACd,gBAAgB,EAAE,KAAK,CAAC,cAAc;QACtC,WAAW,EAAE,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;QACxF,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC;QACjC,QAAQ,EAAE,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC;QACpC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC;KACpC,CAAC;AACN,CAAC"}

View File

@ -0,0 +1,124 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Actor } from './Actor';
import {
ActorFromJSON,
ActorFromJSONTyped,
ActorToJSON,
} from './Actor';
import type { Event } from './Event';
import {
EventFromJSON,
EventFromJSONTyped,
EventToJSON,
} from './Event';
import type { Target } from './Target';
import {
TargetFromJSON,
TargetFromJSONTyped,
TargetToJSON,
} from './Target';
/**
*
* @export
* @interface AuditLog
*/
export interface AuditLog {
/**
*
* @type {string}
* @memberof AuditLog
*/
id?: string;
/**
*
* @type {string}
* @memberof AuditLog
*/
organizationID?: string;
/**
*
* @type {Date}
* @memberof AuditLog
*/
timestamp?: Date;
/**
*
* @type {Actor}
* @memberof AuditLog
*/
actor?: Actor;
/**
*
* @type {Target}
* @memberof AuditLog
*/
target?: Target;
/**
*
* @type {Event}
* @memberof AuditLog
*/
event?: Event;
}
/**
* Check if a given object implements the AuditLog interface.
*/
export function instanceOfAuditLog(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function AuditLogFromJSON(json: any): AuditLog {
return AuditLogFromJSONTyped(json, false);
}
export function AuditLogFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuditLog {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'organizationID': !exists(json, 'organizationID') ? undefined : json['organizationID'],
'timestamp': !exists(json, 'timestamp') ? undefined : (new Date(json['timestamp'])),
'actor': !exists(json, 'actor') ? undefined : ActorFromJSON(json['actor']),
'target': !exists(json, 'target') ? undefined : TargetFromJSON(json['target']),
'event': !exists(json, 'event') ? undefined : EventFromJSON(json['event']),
};
}
export function AuditLogToJSON(value?: AuditLog | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'organizationID': value.organizationID,
'timestamp': value.timestamp === undefined ? undefined : (value.timestamp.toISOString()),
'actor': ActorToJSON(value.actor),
'target': TargetToJSON(value.target),
'event': EventToJSON(value.event),
};
}

View File

@ -0,0 +1,48 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import { AuditLogFromJSON, AuditLogFromJSONTyped, AuditLogToJSON, } from './AuditLog';
import { PaginationMetadataFromJSON, PaginationMetadataFromJSONTyped, PaginationMetadataToJSON, } from './PaginationMetadata';
/**
* Check if a given object implements the AuditLogsList200Response interface.
*/
export function instanceOfAuditLogsList200Response(value) {
let isInstance = true;
return isInstance;
}
export function AuditLogsList200ResponseFromJSON(json) {
return AuditLogsList200ResponseFromJSONTyped(json, false);
}
export function AuditLogsList200ResponseFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'data': !exists(json, 'data') ? undefined : (json['data'].map(AuditLogFromJSON)),
'metadata': !exists(json, 'metadata') ? undefined : PaginationMetadataFromJSON(json['metadata']),
};
}
export function AuditLogsList200ResponseToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'data': value.data === undefined ? undefined : (value.data.map(AuditLogToJSON)),
'metadata': PaginationMetadataToJSON(value.metadata),
};
}
//# sourceMappingURL=AuditLogsList200Response.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuditLogsList200Response.js","sourceRoot":"","sources":["AuditLogsList200Response.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,GACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACH,0BAA0B,EAC1B,+BAA+B,EAC/B,wBAAwB,GAC3B,MAAM,sBAAsB,CAAC;AAsB9B;;GAEG;AACH,MAAM,UAAU,kCAAkC,CAAC,KAAa;IAC5D,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,IAAS;IACtD,OAAO,qCAAqC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,qCAAqC,CAAC,IAAS,EAAE,mBAA4B;IACzF,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,MAAM,CAAgB,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAChG,UAAU,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,0BAA0B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KACnG,CAAC;AACN,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,KAAuC;IAClF,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,MAAM,EAAE,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,IAAmB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC/F,UAAU,EAAE,wBAAwB,CAAC,KAAK,CAAC,QAAQ,CAAC;KACvD,CAAC;AACN,CAAC"}

View File

@ -0,0 +1,86 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { AuditLog } from './AuditLog';
import {
AuditLogFromJSON,
AuditLogFromJSONTyped,
AuditLogToJSON,
} from './AuditLog';
import type { PaginationMetadata } from './PaginationMetadata';
import {
PaginationMetadataFromJSON,
PaginationMetadataFromJSONTyped,
PaginationMetadataToJSON,
} from './PaginationMetadata';
/**
*
* @export
* @interface AuditLogsList200Response
*/
export interface AuditLogsList200Response {
/**
*
* @type {Array<AuditLog>}
* @memberof AuditLogsList200Response
*/
data?: Array<AuditLog>;
/**
*
* @type {PaginationMetadata}
* @memberof AuditLogsList200Response
*/
metadata?: PaginationMetadata;
}
/**
* Check if a given object implements the AuditLogsList200Response interface.
*/
export function instanceOfAuditLogsList200Response(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function AuditLogsList200ResponseFromJSON(json: any): AuditLogsList200Response {
return AuditLogsList200ResponseFromJSONTyped(json, false);
}
export function AuditLogsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuditLogsList200Response {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'data': !exists(json, 'data') ? undefined : ((json['data'] as Array<any>).map(AuditLogFromJSON)),
'metadata': !exists(json, 'metadata') ? undefined : PaginationMetadataFromJSON(json['metadata']),
};
}
export function AuditLogsList200ResponseToJSON(value?: AuditLogsList200Response | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'data': value.data === undefined ? undefined : ((value.data as Array<any>).map(AuditLogToJSON)),
'metadata': PaginationMetadataToJSON(value.metadata),
};
}

View File

@ -0,0 +1,51 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import { DownloadsDnclientFromJSON, DownloadsDnclientFromJSONTyped, DownloadsDnclientToJSON, } from './DownloadsDnclient';
import { DownloadsMobileFromJSON, DownloadsMobileFromJSONTyped, DownloadsMobileToJSON, } from './DownloadsMobile';
import { DownloadsVersionInfoFromJSON, DownloadsVersionInfoFromJSONTyped, DownloadsVersionInfoToJSON, } from './DownloadsVersionInfo';
/**
* Check if a given object implements the Downloads interface.
*/
export function instanceOfDownloads(value) {
let isInstance = true;
return isInstance;
}
export function DownloadsFromJSON(json) {
return DownloadsFromJSONTyped(json, false);
}
export function DownloadsFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'dnclient': !exists(json, 'dnclient') ? undefined : DownloadsDnclientFromJSON(json['dnclient']),
'mobile': !exists(json, 'mobile') ? undefined : DownloadsMobileFromJSON(json['mobile']),
'versionInfo': !exists(json, 'versionInfo') ? undefined : DownloadsVersionInfoFromJSON(json['versionInfo']),
};
}
export function DownloadsToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'dnclient': DownloadsDnclientToJSON(value.dnclient),
'mobile': DownloadsMobileToJSON(value.mobile),
'versionInfo': DownloadsVersionInfoToJSON(value.versionInfo),
};
}
//# sourceMappingURL=Downloads.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"Downloads.js","sourceRoot":"","sources":["Downloads.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EACH,yBAAyB,EACzB,8BAA8B,EAC9B,uBAAuB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,uBAAuB,EACvB,4BAA4B,EAC5B,qBAAqB,GACxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACH,4BAA4B,EAC5B,iCAAiC,EACjC,0BAA0B,GAC7B,MAAM,wBAAwB,CAAC;AA4BhC;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC7C,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAS;IACvC,OAAO,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAS,EAAE,mBAA4B;IAC1E,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,UAAU,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC/F,QAAQ,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvF,aAAa,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KAC9G,CAAC;AACN,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAwB;IACpD,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,UAAU,EAAE,uBAAuB,CAAC,KAAK,CAAC,QAAQ,CAAC;QACnD,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC;QAC7C,aAAa,EAAE,0BAA0B,CAAC,KAAK,CAAC,WAAW,CAAC;KAC/D,CAAC;AACN,CAAC"}

View File

@ -0,0 +1,100 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { DownloadsDnclient } from './DownloadsDnclient';
import {
DownloadsDnclientFromJSON,
DownloadsDnclientFromJSONTyped,
DownloadsDnclientToJSON,
} from './DownloadsDnclient';
import type { DownloadsMobile } from './DownloadsMobile';
import {
DownloadsMobileFromJSON,
DownloadsMobileFromJSONTyped,
DownloadsMobileToJSON,
} from './DownloadsMobile';
import type { DownloadsVersionInfo } from './DownloadsVersionInfo';
import {
DownloadsVersionInfoFromJSON,
DownloadsVersionInfoFromJSONTyped,
DownloadsVersionInfoToJSON,
} from './DownloadsVersionInfo';
/**
*
* @export
* @interface Downloads
*/
export interface Downloads {
/**
*
* @type {DownloadsDnclient}
* @memberof Downloads
*/
dnclient?: DownloadsDnclient;
/**
*
* @type {DownloadsMobile}
* @memberof Downloads
*/
mobile?: DownloadsMobile;
/**
*
* @type {DownloadsVersionInfo}
* @memberof Downloads
*/
versionInfo?: DownloadsVersionInfo;
}
/**
* Check if a given object implements the Downloads interface.
*/
export function instanceOfDownloads(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function DownloadsFromJSON(json: any): Downloads {
return DownloadsFromJSONTyped(json, false);
}
export function DownloadsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Downloads {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'dnclient': !exists(json, 'dnclient') ? undefined : DownloadsDnclientFromJSON(json['dnclient']),
'mobile': !exists(json, 'mobile') ? undefined : DownloadsMobileFromJSON(json['mobile']),
'versionInfo': !exists(json, 'versionInfo') ? undefined : DownloadsVersionInfoFromJSON(json['versionInfo']),
};
}
export function DownloadsToJSON(value?: Downloads | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'dnclient': DownloadsDnclientToJSON(value.dnclient),
'mobile': DownloadsMobileToJSON(value.mobile),
'versionInfo': DownloadsVersionInfoToJSON(value.versionInfo),
};
}

View File

@ -0,0 +1,56 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
* Check if a given object implements the DownloadsDNClientLinks interface.
*/
export function instanceOfDownloadsDNClientLinks(value) {
let isInstance = true;
return isInstance;
}
export function DownloadsDNClientLinksFromJSON(json) {
return DownloadsDNClientLinksFromJSONTyped(json, false);
}
export function DownloadsDNClientLinksFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
...json,
'linuxAmd64': !exists(json, 'linux-amd64') ? undefined : json['linux-amd64'],
'linuxArm64': !exists(json, 'linux-arm64') ? undefined : json['linux-arm64'],
'macosUniversal': !exists(json, 'macos-universal') ? undefined : json['macos-universal'],
'macosUniversalDmg': !exists(json, 'macos-universal-dmg') ? undefined : json['macos-universal-dmg'],
'windowsAmd64': !exists(json, 'windows-amd64') ? undefined : json['windows-amd64'],
'windowsArm64': !exists(json, 'windows-arm64') ? undefined : json['windows-arm64'],
};
}
export function DownloadsDNClientLinksToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
...value,
'linux-amd64': value.linuxAmd64,
'linux-arm64': value.linuxArm64,
'macos-universal': value.macosUniversal,
'macos-universal-dmg': value.macosUniversalDmg,
'windows-amd64': value.windowsAmd64,
'windows-arm64': value.windowsArm64,
};
}
//# sourceMappingURL=DownloadsDNClientLinks.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"DownloadsDNClientLinks.js","sourceRoot":"","sources":["DownloadsDNClientLinks.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA8C/C;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAAC,KAAa;IAC1D,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,IAAS;IACpD,OAAO,mCAAmC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,mCAAmC,CAAC,IAAS,EAAE,mBAA4B;IACvF,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEC,GAAG,IAAI;QACX,YAAY,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;QAC5E,YAAY,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;QAC5E,gBAAgB,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC;QACxF,mBAAmB,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC;QACnG,cAAc,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;QAClF,cAAc,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;KACrF,CAAC;AACN,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,KAAqC;IAC9E,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEC,GAAG,KAAK;QACZ,aAAa,EAAE,KAAK,CAAC,UAAU;QAC/B,aAAa,EAAE,KAAK,CAAC,UAAU;QAC/B,iBAAiB,EAAE,KAAK,CAAC,cAAc;QACvC,qBAAqB,EAAE,KAAK,CAAC,iBAAiB;QAC9C,eAAe,EAAE,KAAK,CAAC,YAAY;QACnC,eAAe,EAAE,KAAK,CAAC,YAAY;KACtC,CAAC;AACN,CAAC"}

View File

@ -0,0 +1,108 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
* Download links for a given DNClient version
* @export
* @interface DownloadsDNClientLinks
*/
export interface DownloadsDNClientLinks {
[key: string]: string | any;
/**
*
* @type {string}
* @memberof DownloadsDNClientLinks
*/
linuxAmd64?: string;
/**
*
* @type {string}
* @memberof DownloadsDNClientLinks
*/
linuxArm64?: string;
/**
*
* @type {string}
* @memberof DownloadsDNClientLinks
*/
macosUniversal?: string;
/**
*
* @type {string}
* @memberof DownloadsDNClientLinks
*/
macosUniversalDmg?: string;
/**
*
* @type {string}
* @memberof DownloadsDNClientLinks
*/
windowsAmd64?: string;
/**
*
* @type {string}
* @memberof DownloadsDNClientLinks
*/
windowsArm64?: string;
}
/**
* Check if a given object implements the DownloadsDNClientLinks interface.
*/
export function instanceOfDownloadsDNClientLinks(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function DownloadsDNClientLinksFromJSON(json: any): DownloadsDNClientLinks {
return DownloadsDNClientLinksFromJSONTyped(json, false);
}
export function DownloadsDNClientLinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): DownloadsDNClientLinks {
if ((json === undefined) || (json === null)) {
return json;
}
return {
...json,
'linuxAmd64': !exists(json, 'linux-amd64') ? undefined : json['linux-amd64'],
'linuxArm64': !exists(json, 'linux-arm64') ? undefined : json['linux-arm64'],
'macosUniversal': !exists(json, 'macos-universal') ? undefined : json['macos-universal'],
'macosUniversalDmg': !exists(json, 'macos-universal-dmg') ? undefined : json['macos-universal-dmg'],
'windowsAmd64': !exists(json, 'windows-amd64') ? undefined : json['windows-amd64'],
'windowsArm64': !exists(json, 'windows-arm64') ? undefined : json['windows-arm64'],
};
}
export function DownloadsDNClientLinksToJSON(value?: DownloadsDNClientLinks | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
...value,
'linux-amd64': value.linuxAmd64,
'linux-arm64': value.linuxArm64,
'macos-universal': value.macosUniversal,
'macos-universal-dmg': value.macosUniversalDmg,
'windows-amd64': value.windowsAmd64,
'windows-arm64': value.windowsArm64,
};
}

View File

@ -0,0 +1,47 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import { DownloadsDNClientLinksFromJSON, DownloadsDNClientLinksFromJSONTyped, DownloadsDNClientLinksToJSON, } from './DownloadsDNClientLinks';
/**
* Check if a given object implements the DownloadsDnclient interface.
*/
export function instanceOfDownloadsDnclient(value) {
let isInstance = true;
return isInstance;
}
export function DownloadsDnclientFromJSON(json) {
return DownloadsDnclientFromJSONTyped(json, false);
}
export function DownloadsDnclientFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
...json,
'latest': !exists(json, 'latest') ? undefined : DownloadsDNClientLinksFromJSON(json['latest']),
};
}
export function DownloadsDnclientToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
...value,
'latest': DownloadsDNClientLinksToJSON(value.latest),
};
}
//# sourceMappingURL=DownloadsDnclient.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"DownloadsDnclient.js","sourceRoot":"","sources":["DownloadsDnclient.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EACH,8BAA8B,EAC9B,mCAAmC,EACnC,4BAA4B,GAC/B,MAAM,0BAA0B,CAAC;AAiBlC;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAa;IACrD,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,IAAS;IAC/C,OAAO,8BAA8B,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,IAAS,EAAE,mBAA4B;IAClF,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEC,GAAG,IAAI;QACX,QAAQ,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KACjG,CAAC;AACN,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,KAAgC;IACpE,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEC,GAAG,KAAK;QACZ,QAAQ,EAAE,4BAA4B,CAAC,KAAK,CAAC,MAAM,CAAC;KACvD,CAAC;AACN,CAAC"}

View File

@ -0,0 +1,75 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { DownloadsDNClientLinks } from './DownloadsDNClientLinks';
import {
DownloadsDNClientLinksFromJSON,
DownloadsDNClientLinksFromJSONTyped,
DownloadsDNClientLinksToJSON,
} from './DownloadsDNClientLinks';
/**
*
* @export
* @interface DownloadsDnclient
*/
export interface DownloadsDnclient {
[key: string]: DownloadsDNClientLinks | any;
/**
*
* @type {DownloadsDNClientLinks}
* @memberof DownloadsDnclient
*/
latest?: DownloadsDNClientLinks;
}
/**
* Check if a given object implements the DownloadsDnclient interface.
*/
export function instanceOfDownloadsDnclient(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function DownloadsDnclientFromJSON(json: any): DownloadsDnclient {
return DownloadsDnclientFromJSONTyped(json, false);
}
export function DownloadsDnclientFromJSONTyped(json: any, ignoreDiscriminator: boolean): DownloadsDnclient {
if ((json === undefined) || (json === null)) {
return json;
}
return {
...json,
'latest': !exists(json, 'latest') ? undefined : DownloadsDNClientLinksFromJSON(json['latest']),
};
}
export function DownloadsDnclientToJSON(value?: DownloadsDnclient | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
...value,
'latest': DownloadsDNClientLinksToJSON(value.latest),
};
}

View File

@ -0,0 +1,45 @@
/* tslint:disable */
/* eslint-disable */
/**
* Defined Networking API
* <br/> <br/> This API enables automated administration of Defined Networking hosts, roles, logs, and more. To authenticate, obtain an api key to use as a bearer token from your Defined Networking admin panel [API Keys page](https://admin.defined.net/settings/api-keys). API keys must be given the appropriate permission scopes for every method and endpoint, as specified throughout this documentation. Please [contact us](https://www.defined.net/contact?reason=support) for any questions or issues. In the event of a token leak, please take care to [rotate the key](/guides/rotating-api-keys). <div className=\'introduction-end\'></div>
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import { DownloadsFromJSON, DownloadsFromJSONTyped, DownloadsToJSON, } from './Downloads';
/**
* Check if a given object implements the DownloadsList200Response interface.
*/
export function instanceOfDownloadsList200Response(value) {
let isInstance = true;
return isInstance;
}
export function DownloadsList200ResponseFromJSON(json) {
return DownloadsList200ResponseFromJSONTyped(json, false);
}
export function DownloadsList200ResponseFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'data': !exists(json, 'data') ? undefined : DownloadsFromJSON(json['data']),
};
}
export function DownloadsList200ResponseToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'data': DownloadsToJSON(value.data),
};
}
//# sourceMappingURL=DownloadsList200Response.js.map

Some files were not shown because too many files have changed in this diff Show More