@itwin/core-common
Version:
iTwin.js components common to frontend and backend
107 lines • 6.15 kB
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module RpcInterface
*/
/* eslint-disable @typescript-eslint/no-deprecated */
/** Describes available options for RPC response caching.
* @public
*/
export var RpcResponseCacheControl;
(function (RpcResponseCacheControl) {
RpcResponseCacheControl[RpcResponseCacheControl["None"] = 0] = "None";
RpcResponseCacheControl[RpcResponseCacheControl["Immutable"] = 1] = "Immutable";
})(RpcResponseCacheControl || (RpcResponseCacheControl = {}));
/** RPC protocol event types.
* @public
* @deprecated in 3.6 - might be removed in next major version. The RPC system will be significantly refactored (or replaced) in the future.
*/
export var RpcProtocolEvent;
(function (RpcProtocolEvent) {
RpcProtocolEvent[RpcProtocolEvent["RequestCreated"] = 0] = "RequestCreated";
RpcProtocolEvent[RpcProtocolEvent["ResponseLoaded"] = 1] = "ResponseLoaded";
RpcProtocolEvent[RpcProtocolEvent["ResponseLoading"] = 2] = "ResponseLoading";
RpcProtocolEvent[RpcProtocolEvent["ConnectionErrorReceived"] = 3] = "ConnectionErrorReceived";
RpcProtocolEvent[RpcProtocolEvent["UnknownErrorReceived"] = 4] = "UnknownErrorReceived";
RpcProtocolEvent[RpcProtocolEvent["BackendErrorReceived"] = 5] = "BackendErrorReceived";
RpcProtocolEvent[RpcProtocolEvent["ConnectionAborted"] = 6] = "ConnectionAborted";
RpcProtocolEvent[RpcProtocolEvent["RequestReceived"] = 7] = "RequestReceived";
RpcProtocolEvent[RpcProtocolEvent["BackendResponseCreated"] = 8] = "BackendResponseCreated";
RpcProtocolEvent[RpcProtocolEvent["BackendReportedPending"] = 9] = "BackendReportedPending";
RpcProtocolEvent[RpcProtocolEvent["BackendReportedNotFound"] = 10] = "BackendReportedNotFound";
RpcProtocolEvent[RpcProtocolEvent["BackendErrorOccurred"] = 11] = "BackendErrorOccurred";
RpcProtocolEvent[RpcProtocolEvent["BackendReportedNoContent"] = 12] = "BackendReportedNoContent";
})(RpcProtocolEvent || (RpcProtocolEvent = {}));
/** The status of an RPC operation request.
* @public
* @deprecated in 3.6 - might be removed in next major version. The RPC system will be significantly refactored (or replaced) in the future.
*/
export var RpcRequestStatus;
(function (RpcRequestStatus) {
RpcRequestStatus[RpcRequestStatus["Unknown"] = 0] = "Unknown";
RpcRequestStatus[RpcRequestStatus["Created"] = 1] = "Created";
RpcRequestStatus[RpcRequestStatus["Submitted"] = 2] = "Submitted";
RpcRequestStatus[RpcRequestStatus["Pending"] = 3] = "Pending";
RpcRequestStatus[RpcRequestStatus["Resolved"] = 4] = "Resolved";
RpcRequestStatus[RpcRequestStatus["Rejected"] = 5] = "Rejected";
RpcRequestStatus[RpcRequestStatus["Disposed"] = 6] = "Disposed";
RpcRequestStatus[RpcRequestStatus["NotFound"] = 7] = "NotFound";
RpcRequestStatus[RpcRequestStatus["Cancelled"] = 8] = "Cancelled";
RpcRequestStatus[RpcRequestStatus["NoContent"] = 9] = "NoContent";
RpcRequestStatus[RpcRequestStatus["BadGateway"] = 10] = "BadGateway";
RpcRequestStatus[RpcRequestStatus["ServiceUnavailable"] = 11] = "ServiceUnavailable";
RpcRequestStatus[RpcRequestStatus["GatewayTimeout"] = 12] = "GatewayTimeout";
RpcRequestStatus[RpcRequestStatus["RequestTimeout"] = 13] = "RequestTimeout";
RpcRequestStatus[RpcRequestStatus["TooManyRequests"] = 14] = "TooManyRequests";
})(RpcRequestStatus || (RpcRequestStatus = {}));
/** @public @deprecated in 3.6 - might be removed in next major version. The RPC system will be significantly refactored (or replaced) in the future. */
(function (RpcRequestStatus) {
function isTransientError(status) {
return status === RpcRequestStatus.BadGateway || status === RpcRequestStatus.ServiceUnavailable || status === RpcRequestStatus.GatewayTimeout
|| status === RpcRequestStatus.RequestTimeout || status === RpcRequestStatus.TooManyRequests;
}
RpcRequestStatus.isTransientError = isTransientError;
})(RpcRequestStatus || (RpcRequestStatus = {}));
/** RPC request event types.
* @public
* @deprecated in 3.6 - might be removed in next major version. The RPC system will be significantly refactored (or replaced) in the future.
*/
export var RpcRequestEvent;
(function (RpcRequestEvent) {
RpcRequestEvent[RpcRequestEvent["StatusChanged"] = 0] = "StatusChanged";
RpcRequestEvent[RpcRequestEvent["PendingUpdateReceived"] = 1] = "PendingUpdateReceived";
RpcRequestEvent[RpcRequestEvent["TransientErrorReceived"] = 2] = "TransientErrorReceived";
})(RpcRequestEvent || (RpcRequestEvent = {}));
/** RPC content types.
* @public
* @deprecated in 3.6 - might be removed in next major version. The RPC system will be significantly refactored (or replaced) in the future.
*/
export var RpcContentType;
(function (RpcContentType) {
RpcContentType[RpcContentType["Unknown"] = 0] = "Unknown";
RpcContentType[RpcContentType["Text"] = 1] = "Text";
RpcContentType[RpcContentType["Binary"] = 2] = "Binary";
RpcContentType[RpcContentType["Multipart"] = 3] = "Multipart";
RpcContentType[RpcContentType["Stream"] = 4] = "Stream";
})(RpcContentType || (RpcContentType = {}));
/** Endpoints for RPC protocols.
* @public
* @deprecated in 3.6 - might be removed in next major version. The RPC system will be significantly refactored (or replaced) in the future.
*/
export var RpcEndpoint;
(function (RpcEndpoint) {
RpcEndpoint[RpcEndpoint["Frontend"] = 0] = "Frontend";
RpcEndpoint[RpcEndpoint["Backend"] = 1] = "Backend";
})(RpcEndpoint || (RpcEndpoint = {}));
/* eslint-disable @typescript-eslint/naming-convention */
/** @internal */
export const WEB_RPC_CONSTANTS = {
CONTENT: "Content-Type",
TEXT: "text/plain",
ANY_TEXT: "text/",
BINARY: "application/octet-stream",
MULTIPART: "multipart/form-data",
};
//# sourceMappingURL=RpcConstants.js.map