import { ChunkUploadSdk } from "./chunk-upload/chunk-upload.sdk"; import { Query } from "./Query"; import { RequestFactory } from "./Requests/RequestFactory"; import { TypeOptions } from "./Sitefinity"; /** * The constructor of the Data object. This object is used for requesting data from Sitefinity. */ export declare class Data { private urlOptions; private factory; constructor(urlOptions: TypeOptions, factory: RequestFactory); /** * Returns an instance of the @type {ChunkUploadService} * * @readonly * @type {ChunkUploadSdk} * @memberof Data */ get chunkUpload(): ChunkUploadSdk; /** * Executes a GET request to retrieve a collection of items. */ get(parameters: RequestOptionsBase): void; /** * Executes a GET request to retrieve an/all item(s) operations. */ getOperations(parameters: OperationsRequestOptions): void; /** * Executes a GET request for a single item. */ getSingle(parameters: RequestOptionsBase): void; /** * Executes a POST request for a single item. */ create(parameters: CreateRequestOptions): void; /** * Executes a PATCH request to update a single item. * @example * const data = sf.data({ * entitySet: "newsitems", * provider: "OpenAccessDataProvider", * culture: "en" * }); * * const newsItemUpdate = { * "Title": 'updated news title' * }; * * data.update({ * key: '00000000-0000-0000-0000-000000000000', // key of item to update * data: newsItemUpdate, * saveTemp: true, * successCb: successCb, * failureCb: failureCb * }); */ update(parameters: UpdateRequestOptions): void; /** * Executes a DELETE request to delete a single item. */ destroy(parameters: RequestOptionsBase): void; /** * Executes a POST request to execute a workflow operation for single item. */ operation(parameters: CreateRequestOptions): void; /** * Executes a GET request to get the property of a single item. */ getProperty(parameters: PropertyRequestOptions): void; /** * Executes a GET request to get the related property value of a single item. */ getRelated(parameters: PropertyRequestOptions): void; /** * Executes a GET request to retrieve the related property value of a single item by the id of the related item. */ getRelatedById(parameters: SingleRelatedItemRequestOptions): void; /** * Executes a DELETE request to retrieve the delete all of the associated members in the relation property. */ destroyRelated(parameters: PropertyRequestOptions): void; /** * Executes a DELETE request to retrieve the a single entry of the associated members in the relation property. */ destroyRelatedById(parameters: SingleRelatedItemRequestOptions): void; /** * Executes a POST request to add a related item to the property collection. */ createRelated(parameters: CreateRelatedRequestOptions): void; /** * Executes a POST request to upload a media item. * @example * * const data = sf.data({ * entitySet: "images" * }); * data.upload({ * data: { * content: "base 64 representation of the file", * contentType: "image/jpeg", * name: "test.jpg", * payload: { * Title: "Test", * entitySet: "test" * }, * uploadProperties: { * ParentId: "4BA7AD46-F29B-4E65-BE17-9BF7CE5BA1FB" * } * }, * successCb: successCb, * failureCb: failureCb * }); */ upload(parameters: UploadRequestOptions): void; } export interface RequestOptionsBase { query?: Query; action?: string; successCb?: Function; failureCb?: Function; progressCb?: Function; fallbackProperties?: string[]; key?: string | number; } export interface OperationsRequestOptions extends RequestOptionsBase { parentId?: string; } export interface CreateRequestOptions extends RequestOptionsBase { data?: object; } export interface UpdateRequestOptions extends CreateRequestOptions { saveTemp?: boolean; } export interface PropertyRequestOptions extends RequestOptionsBase { property: string; } export interface SingleRelatedItemRequestOptions extends PropertyRequestOptions { relatedId: string; } export interface CreateRelatedRequestOptions extends PropertyRequestOptions { link: string | number; } export interface UploadRequestOptions extends CreateRequestOptions { data: { content: string; contentType: string; uploadProperties: { [key: string]: string; }; name: string; payload: object; }; publish: boolean; }