UNPKG

@kontent-ai/delivery-sdk

Version:
36 lines 1.2 kB
import { BaseListingQuery } from '../common/base-listing-query.class'; export class SyncChangesQuery extends BaseListingQuery { constructor(config, queryService) { super(config, queryService); this.config = config; this.queryService = queryService; this._queryConfig = {}; this.action = '/sync'; } toPromise() { var _a; console.warn(`Sync Api v1 is deprecated. Please use the new Sync Api v2. https://kontent.ai/learn/docs/apis/openapi/sync-api-v2/`); return this.queryService.syncChanges(this.getUrl(), (_a = this._queryConfig) !== null && _a !== void 0 ? _a : {}); } getUrl() { return super.resolveUrlInternal(this.action); } /** * Used to configure query * @param queryConfig Query configuration */ queryConfig(queryConfig) { this._queryConfig = queryConfig; return this; } map(json) { return this.queryService.mappingService.syncChanges(json); } allResponseFactory(items, responses) { return { items: items, responses: responses }; } } //# sourceMappingURL=sync-changes-query.class.js.map