@blinkdotnew/sdk 2.3.2 → 2.3.3
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/index.d.mts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +25 -1
- package/dist/index.mjs +25 -1
- package/package.json +2 -4
package/dist/index.d.mts
CHANGED
|
@@ -1145,6 +1145,20 @@ declare class HttpClient {
|
|
|
1145
1145
|
};
|
|
1146
1146
|
};
|
|
1147
1147
|
}, signal?: AbortSignal): Promise<Response>;
|
|
1148
|
+
/**
|
|
1149
|
+
* RAG AI Search streaming request
|
|
1150
|
+
* Returns raw Response for SSE streaming
|
|
1151
|
+
*/
|
|
1152
|
+
ragAiSearchStream(body: {
|
|
1153
|
+
collection_id?: string;
|
|
1154
|
+
collection_name?: string;
|
|
1155
|
+
query: string;
|
|
1156
|
+
model?: string;
|
|
1157
|
+
max_context_chunks?: number;
|
|
1158
|
+
score_threshold?: number;
|
|
1159
|
+
system_prompt?: string;
|
|
1160
|
+
stream: true;
|
|
1161
|
+
}, signal?: AbortSignal): Promise<Response>;
|
|
1148
1162
|
/**
|
|
1149
1163
|
* Data-specific requests
|
|
1150
1164
|
*/
|
|
@@ -2085,6 +2099,8 @@ interface AISearchOptions {
|
|
|
2085
2099
|
scoreThreshold?: number;
|
|
2086
2100
|
systemPrompt?: string;
|
|
2087
2101
|
stream?: boolean;
|
|
2102
|
+
/** AbortSignal for cancellation (streaming only) */
|
|
2103
|
+
signal?: AbortSignal;
|
|
2088
2104
|
}
|
|
2089
2105
|
interface ListDocumentsOptions {
|
|
2090
2106
|
collectionId?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1145,6 +1145,20 @@ declare class HttpClient {
|
|
|
1145
1145
|
};
|
|
1146
1146
|
};
|
|
1147
1147
|
}, signal?: AbortSignal): Promise<Response>;
|
|
1148
|
+
/**
|
|
1149
|
+
* RAG AI Search streaming request
|
|
1150
|
+
* Returns raw Response for SSE streaming
|
|
1151
|
+
*/
|
|
1152
|
+
ragAiSearchStream(body: {
|
|
1153
|
+
collection_id?: string;
|
|
1154
|
+
collection_name?: string;
|
|
1155
|
+
query: string;
|
|
1156
|
+
model?: string;
|
|
1157
|
+
max_context_chunks?: number;
|
|
1158
|
+
score_threshold?: number;
|
|
1159
|
+
system_prompt?: string;
|
|
1160
|
+
stream: true;
|
|
1161
|
+
}, signal?: AbortSignal): Promise<Response>;
|
|
1148
1162
|
/**
|
|
1149
1163
|
* Data-specific requests
|
|
1150
1164
|
*/
|
|
@@ -2085,6 +2099,8 @@ interface AISearchOptions {
|
|
|
2085
2099
|
scoreThreshold?: number;
|
|
2086
2100
|
systemPrompt?: string;
|
|
2087
2101
|
stream?: boolean;
|
|
2102
|
+
/** AbortSignal for cancellation (streaming only) */
|
|
2103
|
+
signal?: AbortSignal;
|
|
2088
2104
|
}
|
|
2089
2105
|
interface ListDocumentsOptions {
|
|
2090
2106
|
collectionId?: string;
|
package/dist/index.js
CHANGED
|
@@ -3503,6 +3503,29 @@ var HttpClient = class {
|
|
|
3503
3503
|
}
|
|
3504
3504
|
return response;
|
|
3505
3505
|
}
|
|
3506
|
+
/**
|
|
3507
|
+
* RAG AI Search streaming request
|
|
3508
|
+
* Returns raw Response for SSE streaming
|
|
3509
|
+
*/
|
|
3510
|
+
async ragAiSearchStream(body, signal) {
|
|
3511
|
+
const url = this.buildUrl(`/api/rag/${this.projectId}/ai-search`);
|
|
3512
|
+
const token = this.getValidToken ? await this.getValidToken() : this.getToken();
|
|
3513
|
+
const headers = {
|
|
3514
|
+
"Content-Type": "application/json"
|
|
3515
|
+
};
|
|
3516
|
+
const auth = this.getAuthorizationHeader(url, token);
|
|
3517
|
+
if (auth) headers.Authorization = auth;
|
|
3518
|
+
const response = await fetch(url, {
|
|
3519
|
+
method: "POST",
|
|
3520
|
+
headers,
|
|
3521
|
+
body: JSON.stringify(body),
|
|
3522
|
+
signal
|
|
3523
|
+
});
|
|
3524
|
+
if (!response.ok) {
|
|
3525
|
+
await this.handleErrorResponse(response);
|
|
3526
|
+
}
|
|
3527
|
+
return response;
|
|
3528
|
+
}
|
|
3506
3529
|
/**
|
|
3507
3530
|
* Data-specific requests
|
|
3508
3531
|
*/
|
|
@@ -9084,7 +9107,8 @@ var BlinkRAGImpl = class {
|
|
|
9084
9107
|
stream: options.stream
|
|
9085
9108
|
});
|
|
9086
9109
|
if (options.stream) {
|
|
9087
|
-
|
|
9110
|
+
const response2 = await this.httpClient.ragAiSearchStream(body, options.signal);
|
|
9111
|
+
return response2.body;
|
|
9088
9112
|
}
|
|
9089
9113
|
const response = await this.httpClient.post(this.url("/ai-search"), body);
|
|
9090
9114
|
return convertAISearchResult(response.data);
|
package/dist/index.mjs
CHANGED
|
@@ -3501,6 +3501,29 @@ var HttpClient = class {
|
|
|
3501
3501
|
}
|
|
3502
3502
|
return response;
|
|
3503
3503
|
}
|
|
3504
|
+
/**
|
|
3505
|
+
* RAG AI Search streaming request
|
|
3506
|
+
* Returns raw Response for SSE streaming
|
|
3507
|
+
*/
|
|
3508
|
+
async ragAiSearchStream(body, signal) {
|
|
3509
|
+
const url = this.buildUrl(`/api/rag/${this.projectId}/ai-search`);
|
|
3510
|
+
const token = this.getValidToken ? await this.getValidToken() : this.getToken();
|
|
3511
|
+
const headers = {
|
|
3512
|
+
"Content-Type": "application/json"
|
|
3513
|
+
};
|
|
3514
|
+
const auth = this.getAuthorizationHeader(url, token);
|
|
3515
|
+
if (auth) headers.Authorization = auth;
|
|
3516
|
+
const response = await fetch(url, {
|
|
3517
|
+
method: "POST",
|
|
3518
|
+
headers,
|
|
3519
|
+
body: JSON.stringify(body),
|
|
3520
|
+
signal
|
|
3521
|
+
});
|
|
3522
|
+
if (!response.ok) {
|
|
3523
|
+
await this.handleErrorResponse(response);
|
|
3524
|
+
}
|
|
3525
|
+
return response;
|
|
3526
|
+
}
|
|
3504
3527
|
/**
|
|
3505
3528
|
* Data-specific requests
|
|
3506
3529
|
*/
|
|
@@ -9082,7 +9105,8 @@ var BlinkRAGImpl = class {
|
|
|
9082
9105
|
stream: options.stream
|
|
9083
9106
|
});
|
|
9084
9107
|
if (options.stream) {
|
|
9085
|
-
|
|
9108
|
+
const response2 = await this.httpClient.ragAiSearchStream(body, options.signal);
|
|
9109
|
+
return response2.body;
|
|
9086
9110
|
}
|
|
9087
9111
|
const response = await this.httpClient.post(this.url("/ai-search"), body);
|
|
9088
9112
|
return convertAISearchResult(response.data);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blinkdotnew/sdk",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "Blink TypeScript SDK for client-side applications - Zero-boilerplate CRUD + auth + AI + analytics + notifications for modern SaaS/AI apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"blink",
|
|
@@ -51,10 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@blink/core": "0.4.1",
|
|
55
54
|
"tsup": "^8.0.0",
|
|
56
|
-
"typescript": "^5.0.0"
|
|
57
|
-
"@blinkdotnew/dev-sdk": "workspace:*"
|
|
55
|
+
"typescript": "^5.0.0"
|
|
58
56
|
},
|
|
59
57
|
"peerDependencies": {},
|
|
60
58
|
"publishConfig": {
|