UNPKG

4.31 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.AnalyticsScanConsistency = exports.AnalyticsMetrics = exports.AnalyticsWarning = exports.AnalyticsMetaData = exports.AnalyticsResult = exports.AnalyticsStatus = void 0;
4/**
5 * Represents the status of an analytics query.
6 *
7 * @category Analytics
8 */
9var AnalyticsStatus;
10(function (AnalyticsStatus) {
11 /**
12 * Indicates the query is still running.
13 */
14 AnalyticsStatus["Running"] = "running";
15 /**
16 * Indicates that the query completed successfully.
17 */
18 AnalyticsStatus["Success"] = "success";
19 /**
20 * Indicates that the query completed with errors.
21 */
22 AnalyticsStatus["Errors"] = "errors";
23 /**
24 * Indicates that the query completed but the outcome was unknown.
25 */
26 AnalyticsStatus["Completed"] = "completed";
27 /**
28 * Indicates that the query was stopped.
29 */
30 AnalyticsStatus["Stopped"] = "stopped";
31 /**
32 * Indicates that the query timed out during execution.
33 */
34 AnalyticsStatus["Timeout"] = "timeout";
35 /**
36 * Indicates that a connection was closed during execution of the query.
37 */
38 AnalyticsStatus["Closed"] = "closed";
39 /**
40 * Indicates that the query stopped with fatal errors.
41 */
42 AnalyticsStatus["Fatal"] = "fatal";
43 /**
44 * Indicates that the query was aborted while executing.
45 */
46 AnalyticsStatus["Aborted"] = "aborted";
47 /**
48 * Indicates that the status of the query is unknown.
49 */
50 AnalyticsStatus["Unknown"] = "unknown";
51})(AnalyticsStatus || (exports.AnalyticsStatus = AnalyticsStatus = {}));
52/**
53 * Contains the results of an analytics query.
54 *
55 * @category Analytics
56 */
57class AnalyticsResult {
58 /**
59 * @internal
60 */
61 constructor(data) {
62 this.rows = data.rows;
63 this.meta = data.meta;
64 }
65}
66exports.AnalyticsResult = AnalyticsResult;
67/**
68 * Contains the meta-data that is returend from an analytics query.
69 *
70 * @category Analytics
71 */
72class AnalyticsMetaData {
73 /**
74 * @internal
75 */
76 constructor(data) {
77 this.requestId = data.requestId;
78 this.clientContextId = data.clientContextId;
79 this.status = data.status;
80 this.signature = data.signature;
81 this.warnings = data.warnings;
82 this.metrics = data.metrics;
83 }
84}
85exports.AnalyticsMetaData = AnalyticsMetaData;
86/**
87 * Contains information about a warning which occurred during the
88 * execution of an analytics query.
89 *
90 * @category Analytics
91 */
92class AnalyticsWarning {
93 /**
94 * @internal
95 */
96 constructor(data) {
97 this.code = data.code;
98 this.message = data.message;
99 }
100}
101exports.AnalyticsWarning = AnalyticsWarning;
102/**
103 * Contains various metrics that are returned by the server following
104 * the execution of an analytics query.
105 *
106 * @category Analytics
107 */
108class AnalyticsMetrics {
109 /**
110 * @internal
111 */
112 constructor(data) {
113 this.elapsedTime = data.elapsedTime;
114 this.executionTime = data.executionTime;
115 this.resultCount = data.resultCount;
116 this.resultSize = data.resultSize;
117 this.errorCount = data.errorCount;
118 this.processedObjects = data.processedObjects;
119 this.warningCount = data.warningCount;
120 }
121}
122exports.AnalyticsMetrics = AnalyticsMetrics;
123/**
124 * Represents the various scan consistency options that are available when
125 * querying against the analytics service.
126 *
127 * @category Analytics
128 */
129var AnalyticsScanConsistency;
130(function (AnalyticsScanConsistency) {
131 /**
132 * Indicates that no specific consistency is required, this is the fastest
133 * options, but results may not include the most recent operations which have
134 * been performed.
135 */
136 AnalyticsScanConsistency["NotBounded"] = "not_bounded";
137 /**
138 * Indicates that the results to the query should include all operations that
139 * have occurred up until the query was started. This incurs a performance
140 * penalty of waiting for the index to catch up to the most recent operations,
141 * but provides the highest level of consistency.
142 */
143 AnalyticsScanConsistency["RequestPlus"] = "request_plus";
144})(AnalyticsScanConsistency || (exports.AnalyticsScanConsistency = AnalyticsScanConsistency = {}));