@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.
46 lines • 1.93 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const APICore_js_1 = tslib_1.__importDefault(require("../../APICore.js"));
const normalizePaginatedOptions_js_1 = require("../../utils/normalizePaginatedOptions.js");
const Resource_js_1 = tslib_1.__importDefault(require("../Resource.js"));
class Vaults extends Resource_js_1.default {
static baseUrl = `/rest/organizations/${APICore_js_1.default.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 = (0, normalizePaginatedOptions_js_1.normalizePaginatedOptions)(options);
return this.api.get(this.buildPath(Vaults.baseUrl, normalizedOptions));
}
}
exports.default = Vaults;
//# sourceMappingURL=Vaults.js.map