UNPKG

@coveo/platform-client

Version:

The main goal of this package is to provide an easy to configure and straightforward way of querying Coveo Cloud APIs using JavaScript.

42 lines 1.66 kB
import API from '../../APICore.js'; import { normalizePaginatedOptions } from '../../utils/normalizePaginatedOptions.js'; import Resource from '../Resource.js'; export default class Vaults extends Resource { static baseUrl = `/rest/organizations/${API.orgPlaceholder}/vaultentries`; /** * Find error vault keys for a given snapshot. * @param snapshotId The unique identifier of the target snapshot. */ findMissing(snapshotId) { return this.api.get(this.buildPath(`${Vaults.baseUrl}/missing`, { snapshotId })); } /** * Import vault entries from the starting organization into the current organization. * @param currentSnapshotId The unique identifier of the current snapshot. * @param sourceOrganizationId The unique identifier of the source organization. * @param fetchStrategy Choosing the strategy to use when importing vault entries. */ import(currentSnapshotId, sourceOrganizationId, fetchStrategy) { return this.api.put(this.buildPath(`${Vaults.baseUrl}/fetch`, { referenceSnapshotId: currentSnapshotId, sourceOrganizationId, fetchStrategy, })); } /** * Create a vault entry. * @param model Vault entry model */ create(model) { return this.api.post(Vaults.baseUrl, model); } /** * Get all vault entries for an organization. * @param options pagination options */ list(options) { const normalizedOptions = normalizePaginatedOptions(options); return this.api.get(this.buildPath(Vaults.baseUrl, normalizedOptions)); } } //# sourceMappingURL=Vaults.js.map