@ethlete/query 5.28.0 → 5.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { HttpStatusCode } from '../request';
1
+ import { HttpStatusCode } from '@angular/common/http';
2
2
  export interface ClassValidatorError {
3
3
  statusCode: HttpStatusCode;
4
4
  message: string[];
@@ -1,8 +1,9 @@
1
- import { HttpClient, HttpContext, HttpErrorResponse, HttpEvent } from '@angular/common/http';
1
+ import { HttpClient, HttpContext, HttpEvent } from '@angular/common/http';
2
2
  import { Signal } from '@angular/core';
3
3
  import { QueryArgs, RequestArgs, ResponseType } from './query';
4
4
  import { CacheAdapterFn } from './query-client-config';
5
5
  import { QueryMethod } from './query-creator';
6
+ import { QueryErrorResponse } from './query-error-response';
6
7
  import { ShouldRetryRequestFn } from './query-utils';
7
8
  export declare const SPEED_BUFFER_TIME_IN_MS = 2000;
8
9
  export type HttpRequestTransferCacheConfig = boolean | {
@@ -99,7 +100,7 @@ export type HttpRequest<TArgs extends QueryArgs> = {
99
100
  /** The loading state of the request */
100
101
  loading: Signal<HttpRequestLoadingState | null>;
101
102
  /** The error state of the request */
102
- error: Signal<HttpErrorResponse | null>;
103
+ error: Signal<QueryErrorResponse | null>;
103
104
  /** The response state of the request */
104
105
  response: Signal<ResponseType<TArgs> | null>;
105
106
  /** The current event of the request */
@@ -110,6 +111,6 @@ export type HttpRequest<TArgs extends QueryArgs> = {
110
111
  /** A custom error event since the Angular http client does not provide a specific event for errors */
111
112
  export type HttpErrorEvent = {
112
113
  type: 'error';
113
- error: HttpErrorResponse;
114
+ error: QueryErrorResponse;
114
115
  };
115
116
  export declare const createHttpRequest: <TArgs extends QueryArgs>(options: CreateHttpRequestOptions<TArgs>) => HttpRequest<TArgs>;
@@ -1,8 +1,8 @@
1
- import { HttpErrorResponse } from '@angular/common/http';
2
1
  import { Signal } from '@angular/core';
3
2
  import { ContentfulGqlLikePaginated, DynLikePaginated, GgLikePaginated, NormalizedPagination, Paginated } from '@ethlete/types';
4
3
  import { AnyQuery, Query, QueryArgs, RequestArgs, ResponseType } from './query';
5
4
  import { AnyQueryCreator, QueryArgsOf, QueryCreator } from './query-creator';
5
+ import { QueryErrorResponse } from './query-error-response';
6
6
  import { QueryFeature } from './query-features';
7
7
  export declare const ethletePaginationAdapter: <T>(response: Paginated<T>) => NormalizedPagination<T>;
8
8
  export declare const ggLikePaginationAdapter: <T>(response: GgLikePaginated<T>) => NormalizedPagination<T>;
@@ -126,7 +126,7 @@ export type PagedQueryStack<TQuery extends AnyQuery, TNormPagination extends Nor
126
126
  /**
127
127
  * The error that occurred during the last execution of the paged query.
128
128
  */
129
- error: Signal<HttpErrorResponse | null>;
129
+ error: Signal<QueryErrorResponse | null>;
130
130
  /**
131
131
  * The last query executed in the paged query.
132
132
  */
@@ -0,0 +1,19 @@
1
+ import { HttpErrorResponse, HttpStatusCode } from '@angular/common/http';
2
+ import { ShouldRetryRequestResult } from './query-utils';
3
+ export type QueryErrorResponseList = {
4
+ isList: true;
5
+ errors: QueryErrorResponseItem[];
6
+ };
7
+ export type QueryErrorResponseSingle = {
8
+ isList: false;
9
+ error: QueryErrorResponseItem;
10
+ };
11
+ export type QueryErrorResponse = {
12
+ raw: HttpErrorResponse;
13
+ retryState: ShouldRetryRequestResult;
14
+ code: HttpStatusCode;
15
+ } & (QueryErrorResponseList | QueryErrorResponseSingle);
16
+ export interface QueryErrorResponseItem {
17
+ message: string;
18
+ }
19
+ export declare const createQueryErrorResponse: (error: unknown) => QueryErrorResponse;
@@ -1,7 +1,8 @@
1
- import { HttpErrorResponse, HttpEvent } from '@angular/common/http';
1
+ import { HttpEvent } from '@angular/common/http';
2
2
  import { Signal } from '@angular/core';
3
3
  import { QueryArgs, RequestArgs, ResponseType } from './query';
4
4
  import { QueryDependencies } from './query-dependencies';
5
+ import { QueryErrorResponse } from './query-error-response';
5
6
  import { InternalQueryExecute } from './query-execute';
6
7
  import { QueryState } from './query-state';
7
8
  import { ClearQueryArgs, QueryFeatureFlags } from './query-utils';
@@ -61,7 +62,7 @@ export type WithLoggingFeatureOptions<TArgs extends QueryArgs> = {
61
62
  export declare const withLogging: <TArgs extends QueryArgs>(options: WithLoggingFeatureOptions<TArgs>) => QueryFeature<TArgs>;
62
63
  export type WithErrorHandlingFeatureOptions = {
63
64
  /** A function that will be called with the latest error */
64
- handler: (e: HttpErrorResponse) => void;
65
+ handler: (e: QueryErrorResponse) => void;
65
66
  };
66
67
  /** A query feature that can be used to handle errors */
67
68
  export declare const withErrorHandling: <TArgs extends QueryArgs>(options: WithErrorHandlingFeatureOptions) => QueryFeature<TArgs>;
@@ -1,7 +1,7 @@
1
- import { HttpErrorResponse } from '@angular/common/http';
2
1
  import { Signal } from '@angular/core';
3
2
  import { AnyQuery, RequestArgs, ResponseType } from './query';
4
3
  import { AnyQueryCreator, QueryArgsOf, RunQueryCreator } from './query-creator';
4
+ import { QueryErrorResponse } from './query-error-response';
5
5
  import { QueryFeature } from './query-features';
6
6
  export type QueryStack<TQuery extends AnyQuery, TTransform> = {
7
7
  /** Contains all queries in the stack. */
@@ -11,7 +11,7 @@ export type QueryStack<TQuery extends AnyQuery, TTransform> = {
11
11
  /** True if any query in the stack is loading. */
12
12
  loading: Signal<boolean>;
13
13
  /** Contains the first error that occurred in the stack. */
14
- error: Signal<HttpErrorResponse | null>;
14
+ error: Signal<QueryErrorResponse | null>;
15
15
  /** Contains the responses of all queries in the stack. Will be `null` for queries that are loading or errored. */
16
16
  response: Signal<TTransform>;
17
17
  /** Executes all queries in the stack. */
@@ -1,7 +1,8 @@
1
- import { HttpErrorResponse, HttpEvent } from '@angular/common/http';
1
+ import { HttpEvent } from '@angular/common/http';
2
2
  import { WritableSignal } from '@angular/core';
3
3
  import { HttpRequest, HttpRequestLoadingState } from './http-request';
4
4
  import { QueryArgs, RequestArgs, ResponseType } from './query';
5
+ import { QueryErrorResponse } from './query-error-response';
5
6
  export type SetupQueryStateOptions = {};
6
7
  export type QueryStateSubtle<TArgs extends QueryArgs> = {
7
8
  request: WritableSignal<HttpRequest<TArgs> | null>;
@@ -11,7 +12,7 @@ export type QueryState<TArgs extends QueryArgs> = {
11
12
  args: WritableSignal<RequestArgs<TArgs> | null>;
12
13
  latestHttpEvent: WritableSignal<HttpEvent<ResponseType<TArgs>> | null>;
13
14
  loading: WritableSignal<HttpRequestLoadingState | null>;
14
- error: WritableSignal<HttpErrorResponse | null>;
15
+ error: WritableSignal<QueryErrorResponse | null>;
15
16
  lastTimeExecutedAt: WritableSignal<number | null>;
16
17
  subtle: QueryStateSubtle<TArgs>;
17
18
  };
@@ -1,7 +1,8 @@
1
- import { HttpErrorResponse, HttpEvent, HttpHeaders } from '@angular/common/http';
1
+ import { HttpEvent, HttpHeaders } from '@angular/common/http';
2
2
  import { Signal } from '@angular/core';
3
3
  import { HttpRequestLoadingState } from './http-request';
4
4
  import { CreateQueryCreatorOptions, InternalCreateQueryCreatorOptions, QueryConfig } from './query-creator';
5
+ import { QueryErrorResponse } from './query-error-response';
5
6
  import { QueryExecute } from './query-execute';
6
7
  import { QueryFeature } from './query-features';
7
8
  export type QueryArgs = {
@@ -36,7 +37,7 @@ export type QueryBase<TArgs extends QueryArgs> = {
36
37
  /** The loading state of the query. Will be `null` if the query currently isn't loading. */
37
38
  loading: Signal<HttpRequestLoadingState | null>;
38
39
  /** The error that occurred during the last execution of the query. Will be `null` if no error occurred. */
39
- error: Signal<HttpErrorResponse | null>;
40
+ error: Signal<QueryErrorResponse | null>;
40
41
  /** The time the query was last executed at. Will be `null` if the query has never been executed. */
41
42
  lastTimeExecutedAt: Signal<number | null>;
42
43
  /** The id of the query */
@@ -1,4 +1,5 @@
1
1
  export * from './auth';
2
2
  export * from './gql';
3
3
  export * from './http';
4
+ export * from './pipes';
4
5
  export * from './ws';
@@ -0,0 +1,4 @@
1
+ export * from './parse-http-error-code-de';
2
+ export * from './parse-http-error-code-de.pipe';
3
+ export * from './parse-http-error-code-en';
4
+ export * from './parse-http-error-code-en.pipe';
@@ -0,0 +1,3 @@
1
+ import { HttpStatusCode } from '@angular/common/http';
2
+ export declare const parseHttpErrorCodeToTitleDe: (statusCode: HttpStatusCode) => "Ungültige Anfrage" | "Nicht autorisiert" | "Zahlung erforderlich" | "Verboten" | "Nicht gefunden" | "Methode nicht erlaubt" | "Nicht akzeptabel" | "Proxy-Authentifizierung erforderlich" | "Anforderungszeitüberschreitung" | "Konflikt" | "Weg" | "Länge erforderlich" | "Vorbedingung fehlgeschlagen" | "Nutzlast zu groß" | "URI zu lang" | "Nicht unterstützter Medientyp" | "Bereich nicht zufriedenstellend" | "Erwartung fehlgeschlagen" | "Ich bin eine Teekanne" | "Fehlgeleitete Anfrage" | "Unverarbeitbare Entität" | "Gesperrt" | "Fehlgeschlagene Abhängigkeit" | "Zu früh" | "Upgrade erforderlich" | "Vorbedingung erforderlich" | "Zu viele Anfragen" | "Anforderungskopffelder zu groß" | "Aus rechtlichen Gründen nicht verfügbar" | "Interner Serverfehler" | "Nicht implementiert" | "Schlechtes Gateway" | "Dienst nicht verfügbar" | "Gateway-Zeitüberschreitung" | "HTTP-Version nicht unterstützt" | "Variante verhandelt auch" | "Unzureichender Speicher" | "Schleifenerkennung" | "Nicht erweitert" | "Netzwerkauthentifizierung erforderlich" | "Etwas ist schief gelaufen";
3
+ export declare const parseHttpErrorCodeToMessageDe: (statusCode: HttpStatusCode) => "Entschuldigung, wir konnten Ihre Anfrage nicht bearbeiten. Bitte versuchen Sie es später erneut." | "Sie sind nicht berechtigt, diese Aktion auszuführen. Bitte melden Sie sich an, um fortzufahren." | "Zur Ausführung dieser Aktion ist eine Zahlung erforderlich." | "Sie haben keine Berechtigung, diese Aktion auszuführen." | "Die angeforderte Ressource wurde nicht gefunden." | "Die angeforderte Methode ist für diese Ressource nicht zulässig." | "Die angeforderte Ressource ist nicht in der Lage, eine Antwort zu generieren, die der Liste der akzeptablen Werte entspricht." | "Zur Ausführung dieser Aktion ist eine Proxy-Authentifizierung erforderlich." | "Der Server hat auf die Anforderung gewartet." | "Die Anforderung steht im Widerspruch zum aktuellen Zustand der Ressource." | "Die angeforderte Ressource ist nicht mehr verfügbar und wird auch nicht mehr verfügbar sein." | "Die Anforderung hat die Länge ihres Inhalts nicht angegeben, die von der angeforderten Ressource benötigt wird." | "Der Server erfüllt eine der Voraussetzungen nicht, die der Anforderer an die Anforderung gestellt hat." | "Die Anforderung ist größer als der Server bereit oder in der Lage ist, zu verarbeiten." | "Die bereitgestellte URL war für den Server zu lang, um sie zu verarbeiten." | "Die Anforderungseinheit hat einen Medientyp, den der Server oder die Ressource nicht unterstützt." | "Der Client hat einen Teil der Datei angefordert, aber der Server kann diesen Teil nicht liefern." | "Der Server kann die Anforderungen des Erwartung-Anforderungskopffelds nicht erfüllen." | "Ich bin eine Teekanne." | "Die Anforderung wurde an einen Server gerichtet, der nicht in der Lage ist, eine Antwort zu generieren." | "Die Anforderung war gut formuliert, konnte aber aufgrund semantischer Fehler nicht befolgt werden." | "Die Ressource, auf die zugegriffen wird, ist gesperrt." | "Die Anforderung ist aufgrund eines Fehlers einer vorherigen Anforderung fehlgeschlagen." | "Der Server ist nicht bereit, die Anforderung zu verarbeiten, weil der Benutzer nicht authentifiziert wurde." | "Der Client sollte zu einem anderen Protokoll wie TLS/1.0 wechseln, das im Upgrade-Anforderungskopffeld angegeben ist." | "Der Ursprungsserver erfordert, dass die Anforderung bedingt ist." | "Sie haben in einer bestimmten Zeit zu viele Anfragen gesendet. Bitte versuchen Sie es später erneut." | "Der Server ist nicht bereit, die Anforderung zu verarbeiten, weil seine Kopffelder zu groß sind." | "Die Ressource ist aufgrund einer rechtlichen Forderung nicht verfügbar." | "Etwas ist schief gelaufen. Bitte versuchen Sie es später erneut." | "Der Server unterstützt die zur Erfüllung der Anforderung erforderliche Funktionalität nicht." | "Der Server kann die Anforderung derzeit nicht bearbeiten, da er vorübergehend überlastet oder gewartet wird." | "Der Server hat beim Versuch, die Anforderung abzuschließen, keine rechtzeitige Antwort vom Server erhalten." | "Der Server unterstützt die in der Anforderung verwendete HTTP-Protokollversion nicht." | "Der Server hat einen internen Konfigurationsfehler: Die ausgewählte Variantenressource ist so konfiguriert, dass sie sich selbst in die transparente Inhaltsverhandlung einbindet, und ist daher kein geeigneter Endpunkt im Verhandlungsprozess." | "Die Methode konnte auf die Ressource nicht angewendet werden, weil der Server nicht in der Lage ist, die für die erfolgreiche Ausführung der Anforderung erforderliche Darstellung zu speichern." | "Der Server hat eine Endlosschleife erkannt, während er die Anforderung verarbeitet." | "Weitere Erweiterungen der Anforderung sind erforderlich, damit der Server sie erfüllen kann." | "Sie müssen sich authentifizieren, um Zugang zum Netzwerk zu erhalten." | "Etwas ist schief gelaufen. Überprüfen Sie Ihre Internetverbindung und versuchen Sie es später erneut.";
@@ -0,0 +1,12 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ParseHttpErrorCodeToTitleDePipe implements PipeTransform {
4
+ transform: (statusCode: import("@angular/common/http").HttpStatusCode) => "Ungültige Anfrage" | "Nicht autorisiert" | "Zahlung erforderlich" | "Verboten" | "Nicht gefunden" | "Methode nicht erlaubt" | "Nicht akzeptabel" | "Proxy-Authentifizierung erforderlich" | "Anforderungszeitüberschreitung" | "Konflikt" | "Weg" | "Länge erforderlich" | "Vorbedingung fehlgeschlagen" | "Nutzlast zu groß" | "URI zu lang" | "Nicht unterstützter Medientyp" | "Bereich nicht zufriedenstellend" | "Erwartung fehlgeschlagen" | "Ich bin eine Teekanne" | "Fehlgeleitete Anfrage" | "Unverarbeitbare Entität" | "Gesperrt" | "Fehlgeschlagene Abhängigkeit" | "Zu früh" | "Upgrade erforderlich" | "Vorbedingung erforderlich" | "Zu viele Anfragen" | "Anforderungskopffelder zu groß" | "Aus rechtlichen Gründen nicht verfügbar" | "Interner Serverfehler" | "Nicht implementiert" | "Schlechtes Gateway" | "Dienst nicht verfügbar" | "Gateway-Zeitüberschreitung" | "HTTP-Version nicht unterstützt" | "Variante verhandelt auch" | "Unzureichender Speicher" | "Schleifenerkennung" | "Nicht erweitert" | "Netzwerkauthentifizierung erforderlich" | "Etwas ist schief gelaufen";
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<ParseHttpErrorCodeToTitleDePipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<ParseHttpErrorCodeToTitleDePipe, "parseHttpErrorCodeToTitleDe", true>;
7
+ }
8
+ export declare class ParseHttpErrorCodeToMessageDePipe implements PipeTransform {
9
+ transform: (statusCode: import("@angular/common/http").HttpStatusCode) => "Entschuldigung, wir konnten Ihre Anfrage nicht bearbeiten. Bitte versuchen Sie es später erneut." | "Sie sind nicht berechtigt, diese Aktion auszuführen. Bitte melden Sie sich an, um fortzufahren." | "Zur Ausführung dieser Aktion ist eine Zahlung erforderlich." | "Sie haben keine Berechtigung, diese Aktion auszuführen." | "Die angeforderte Ressource wurde nicht gefunden." | "Die angeforderte Methode ist für diese Ressource nicht zulässig." | "Die angeforderte Ressource ist nicht in der Lage, eine Antwort zu generieren, die der Liste der akzeptablen Werte entspricht." | "Zur Ausführung dieser Aktion ist eine Proxy-Authentifizierung erforderlich." | "Der Server hat auf die Anforderung gewartet." | "Die Anforderung steht im Widerspruch zum aktuellen Zustand der Ressource." | "Die angeforderte Ressource ist nicht mehr verfügbar und wird auch nicht mehr verfügbar sein." | "Die Anforderung hat die Länge ihres Inhalts nicht angegeben, die von der angeforderten Ressource benötigt wird." | "Der Server erfüllt eine der Voraussetzungen nicht, die der Anforderer an die Anforderung gestellt hat." | "Die Anforderung ist größer als der Server bereit oder in der Lage ist, zu verarbeiten." | "Die bereitgestellte URL war für den Server zu lang, um sie zu verarbeiten." | "Die Anforderungseinheit hat einen Medientyp, den der Server oder die Ressource nicht unterstützt." | "Der Client hat einen Teil der Datei angefordert, aber der Server kann diesen Teil nicht liefern." | "Der Server kann die Anforderungen des Erwartung-Anforderungskopffelds nicht erfüllen." | "Ich bin eine Teekanne." | "Die Anforderung wurde an einen Server gerichtet, der nicht in der Lage ist, eine Antwort zu generieren." | "Die Anforderung war gut formuliert, konnte aber aufgrund semantischer Fehler nicht befolgt werden." | "Die Ressource, auf die zugegriffen wird, ist gesperrt." | "Die Anforderung ist aufgrund eines Fehlers einer vorherigen Anforderung fehlgeschlagen." | "Der Server ist nicht bereit, die Anforderung zu verarbeiten, weil der Benutzer nicht authentifiziert wurde." | "Der Client sollte zu einem anderen Protokoll wie TLS/1.0 wechseln, das im Upgrade-Anforderungskopffeld angegeben ist." | "Der Ursprungsserver erfordert, dass die Anforderung bedingt ist." | "Sie haben in einer bestimmten Zeit zu viele Anfragen gesendet. Bitte versuchen Sie es später erneut." | "Der Server ist nicht bereit, die Anforderung zu verarbeiten, weil seine Kopffelder zu groß sind." | "Die Ressource ist aufgrund einer rechtlichen Forderung nicht verfügbar." | "Etwas ist schief gelaufen. Bitte versuchen Sie es später erneut." | "Der Server unterstützt die zur Erfüllung der Anforderung erforderliche Funktionalität nicht." | "Der Server kann die Anforderung derzeit nicht bearbeiten, da er vorübergehend überlastet oder gewartet wird." | "Der Server hat beim Versuch, die Anforderung abzuschließen, keine rechtzeitige Antwort vom Server erhalten." | "Der Server unterstützt die in der Anforderung verwendete HTTP-Protokollversion nicht." | "Der Server hat einen internen Konfigurationsfehler: Die ausgewählte Variantenressource ist so konfiguriert, dass sie sich selbst in die transparente Inhaltsverhandlung einbindet, und ist daher kein geeigneter Endpunkt im Verhandlungsprozess." | "Die Methode konnte auf die Ressource nicht angewendet werden, weil der Server nicht in der Lage ist, die für die erfolgreiche Ausführung der Anforderung erforderliche Darstellung zu speichern." | "Der Server hat eine Endlosschleife erkannt, während er die Anforderung verarbeitet." | "Weitere Erweiterungen der Anforderung sind erforderlich, damit der Server sie erfüllen kann." | "Sie müssen sich authentifizieren, um Zugang zum Netzwerk zu erhalten." | "Etwas ist schief gelaufen. Überprüfen Sie Ihre Internetverbindung und versuchen Sie es später erneut.";
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<ParseHttpErrorCodeToMessageDePipe, never>;
11
+ static ɵpipe: i0.ɵɵPipeDeclaration<ParseHttpErrorCodeToMessageDePipe, "parseHttpErrorCodeToMessageDe", true>;
12
+ }
@@ -0,0 +1,3 @@
1
+ import { HttpStatusCode } from '@angular/common/http';
2
+ export declare const parseHttpErrorCodeToTitleEn: (statusCode: HttpStatusCode) => "Bad request" | "Unauthorized" | "Payment required" | "Forbidden" | "Not found" | "Method not allowed" | "Not acceptable" | "Proxy authentication required" | "Request timeout" | "Conflict" | "Gone" | "Length required" | "Precondition failed" | "Payload too large" | "URI too long" | "Unsupported media type" | "Range not satisfiable" | "Expectation failed" | "I am a teapot" | "Misdirected request" | "Unprocessable entity" | "Locked" | "Failed dependency" | "Too early" | "Upgrade required" | "Precondition required" | "Too many requests" | "Request header fields too large" | "Unavailable for legal reasons" | "Internal server error" | "Not implemented" | "Bad gateway" | "Service unavailable" | "Gateway timeout" | "HTTP version not supported" | "Variant also negotiates" | "Insufficient storage" | "Loop detected" | "Not extended" | "Network authentication required" | "Something went wrong";
3
+ export declare const parseHttpErrorCodeToMessageEn: (statusCode: HttpStatusCode) => "Sorry, we could not process your request. Please try again later." | "You are not authorized to perform this action. Please log in to continue." | "Payment is required to complete this action." | "You do not have permission to perform this action." | "The requested resource was not found." | "The requested method is not allowed for this resource." | "The requested resource is not capable of generating a response matching the list of acceptable values." | "Proxy authentication is required to complete this action." | "The server timed out waiting for the request." | "The request conflicts with the current state of the resource." | "The requested resource is no longer available and will not be available again." | "The request did not specify the length of its content, which is required by the requested resource." | "The server does not meet one of the preconditions that the requester put on the request." | "The request is larger than the server is willing or able to process." | "The URL provided was too long for the server to process." | "The request entity has a media type which the server or resource does not support." | "The client has asked for a portion of the file, but the server cannot supply that portion." | "The server cannot meet the requirements of the Expect request-header field." | "I am a teapot." | "The request was directed at a server that is not able to produce a response." | "The request was well-formed but was unable to be followed due to semantic errors." | "The resource that is being accessed is locked." | "The request failed due to failure of a previous request." | "The server is unwilling to process the request because the user has not been authenticated." | "The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field." | "The origin server requires the request to be conditional." | "You have sent too many requests in a given amount of time. Please try again later." | "The server is unwilling to process the request because its header fields are too large." | "The resource is unavailable due to a legal demand." | "Something went wrong on our end. Please try again later." | "The server does not support the functionality required to fulfill the request." | "The server is currently unable to handle the request due to a temporary overload or maintenance of the server." | "The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URL or some other auxiliary server it needed to access in attempting to complete the request." | "The server does not support the HTTP protocol version used in the request." | "The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process." | "The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request." | "The server detected an infinite loop while processing the request." | "Further extensions to the request are required for the server to fulfill it." | "You need to authenticate to gain network access." | "Something went wrong. Check your internet connection and try again later.";
@@ -0,0 +1,12 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ParseHttpErrorCodeToTitleEnPipe implements PipeTransform {
4
+ transform: (statusCode: import("@angular/common/http").HttpStatusCode) => "Bad request" | "Unauthorized" | "Payment required" | "Forbidden" | "Not found" | "Method not allowed" | "Not acceptable" | "Proxy authentication required" | "Request timeout" | "Conflict" | "Gone" | "Length required" | "Precondition failed" | "Payload too large" | "URI too long" | "Unsupported media type" | "Range not satisfiable" | "Expectation failed" | "I am a teapot" | "Misdirected request" | "Unprocessable entity" | "Locked" | "Failed dependency" | "Too early" | "Upgrade required" | "Precondition required" | "Too many requests" | "Request header fields too large" | "Unavailable for legal reasons" | "Internal server error" | "Not implemented" | "Bad gateway" | "Service unavailable" | "Gateway timeout" | "HTTP version not supported" | "Variant also negotiates" | "Insufficient storage" | "Loop detected" | "Not extended" | "Network authentication required" | "Something went wrong";
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<ParseHttpErrorCodeToTitleEnPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<ParseHttpErrorCodeToTitleEnPipe, "parseHttpErrorCodeToTitleEn", true>;
7
+ }
8
+ export declare class ParseHttpErrorCodeToMessageEnPipe implements PipeTransform {
9
+ transform: (statusCode: import("@angular/common/http").HttpStatusCode) => "Sorry, we could not process your request. Please try again later." | "You are not authorized to perform this action. Please log in to continue." | "Payment is required to complete this action." | "You do not have permission to perform this action." | "The requested resource was not found." | "The requested method is not allowed for this resource." | "The requested resource is not capable of generating a response matching the list of acceptable values." | "Proxy authentication is required to complete this action." | "The server timed out waiting for the request." | "The request conflicts with the current state of the resource." | "The requested resource is no longer available and will not be available again." | "The request did not specify the length of its content, which is required by the requested resource." | "The server does not meet one of the preconditions that the requester put on the request." | "The request is larger than the server is willing or able to process." | "The URL provided was too long for the server to process." | "The request entity has a media type which the server or resource does not support." | "The client has asked for a portion of the file, but the server cannot supply that portion." | "The server cannot meet the requirements of the Expect request-header field." | "I am a teapot." | "The request was directed at a server that is not able to produce a response." | "The request was well-formed but was unable to be followed due to semantic errors." | "The resource that is being accessed is locked." | "The request failed due to failure of a previous request." | "The server is unwilling to process the request because the user has not been authenticated." | "The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field." | "The origin server requires the request to be conditional." | "You have sent too many requests in a given amount of time. Please try again later." | "The server is unwilling to process the request because its header fields are too large." | "The resource is unavailable due to a legal demand." | "Something went wrong on our end. Please try again later." | "The server does not support the functionality required to fulfill the request." | "The server is currently unable to handle the request due to a temporary overload or maintenance of the server." | "The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URL or some other auxiliary server it needed to access in attempting to complete the request." | "The server does not support the HTTP protocol version used in the request." | "The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process." | "The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request." | "The server detected an infinite loop while processing the request." | "Further extensions to the request are required for the server to fulfill it." | "You need to authenticate to gain network access." | "Something went wrong. Check your internet connection and try again later.";
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<ParseHttpErrorCodeToMessageEnPipe, never>;
11
+ static ɵpipe: i0.ɵɵPipeDeclaration<ParseHttpErrorCodeToMessageEnPipe, "parseHttpErrorCodeToMessageEn", true>;
12
+ }
@@ -1,4 +1,4 @@
1
- import { HttpStatusCode } from './request.util';
1
+ import { HttpStatusCode } from '@angular/common/http';
2
2
  export type Method = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT' | 'PURGE' | 'LINK' | 'UNLINK' | 'GQL_QUERY' | 'GQL_MUTATE' | 'CUSTOM';
3
3
  export interface RequestError<Detail = unknown> {
4
4
  url: string;
@@ -24,69 +24,3 @@ export declare const forEachHeader: (headers: RequestHeaders, callback: (value:
24
24
  export declare const parseAllXhrResponseHeaders: (xhr: XMLHttpRequest) => RequestHeaders;
25
25
  export declare const getResponseUrl: (xhr: XMLHttpRequest) => string | null;
26
26
  export declare const shouldRetryRequest: RequestRetryFn;
27
- export declare const enum HttpStatusCode {
28
- Unknown = 0,
29
- Continue = 100,
30
- SwitchingProtocols = 101,
31
- Processing = 102,
32
- EarlyHints = 103,
33
- Ok = 200,
34
- Created = 201,
35
- Accepted = 202,
36
- NonAuthoritativeInformation = 203,
37
- NoContent = 204,
38
- ResetContent = 205,
39
- PartialContent = 206,
40
- MultiStatus = 207,
41
- AlreadyReported = 208,
42
- ImUsed = 226,
43
- MultipleChoices = 300,
44
- MovedPermanently = 301,
45
- Found = 302,
46
- SeeOther = 303,
47
- NotModified = 304,
48
- UseProxy = 305,
49
- Unused = 306,
50
- TemporaryRedirect = 307,
51
- PermanentRedirect = 308,
52
- BadRequest = 400,
53
- Unauthorized = 401,
54
- PaymentRequired = 402,
55
- Forbidden = 403,
56
- NotFound = 404,
57
- MethodNotAllowed = 405,
58
- NotAcceptable = 406,
59
- ProxyAuthenticationRequired = 407,
60
- RequestTimeout = 408,
61
- Conflict = 409,
62
- Gone = 410,
63
- LengthRequired = 411,
64
- PreconditionFailed = 412,
65
- PayloadTooLarge = 413,
66
- UriTooLong = 414,
67
- UnsupportedMediaType = 415,
68
- RangeNotSatisfiable = 416,
69
- ExpectationFailed = 417,
70
- ImATeapot = 418,
71
- MisdirectedRequest = 421,
72
- UnprocessableEntity = 422,
73
- Locked = 423,
74
- FailedDependency = 424,
75
- TooEarly = 425,
76
- UpgradeRequired = 426,
77
- PreconditionRequired = 428,
78
- TooManyRequests = 429,
79
- RequestHeaderFieldsTooLarge = 431,
80
- UnavailableForLegalReasons = 451,
81
- InternalServerError = 500,
82
- NotImplemented = 501,
83
- BadGateway = 502,
84
- ServiceUnavailable = 503,
85
- GatewayTimeout = 504,
86
- HttpVersionNotSupported = 505,
87
- VariantAlsoNegotiates = 506,
88
- InsufficientStorage = 507,
89
- LoopDetected = 508,
90
- NotExtended = 510,
91
- NetworkAuthenticationRequired = 511
92
- }
@@ -1,4 +1,4 @@
1
- import { HttpStatusCode } from '../request';
1
+ import { HttpStatusCode } from '@angular/common/http';
2
2
  export interface SymfonyErrorTrace {
3
3
  args: string[];
4
4
  class: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/query",
3
- "version": "5.28.0",
3
+ "version": "5.29.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "19.1.5",