@sovaria/sdk 0.0.0-stage → 0.4.0

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.
@@ -0,0 +1,102 @@
1
+ export interface SovariaClientOptions {
2
+ accessToken?: string;
3
+ refreshToken?: string;
4
+ onTokenRefresh?: (tokens: TokenResponse) => void;
5
+ }
6
+ export { SovariaError } from './errors.js';
7
+ export interface TokenResponse {
8
+ access_token: string;
9
+ refresh_token: string;
10
+ expires_in: number;
11
+ token_type?: string;
12
+ }
13
+ export interface UserProfile {
14
+ user_id?: string;
15
+ email?: string;
16
+ org_id?: string;
17
+ project_id?: string;
18
+ roles?: string[];
19
+ [key: string]: unknown;
20
+ }
21
+ export interface NodeResponse {
22
+ node_id?: string;
23
+ id?: string;
24
+ type?: string;
25
+ name?: string;
26
+ metadata?: Record<string, unknown>;
27
+ [key: string]: unknown;
28
+ }
29
+ export interface ColumnDefinition {
30
+ name: string;
31
+ type: string;
32
+ nullable?: boolean;
33
+ primary_key?: boolean;
34
+ default?: unknown;
35
+ }
36
+ export interface SqlQueryResult {
37
+ rows: Record<string, unknown>[];
38
+ row_count?: number;
39
+ }
40
+ export interface DocumentPutResponse {
41
+ ok?: boolean;
42
+ key?: string;
43
+ [key: string]: unknown;
44
+ }
45
+ export interface DocumentGetResponse {
46
+ key?: string;
47
+ value?: Record<string, unknown>;
48
+ [key: string]: unknown;
49
+ }
50
+ export interface DocumentScanResult {
51
+ items?: Array<Record<string, unknown>>;
52
+ count?: number;
53
+ [key: string]: unknown;
54
+ }
55
+ export interface StorageObject {
56
+ path: string;
57
+ size?: number;
58
+ content_type?: string;
59
+ metadata?: Record<string, unknown>;
60
+ [key: string]: unknown;
61
+ }
62
+ export interface Bucket {
63
+ name: string;
64
+ public?: boolean;
65
+ metadata?: Record<string, unknown>;
66
+ [key: string]: unknown;
67
+ }
68
+ export interface BucketListResponse {
69
+ buckets: Bucket[];
70
+ }
71
+ export interface ObjectListResponse {
72
+ objects: StorageObject[];
73
+ }
74
+ export interface FunctionDeployResponse {
75
+ deployment_id?: string;
76
+ status?: string;
77
+ [key: string]: unknown;
78
+ }
79
+ export interface FunctionInvokeResponse {
80
+ output?: unknown;
81
+ status?: string;
82
+ [key: string]: unknown;
83
+ }
84
+ export interface RealtimeEvent {
85
+ type: string;
86
+ channel: string;
87
+ payload: unknown;
88
+ }
89
+ export type RealtimeCallback = (event: RealtimeEvent) => void;
90
+ export interface RealtimeSubscription {
91
+ unsubscribe: () => void;
92
+ }
93
+ export interface TimelineLogResponse {
94
+ timeline?: string;
95
+ events?: Array<Record<string, unknown>>;
96
+ [key: string]: unknown;
97
+ }
98
+ export interface TimelineJumpResponse {
99
+ timeline?: string;
100
+ target_hex?: string;
101
+ [key: string]: unknown;
102
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export { SovariaError } from './errors.js';
package/package.json CHANGED
@@ -1,6 +1,76 @@
1
1
  {
2
2
  "name": "@sovaria/sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.0",
4
+ "description": "Official JavaScript/TypeScript SDK for Sovaria: database (SQL and documents), auth, storage, realtime, functions and the full Sovaria API",
5
+ "keywords": [
6
+ "sovaria",
7
+ "sdk",
8
+ "baas",
9
+ "backend",
10
+ "database",
11
+ "postgres",
12
+ "auth",
13
+ "storage",
14
+ "realtime",
15
+ "firestore",
16
+ "supabase-alternative",
17
+ "firebase-alternative"
18
+ ],
19
+ "homepage": "https://sovaria.in/docs/javascript-setup",
20
+ "bugs": {
21
+ "url": "https://sovaria.in/contact"
22
+ },
23
+ "license": "MIT",
24
+ "author": "Sovaria (https://sovaria.in)",
25
+ "type": "module",
26
+ "main": "dist/index.js",
27
+ "types": "dist/index.d.ts",
28
+ "typesVersions": {
29
+ "*": {
30
+ "firestore": [
31
+ "./dist/firestore.d.ts"
32
+ ]
33
+ }
34
+ },
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/index.d.ts",
38
+ "import": "./dist/index.js",
39
+ "default": "./dist/index.js"
40
+ },
41
+ "./firestore": {
42
+ "types": "./dist/firestore.d.ts",
43
+ "import": "./dist/firestore.js",
44
+ "default": "./dist/firestore.js"
45
+ },
46
+ "./package.json": "./package.json"
47
+ },
48
+ "files": [
49
+ "dist",
50
+ "README.md",
51
+ "LICENSE"
52
+ ],
53
+ "engines": {
54
+ "node": ">=18"
55
+ },
56
+ "scripts": {
57
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
58
+ "test": "vitest run src",
59
+ "lint": "tsc --noEmit -p tsconfig.json",
60
+ "clean": "rm -rf dist",
61
+ "docs:api": "typedoc --options typedoc.json",
62
+ "prepublishOnly": "npm run build && npm test -- --maxWorkers=2"
63
+ },
64
+ "dependencies": {
65
+ "hash-wasm": "4.12.0"
66
+ },
67
+ "devDependencies": {
68
+ "typedoc": "^0.28.14",
69
+ "typedoc-plugin-markdown": "^4.9.0",
70
+ "typescript": "^5.3.3",
71
+ "vitest": "^4.1.4"
72
+ },
73
+ "publishConfig": {
74
+ "access": "public"
75
+ }
76
+ }