@aerostack/sdk-node 0.8.8 → 0.8.10
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/package.json +10 -3
- package/FUNCTIONS.md +0 -95
- package/RUNTIMES.md +0 -48
- package/examples/aiAIChat.example.ts +0 -31
- package/examples/databaseDbQuery.example.ts +0 -34
- package/examples/e2e/__tests__/e2e.test.ts +0 -118
- package/examples/e2e/package.json +0 -15
- package/examples/e2e/vitest.config.ts +0 -8
- package/examples/express-integration.ts +0 -67
- package/examples/next-api-route.ts +0 -46
- package/examples/package.json +0 -18
- package/examples/standalone-auth.ts +0 -44
- package/jsr.json +0 -27
- package/src/__tests__/realtime.test.ts +0 -430
- package/src/__tests__/sdk.test.ts +0 -412
- package/src/_generated/apis/AIApi.ts +0 -477
- package/src/_generated/apis/AuthenticationApi.ts +0 -121
- package/src/_generated/apis/CacheApi.ts +0 -551
- package/src/_generated/apis/DatabaseApi.ts +0 -138
- package/src/_generated/apis/GatewayApi.ts +0 -204
- package/src/_generated/apis/QueueApi.ts +0 -218
- package/src/_generated/apis/ServicesApi.ts +0 -74
- package/src/_generated/apis/StorageApi.ts +0 -476
- package/src/_generated/apis/index.ts +0 -10
- package/src/_generated/index.ts +0 -5
- package/src/_generated/models/AuthResponse.ts +0 -88
- package/src/_generated/models/AuthSigninRequest.ts +0 -75
- package/src/_generated/models/AuthSignupRequest.ts +0 -91
- package/src/_generated/models/CacheDeleteMany200Response.ts +0 -81
- package/src/_generated/models/CacheDeleteManyRequest.ts +0 -66
- package/src/_generated/models/CacheExpireRequest.ts +0 -75
- package/src/_generated/models/CacheFlush200Response.ts +0 -73
- package/src/_generated/models/CacheFlushRequest.ts +0 -65
- package/src/_generated/models/CacheGet200Response.ts +0 -73
- package/src/_generated/models/CacheGetMany200Response.ts +0 -72
- package/src/_generated/models/CacheGetManyEntry.ts +0 -81
- package/src/_generated/models/CacheGetManyRequest.ts +0 -66
- package/src/_generated/models/CacheGetRequest.ts +0 -66
- package/src/_generated/models/CacheIncrement200Response.ts +0 -65
- package/src/_generated/models/CacheIncrementRequest.ts +0 -90
- package/src/_generated/models/CacheKeyEntry.ts +0 -73
- package/src/_generated/models/CacheKeys200Response.ts +0 -73
- package/src/_generated/models/CacheKeysRequest.ts +0 -65
- package/src/_generated/models/CacheListRequest.ts +0 -81
- package/src/_generated/models/CacheListResult.ts +0 -88
- package/src/_generated/models/CacheSet200Response.ts +0 -65
- package/src/_generated/models/CacheSetEntry.ts +0 -83
- package/src/_generated/models/CacheSetMany200Response.ts +0 -73
- package/src/_generated/models/CacheSetManyRequest.ts +0 -73
- package/src/_generated/models/CacheSetRequest.ts +0 -83
- package/src/_generated/models/ChatCompletionRequest.ts +0 -130
- package/src/_generated/models/ChatCompletionRequestStreamOptions.ts +0 -67
- package/src/_generated/models/ChatCompletionResponse.ts +0 -128
- package/src/_generated/models/ChatCompletionResponseChoicesInner.ts +0 -100
- package/src/_generated/models/ChatMessage.ts +0 -87
- package/src/_generated/models/ConfigureRequest.ts +0 -77
- package/src/_generated/models/DbBatchRequest.ts +0 -73
- package/src/_generated/models/DbBatchRequestQueriesInner.ts +0 -74
- package/src/_generated/models/DbBatchResult.ts +0 -80
- package/src/_generated/models/DbBatchResultResultsInner.ts +0 -81
- package/src/_generated/models/DbQueryRequest.ts +0 -74
- package/src/_generated/models/DbQueryResult.ts +0 -73
- package/src/_generated/models/DeleteByTypeRequest.ts +0 -66
- package/src/_generated/models/DeleteRequest.ts +0 -66
- package/src/_generated/models/ErrorResponse.ts +0 -99
- package/src/_generated/models/GatewayBillingLog200Response.ts +0 -73
- package/src/_generated/models/GatewayBillingLogRequest.ts +0 -92
- package/src/_generated/models/GatewayGetWallet200Response.ts +0 -72
- package/src/_generated/models/IngestRequest.ts +0 -91
- package/src/_generated/models/JobRecord.ts +0 -119
- package/src/_generated/models/ListTypes200Response.ts +0 -72
- package/src/_generated/models/Query200Response.ts +0 -72
- package/src/_generated/models/QueryRequest.ts +0 -90
- package/src/_generated/models/QueueCancelJob200Response.ts +0 -73
- package/src/_generated/models/QueueEnqueue201Response.ts +0 -73
- package/src/_generated/models/QueueEnqueueRequest.ts +0 -83
- package/src/_generated/models/QueueGetJob200Response.ts +0 -80
- package/src/_generated/models/QueueGetJobRequest.ts +0 -66
- package/src/_generated/models/QueueListJobs200Response.ts +0 -88
- package/src/_generated/models/QueueListJobsRequest.ts +0 -103
- package/src/_generated/models/SearchCount200Response.ts +0 -65
- package/src/_generated/models/SearchCountRequest.ts +0 -65
- package/src/_generated/models/SearchGet200Response.ts +0 -80
- package/src/_generated/models/SearchGetRequest.ts +0 -66
- package/src/_generated/models/SearchResult.ts +0 -97
- package/src/_generated/models/SearchUpdateRequest.ts +0 -91
- package/src/_generated/models/ServicesInvoke200Response.ts +0 -73
- package/src/_generated/models/ServicesInvokeRequest.ts +0 -75
- package/src/_generated/models/StorageCopy200Response.ts +0 -73
- package/src/_generated/models/StorageCopyRequest.ts +0 -75
- package/src/_generated/models/StorageExists200Response.ts +0 -65
- package/src/_generated/models/StorageGetRequest.ts +0 -66
- package/src/_generated/models/StorageListRequest.ts +0 -81
- package/src/_generated/models/StorageListResult.ts +0 -88
- package/src/_generated/models/StorageMetadata.ts +0 -97
- package/src/_generated/models/StorageMove200Response.ts +0 -73
- package/src/_generated/models/StorageMoveRequest.ts +0 -75
- package/src/_generated/models/StorageObject.ts +0 -97
- package/src/_generated/models/StorageUpload200Response.ts +0 -65
- package/src/_generated/models/TokenUsage.ts +0 -81
- package/src/_generated/models/TokenWallet.ts +0 -73
- package/src/_generated/models/TypeStats.ts +0 -73
- package/src/_generated/models/User.ts +0 -97
- package/src/_generated/models/index.ts +0 -80
- package/src/_generated/runtime.ts +0 -431
- package/src/index.ts +0 -3
- package/src/realtime.ts +0 -439
- package/src/sdk.ts +0 -317
- package/test_sdk.ts +0 -19
- package/tsconfig.json +0 -43
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Aerostack API
|
|
5
|
-
* Aerostack Platform API - Unified access to database, authentication, caching, queues, storage, and AI services.
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 1.5.0
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
-
* https://openapi-generator.tech
|
|
12
|
-
* Do not edit the class manually.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import * as runtime from '../runtime.js';
|
|
17
|
-
import type {
|
|
18
|
-
CacheSet200Response,
|
|
19
|
-
ChatCompletionRequest,
|
|
20
|
-
ChatCompletionResponse,
|
|
21
|
-
ConfigureRequest,
|
|
22
|
-
DeleteByTypeRequest,
|
|
23
|
-
DeleteRequest,
|
|
24
|
-
IngestRequest,
|
|
25
|
-
ListTypes200Response,
|
|
26
|
-
Query200Response,
|
|
27
|
-
QueryRequest,
|
|
28
|
-
SearchCount200Response,
|
|
29
|
-
SearchCountRequest,
|
|
30
|
-
SearchGet200Response,
|
|
31
|
-
SearchGetRequest,
|
|
32
|
-
SearchUpdateRequest,
|
|
33
|
-
} from '../models/index.js';
|
|
34
|
-
import {
|
|
35
|
-
CacheSet200ResponseFromJSON,
|
|
36
|
-
CacheSet200ResponseToJSON,
|
|
37
|
-
ChatCompletionRequestFromJSON,
|
|
38
|
-
ChatCompletionRequestToJSON,
|
|
39
|
-
ChatCompletionResponseFromJSON,
|
|
40
|
-
ChatCompletionResponseToJSON,
|
|
41
|
-
ConfigureRequestFromJSON,
|
|
42
|
-
ConfigureRequestToJSON,
|
|
43
|
-
DeleteByTypeRequestFromJSON,
|
|
44
|
-
DeleteByTypeRequestToJSON,
|
|
45
|
-
DeleteRequestFromJSON,
|
|
46
|
-
DeleteRequestToJSON,
|
|
47
|
-
IngestRequestFromJSON,
|
|
48
|
-
IngestRequestToJSON,
|
|
49
|
-
ListTypes200ResponseFromJSON,
|
|
50
|
-
ListTypes200ResponseToJSON,
|
|
51
|
-
Query200ResponseFromJSON,
|
|
52
|
-
Query200ResponseToJSON,
|
|
53
|
-
QueryRequestFromJSON,
|
|
54
|
-
QueryRequestToJSON,
|
|
55
|
-
SearchCount200ResponseFromJSON,
|
|
56
|
-
SearchCount200ResponseToJSON,
|
|
57
|
-
SearchCountRequestFromJSON,
|
|
58
|
-
SearchCountRequestToJSON,
|
|
59
|
-
SearchGet200ResponseFromJSON,
|
|
60
|
-
SearchGet200ResponseToJSON,
|
|
61
|
-
SearchGetRequestFromJSON,
|
|
62
|
-
SearchGetRequestToJSON,
|
|
63
|
-
SearchUpdateRequestFromJSON,
|
|
64
|
-
SearchUpdateRequestToJSON,
|
|
65
|
-
} from '../models/index.js';
|
|
66
|
-
|
|
67
|
-
export interface DeleteOperationRequest {
|
|
68
|
-
deleteRequest: DeleteRequest;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface AiChatRequest {
|
|
72
|
-
chatCompletionRequest: ChatCompletionRequest;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface ConfigureOperationRequest {
|
|
76
|
-
configureRequest: ConfigureRequest;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface DeleteByTypeOperationRequest {
|
|
80
|
-
deleteByTypeRequest: DeleteByTypeRequest;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface IngestOperationRequest {
|
|
84
|
-
ingestRequest: IngestRequest;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export interface QueryOperationRequest {
|
|
88
|
-
queryRequest: QueryRequest;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface SearchCountOperationRequest {
|
|
92
|
-
searchCountRequest: SearchCountRequest;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface SearchGetOperationRequest {
|
|
96
|
-
searchGetRequest: SearchGetRequest;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface SearchUpdateOperationRequest {
|
|
100
|
-
searchUpdateRequest: SearchUpdateRequest;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
*
|
|
105
|
-
*/
|
|
106
|
-
export class AIApi extends runtime.BaseAPI {
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Delete item by ID
|
|
110
|
-
*/
|
|
111
|
-
async _deleteRaw(requestParameters: DeleteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CacheSet200Response>> {
|
|
112
|
-
if (requestParameters.deleteRequest === null || requestParameters.deleteRequest === undefined) {
|
|
113
|
-
throw new runtime.RequiredError('deleteRequest','Required parameter requestParameters.deleteRequest was null or undefined when calling _delete.');
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const queryParameters: any = {};
|
|
117
|
-
|
|
118
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
119
|
-
|
|
120
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
121
|
-
|
|
122
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
123
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const response = await this.request({
|
|
127
|
-
path: `/ai/search/delete`,
|
|
128
|
-
method: 'POST',
|
|
129
|
-
headers: headerParameters,
|
|
130
|
-
query: queryParameters,
|
|
131
|
-
body: DeleteRequestToJSON(requestParameters.deleteRequest),
|
|
132
|
-
}, initOverrides);
|
|
133
|
-
|
|
134
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => CacheSet200ResponseFromJSON(jsonValue));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Delete item by ID
|
|
139
|
-
*/
|
|
140
|
-
async _delete(requestParameters: DeleteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CacheSet200Response> {
|
|
141
|
-
const response = await this._deleteRaw(requestParameters, initOverrides);
|
|
142
|
-
return await response.value();
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Generate a chat completion using the project\'s configured AI model. Set `stream: true` to receive a server-sent events (SSE) stream of token deltas in OpenAI-compatible format. Each data frame contains a JSON object with `choices[0].delta.content`. The stream ends with `data: [DONE]`. The final frame (when `stream_options.include_usage` is true) includes a `usage` object with `total_tokens`.
|
|
147
|
-
* Generate AI chat completion
|
|
148
|
-
*/
|
|
149
|
-
async aiChatRaw(requestParameters: AiChatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatCompletionResponse>> {
|
|
150
|
-
if (requestParameters.chatCompletionRequest === null || requestParameters.chatCompletionRequest === undefined) {
|
|
151
|
-
throw new runtime.RequiredError('chatCompletionRequest','Required parameter requestParameters.chatCompletionRequest was null or undefined when calling aiChat.');
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const queryParameters: any = {};
|
|
155
|
-
|
|
156
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
157
|
-
|
|
158
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
159
|
-
|
|
160
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
161
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const response = await this.request({
|
|
165
|
-
path: `/ai/chat`,
|
|
166
|
-
method: 'POST',
|
|
167
|
-
headers: headerParameters,
|
|
168
|
-
query: queryParameters,
|
|
169
|
-
body: ChatCompletionRequestToJSON(requestParameters.chatCompletionRequest),
|
|
170
|
-
}, initOverrides);
|
|
171
|
-
|
|
172
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => ChatCompletionResponseFromJSON(jsonValue));
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Generate a chat completion using the project\'s configured AI model. Set `stream: true` to receive a server-sent events (SSE) stream of token deltas in OpenAI-compatible format. Each data frame contains a JSON object with `choices[0].delta.content`. The stream ends with `data: [DONE]`. The final frame (when `stream_options.include_usage` is true) includes a `usage` object with `total_tokens`.
|
|
177
|
-
* Generate AI chat completion
|
|
178
|
-
*/
|
|
179
|
-
async aiChat(requestParameters: AiChatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatCompletionResponse> {
|
|
180
|
-
const response = await this.aiChatRaw(requestParameters, initOverrides);
|
|
181
|
-
return await response.value();
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Update search configuration
|
|
186
|
-
*/
|
|
187
|
-
async configureRaw(requestParameters: ConfigureOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CacheSet200Response>> {
|
|
188
|
-
if (requestParameters.configureRequest === null || requestParameters.configureRequest === undefined) {
|
|
189
|
-
throw new runtime.RequiredError('configureRequest','Required parameter requestParameters.configureRequest was null or undefined when calling configure.');
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const queryParameters: any = {};
|
|
193
|
-
|
|
194
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
195
|
-
|
|
196
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
197
|
-
|
|
198
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
199
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
const response = await this.request({
|
|
203
|
-
path: `/ai/search/configure`,
|
|
204
|
-
method: 'POST',
|
|
205
|
-
headers: headerParameters,
|
|
206
|
-
query: queryParameters,
|
|
207
|
-
body: ConfigureRequestToJSON(requestParameters.configureRequest),
|
|
208
|
-
}, initOverrides);
|
|
209
|
-
|
|
210
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => CacheSet200ResponseFromJSON(jsonValue));
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Update search configuration
|
|
215
|
-
*/
|
|
216
|
-
async configure(requestParameters: ConfigureOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CacheSet200Response> {
|
|
217
|
-
const response = await this.configureRaw(requestParameters, initOverrides);
|
|
218
|
-
return await response.value();
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Delete all items of a type
|
|
223
|
-
*/
|
|
224
|
-
async deleteByTypeRaw(requestParameters: DeleteByTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CacheSet200Response>> {
|
|
225
|
-
if (requestParameters.deleteByTypeRequest === null || requestParameters.deleteByTypeRequest === undefined) {
|
|
226
|
-
throw new runtime.RequiredError('deleteByTypeRequest','Required parameter requestParameters.deleteByTypeRequest was null or undefined when calling deleteByType.');
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const queryParameters: any = {};
|
|
230
|
-
|
|
231
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
232
|
-
|
|
233
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
234
|
-
|
|
235
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
236
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const response = await this.request({
|
|
240
|
-
path: `/ai/search/deleteByType`,
|
|
241
|
-
method: 'POST',
|
|
242
|
-
headers: headerParameters,
|
|
243
|
-
query: queryParameters,
|
|
244
|
-
body: DeleteByTypeRequestToJSON(requestParameters.deleteByTypeRequest),
|
|
245
|
-
}, initOverrides);
|
|
246
|
-
|
|
247
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => CacheSet200ResponseFromJSON(jsonValue));
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Delete all items of a type
|
|
252
|
-
*/
|
|
253
|
-
async deleteByType(requestParameters: DeleteByTypeOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CacheSet200Response> {
|
|
254
|
-
const response = await this.deleteByTypeRaw(requestParameters, initOverrides);
|
|
255
|
-
return await response.value();
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Ingest content into managed search index
|
|
260
|
-
*/
|
|
261
|
-
async ingestRaw(requestParameters: IngestOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CacheSet200Response>> {
|
|
262
|
-
if (requestParameters.ingestRequest === null || requestParameters.ingestRequest === undefined) {
|
|
263
|
-
throw new runtime.RequiredError('ingestRequest','Required parameter requestParameters.ingestRequest was null or undefined when calling ingest.');
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
const queryParameters: any = {};
|
|
267
|
-
|
|
268
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
269
|
-
|
|
270
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
271
|
-
|
|
272
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
273
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
const response = await this.request({
|
|
277
|
-
path: `/ai/search/ingest`,
|
|
278
|
-
method: 'POST',
|
|
279
|
-
headers: headerParameters,
|
|
280
|
-
query: queryParameters,
|
|
281
|
-
body: IngestRequestToJSON(requestParameters.ingestRequest),
|
|
282
|
-
}, initOverrides);
|
|
283
|
-
|
|
284
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => CacheSet200ResponseFromJSON(jsonValue));
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Ingest content into managed search index
|
|
289
|
-
*/
|
|
290
|
-
async ingest(requestParameters: IngestOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CacheSet200Response> {
|
|
291
|
-
const response = await this.ingestRaw(requestParameters, initOverrides);
|
|
292
|
-
return await response.value();
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* List distinct types and counts
|
|
297
|
-
*/
|
|
298
|
-
async listTypesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListTypes200Response>> {
|
|
299
|
-
const queryParameters: any = {};
|
|
300
|
-
|
|
301
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
302
|
-
|
|
303
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
304
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
const response = await this.request({
|
|
308
|
-
path: `/ai/search/listTypes`,
|
|
309
|
-
method: 'GET',
|
|
310
|
-
headers: headerParameters,
|
|
311
|
-
query: queryParameters,
|
|
312
|
-
}, initOverrides);
|
|
313
|
-
|
|
314
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => ListTypes200ResponseFromJSON(jsonValue));
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* List distinct types and counts
|
|
319
|
-
*/
|
|
320
|
-
async listTypes(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListTypes200Response> {
|
|
321
|
-
const response = await this.listTypesRaw(initOverrides);
|
|
322
|
-
return await response.value();
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Search managed index
|
|
327
|
-
*/
|
|
328
|
-
async queryRaw(requestParameters: QueryOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Query200Response>> {
|
|
329
|
-
if (requestParameters.queryRequest === null || requestParameters.queryRequest === undefined) {
|
|
330
|
-
throw new runtime.RequiredError('queryRequest','Required parameter requestParameters.queryRequest was null or undefined when calling query.');
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
const queryParameters: any = {};
|
|
334
|
-
|
|
335
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
336
|
-
|
|
337
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
338
|
-
|
|
339
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
340
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
const response = await this.request({
|
|
344
|
-
path: `/ai/search/query`,
|
|
345
|
-
method: 'POST',
|
|
346
|
-
headers: headerParameters,
|
|
347
|
-
query: queryParameters,
|
|
348
|
-
body: QueryRequestToJSON(requestParameters.queryRequest),
|
|
349
|
-
}, initOverrides);
|
|
350
|
-
|
|
351
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => Query200ResponseFromJSON(jsonValue));
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Search managed index
|
|
356
|
-
*/
|
|
357
|
-
async query(requestParameters: QueryOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Query200Response> {
|
|
358
|
-
const response = await this.queryRaw(requestParameters, initOverrides);
|
|
359
|
-
return await response.value();
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Returns total count of indexed items, optionally filtered by type.
|
|
364
|
-
* Count indexed items
|
|
365
|
-
*/
|
|
366
|
-
async searchCountRaw(requestParameters: SearchCountOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchCount200Response>> {
|
|
367
|
-
if (requestParameters.searchCountRequest === null || requestParameters.searchCountRequest === undefined) {
|
|
368
|
-
throw new runtime.RequiredError('searchCountRequest','Required parameter requestParameters.searchCountRequest was null or undefined when calling searchCount.');
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
const queryParameters: any = {};
|
|
372
|
-
|
|
373
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
374
|
-
|
|
375
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
376
|
-
|
|
377
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
378
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
const response = await this.request({
|
|
382
|
-
path: `/ai/search/count`,
|
|
383
|
-
method: 'POST',
|
|
384
|
-
headers: headerParameters,
|
|
385
|
-
query: queryParameters,
|
|
386
|
-
body: SearchCountRequestToJSON(requestParameters.searchCountRequest),
|
|
387
|
-
}, initOverrides);
|
|
388
|
-
|
|
389
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => SearchCount200ResponseFromJSON(jsonValue));
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* Returns total count of indexed items, optionally filtered by type.
|
|
394
|
-
* Count indexed items
|
|
395
|
-
*/
|
|
396
|
-
async searchCount(requestParameters: SearchCountOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchCount200Response> {
|
|
397
|
-
const response = await this.searchCountRaw(requestParameters, initOverrides);
|
|
398
|
-
return await response.value();
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* Get a specific indexed item by ID
|
|
403
|
-
*/
|
|
404
|
-
async searchGetRaw(requestParameters: SearchGetOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchGet200Response>> {
|
|
405
|
-
if (requestParameters.searchGetRequest === null || requestParameters.searchGetRequest === undefined) {
|
|
406
|
-
throw new runtime.RequiredError('searchGetRequest','Required parameter requestParameters.searchGetRequest was null or undefined when calling searchGet.');
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
const queryParameters: any = {};
|
|
410
|
-
|
|
411
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
412
|
-
|
|
413
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
414
|
-
|
|
415
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
416
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
const response = await this.request({
|
|
420
|
-
path: `/ai/search/get`,
|
|
421
|
-
method: 'POST',
|
|
422
|
-
headers: headerParameters,
|
|
423
|
-
query: queryParameters,
|
|
424
|
-
body: SearchGetRequestToJSON(requestParameters.searchGetRequest),
|
|
425
|
-
}, initOverrides);
|
|
426
|
-
|
|
427
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => SearchGet200ResponseFromJSON(jsonValue));
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* Get a specific indexed item by ID
|
|
432
|
-
*/
|
|
433
|
-
async searchGet(requestParameters: SearchGetOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchGet200Response> {
|
|
434
|
-
const response = await this.searchGetRaw(requestParameters, initOverrides);
|
|
435
|
-
return await response.value();
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* Updates a previously ingested item by re-ingesting with the same ID. The Vectorize upsert operation is idempotent — re-ingesting with the same ID replaces the existing vector and metadata.
|
|
440
|
-
* Update an existing indexed item
|
|
441
|
-
*/
|
|
442
|
-
async searchUpdateRaw(requestParameters: SearchUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CacheSet200Response>> {
|
|
443
|
-
if (requestParameters.searchUpdateRequest === null || requestParameters.searchUpdateRequest === undefined) {
|
|
444
|
-
throw new runtime.RequiredError('searchUpdateRequest','Required parameter requestParameters.searchUpdateRequest was null or undefined when calling searchUpdate.');
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
const queryParameters: any = {};
|
|
448
|
-
|
|
449
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
450
|
-
|
|
451
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
452
|
-
|
|
453
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
454
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
const response = await this.request({
|
|
458
|
-
path: `/ai/search/update`,
|
|
459
|
-
method: 'POST',
|
|
460
|
-
headers: headerParameters,
|
|
461
|
-
query: queryParameters,
|
|
462
|
-
body: SearchUpdateRequestToJSON(requestParameters.searchUpdateRequest),
|
|
463
|
-
}, initOverrides);
|
|
464
|
-
|
|
465
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => CacheSet200ResponseFromJSON(jsonValue));
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* Updates a previously ingested item by re-ingesting with the same ID. The Vectorize upsert operation is idempotent — re-ingesting with the same ID replaces the existing vector and metadata.
|
|
470
|
-
* Update an existing indexed item
|
|
471
|
-
*/
|
|
472
|
-
async searchUpdate(requestParameters: SearchUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CacheSet200Response> {
|
|
473
|
-
const response = await this.searchUpdateRaw(requestParameters, initOverrides);
|
|
474
|
-
return await response.value();
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Aerostack API
|
|
5
|
-
* Aerostack Platform API - Unified access to database, authentication, caching, queues, storage, and AI services.
|
|
6
|
-
*
|
|
7
|
-
* The version of the OpenAPI document: 1.5.0
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
-
* https://openapi-generator.tech
|
|
12
|
-
* Do not edit the class manually.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import * as runtime from '../runtime.js';
|
|
17
|
-
import type {
|
|
18
|
-
AuthResponse,
|
|
19
|
-
AuthSigninRequest,
|
|
20
|
-
AuthSignupRequest,
|
|
21
|
-
ErrorResponse,
|
|
22
|
-
} from '../models/index.js';
|
|
23
|
-
import {
|
|
24
|
-
AuthResponseFromJSON,
|
|
25
|
-
AuthResponseToJSON,
|
|
26
|
-
AuthSigninRequestFromJSON,
|
|
27
|
-
AuthSigninRequestToJSON,
|
|
28
|
-
AuthSignupRequestFromJSON,
|
|
29
|
-
AuthSignupRequestToJSON,
|
|
30
|
-
ErrorResponseFromJSON,
|
|
31
|
-
ErrorResponseToJSON,
|
|
32
|
-
} from '../models/index.js';
|
|
33
|
-
|
|
34
|
-
export interface AuthSigninOperationRequest {
|
|
35
|
-
authSigninRequest: AuthSigninRequest;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface AuthSignupOperationRequest {
|
|
39
|
-
authSignupRequest: AuthSignupRequest;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
*/
|
|
45
|
-
export class AuthenticationApi extends runtime.BaseAPI {
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Sign in user
|
|
49
|
-
*/
|
|
50
|
-
async authSigninRaw(requestParameters: AuthSigninOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthResponse>> {
|
|
51
|
-
if (requestParameters.authSigninRequest === null || requestParameters.authSigninRequest === undefined) {
|
|
52
|
-
throw new runtime.RequiredError('authSigninRequest','Required parameter requestParameters.authSigninRequest was null or undefined when calling authSignin.');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const queryParameters: any = {};
|
|
56
|
-
|
|
57
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
58
|
-
|
|
59
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
60
|
-
|
|
61
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
62
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const response = await this.request({
|
|
66
|
-
path: `/auth/signin`,
|
|
67
|
-
method: 'POST',
|
|
68
|
-
headers: headerParameters,
|
|
69
|
-
query: queryParameters,
|
|
70
|
-
body: AuthSigninRequestToJSON(requestParameters.authSigninRequest),
|
|
71
|
-
}, initOverrides);
|
|
72
|
-
|
|
73
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => AuthResponseFromJSON(jsonValue));
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Sign in user
|
|
78
|
-
*/
|
|
79
|
-
async authSignin(requestParameters: AuthSigninOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthResponse> {
|
|
80
|
-
const response = await this.authSigninRaw(requestParameters, initOverrides);
|
|
81
|
-
return await response.value();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Sign up new user
|
|
86
|
-
*/
|
|
87
|
-
async authSignupRaw(requestParameters: AuthSignupOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthResponse>> {
|
|
88
|
-
if (requestParameters.authSignupRequest === null || requestParameters.authSignupRequest === undefined) {
|
|
89
|
-
throw new runtime.RequiredError('authSignupRequest','Required parameter requestParameters.authSignupRequest was null or undefined when calling authSignup.');
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const queryParameters: any = {};
|
|
93
|
-
|
|
94
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
95
|
-
|
|
96
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
97
|
-
|
|
98
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
99
|
-
headerParameters["X-Aerostack-Key"] = this.configuration.apiKey("X-Aerostack-Key"); // ApiKeyAuth authentication
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const response = await this.request({
|
|
103
|
-
path: `/auth/signup`,
|
|
104
|
-
method: 'POST',
|
|
105
|
-
headers: headerParameters,
|
|
106
|
-
query: queryParameters,
|
|
107
|
-
body: AuthSignupRequestToJSON(requestParameters.authSignupRequest),
|
|
108
|
-
}, initOverrides);
|
|
109
|
-
|
|
110
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => AuthResponseFromJSON(jsonValue));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Sign up new user
|
|
115
|
-
*/
|
|
116
|
-
async authSignup(requestParameters: AuthSignupOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthResponse> {
|
|
117
|
-
const response = await this.authSignupRaw(requestParameters, initOverrides);
|
|
118
|
-
return await response.value();
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
}
|