cloreai 0.1.4 → 0.1.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/build/CloreAI.d.ts +11 -11
- package/build/WebAPI.d.ts +7 -7
- package/build/WebAPI.js +2 -2
- package/build/constants.d.ts +0 -1
- package/build/constants.js +0 -3
- package/build/types/cloreai/cancelOrder.d.ts +1 -1
- package/build/types/cloreai/createOrder.d.ts +2 -2
- package/build/types/cloreai/marketplace.d.ts +2 -2
- package/build/types/cloreai/myOrders.d.ts +2 -2
- package/build/types/cloreai/myServers.d.ts +2 -2
- package/build/types/cloreai/serverConfig.d.ts +2 -2
- package/build/types/cloreai/setServerSettings.d.ts +1 -1
- package/build/types/cloreai/setSpotPrice.d.ts +1 -1
- package/build/types/cloreai/spotMarketplace.d.ts +2 -2
- package/build/types/cloreai/wallets.d.ts +2 -2
- package/build/types/config.d.ts +1 -1
- package/build/types/webapi/cancelOrder.d.ts +1 -1
- package/build/types/webapi/createOrder.d.ts +2 -2
- package/build/types/webapi/getSpot.d.ts +2 -2
- package/build/types/webapi/orders.d.ts +2 -2
- package/build/types/webapi/servers.d.ts +2 -2
- package/build/types/webapi/setSpotPrice.d.ts +1 -1
- package/package.json +6 -8
package/build/CloreAI.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type AxiosInstance, type AxiosRequestConfig } from 'axios';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
2
|
+
import type { CancelOrderBody, CancelOrderOutput } from './types/cloreai/cancelOrder.js';
|
|
3
|
+
import type { CreateOrderBody, CreateOrderOutput } from './types/cloreai/createOrder.js';
|
|
4
|
+
import type { MarketplaceOutput } from './types/cloreai/marketplace.js';
|
|
5
|
+
import type { MyOrdersOutput, MyOrdersParams } from './types/cloreai/myOrders.js';
|
|
6
|
+
import type { MyServersOutput } from './types/cloreai/myServers.js';
|
|
7
|
+
import type { ServerConfigBody, ServerConfigOutput } from './types/cloreai/serverConfig.js';
|
|
8
|
+
import type { SetServerSettingsBody, SetServerSettingsOutput } from './types/cloreai/setServerSettings.js';
|
|
9
|
+
import type { SetSpotPriceBody, SetSpotPriceOutput } from './types/cloreai/setSpotPrice.js';
|
|
10
|
+
import type { SpotMarketplaceOutput, SpotMarketplaceParams } from './types/cloreai/spotMarketplace.js';
|
|
11
|
+
import type { WalletsOutput } from './types/cloreai/wallets.js';
|
|
12
|
+
import type { Config } from './types/config.js';
|
|
13
13
|
export declare class CloreAI {
|
|
14
14
|
readonly api: AxiosInstance;
|
|
15
15
|
constructor(config: Config);
|
package/build/WebAPI.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type AxiosInstance, type AxiosRequestConfig } from 'axios';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import type { WebConfig } from './types/config.js';
|
|
3
|
+
import type { WebCancelOrderBody, WebCancelOrderOutput } from './types/webapi/cancelOrder.js';
|
|
4
|
+
import type { WebCreateOrderBody, WebCreateOrderOutput } from './types/webapi/createOrder.js';
|
|
5
|
+
import type { WebGetSpotBody, WebGetSpotOutput } from './types/webapi/getSpot.js';
|
|
6
|
+
import type { WebOrdersBody } from './types/webapi/orders.js';
|
|
7
|
+
import type { WebServersOutput } from './types/webapi/servers.js';
|
|
8
|
+
import type { WebSetSpotPriceBody, WebSetSpotPriceOutput } from './types/webapi/setSpotPrice.js';
|
|
9
9
|
export declare class WebAPI {
|
|
10
10
|
readonly api: AxiosInstance;
|
|
11
11
|
constructor(config: WebConfig);
|
package/build/WebAPI.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { webStatusCodes } from './constants.js';
|
|
3
2
|
import { UnknownError } from './errors.js';
|
|
4
3
|
import { getErrorMessage } from './getErrorMessage.js';
|
|
5
4
|
export class WebAPI {
|
|
@@ -18,7 +17,8 @@ export class WebAPI {
|
|
|
18
17
|
return request;
|
|
19
18
|
});
|
|
20
19
|
this.api.interceptors.response.use((response) => {
|
|
21
|
-
|
|
20
|
+
const hasError = Boolean(response.data.error);
|
|
21
|
+
if (!hasError) {
|
|
22
22
|
return response;
|
|
23
23
|
}
|
|
24
24
|
const errorMessage = getErrorMessage(response.data.status, response.data.error);
|
package/build/constants.d.ts
CHANGED
package/build/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Price, Specs } from '../common.js';
|
|
2
|
+
import type { Output } from '../output.js';
|
|
3
3
|
export interface MarketplaceServer {
|
|
4
4
|
id: number;
|
|
5
5
|
owner: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Currency, Specs } from '../common.js';
|
|
2
|
+
import type { Output } from '../output.js';
|
|
3
3
|
export interface MyOrdersParams {
|
|
4
4
|
return_completed?: boolean;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Pricing, Specs, Visibility } from '../common.js';
|
|
2
|
+
import type { Output } from '../output.js';
|
|
3
3
|
export interface MyServersServer {
|
|
4
4
|
name: string;
|
|
5
5
|
connected: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Pricing, Specs, Visibility } from '../common.js';
|
|
2
|
+
import type { Output } from '../output.js';
|
|
3
3
|
export interface ServerConfigBody {
|
|
4
4
|
server_name: string;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Pricing, Visibility } from '../common.js';
|
|
2
|
+
import type { Output } from '../output.js';
|
|
3
3
|
export interface SpotMarketplaceParams {
|
|
4
4
|
market: number;
|
|
5
5
|
}
|
package/build/types/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Currency } from '../common.js';
|
|
2
|
+
import type { WebOutput } from '../output.js';
|
|
3
3
|
export interface WebCreateOrderCommon {
|
|
4
4
|
currency: Currency;
|
|
5
5
|
image: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Currency, Pricing, Visibility } from '../common.js';
|
|
2
|
+
import type { WebOutput } from '../output.js';
|
|
3
3
|
export interface WebGetSpotBody {
|
|
4
4
|
id: number;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Currency, Price, Specs } from '../common.js';
|
|
2
|
+
import type { WebOutput } from '../output.js';
|
|
3
3
|
export interface WebOrdersBody {
|
|
4
4
|
rc: boolean;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Currency, Price, Specs } from '../common.js';
|
|
2
|
+
import type { WebOutput } from '../output.js';
|
|
3
3
|
export interface WebServersServerRating {
|
|
4
4
|
avg: number;
|
|
5
5
|
cnt: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloreai",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "CLORE.AI API client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloreai",
|
|
@@ -26,9 +26,7 @@
|
|
|
26
26
|
"prepare": "husky",
|
|
27
27
|
"start-playground": "node playground/main.js",
|
|
28
28
|
"typecheck": "tsc --noEmit",
|
|
29
|
-
"update-
|
|
30
|
-
"update-latest": "npm-check-updates --peer --upgrade --target latest",
|
|
31
|
-
"update-minor": "npm-check-updates --peer --upgrade --target minor"
|
|
29
|
+
"update-latest": "rimraf package-lock.json && npm-check-updates --peer --upgrade && npm install"
|
|
32
30
|
},
|
|
33
31
|
"dependencies": {
|
|
34
32
|
"axios": "^1.7.2"
|
|
@@ -36,12 +34,12 @@
|
|
|
36
34
|
"devDependencies": {
|
|
37
35
|
"@tsconfig/strictest": "^2.0.5",
|
|
38
36
|
"eslint": "^8.57.0",
|
|
39
|
-
"eslint-config-vladpuz": "^0.
|
|
40
|
-
"husky": "^9.
|
|
37
|
+
"eslint-config-vladpuz": "^0.8.0",
|
|
38
|
+
"husky": "^9.1.1",
|
|
41
39
|
"npm-check-updates": "^16.14.20",
|
|
42
40
|
"prettier": "^3.3.3",
|
|
43
|
-
"prettier-config-vladpuz": "^0.
|
|
41
|
+
"prettier-config-vladpuz": "^0.5.0",
|
|
44
42
|
"rimraf": "^6.0.1",
|
|
45
|
-
"typescript": "^5.5.
|
|
43
|
+
"typescript": "^5.5.4"
|
|
46
44
|
}
|
|
47
45
|
}
|