@azure-utils/storybooks
Version:
Utils to upload and manage Storybooks via Azure Functions and storage.
51 lines (50 loc) • 2.08 kB
TypeScript
import z from "zod";
import type { InvocationContext } from "@azure/functions";
import { ListAzureTableEntitiesOptions } from "../utils/azure-data-tables";
import { type BaseModel } from "./shared";
import { BuildModel } from "./builds";
import { LabelModel } from "./labels";
export type ProjectType = z.infer<typeof ProjectSchema>;
/** @private */
export declare const ProjectSchema: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
purgeBuildsAfterDays: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
gitHubRepo: z.ZodString;
gitHubPath: z.ZodOptional<z.ZodString>;
gitHubDefaultBranch: z.ZodDefault<z.ZodString>;
buildSHA: z.ZodOptional<z.ZodString>;
timestamp: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
type ProjectCreateType = z.infer<typeof ProjectCreateSchema>;
export declare const ProjectCreateSchema: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
purgeBuildsAfterDays: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
gitHubRepo: z.ZodString;
gitHubPath: z.ZodOptional<z.ZodString>;
gitHubDefaultBranch: z.ZodDefault<z.ZodString>;
}, z.core.$strip>;
export declare class ProjectModel implements BaseModel<ProjectType, ProjectCreateType> {
#private;
constructor(context: InvocationContext, connectionString: string);
parse: (data: unknown, params?: z.core.ParseContext<z.core.$ZodIssue>) => {
id: string;
name: string;
purgeBuildsAfterDays: number;
gitHubRepo: string;
gitHubDefaultBranch: string;
gitHubPath?: string | undefined;
buildSHA?: string | undefined;
timestamp?: string | undefined;
};
buildModel(projectId: string): BuildModel;
labelModel(projectId: string): LabelModel;
list(options?: ListAzureTableEntitiesOptions<ProjectType>): Promise<ProjectType[]>;
get(id: string): Promise<ProjectType>;
has(id: string): Promise<boolean>;
create(data: ProjectCreateType): Promise<void>;
update(id: string, data: Partial<ProjectType>): Promise<void>;
delete(id: string): Promise<void>;
}
export {};