import type { RawAxiosRequestHeaders } from 'axios'; import type { GetDataAssemblyParams, GetSpaceEnvironmentParams } from '../../common-types'; import type { CreateDataAssemblyProps, DataAssemblyProps, DataAssemblyQueryOptions, UpdateDataAssemblyProps, DataAssemblyCollection } from '../../entities/data-assembly'; import type { OptionalDefaults } from '../wrappers/wrap'; export type DataAssemblyPlainClientAPI = { /** * Fetches all data assemblies for a space and environment * @param params the space, environment IDs and query options (see {@link DataAssemblyQueryOptions}) * @returns a collection of data assemblies * @throws if the request fails, or the space or environment is not found * @internal - Experimental endpoint, subject to breaking changes without notice * @example * ```javascript * const dataAssemblies = await client.dataAssembly.getMany({ * spaceId: '', * environmentId: '', * query: { * limit: 10, * }, * }); * ``` */ getMany(params: OptionalDefaults): Promise; /** * Fetches a single data assembly by ID * @param params the space, environment, and data assembly IDs * @returns the data assembly * @throws if the request fails, or the data assembly is not found * @internal - Experimental endpoint, subject to breaking changes without notice * @example * ```javascript * const dataAssembly = await client.dataAssembly.get({ * spaceId: '', * environmentId: '', * dataAssemblyId: '', * }); * ``` */ get(params: OptionalDefaults): Promise; /** * Creates a new data assembly * @param params the space and environment IDs * @param rawData the data assembly data to create * @param headers optional custom headers * @returns the created data assembly * @throws if the request fails * @internal - Experimental endpoint, subject to breaking changes without notice * @example * ```javascript * const dataAssembly = await client.dataAssembly.create({ * spaceId: '', * environmentId: '', * }, { * metadata: { tags: [] }, * name: 'My Assembly', * description: 'A data assembly', * parameters: [], * resolvers: {}, * return: {}, * }); * ``` */ create(params: OptionalDefaults, rawData: CreateDataAssemblyProps, headers?: RawAxiosRequestHeaders): Promise; /** * Updates a data assembly with PUT * @param params the space, environment, and data assembly IDs, and the current version (sent as X-Contentful-Version). * The version is required to update an existing data assembly; omit it only when the PUT creates one with the given ID. * @param rawData the data assembly data to update, without top-level sys * @param headers optional custom headers * @returns the updated data assembly * @throws if the request fails, or the data assembly is not found * @internal - Experimental endpoint, subject to breaking changes without notice * @example * ```javascript * const { sys, ...body } = dataAssembly; * const updated = await client.dataAssembly.update( * { * spaceId: '', * environmentId: '', * dataAssemblyId: sys.id, * version: sys.version, * }, * { ...body, name: 'Updated Name' }, * ); * ``` */ update(params: OptionalDefaults, rawData: UpdateDataAssemblyProps, headers?: RawAxiosRequestHeaders): Promise; /** * Deletes a data assembly * @param params the space, environment, and data assembly IDs * @returns void * @throws if the request fails, or the data assembly is not found * @internal - Experimental endpoint, subject to breaking changes without notice * @example * ```javascript * await client.dataAssembly.delete({ * spaceId: '', * environmentId: '', * dataAssemblyId: '', * }); * ``` */ delete(params: OptionalDefaults): Promise; /** * Publishes a data assembly * @param params the space, environment, and data assembly IDs, and the version number * @returns the published data assembly * @throws if the request fails, or the data assembly is not found * @internal - Experimental endpoint, subject to breaking changes without notice * @example * ```javascript * const dataAssembly = await client.dataAssembly.publish({ * spaceId: '', * environmentId: '', * dataAssemblyId: '', * version: 1, * }); * ``` */ publish(params: OptionalDefaults): Promise; /** * Unpublishes a data assembly * @param params the space, environment, and data assembly IDs, and the version number * @returns the unpublished data assembly * @throws if the request fails, or the data assembly is not found * @internal - Experimental endpoint, subject to breaking changes without notice * @example * ```javascript * const dataAssembly = await client.dataAssembly.unpublish({ * spaceId: '', * environmentId: '', * dataAssemblyId: '', * version: 1, * }); * ``` */ unpublish(params: OptionalDefaults): Promise; /** * Fetches all published data assemblies for a space and environment * @param params the space, environment IDs and query options (see {@link DataAssemblyQueryOptions}) * @returns a collection of published data assemblies * @throws if the request fails, or the space or environment is not found * @internal - Experimental endpoint, subject to breaking changes without notice * @example * ```javascript * const dataAssemblies = await client.dataAssembly.getManyPublished({ * spaceId: '', * environmentId: '', * query: { * limit: 10, * }, * }); * ``` */ getManyPublished(params: OptionalDefaults): Promise; /** * Fetches a single published data assembly by ID * @param params the space, environment, and data assembly IDs * @returns the published data assembly * @throws if the request fails, or the data assembly is not found * @internal - Experimental endpoint, subject to breaking changes without notice * @example * ```javascript * const dataAssembly = await client.dataAssembly.getPublished({ * spaceId: '', * environmentId: '', * dataAssemblyId: '', * }); * ``` */ getPublished(params: OptionalDefaults): Promise; };