mirror of
https://github.com/LukeHagar/dub-node.git
synced 2025-12-09 20:37:49 +00:00
117 lines
3.2 KiB
TypeScript
117 lines
3.2 KiB
TypeScript
/*
|
|
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
*/
|
|
|
|
import { ClosedEnum } from "../../types";
|
|
import * as z from "zod";
|
|
|
|
/**
|
|
* The type of redirect to use for this domain.
|
|
*/
|
|
export const Type = {
|
|
Redirect: "redirect",
|
|
Rewrite: "rewrite",
|
|
} as const;
|
|
/**
|
|
* The type of redirect to use for this domain.
|
|
*/
|
|
export type Type = ClosedEnum<typeof Type>;
|
|
|
|
export type DomainSchema = {
|
|
/**
|
|
* The unique identifier of the domain.
|
|
*/
|
|
id: string;
|
|
/**
|
|
* The domain name.
|
|
*/
|
|
slug: string;
|
|
/**
|
|
* Whether the domain is verified.
|
|
*/
|
|
verified?: boolean | undefined;
|
|
/**
|
|
* Whether the domain is the primary domain for the workspace.
|
|
*/
|
|
primary?: boolean | undefined;
|
|
/**
|
|
* Whether the domain is archived.
|
|
*/
|
|
archived?: boolean | undefined;
|
|
/**
|
|
* Prevent search engines from indexing the domain.
|
|
*/
|
|
noindex?: boolean | undefined;
|
|
/**
|
|
* Provide context to your teammates in the link creation modal by showing them an example of a link to be shortened.
|
|
*/
|
|
placeholder?: string | undefined;
|
|
/**
|
|
* The URL to redirect to when a link under this domain has expired.
|
|
*/
|
|
expiredUrl: string | null;
|
|
/**
|
|
* The page your users will get redirected to when they visit your domain.
|
|
*/
|
|
target: string | null;
|
|
/**
|
|
* The type of redirect to use for this domain.
|
|
*/
|
|
type: Type;
|
|
/**
|
|
* The number of clicks on the domain.
|
|
*/
|
|
clicks?: number | undefined;
|
|
};
|
|
|
|
/** @internal */
|
|
export namespace Type$ {
|
|
export const inboundSchema = z.nativeEnum(Type);
|
|
export const outboundSchema = inboundSchema;
|
|
}
|
|
|
|
/** @internal */
|
|
export namespace DomainSchema$ {
|
|
export const inboundSchema: z.ZodType<DomainSchema, z.ZodTypeDef, unknown> = z.object({
|
|
id: z.string(),
|
|
slug: z.string(),
|
|
verified: z.boolean().default(false),
|
|
primary: z.boolean().default(false),
|
|
archived: z.boolean().default(false),
|
|
noindex: z.boolean().default(false),
|
|
placeholder: z.string().default("https://dub.co/help/article/what-is-dub"),
|
|
expiredUrl: z.nullable(z.string()),
|
|
target: z.nullable(z.string()),
|
|
type: Type$.inboundSchema,
|
|
clicks: z.number().default(0),
|
|
});
|
|
|
|
export type Outbound = {
|
|
id: string;
|
|
slug: string;
|
|
verified: boolean;
|
|
primary: boolean;
|
|
archived: boolean;
|
|
noindex: boolean;
|
|
placeholder: string;
|
|
expiredUrl: string | null;
|
|
target: string | null;
|
|
type: string;
|
|
clicks: number;
|
|
};
|
|
|
|
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, DomainSchema> = z.object({
|
|
id: z.string(),
|
|
slug: z.string(),
|
|
verified: z.boolean().default(false),
|
|
primary: z.boolean().default(false),
|
|
archived: z.boolean().default(false),
|
|
noindex: z.boolean().default(false),
|
|
placeholder: z.string().default("https://dub.co/help/article/what-is-dub"),
|
|
expiredUrl: z.nullable(z.string()),
|
|
target: z.nullable(z.string()),
|
|
type: Type$.outboundSchema,
|
|
clicks: z.number().default(0),
|
|
});
|
|
}
|