UNPKG

8.83 kBJavaScriptView Raw
1"use strict";
2/**
3 * Copyright 2018, OpenCensus Authors
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17Object.defineProperty(exports, "__esModule", { value: true });
18exports.LinkType = exports.SpanKind = exports.MessageEventType = exports.CanonicalCode = void 0;
19/** An enumeration of canonical status codes. */
20var CanonicalCode;
21(function (CanonicalCode) {
22 /**
23 * Not an error; returned on success
24 */
25 CanonicalCode[CanonicalCode["OK"] = 0] = "OK";
26 /**
27 * The operation was cancelled (typically by the caller).
28 */
29 CanonicalCode[CanonicalCode["CANCELLED"] = 1] = "CANCELLED";
30 /**
31 * Unknown error. An example of where this error may be returned is
32 * if a status value received from another address space belongs to
33 * an error-space that is not known in this address space. Also
34 * errors raised by APIs that do not return enough error information
35 * may be converted to this error.
36 */
37 CanonicalCode[CanonicalCode["UNKNOWN"] = 2] = "UNKNOWN";
38 /**
39 * Client specified an invalid argument. Note that this differs
40 * from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments
41 * that are problematic regardless of the state of the system
42 * (e.g., a malformed file name).
43 */
44 CanonicalCode[CanonicalCode["INVALID_ARGUMENT"] = 3] = "INVALID_ARGUMENT";
45 /**
46 * Deadline expired before operation could complete. For operations
47 * that change the state of the system, this error may be returned
48 * even if the operation has completed successfully. For example, a
49 * successful response from a server could have been delayed long
50 * enough for the deadline to expire.
51 */
52 CanonicalCode[CanonicalCode["DEADLINE_EXCEEDED"] = 4] = "DEADLINE_EXCEEDED";
53 /**
54 * Some requested entity (e.g., file or directory) was not found.
55 */
56 CanonicalCode[CanonicalCode["NOT_FOUND"] = 5] = "NOT_FOUND";
57 /**
58 * Some entity that we attempted to create (e.g., file or directory)
59 * already exists.
60 */
61 CanonicalCode[CanonicalCode["ALREADY_EXISTS"] = 6] = "ALREADY_EXISTS";
62 /**
63 * The caller does not have permission to execute the specified
64 * operation. PERMISSION_DENIED must not be used for rejections
65 * caused by exhausting some resource (use RESOURCE_EXHAUSTED
66 * instead for those errors). PERMISSION_DENIED must not be
67 * used if the caller can not be identified (use UNAUTHENTICATED
68 * instead for those errors).
69 */
70 CanonicalCode[CanonicalCode["PERMISSION_DENIED"] = 7] = "PERMISSION_DENIED";
71 /**
72 * Some resource has been exhausted, perhaps a per-user quota, or
73 * perhaps the entire file system is out of space.
74 */
75 CanonicalCode[CanonicalCode["RESOURCE_EXHAUSTED"] = 8] = "RESOURCE_EXHAUSTED";
76 /**
77 * Operation was rejected because the system is not in a state
78 * required for the operation's execution. For example, directory
79 * to be deleted may be non-empty, an rmdir operation is applied to
80 * a non-directory, etc.
81 *
82 * A litmus test that may help a service implementor in deciding
83 * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:
84 *
85 * - Use UNAVAILABLE if the client can retry just the failing call.
86 * - Use ABORTED if the client should retry at a higher-level
87 * (e.g., restarting a read-modify-write sequence).
88 * - Use FAILED_PRECONDITION if the client should not retry until
89 * the system state has been explicitly fixed. E.g., if an "rmdir"
90 * fails because the directory is non-empty, FAILED_PRECONDITION
91 * should be returned since the client should not retry unless
92 * they have first fixed up the directory by deleting files from it.
93 * - Use FAILED_PRECONDITION if the client performs conditional
94 * REST Get/Update/Delete on a resource and the resource on the
95 * server does not match the condition. E.g., conflicting
96 * read-modify-write on the same resource.
97 */
98 CanonicalCode[CanonicalCode["FAILED_PRECONDITION"] = 9] = "FAILED_PRECONDITION";
99 /**
100 * The operation was aborted, typically due to a concurrency issue
101 * like sequencer check failures, transaction aborts, etc.
102 *
103 * See litmus test above for deciding between FAILED_PRECONDITION,
104 * ABORTED, and UNAVAILABLE.
105 */
106 CanonicalCode[CanonicalCode["ABORTED"] = 10] = "ABORTED";
107 /**
108 * Operation was attempted past the valid range. E.g., seeking or
109 * reading past end of file.
110 *
111 * Unlike INVALID_ARGUMENT, this error indicates a problem that may
112 * be fixed if the system state changes. For example, a 32-bit file
113 * system will generate INVALID_ARGUMENT if asked to read at an
114 * offset that is not in the range [0,2^32-1], but it will generate
115 * OUT_OF_RANGE if asked to read from an offset past the current
116 * file size.
117 *
118 * There is a fair bit of overlap between FAILED_PRECONDITION and
119 * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific
120 * error) when it applies so that callers who are iterating through
121 * a space can easily look for an OUT_OF_RANGE error to detect when
122 * they are done.
123 */
124 CanonicalCode[CanonicalCode["OUT_OF_RANGE"] = 11] = "OUT_OF_RANGE";
125 /**
126 * Operation is not implemented or not supported/enabled in this service.
127 */
128 CanonicalCode[CanonicalCode["UNIMPLEMENTED"] = 12] = "UNIMPLEMENTED";
129 /**
130 * Internal errors. Means some invariants expected by underlying
131 * system has been broken. If you see one of these errors,
132 * something is very broken.
133 */
134 CanonicalCode[CanonicalCode["INTERNAL"] = 13] = "INTERNAL";
135 /**
136 * The service is currently unavailable. This is a most likely a
137 * transient condition and may be corrected by retrying with
138 * a backoff.
139 *
140 * See litmus test above for deciding between FAILED_PRECONDITION,
141 * ABORTED, and UNAVAILABLE.
142 */
143 CanonicalCode[CanonicalCode["UNAVAILABLE"] = 14] = "UNAVAILABLE";
144 /**
145 * Unrecoverable data loss or corruption.
146 */
147 CanonicalCode[CanonicalCode["DATA_LOSS"] = 15] = "DATA_LOSS";
148 /**
149 * The request does not have valid authentication credentials for the
150 * operation.
151 */
152 CanonicalCode[CanonicalCode["UNAUTHENTICATED"] = 16] = "UNAUTHENTICATED";
153})(CanonicalCode = exports.CanonicalCode || (exports.CanonicalCode = {}));
154/** An event describing a message sent/received between Spans. */
155var MessageEventType;
156(function (MessageEventType) {
157 /** Unknown event type. */
158 MessageEventType[MessageEventType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
159 /** Indicates a sent message. */
160 MessageEventType[MessageEventType["SENT"] = 1] = "SENT";
161 /** Indicates a received message. */
162 MessageEventType[MessageEventType["RECEIVED"] = 2] = "RECEIVED";
163})(MessageEventType = exports.MessageEventType || (exports.MessageEventType = {}));
164/**
165 * Type of span. Can be used to specify additional relationships between spans
166 * in addition to a parent/child relationship.
167 */
168var SpanKind;
169(function (SpanKind) {
170 /** Unspecified */
171 SpanKind[SpanKind["UNSPECIFIED"] = 0] = "UNSPECIFIED";
172 /**
173 * Indicates that the span covers server-side handling of an RPC or other
174 * remote network request.
175 */
176 SpanKind[SpanKind["SERVER"] = 1] = "SERVER";
177 /**
178 * Indicates that the span covers the client-side wrapper around an RPC or
179 * other remote request.
180 */
181 SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT";
182})(SpanKind = exports.SpanKind || (exports.SpanKind = {}));
183/**
184 * Type of link. The relationship of the current span relative to the linked
185 * span.
186 */
187var LinkType;
188(function (LinkType) {
189 /**
190 * The relationship of the two spans is unknown, or known but other
191 * than parent-child.
192 */
193 LinkType[LinkType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
194 /** The linked span is a child of the current span. */
195 LinkType[LinkType["CHILD_LINKED_SPAN"] = 1] = "CHILD_LINKED_SPAN";
196 /** The linked span is a parent of the current span. */
197 LinkType[LinkType["PARENT_LINKED_SPAN"] = 2] = "PARENT_LINKED_SPAN";
198})(LinkType = exports.LinkType || (exports.LinkType = {}));
199//# sourceMappingURL=types.js.map
\No newline at end of file