import { LazyCredential, type Credential } from './credentials'; import type { RelationshipHierarchy } from './orchestrator/dependencies/relationship-resolver'; export type UnloadedRecord = { content: string; sysId: string; table: string; tableName: string; name: string; }; export type BatchRecord = { table: string; sysIds: string[]; graphIds: string[]; }; export type BatchUnloadRequest = { records: BatchRecord[]; graphs: Record>; scopeId: string; }; export type UnloadRequest = BatchUnloadRequest; export declare const UNSUPPORTED_BATCH_FORMAT_ERROR_MESSAGE = "Missing required parameters: table, sysId, and tableGraphs are required."; export type QueryDisplayValue = 'true' | 'false' | 'all'; export type QueryOptions = { table: string; encodedQuery: string; limit?: number; offset?: number; fields?: string; displayValue?: QueryDisplayValue; excludeReferenceLink?: boolean; noCount?: boolean; timeoutMs?: number; view?: string; queryCategory?: string; queryNoDomain?: boolean; }; export type QueryResult = { table: string; count: number; hasMore: boolean; nextOffset: number | null; records: unknown[]; }; export interface IConnector { fetch(path: string, init?: RequestInit, params?: URLSearchParams): Promise; setCurrentApplication(scopeId: string): Promise; getHost(): URL; download(scope: string, options?: { method: 'complete'; } | { method: 'incremental'; lastPull?: string; }): Promise; moveToApp(sysIds: string[], scope: string): Promise; uploadScopedAppPackage(file: Blob, options: { timeoutMs?: number | undefined; loadDemoData?: boolean; isStoreApp?: boolean; registerScope?: boolean; installAsync?: boolean; appInfo?: { scope: string; scopeId: string; version: string; }; }): Promise<{ trackerId: string; rollbackId: string; } | undefined>; getUpdateXMLCount(updateSetId: string): Promise; uninstallApplication(scopeId: string, isStoreApp: boolean): Promise; appUpgradeStatus(scope: string): Promise<{ finished: boolean; id: string; }>; getProgress(progressId: string): Promise<{ status: string; percent_complete: number; status_message: string; }>; getUpdateMutex(): Promise; getInstanceBuildName(): Promise; appCreatorVendorPrefix(): Promise; getScopeInfo(scope?: string, scopeId?: string): Promise; downloadUpdateSet(updateSetId: string, scopeId: string): Promise; syntaxEditorCacheScriptIncludes(): Promise>; syntaxEditorCompletionDefinitions(): Promise; syntaxEditorDefinitionsScriptIncludes(scriptIncludeIds: string[]): Promise>; processorRequest(api: string, search: URLSearchParams): Promise<{ status: number; value: string; }>; unloadDependentRecords(request: UnloadRequest): Promise; /** @deprecated Use the single request object form instead */ unloadDependentRecords(table: T, sysId: string, tableGraphs: RelationshipHierarchy[], scopeId?: string): Promise; unloadRecords(sysIds: string[], scopeId: string): Promise; uploadXmlFiles(scope: string, files: { blob: Blob; name: string; }[], options?: { timeoutMs?: number; targetUpdateSetId?: string; }): Promise; queryTable(options: QueryOptions): Promise; } /** * This class handles http communication with the ServiceNow instance */ export declare class Connector implements IConnector { private readonly credential; constructor( /** * The credential for authentication with the instance */ credential: LazyCredential | Credential); uploadXmlFiles(scopeId: string, files: { blob: Blob; name: string; }[], options?: { timeoutMs?: number; targetUpdateSetId?: string; }): Promise; getHost(): URL; unloadRecords(sysIds: string[], scopeId: string): Promise; unloadDependentRecords(requestOrTable: UnloadRequest | T, sysId?: string, tableGraphs?: RelationshipHierarchy[], scopeId?: string): Promise; processorRequest(api: string, search: URLSearchParams): Promise<{ status: number; value: string; }>; getScopeInfo(scope?: string, scopeId?: string): Promise; moveToApp(sysIds: string[], scope: string): Promise; uploadScopedAppPackage(file: Blob, options: { timeoutMs?: number | undefined; loadDemoData?: boolean; isStoreApp?: boolean; registerScope?: boolean; installAsync?: boolean; appInfo?: { scope: string; scopeId: string; version: string; }; }): Promise<{ trackerId: string; rollbackId: string; } | undefined>; setCurrentApplication(scopeId: string): Promise; uninstallApplication(scopeId: string, isStoreApp: boolean): Promise; appUpgradeStatus(scope: string): Promise<{ finished: boolean; id: string; }>; getProgress(progressId: string): Promise<{ status: string; percent_complete: number; status_message: string; }>; getUpdateMutex(): Promise; download(scope: string, options?: { method: 'complete'; } | { method: 'incremental'; lastPull?: string; }): Promise; downloadUpdateSet(updateSetId: string, scopeId: string): Promise; getInstanceBuildName(): Promise; appCreatorVendorPrefix(): Promise; /**Produces the typescript definition for glide server scriptables */ syntaxEditorCompletionDefinitions(): Promise; /** * Mapping between script include identifiers and their sys_id * @returns Mapping of script to scripd sys_id (Example: { 'global.JSUtil': '1e2e4e24c1af42bea7f0c0f9fa40fbeb' }) */ syntaxEditorCacheScriptIncludes(): Promise>; /**Produces the definitions for script includes */ syntaxEditorDefinitionsScriptIncludes(scriptIncludeIds: string[]): Promise>; private appsAjaxProcessor; /** * Fetch a resource from the ServiceNow instance * @param path Subpath to fetch from the instance (ex: /api/now/table/incident) * @param init Request options to pass to fetch (Default: { method: 'GET', headers: { 'Content-Type': 'application/json' } }) * @returns The response from the fetch request or an error if the request failed */ fetch(path: string, init?: RequestInit, params?: URLSearchParams): Promise; getUpdateXMLCount(updateSetId: string): Promise; private fetchApiNowTable; private sysParmCk; queryTable(options: QueryOptions): Promise; private fetchQueryPage; } export type CustomizeOrMoveResult = { sysId: string; table: string; };