export = ConnectionConfig; /** * @file Terminus DB connection configuration * @license Apache Version 2 * @description Object representing the state of a connection to a terminus db - these are: * provides methods for getting and setting connection parameters * @constructor * @param {string} serverUrl - the terminusdb server url * @param {typedef.ParamsObj} [params] - an object with the following connection parameters: */ declare function ConnectionConfig(serverUrl: string, params?: typedef.ParamsObj): void; declare class ConnectionConfig { /** * @file Terminus DB connection configuration * @license Apache Version 2 * @description Object representing the state of a connection to a terminus db - these are: * provides methods for getting and setting connection parameters * @constructor * @param {string} serverUrl - the terminusdb server url * @param {typedef.ParamsObj} [params] - an object with the following connection parameters: */ constructor(serverUrl: string, params?: typedef.ParamsObj); /** * @type {string} */ server: string; baseServer: any; /** @type {typedef.CredentialObj} */ remote_auth: typedef.CredentialObj; /** @type {typedef.CredentialObj } */ local_auth: typedef.CredentialObj; /** @type {string | boolean} */ organizationid: string | boolean; /** @type {string | boolean} */ dbid: string | boolean; default_branch_id: string; default_repo_id: string; system_db: string; api_extension: string; branchid: string; repoid: string; /** @type {string | boolean} */ refid: string | boolean; /** @type {string | boolean} */ connection_error: string | boolean; /** * Creates a new connection config object and copies all the state information from this one into it * @returns {ConnectionConfig} */ copy(): ConnectionConfig; /** * updates connection config with new parameters * @param {typedef.ParamsObj} params - an object with the following connection parameters: */ update(params: typedef.ParamsObj): void; /** * Simple gets to retrieve current connection status * Gets the current server url * @returns {string} */ serverURL(): string; /** * Simple gets to retrieve current connection status * Gets the current server url * @returns {string} */ author(): string; /** * Gets the server connection url * @returns {string} */ apiURL(): string; /** * Gets the server connection url info * @returns {string} */ apiURLInfo(): string; /** * Gets the current database id * @returns {string | boolean} */ db(): string | boolean; /** * Gets the current branch id * @returns {string} */ branch(): string; /** * Gets the current commit ref id * @returns {string | boolean} */ ref(): string | boolean; /** * Gets the current organization id * @returns {string | boolean} */ organization(): string | boolean; /** * Gets the current organization id * @returns {string} */ repo(): string; /** *Gets the local Authorization credentials *return {CredentialObj | boolean} */ localAuth(): false | typedef.CredentialObj; /** *Gets the local user name *return {string | boolean} */ localUser(): string | boolean; /** *Gets the current user name *@param {boolean} [ignoreJwt] *return {string | boolean} */ user(ignoreJwt?: boolean): string | boolean; /** * Check the server URL * @param {string} str - the server url string * @returns {string} */ parseServerURL(str: string): string; serverUrlEncoding(str: any): any; /** * Clear cursor for connection */ clearCursor(): void; /** * @param {string | boolean} errorMessage */ setError(errorMessage: string | boolean): void; /** * Set the organization to which the connected db belongs * (not the users organization - set in capabilities) * @param {string | boolean} [orgId] */ setOrganization(orgId?: string | boolean): void; /** * Set the local identifier of db * @param {string | boolean} dbId - database Id */ setDB(dbId: string | boolean): void; /** * Set the repository type |local|remote| * @param {typedef.RepoType | string} repoId - for the local server - identifier of repo */ setRepo(repoId: typedef.RepoType | string): void; /** * @param {string} [branchId] - id of branch */ setBranch(branchId?: string): void; /** * Set an Reference ID or Commit ID. * Commit IDs are unique hashes that are created whenever a new commit is recorded * @param {string | boolean} refId - commit reference id */ setRef(refId: string | boolean): void; /** * set the local database connection credential * @param {string} [remoteKey] - jwt auth api key * @param {string} [remoteUserID] - remote user id */ setRemoteBasicAuth(remoteKey?: string, remoteUserID?: string): void; /** * set the local database connection credential * @param {string} [userKey] - basic auth api key * @param {string} [userId] - user id * @param {string} [type] - basic|jwt|apikey */ setLocalBasicAuth(userKey?: string, userId?: string, type?: string): void; /** * Set the local server connection credential * @param {typedef.CredentialObj} newCredential */ setLocalAuth(newCredential: typedef.CredentialObj): void; /** * Set the remote server connection credential * @param {typedef.CredentialObj} newCredential */ setRemoteAuth(newCredential: typedef.CredentialObj): void; /** *Gets the remote Authorization credentials *to connect the local db with a remote terminusdb database for push-pull-clone actions *return {CredentialObj| boolean} */ remoteAuth(): false | typedef.CredentialObj; /** * Generate the db endpoit url for create / delete db * @returns {string} */ dbURL(): string; /** * Generate URL for the user's api endpoint * @param {string} [user] - the user id * @returns {string} */ userURL(user?: string): string; /** * Generate URL for the user's organization api endpoint * @param {string} orgId - the organization id * @param {string} [action] - the organization id * @returns {string} */ organizationURL(orgId: string, action?: string): string; /** * Generate URL for the user's organization api endpoint * @param {string} orgId - the organization id * @param {string} [action] - the organization id * @returns {string} */ userOrganizationsURL(): string; /** * Generate URL for the user's roles api endpoint * @returns {string} */ rolesURL(): string; /** * Generate URL to update the user's role api endpoint * @returns {string} */ updateRolesURL(): string; /** * Generate URL for create / delete graph api endpoint * @param {string} graphType * @returns {string} */ graphURL(graphType: string): string; /** * Generate URL for get / set schema api endpoint * @param {string} graphType * @returns {string} */ triplesURL(graphType: string): string; /** * Generate URL for add / get csv api endpoint * @returns {string} */ csvURL(): string; /** * Generate URL for woql query api endpoint * @returns {string} */ queryURL(): string; /** * Generate URL for get back the commits logs * @returns {string} */ log(): string; /** * get the url to update the organization role in the system database * don't change the end point (this is a terminus db server end point) * @returns {string} */ updateOrganizationRoleURL(): string; /** * Generate URL for clone db endpoint * @param {string} [newRepoId] the repository id * @returns {string} */ cloneURL(newRepoId?: string): string; /** * URL at which a db can be cloned * @returns {string} */ cloneableURL(): string; /** * Generate URL for pull endpoint * @returns {string} */ pullURL(): string; /** * Generate URL for pull endpoint * @returns {string} */ patchURL(): string; /** * Generate URL for diff endpoint * @returns {string} */ diffURL(): string; /** * Generate URL for diff endpoint * @returns {string} */ applyURL(): string; /** * Generate url portion consisting of organization/dbid * (unless dbid = system dbname in which case there is no organization) * @property {typedef.DocParamsPost|Object} params */ docHistoryURL(params: any): string; /** * Generate URL for fetch endpoint * @param {string} remoteName * @returns {string} */ fetchURL(remoteName: string): string; /** * Generate URL for remote endpoint * @param {string} [remoteName] - optional remote name * @returns {string} */ remoteURL(remoteName?: string): string; /** * Generate URL for rebase endpoint * @returns {string} */ rebaseURL(): string; /** * Generate URL for reset endpoint * @returns {string} */ resetURL(): string; /** * Generate URL for push endpoint * @returns {string} */ pushURL(): string; /** * Generate URL for branch endpoint * @param {string} branchId - the branch id * @returns {string} */ branchURL(branchId: string): string; /** * Generate URL for branch squash endpoint */ squashBranchURL(nuid: any): string; /** * Generate URL for branch reset endpoint */ resetBranchUrl(nuid: any): string; /** * Generate URL for commit descriptor * @param {string} commitId * @returns {string} a commit pathname */ commitDescriptorUrl(commitId: string): string; /** * Generate URL for optimizing db branch */ optimizeBranchUrl(branchId: any): string; /** * Generate base db url consisting of server/action/organization/dbid * @param {typedef.ActionType} action * @returns {string} */ dbBase(action: typedef.ActionType): string; /** * Generate base branch url consisting of server/action/organization/dbid/branchid * @param {typedef.ActionType} action * @returns {string} */ repoBase(action: typedef.ActionType): string; /** * Get database branch Url * Generate base branch url consisting of server/action/organization/dbid/branchid * @param {typedef.ActionType} action * @returns {string} */ branchBase(action: typedef.ActionType): string; /** * Generate url portion consisting of organization/dbid * (unless dbid = system dbname in which case there is no organization) * @returns {string|boolean} */ dbURLFragment(): string | boolean; /** * Generate url portion consisting of organization/dbid * (unless dbid = system dbname in which case there is no organization) * @property {typedef.DocParamsPost|Object} params */ documentURL(params: any): string; prefixesURL(): string; queryParameter(params: any): string; jsonSchemaURL(params: any): string; } import typedef = require("./typedef");