UNPKG

dataverse-webapi

Version:
152 lines (151 loc) 7.79 kB
import { ChangeSet, Entity, FunctionInput, QueryOptions, RetrieveMultipleResponse, WebApiConfig } from './models'; /** * Retrieve a record from CRM * @param apiConfig WebApiConfig object * @param entityType Type of entity to retrieve * @param id Id of record to retrieve * @param queryString OData query string parameters * @param queryOptions Various query options for the query */ export declare function retrieve(apiConfig: WebApiConfig, entitySet: string, id: string, queryString?: string, queryOptions?: QueryOptions): Promise<Entity>; /** * Retrieve multiple records from CRM * @param apiConfig WebApiConfig object * @param entitySet Type of entity to retrieve * @param queryString OData query string parameters * @param queryOptions Various query options for the query */ export declare function retrieveMultiple(apiConfig: WebApiConfig, entitySet: string, queryString?: string, queryOptions?: QueryOptions): Promise<RetrieveMultipleResponse>; /** * Retrieve next page from a retrieveMultiple request * @param apiConfig WebApiConfig object * @param url Query from the @odata.nextlink property of a retrieveMultiple * @param queryOptions Various query options for the query */ export declare function retrieveMultipleNextPage(apiConfig: WebApiConfig, queryUrl: string, queryOptions?: QueryOptions): Promise<RetrieveMultipleResponse>; /** * Create a record in CRM * @param apiConfig WebApiConfig object * @param entitySet Type of entity to create * @param entity Entity to create * @param queryOptions Various query options for the query */ export declare function create(apiConfig: WebApiConfig, entitySet: string, entity: Entity, queryOptions?: QueryOptions): Promise<void>; /** * Create a record in CRM and return data * @param apiConfig WebApiConfig object * @param entitySet Type of entity to create * @param entity Entity to create * @param select Select odata query parameter * @param queryOptions Various query options for the query */ export declare function createWithReturnData(apiConfig: WebApiConfig, entitySet: string, entity: Entity, select: string, queryOptions?: QueryOptions): Promise<Entity>; /** * Update a record in CRM * @param apiConfig WebApiConfig object * @param entitySet Type of entity to update * @param id Id of record to update * @param entity Entity fields to update * @param queryOptions Various query options for the query */ export declare function update(apiConfig: WebApiConfig, entitySet: string, id: string, entity: Entity, queryOptions?: QueryOptions): Promise<void>; /** * Create a record in CRM and return data * @param apiConfig WebApiConfig object * @param entitySet Type of entity to create * @param id Id of record to update * @param entity Entity fields to update * @param select Select odata query parameter * @param queryOptions Various query options for the query */ export declare function updateWithReturnData(apiConfig: WebApiConfig, entitySet: string, id: string, entity: Entity, select: string, queryOptions?: QueryOptions): Promise<Entity>; /** * Update a single property of a record in CRM * @param apiConfig WebApiConfig object * @param entitySet Type of entity to update * @param id Id of record to update * @param attribute Attribute to update * @param queryOptions Various query options for the query */ export declare function updateProperty(apiConfig: WebApiConfig, entitySet: string, id: string, attribute: string, value: string | number | boolean, queryOptions?: QueryOptions): Promise<void>; /** * Delete a record from CRM * @param apiConfig WebApiConfig object * @param entitySet Type of entity to delete * @param id Id of record to delete */ export declare function deleteRecord(apiConfig: WebApiConfig, entitySet: string, id: string): Promise<void>; /** * Delete a property from a record in CRM. Non navigation properties only * @param apiConfig WebApiConfig object * @param entitySet Type of entity to update * @param id Id of record to update * @param attribute Attribute to delete */ export declare function deleteProperty(apiConfig: WebApiConfig, entitySet: string, id: string, attribute: string): Promise<void>; /** * Associate two records * @param apiConfig WebApiConfig object * @param entitySet Type of entity for primary record * @param id Id of primary record * @param relationship Schema name of relationship * @param relatedEntitySet Type of entity for secondary record * @param relatedEntityId Id of secondary record * @param queryOptions Various query options for the query */ export declare function associate(apiConfig: WebApiConfig, entitySet: string, id: string, relationship: string, relatedEntitySet: string, relatedEntityId: string, queryOptions?: QueryOptions): Promise<void>; /** * Disassociate two records * @param apiConfig WebApiConfig obje * @param entitySet Type of entity for primary record * @param id Id of primary record * @param property Schema name of property or relationship * @param relatedEntityId Id of secondary record. Only needed for collection-valued navigation properties */ export declare function disassociate(apiConfig: WebApiConfig, entitySet: string, id: string, property: string, relatedEntityId?: string): Promise<void>; /** * Execute a default or custom bound action in CRM * @param apiConfig WebApiConfig object * @param entitySet Type of entity to run the action against * @param id Id of record to run the action against * @param actionName Name of the action to run * @param inputs Any inputs required by the action * @param queryOptions Various query options for the query */ export declare function boundAction(apiConfig: WebApiConfig, entitySet: string, id: string, actionName: string, inputs?: Record<string, unknown>, queryOptions?: QueryOptions): Promise<unknown>; /** * Execute a default or custom unbound action in CRM * @param apiConfig WebApiConfig object * @param actionName Name of the action to run * @param inputs Any inputs required by the action * @param queryOptions Various query options for the query */ export declare function unboundAction(apiConfig: WebApiConfig, actionName: string, inputs?: Record<string, unknown>, queryOptions?: QueryOptions): Promise<unknown>; /** * Execute a default or custom bound action in CRM * @param apiConfig WebApiConfig object * @param entitySet Type of entity to run the action against * @param id Id of record to run the action against * @param functionName Name of the action to run * @param inputs Any inputs required by the action * @param queryOptions Various query options for the query */ export declare function boundFunction(apiConfig: WebApiConfig, entitySet: string, id: string, functionName: string, inputs?: FunctionInput[], queryOptions?: QueryOptions): Promise<unknown>; /** * Execute an unbound function in CRM * @param apiConfig WebApiConfig object * @param functionName Name of the action to run * @param inputs Any inputs required by the action * @param queryOptions Various query options for the query */ export declare function unboundFunction(apiConfig: WebApiConfig, functionName: string, inputs?: FunctionInput[], queryOptions?: QueryOptions): Promise<unknown>; /** * Execute a batch operation in CRM * @param apiConfig WebApiConfig object * @param batchId Unique batch id for the operation * @param changeSetId Unique change set id for any changesets in the operation * @param changeSets Array of change sets (create or update) for the operation * @param batchGets Array of get requests for the operation * @param queryOptions Various query options for the query */ export declare function batchOperation(apiConfig: WebApiConfig, batchId: string, changeSetId: string, changeSets: ChangeSet[], batchGets: string[], queryOptions?: QueryOptions): Promise<unknown>;