@squidcloud/client 1.0.326 → 1.0.328
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.
- package/dist/cjs/index.js +1 -1
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +67 -43
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +5 -2
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +0 -1
- package/dist/internal-common/src/public-types/http-status.enum.d.ts +414 -50
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types/query.public-types.d.ts +1 -0
- package/dist/internal-common/src/public-types/socket.public-types.d.ts +3 -5
- package/dist/internal-common/src/types/ai-agent.types.d.ts +1 -34
- package/dist/internal-common/src/utils/validation.d.ts +3 -4
- package/dist/typescript-client/src/admin-client.d.ts +0 -3
- package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +36 -0
- package/dist/typescript-client/src/agent/ai-agent-client.d.ts +13 -0
- package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +17 -0
- package/dist/typescript-client/src/ai-client.d.ts +3 -2
- package/dist/typescript-client/src/collection-reference.d.ts +1 -1
- package/dist/typescript-client/src/document-reference.d.ts +1 -1
- package/dist/typescript-client/src/index.d.ts +4 -2
- package/dist/typescript-client/src/public-types.d.ts +0 -1
- package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +1 -1
- package/dist/typescript-client/src/squid.d.ts +4 -4
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/internal-common/src/public-types/integrations/ai_agent.public-types.d.ts +0 -47
- package/dist/typescript-client/src/agent-client.d.ts +0 -6
- package/dist/typescript-client/src/ai-agent-client.d.ts +0 -228
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AiAgentId, IntegrationId } from './communication.public-types';
|
|
1
|
+
import { AiAgentId, AiContextId, IntegrationId } from './communication.public-types';
|
|
2
2
|
import { IntegrationType } from './integration.public-types';
|
|
3
3
|
import { FunctionName, FunctionNameWithContext } from './bundle-data.public-types';
|
|
4
4
|
/** The supported OpenAI models */
|
|
@@ -41,7 +41,7 @@ export type FluxModelName = (typeof FLUX_MODEL_NAMES)[number];
|
|
|
41
41
|
export type AiGenerateImageOptions = DallEOptions | StableDiffusionCoreOptions | FluxOptions;
|
|
42
42
|
export type AiAudioTranscribeOptions = WhisperOptions;
|
|
43
43
|
export type AiAudioCreateSpeechOptions = OpenAiCreateSpeechOptions;
|
|
44
|
-
export declare const VECTOR_DB_TYPES: readonly ["
|
|
44
|
+
export declare const VECTOR_DB_TYPES: readonly ["postgres"];
|
|
45
45
|
export type VectorDbType = (typeof VECTOR_DB_TYPES)[number];
|
|
46
46
|
export interface AiAudioCreateSpeechResponse {
|
|
47
47
|
mimeType: string;
|
|
@@ -102,7 +102,7 @@ export interface StableDiffusionCoreOptions extends BaseAiGenerateImageOptions {
|
|
|
102
102
|
}
|
|
103
103
|
/** The possible sources for the LLM provider API key. */
|
|
104
104
|
export type ApiKeySource = 'user' | 'system';
|
|
105
|
-
export type
|
|
105
|
+
export type AiAgentResponseFormat = 'text' | 'json_object';
|
|
106
106
|
export type AiFileUrlType = 'image';
|
|
107
107
|
export interface AiFileUrl {
|
|
108
108
|
type: AiFileUrlType;
|
|
@@ -154,7 +154,7 @@ interface BaseAiAgentChatOptions {
|
|
|
154
154
|
/** Whether to include references from the source context in the response. Default to false. */
|
|
155
155
|
includeReference?: boolean;
|
|
156
156
|
/** The format of the response from the AI model. Note that not all models support JSON format. Default to 'text'. */
|
|
157
|
-
responseFormat?:
|
|
157
|
+
responseFormat?: AiAgentResponseFormat;
|
|
158
158
|
/** Whether to response in a "smooth typing" way, beneficial when the chat result is displayed in a UI. Default to true. */
|
|
159
159
|
smoothTyping?: boolean;
|
|
160
160
|
/** Global context passed to the agent and all AI functions of the agent. */
|
|
@@ -166,8 +166,8 @@ interface BaseAiAgentChatOptions {
|
|
|
166
166
|
* Overrides the stored value.
|
|
167
167
|
*/
|
|
168
168
|
functions?: Array<FunctionName | FunctionNameWithContext>;
|
|
169
|
-
/**
|
|
170
|
-
instructions?:
|
|
169
|
+
/** Instructions to include with the prompt. */
|
|
170
|
+
instructions?: string;
|
|
171
171
|
/** A set of filters that will limit the context the AI can access. */
|
|
172
172
|
contextMetadataFilter?: AiContextMetadataFilter;
|
|
173
173
|
/** The options to use for the response in voice. */
|
|
@@ -182,25 +182,44 @@ interface BaseAiAgentChatOptions {
|
|
|
182
182
|
includeMetadata?: boolean;
|
|
183
183
|
/** The temperature to use when sampling from the model. Default to 0.5. */
|
|
184
184
|
temperature?: number;
|
|
185
|
-
|
|
185
|
+
model?: AiChatModelName;
|
|
186
186
|
}
|
|
187
187
|
export interface GeminiChatOptions extends BaseAiAgentChatOptions {
|
|
188
|
-
|
|
188
|
+
model?: GeminiChatModelName;
|
|
189
189
|
groundingWithWebSearch?: boolean;
|
|
190
190
|
}
|
|
191
|
-
export interface OpenAiReasoningChatOptions extends BaseAiAgentChatOptions {
|
|
192
|
-
overrideModel?: OpenAiReasoningChatModelName;
|
|
193
|
-
reasoningEffort?: 'low' | 'medium' | 'high';
|
|
194
|
-
}
|
|
195
191
|
export interface OpenAiChatOptions extends BaseAiAgentChatOptions {
|
|
196
|
-
|
|
197
|
-
topP?: number;
|
|
192
|
+
model?: OpenAiChatModelName;
|
|
198
193
|
fileUrls?: Array<AiFileUrl>;
|
|
199
194
|
}
|
|
195
|
+
export type OpenAiReasoningEffort = 'low' | 'medium' | 'high';
|
|
196
|
+
export interface OpenAiReasoningChatOptions extends OpenAiChatOptions {
|
|
197
|
+
model?: OpenAiReasoningChatModelName;
|
|
198
|
+
reasoningEffort?: OpenAiReasoningEffort;
|
|
199
|
+
}
|
|
200
200
|
export interface AnthropicChatOptions extends BaseAiAgentChatOptions {
|
|
201
|
-
|
|
201
|
+
model?: AnthropicChatModelName;
|
|
202
202
|
}
|
|
203
|
+
export type AiSessionOptions = Partial<{
|
|
204
|
+
traceId: string;
|
|
205
|
+
clientId: string;
|
|
206
|
+
agentId: string;
|
|
207
|
+
}>;
|
|
203
208
|
export type AiAgentChatOptions<T extends AiChatModelName | undefined = undefined> = T extends undefined ? BaseAiAgentChatOptions | GeminiChatOptions | OpenAiReasoningChatOptions | OpenAiChatOptions | AnthropicChatOptions : T extends GeminiChatModelName ? GeminiChatOptions : T extends OpenAiReasoningChatModelName ? OpenAiReasoningChatOptions : T extends OpenAiChatModelName ? OpenAiChatOptions : T extends AnthropicChatModelName ? AnthropicChatOptions : never;
|
|
209
|
+
/** A definition of an AI agent. */
|
|
210
|
+
export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
|
|
211
|
+
id: AiAgentId;
|
|
212
|
+
createdAt: Date;
|
|
213
|
+
updatedAt: Date;
|
|
214
|
+
description?: string;
|
|
215
|
+
isPublic?: boolean;
|
|
216
|
+
auditLog?: boolean;
|
|
217
|
+
/** The default options of the agent - can be overridden by the user when using the agent. */
|
|
218
|
+
options: AiAgentChatOptions<T>;
|
|
219
|
+
}
|
|
220
|
+
export type UpsertAgentRequest = Omit<AiAgent, 'createdAt' | 'updatedAt' | 'options'> & {
|
|
221
|
+
options?: AiAgentChatOptions;
|
|
222
|
+
};
|
|
204
223
|
export interface AiObserveStatusOptions {
|
|
205
224
|
/** A unique chat ID for the conversation. */
|
|
206
225
|
chatId?: string;
|
|
@@ -241,17 +260,7 @@ export interface AiSearchOptions {
|
|
|
241
260
|
}
|
|
242
261
|
export interface AiSearchRequest {
|
|
243
262
|
options: AiSearchOptions;
|
|
244
|
-
|
|
245
|
-
integrationId: IntegrationId;
|
|
246
|
-
}
|
|
247
|
-
export type AiMutationType = 'insert' | 'update' | 'delete' | 'append' | 'feedback';
|
|
248
|
-
export type AiResourceType = 'instruction' | 'profile' | 'context' | 'contexts';
|
|
249
|
-
export type AiContextType = 'text' | 'url' | 'file';
|
|
250
|
-
export interface AiContextBase {
|
|
251
|
-
type: AiContextType;
|
|
252
|
-
data: string;
|
|
253
|
-
metadata?: AiContextMetadata;
|
|
254
|
-
password?: string;
|
|
263
|
+
agentId: AiAgentId;
|
|
255
264
|
}
|
|
256
265
|
export interface AiSearchResponse {
|
|
257
266
|
chunks: Array<AiSearchResultChunk>;
|
|
@@ -261,32 +270,47 @@ export interface AiSearchResultChunk {
|
|
|
261
270
|
metadata?: AiContextMetadata;
|
|
262
271
|
score: number;
|
|
263
272
|
}
|
|
264
|
-
|
|
265
|
-
|
|
273
|
+
/**
|
|
274
|
+
* Provides context to the security rules of an AI Agent for each new user prompt.
|
|
275
|
+
* Refer to the `@secureAiAgent` annotation for more details.
|
|
276
|
+
*/
|
|
277
|
+
export declare class SecureAiAgentContext {
|
|
278
|
+
readonly prompt?: string;
|
|
279
|
+
readonly agentId: AiAgentId;
|
|
266
280
|
}
|
|
267
|
-
export interface
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
281
|
+
export interface AiAgentContext {
|
|
282
|
+
id: AiContextId;
|
|
283
|
+
createdAt: Date;
|
|
284
|
+
updatedAt: Date;
|
|
285
|
+
agentId: AiAgentId;
|
|
286
|
+
type: AiContextType;
|
|
287
|
+
title: string;
|
|
288
|
+
text: string;
|
|
289
|
+
preview: boolean;
|
|
290
|
+
sizeBytes: number;
|
|
291
|
+
metadata: AiContextMetadata;
|
|
292
|
+
}
|
|
293
|
+
export type AgentContextRequest = TextContextRequest | FileContextRequest;
|
|
294
|
+
export interface BaseContextRequest {
|
|
295
|
+
contextId: string;
|
|
296
|
+
type: AiContextType;
|
|
297
|
+
metadata?: AiContextMetadata;
|
|
272
298
|
}
|
|
273
|
-
export
|
|
299
|
+
export type AiContextType = 'text' | 'file';
|
|
300
|
+
export interface TextContextRequest extends BaseContextRequest {
|
|
301
|
+
type: 'text';
|
|
302
|
+
title: string;
|
|
303
|
+
text: string;
|
|
304
|
+
}
|
|
305
|
+
export interface FileContextRequest extends BaseContextRequest {
|
|
274
306
|
type: 'file';
|
|
275
307
|
extractImages?: boolean;
|
|
276
308
|
minImageWidth?: number;
|
|
277
309
|
minImageHeight?: number;
|
|
278
310
|
fullPageAsImage?: boolean;
|
|
279
311
|
extractionModel?: AiChatModelName;
|
|
312
|
+
password?: string;
|
|
280
313
|
}
|
|
281
|
-
/**
|
|
282
|
-
* Provides context to the security rules of an AI Agent for each new user prompt.
|
|
283
|
-
* Refer to the `@secureAiAgent` annotation for more details.
|
|
284
|
-
*/
|
|
285
|
-
export declare class AiChatContext {
|
|
286
|
-
readonly prompt?: string;
|
|
287
|
-
readonly profileId: AiAgentId;
|
|
288
|
-
}
|
|
289
|
-
export type AiContext = AiTextContext | AiUrlContext | AiFileContext;
|
|
290
314
|
export type AiContextMetadataValue = number | string | boolean | undefined;
|
|
291
315
|
export type AiContextMetadataValueArray = AiContextMetadataValue[];
|
|
292
316
|
export interface AiContextMetadataEqFilter {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenAiChatModelName, OpenAiReasoningEffort, AiAgentResponseFormat } from './ai-agent.public-types';
|
|
2
2
|
import { FunctionName } from './bundle-data.public-types';
|
|
3
3
|
export type AssistantToolType = 'code_interpreter' | 'file_search';
|
|
4
4
|
/** The options for the AI assistant. */
|
|
@@ -8,5 +8,8 @@ export interface QueryAssistantOptions {
|
|
|
8
8
|
/** Extra context per AI function.*/
|
|
9
9
|
functionContexts?: Record<FunctionName, Record<string, unknown>>;
|
|
10
10
|
/** The format of the response from the AI model. Defaults to 'text' */
|
|
11
|
-
responseFormat?:
|
|
11
|
+
responseFormat?: AiAgentResponseFormat;
|
|
12
|
+
model?: OpenAiChatModelName;
|
|
13
|
+
reasoningEffort?: OpenAiReasoningEffort;
|
|
14
|
+
instructions?: string;
|
|
12
15
|
}
|
|
@@ -10,6 +10,5 @@ export type SquidDocId = string;
|
|
|
10
10
|
export type ClientRequestId = string;
|
|
11
11
|
/** ID of AI agent. Also known as AI profile id. */
|
|
12
12
|
export type AiAgentId = string;
|
|
13
|
-
export type AiProfileId = AiAgentId;
|
|
14
13
|
export declare const BUILT_IN_AGENT_ID = "built_in_agent";
|
|
15
14
|
export type AiContextId = string;
|
|
@@ -1,50 +1,414 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
/** Set of constants for HTTP status codes. */
|
|
2
|
+
export declare const HttpStatus: {
|
|
3
|
+
/**
|
|
4
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.2.1
|
|
5
|
+
*
|
|
6
|
+
* This interim response indicates that everything so far is OK and that the client should continue with the request
|
|
7
|
+
* or ignore it if it is already finished.
|
|
8
|
+
*/
|
|
9
|
+
readonly CONTINUE: 100;
|
|
10
|
+
/**
|
|
11
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.2.2
|
|
12
|
+
*
|
|
13
|
+
* This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is
|
|
14
|
+
* switching too.
|
|
15
|
+
*/
|
|
16
|
+
readonly SWITCHING_PROTOCOLS: 101;
|
|
17
|
+
/**
|
|
18
|
+
* Official Documentation: https://tools.ietf.org/html/rfc2518#section-10.1
|
|
19
|
+
*
|
|
20
|
+
* This code indicates that the server has received and is processing the request, but no response is available yet.
|
|
21
|
+
*/
|
|
22
|
+
readonly PROCESSING: 102;
|
|
23
|
+
/**
|
|
24
|
+
* Official Documentation: https://www.rfc-editor.org/rfc/rfc8297#page-3
|
|
25
|
+
*
|
|
26
|
+
* This code indicates to the client that the server is likely to send a final response with the header fields
|
|
27
|
+
* included in the informational response.
|
|
28
|
+
*/
|
|
29
|
+
readonly EARLY_HINTS: 103;
|
|
30
|
+
/**
|
|
31
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.3.1
|
|
32
|
+
*
|
|
33
|
+
* The request has succeeded. The meaning of a success varies depending on the HTTP method:
|
|
34
|
+
* GET: The resource has been fetched and is transmitted in the message body.
|
|
35
|
+
* HEAD: The entity headers are in the message body.
|
|
36
|
+
* POST: The resource describing the result of the action is transmitted in the message body.
|
|
37
|
+
* TRACE: The message body contains the request message as received by the server
|
|
38
|
+
*/
|
|
39
|
+
readonly OK: 200;
|
|
40
|
+
/**
|
|
41
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.3.2
|
|
42
|
+
*
|
|
43
|
+
* The request has succeeded and a new resource has been created as a result of it. This is typically the response
|
|
44
|
+
* sent after a PUT request.
|
|
45
|
+
*/
|
|
46
|
+
readonly CREATED: 201;
|
|
47
|
+
/**
|
|
48
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.3.3
|
|
49
|
+
*
|
|
50
|
+
* The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to
|
|
51
|
+
* later send an asynchronous response indicating the outcome of processing the request. It is intended for cases
|
|
52
|
+
* where another process or server handles the request, or for batch processing.
|
|
53
|
+
*/
|
|
54
|
+
readonly ACCEPTED: 202;
|
|
55
|
+
/**
|
|
56
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.3.4
|
|
57
|
+
*
|
|
58
|
+
* This response code means returned meta-information set is not exact set as available from the origin server, but
|
|
59
|
+
* collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead
|
|
60
|
+
* of this response.
|
|
61
|
+
*/
|
|
62
|
+
readonly NON_AUTHORITATIVE_INFORMATION: 203;
|
|
63
|
+
/**
|
|
64
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.3.5
|
|
65
|
+
*
|
|
66
|
+
* There is no content to send for this request, but the headers may be useful. The user-agent may update its cached
|
|
67
|
+
* headers for this resource with the new ones.
|
|
68
|
+
*/
|
|
69
|
+
readonly NO_CONTENT: 204;
|
|
70
|
+
/**
|
|
71
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.3.6
|
|
72
|
+
*
|
|
73
|
+
* This response code is sent after accomplishing request to tell user agent reset document view which sent this
|
|
74
|
+
* request.
|
|
75
|
+
*/
|
|
76
|
+
readonly RESET_CONTENT: 205;
|
|
77
|
+
/**
|
|
78
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7233#section-4.1
|
|
79
|
+
*
|
|
80
|
+
* This response code is used because of range header sent by the client to separate download into multiple streams.
|
|
81
|
+
*/
|
|
82
|
+
readonly PARTIAL_CONTENT: 206;
|
|
83
|
+
/**
|
|
84
|
+
* Official Documentation: https://tools.ietf.org/html/rfc2518#section-10.2
|
|
85
|
+
*
|
|
86
|
+
* A Multi-Status response conveys information about multiple resources in situations where multiple status codes
|
|
87
|
+
* might be appropriate.
|
|
88
|
+
*/
|
|
89
|
+
readonly MULTI_STATUS: 207;
|
|
90
|
+
/**
|
|
91
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.4.1
|
|
92
|
+
*
|
|
93
|
+
* The request has more than one possible responses. User-agent or user should choose one of them. There is no
|
|
94
|
+
* standardized way to choose one of the responses.
|
|
95
|
+
*/
|
|
96
|
+
readonly MULTIPLE_CHOICES: 300;
|
|
97
|
+
/**
|
|
98
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.4.2
|
|
99
|
+
*
|
|
100
|
+
* This response code means that URI of requested resource has been changed. Probably, new URI would be given in the
|
|
101
|
+
* response.
|
|
102
|
+
*/
|
|
103
|
+
readonly MOVED_PERMANENTLY: 301;
|
|
104
|
+
/**
|
|
105
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.4.3
|
|
106
|
+
*
|
|
107
|
+
* This response code means that URI of requested resource has been changed temporarily. New changes in the URI might
|
|
108
|
+
* be made in the future. Therefore, this same URI should be used by the client in future requests.
|
|
109
|
+
*/
|
|
110
|
+
readonly MOVED_TEMPORARILY: 302;
|
|
111
|
+
/**
|
|
112
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.4.4
|
|
113
|
+
*
|
|
114
|
+
* Server sent this response to directing client to get requested resource to another URI with an GET request.
|
|
115
|
+
*/
|
|
116
|
+
readonly SEE_OTHER: 303;
|
|
117
|
+
/**
|
|
118
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7232#section-4.1
|
|
119
|
+
*
|
|
120
|
+
* This is used for caching purposes. It is telling to client that response has not been modified. So, client can
|
|
121
|
+
* continue to use same cached version of response.
|
|
122
|
+
*/
|
|
123
|
+
readonly NOT_MODIFIED: 304;
|
|
124
|
+
/**
|
|
125
|
+
* @deprecated
|
|
126
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.4.6
|
|
127
|
+
*
|
|
128
|
+
* Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed
|
|
129
|
+
* by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.
|
|
130
|
+
*/
|
|
131
|
+
readonly USE_PROXY: 305;
|
|
132
|
+
/**
|
|
133
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.4.7
|
|
134
|
+
*
|
|
135
|
+
* Server sent this response to directing client to get requested resource to another URI with same method that used
|
|
136
|
+
* prior request. This has the same semantic as the 302 Found HTTP response code, with the exception that the user
|
|
137
|
+
* agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the
|
|
138
|
+
* second request.
|
|
139
|
+
*/
|
|
140
|
+
readonly TEMPORARY_REDIRECT: 307;
|
|
141
|
+
/**
|
|
142
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7538#section-3
|
|
143
|
+
*
|
|
144
|
+
* This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response
|
|
145
|
+
* header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the
|
|
146
|
+
* user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in
|
|
147
|
+
* the second request.
|
|
148
|
+
*/
|
|
149
|
+
readonly PERMANENT_REDIRECT: 308;
|
|
150
|
+
/**
|
|
151
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.1
|
|
152
|
+
*
|
|
153
|
+
* This response means that server could not understand the request due to invalid syntax.
|
|
154
|
+
*/
|
|
155
|
+
readonly BAD_REQUEST: 400;
|
|
156
|
+
/**
|
|
157
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7235#section-3.1
|
|
158
|
+
*
|
|
159
|
+
* Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is,
|
|
160
|
+
* the client must authenticate itself to get the requested response.
|
|
161
|
+
*/
|
|
162
|
+
readonly UNAUTHORIZED: 401;
|
|
163
|
+
/**
|
|
164
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.2
|
|
165
|
+
*
|
|
166
|
+
* This response code is reserved for future use. Initial aim for creating this code was using it for digital payment
|
|
167
|
+
* systems however this is not used currently.
|
|
168
|
+
*/
|
|
169
|
+
readonly PAYMENT_REQUIRED: 402;
|
|
170
|
+
/**
|
|
171
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.3
|
|
172
|
+
*
|
|
173
|
+
* The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give
|
|
174
|
+
* proper response. Unlike 401, the client's identity is known to the server.
|
|
175
|
+
*/
|
|
176
|
+
readonly FORBIDDEN: 403;
|
|
177
|
+
/**
|
|
178
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.4
|
|
179
|
+
*
|
|
180
|
+
* The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this
|
|
181
|
+
* can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this
|
|
182
|
+
* response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is
|
|
183
|
+
* probably the most famous one due to its frequent occurrence on the web.
|
|
184
|
+
*/
|
|
185
|
+
readonly NOT_FOUND: 404;
|
|
186
|
+
/**
|
|
187
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.5
|
|
188
|
+
*
|
|
189
|
+
* The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid
|
|
190
|
+
* DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this
|
|
191
|
+
* error code.
|
|
192
|
+
*/
|
|
193
|
+
readonly METHOD_NOT_ALLOWED: 405;
|
|
194
|
+
/**
|
|
195
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.6
|
|
196
|
+
*
|
|
197
|
+
* This response is sent when the web server, after performing server-driven content negotiation, doesn't find any
|
|
198
|
+
* content following the criteria given by the user agent.
|
|
199
|
+
*/
|
|
200
|
+
readonly NOT_ACCEPTABLE: 406;
|
|
201
|
+
/**
|
|
202
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7235#section-3.2
|
|
203
|
+
*
|
|
204
|
+
* This is similar to 401 but authentication is needed to be done by a proxy.
|
|
205
|
+
*/
|
|
206
|
+
readonly PROXY_AUTHENTICATION_REQUIRED: 407;
|
|
207
|
+
/**
|
|
208
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.7
|
|
209
|
+
*
|
|
210
|
+
* This response is sent on an idle connection by some servers, even without any previous request by the client. It
|
|
211
|
+
* means that the server would like to shut down this unused connection. This response is used much more since some
|
|
212
|
+
* browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that
|
|
213
|
+
* some servers merely shut down the connection without sending this message.
|
|
214
|
+
*/
|
|
215
|
+
readonly REQUEST_TIMEOUT: 408;
|
|
216
|
+
/**
|
|
217
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.8
|
|
218
|
+
*
|
|
219
|
+
* This response is sent when a request conflicts with the current state of the server.
|
|
220
|
+
*/
|
|
221
|
+
readonly CONFLICT: 409;
|
|
222
|
+
/**
|
|
223
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.9
|
|
224
|
+
*
|
|
225
|
+
* This response would be sent when the requested content has been permanently deleted from server, with no
|
|
226
|
+
* forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification
|
|
227
|
+
* intends this status code to be used for "limited-time, promotional services". APIs should not feel compelled to
|
|
228
|
+
* indicate resources that have been deleted with this status code.
|
|
229
|
+
*/
|
|
230
|
+
readonly GONE: 410;
|
|
231
|
+
/**
|
|
232
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.10
|
|
233
|
+
*
|
|
234
|
+
* The server rejected the request because the Content-Length header field is not defined and the server requires it.
|
|
235
|
+
*/
|
|
236
|
+
readonly LENGTH_REQUIRED: 411;
|
|
237
|
+
/**
|
|
238
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7232#section-4.2
|
|
239
|
+
*
|
|
240
|
+
* The client has indicated preconditions in its headers which the server does not meet.
|
|
241
|
+
*/
|
|
242
|
+
readonly PRECONDITION_FAILED: 412;
|
|
243
|
+
/**
|
|
244
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.11
|
|
245
|
+
*
|
|
246
|
+
* Request entity is larger than limits defined by server; the server might close the connection or return a
|
|
247
|
+
* Retry-After header field.
|
|
248
|
+
*/
|
|
249
|
+
readonly REQUEST_TOO_LONG: 413;
|
|
250
|
+
/**
|
|
251
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.12
|
|
252
|
+
*
|
|
253
|
+
* The URI requested by the client is longer than the server is willing to interpret.
|
|
254
|
+
*/
|
|
255
|
+
readonly REQUEST_URI_TOO_LONG: 414;
|
|
256
|
+
/**
|
|
257
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.13
|
|
258
|
+
*
|
|
259
|
+
* The media format of the requested data is not supported by the server, so the server is rejecting the request.
|
|
260
|
+
*/
|
|
261
|
+
readonly UNSUPPORTED_MEDIA_TYPE: 415;
|
|
262
|
+
/**
|
|
263
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7233#section-4.4
|
|
264
|
+
*
|
|
265
|
+
* The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is
|
|
266
|
+
* outside the size of the target URI's data.
|
|
267
|
+
*/
|
|
268
|
+
readonly REQUESTED_RANGE_NOT_SATISFIABLE: 416;
|
|
269
|
+
/**
|
|
270
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.5.14
|
|
271
|
+
*
|
|
272
|
+
* This response code means the expectation indicated by the Expect request header field can't be met by the server.
|
|
273
|
+
*/
|
|
274
|
+
readonly EXPECTATION_FAILED: 417;
|
|
275
|
+
/**
|
|
276
|
+
* Official Documentation: https://tools.ietf.org/html/rfc2324#section-2.3.2
|
|
277
|
+
*
|
|
278
|
+
* Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity
|
|
279
|
+
* body MAY be short and stout.
|
|
280
|
+
*/
|
|
281
|
+
readonly IM_A_TEAPOT: 418;
|
|
282
|
+
/**
|
|
283
|
+
* Official Documentation: https://tools.ietf.org/html/rfc2518#section-10.6
|
|
284
|
+
*
|
|
285
|
+
* The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the
|
|
286
|
+
* server is unable to store the representation needed to successfully complete the request. This condition is
|
|
287
|
+
* considered to be temporary. If the request which received this status code was the result of a user action, the
|
|
288
|
+
* request MUST NOT be repeated until it is requested by a separate user action.
|
|
289
|
+
*/
|
|
290
|
+
readonly INSUFFICIENT_SPACE_ON_RESOURCE: 419;
|
|
291
|
+
/**
|
|
292
|
+
* @deprecated
|
|
293
|
+
* Official Documentation: https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt
|
|
294
|
+
*
|
|
295
|
+
* A deprecated response used by the Spring Framework when a method has failed.
|
|
296
|
+
*/
|
|
297
|
+
readonly METHOD_FAILURE: 420;
|
|
298
|
+
/**
|
|
299
|
+
* Official Documentation: https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2
|
|
300
|
+
*
|
|
301
|
+
* Defined in the specification of HTTP/2 to indicate that a server is not able to produce a response for the
|
|
302
|
+
* combination of scheme and authority that are included in the request URI.
|
|
303
|
+
*/
|
|
304
|
+
readonly MISDIRECTED_REQUEST: 421;
|
|
305
|
+
/**
|
|
306
|
+
* Official Documentation: https://tools.ietf.org/html/rfc2518#section-10.3
|
|
307
|
+
*
|
|
308
|
+
* The request was well-formed but was unable to be followed due to semantic errors.
|
|
309
|
+
*/
|
|
310
|
+
readonly UNPROCESSABLE_ENTITY: 422;
|
|
311
|
+
/**
|
|
312
|
+
* Official Documentation: https://tools.ietf.org/html/rfc2518#section-10.4
|
|
313
|
+
*
|
|
314
|
+
* The resource that is being accessed is locked.
|
|
315
|
+
*/
|
|
316
|
+
readonly LOCKED: 423;
|
|
317
|
+
/**
|
|
318
|
+
* Official Documentation: https://tools.ietf.org/html/rfc2518#section-10.5
|
|
319
|
+
*
|
|
320
|
+
* The request failed due to failure of a previous request.
|
|
321
|
+
*/
|
|
322
|
+
readonly FAILED_DEPENDENCY: 424;
|
|
323
|
+
/**
|
|
324
|
+
* Official Documentation: https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.15
|
|
325
|
+
*
|
|
326
|
+
* The server refuses to perform the request using the current protocol but might be willing to do so after the
|
|
327
|
+
* client upgrades to a different protocol.
|
|
328
|
+
*/
|
|
329
|
+
readonly UPGRADE_REQUIRED: 426;
|
|
330
|
+
/**
|
|
331
|
+
* Official Documentation: https://tools.ietf.org/html/rfc6585#section-3
|
|
332
|
+
*
|
|
333
|
+
* The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a
|
|
334
|
+
* client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has
|
|
335
|
+
* modified the state on the server, leading to a conflict.
|
|
336
|
+
*/
|
|
337
|
+
readonly PRECONDITION_REQUIRED: 428;
|
|
338
|
+
/**
|
|
339
|
+
* Official Documentation: https://tools.ietf.org/html/rfc6585#section-4
|
|
340
|
+
*
|
|
341
|
+
* The user has sent too many requests in a given amount of time ("rate limiting").
|
|
342
|
+
*/
|
|
343
|
+
readonly TOO_MANY_REQUESTS: 429;
|
|
344
|
+
/**
|
|
345
|
+
* Official Documentation: https://tools.ietf.org/html/rfc6585#section-5
|
|
346
|
+
*
|
|
347
|
+
* The server is unwilling to process the request because its header fields are too large. The request MAY be
|
|
348
|
+
* resubmitted after reducing the size of the request header fields.
|
|
349
|
+
*/
|
|
350
|
+
readonly REQUEST_HEADER_FIELDS_TOO_LARGE: 431;
|
|
351
|
+
/**
|
|
352
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7725
|
|
353
|
+
*
|
|
354
|
+
* The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.
|
|
355
|
+
*/
|
|
356
|
+
readonly UNAVAILABLE_FOR_LEGAL_REASONS: 451;
|
|
357
|
+
/**
|
|
358
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.6.1
|
|
359
|
+
*
|
|
360
|
+
* The server encountered an unexpected condition that prevented it from fulfilling the request.
|
|
361
|
+
*/
|
|
362
|
+
readonly INTERNAL_SERVER_ERROR: 500;
|
|
363
|
+
/**
|
|
364
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.6.2
|
|
365
|
+
*
|
|
366
|
+
* The request method is not supported by the server and cannot be handled. The only methods that servers are
|
|
367
|
+
* required to support (and therefore that must not return this code) are GET and HEAD.
|
|
368
|
+
*/
|
|
369
|
+
readonly NOT_IMPLEMENTED: 501;
|
|
370
|
+
/**
|
|
371
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.6.3
|
|
372
|
+
*
|
|
373
|
+
* This error response means that the server, while working as a gateway to get a response needed to handle the
|
|
374
|
+
* request, got an invalid response.
|
|
375
|
+
*/
|
|
376
|
+
readonly BAD_GATEWAY: 502;
|
|
377
|
+
/**
|
|
378
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.6.4
|
|
379
|
+
*
|
|
380
|
+
* The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is
|
|
381
|
+
* overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent.
|
|
382
|
+
* This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible,
|
|
383
|
+
* contain the estimated time before the recovery of the service. The webmaster must also take care about the
|
|
384
|
+
* caching-related headers that are sent along with this response, as these temporary condition responses should
|
|
385
|
+
* usually not be cached.
|
|
386
|
+
*/
|
|
387
|
+
readonly SERVICE_UNAVAILABLE: 503;
|
|
388
|
+
/**
|
|
389
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.6.5
|
|
390
|
+
*
|
|
391
|
+
* This error response is given when the server is acting as a gateway and cannot get a response in time.
|
|
392
|
+
*/
|
|
393
|
+
readonly GATEWAY_TIMEOUT: 504;
|
|
394
|
+
/**
|
|
395
|
+
* Official Documentation: https://tools.ietf.org/html/rfc7231#section-6.6.6
|
|
396
|
+
*
|
|
397
|
+
* The HTTP version used in the request is not supported by the server.
|
|
398
|
+
*/
|
|
399
|
+
readonly HTTP_VERSION_NOT_SUPPORTED: 505;
|
|
400
|
+
/**
|
|
401
|
+
* Official Documentation: https://tools.ietf.org/html/rfc2518#section-10.6
|
|
402
|
+
*
|
|
403
|
+
* The server has an internal configuration error: the chosen variant resource is configured to engage in transparent
|
|
404
|
+
* content negotiation itself, and is therefore not a proper end point in the negotiation process.
|
|
405
|
+
*/
|
|
406
|
+
readonly INSUFFICIENT_STORAGE: 507;
|
|
407
|
+
/**
|
|
408
|
+
* Official Documentation: https://tools.ietf.org/html/rfc6585#section-6
|
|
409
|
+
*
|
|
410
|
+
* The 511 status code indicates that the client needs to authenticate to gain network access.
|
|
411
|
+
*/
|
|
412
|
+
readonly NETWORK_AUTHENTICATION_REQUIRED: 511;
|
|
413
|
+
};
|
|
414
|
+
export type HttpStatusCode = (typeof HttpStatus)[keyof typeof HttpStatus];
|