Path: blob/main/src/publish/netlify/api/services/SiteService.ts
6464 views
// deno-lint-ignore-file1/* istanbul ignore file */2/* tslint:disable */3/* eslint-disable */4import type { CancelablePromise } from "../core/CancelablePromise.ts";5import type { BaseHttpRequest } from "../core/BaseHttpRequest.ts";67export class SiteService {8constructor(public readonly httpRequest: BaseHttpRequest) {}910/**11* @returns any OK12* @throws ApiError13*/14public listSites({15name,16filter,17page,18perPage,19}: {20name?: string;21filter?: "all" | "owner" | "guest";22page?: number;23perPage?: number;24}): CancelablePromise<25Array<{26id?: string;27state?: string;28plan?: string;29name?: string;30custom_domain?: string;31domain_aliases?: Array<string>;32password?: string;33notification_email?: string;34url?: string;35ssl_url?: string;36admin_url?: string;37screenshot_url?: string;38created_at?: string;39updated_at?: string;40user_id?: string;41session_id?: string;42ssl?: boolean;43force_ssl?: boolean;44managed_dns?: boolean;45deploy_url?: string;46published_deploy?: {47id?: string;48site_id?: string;49user_id?: string;50build_id?: string;51state?: string;52name?: string;53url?: string;54ssl_url?: string;55admin_url?: string;56deploy_url?: string;57deploy_ssl_url?: string;58screenshot_url?: string;59review_id?: number;60draft?: boolean;61required?: Array<string>;62required_functions?: Array<string>;63error_message?: string;64branch?: string;65commit_ref?: string;66commit_url?: string;67skipped?: boolean;68created_at?: string;69updated_at?: string;70published_at?: string;71title?: string;72context?: string;73locked?: boolean;74review_url?: string;75site_capabilities?: {76large_media_enabled?: boolean;77};78framework?: string;79function_schedules?: Array<{80name?: string;81cron?: string;82}>;83};84account_name?: string;85account_slug?: string;86git_provider?: string;87deploy_hook?: string;88capabilities?: Record<string, any>;89processing_settings?: {90skip?: boolean;91css?: {92bundle?: boolean;93minify?: boolean;94};95js?: {96bundle?: boolean;97minify?: boolean;98};99images?: {100optimize?: boolean;101};102html?: {103pretty_urls?: boolean;104};105};106build_settings?: {107id?: number;108provider?: string;109deploy_key_id?: string;110repo_path?: string;111repo_branch?: string;112dir?: string;113functions_dir?: string;114cmd?: string;115allowed_branches?: Array<string>;116public_repo?: boolean;117private_logs?: boolean;118repo_url?: string;119env?: Record<string, string>;120installation_id?: number;121stop_builds?: boolean;122};123id_domain?: string;124default_hooks_data?: {125access_token?: string;126};127build_image?: string;128prerender?: string;129}>130> {131return this.httpRequest.request({132method: "GET",133url: "/sites",134query: {135"name": name,136"filter": filter,137"page": page,138"per_page": perPage,139},140});141}142143/**144* @returns any error145* @throws ApiError146*/147public createSite({148site,149configureDns,150}: {151site: {152id?: string;153state?: string;154plan?: string;155name?: string;156custom_domain?: string;157domain_aliases?: Array<string>;158password?: string;159notification_email?: string;160url?: string;161ssl_url?: string;162admin_url?: string;163screenshot_url?: string;164created_at?: string;165updated_at?: string;166user_id?: string;167session_id?: string;168ssl?: boolean;169force_ssl?: boolean;170managed_dns?: boolean;171deploy_url?: string;172published_deploy?: {173id?: string;174site_id?: string;175user_id?: string;176build_id?: string;177state?: string;178name?: string;179url?: string;180ssl_url?: string;181admin_url?: string;182deploy_url?: string;183deploy_ssl_url?: string;184screenshot_url?: string;185review_id?: number;186draft?: boolean;187required?: Array<string>;188required_functions?: Array<string>;189error_message?: string;190branch?: string;191commit_ref?: string;192commit_url?: string;193skipped?: boolean;194created_at?: string;195updated_at?: string;196published_at?: string;197title?: string;198context?: string;199locked?: boolean;200review_url?: string;201site_capabilities?: {202large_media_enabled?: boolean;203};204framework?: string;205function_schedules?: Array<{206name?: string;207cron?: string;208}>;209};210account_name?: string;211account_slug?: string;212git_provider?: string;213deploy_hook?: string;214capabilities?: Record<string, any>;215processing_settings?: {216skip?: boolean;217css?: {218bundle?: boolean;219minify?: boolean;220};221js?: {222bundle?: boolean;223minify?: boolean;224};225images?: {226optimize?: boolean;227};228html?: {229pretty_urls?: boolean;230};231};232build_settings?: {233id?: number;234provider?: string;235deploy_key_id?: string;236repo_path?: string;237repo_branch?: string;238dir?: string;239functions_dir?: string;240cmd?: string;241allowed_branches?: Array<string>;242public_repo?: boolean;243private_logs?: boolean;244repo_url?: string;245env?: Record<string, string>;246installation_id?: number;247stop_builds?: boolean;248};249id_domain?: string;250default_hooks_data?: {251access_token?: string;252};253build_image?: string;254prerender?: string;255};256configureDns?: boolean;257}): CancelablePromise<{258code?: number;259message: string;260}> {261return this.httpRequest.request({262method: "POST",263url: "/sites",264query: {265"configure_dns": configureDns,266},267body: site,268});269}270271/**272* @returns any OK273* @throws ApiError274*/275public getSite({276siteId,277}: {278siteId: string;279}): CancelablePromise<{280id?: string;281state?: string;282plan?: string;283name?: string;284custom_domain?: string;285domain_aliases?: Array<string>;286password?: string;287notification_email?: string;288url?: string;289ssl_url?: string;290admin_url?: string;291screenshot_url?: string;292created_at?: string;293updated_at?: string;294user_id?: string;295session_id?: string;296ssl?: boolean;297force_ssl?: boolean;298managed_dns?: boolean;299deploy_url?: string;300published_deploy?: {301id?: string;302site_id?: string;303user_id?: string;304build_id?: string;305state?: string;306name?: string;307url?: string;308ssl_url?: string;309admin_url?: string;310deploy_url?: string;311deploy_ssl_url?: string;312screenshot_url?: string;313review_id?: number;314draft?: boolean;315required?: Array<string>;316required_functions?: Array<string>;317error_message?: string;318branch?: string;319commit_ref?: string;320commit_url?: string;321skipped?: boolean;322created_at?: string;323updated_at?: string;324published_at?: string;325title?: string;326context?: string;327locked?: boolean;328review_url?: string;329site_capabilities?: {330large_media_enabled?: boolean;331};332framework?: string;333function_schedules?: Array<{334name?: string;335cron?: string;336}>;337};338account_name?: string;339account_slug?: string;340git_provider?: string;341deploy_hook?: string;342capabilities?: Record<string, any>;343processing_settings?: {344skip?: boolean;345css?: {346bundle?: boolean;347minify?: boolean;348};349js?: {350bundle?: boolean;351minify?: boolean;352};353images?: {354optimize?: boolean;355};356html?: {357pretty_urls?: boolean;358};359};360build_settings?: {361id?: number;362provider?: string;363deploy_key_id?: string;364repo_path?: string;365repo_branch?: string;366dir?: string;367functions_dir?: string;368cmd?: string;369allowed_branches?: Array<string>;370public_repo?: boolean;371private_logs?: boolean;372repo_url?: string;373env?: Record<string, string>;374installation_id?: number;375stop_builds?: boolean;376};377id_domain?: string;378default_hooks_data?: {379access_token?: string;380};381build_image?: string;382prerender?: string;383}> {384return this.httpRequest.request({385method: "GET",386url: "/sites/{site_id}",387path: {388"site_id": siteId,389},390});391}392393/**394* @returns any OK395* @throws ApiError396*/397public updateSite({398siteId,399site,400}: {401siteId: string;402site: {403id?: string;404state?: string;405plan?: string;406name?: string;407custom_domain?: string;408domain_aliases?: Array<string>;409password?: string;410notification_email?: string;411url?: string;412ssl_url?: string;413admin_url?: string;414screenshot_url?: string;415created_at?: string;416updated_at?: string;417user_id?: string;418session_id?: string;419ssl?: boolean;420force_ssl?: boolean;421managed_dns?: boolean;422deploy_url?: string;423published_deploy?: {424id?: string;425site_id?: string;426user_id?: string;427build_id?: string;428state?: string;429name?: string;430url?: string;431ssl_url?: string;432admin_url?: string;433deploy_url?: string;434deploy_ssl_url?: string;435screenshot_url?: string;436review_id?: number;437draft?: boolean;438required?: Array<string>;439required_functions?: Array<string>;440error_message?: string;441branch?: string;442commit_ref?: string;443commit_url?: string;444skipped?: boolean;445created_at?: string;446updated_at?: string;447published_at?: string;448title?: string;449context?: string;450locked?: boolean;451review_url?: string;452site_capabilities?: {453large_media_enabled?: boolean;454};455framework?: string;456function_schedules?: Array<{457name?: string;458cron?: string;459}>;460};461account_name?: string;462account_slug?: string;463git_provider?: string;464deploy_hook?: string;465capabilities?: Record<string, any>;466processing_settings?: {467skip?: boolean;468css?: {469bundle?: boolean;470minify?: boolean;471};472js?: {473bundle?: boolean;474minify?: boolean;475};476images?: {477optimize?: boolean;478};479html?: {480pretty_urls?: boolean;481};482};483build_settings?: {484id?: number;485provider?: string;486deploy_key_id?: string;487repo_path?: string;488repo_branch?: string;489dir?: string;490functions_dir?: string;491cmd?: string;492allowed_branches?: Array<string>;493public_repo?: boolean;494private_logs?: boolean;495repo_url?: string;496env?: Record<string, string>;497installation_id?: number;498stop_builds?: boolean;499};500id_domain?: string;501default_hooks_data?: {502access_token?: string;503};504build_image?: string;505prerender?: string;506};507}): CancelablePromise<{508id?: string;509state?: string;510plan?: string;511name?: string;512custom_domain?: string;513domain_aliases?: Array<string>;514password?: string;515notification_email?: string;516url?: string;517ssl_url?: string;518admin_url?: string;519screenshot_url?: string;520created_at?: string;521updated_at?: string;522user_id?: string;523session_id?: string;524ssl?: boolean;525force_ssl?: boolean;526managed_dns?: boolean;527deploy_url?: string;528published_deploy?: {529id?: string;530site_id?: string;531user_id?: string;532build_id?: string;533state?: string;534name?: string;535url?: string;536ssl_url?: string;537admin_url?: string;538deploy_url?: string;539deploy_ssl_url?: string;540screenshot_url?: string;541review_id?: number;542draft?: boolean;543required?: Array<string>;544required_functions?: Array<string>;545error_message?: string;546branch?: string;547commit_ref?: string;548commit_url?: string;549skipped?: boolean;550created_at?: string;551updated_at?: string;552published_at?: string;553title?: string;554context?: string;555locked?: boolean;556review_url?: string;557site_capabilities?: {558large_media_enabled?: boolean;559};560framework?: string;561function_schedules?: Array<{562name?: string;563cron?: string;564}>;565};566account_name?: string;567account_slug?: string;568git_provider?: string;569deploy_hook?: string;570capabilities?: Record<string, any>;571processing_settings?: {572skip?: boolean;573css?: {574bundle?: boolean;575minify?: boolean;576};577js?: {578bundle?: boolean;579minify?: boolean;580};581images?: {582optimize?: boolean;583};584html?: {585pretty_urls?: boolean;586};587};588build_settings?: {589id?: number;590provider?: string;591deploy_key_id?: string;592repo_path?: string;593repo_branch?: string;594dir?: string;595functions_dir?: string;596cmd?: string;597allowed_branches?: Array<string>;598public_repo?: boolean;599private_logs?: boolean;600repo_url?: string;601env?: Record<string, string>;602installation_id?: number;603stop_builds?: boolean;604};605id_domain?: string;606default_hooks_data?: {607access_token?: string;608};609build_image?: string;610prerender?: string;611}> {612return this.httpRequest.request({613method: "PATCH",614url: "/sites/{site_id}",615path: {616"site_id": siteId,617},618body: site,619});620}621622/**623* @returns any error624* @throws ApiError625*/626public deleteSite({627siteId,628}: {629siteId: string;630}): CancelablePromise<{631code?: number;632message: string;633}> {634return this.httpRequest.request({635method: "DELETE",636url: "/sites/{site_id}",637path: {638"site_id": siteId,639},640});641}642643/**644* [Beta] Unlinks the repo from the site.645*646* This action will also:647* - Delete associated deploy keys648* - Delete outgoing webhooks for the repo649* - Delete the site's build hooks650* @returns any OK651* @throws ApiError652*/653public unlinkSiteRepo({654siteId,655}: {656siteId: string;657}): CancelablePromise<{658id?: string;659state?: string;660plan?: string;661name?: string;662custom_domain?: string;663domain_aliases?: Array<string>;664password?: string;665notification_email?: string;666url?: string;667ssl_url?: string;668admin_url?: string;669screenshot_url?: string;670created_at?: string;671updated_at?: string;672user_id?: string;673session_id?: string;674ssl?: boolean;675force_ssl?: boolean;676managed_dns?: boolean;677deploy_url?: string;678published_deploy?: {679id?: string;680site_id?: string;681user_id?: string;682build_id?: string;683state?: string;684name?: string;685url?: string;686ssl_url?: string;687admin_url?: string;688deploy_url?: string;689deploy_ssl_url?: string;690screenshot_url?: string;691review_id?: number;692draft?: boolean;693required?: Array<string>;694required_functions?: Array<string>;695error_message?: string;696branch?: string;697commit_ref?: string;698commit_url?: string;699skipped?: boolean;700created_at?: string;701updated_at?: string;702published_at?: string;703title?: string;704context?: string;705locked?: boolean;706review_url?: string;707site_capabilities?: {708large_media_enabled?: boolean;709};710framework?: string;711function_schedules?: Array<{712name?: string;713cron?: string;714}>;715};716account_name?: string;717account_slug?: string;718git_provider?: string;719deploy_hook?: string;720capabilities?: Record<string, any>;721processing_settings?: {722skip?: boolean;723css?: {724bundle?: boolean;725minify?: boolean;726};727js?: {728bundle?: boolean;729minify?: boolean;730};731images?: {732optimize?: boolean;733};734html?: {735pretty_urls?: boolean;736};737};738build_settings?: {739id?: number;740provider?: string;741deploy_key_id?: string;742repo_path?: string;743repo_branch?: string;744dir?: string;745functions_dir?: string;746cmd?: string;747allowed_branches?: Array<string>;748public_repo?: boolean;749private_logs?: boolean;750repo_url?: string;751env?: Record<string, string>;752installation_id?: number;753stop_builds?: boolean;754};755id_domain?: string;756default_hooks_data?: {757access_token?: string;758};759build_image?: string;760prerender?: string;761}> {762return this.httpRequest.request({763method: "PUT",764url: "/sites/{site_id}/unlink_repo",765path: {766"site_id": siteId,767},768errors: {769404: `Site not found`,770},771});772}773774/**775* @returns any error776* @throws ApiError777*/778public createSiteInTeam({779accountSlug,780site,781configureDns,782}: {783accountSlug: string;784site?: {785id?: string;786state?: string;787plan?: string;788name?: string;789custom_domain?: string;790domain_aliases?: Array<string>;791password?: string;792notification_email?: string;793url?: string;794ssl_url?: string;795admin_url?: string;796screenshot_url?: string;797created_at?: string;798updated_at?: string;799user_id?: string;800session_id?: string;801ssl?: boolean;802force_ssl?: boolean;803managed_dns?: boolean;804deploy_url?: string;805published_deploy?: {806id?: string;807site_id?: string;808user_id?: string;809build_id?: string;810state?: string;811name?: string;812url?: string;813ssl_url?: string;814admin_url?: string;815deploy_url?: string;816deploy_ssl_url?: string;817screenshot_url?: string;818review_id?: number;819draft?: boolean;820required?: Array<string>;821required_functions?: Array<string>;822error_message?: string;823branch?: string;824commit_ref?: string;825commit_url?: string;826skipped?: boolean;827created_at?: string;828updated_at?: string;829published_at?: string;830title?: string;831context?: string;832locked?: boolean;833review_url?: string;834site_capabilities?: {835large_media_enabled?: boolean;836};837framework?: string;838function_schedules?: Array<{839name?: string;840cron?: string;841}>;842};843account_name?: string;844account_slug?: string;845git_provider?: string;846deploy_hook?: string;847capabilities?: Record<string, any>;848processing_settings?: {849skip?: boolean;850css?: {851bundle?: boolean;852minify?: boolean;853};854js?: {855bundle?: boolean;856minify?: boolean;857};858images?: {859optimize?: boolean;860};861html?: {862pretty_urls?: boolean;863};864};865build_settings?: {866id?: number;867provider?: string;868deploy_key_id?: string;869repo_path?: string;870repo_branch?: string;871dir?: string;872functions_dir?: string;873cmd?: string;874allowed_branches?: Array<string>;875public_repo?: boolean;876private_logs?: boolean;877repo_url?: string;878env?: Record<string, string>;879installation_id?: number;880stop_builds?: boolean;881};882id_domain?: string;883default_hooks_data?: {884access_token?: string;885};886build_image?: string;887prerender?: string;888};889configureDns?: boolean;890}): CancelablePromise<{891code?: number;892message: string;893}> {894return this.httpRequest.request({895method: "POST",896url: "/{account_slug}/sites",897path: {898"account_slug": accountSlug,899},900query: {901"configure_dns": configureDns,902},903body: site,904});905}906907/**908* @returns any OK909* @throws ApiError910*/911public listSitesForAccount({912accountSlug,913name,914page,915perPage,916}: {917accountSlug: string;918name?: string;919page?: number;920perPage?: number;921}): CancelablePromise<922Array<{923id?: string;924state?: string;925plan?: string;926name?: string;927custom_domain?: string;928domain_aliases?: Array<string>;929password?: string;930notification_email?: string;931url?: string;932ssl_url?: string;933admin_url?: string;934screenshot_url?: string;935created_at?: string;936updated_at?: string;937user_id?: string;938session_id?: string;939ssl?: boolean;940force_ssl?: boolean;941managed_dns?: boolean;942deploy_url?: string;943published_deploy?: {944id?: string;945site_id?: string;946user_id?: string;947build_id?: string;948state?: string;949name?: string;950url?: string;951ssl_url?: string;952admin_url?: string;953deploy_url?: string;954deploy_ssl_url?: string;955screenshot_url?: string;956review_id?: number;957draft?: boolean;958required?: Array<string>;959required_functions?: Array<string>;960error_message?: string;961branch?: string;962commit_ref?: string;963commit_url?: string;964skipped?: boolean;965created_at?: string;966updated_at?: string;967published_at?: string;968title?: string;969context?: string;970locked?: boolean;971review_url?: string;972site_capabilities?: {973large_media_enabled?: boolean;974};975framework?: string;976function_schedules?: Array<{977name?: string;978cron?: string;979}>;980};981account_name?: string;982account_slug?: string;983git_provider?: string;984deploy_hook?: string;985capabilities?: Record<string, any>;986processing_settings?: {987skip?: boolean;988css?: {989bundle?: boolean;990minify?: boolean;991};992js?: {993bundle?: boolean;994minify?: boolean;995};996images?: {997optimize?: boolean;998};999html?: {1000pretty_urls?: boolean;1001};1002};1003build_settings?: {1004id?: number;1005provider?: string;1006deploy_key_id?: string;1007repo_path?: string;1008repo_branch?: string;1009dir?: string;1010functions_dir?: string;1011cmd?: string;1012allowed_branches?: Array<string>;1013public_repo?: boolean;1014private_logs?: boolean;1015repo_url?: string;1016env?: Record<string, string>;1017installation_id?: number;1018stop_builds?: boolean;1019};1020id_domain?: string;1021default_hooks_data?: {1022access_token?: string;1023};1024build_image?: string;1025prerender?: string;1026}>1027> {1028return this.httpRequest.request({1029method: "GET",1030url: "/{account_slug}/sites",1031path: {1032"account_slug": accountSlug,1033},1034query: {1035"name": name,1036"page": page,1037"per_page": perPage,1038},1039});1040}1041}104210431044