@evergis/sp-api
Advanced tools
Comparing version 0.4.2 to 0.4.3
import { EventHandler } from "@evergis/sgis/EventHandler"; | ||
import { Api } from "./Api"; | ||
export interface Credentials { | ||
login?: string; | ||
password?: string; | ||
sessionId?: string; | ||
} | ||
export declare class Connector extends EventHandler { | ||
@@ -13,7 +18,7 @@ api: Api; | ||
_aborted: any; | ||
private initializationPromise; | ||
initializationPromise: Promise<string>; | ||
_sessionId: string; | ||
private _latestOperationNotification; | ||
private _login; | ||
constructor(url: any, authServiceUrl: any, {login, password, sessionId}: any); | ||
constructor(url: any, authServiceUrl: any, credentials?: Credentials); | ||
addNotificationListner(tag: any, string: any, callback: any): void; | ||
@@ -23,7 +28,3 @@ removeNotificationListner(tag: any, string: any): void; | ||
removeObjectSelectorListener(f: any): void; | ||
initializeSession({login, password, sessionId}: { | ||
login: any; | ||
password: any; | ||
sessionId: any; | ||
}): void; | ||
initializeSession({login, password, sessionId}: Credentials): Promise<string>; | ||
requestNotifications(): void; | ||
@@ -30,0 +31,0 @@ connectionLostError(): void; |
@@ -7,3 +7,3 @@ import { EventHandler } from "@evergis/sgis/EventHandler"; | ||
export class Connector extends EventHandler { | ||
constructor(url, authServiceUrl, { login, password, sessionId }) { | ||
constructor(url, authServiceUrl, credentials) { | ||
super(); | ||
@@ -17,3 +17,5 @@ this._url = url; | ||
this._failedNotificationRequests = 0; | ||
this.initializeSession({ login, password, sessionId }); | ||
if (credentials) { | ||
this.initializeSession(credentials); | ||
} | ||
this.api = new Api(this); | ||
@@ -79,2 +81,3 @@ } | ||
}); | ||
return this.initializationPromise; | ||
} | ||
@@ -81,0 +84,0 @@ requestNotifications() { |
{ | ||
"name": "@evergis/sp-api", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/compilation/everGis.js", |
@@ -7,2 +7,8 @@ import {EventHandler} from "@evergis/sgis/EventHandler"; | ||
export interface Credentials { | ||
login?: string; | ||
password?: string; | ||
sessionId?: string; | ||
} | ||
export class Connector extends EventHandler { | ||
@@ -20,3 +26,3 @@ api: Api; | ||
_aborted: any; | ||
private initializationPromise: Promise<any>; | ||
initializationPromise: Promise<string>; | ||
_sessionId: string; | ||
@@ -26,3 +32,3 @@ private _latestOperationNotification: any; | ||
constructor(url, authServiceUrl, {login, password, sessionId}: any) { | ||
constructor(url, authServiceUrl, credentials?: Credentials) { | ||
super(); | ||
@@ -39,3 +45,5 @@ | ||
this.initializeSession({login, password, sessionId}); | ||
if (credentials) { | ||
this.initializeSession(credentials); | ||
} | ||
@@ -63,3 +71,3 @@ this.api = new Api(this); | ||
initializeSession({login, password, sessionId}) { | ||
initializeSession({login, password, sessionId}: Credentials) { | ||
this.initializationPromise = new Promise((resolve, reject) => { | ||
@@ -107,2 +115,4 @@ var self = this; | ||
}); | ||
return this.initializationPromise; | ||
} | ||
@@ -109,0 +119,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1689372
18367