UNPKG

3.42 kBSource Map (JSON)View Raw
1{"version":3,"file":"ChangeFeedResponse.js","sourceRoot":"","sources":["../../src/ChangeFeedResponse.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAC7B;;OAEG;IACH;IACE;;OAEG;IACa,MAAS;IACzB;;OAEG;IACa,KAAa;IAC7B;;OAEG;IACa,UAAkB,EAClC,OAAsB;QATN,WAAM,GAAN,MAAM,CAAG;QAIT,UAAK,GAAL,KAAK,CAAQ;QAIb,eAAU,GAAV,UAAU,CAAQ;QAGlC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAC9D,OAAO,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACxD,CAAC;IAED;;;;OAIG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;OAQG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;CAMF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { Constants } from \"./common\";\nimport { CosmosHeaders } from \"./queryExecutionContext\";\n\n/**\n * A single response page from the Azure Cosmos DB Change Feed\n */\nexport class ChangeFeedResponse<T> {\n /**\n * @internal\n */\n constructor(\n /**\n * Gets the items returned in the response from Azure Cosmos DB\n */\n public readonly result: T,\n /**\n * Gets the number of items returned in the response from Azure Cosmos DB\n */\n public readonly count: number,\n /**\n * Gets the status code of the response from Azure Cosmos DB\n */\n public readonly statusCode: number,\n headers: CosmosHeaders\n ) {\n this.headers = Object.freeze(headers);\n }\n\n /**\n * Gets the request charge for this request from the Azure Cosmos DB service.\n */\n public get requestCharge(): number {\n const rus = this.headers[Constants.HttpHeaders.RequestCharge];\n return rus ? parseInt(rus, 10) : null;\n }\n\n /**\n * Gets the activity ID for the request from the Azure Cosmos DB service.\n */\n public get activityId(): string {\n return this.headers[Constants.HttpHeaders.ActivityId];\n }\n\n /**\n * Gets the continuation token to be used for continuing enumeration of the Azure Cosmos DB service.\n *\n * This is equivalent to the `etag` property.\n */\n public get continuation(): string {\n return this.etag;\n }\n\n /**\n * Gets the session token for use in session consistency reads from the Azure Cosmos DB service.\n */\n public get sessionToken(): string {\n return this.headers[Constants.HttpHeaders.SessionToken];\n }\n\n /**\n * Gets the entity tag associated with last transaction in the Azure Cosmos DB service,\n * which can be used as If-Non-Match Access condition for ReadFeed REST request or\n * `continuation` property of `ChangeFeedOptions` parameter for\n * `Items.changeFeed()`\n * to get feed changes since the transaction specified by this entity tag.\n *\n * This is equivalent to the `continuation` property.\n */\n public get etag(): string {\n return this.headers[Constants.HttpHeaders.ETag];\n }\n\n /**\n * Response headers of the response from Azure Cosmos DB\n */\n public headers: CosmosHeaders;\n}\n"]}
\No newline at end of file