/** @packageDocumentation
* @module iTwinServiceClients
*/
import { GuidString } from "@bentley/bentleyjs-core";
import { WsgInstance } from "../ECJsonTypeMap";
import { WsgClient } from "../WsgClient";
import { AuthorizedClientRequestContext } from "../AuthorizedClientRequestContext";
import { WsgQuery } from "../WsgQuery";
/** Folder
* @alpha
*/
export declare class ProjectShareFolder extends WsgInstance {
name?: string;
contentType?: string;
createdBy?: string;
path?: string;
createdTimeStamp?: string;
modifiedBy?: string;
modifiedTimeStamp?: string;
parentFolderId?: string;
size?: number;
}
/** File
* @alpha
*/
export declare class ProjectShareFile extends WsgInstance {
instanceId?: string;
name?: string;
contentType?: string;
createdBy?: string;
path?: string;
createdTimeStamp?: string;
modifiedBy?: string;
modifiedTimeStamp?: string;
parentFolderWsgId?: string;
size?: number;
/**
* @note The accessUrl is only valid for one hour after it has been initialized by the server.
*/
accessUrl?: string;
customProperties?: any;
}
/** Base query object for getting ProjectShare files and folders
* @alpha
*/
export declare class ProjectShareQuery extends WsgQuery {
/**
* Query for children inside the specified folder
* @param contextId Context Id (e.g., projectId or assetId)
* @note This cannot be combined with other queries.
*/
inRootFolder(contextId: GuidString): this;
/**
* Query for children inside the specified folder
* @param folderId Id of the folder
* @note This cannot be combined with other queries.
*/
inFolder(folderId: GuidString): this;
/**
* Query for folders or files by ids
* @param ids (Array of) folder or file ids
*/
byWsgIds(...ids: GuidString[]): this;
/**
* Query for children in the specified folder, and with a name that matches the specified expression
* @param folderId Id of the folder to look in
* @param nameLike Wild card expression to match the name of the file
* @note
*
* - The path is really as seen in the connect project share portal, and should not include the contextId at the root.
*
- This cannot be combined with other queries.
*
*/
inFolderWithNameLike(folderId: GuidString, searchName: string): this;
/**
* Query for children in the specified path, and with a name that matches the specified expression
* @param contextId Context Id (e.g., projectId or assetId)
* @param path Path specified relative to the root folder to look in. Note: Root folder is named by the contextId, and need not be included.
* @param nameLike Wildcard expression to match the name of the file
* @note
*
* - The path is really as seen in the connect project share portal, and should not include the contextId at the root.
*
- This cannot be combined with other queries.
*
*/
startsWithPathAndNameLike(contextId: GuidString, path: string, nameLike?: string): this;
}
/** Query object for getting ProjectShareFiles. You can use this to modify the query.
* @alpha
*/
export declare class ProjectShareFileQuery extends ProjectShareQuery {
/**
* Query for children inside of the specified path
* @param contextId Context Id (e.g., projectId or assetId)
* @param path Path specified relative to the root folder to look in. Note: Root folder is named by the contextId, and need not be included.
* @note
*
* - The path is really as seen in the connect project share portal, and should not include the contextId at the root.
*
- This cannot be combined with other queries.
*
*/
startsWithPath(contextId: GuidString, path: string): this;
}
/** Query object for getting ProjectShareFolders. You can use this to modify the query.
* @alpha
*/
export declare class ProjectShareFolderQuery extends ProjectShareQuery {
/**
* Query for children inside of the specified path
* @param contextId Context Id (e.g., projectId or assetId)
* @param path Path specified relative to the root folder to look in. Note: Root folder is named by the contextId, and need not be included.
* @note
*
* - The path is really as seen in the connect project share portal, and should not include the contextId at the root.
*
- This cannot be combined with other queries.
*
*/
inPath(contextId: GuidString, path: string): this;
}
/**
* Client wrapper to ProjectShare Service
* @note
*
* - Authorization supplied through the [[AuthorizedClientRequestContext]] and can contain SAML or OIDC (JWT) tokens. The client
* creating OIDC tokens must include the scope *projectwise-share*.
*
- Use this [link](http://bsw-wiki.bentley.com/bin/view.pl/Main/ProjectShareApiV2Documentation) for comprehensive documentation of
* the underlying REST API.
*
- The user accessing Project Share must be provided the required permissions in the connect role management portal.
* i.e., from the main connect project portal, follow the link to "Project Team Management > Project Role Management > Service Access and Permissions > Share"
* and ensure it includes the relevant Project Share permissions for Read, Write, Delete, etc.
*
* @alpha
*/
export declare class ProjectShareClient extends WsgClient {
static readonly searchKey: string;
static readonly configURL = "imjs_project_share_client_url";
static readonly configRelyingPartyUri = "imjs_project_share_client_relying_party_uri";
static readonly configRegion = "imjs_project_share_client_region";
/**
* Creates an instance of ProjectShareClient.
* @param deploymentEnv Deployment environment.
*/
constructor();
protected getRelyingPartyUrl(): string;
protected getRegion(): number | undefined;
/**
* Gets name/key to query the service URLs from the URL Discovery Service ("Buddi")
* @returns Search key for the URL.
*/
protected getUrlSearchKey(): string;
/**
* Gets the default URL for the service.
* @returns Default URL for the service.
*/
protected getDefaultUrl(): string;
/**
* Gets the URL of the service.
* Attempts to discover and cache the URL from the URL Discovery Service. If not
* found uses the default URL provided by client implementations. Note that for consistency
* sake, the URL is stripped of any trailing "/"
* @param excludeApiVersion Pass true to optionally exclude the API version from the URL.
* @returns URL for the service
*/
getUrl(requestContext: AuthorizedClientRequestContext, excludeApiVersion?: boolean): Promise;
/**
* Get folders that meet the specified query
* @param requestContext Client request context that includes the authorization information to access Project Share.
* @param contextId Context Id (e.g., projectId or assetId)
* @param query ProjectShareQuery
*/
getFolders(requestContext: AuthorizedClientRequestContext, contextId: GuidString, query: ProjectShareQuery): Promise;
/**
* Get files as specified by the query
* @param requestContext Client request context that includes the authorization information to access Project Share.
* @param contextId Context Id (e.g., projectId or assetId)
* @param query ProjectShareQuery
* @note The accessUrl in a ProjectShareFile is only valid for one hour after it has been initialized by the server.
*/
getFiles(requestContext: AuthorizedClientRequestContext, contextId: GuidString, query: ProjectShareQuery): Promise;
/**
* Reads a file as a byte array
* @param requestContext Client request context that includes the authorization information to access Project Share.
* @param file ProjectShare file (should include the accessUrl property pointing to the download URL)
* @note For use only in node.js. @see readFile for use in the browser
*/
readFileNodeJs(requestContext: AuthorizedClientRequestContext, file: ProjectShareFile): Promise;
/**
* Reads a file as a byte array
* @param requestContext Client request context that includes the authorization information to access Project Share.
* @param file ProjectShare file (should include the accessUrl property pointing to the download URL)
* @param maxByteCount If specified the maximum number of bytes to copy from the file
* @note For use only in the browser. @see readFileNodeJs for use in node.js
*/
readFile(requestContext: AuthorizedClientRequestContext, file: ProjectShareFile, maxByteCount?: number): Promise;
/**
* Create, update or delete custom properties in a file, and return the new state of the file.
* @param requestContext Client request context that includes the authorization information to access Project Share.
* @param file ProjectShareFile
* @param updateProperties Array of Name-Value pairs describing creates and updates
*
* e.g.,
* [{
* "Name": "Reviewer",
* "Value": "Bob"
* },
* {
* "Name": "Version",
* "Value": "2.0"
* }]
*
* @param deleteProperties Array of names of custom properties to delete
* @return The instance after the changes
*/
updateCustomProperties(requestContext: AuthorizedClientRequestContext, contextId: GuidString, file: ProjectShareFile, updateProperties?: Array<{
Name: string;
Value: string;
}>, deleteProperties?: string[]): Promise;
}
//# sourceMappingURL=ProjectShareClient.d.ts.map