UNPKG

@azure-utils/storybooks

Version:

Utils to upload and manage Storybooks via Azure Functions and storage.

50 lines (49 loc) 1.85 kB
import z from "zod"; import type { InvocationContext } from "@azure/functions"; import { ListAzureTableEntitiesOptions } from "../utils/azure-data-tables"; import { type BaseModel } from "./shared"; import { ProjectModel } from "./projects"; export declare const labelTypes: readonly ["branch", "pr"]; export type LabelType = z.infer<typeof LabelSchema>; /** @private */ export declare const LabelSchema: z.ZodObject<{ slug: z.ZodString; value: z.ZodString; type: z.ZodEnum<{ branch: "branch"; pr: "pr"; }>; buildSHA: z.ZodOptional<z.ZodString>; timestamp: z.ZodOptional<z.ZodString>; }, z.core.$strip>; type LabelCreateType = z.infer<typeof LabelCreateSchema>; export declare const LabelCreateSchema: z.ZodObject<{ type: z.ZodEnum<{ branch: "branch"; pr: "pr"; }>; value: z.ZodString; buildSHA: z.ZodOptional<z.ZodString>; }, z.core.$strip>; type LabelUpdateType = z.infer<typeof LabelUpdateSchema>; export declare const LabelUpdateSchema: z.ZodObject<{ type: z.ZodOptional<z.ZodEnum<{ branch: "branch"; pr: "pr"; }>>; value: z.ZodOptional<z.ZodString>; buildSHA: z.ZodOptional<z.ZodOptional<z.ZodString>>; }, z.core.$strip>; export declare class LabelModel implements BaseModel<LabelType, LabelCreateType, LabelUpdateType> { #private; projectModel: ProjectModel; constructor(context: InvocationContext, connectionString: string, projectId: string); list(options?: ListAzureTableEntitiesOptions<LabelType>): Promise<LabelType[]>; get(slug: string): Promise<LabelType>; has(slug: string): Promise<boolean>; create(data: LabelCreateType): Promise<void>; update(slug: string, data: LabelUpdateType): Promise<void>; delete(slug: string): Promise<void>; static createSlug(value: string): string; } export {};