@azure/cosmos
Version:
Microsoft Azure Cosmos DB Service Node.js SDK for NOSQL API
83 lines (82 loc) • 2.87 kB
JavaScript
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 ChangeFeedResponse_exports = {};
__export(ChangeFeedResponse_exports, {
ChangeFeedResponse: () => ChangeFeedResponse
});
module.exports = __toCommonJS(ChangeFeedResponse_exports);
var import_common = require("./common/index.js");
class ChangeFeedResponse {
/**
* @internal
*/
constructor(result, count, statusCode, headers, diagnostics) {
this.result = result;
this.count = count;
this.statusCode = statusCode;
this.diagnostics = diagnostics;
this.headers = Object.freeze(headers);
}
/**
* Gets the request charge for this request from the Azure Cosmos DB service.
*/
get requestCharge() {
const rus = this.headers[import_common.Constants.HttpHeaders.RequestCharge];
return rus ? parseInt(rus, 10) : null;
}
/**
* Gets the activity ID for the request from the Azure Cosmos DB service.
*/
get activityId() {
return this.headers[import_common.Constants.HttpHeaders.ActivityId];
}
/**
* Gets the continuation token to be used for continuing enumeration of the Azure Cosmos DB service.
*
* This is equivalent to the `etag` property.
*/
get continuation() {
return this.etag;
}
/**
* Gets the session token for use in session consistency reads from the Azure Cosmos DB service.
*/
get sessionToken() {
return this.headers[import_common.Constants.HttpHeaders.SessionToken];
}
/**
* Gets the entity tag associated with last transaction in the Azure Cosmos DB service,
* which can be used as If-Non-Match Access condition for ReadFeed REST request or
* `continuation` property of `ChangeFeedOptions` parameter for
* `Items.changeFeed()`
* to get feed changes since the transaction specified by this entity tag.
*
* This is equivalent to the `continuation` property.
*/
get etag() {
return this.headers[import_common.Constants.HttpHeaders.ETag];
}
/**
* Response headers of the response from Azure Cosmos DB
*/
headers;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ChangeFeedResponse
});