export type DeveloperAccount = {developerIdentifier: string, developerAccountIdentifier: string, name?: string | undefined, contactFirstName?: string | undefined, contactLastName?: string | undefined, addressLine?: string | undefined, addressLine2?: string | undefined, addressLine3?: string | undefined, city?: string | undefined, state?: string | undefined, country?: string | undefined, postalCode?: string | undefined, phoneNumber?: string | undefined, email?: string | undefined, partner?: string | undefined, origin?: string | undefined, primaryDomain?: string | undefined, additionalDomains?: Array | undefined, customAttributes?: {[key: string]: string} | undefined}; export type DeveloperAccountWS = {type: string, operation: string, developerAccounts?: Array | undefined}; export type CreateApiSyncV1TasksCreateArgs = {body: DeveloperAccountWS}; export type CreateApiSyncV1TasksCreateOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create developer account * * POST /sync/v1/tasks#create */ export const createApiSyncV1TasksCreate = async (args: CreateApiSyncV1TasksCreateArgs, options?: CreateApiSyncV1TasksCreateOptions) => { const {baseUrl = "https://marketplace.appdirect.com/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/sync/v1/tasks#create${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 undefined };