@simplito/privmx-webendpoint
Version:
PrivMX Web Endpoint library
72 lines (69 loc) • 2.33 kB
TypeScript
/*!
PrivMX Web Endpoint.
Copyright © 2024 Simplito sp. z o.o.
This file is part of the PrivMX Platform (https://privmx.dev).
This software is Licensed under the PrivMX Free License.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { BaseApi } from "./BaseApi";
import { ConnectionNative } from "../api/ConnectionNative";
import { PagingQuery, PagingList, Context, UserInfo } from "../Types";
import { BaseNative } from "../api/BaseNative";
import { UserVerifierInterface } from "./UserVerifierInterface";
export declare class Connection extends BaseApi {
private native;
/**
* //doc-gen:ignore
*/
apisRefs: {
[apiId: string]: {
_apiServicePtr: number;
};
};
/**
* //doc-gen:ignore
*/
nativeApisDeps: {
[apiId: string]: BaseNative;
};
constructor(native: ConnectionNative, ptr: number);
/**
* Gets the ID of the current connection.
*
* @returns {number} ID of the connection
*/
getConnectionId(): Promise<number>;
/**
* Gets a list of Contexts available for the user.
*
* @param pagingQuery struct with list query parameters
* @returns {PagingList<Context>} struct containing a list of Contexts
*/
listContexts(pagingQuery: PagingQuery): Promise<PagingList<Context>>;
/**
* Gets a list of users of given context.
*
* @param contextId ID of the Context
*
* @returns a list of the UserInfo objects
*/
getContextUsers(contextId: string): Promise<UserInfo[]>;
/**
* Disconnects from the Platform backend.
*
*/
disconnect(): Promise<void>;
/**
* Sets user's custom verification callback.
*
* The feature allows the developer to set up a callback for user verification.
* A developer can implement an interface and pass the implementation to the function.
* Each time data is read from the container, a callback will be triggered, allowing the developer to validate the sender in an external service,
* e.g. Developer's Application Server or PKI Server.
* @param verifier an implementation of the UserVerifierInterface
*
*/
setUserVerifier(verifier: UserVerifierInterface): Promise<void>;
private freeApis;
}