/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as Flatfile from "../../../index"; export declare namespace Mapping { interface Options { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; token?: core.Supplier; /** Override the X-Disable-Hooks header */ xDisableHooks?: "true"; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Override the X-Disable-Hooks header */ xDisableHooks?: "true"; /** Additional headers to include in the request. */ headers?: Record; } } export declare class Mapping { protected readonly _options: Mapping.Options; constructor(_options?: Mapping.Options); /** * Creates a list of mapping rules based on two provided schemas * * @param {Flatfile.CreateMappingProgram} request * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.createMappingProgram({ * body: { * source: { * name: "name", * fields: [{ * type: "string", * key: "key" * }, { * type: "string", * key: "key" * }] * }, * destination: { * name: "name", * fields: [{ * type: "string", * key: "key" * }, { * type: "string", * key: "key" * }] * } * } * }) */ createMappingProgram(request: Flatfile.CreateMappingProgram, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __createMappingProgram; /** * Deletes all history for the authenticated user * * @param {Flatfile.DeleteAllHistoryForUserRequest} request * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.deleteAllHistoryForUser() */ deleteAllHistoryForUser(request?: Flatfile.DeleteAllHistoryForUserRequest, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __deleteAllHistoryForUser; /** * List all mapping programs * * @param {Flatfile.ListProgramsRequest} request * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * * @example * await client.mapping.listMappingPrograms() */ listMappingPrograms(request?: Flatfile.ListProgramsRequest, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __listMappingPrograms; /** * Get a mapping program * * @param {Flatfile.ProgramId} programId - ID of the program * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.getMappingProgram("programId") */ getMappingProgram(programId: Flatfile.ProgramId, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __getMappingProgram; /** * Updates a mapping program * * @param {Flatfile.ProgramId} programId - ID of the program * @param {Flatfile.ProgramConfig} request * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.updateMappingProgram("programId", { * source: { * name: "name", * fields: [{ * type: "string", * key: "key" * }, { * type: "string", * key: "key" * }] * }, * destination: { * name: "name", * fields: [{ * type: "string", * key: "key" * }, { * type: "string", * key: "key" * }] * } * }) */ updateMappingProgram(programId: Flatfile.ProgramId, request: Flatfile.ProgramConfig, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __updateMappingProgram; /** * Deletes a mapping program * * @param {Flatfile.ProgramId} programId - ID of the program * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.deleteMappingProgram("programId") */ deleteMappingProgram(programId: Flatfile.ProgramId, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __deleteMappingProgram; /** * Add mapping rules to a program * * @param {Flatfile.ProgramId} programId - ID of the program * @param {Flatfile.CreateMappingRulesRequest} request * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.createRules("programId", [{ * name: "name", * type: "type" * }, { * name: "name", * type: "type" * }]) */ createRules(programId: Flatfile.ProgramId, request: Flatfile.CreateMappingRulesRequest, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __createRules; /** * Deletes multiple mapping rules from a program * * @param {Flatfile.ProgramId} programId - ID of the program * @param {Flatfile.DeleteMultipleRulesRequest} request * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.deleteMultipleRules("programId", { * ruleIds: ["ruleIds", "ruleIds"] * }) */ deleteMultipleRules(programId: Flatfile.ProgramId, request: Flatfile.DeleteMultipleRulesRequest, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __deleteMultipleRules; /** * List all mapping rules in a program * * @param {Flatfile.ProgramId} programId - ID of the program * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.listRules("us_mp_YOUR_ID") */ listRules(programId: Flatfile.ProgramId, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __listRules; /** * Get a mapping rule from a program * * @param {Flatfile.ProgramId} programId - ID of the program * @param {Flatfile.MappingId} mappingId - ID of mapping rule * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.getRule("us_mp_YOUR_ID", "us_mr_YOUR_ID") */ getRule(programId: Flatfile.ProgramId, mappingId: Flatfile.MappingId, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __getRule; /** * Updates a mapping rule in a program * * @param {Flatfile.ProgramId} programId - ID of the program * @param {Flatfile.MappingId} mappingId - ID of mapping rule * @param {Flatfile.MappingRuleConfig} request * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.updateRule("us_mp_YOUR_ID", "us_mr_YOUR_ID", { * name: "Assign mapping rule", * type: "assign", * config: {}, * metadata: {} * }) */ updateRule(programId: Flatfile.ProgramId, mappingId: Flatfile.MappingId, request: Flatfile.MappingRuleConfig, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __updateRule; /** * Updates a list of mapping rules in a program * * @param {Flatfile.ProgramId} programId - ID of the program * @param {Flatfile.UpdateMappingRulesRequest} request * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.updateRules("programId", [{ * name: "name", * type: "type", * id: "id", * createdAt: "2024-01-15T09:30:00Z", * updatedAt: "2024-01-15T09:30:00Z" * }, { * name: "name", * type: "type", * id: "id", * createdAt: "2024-01-15T09:30:00Z", * updatedAt: "2024-01-15T09:30:00Z" * }]) */ updateRules(programId: Flatfile.ProgramId, request: Flatfile.UpdateMappingRulesRequest, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __updateRules; /** * Deletes a mapping rule from a program * * @param {Flatfile.ProgramId} programId - ID of the program * @param {Flatfile.MappingId} mappingId - ID of mapping rule * @param {Mapping.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Flatfile.BadRequestError} * @throws {@link Flatfile.NotFoundError} * * @example * await client.mapping.deleteRule("us_mp_YOUR_ID", "us_mr_YOUR_ID") */ deleteRule(programId: Flatfile.ProgramId, mappingId: Flatfile.MappingId, requestOptions?: Mapping.RequestOptions): core.HttpResponsePromise; private __deleteRule; protected _getAuthorizationHeader(): Promise; }