/*! * Copyright Adaptavist 2023 (c) All rights reserved */ import { Headers, Response, BaseApiCore, ErrorStrategyOptionType, PlatformImplementation } from '@managed-api/commons-core'; import { CommonError, AdditionalErrorTypes, ErrorStrategyHandlers, ErrorStrategyOption } from './errorStrategy'; import { ErrorStrategyBuilder } from './builders/errorStrategy'; import { GetAttachmentsResponseOK, GetAttachmentsRequest, GetMetadataForAttachmentRequest, GetMetadataForAttachmentResponseOK, UploadBinaryFileResponseOK, UploadBinaryFileRequest, UploadMultipartFileResponseOK, UploadMultipartFileRequest, DeleteAttachmentRequest, DeleteAttachmentResponseOK } from './types/attachment'; import { AddRecordRequest, AddRecordResponseOK, DeleteRecordRequest, DeleteRecordResponseOK, GetRecordRequest, GetRecordResponseOK, GetRecordsRequest, GetRecordsResponseOK, UpdateRecordRequest, UpdateRecordResponseOK, UpdateRecordWithNameValuePairRequest, UpdateRecordWithNameValuePairResponseOK } from './types/table'; export interface ServiceNowApiCoreOptions extends ErrorStrategyOption { } declare type GetGlobalErrorStrategy = () => ErrorStrategyOptionType | undefined; export declare abstract class ServiceNowApiCore extends BaseApiCore { private options?; Attachment: AttachmentGroup; Table: TableGroup; All: AllGroup; constructor(options?: ServiceNowApiCoreOptions | undefined); setGlobalErrorStrategy(errorStrategy: ErrorStrategyOptionType): void; protected buildResponse(url: string, status: number, statusText: string, headers: Headers, body?: string | ArrayBuffer): Response; private getGlobalErrorStrategy; } declare class AllGroup { private Attachment; private Table; constructor(Attachment: AttachmentGroup, Table: TableGroup); /** * This method deletes the attachment with a specific sys_id value. * Alternative usage: Attachment.deleteAttachment * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_AttachmentAPI.html#title_attachment-DELETE * @param options Request options. */ deleteAttachment(options: DeleteAttachmentRequest): Promise; /** * Returns the metadata for multiple attachments. * Alternative usage: Attachment.getAttachments * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_AttachmentAPI.html#title_attachment-GET * @param options Request options. */ getAttachments(options?: GetAttachmentsRequest): Promise; /** * Returns the metadata for the attachment file with a specific sys_id value. * Alternative usage: Attachment.getMetadataForAttachment * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_AttachmentAPI.html#title_attachment-GET-sys_id * @param options Request options. */ getMetadataForAttachment(options: GetMetadataForAttachmentRequest): Promise; /** * Uploads a specified binary file as an attachment to a specified record. * Alternative usage: Attachment.uploadBinaryFile * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_AttachmentAPI.html#title_attachment-POST-file * @param options Request options. */ uploadBinaryFile(options: UploadBinaryFileRequest): Promise; /** * Deletes the specified record from the specified table. * Alternative usage: Table.deleteRecord * Documentation:https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-DELETE */ deleteRecord(options: DeleteRecordRequest): Promise; /** * Retrieves multiple records for the specified table. * Alternative usage: Table.getRecords * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-GET * @param options Request options. */ getRecords(options: GetRecordsRequest): Promise; /** * Retrieves the record identified by the specified sys_id from the specified table. * Alternative usage: Table.getRecord * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-GET-id * @param options Request options. */ getRecord(options: GetRecordRequest): Promise; /** * Updates the specified record with the name-value pairs included in the request body. * Alternative usage: Table.updateRecordWithNameValuePair * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-PATCH * @param options Request options. */ updateRecordWithNameValuePair(options: UpdateRecordWithNameValuePairRequest): Promise; /** * Inserts one record in the specified table. Multiple record insertion is not supported by this method. * Alternative usage: Table.addRecord * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-POST * @param options Request options. */ addRecord(options: AddRecordRequest): Promise; /** * Updates the specified record with the request body. * Alternative usage: Table.updateRecord * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-PUT * @param options Request options. */ updateRecord(options: UpdateRecordRequest): Promise; } declare class AttachmentGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * This method deletes the attachment with a specific sys_id value. * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_AttachmentAPI.html#title_attachment-DELETE * @param options Request options. */ deleteAttachment(options: DeleteAttachmentRequest): Promise; /** * Returns the metadata for multiple attachments. * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_AttachmentAPI.html#title_attachment-GET * @param options Request options. */ getAttachments(options?: GetAttachmentsRequest): Promise; /** * Returns the metadata for the attachment file with a specific sys_id value. * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_AttachmentAPI.html#title_attachment-GET-file * @param options Request options. */ getMetadataForAttachment(options: GetMetadataForAttachmentRequest): Promise; /** * Uploads a specified binary file as an attachment to a specified record. * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_AttachmentAPI.html#title_attachment-POST-file * @param options Request options. */ uploadBinaryFile(options: UploadBinaryFileRequest): Promise; /** * Uploads a multipart file attachment. * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_AttachmentAPI.html#title_attachment-POST-upload * @param options Request options. */ uploadMultipartFile(options: UploadMultipartFileRequest): Promise; } declare class TableGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Deletes the specified record from the specified table. * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-DELETE * @param options Request options. */ deleteRecord(options: DeleteRecordRequest): Promise; /** * Retrieves multiple records for the specified table. * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-GET * @param options Request options. */ getRecords(options: GetRecordsRequest): Promise; /** * Retrieves the record identified by the specified sys_id from the specified table. * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-GET-id * @param options Request options. */ getRecord(options: GetRecordRequest): Promise; /** * Updates the specified record with the name-value pairs included in the request body. * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-PATCH * @param options Request options. */ updateRecordWithNameValuePair(options: UpdateRecordWithNameValuePairRequest): Promise; /** * Inserts one record in the specified table. Multiple record insertion is not supported by this method. * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-POST * @param options Request options. */ addRecord(options: AddRecordRequest): Promise; /** * Updates the specified record with the request body. * Documentation: https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html#title_table-PUT * @param options Request options. */ updateRecord(options: UpdateRecordRequest): Promise; } export {}; //# sourceMappingURL=index.d.ts.map