@squarecloud/blob
Version:
Official Square Cloud Blob SDK for NodeJS
144 lines (141 loc) • 14.3 kB
text/typescript
import { z } from 'zod';
declare const createObjectSchema: z.ZodEffects<z.ZodObject<{
/** A string representing the name for the file. */
name: z.ZodString;
/** Use absolute path, Buffer or Blob */
file: z.ZodUnion<[z.ZodString, z.ZodType<Buffer, z.ZodTypeDef, Buffer>]>;
/** A string representing the MIME type of the file. */
mimeType: z.ZodOptional<z.ZodEnum<["video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript", ...("video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript")[]]>>;
/** A string representing the prefix for the file. */
prefix: z.ZodOptional<z.ZodString>;
/** A number indicating the expiration period of the file, ranging from 1 to 365 days. */
expiresIn: z.ZodOptional<z.ZodNumber>;
/** Set to true if a security hash is required. */
securityHash: z.ZodOptional<z.ZodBoolean>;
/** Set to true if the file should be set for automatic download. */
autoDownload: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
name: string;
file: (string | Buffer) & (string | Buffer | undefined);
mimeType?: "video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript" | undefined;
prefix?: string | undefined;
expiresIn?: number | undefined;
securityHash?: boolean | undefined;
autoDownload?: boolean | undefined;
}, {
name: string;
file: (string | Buffer) & (string | Buffer | undefined);
mimeType?: "video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript" | undefined;
prefix?: string | undefined;
expiresIn?: number | undefined;
securityHash?: boolean | undefined;
autoDownload?: boolean | undefined;
}>, {
name: string;
file: (string | Buffer) & (string | Buffer | undefined);
mimeType?: "video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript" | undefined;
prefix?: string | undefined;
expiresIn?: number | undefined;
securityHash?: boolean | undefined;
autoDownload?: boolean | undefined;
}, {
name: string;
file: (string | Buffer) & (string | Buffer | undefined);
mimeType?: "video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript" | undefined;
prefix?: string | undefined;
expiresIn?: number | undefined;
securityHash?: boolean | undefined;
autoDownload?: boolean | undefined;
}>;
declare const createObjectPayloadSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
/** A string representing the name for the file. */
name: z.ZodString;
/** Use absolute path, Buffer or Blob */
file: z.ZodUnion<[z.ZodString, z.ZodType<Buffer, z.ZodTypeDef, Buffer>]>;
/** A string representing the MIME type of the file. */
mimeType: z.ZodOptional<z.ZodEnum<["video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript", ...("video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript")[]]>>;
/** A string representing the prefix for the file. */
prefix: z.ZodOptional<z.ZodString>;
/** A number indicating the expiration period of the file, ranging from 1 to 365 days. */
expiresIn: z.ZodOptional<z.ZodNumber>;
/** Set to true if a security hash is required. */
securityHash: z.ZodOptional<z.ZodBoolean>;
/** Set to true if the file should be set for automatic download. */
autoDownload: z.ZodOptional<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
name: string;
file: (string | Buffer) & (string | Buffer | undefined);
mimeType?: "video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript" | undefined;
prefix?: string | undefined;
expiresIn?: number | undefined;
securityHash?: boolean | undefined;
autoDownload?: boolean | undefined;
}, {
name: string;
file: (string | Buffer) & (string | Buffer | undefined);
mimeType?: "video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript" | undefined;
prefix?: string | undefined;
expiresIn?: number | undefined;
securityHash?: boolean | undefined;
autoDownload?: boolean | undefined;
}>, {
name: string;
file: (string | Buffer) & (string | Buffer | undefined);
mimeType?: "video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript" | undefined;
prefix?: string | undefined;
expiresIn?: number | undefined;
securityHash?: boolean | undefined;
autoDownload?: boolean | undefined;
}, {
name: string;
file: (string | Buffer) & (string | Buffer | undefined);
mimeType?: "video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript" | undefined;
prefix?: string | undefined;
expiresIn?: number | undefined;
securityHash?: boolean | undefined;
autoDownload?: boolean | undefined;
}>, {
file: (string | Buffer) & (string | Buffer | undefined);
mimeType: "video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript" | undefined;
params: {
expire: number | undefined;
security_hash: boolean | undefined;
auto_download: boolean | undefined;
name: string;
mimeType?: "video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript" | undefined;
prefix?: string | undefined;
};
}, {
name: string;
file: (string | Buffer) & (string | Buffer | undefined);
mimeType?: "video/mp4" | "video/mpeg" | "video/webm" | "video/x-flv" | "video/x-m4v" | "image/jpeg" | "image/png" | "image/apng" | "image/tiff" | "image/gif" | "image/webp" | "image/bmp" | "image/svg+xml" | "image/x-icon" | "image/ico" | "image/cur" | "image/heic" | "image/heif" | "audio/wav" | "audio/ogg" | "audio/opus" | "audio/mp4" | "audio/mpeg" | "audio/aac" | "text/plain" | "text/html" | "text/css" | "text/csv" | "text/x-sql" | "application/xml" | "application/sql" | "application/x-sql" | "application/x-sqlite3" | "application/x-pkcs12" | "application/pdf" | "application/json" | "application/javascript" | undefined;
prefix?: string | undefined;
expiresIn?: number | undefined;
securityHash?: boolean | undefined;
autoDownload?: boolean | undefined;
}>;
declare const createObjectResponseSchema: z.ZodObject<{
/** The id of the uploaded file. */
id: z.ZodString;
/** The name of the uploaded file. */
name: z.ZodString;
/** The prefix of the uploaded file. */
prefix: z.ZodOptional<z.ZodString>;
/** The size of the uploaded file. */
size: z.ZodNumber;
/** The URL of the uploaded file. (File distributed in Square Cloud CDN) */
url: z.ZodString;
}, "strip", z.ZodTypeAny, {
size: number;
name: string;
id: string;
url: string;
prefix?: string | undefined;
}, {
size: number;
name: string;
id: string;
url: string;
prefix?: string | undefined;
}>;
export { createObjectPayloadSchema, createObjectResponseSchema, createObjectSchema };