UNPKG

@azure/cosmos

Version:
79 lines (78 loc) 2.36 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var statusCodes_exports = {}; __export(statusCodes_exports, { StatusCodes: () => StatusCodes, SubStatusCodes: () => SubStatusCodes }); module.exports = __toCommonJS(statusCodes_exports); const StatusCodes = { // Success Ok: 200, Created: 201, Accepted: 202, NoContent: 204, MultiStatus: 207, NotModified: 304, // Client error BadRequest: 400, Unauthorized: 401, Forbidden: 403, NotFound: 404, MethodNotAllowed: 405, RequestTimeout: 408, Conflict: 409, Gone: 410, PreconditionFailed: 412, RequestEntityTooLarge: 413, FailedDependency: 424, TooManyRequests: 429, RetryWith: 449, // Server Error InternalServerError: 500, ServiceUnavailable: 503, // System codes ENOTFOUND: "ENOTFOUND", // Operation pause and cancel. These are FAKE status codes for QOS logging purpose only. OperationPaused: 1200, OperationCancelled: 1201 }; const SubStatusCodes = { Unknown: 0, // 400: Bad Request Substatus CrossPartitionQueryNotServable: 1004, IncorrectContainerRidSubstatus: 1024, PartitionKeyMismatch: 1001, // 410: StatusCodeType_Gone: substatus PartitionKeyRangeGone: 1002, CompletingSplit: 1007, CompletingPartitionMigration: 1008, NameCacheIsStale: 1e3, // 404: NotFound Substatus ReadSessionNotAvailable: 1002, // 403: Forbidden Substatus WriteForbidden: 3, DatabaseAccountNotFound: 1008, // 413: Request Entity Too Large Substatus ResponseSizeExceeded: 3402 }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { StatusCodes, SubStatusCodes });