fsm-sdk
Version:
Node.JS sdk to interface with SAP Field Service Management APIs.
48 lines (47 loc) • 1.93 kB
TypeScript
import { ClientConfig } from '../client-config.model';
import { HttpService } from '../http/http-service';
import { OAuthService } from '../oauth/oauth.service';
import { Activity, UdfValue } from './service-management.model';
/**
* Service for performing business actions on service calls.
* Provides methods to cancel and manage service call lifecycle.
*/
export declare class ServiceCallAPI {
private _config;
private _http;
private _auth;
constructor(_config: Readonly<ClientConfig>, _http: Readonly<HttpService>, _auth: Readonly<OAuthService>);
/**
* Constructs the API URL for service call business actions.
*
* @param {string} path - Path to append to the base URL.
* @returns {string} The complete API URL.
* @see https://api.sap.com/api/service_management_ext/resource/Service_Call_Business_Actions
*/
getApiUrl(path?: string): string;
/**
* Cancels a service call by its ID.
*
* @param {string} id - Service call ID (also supports code=$ or externalId=$ format).
* @param {object} options - Optional cancellation parameters.
* @param {string} options.cancellationReason - Reason for cancellation.
* @param {UdfValue[]} options.udfValues - User-defined field values.
* @returns {Promise<{ activity: Activity }>} A promise resolving to the cancelled service call.
*/
cancel(id: string, // also support code=$ or externalId=$
options?: Partial<{
cancellationReason: string;
udfValues: UdfValue[];
}>): Promise<{
activity: Activity;
}>;
/**
* Marks a service call as technically complete.
*
* @param {string} id - Service call ID (also supports code=$ or externalId=$ format).
* @returns {Promise<{ activity: Activity }>} A promise resolving to the service call.
*/
technicallyComplete(id: string): Promise<{
activity: Activity;
}>;
}