@squarecloud/api
Advanced tools
@@ -0,1 +1,2 @@ | ||
| import { AxiosRequestConfig } from 'axios'; | ||
| import { APIResponse, RawUserData } from './typings'; | ||
@@ -9,4 +10,4 @@ export declare class SquareCloudAPIError extends Error { | ||
| private fetch; | ||
| user(id?: string, options?: RequestInit): Promise<RawUserData>; | ||
| application(path: string, id: string, options?: RequestInit | boolean): Promise<APIResponse>; | ||
| user(id?: string, options?: AxiosRequestConfig): Promise<RawUserData>; | ||
| application(path: string, id: string, options?: AxiosRequestConfig | boolean): Promise<APIResponse>; | ||
| } |
| "use strict"; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.APIManager = exports.SquareCloudAPIError = void 0; | ||
| const axios_1 = __importDefault(require("axios")); | ||
| class SquareCloudAPIError extends Error { | ||
@@ -28,3 +32,3 @@ constructor(code, message) { | ||
| options.method = options.method || 'GET'; | ||
| const data = await fetch('https://api.squarecloud.app/v1/public/' + path, options).then((r) => r.json()); | ||
| const data = await (0, axios_1.default)('https://api.squarecloud.app/v1/public/' + path, options).then((r) => r.data); | ||
| if (data.status === 'error') { | ||
@@ -31,0 +35,0 @@ throw new SquareCloudAPIError(data.code); |
@@ -119,3 +119,3 @@ "use strict"; | ||
| method: 'POST', | ||
| body: formData.getBuffer(), | ||
| data: formData.getBuffer(), | ||
| headers: formData.getHeaders(), | ||
@@ -122,0 +122,0 @@ }); |
+2
-1
| { | ||
| "name": "@squarecloud/api", | ||
| "version": "1.1.8", | ||
| "version": "1.1.9", | ||
| "description": "A JavaScript Wrapper for SquareCloud API", | ||
@@ -30,2 +30,3 @@ "main": "lib/index.js", | ||
| "dependencies": { | ||
| "axios": "^1.2.1", | ||
| "form-data": "^4.0.0", | ||
@@ -32,0 +33,0 @@ "zod": "^3.19.1" |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
49218
0.59%982
0.51%6
-14.29%3
50%+ Added
+ Added
+ Added
+ Added