@fencyai/js 0.1.47 → 0.1.48
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/lib/api/createStream.js +4 -2
- package/lib/api/createWebsite.js +7 -2
- package/lib/index.d.ts +2 -2
- package/lib/openapi/index.d.ts +3 -0
- package/lib/openapi/models/CreateWebsiteRequest.d.ts +1 -0
- package/lib/openapi/models/FileTextContentReadyEventDto.d.ts +1 -1
- package/lib/openapi/models/PubWebsiteDto.d.ts +1 -1
- package/lib/openapi/models/StoredWebsiteId.d.ts +3 -0
- package/lib/openapi/models/StreamEventType.d.ts +3 -1
- package/lib/openapi/models/StreamEventType.js +2 -0
- package/lib/openapi/models/StreamType.d.ts +2 -1
- package/lib/openapi/models/StreamType.js +2 -1
- package/lib/openapi/models/WebsiteHtmlContentReadyEventDto.d.ts +10 -0
- package/lib/openapi/models/WebsiteTextContentReadyEventDto.d.ts +10 -0
- package/lib/openapi/models/WebsiteTextContentReadyEventDto.js +1 -0
- package/lib/openapi/services/PubService.d.ts +3 -1
- package/lib/types/CreateStreamRequest.d.ts +1 -1
- package/lib/types/CreateUploadResponse.d.ts +2 -2
- package/lib/types/CreateWebsiteRequest.d.ts +1 -0
- package/lib/types/CreateWebsiteResponse.d.ts +2 -2
- package/lib/types/FencyFile.d.ts +4 -3
- package/lib/types/StreamData.d.ts +15 -1
- package/lib/types/{FencyUpload.d.ts → Upload.d.ts} +1 -1
- package/lib/types/Upload.js +1 -0
- package/lib/types/Website.d.ts +7 -0
- package/lib/types/Website.js +1 -0
- package/lib/utils/version.js +1 -1
- package/package.json +2 -2
- package/lib/types/FencyWebsite.d.ts +0 -5
- /package/lib/{types/FencyUpload.js → openapi/models/StoredWebsiteId.js} +0 -0
- /package/lib/{types/FencyWebsite.js → openapi/models/WebsiteHtmlContentReadyEventDto.js} +0 -0
package/lib/api/createStream.js
CHANGED
|
@@ -47,7 +47,9 @@ const mapTypeToStreamType = (type) => {
|
|
|
47
47
|
switch (type) {
|
|
48
48
|
case 'ChatCompletionStream':
|
|
49
49
|
return StreamType.CHAT_COMPLETION_STREAM;
|
|
50
|
-
case '
|
|
51
|
-
return StreamType.
|
|
50
|
+
case 'FileStream':
|
|
51
|
+
return StreamType.FILE_STREAM;
|
|
52
|
+
case 'WebsiteStream':
|
|
53
|
+
return StreamType.WEBSITE_STREAM;
|
|
52
54
|
}
|
|
53
55
|
};
|
package/lib/api/createWebsite.js
CHANGED
|
@@ -17,13 +17,18 @@ export async function createWebsite(params) {
|
|
|
17
17
|
Authorization: `Bearer ${params.pk}`,
|
|
18
18
|
'X-Fency-Sdk-Version': getPackageVersion(),
|
|
19
19
|
};
|
|
20
|
-
const response = await PubService.createWebsite(
|
|
20
|
+
const response = await PubService.createWebsite({
|
|
21
|
+
url: params.request.url,
|
|
22
|
+
streamId: params.request.streamId,
|
|
23
|
+
});
|
|
21
24
|
return {
|
|
22
25
|
type: 'success',
|
|
23
26
|
website: {
|
|
24
27
|
id: response.id,
|
|
25
28
|
createdAt: response.createdAt,
|
|
26
|
-
|
|
29
|
+
url: response.url,
|
|
30
|
+
content: null,
|
|
31
|
+
text: null,
|
|
27
32
|
},
|
|
28
33
|
};
|
|
29
34
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -12,8 +12,8 @@ export type { CreateOpenAiChatCompletionParams } from './types/CreateOpenAiChatC
|
|
|
12
12
|
export type { CreateStreamRequest } from './types/CreateStreamRequest';
|
|
13
13
|
export type { CreateStreamResponse } from './types/CreateStreamResponse';
|
|
14
14
|
export type { CreateWebsiteRequest } from './types/CreateWebsiteRequest';
|
|
15
|
-
export type {
|
|
16
|
-
export type {
|
|
15
|
+
export type { Upload } from './types/Upload';
|
|
16
|
+
export type { Website } from './types/Website';
|
|
17
17
|
export type { GeminiModel } from './types/GeminiModel';
|
|
18
18
|
export type { OpenAiModel } from './types/OpenAiModel';
|
|
19
19
|
export type { Stream } from './types/Stream';
|
package/lib/openapi/index.d.ts
CHANGED
|
@@ -24,9 +24,12 @@ export type { StoredChatCompletionId } from './models/StoredChatCompletionId';
|
|
|
24
24
|
export type { StoredFileId } from './models/StoredFileId';
|
|
25
25
|
export type { StoredStreamId } from './models/StoredStreamId';
|
|
26
26
|
export type { StoredUploadId } from './models/StoredUploadId';
|
|
27
|
+
export type { StoredWebsiteId } from './models/StoredWebsiteId';
|
|
27
28
|
export type { StreamDto } from './models/StreamDto';
|
|
28
29
|
export { StreamEventType } from './models/StreamEventType';
|
|
29
30
|
export type { StreamNotFoundEventDto } from './models/StreamNotFoundEventDto';
|
|
30
31
|
export type { StreamTimeoutEventDto } from './models/StreamTimeoutEventDto';
|
|
31
32
|
export { StreamType } from './models/StreamType';
|
|
33
|
+
export type { WebsiteHtmlContentReadyEventDto } from './models/WebsiteHtmlContentReadyEventDto';
|
|
34
|
+
export type { WebsiteTextContentReadyEventDto } from './models/WebsiteTextContentReadyEventDto';
|
|
32
35
|
export { PubService } from './services/PubService';
|
|
@@ -4,5 +4,7 @@ export declare enum StreamEventType {
|
|
|
4
4
|
STREAM_TIMEOUT = "StreamTimeout",
|
|
5
5
|
STREAM_NOT_FOUND = "StreamNotFound",
|
|
6
6
|
FILE_UPLOAD_COMPLETED = "FileUploadCompleted",
|
|
7
|
-
FILE_TEXT_CONTENT_READY = "FileTextContentReady"
|
|
7
|
+
FILE_TEXT_CONTENT_READY = "FileTextContentReady",
|
|
8
|
+
WEBSITE_HTML_CONTENT_READY = "WebsiteHtmlContentReady",
|
|
9
|
+
WEBSITE_TEXT_CONTENT_READY = "WebsiteTextContentReady"
|
|
8
10
|
}
|
|
@@ -10,4 +10,6 @@ export var StreamEventType;
|
|
|
10
10
|
StreamEventType["STREAM_NOT_FOUND"] = "StreamNotFound";
|
|
11
11
|
StreamEventType["FILE_UPLOAD_COMPLETED"] = "FileUploadCompleted";
|
|
12
12
|
StreamEventType["FILE_TEXT_CONTENT_READY"] = "FileTextContentReady";
|
|
13
|
+
StreamEventType["WEBSITE_HTML_CONTENT_READY"] = "WebsiteHtmlContentReady";
|
|
14
|
+
StreamEventType["WEBSITE_TEXT_CONTENT_READY"] = "WebsiteTextContentReady";
|
|
13
15
|
})(StreamEventType || (StreamEventType = {}));
|
|
@@ -5,5 +5,6 @@
|
|
|
5
5
|
export var StreamType;
|
|
6
6
|
(function (StreamType) {
|
|
7
7
|
StreamType["CHAT_COMPLETION_STREAM"] = "ChatCompletionStream";
|
|
8
|
-
StreamType["
|
|
8
|
+
StreamType["FILE_STREAM"] = "FileStream";
|
|
9
|
+
StreamType["WEBSITE_STREAM"] = "WebsiteStream";
|
|
9
10
|
})(StreamType || (StreamType = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StoredStreamId } from './StoredStreamId';
|
|
2
|
+
import type { StoredWebsiteId } from './StoredWebsiteId';
|
|
3
|
+
import type { StreamEventType } from './StreamEventType';
|
|
4
|
+
export type WebsiteHtmlContentReadyEventDto = {
|
|
5
|
+
type: StreamEventType;
|
|
6
|
+
streamId: StoredStreamId;
|
|
7
|
+
websiteId: StoredWebsiteId;
|
|
8
|
+
htmlContent: string;
|
|
9
|
+
timestamp: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StoredStreamId } from './StoredStreamId';
|
|
2
|
+
import type { StoredWebsiteId } from './StoredWebsiteId';
|
|
3
|
+
import type { StreamEventType } from './StreamEventType';
|
|
4
|
+
export type WebsiteTextContentReadyEventDto = {
|
|
5
|
+
type: StreamEventType;
|
|
6
|
+
streamId: StoredStreamId;
|
|
7
|
+
websiteId: StoredWebsiteId;
|
|
8
|
+
textContent: string;
|
|
9
|
+
timestamp: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -12,6 +12,8 @@ import type { PubWebsiteDto } from '../models/PubWebsiteDto';
|
|
|
12
12
|
import type { StreamDto } from '../models/StreamDto';
|
|
13
13
|
import type { StreamNotFoundEventDto } from '../models/StreamNotFoundEventDto';
|
|
14
14
|
import type { StreamTimeoutEventDto } from '../models/StreamTimeoutEventDto';
|
|
15
|
+
import type { WebsiteHtmlContentReadyEventDto } from '../models/WebsiteHtmlContentReadyEventDto';
|
|
16
|
+
import type { WebsiteTextContentReadyEventDto } from '../models/WebsiteTextContentReadyEventDto';
|
|
15
17
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
16
18
|
export declare class PubService {
|
|
17
19
|
/**
|
|
@@ -33,7 +35,7 @@ export declare class PubService {
|
|
|
33
35
|
* @returns any OK
|
|
34
36
|
* @throws ApiError
|
|
35
37
|
*/
|
|
36
|
-
static getPubTypes(): CancelablePromise<(StreamTimeoutEventDto | StreamNotFoundEventDto | NewChatCompletionStreamChunkEventDto | ChatCompletionStreamCompletedEventDto | FileUploadCompletedEventDto | FileTextContentReadyEventDto)>;
|
|
38
|
+
static getPubTypes(): CancelablePromise<(StreamTimeoutEventDto | StreamNotFoundEventDto | NewChatCompletionStreamChunkEventDto | ChatCompletionStreamCompletedEventDto | FileUploadCompletedEventDto | FileTextContentReadyEventDto | WebsiteHtmlContentReadyEventDto | WebsiteTextContentReadyEventDto)>;
|
|
37
39
|
/**
|
|
38
40
|
* Create Upload
|
|
39
41
|
* @param requestBody
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ApiError } from './ApiError';
|
|
2
|
-
import {
|
|
2
|
+
import { Upload } from './Upload';
|
|
3
3
|
export type CreateUploadResponse = {
|
|
4
4
|
type: 'success';
|
|
5
|
-
upload:
|
|
5
|
+
upload: Upload;
|
|
6
6
|
} | {
|
|
7
7
|
type: 'error';
|
|
8
8
|
error: ApiError;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ApiError } from './ApiError';
|
|
2
|
-
import {
|
|
2
|
+
import { Website } from './Website';
|
|
3
3
|
export type CreateWebsiteResponse = {
|
|
4
4
|
type: 'success';
|
|
5
|
-
website:
|
|
5
|
+
website: Website;
|
|
6
6
|
} | {
|
|
7
7
|
type: 'error';
|
|
8
8
|
error: ApiError;
|
package/lib/types/FencyFile.d.ts
CHANGED
|
@@ -36,4 +36,18 @@ export type FileTextContentReady = {
|
|
|
36
36
|
text: string;
|
|
37
37
|
timestamp: string;
|
|
38
38
|
};
|
|
39
|
-
export type
|
|
39
|
+
export type WebsiteHtmlContentReady = {
|
|
40
|
+
type: 'WebsiteHtmlContentReady';
|
|
41
|
+
streamId: string;
|
|
42
|
+
websiteId: string;
|
|
43
|
+
htmlContent: string;
|
|
44
|
+
timestamp: string;
|
|
45
|
+
};
|
|
46
|
+
export type WebsiteTextContentReady = {
|
|
47
|
+
type: 'WebsiteTextContentReady';
|
|
48
|
+
streamId: string;
|
|
49
|
+
websiteId: string;
|
|
50
|
+
textContent: string;
|
|
51
|
+
timestamp: string;
|
|
52
|
+
};
|
|
53
|
+
export type StreamData = NewChatCompletionStreamChunk | ChatCompletionStreamCompleted | StreamTimeout | StreamNotFound | FileUploadCompleted | FileTextContentReady | WebsiteHtmlContentReady | WebsiteTextContentReady;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/utils/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Browser-compatible version utility
|
|
2
2
|
// The version is set at build time and can be overridden if needed
|
|
3
3
|
// Build-time version constant - this should be updated during the build process
|
|
4
|
-
const SDK_VERSION = '0.1.
|
|
4
|
+
const SDK_VERSION = '0.1.48';
|
|
5
5
|
// Allow runtime override if needed
|
|
6
6
|
let versionOverride = null;
|
|
7
7
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.48",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"ts-jest": "^29.1.1",
|
|
42
42
|
"typescript": "^5.3.3"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "889ff241bad28cb096835f3e72389bfdcf1d51ee"
|
|
45
45
|
}
|
|
File without changes
|
|
File without changes
|