import { BentleyStatus, ClientRequestContext, GuidString } from "@bentley/bentleyjs-core"; import { AuthorizedClientRequestContext } from "../AuthorizedClientRequestContext"; import { Client } from "../Client"; import { RequestOptions } from "../Request"; import { AccessToken, AuthorizationToken } from "../Token"; /** Represents one of the potential usage types. * See also * - [[UsageLogEntry]], [[FeatureLogEntry]] * - *UsageType* entry on [ULAS Swagger](https://qa-connect-ulastm.bentley.com/Bentley.ULAS.SwaggerUI/SwaggerWebApp/?urls.primaryName=ULAS%20Posting%20Service%20v1) * site (section *Models*) * @internal */ export declare enum UsageType { Production = 0, Trial = 1, Beta = 2, HomeUse = 3, PreActivation = 4 } /** Represents the version of the product logging usage or features. * See also [[UsageLogEntry]], [[FeatureLogEntry]]. * @internal */ export interface ProductVersion { major: number; minor: number; sub1?: number; sub2?: number; } /** * Usage log entry data that is submitted to the ULAS Posting Service. * See also * - [[UlasClient]] * - *UsageLogEntry* entry on [ULAS Swagger](https://qa-connect-ulastm.bentley.com/Bentley.ULAS.SwaggerUI/SwaggerWebApp/?urls.primaryName=ULAS%20Posting%20Service%20v1) * site (section *Models*) * @internal */ export declare class UsageLogEntry { /** The GUID of the context that the usage should be associated with. */ contextId?: GuidString; /** Name of the client machine from which usage is logged */ readonly hostName: string; /** The type of usage that occurred on the client. It is acting as a filter to eliminate records from log processing that * should not count towards a customer’s peak processing. */ readonly usageType: UsageType; /** Timestamp against which the usage is logged. * It is set at construction time of this object. */ readonly timestamp: string; /** Creates a new UsageLogEntry object. * This also sets the timestamp against which the usage will be logged. * @param hostName Name of the client machine from which usage is logged. * @param usageType Usage type (see [[UsageType]]) * @param contextId The GUID of the context that the usage should be associated with. */ constructor(hostName: string, usageType: UsageType, contextId?: GuidString); } /** * Represents arbitrary metadata that can be attached to a * [[FeatureLogEntry]] when collecting information about feature usage. * @internal */ export interface FeatureLogEntryAttribute { name: string; value: any; } /** * Feature log entry data that is submitted to the ULAS Posting Service. * See also * - [[UlasClient]] * - *FeatureLogEntry* entry on [ULAS Swagger](https://qa-connect-ulastm.bentley.com/Bentley.ULAS.SwaggerUI/SwaggerWebApp/?urls.primaryName=ULAS%20Posting%20Service%20v1) * site (section *Models*) * @internal */ export declare class FeatureLogEntry { /** The GUID of the context that the usage should be associated with. */ contextId?: GuidString; /** ID of the feature to log (from the Global Feature Registry). */ readonly featureId: GuidString; /** Additional user-defined metadata for the feature usage. */ usageData: FeatureLogEntryAttribute[]; /** Name of the client machine from which usage is logged. */ readonly hostName: string; /** The type of usage that occurred on the client. It is acting as a filter to eliminate records from log processing that * should not count towards a customer’s peak processing. */ readonly usageType: UsageType; /** Timestamp against which the feature is logged. * It is set at construction time of this object. */ readonly timestamp: string; /** Creates a new FeatureLogEntry object. * This also sets the timestamp against which the feature will be logged. * @param featureId Feature ID from the Global Feature Registry which is being logged. * @param hostName Name of the client machine from which the feature is being logged. * @param usageType Usage type (see [[UsageType]]) * @param contextId The GUID of the context that the usage should be associated with. */ constructor(featureId: GuidString, hostName: string, usageType: UsageType, contextId?: GuidString); } /** * Start point of a duration Feature log entry that is submitted to the ULAS Posting Service. * See also * - [[UlasClient]] * - [[FeatureLogEntry]] * - *FeatureLogEntry* entry on [ULAS Swagger](https://qa-connect-ulastm.bentley.com/Bentley.ULAS.SwaggerUI/SwaggerWebApp/?urls.primaryName=ULAS%20Posting%20Service%20v1) * site (section *Models*) * @internal */ export declare class FeatureStartedLogEntry extends FeatureLogEntry { /** ID of this entry which must be passed to the respective [[FeatureEndedLogEntry]] to * correlate start and end entry. */ readonly entryId: GuidString; /** Creates a new FeatureStartedLogEntry object. * @param featureId Feature ID from the Global Feature Registry which is being logged. * @param hostName Name of the client machine from which the feature is being logged. * @param usageType Usage type (see [[UsageType]]) * @param contextId The GUID of the context that the usage should be associated with. */ constructor(featureId: GuidString, hostName: string, usageType: UsageType, contextId?: GuidString); } /** * End point of a duration Feature log entry that is submitted to the ULAS Posting Service. * See also * - [[UlasClient]] * - [[FeatureStartedLogEntry]] * - *FeatureLogEntry* entry on [ULAS Swagger](https://qa-connect-ulastm.bentley.com/Bentley.ULAS.SwaggerUI/SwaggerWebApp/?urls.primaryName=ULAS%20Posting%20Service%20v1) * site (section *Models*) * @internal */ export declare class FeatureEndedLogEntry extends FeatureLogEntry { readonly startEntryId: GuidString; /** Creates a new FeatureEndedLogEntry object. * @param featureId Feature ID from the Global Feature Registry which is being logged. * @param startEntryId ID of the corresponding [[FeatureStartedLogEntry]] * @param hostName Name of the client machine from which the feature is being logged. * @param usageType Usage type (see [[UsageType]]) * @param contextId The GUID of the context that the usage should be associated with. */ constructor(featureId: GuidString, startEntryId: GuidString, hostName: string, usageType: UsageType, contextId?: GuidString); /** Creates a new FeatureEndedLogEntry from the specified FeatureStartedLogEntry. * @param startEntry Corresponding [[FeatureStartedLogEntry]] * @return Corresponding FeatureEndedLogEntry. */ static fromStartEntry(startEntry: FeatureStartedLogEntry): FeatureEndedLogEntry; } /** * Response from posting a [[UsageLogEntry]] or [[FeatureLogEntry]] with the [[UlasClient]]. * See also *LogPostingResponse* entry on [ULAS Swagger](https://qa-connect-ulastm.bentley.com/Bentley.ULAS.SwaggerUI/SwaggerWebApp/?urls.primaryName=ULAS%20Posting%20Service%20v1) * site (section *Models*) * @internal */ export interface LogPostingResponse { status: BentleyStatus; message: string; time: number; requestId: GuidString; } /** * Client for the Bentley Usage Logging & Analysis Services (ULAS). * See also the two `POST` requests on [ULAS Swagger](https://qa-connect-ulastm.bentley.com/Bentley.ULAS.SwaggerUI/SwaggerWebApp/?urls.primaryName=ULAS%20Posting%20Service%20v1) * @deprecated Use [[UlasUtilities]] instead. * @internal */ export declare class UlasClient extends Client { private static readonly _buddiSearchKey; private static readonly _configRelyingPartyUri; private static readonly _configDefaultRelyingPartyUri; /** Creates an instance of UlasClient. */ constructor(); /** * Gets name/key to query the service URLs from the URL Discovery Service ("Buddi") * @returns Search key for the URL. */ protected getUrlSearchKey(): string; protected setupOptionDefaults(options: RequestOptions): Promise; /** * Gets theRelyingPartyUrl for the service. * @returns RelyingPartyUrl for the service. */ private getRelyingPartyUrl; /** * Gets the (delegation) access token to access the service * @param requestContext The client request context. * @param authTokenInfo Access token. * @returns Resolves to the (delegation) access token. * @internal */ getAccessToken(requestContext: ClientRequestContext, authorizationToken: AuthorizationToken): Promise; /** * Logs usage via the ULAS service * @param requestContext The client request context. * @param hostName The client host name. * @param usageType The client usage type * @deprecated Use [[UlasUtilities]] instead. * @returns Response from the service. */ logUsage(requestContext: AuthorizedClientRequestContext, entry: UsageLogEntry): Promise; /** * Logs one ore more feature entries via the ULAS service * @param requestContext The client request context. * @param entries One or more feature log entries. * @deprecated Use [[UlasUtilities]] instead. * @returns Response from the service. */ logFeature(requestContext: AuthorizedClientRequestContext, ...entries: FeatureLogEntry[]): Promise; private logEntry; } //# sourceMappingURL=UlasClient.d.ts.map