@@ -36,6 +36,7 @@ const JWT_REGEX = /^[a-zA-Z0-9\-_=]+?\.[a-zA-Z0-9\-_=]+?\.([a-zA-Z0-9\-_=]+)?$/;
3636
3737/** @hidden */
3838export interface Request extends express . Request {
39+ /** The wire format representation of the request body. */
3940 rawBody : Buffer ;
4041}
4142
@@ -176,37 +177,53 @@ export interface CallableRequest<T = any> {
176177 * https://github.com/grpc/grpc/blob/master/doc/statuscodes.md
177178 *
178179 * Possible values:
179- * - 'cancelled': The operation was cancelled (typically by the caller).
180- * - 'unknown': Unknown error or an error from a different error domain.
181- * - 'invalid-argument': Client specified an invalid argument. Note that this
182- * differs from 'failed-precondition'. 'invalid-argument' indicates
180+ *
181+ * - `cancelled`: The operation was cancelled (typically by the caller).
182+ *
183+ * - `unknown`: Unknown error or an error from a different error domain.
184+ *
185+ * - `invalid-argument`: Client specified an invalid argument. Note that this
186+ * differs from `failed-precondition`. `invalid-argument` indicates
183187 * arguments that are problematic regardless of the state of the system
184188 * (e.g. an invalid field name).
185- * - 'deadline-exceeded': Deadline expired before operation could complete.
189+ *
190+ * - `deadline-exceeded`: Deadline expired before operation could complete.
186191 * For operations that change the state of the system, this error may be
187192 * returned even if the operation has completed successfully. For example,
188193 * a successful response from a server could have been delayed long enough
189194 * for the deadline to expire.
190- * - 'not-found': Some requested document was not found.
191- * - 'already-exists': Some document that we attempted to create already
195+ *
196+ * - `not-found`: Some requested document was not found.
197+ *
198+ * - `already-exists`: Some document that we attempted to create already
192199 * exists.
193- * - 'permission-denied': The caller does not have permission to execute the
200+ *
201+ * - `permission-denied`: The caller does not have permission to execute the
194202 * specified operation.
195- * - 'resource-exhausted': Some resource has been exhausted, perhaps a
203+ *
204+ * - `resource-exhausted`: Some resource has been exhausted, perhaps a
196205 * per-user quota, or perhaps the entire file system is out of space.
197- * - 'failed-precondition': Operation was rejected because the system is not
206+ *
207+ * - `failed-precondition`: Operation was rejected because the system is not
198208 * in a state required for the operation's execution.
199- * - 'aborted': The operation was aborted, typically due to a concurrency
209+ *
210+ * - `aborted`: The operation was aborted, typically due to a concurrency
200211 * issue like transaction aborts, etc.
201- * - 'out-of-range': Operation was attempted past the valid range.
202- * - 'unimplemented': Operation is not implemented or not supported/enabled.
203- * - 'internal': Internal errors. Means some invariants expected by
212+ *
213+ * - `out-of-range`: Operation was attempted past the valid range.
214+ *
215+ * - `unimplemented`: Operation is not implemented or not supported/enabled.
216+ *
217+ * - `internal`: Internal errors. Means some invariants expected by
204218 * underlying system has been broken. If you see one of these errors,
205219 * something is very broken.
206- * - 'unavailable': The service is currently unavailable. This is most likely
220+ *
221+ * - `unavailable`: The service is currently unavailable. This is most likely
207222 * a transient condition and may be corrected by retrying with a backoff.
208- * - 'data-loss': Unrecoverable data loss or corruption.
209- * - 'unauthenticated': The request does not have valid authentication
223+ *
224+ * - `data-loss`: Unrecoverable data loss or corruption.
225+ *
226+ * - `unauthenticated`: The request does not have valid authentication
210227 * credentials for the operation.
211228 */
212229export type FunctionsErrorCode =
@@ -326,6 +343,9 @@ export class HttpsError extends Error {
326343 this . httpErrorCode = errorCodeMap [ code ] ;
327344 }
328345
346+ /**
347+ * Returns a JSON-serializable representation of this object.
348+ */
329349 public toJSON ( ) : HttpErrorWireFormat {
330350 const {
331351 details,
0 commit comments