export type Tag = {key?: string | undefined, type?: string | undefined, value?: string | undefined}; export type IntegrationApi = {api?: string | undefined, configuration?: {[key: string]: Record} | undefined, createTime?: number | undefined, createdBy?: string | undefined, description?: string | undefined, enabled?: boolean | undefined, integrationName?: string | undefined, ownerApp?: string | undefined, tags?: Array | undefined, updateTime?: number | undefined, updatedBy?: string | undefined}; export type Integration = {apis?: Array | undefined, category?: ('API' | 'AI_MODEL' | 'VECTOR_DB' | 'RELATIONAL_DB' | 'MESSAGE_BROKER' | 'GIT' | 'EMAIL' | 'MCP' | 'CLOUD') | undefined, configuration?: {[key: string]: Record} | undefined, createTime?: number | undefined, createdBy?: string | undefined, description?: string | undefined, enabled?: boolean | undefined, modelsCount?: number | undefined, name?: string | undefined, ownerApp?: string | undefined, tags?: Array | undefined, type?: string | undefined, updateTime?: number | undefined, updatedBy?: string | undefined}; export type CreateApiApiIntegrationsArgs = {body: Array}; export type CreateApiApiIntegrationsOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Save all Integrations * * POST /api/integrations/ */ export const createApiApiIntegrations = async (args: CreateApiApiIntegrationsArgs, options?: CreateApiApiIntegrationsOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/integrations/${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 };