export type ProjectAgencyRegistry = {agencyId?: number | undefined, averageAnnualEmissionReduction?: number | undefined, mechanism?: string | undefined, methodology?: string | undefined, registryId?: string | undefined, registryUrl?: string | undefined, vintage?: number | undefined}; export type ProjectEffect = {effectCode?: ('AFFORDABLE_AND_CLEAN_ENERGY' | 'CLEAN_WATER_AND_SANITATION' | 'CLIMATE_ACTION' | 'DECENT_WORK_AND_ECONOMIC_GROWTH' | 'GENDER_EQUALITY' | 'GOOD_HEALTH_AND_WELLBEING' | 'INDUSTRY_INNOVATION_AND_INFRASTRUCTURE' | 'LIFE_BELLOW_WATER' | 'LIFE_ON_LAND' | 'NO_POVERTY' | 'PARTNERSHIPS_FOR_THE_GOALS' | 'PEACE_JUSTICE_AND_STRONG_INSTITUTIONS' | 'QUALITY_EDUCATION' | 'REDUCED_INEQUALITIES' | 'RESPONSIBLE_CONSUMPTION_AND_PRODUCTION' | 'SUSTAINABLE_CITIES_AND_COMMUNITIES' | 'ZERO_HUNGER') | undefined, effectDescriptionEn?: string | undefined, effectDescriptionKr?: string | undefined, effectImageUrl?: string | undefined}; export type AdminInsertProjectRequest = {agencyRegistry?: ProjectAgencyRegistry | undefined, areaHectare?: number | undefined, attachmentUrls?: Array | undefined, cd_tp_proj?: ('AFFORESTATION_REFORESTATION_AND_REVEGETATION' | 'AGRICULTURAL_LAND_MANAGEMENT' | 'AGRICULTURE_FORESTRY_AND_OTHER_LAND_USE' | 'AVOIDED_CONVERSION_OF_GRASSLANDS_AND_SHRUBLANDS' | 'CHEMICAL_INDUSTRY' | 'CLIMATE_CHANGE_ADAPTION' | 'CONSTRUCTION' | 'ENERGY' | 'ENERGY_DEMAND' | 'ENERGY_DISTRIBUTION' | 'ENERGY_INDUSTRIES' | 'FUGITIVE_EMISSIONS_FROM_FUELS__SOLID_OIL_AND_GAS' | 'IMPROVED_FOREST_MANAGEMENT' | 'LIVELIHOODS' | 'LIVESTOCK_ENTERIC_FERMENTATION_AND_MANURE_MANAGEMENT' | 'MANUFACTURING_INDUSTRIES' | 'METAL_PRODUCTION' | 'MINING_MINERAL_ODUCTION' | 'PLASTIC_WASTE_COLLECTION' | 'PLASTIC_WASTE_RECYCLING' | 'REDUCED_EMISSONS_FROM_FORESTATION_AND_DEGRADATION' | 'TRANSPORT' | 'UNSPECIFIED' | 'WASTE_HANDLING_AND_DISPOSAL' | 'WATER_ACCESS_AND_SANITATIO' | 'WETLAND_REWETTING_AND_CONSVATION') | undefined, dttm_reg_cert?: number | undefined, effects?: Array | undefined, img_thumbnail_proj?: string | undefined, introductionTextEn?: string | undefined, introductionTextKo?: string | undefined, locationImageUrl?: string | undefined, nationCode?: string | undefined, nm_proj_dev?: string | undefined, nm_serial?: string | undefined, projectNameEn?: string | undefined, projectNameKr?: string | undefined, serial_end?: string | undefined, serial_postfix?: string | undefined, serial_prefix?: string | undefined, serial_start?: string | undefined, tot_vol?: number | undefined, yn_corrs_adj?: ('N' | 'Y') | undefined}; export type CreateApiBapiV1ProjectArgs = {body: AdminInsertProjectRequest}; export type CreateApiBapiV1ProjectOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * 프로젝트 등록 * * POST /bapi/v1/project */ export const createApiBapiV1Project = async (args: CreateApiBapiV1ProjectArgs, options?: CreateApiBapiV1ProjectOptions) => { const {baseUrl = "https://api.wincl.io:443", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/bapi/v1/project${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };