export type V1alpha1InputItem = {from: string, parameterKey?: string | undefined}; export type V1alpha1OutputItem = {name: string, valueFrom: string}; export type CommonApplicationTrait = {properties?: string | undefined, type: string}; export type CommonApplicationComponent = {dependsOn?: Array | undefined, externalRevision?: string | undefined, inputs?: Array | undefined, name: string, outputs?: Array | undefined, properties?: string | undefined, scopes?: {[key: string]: string} | undefined, traits?: Array | undefined, type: string}; export type V1beta1AppPolicy = {name?: string | undefined, properties?: string | undefined, type: string}; export type V1alpha1WorkflowExecuteMode = {steps?: string | undefined, subSteps?: string | undefined}; export type V1alpha1WorkflowStepMeta = {alias?: string | undefined}; export type V1alpha1WorkflowStepBase = {dependsOn?: Array | undefined, if?: string | undefined, inputs?: Array | undefined, meta?: V1alpha1WorkflowStepMeta | undefined, name?: string | undefined, outputs?: Array | undefined, properties?: string | undefined, timeout?: string | undefined, type: string}; export type V1alpha1WorkflowStep = {dependsOn?: Array | undefined, if?: string | undefined, inputs?: Array | undefined, meta?: V1alpha1WorkflowStepMeta | undefined, mode?: string | undefined, name?: string | undefined, outputs?: Array | undefined, properties?: string | undefined, subSteps?: Array | undefined, timeout?: string | undefined, type: string}; export type V1beta1Workflow = {mode?: V1alpha1WorkflowExecuteMode | undefined, ref?: string | undefined, steps?: Array | undefined}; export type V1ApplicationRequest = {components: Array, policies?: Array | undefined, workflow?: V1beta1Workflow | undefined}; export type CreateApiV1NamespacesNamespaceApplicationsAppnameArgs = {namespace: string, appname: string, dryRun?: string | undefined, body: V1ApplicationRequest}; export type CreateApiV1NamespacesNamespaceApplicationsAppnameOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * create or update oam application in the specified namespace * * POST /v1/namespaces/{namespace}/applications/{appname} */ export const createApiV1NamespacesNamespaceApplicationsAppname = async (args: CreateApiV1NamespacesNamespaceApplicationsAppnameArgs, options: CreateApiV1NamespacesNamespaceApplicationsAppnameOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.dryRun != null) query.append("dryRun", String(args.dryRun)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/namespaces/${encodeURIComponent(String(args.namespace))}/applications/${encodeURIComponent(String(args.appname))}${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 };