@azure-utils/storybooks
Version:
Utils to upload and manage Storybooks via Azure Functions and storage.
60 lines (59 loc) • 2.19 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 { ProjectModel } from "./projects";
export type BuildType = z.infer<typeof BuildSchema>;
/** @private */
export declare const BuildSchema: z.ZodObject<{
label: z.ZodString;
sha: z.ZodString;
authorName: z.ZodString;
authorEmail: z.ZodString;
message: z.ZodOptional<z.ZodString>;
timestamp: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
/** @private */
export type BuildUploadType = z.infer<typeof BuildUploadSchema>;
export declare const BuildUploadSchema: z.ZodObject<{
message: z.ZodOptional<z.ZodString>;
sha: z.ZodString;
authorName: z.ZodString;
authorEmail: z.ZodString;
timestamp: z.ZodOptional<z.ZodString>;
labels: z.ZodArray<z.ZodString>;
}, z.core.$strip>;
export type BuildUploadFormType = z.infer<typeof BuildUploadSchema>;
export declare const BuildUploadFormSchema: z.ZodObject<{
message: z.ZodOptional<z.ZodString>;
sha: z.ZodString;
authorName: z.ZodString;
authorEmail: z.ZodString;
timestamp: z.ZodOptional<z.ZodString>;
labels: z.ZodArray<z.ZodString>;
zipFile: z.ZodFile;
}, z.core.$strip>;
/**
* - partitionKey: label
* - rowKey: sha
*/
export declare class BuildModel implements BaseModel<BuildType, BuildUploadType> {
#private;
projectModel: ProjectModel;
constructor(context: InvocationContext, connectionString: string, projectId: string);
parse: (data: unknown, params?: z.core.ParseContext<z.core.$ZodIssue>) => {
label: string;
sha: string;
authorName: string;
authorEmail: string;
message?: string | undefined;
timestamp?: string | undefined;
};
list(options?: ListAzureTableEntitiesOptions<BuildType>): Promise<BuildType[]>;
get(sha: string, labelSlug?: string): Promise<BuildType>;
has(sha: string): Promise<boolean>;
create(data: BuildUploadType): Promise<void>;
update(): Promise<void>;
delete(sha: string): Promise<void>;
deleteByLabel(labelSlug: string): Promise<void>;
}