sideshift-node-sdk
Version:
TypeScript Client for SideShift.ai API
39 lines (38 loc) • 1.63 kB
TypeScript
import { SideShiftHttpHandler } from '../sideShiftHttpClient';
import { ApiResponse, RecentShift, ShiftResponse } from '../../types';
export declare class ShiftsAPI {
private sideShiftHttpHandler;
constructor(sideShiftHttpHandler: SideShiftHttpHandler);
/**
* Returns whether or not the user is allowed to create shifts on SideShift.ai.
* @see https://docs.sideshift.ai/endpoints/v2/permissions
*
* @param endUserIp - Optional end-user IP address for integrations API requests
* @returns Promise<ApiResponse<boolean[]>>
*/
getPermissions(endUserIp?: string): Promise<ApiResponse<boolean>>;
/**
* Returns the shift data.
* @see https://docs.sideshift.ai/endpoints/v2/shift
*
* @param shiftId - The ID of the shift to retrieve.
* @returns Promise<ApiResponse<ShiftResponse>>
*/
getShift(shiftId: string): Promise<ApiResponse<ShiftResponse>>;
/**
* Returns the shift data for every shiftId listed in the array.
* @see https://docs.sideshift.ai/endpoints/v2/bulkshifts
*
* @param shiftIds - An array of shift IDs to retrieve.
* @returns Promise<ApiResponse<ShiftResponse[]>>
*/
getBulkShifts(shiftIds: string[]): Promise<ApiResponse<ShiftResponse[]>>;
/**
* Returns the 10 most recent completed shifts
* @see https://docs.sideshift.ai/endpoints/v2/recentshifts
*
* @param limit - The maximum number of recent shifts to return (default is 10, max is 100).
* @returns Promise<ApiResponse<RecentShift[]>>
*/
getRecentShifts(limit?: number): Promise<ApiResponse<RecentShift[]>>;
}