seeksphere-sdk 1.0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 SeekSphere
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,121 @@
1
+ # SeekSphere SDK
2
+
3
+ The official TypeScript Node.js SDK for interacting with the SeekSphere API.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install seeksphere-sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { SeekSphereClient } from 'seeksphere-sdk';
15
+
16
+ // Initialize the client
17
+ const client = new SeekSphereClient({
18
+ baseUrl: 'https://your-api-domain.com',
19
+ apiKey: 'your-org-id', // org_id is used as the API key
20
+ timeout: 30000 // optional, defaults to 30 seconds
21
+ });
22
+
23
+ // Search
24
+ const searchResult = await client.search({
25
+ query: 'your search query'
26
+ }, 'sql_only'); // mode can be 'sql_only' or 'full'
27
+
28
+ // Update tokens
29
+ await client.updateTokens({
30
+ tokens: {
31
+ 'category1': ['token1', 'token2'],
32
+ 'category2': ['token3', 'token4']
33
+ }
34
+ });
35
+
36
+ // Update schema
37
+ await client.updateSchema({
38
+ search_schema: {
39
+ // your schema object
40
+ }
41
+ });
42
+
43
+ // Get current tokens
44
+ const tokens = await client.getTokens();
45
+
46
+ // Get current schema
47
+ const schema = await client.getSchema();
48
+ ```
49
+
50
+ ## API Methods
51
+
52
+ ### `search(request, mode?)`
53
+ - **request**: `{ query: string }`
54
+ - **mode**: `'sql_only' | 'full'` (optional, defaults to 'sql_only')
55
+ - **returns**: Search results
56
+
57
+ ### `updateTokens(request)`
58
+ - **request**: `{ tokens: Record<string, string[]> }`
59
+ - **returns**: Success response
60
+
61
+ ### `updateSchema(request)`
62
+ - **request**: `{ search_schema: any }`
63
+ - **returns**: Success response
64
+
65
+ ### `getTokens()`
66
+ - **returns**: Current tokens mapping
67
+
68
+ ### `getSchema()`
69
+ - **returns**: Current search schema
70
+
71
+ ## Configuration
72
+
73
+ The SDK automatically sets:
74
+ - `X-Org-Id` header to your provided `apiKey`
75
+ - `X-User-Id` header to `'node_sdk'`
76
+ - `Content-Type` header to `'application/json'`
77
+
78
+ ## Error Handling
79
+
80
+ The SDK throws descriptive errors for:
81
+ - Network issues
82
+ - HTTP error responses
83
+ - Request configuration problems
84
+
85
+ ```typescript
86
+ try {
87
+ const result = await client.search({ query: 'test' });
88
+ } catch (error) {
89
+ console.error('Search failed:', error.message);
90
+ }
91
+ ```
92
+
93
+ ## Development
94
+
95
+ ### Prerequisites
96
+ - Node.js 18+
97
+ - npm or yarn
98
+
99
+ ### Setup
100
+ ```bash
101
+ git clone https://github.com/seeksphere/seeksphere-node-sdk.git
102
+ cd seeksphere-node-sdk
103
+ npm install
104
+ ```
105
+
106
+ ### Scripts
107
+ ```bash
108
+ npm run build # Build the project
109
+ npm run test # Run tests
110
+ npm run test:coverage # Run tests with coverage
111
+ npm run lint # Run ESLint
112
+ npm run format # Format code with Prettier
113
+ ```
114
+
115
+ ## Contributing
116
+
117
+ We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
118
+
119
+ ## License
120
+
121
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,33 @@
1
+ import { SDKConfig, SearchRequest, SearchResponse, UpdateTokensRequest, UpdateSchemaRequest, ApiResponse, SearchMode } from './types';
2
+ export declare class SeekSphereClient {
3
+ private client;
4
+ private static readonly BASE_URL;
5
+ constructor(config: SDKConfig);
6
+ /**
7
+ * Search endpoint
8
+ */
9
+ search(request: SearchRequest, mode?: SearchMode): Promise<SearchResponse>;
10
+ /**
11
+ * Update tokens mapping
12
+ */
13
+ updateTokens(request: UpdateTokensRequest): Promise<ApiResponse>;
14
+ /**
15
+ * Update search schema
16
+ */
17
+ updateSchema(request: UpdateSchemaRequest): Promise<ApiResponse>;
18
+ /**
19
+ * Get current tokens (helper method)
20
+ */
21
+ getTokens(): Promise<{
22
+ tokens: Record<string, string[]>;
23
+ org_id: string;
24
+ }>;
25
+ /**
26
+ * Get current search schema (helper method)
27
+ */
28
+ getSchema(): Promise<{
29
+ search_schema: any;
30
+ org_id: string;
31
+ }>;
32
+ }
33
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,UAAU,EACX,MAAM,SAAS,CAAC;AAEjB,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAgC;gBAEpD,MAAM,EAAE,SAAS;IA2B7B;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,GAAE,UAAuB,GAAG,OAAO,CAAC,cAAc,CAAC;IAa5F;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC;IAKtE;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC;IAKtE;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAKhF;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC;QAAE,aAAa,EAAE,GAAG,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAInE"}
package/dist/client.js ADDED
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SeekSphereClient = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ class SeekSphereClient {
9
+ constructor(config) {
10
+ this.client = axios_1.default.create({
11
+ baseURL: SeekSphereClient.BASE_URL,
12
+ timeout: config.timeout || 30000,
13
+ headers: {
14
+ 'Content-Type': 'application/json',
15
+ 'X-Org-Id': config.apiKey, // org_id is used as api_key
16
+ 'X-User-Id': 'node_sdk' // Fixed user_id for SDK
17
+ }
18
+ });
19
+ // Response interceptor for error handling
20
+ this.client.interceptors.response.use((response) => response, (error) => {
21
+ if (error.response) {
22
+ throw new Error(`API Error: ${error.response.status} - ${error.response.data?.error || error.response.statusText}`);
23
+ }
24
+ else if (error.request) {
25
+ throw new Error('Network Error: No response received from server');
26
+ }
27
+ else {
28
+ throw new Error(`Request Error: ${error.message}`);
29
+ }
30
+ });
31
+ }
32
+ /**
33
+ * Search endpoint
34
+ */
35
+ async search(request, mode = 'sql_only') {
36
+ if (mode === 'full') {
37
+ throw new Error('SearchMode "full" is coming soon and not yet supported');
38
+ }
39
+ const response = await this.client.post('/search', request, {
40
+ headers: {
41
+ 'X-Mode': mode
42
+ }
43
+ });
44
+ return response.data;
45
+ }
46
+ /**
47
+ * Update tokens mapping
48
+ */
49
+ async updateTokens(request) {
50
+ const response = await this.client.put('/org/tokens', request);
51
+ return response.data;
52
+ }
53
+ /**
54
+ * Update search schema
55
+ */
56
+ async updateSchema(request) {
57
+ const response = await this.client.put('/org/search_schema', request);
58
+ return response.data;
59
+ }
60
+ /**
61
+ * Get current tokens (helper method)
62
+ */
63
+ async getTokens() {
64
+ const response = await this.client.get('/org/tokens');
65
+ return response.data;
66
+ }
67
+ /**
68
+ * Get current search schema (helper method)
69
+ */
70
+ async getSchema() {
71
+ const response = await this.client.get('/org/search_schema');
72
+ return response.data;
73
+ }
74
+ }
75
+ exports.SeekSphereClient = SeekSphereClient;
76
+ SeekSphereClient.BASE_URL = 'https://api.seeksphere.com';
77
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA4D;AAW5D,MAAa,gBAAgB;IAI3B,YAAY,MAAiB;QAE3B,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,gBAAgB,CAAC,QAAQ;YAClC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,KAAK;YAChC,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,4BAA4B;gBACvD,WAAW,EAAE,UAAU,CAAC,wBAAwB;aACjD;SACF,CAAC,CAAC;QAEH,0CAA0C;QAC1C,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CACnC,CAAC,QAAQ,EAAE,EAAE,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CAAC;QAClG,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS;QACb,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACtD,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS;QACb,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAC7D,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;;AA7EH,4CA8EC;AA5EyB,yBAAQ,GAAG,4BAA4B,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare function example(): Promise<void>;
2
+ export { example };
3
+ //# sourceMappingURL=example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":"AAEA,iBAAe,OAAO,kBAoErB;AAOD,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.example = example;
4
+ const index_1 = require("./index");
5
+ async function example() {
6
+ // Initialize the client
7
+ const client = new index_1.SeekSphereClient({
8
+ apiKey: 'your-org-id-here', // Replace with your actual org_id
9
+ timeout: 30000
10
+ });
11
+ try {
12
+ // Example 1: Search with sql_only mode
13
+ console.log('Searching with sql_only mode...');
14
+ const searchResult = await client.search({
15
+ query: 'show me all users from last month'
16
+ }, 'sql_only');
17
+ console.log('Search result:', searchResult);
18
+ // Example 2: Search with full mode (will throw error - coming soon)
19
+ console.log('\nTrying to search with full mode...');
20
+ try {
21
+ const fullSearchResult = await client.search({
22
+ query: 'analyze customer behavior trends'
23
+ }, 'full');
24
+ console.log('Full search result:', fullSearchResult);
25
+ }
26
+ catch (error) {
27
+ console.log('Expected error for full mode:', error instanceof Error ? error.message : String(error));
28
+ }
29
+ // Example 3: Update tokens
30
+ console.log('\nUpdating tokens...');
31
+ const updateTokensResult = await client.updateTokens({
32
+ tokens: {
33
+ 'product_categories': ['electronics', 'clothing', 'books'],
34
+ 'user_types': ['premium', 'standard', 'trial'],
35
+ 'regions': ['north', 'south', 'east', 'west']
36
+ }
37
+ });
38
+ console.log('Update tokens result:', updateTokensResult);
39
+ // Example 4: Update schema
40
+ console.log('\nUpdating schema...');
41
+ const updateSchemaResult = await client.updateSchema({
42
+ search_schema: {
43
+ tables: {
44
+ users: {
45
+ columns: ['id', 'name', 'email', 'created_at'],
46
+ types: ['int', 'varchar', 'varchar', 'datetime']
47
+ },
48
+ orders: {
49
+ columns: ['id', 'user_id', 'amount', 'status'],
50
+ types: ['int', 'int', 'decimal', 'varchar']
51
+ }
52
+ }
53
+ }
54
+ });
55
+ console.log('Update schema result:', updateSchemaResult);
56
+ // Example 5: Get current tokens
57
+ console.log('\nGetting current tokens...');
58
+ const currentTokens = await client.getTokens();
59
+ console.log('Current tokens:', currentTokens);
60
+ // Example 6: Get current schema
61
+ console.log('\nGetting current schema...');
62
+ const currentSchema = await client.getSchema();
63
+ console.log('Current schema:', currentSchema);
64
+ }
65
+ catch (error) {
66
+ console.error('Error:', error instanceof Error ? error.message : String(error));
67
+ }
68
+ }
69
+ // Run the example
70
+ if (require.main === module) {
71
+ example();
72
+ }
73
+ //# sourceMappingURL=example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.js","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":";;AA6ES,0BAAO;AA7EhB,mCAA2C;AAE3C,KAAK,UAAU,OAAO;IACpB,wBAAwB;IACxB,MAAM,MAAM,GAAG,IAAI,wBAAgB,CAAC;QAClC,MAAM,EAAE,kBAAkB,EAAE,kCAAkC;QAC9D,OAAO,EAAE,KAAK;KACf,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,uCAAuC;QACvC,OAAO,CAAC,GAAG,CAAC,i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appingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,cAAc,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.SeekSphereClient = void 0;
18
+ var client_1 = require("./client");
19
+ Object.defineProperty(exports, "SeekSphereClient", { enumerable: true, get: function () { return client_1.SeekSphereClient; } });
20
+ __exportStar(require("./types"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mCAA4C;AAAnC,0GAAA,gBAAgB,OAAA;AACzB,0CAAwB"}
@@ -0,0 +1,28 @@
1
+ export interface SearchRequest {
2
+ query: string;
3
+ }
4
+ export interface SearchResponse {
5
+ success: boolean;
6
+ org_id: string;
7
+ mode: string;
8
+ user_id: string;
9
+ [key: string]: any;
10
+ }
11
+ export interface UpdateTokensRequest {
12
+ tokens: Record<string, string[]>;
13
+ }
14
+ export interface UpdateSchemaRequest {
15
+ search_schema: any;
16
+ }
17
+ export interface ApiResponse<T = any> {
18
+ success?: boolean;
19
+ message?: string;
20
+ error?: string;
21
+ [key: string]: any;
22
+ }
23
+ export interface SDKConfig {
24
+ apiKey: string;
25
+ timeout?: number;
26
+ }
27
+ export type SearchMode = 'sql_only' | 'full';
28
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "seeksphere-sdk",
3
+ "version": "1.0.0",
4
+ "description": "Official TypeScript Node.js SDK for SeekSphere API",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "npm run clean && tsc",
9
+ "dev": "tsc --watch",
10
+ "test": "jest",
11
+ "test:watch": "jest --watch",
12
+ "test:coverage": "jest --coverage",
13
+ "lint": "eslint src/**/*.ts",
14
+ "lint:fix": "eslint src/**/*.ts --fix",
15
+ "format": "prettier --write src/**/*.ts",
16
+ "format:check": "prettier --check src/**/*.ts",
17
+ "clean": "rm -rf dist coverage",
18
+ "prepublishOnly": "npm run lint && npm run test && npm run build",
19
+ "release": "npm version patch && git push && git push --tags"
20
+ },
21
+ "keywords": ["seeksphere", "search", "api", "sdk", "typescript", "nodejs", "database", "query"],
22
+ "author": "SeekSphere",
23
+ "license": "MIT",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/seeksphere/seeksphere-node-sdk.git"
27
+ },
28
+ "homepage": "https://github.com/seeksphere/seeksphere-node-sdk#readme",
29
+ "bugs": {
30
+ "url": "https://github.com/seeksphere/seeksphere-node-sdk/issues"
31
+ },
32
+ "files": [
33
+ "dist/**/*",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "engines": {
38
+ "node": ">=18.0.0"
39
+ },
40
+ "devDependencies": {
41
+ "@types/node": "^20.0.0",
42
+ "@types/jest": "^29.0.0",
43
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
44
+ "@typescript-eslint/parser": "^6.0.0",
45
+ "eslint": "^8.0.0",
46
+ "jest": "^29.0.0",
47
+ "prettier": "^3.0.0",
48
+ "ts-jest": "^29.0.0",
49
+ "typescript": "^5.0.0"
50
+ },
51
+ "dependencies": {
52
+ "axios": "^1.6.0"
53
+ }
54
+ }