oblien 1.2.4 → 1.2.6
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/README.md +11 -7
- package/browser.js +6 -0
- package/cdn.js +6 -0
- package/index.d.ts +300 -0
- package/index.js +6 -0
- package/package.json +13 -3
- package/src/browser/index.js +424 -0
- package/src/cdn/index.js +744 -0
package/README.md
CHANGED
|
@@ -15,13 +15,17 @@ npm install oblien
|
|
|
15
15
|
import { OblienClient } from 'oblien';
|
|
16
16
|
|
|
17
17
|
// Import modules (tree-shakeable)
|
|
18
|
-
import { OblienAgents } from 'oblien/agents';
|
|
19
|
-
import { OblienChat } from 'oblien/chat';
|
|
20
|
-
import { OblienSandboxes } from 'oblien/sandbox';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
18
|
+
import { OblienAgents } from 'oblien/agents'; // agent creation
|
|
19
|
+
import { OblienChat } from 'oblien/chat'; // agent chat managment
|
|
20
|
+
import { OblienSandboxes } from 'oblien/sandbox'; // sandbox for agent code execution
|
|
21
|
+
import { OblienEmbeddings } from 'oblien/embeddings'; // embeddings store for semantic search
|
|
22
|
+
import { OblienSearch } from 'oblien/search'; // search gateway for your agent
|
|
23
|
+
import { OblienIcons } from 'oblien/icons'; // sematic based icons fetch
|
|
24
|
+
import { OblienNamespaces } from 'oblien/namespaces'; // user and guest management
|
|
25
|
+
import { OblienCredits } from 'oblien/credits'; // credits managemnt for your user
|
|
26
|
+
import { OblienCDN } from 'oblien/cdn'; // cdn upload for your app
|
|
27
|
+
import { OblienBrowser } from 'oblien/browser'; // browser api for scrap or any task
|
|
28
|
+
import { OblienDeployments } from 'oblien/deployments'; // deployments gateway
|
|
25
29
|
|
|
26
30
|
// Initialize client
|
|
27
31
|
const client = new OblienClient({
|
package/browser.js
ADDED
package/cdn.js
ADDED
package/index.d.ts
CHANGED
|
@@ -649,6 +649,304 @@ export class OblienCredits {
|
|
|
649
649
|
cancelPurchase(purchaseId: string): Promise<any>;
|
|
650
650
|
}
|
|
651
651
|
|
|
652
|
+
// ============ CDN Types ============
|
|
653
|
+
|
|
654
|
+
export interface CDNConfig {
|
|
655
|
+
cdnURL?: string;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
// ============ Browser Types ============
|
|
659
|
+
|
|
660
|
+
export interface BrowserConfig {
|
|
661
|
+
browserURL?: string;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
export interface BrowserTokenResponse {
|
|
665
|
+
success: boolean;
|
|
666
|
+
token: string;
|
|
667
|
+
expiresIn: string;
|
|
668
|
+
message: string;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export interface PageContentOptions {
|
|
672
|
+
url: string;
|
|
673
|
+
token?: string;
|
|
674
|
+
waitFor?: number;
|
|
675
|
+
selector?: string;
|
|
676
|
+
extract?: 'html' | 'text' | 'both';
|
|
677
|
+
waitForFullLoad?: boolean;
|
|
678
|
+
useProxy?: boolean;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
export interface PageContentResult {
|
|
682
|
+
success: boolean;
|
|
683
|
+
url: string;
|
|
684
|
+
html?: string;
|
|
685
|
+
text?: string;
|
|
686
|
+
title?: string;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
export interface ScreenshotOptions {
|
|
690
|
+
url: string;
|
|
691
|
+
token?: string;
|
|
692
|
+
fullPage?: boolean;
|
|
693
|
+
format?: 'png' | 'jpeg';
|
|
694
|
+
quality?: number;
|
|
695
|
+
viewport?: { width: number; height: number };
|
|
696
|
+
device?: string;
|
|
697
|
+
useProxy?: boolean;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
export interface ScreenshotResult {
|
|
701
|
+
success: boolean;
|
|
702
|
+
screenshot: string;
|
|
703
|
+
format: string;
|
|
704
|
+
width: number;
|
|
705
|
+
height: number;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
export interface PdfOptions {
|
|
709
|
+
url: string;
|
|
710
|
+
token?: string;
|
|
711
|
+
format?: string;
|
|
712
|
+
landscape?: boolean;
|
|
713
|
+
printBackground?: boolean;
|
|
714
|
+
margin?: { top?: string; right?: string; bottom?: string; left?: string };
|
|
715
|
+
useProxy?: boolean;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
export interface PdfResult {
|
|
719
|
+
success: boolean;
|
|
720
|
+
pdf: string;
|
|
721
|
+
format: string;
|
|
722
|
+
pages: number;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
export interface MonitorRequestsOptions {
|
|
726
|
+
url: string;
|
|
727
|
+
token?: string;
|
|
728
|
+
duration?: number;
|
|
729
|
+
filterTypes?: string[];
|
|
730
|
+
useProxy?: boolean;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
export interface MonitorRequestsResult {
|
|
734
|
+
success: boolean;
|
|
735
|
+
requests: Array<{
|
|
736
|
+
url: string;
|
|
737
|
+
method: string;
|
|
738
|
+
type: string;
|
|
739
|
+
status?: number;
|
|
740
|
+
}>;
|
|
741
|
+
count: number;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
export interface ConsoleLogsOptions {
|
|
745
|
+
url: string;
|
|
746
|
+
token?: string;
|
|
747
|
+
duration?: number;
|
|
748
|
+
useProxy?: boolean;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
export interface ConsoleLogsResult {
|
|
752
|
+
success: boolean;
|
|
753
|
+
logs: Array<{
|
|
754
|
+
type: string;
|
|
755
|
+
text: string;
|
|
756
|
+
timestamp: string;
|
|
757
|
+
}>;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
export class OblienBrowser {
|
|
761
|
+
constructor(client: OblienClient, config?: BrowserConfig);
|
|
762
|
+
|
|
763
|
+
// Token Management
|
|
764
|
+
generateToken(): Promise<BrowserTokenResponse>;
|
|
765
|
+
clearTokenCache(): void;
|
|
766
|
+
|
|
767
|
+
// Browser Operations
|
|
768
|
+
getPageContent(options: PageContentOptions): Promise<PageContentResult>;
|
|
769
|
+
screenshot(options: ScreenshotOptions): Promise<ScreenshotResult>;
|
|
770
|
+
pdf(options: PdfOptions): Promise<PdfResult>;
|
|
771
|
+
monitorRequests(options: MonitorRequestsOptions): Promise<MonitorRequestsResult>;
|
|
772
|
+
getConsoleLogs(options: ConsoleLogsOptions): Promise<ConsoleLogsResult>;
|
|
773
|
+
getDevicePresets(options?: { token?: string }): Promise<any>;
|
|
774
|
+
getStatus(options?: { token?: string }): Promise<any>;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
export interface TokenResponse {
|
|
778
|
+
success: boolean;
|
|
779
|
+
token: string;
|
|
780
|
+
scope: 'user' | 'admin';
|
|
781
|
+
permissions: string[];
|
|
782
|
+
expiresIn: string;
|
|
783
|
+
message: string;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
export interface MulterFile {
|
|
787
|
+
buffer: Buffer;
|
|
788
|
+
originalname: string;
|
|
789
|
+
mimetype: string;
|
|
790
|
+
size: number;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
export interface UploadOptions {
|
|
794
|
+
token?: string;
|
|
795
|
+
filename?: string;
|
|
796
|
+
mimetype?: string;
|
|
797
|
+
scope?: 'user' | 'admin';
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
export interface MultiUploadOptions {
|
|
801
|
+
token?: string;
|
|
802
|
+
filenames?: string[];
|
|
803
|
+
scope?: 'user' | 'admin';
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
export interface UploadFromUrlsOptions {
|
|
807
|
+
token?: string;
|
|
808
|
+
scope?: 'user' | 'admin';
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
export interface FileInfoOptions {
|
|
812
|
+
token?: string;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
export interface UploadResult {
|
|
816
|
+
success: boolean;
|
|
817
|
+
file: {
|
|
818
|
+
url: string;
|
|
819
|
+
filename: string;
|
|
820
|
+
size: number;
|
|
821
|
+
mimetype: string;
|
|
822
|
+
variants?: Record<string, string>;
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
export interface MultiUploadResult {
|
|
827
|
+
success: boolean;
|
|
828
|
+
files: Array<{
|
|
829
|
+
url: string;
|
|
830
|
+
filename: string;
|
|
831
|
+
size: number;
|
|
832
|
+
mimetype: string;
|
|
833
|
+
variants?: Record<string, string>;
|
|
834
|
+
}>;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
export interface FileInfo {
|
|
838
|
+
success: boolean;
|
|
839
|
+
file: {
|
|
840
|
+
path: string;
|
|
841
|
+
size: number;
|
|
842
|
+
mimetype: string;
|
|
843
|
+
created: string;
|
|
844
|
+
variants?: Record<string, string>;
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
export interface ListFilesOptions {
|
|
849
|
+
page?: number;
|
|
850
|
+
limit?: number;
|
|
851
|
+
includeDeleted?: boolean;
|
|
852
|
+
uploadType?: 'upload' | 'url';
|
|
853
|
+
sortBy?: 'created_at' | 'size' | 'filename';
|
|
854
|
+
sortOrder?: 'ASC' | 'DESC';
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
export interface CDNFile {
|
|
858
|
+
id: number;
|
|
859
|
+
user_id: string;
|
|
860
|
+
filename: string;
|
|
861
|
+
original_filename: string | null;
|
|
862
|
+
original_url: string | null;
|
|
863
|
+
file_path: string;
|
|
864
|
+
cdn_url: string;
|
|
865
|
+
size: number;
|
|
866
|
+
mime_type: string;
|
|
867
|
+
variants: Array<{
|
|
868
|
+
variant: string;
|
|
869
|
+
url: string;
|
|
870
|
+
}>;
|
|
871
|
+
metadata: Record<string, any>;
|
|
872
|
+
upload_type: 'upload' | 'url';
|
|
873
|
+
is_deleted: boolean;
|
|
874
|
+
deleted_at: string | null;
|
|
875
|
+
created_at: string;
|
|
876
|
+
updated_at: string;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
export interface ListFilesResult {
|
|
880
|
+
success: boolean;
|
|
881
|
+
data: {
|
|
882
|
+
files: CDNFile[];
|
|
883
|
+
pagination: {
|
|
884
|
+
page: number;
|
|
885
|
+
limit: number;
|
|
886
|
+
total: number;
|
|
887
|
+
totalPages: number;
|
|
888
|
+
hasMore: boolean;
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
export interface StorageStats {
|
|
894
|
+
success: boolean;
|
|
895
|
+
data: {
|
|
896
|
+
totalFiles: number;
|
|
897
|
+
totalSize: number;
|
|
898
|
+
activeFiles: number;
|
|
899
|
+
activeSize: number;
|
|
900
|
+
uploadedFiles: number;
|
|
901
|
+
urlFiles: number;
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
export interface GetFileResult {
|
|
906
|
+
success: boolean;
|
|
907
|
+
data: CDNFile;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
export interface DeleteFileResult {
|
|
911
|
+
success: boolean;
|
|
912
|
+
message: string;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
export interface RestoreFileResult {
|
|
916
|
+
success: boolean;
|
|
917
|
+
message: string;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
export class OblienCDN {
|
|
921
|
+
constructor(client: OblienClient, config?: CDNConfig);
|
|
922
|
+
|
|
923
|
+
// Token Management
|
|
924
|
+
generateUserToken(): Promise<TokenResponse>;
|
|
925
|
+
generateAdminToken(): Promise<TokenResponse>;
|
|
926
|
+
clearTokenCache(scope?: 'user' | 'admin' | 'all'): void;
|
|
927
|
+
|
|
928
|
+
// File Upload
|
|
929
|
+
upload(file: Buffer | string | MulterFile, options?: UploadOptions): Promise<UploadResult>;
|
|
930
|
+
uploadMultiple(files: Array<Buffer | string | MulterFile>, options?: MultiUploadOptions): Promise<MultiUploadResult>;
|
|
931
|
+
|
|
932
|
+
// URL Upload
|
|
933
|
+
uploadFromUrls(urls: string[], options?: UploadFromUrlsOptions): Promise<MultiUploadResult>;
|
|
934
|
+
|
|
935
|
+
// File Info (Admin Only)
|
|
936
|
+
getFileInfo(filePath: string, options?: FileInfoOptions): Promise<FileInfo>;
|
|
937
|
+
|
|
938
|
+
// Metadata
|
|
939
|
+
getVariants(options?: { token?: string }): Promise<any>;
|
|
940
|
+
getLimits(options?: { token?: string }): Promise<any>;
|
|
941
|
+
|
|
942
|
+
// File Management (Session-based)
|
|
943
|
+
listFiles(options?: ListFilesOptions): Promise<ListFilesResult>;
|
|
944
|
+
getStats(): Promise<StorageStats>;
|
|
945
|
+
getFile(fileId: number | string): Promise<GetFileResult>;
|
|
946
|
+
deleteFile(fileId: number | string): Promise<DeleteFileResult>;
|
|
947
|
+
restoreFile(fileId: number | string): Promise<RestoreFileResult>;
|
|
948
|
+
}
|
|
949
|
+
|
|
652
950
|
// ============ Exports ============
|
|
653
951
|
|
|
654
952
|
declare const _default: {
|
|
@@ -658,6 +956,8 @@ declare const _default: {
|
|
|
658
956
|
OblienNamespaces: typeof OblienNamespaces;
|
|
659
957
|
Namespace: typeof Namespace;
|
|
660
958
|
OblienCredits: typeof OblienCredits;
|
|
959
|
+
OblienCDN: typeof OblienCDN;
|
|
960
|
+
OblienBrowser: typeof OblienBrowser;
|
|
661
961
|
GuestManager: typeof GuestManager;
|
|
662
962
|
NodeCacheStorage: typeof NodeCacheStorage;
|
|
663
963
|
InMemoryStorage: typeof InMemoryStorage;
|
package/index.js
CHANGED
|
@@ -9,6 +9,8 @@ import { OblienAgents, Agent, Tools, AgentSettings } from './src/agents/index.js
|
|
|
9
9
|
import { OblienSandboxes, Sandbox } from './src/sandbox/index.js';
|
|
10
10
|
import { OblienSearch } from './src/search/index.js';
|
|
11
11
|
import { OblienIcons } from './src/icons/index.js';
|
|
12
|
+
import { OblienCDN } from './src/cdn/index.js';
|
|
13
|
+
import { OblienBrowser } from './src/browser/index.js';
|
|
12
14
|
import { OblienNamespaces, Namespace } from './src/namespaces/index.js';
|
|
13
15
|
import { OblienCredits } from './src/credits/index.js';
|
|
14
16
|
import {
|
|
@@ -25,6 +27,8 @@ export { OblienAgents, Agent, Tools, AgentSettings };
|
|
|
25
27
|
export { OblienSandboxes, Sandbox };
|
|
26
28
|
export { OblienSearch };
|
|
27
29
|
export { OblienIcons };
|
|
30
|
+
export { OblienCDN };
|
|
31
|
+
export { OblienBrowser };
|
|
28
32
|
export { OblienNamespaces, Namespace };
|
|
29
33
|
export { OblienCredits };
|
|
30
34
|
export {
|
|
@@ -47,6 +51,8 @@ export default {
|
|
|
47
51
|
Sandbox,
|
|
48
52
|
OblienSearch,
|
|
49
53
|
OblienIcons,
|
|
54
|
+
OblienCDN,
|
|
55
|
+
OblienBrowser,
|
|
50
56
|
OblienNamespaces,
|
|
51
57
|
Namespace,
|
|
52
58
|
OblienCredits,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oblien",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "Server-side SDK for Oblien AI Platform - Build AI-powered applications with chat, agents, and workflows",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"./agents": "./agents.js",
|
|
14
14
|
"./sandbox": "./sandbox.js",
|
|
15
15
|
"./search": "./search.js",
|
|
16
|
-
"./icons": "./icons.js"
|
|
16
|
+
"./icons": "./icons.js",
|
|
17
|
+
"./cdn": "./cdn.js",
|
|
18
|
+
"./browser": "./browser.js"
|
|
17
19
|
},
|
|
18
20
|
"scripts": {
|
|
19
21
|
"test": "node --test tests/**/*.test.js"
|
|
@@ -28,7 +30,13 @@
|
|
|
28
30
|
"api",
|
|
29
31
|
"server-side",
|
|
30
32
|
"llm",
|
|
31
|
-
"assistant"
|
|
33
|
+
"assistant",
|
|
34
|
+
"cdn",
|
|
35
|
+
"file-upload",
|
|
36
|
+
"image-processing",
|
|
37
|
+
"browser-automation",
|
|
38
|
+
"puppeteer",
|
|
39
|
+
"scraping"
|
|
32
40
|
],
|
|
33
41
|
"author": "Oblien",
|
|
34
42
|
"license": "MIT",
|
|
@@ -68,6 +76,8 @@
|
|
|
68
76
|
"sandbox.js",
|
|
69
77
|
"search.js",
|
|
70
78
|
"icons.js",
|
|
79
|
+
"cdn.js",
|
|
80
|
+
"browser.js",
|
|
71
81
|
"workflows.js",
|
|
72
82
|
"README.md",
|
|
73
83
|
"LICENSE"
|