@sogni-ai/sogni-client 0.3.3 → 0.4.0-aplha.2
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 +3 -2
- package/dist/Account/index.d.ts +127 -3
- package/dist/Account/index.js +126 -2
- package/dist/Account/index.js.map +1 -1
- package/dist/Projects/Job.d.ts +5 -0
- package/dist/Projects/Job.js +6 -0
- package/dist/Projects/Job.js.map +1 -1
- package/dist/Projects/index.d.ts +6 -6
- package/dist/Projects/index.js +14 -4
- package/dist/Projects/index.js.map +1 -1
- package/dist/Projects/types/events.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/Account/index.ts +127 -3
- package/src/Projects/Job.ts +8 -0
- package/src/Projects/index.ts +18 -8
- package/src/Projects/types/events.ts +2 -0
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -57,10 +57,10 @@ const options ={
|
|
|
57
57
|
}
|
|
58
58
|
const client = await SogniClient.createInstance(options);
|
|
59
59
|
// Login to Sogni account and establish WebSocket connection to Supernet
|
|
60
|
-
await client.login(USERNAME, PASSWORD);
|
|
60
|
+
await client.account.login(USERNAME, PASSWORD);
|
|
61
61
|
// Now wait until list of available models is received.
|
|
62
62
|
// This step is only needed if you want to create project immediately.
|
|
63
|
-
const models = await client.waitForModels();
|
|
63
|
+
const models = await client.projects.waitForModels();
|
|
64
64
|
// You can get list of available models any time from `client.projects.availableModels`
|
|
65
65
|
```
|
|
66
66
|
**Important Note:**
|
|
@@ -160,5 +160,6 @@ project.on('failed', async (errorData) => {
|
|
|
160
160
|
console.log('Project failed:', errorData);
|
|
161
161
|
});
|
|
162
162
|
```
|
|
163
|
+
|
|
163
164
|
## Code examples
|
|
164
165
|
You can find more code examples in the [examples](./examples) directory.
|
package/dist/Account/index.d.ts
CHANGED
|
@@ -6,6 +6,14 @@ import CurrentAccount from './CurrentAccount';
|
|
|
6
6
|
import { SupernetType } from '../ApiClient/WebSocketClient/types';
|
|
7
7
|
/**
|
|
8
8
|
* Account API methods that let you interact with the user's account.
|
|
9
|
+
* Can be accessed via `client.account`. Look for more samples below.
|
|
10
|
+
*
|
|
11
|
+
* @example Retrieve the current account balance
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const balance = await client.account.refreshBalance();
|
|
14
|
+
* console.log(balance);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
9
17
|
*/
|
|
10
18
|
declare class AccountApi extends ApiGroup {
|
|
11
19
|
readonly currentAccount: CurrentAccount;
|
|
@@ -13,49 +21,165 @@ declare class AccountApi extends ApiGroup {
|
|
|
13
21
|
private handleBalanceUpdate;
|
|
14
22
|
private handleServerConnected;
|
|
15
23
|
private handleServerDisconnected;
|
|
16
|
-
getNonce
|
|
24
|
+
private getNonce;
|
|
25
|
+
/**
|
|
26
|
+
* Create Ethers.js Wallet instance from username and password.
|
|
27
|
+
* This method is used internally to create a wallet for the user.
|
|
28
|
+
* You can use this method to create a wallet if you need to sign transactions.
|
|
29
|
+
*
|
|
30
|
+
* @example Create a wallet from username and password
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const wallet = client.account.getWallet('username', 'password');
|
|
33
|
+
* console.log(wallet.address);
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @param username - Sogni account username
|
|
37
|
+
* @param password - Sogni account password
|
|
38
|
+
*/
|
|
17
39
|
getWallet(username: string, password: string): Wallet;
|
|
40
|
+
/**
|
|
41
|
+
* Create a new account with the given username, email, and password.
|
|
42
|
+
* @internal
|
|
43
|
+
*
|
|
44
|
+
* @param username
|
|
45
|
+
* @param email
|
|
46
|
+
* @param password
|
|
47
|
+
* @param subscribe
|
|
48
|
+
* @param referralCode
|
|
49
|
+
*/
|
|
18
50
|
create(username: string, email: string, password: string, subscribe?: boolean, referralCode?: string): Promise<AccountCreateData>;
|
|
51
|
+
/**
|
|
52
|
+
* Restore session with username and access token.
|
|
53
|
+
*
|
|
54
|
+
* You can save access token that you get from the login method and restore the session with this method.
|
|
55
|
+
*
|
|
56
|
+
* @example Store access token to local storage
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const { username, token } = await client.account.login('username', 'password');
|
|
59
|
+
* localStorage.setItem('sogni-username', username);
|
|
60
|
+
* localStorage.setItem('sogni-token', token);
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Restore session from local storage
|
|
64
|
+
* ```typescript
|
|
65
|
+
* const username = localStorage.getItem('sogni-username');
|
|
66
|
+
* const token = localStorage.getItem('sogni-token');
|
|
67
|
+
* if (username && token) {
|
|
68
|
+
* client.account.setToken(username, token);
|
|
69
|
+
* console.log('Session restored');
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @param username
|
|
74
|
+
* @param token
|
|
75
|
+
*/
|
|
19
76
|
setToken(username: string, token: string): void;
|
|
20
77
|
/**
|
|
21
78
|
* Login with username and password. WebSocket connection is established after successful login.
|
|
79
|
+
*
|
|
80
|
+
* @example Login with username and password
|
|
81
|
+
* ```typescript
|
|
82
|
+
* await client.account.login('username', 'password');
|
|
83
|
+
* console.log('Logged in');
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
22
86
|
* @param username
|
|
23
87
|
* @param password
|
|
24
88
|
*/
|
|
25
89
|
login(username: string, password: string): Promise<LoginData>;
|
|
26
90
|
/**
|
|
27
91
|
* Logout the user and close the WebSocket connection.
|
|
92
|
+
*
|
|
93
|
+
* @example Logout the user
|
|
94
|
+
* ```typescript
|
|
95
|
+
* await client.account.logout();
|
|
96
|
+
* console.log('Logged out');
|
|
97
|
+
* ```
|
|
28
98
|
*/
|
|
29
99
|
logout(): Promise<void>;
|
|
30
100
|
/**
|
|
31
101
|
* Refresh the balance of the current account.
|
|
102
|
+
*
|
|
103
|
+
* Usually, you don't need to call this method manually. Balance is updated automatically
|
|
104
|
+
* through WebSocket events. But you can call this method to force a balance refresh.
|
|
105
|
+
*
|
|
106
|
+
* @example Refresh user account balance
|
|
107
|
+
* ```typescript
|
|
108
|
+
* const balance = await client.account.refreshBalance();
|
|
109
|
+
* console.log(balance);
|
|
110
|
+
* // { net: '100.000000', settled: '100.000000', credit: '0.000000', debit: '0.000000' }
|
|
111
|
+
* ```
|
|
32
112
|
*/
|
|
33
113
|
refreshBalance(): Promise<BalanceData>;
|
|
34
114
|
/**
|
|
35
|
-
* Get the balance of
|
|
115
|
+
* Get the balance of the wallet address.
|
|
116
|
+
*
|
|
117
|
+
* This method is used to get the balance of the wallet address. It returns $SOGNI and ETH balance.
|
|
118
|
+
*
|
|
119
|
+
* @example Get the balance of the wallet address
|
|
120
|
+
* ```typescript
|
|
121
|
+
* const address = client.account.currentAccount.walletAddress;
|
|
122
|
+
* const balance = await client.account.walletBalance(address);
|
|
123
|
+
* console.log(balance);
|
|
124
|
+
* // { token: '100.000000', ether: '0.000000' }
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
36
127
|
* @param walletAddress
|
|
37
128
|
*/
|
|
38
129
|
walletBalance(walletAddress: string): Promise<{
|
|
39
130
|
token: string;
|
|
40
131
|
ether: string;
|
|
41
132
|
}>;
|
|
133
|
+
/**
|
|
134
|
+
* Validate the username before signup
|
|
135
|
+
* @internal
|
|
136
|
+
* @param username
|
|
137
|
+
*/
|
|
42
138
|
validateUsername(username: string): Promise<import("../ApiClient").ApiErrorResponse | ApiReponse<undefined>>;
|
|
43
139
|
/**
|
|
44
140
|
* Switch between fast and relaxed networks.
|
|
45
141
|
* Note: This method will close the current WebSocket connection and establish a new one.
|
|
46
142
|
* Do not call this method if you have any active projects.
|
|
143
|
+
*
|
|
144
|
+
* @example Switch to the fast network
|
|
145
|
+
* ```typescript
|
|
146
|
+
* client.apiClient.once('connected', ({ network }) => {
|
|
147
|
+
* console.log('Switched to the network:', network);
|
|
148
|
+
* });
|
|
149
|
+
* await client.account.switchNetwork('fast');
|
|
150
|
+
* ```
|
|
47
151
|
* @param network
|
|
48
152
|
*/
|
|
49
153
|
switchNetwork(network: SupernetType): Promise<void>;
|
|
50
154
|
/**
|
|
51
155
|
* Get the transaction history of the current account.
|
|
52
|
-
*
|
|
156
|
+
*
|
|
157
|
+
* @example Get the transaction history
|
|
158
|
+
* ```typescript
|
|
159
|
+
* const { entries, next } = await client.account.transactionHistory({
|
|
160
|
+
* status: 'completed',
|
|
161
|
+
* limit: 10,
|
|
162
|
+
* address: client.account.currentAccount.walletAddress
|
|
163
|
+
* });
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* @param params - Transaction history query parameters
|
|
167
|
+
* @returns Transaction history entries and next query parameters
|
|
53
168
|
*/
|
|
54
169
|
transactionHistory(params: TxHistoryParams): Promise<{
|
|
55
170
|
entries: TxHistoryEntry[];
|
|
56
171
|
next: TxHistoryParams;
|
|
57
172
|
}>;
|
|
173
|
+
/**
|
|
174
|
+
* Get the rewards of the current account.
|
|
175
|
+
* @internal
|
|
176
|
+
*/
|
|
58
177
|
rewards(): Promise<Reward[]>;
|
|
178
|
+
/**
|
|
179
|
+
* Claim rewards by reward IDs.
|
|
180
|
+
* @internal
|
|
181
|
+
* @param rewardIds
|
|
182
|
+
*/
|
|
59
183
|
claimRewards(rewardIds: string[]): Promise<void>;
|
|
60
184
|
}
|
|
61
185
|
export default AccountApi;
|
package/dist/Account/index.js
CHANGED
|
@@ -18,6 +18,14 @@ const ApiClient_1 = require("../ApiClient");
|
|
|
18
18
|
const CurrentAccount_1 = __importDefault(require("./CurrentAccount"));
|
|
19
19
|
/**
|
|
20
20
|
* Account API methods that let you interact with the user's account.
|
|
21
|
+
* Can be accessed via `client.account`. Look for more samples below.
|
|
22
|
+
*
|
|
23
|
+
* @example Retrieve the current account balance
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const balance = await client.account.refreshBalance();
|
|
26
|
+
* console.log(balance);
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
21
29
|
*/
|
|
22
30
|
class AccountApi extends ApiGroup_1.default {
|
|
23
31
|
constructor(config) {
|
|
@@ -47,12 +55,36 @@ class AccountApi extends ApiGroup_1.default {
|
|
|
47
55
|
return res.data.nonce;
|
|
48
56
|
});
|
|
49
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Create Ethers.js Wallet instance from username and password.
|
|
60
|
+
* This method is used internally to create a wallet for the user.
|
|
61
|
+
* You can use this method to create a wallet if you need to sign transactions.
|
|
62
|
+
*
|
|
63
|
+
* @example Create a wallet from username and password
|
|
64
|
+
* ```typescript
|
|
65
|
+
* const wallet = client.account.getWallet('username', 'password');
|
|
66
|
+
* console.log(wallet.address);
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @param username - Sogni account username
|
|
70
|
+
* @param password - Sogni account password
|
|
71
|
+
*/
|
|
50
72
|
getWallet(username, password) {
|
|
51
73
|
const pwd = (0, ethers_1.toUtf8Bytes)(username.toLowerCase() + password);
|
|
52
74
|
const salt = (0, ethers_1.toUtf8Bytes)('sogni-salt-value');
|
|
53
75
|
const pkey = (0, ethers_1.pbkdf2)(pwd, salt, 10000, 32, 'sha256');
|
|
54
76
|
return new ethers_1.Wallet(pkey, this.provider);
|
|
55
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Create a new account with the given username, email, and password.
|
|
80
|
+
* @internal
|
|
81
|
+
*
|
|
82
|
+
* @param username
|
|
83
|
+
* @param email
|
|
84
|
+
* @param password
|
|
85
|
+
* @param subscribe
|
|
86
|
+
* @param referralCode
|
|
87
|
+
*/
|
|
56
88
|
create(username_1, email_1, password_1) {
|
|
57
89
|
return __awaiter(this, arguments, void 0, function* (username, email, password, subscribe = false, referralCode) {
|
|
58
90
|
const wallet = this.getWallet(username, password);
|
|
@@ -71,6 +103,31 @@ class AccountApi extends ApiGroup_1.default {
|
|
|
71
103
|
return res.data;
|
|
72
104
|
});
|
|
73
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Restore session with username and access token.
|
|
108
|
+
*
|
|
109
|
+
* You can save access token that you get from the login method and restore the session with this method.
|
|
110
|
+
*
|
|
111
|
+
* @example Store access token to local storage
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const { username, token } = await client.account.login('username', 'password');
|
|
114
|
+
* localStorage.setItem('sogni-username', username);
|
|
115
|
+
* localStorage.setItem('sogni-token', token);
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* @example Restore session from local storage
|
|
119
|
+
* ```typescript
|
|
120
|
+
* const username = localStorage.getItem('sogni-username');
|
|
121
|
+
* const token = localStorage.getItem('sogni-token');
|
|
122
|
+
* if (username && token) {
|
|
123
|
+
* client.account.setToken(username, token);
|
|
124
|
+
* console.log('Session restored');
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @param username
|
|
129
|
+
* @param token
|
|
130
|
+
*/
|
|
74
131
|
setToken(username, token) {
|
|
75
132
|
this.client.authenticate(token);
|
|
76
133
|
this.currentAccount._update({
|
|
@@ -80,6 +137,13 @@ class AccountApi extends ApiGroup_1.default {
|
|
|
80
137
|
}
|
|
81
138
|
/**
|
|
82
139
|
* Login with username and password. WebSocket connection is established after successful login.
|
|
140
|
+
*
|
|
141
|
+
* @example Login with username and password
|
|
142
|
+
* ```typescript
|
|
143
|
+
* await client.account.login('username', 'password');
|
|
144
|
+
* console.log('Logged in');
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
83
147
|
* @param username
|
|
84
148
|
* @param password
|
|
85
149
|
*/
|
|
@@ -101,6 +165,12 @@ class AccountApi extends ApiGroup_1.default {
|
|
|
101
165
|
}
|
|
102
166
|
/**
|
|
103
167
|
* Logout the user and close the WebSocket connection.
|
|
168
|
+
*
|
|
169
|
+
* @example Logout the user
|
|
170
|
+
* ```typescript
|
|
171
|
+
* await client.account.logout();
|
|
172
|
+
* console.log('Logged out');
|
|
173
|
+
* ```
|
|
104
174
|
*/
|
|
105
175
|
logout() {
|
|
106
176
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -113,6 +183,16 @@ class AccountApi extends ApiGroup_1.default {
|
|
|
113
183
|
}
|
|
114
184
|
/**
|
|
115
185
|
* Refresh the balance of the current account.
|
|
186
|
+
*
|
|
187
|
+
* Usually, you don't need to call this method manually. Balance is updated automatically
|
|
188
|
+
* through WebSocket events. But you can call this method to force a balance refresh.
|
|
189
|
+
*
|
|
190
|
+
* @example Refresh user account balance
|
|
191
|
+
* ```typescript
|
|
192
|
+
* const balance = await client.account.refreshBalance();
|
|
193
|
+
* console.log(balance);
|
|
194
|
+
* // { net: '100.000000', settled: '100.000000', credit: '0.000000', debit: '0.000000' }
|
|
195
|
+
* ```
|
|
116
196
|
*/
|
|
117
197
|
refreshBalance() {
|
|
118
198
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -122,7 +202,18 @@ class AccountApi extends ApiGroup_1.default {
|
|
|
122
202
|
});
|
|
123
203
|
}
|
|
124
204
|
/**
|
|
125
|
-
* Get the balance of
|
|
205
|
+
* Get the balance of the wallet address.
|
|
206
|
+
*
|
|
207
|
+
* This method is used to get the balance of the wallet address. It returns $SOGNI and ETH balance.
|
|
208
|
+
*
|
|
209
|
+
* @example Get the balance of the wallet address
|
|
210
|
+
* ```typescript
|
|
211
|
+
* const address = client.account.currentAccount.walletAddress;
|
|
212
|
+
* const balance = await client.account.walletBalance(address);
|
|
213
|
+
* console.log(balance);
|
|
214
|
+
* // { token: '100.000000', ether: '0.000000' }
|
|
215
|
+
* ```
|
|
216
|
+
*
|
|
126
217
|
* @param walletAddress
|
|
127
218
|
*/
|
|
128
219
|
walletBalance(walletAddress) {
|
|
@@ -133,6 +224,11 @@ class AccountApi extends ApiGroup_1.default {
|
|
|
133
224
|
return res.data;
|
|
134
225
|
});
|
|
135
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Validate the username before signup
|
|
229
|
+
* @internal
|
|
230
|
+
* @param username
|
|
231
|
+
*/
|
|
136
232
|
validateUsername(username) {
|
|
137
233
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
234
|
try {
|
|
@@ -155,6 +251,14 @@ class AccountApi extends ApiGroup_1.default {
|
|
|
155
251
|
* Switch between fast and relaxed networks.
|
|
156
252
|
* Note: This method will close the current WebSocket connection and establish a new one.
|
|
157
253
|
* Do not call this method if you have any active projects.
|
|
254
|
+
*
|
|
255
|
+
* @example Switch to the fast network
|
|
256
|
+
* ```typescript
|
|
257
|
+
* client.apiClient.once('connected', ({ network }) => {
|
|
258
|
+
* console.log('Switched to the network:', network);
|
|
259
|
+
* });
|
|
260
|
+
* await client.account.switchNetwork('fast');
|
|
261
|
+
* ```
|
|
158
262
|
* @param network
|
|
159
263
|
*/
|
|
160
264
|
switchNetwork(network) {
|
|
@@ -168,7 +272,18 @@ class AccountApi extends ApiGroup_1.default {
|
|
|
168
272
|
}
|
|
169
273
|
/**
|
|
170
274
|
* Get the transaction history of the current account.
|
|
171
|
-
*
|
|
275
|
+
*
|
|
276
|
+
* @example Get the transaction history
|
|
277
|
+
* ```typescript
|
|
278
|
+
* const { entries, next } = await client.account.transactionHistory({
|
|
279
|
+
* status: 'completed',
|
|
280
|
+
* limit: 10,
|
|
281
|
+
* address: client.account.currentAccount.walletAddress
|
|
282
|
+
* });
|
|
283
|
+
* ```
|
|
284
|
+
*
|
|
285
|
+
* @param params - Transaction history query parameters
|
|
286
|
+
* @returns Transaction history entries and next query parameters
|
|
172
287
|
*/
|
|
173
288
|
transactionHistory(params) {
|
|
174
289
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -195,6 +310,10 @@ class AccountApi extends ApiGroup_1.default {
|
|
|
195
310
|
};
|
|
196
311
|
});
|
|
197
312
|
}
|
|
313
|
+
/**
|
|
314
|
+
* Get the rewards of the current account.
|
|
315
|
+
* @internal
|
|
316
|
+
*/
|
|
198
317
|
rewards() {
|
|
199
318
|
return __awaiter(this, void 0, void 0, function* () {
|
|
200
319
|
const r = yield this.client.rest.get('/v2/account/rewards');
|
|
@@ -213,6 +332,11 @@ class AccountApi extends ApiGroup_1.default {
|
|
|
213
332
|
}));
|
|
214
333
|
});
|
|
215
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* Claim rewards by reward IDs.
|
|
337
|
+
* @internal
|
|
338
|
+
* @param rewardIds
|
|
339
|
+
*/
|
|
216
340
|
claimRewards(rewardIds) {
|
|
217
341
|
return __awaiter(this, void 0, void 0, function* () {
|
|
218
342
|
yield this.client.rest.post('/v2/account/reward/claim', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAWA,2DAAkD;AAClD,mCAAqD;AACrD,4CAAoD;AACpD,sEAA8C;AAG9C
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAWA,2DAAkD;AAClD,mCAAqD;AACrD,4CAAoD;AACpD,sEAA8C;AAG9C;;;;;;;;;;GAUG;AACH,MAAM,UAAW,SAAQ,kBAAQ;IAG/B,YAAY,MAAiB;QAC3B,KAAK,CAAC,MAAM,CAAC,CAAC;QAHP,mBAAc,GAAG,IAAI,wBAAc,EAAE,CAAC;QAI7C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5E,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3E,CAAC;IAEO,mBAAmB,CAAC,IAAiB;QAC3C,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACjD,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,YAAY,CAAC,SAAmB;;YACpC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE;gBACtD,MAAM,EAAE,SAAS;aAClB,CAAC,CAAC;QACL,CAAC;KAAA;CACF;AAED,kBAAe,UAAU,CAAC"}
|
package/dist/Projects/Job.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface JobData {
|
|
|
9
9
|
status: JobStatus;
|
|
10
10
|
step: number;
|
|
11
11
|
stepCount: number;
|
|
12
|
+
workerName?: string;
|
|
12
13
|
seed?: number;
|
|
13
14
|
isNSFW?: boolean;
|
|
14
15
|
userCanceled?: boolean;
|
|
@@ -61,6 +62,10 @@ declare class Job extends DataEntity<JobData, JobEventMap> {
|
|
|
61
62
|
* If NSFW filter is enabled and the image is NSFW, image will not be available for download.
|
|
62
63
|
*/
|
|
63
64
|
get isNSFW(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Name of the worker that is processing this job.
|
|
67
|
+
*/
|
|
68
|
+
get workerName(): string | undefined;
|
|
64
69
|
private handleUpdated;
|
|
65
70
|
}
|
|
66
71
|
export default Job;
|
package/dist/Projects/Job.js
CHANGED
|
@@ -69,6 +69,12 @@ class Job extends DataEntity_1.default {
|
|
|
69
69
|
get isNSFW() {
|
|
70
70
|
return !!this.data.isNSFW;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Name of the worker that is processing this job.
|
|
74
|
+
*/
|
|
75
|
+
get workerName() {
|
|
76
|
+
return this.data.workerName;
|
|
77
|
+
}
|
|
72
78
|
handleUpdated(keys) {
|
|
73
79
|
if (keys.includes('step') || keys.includes('stepCount')) {
|
|
74
80
|
this.emit('progress', this.progress);
|
package/dist/Projects/Job.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Job.js","sourceRoot":"","sources":["../../src/Projects/Job.ts"],"names":[],"mappings":";;;;;AAAA,mEAA6D;
|
|
1
|
+
{"version":3,"file":"Job.js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,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,IAAI,MAAM;QACR,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;IAC9B,CAAC;IAEO,aAAa,CAAC,IAAc;QAClC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YACxD,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YAC3D,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,SAAU,CAAC,CAAC;QAC1C,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACxD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,KAAM,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;CACF;AAED,kBAAe,GAAG,CAAC"}
|
package/dist/Projects/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ApiGroup, { ApiConfig } from '../ApiGroup';
|
|
2
|
-
import { AvailableModel, EstimateRequest,
|
|
2
|
+
import { AvailableModel, EstimateRequest, ProjectParams } from './types';
|
|
3
3
|
import Project from './Project';
|
|
4
|
-
import {
|
|
4
|
+
import { ProjectApiEvents } from './types/events';
|
|
5
5
|
declare class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
6
6
|
private _availableModels;
|
|
7
7
|
private projects;
|
|
@@ -12,8 +12,8 @@ declare class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
12
12
|
private handleJobProgress;
|
|
13
13
|
private handleJobResult;
|
|
14
14
|
private handleJobError;
|
|
15
|
-
handleProjectEvent
|
|
16
|
-
handleJobEvent
|
|
15
|
+
private handleProjectEvent;
|
|
16
|
+
private handleJobEvent;
|
|
17
17
|
private handleServerDisconnected;
|
|
18
18
|
/**
|
|
19
19
|
* Wait for available models to be received from the network. Useful for scripts that need to
|
|
@@ -35,7 +35,7 @@ declare class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
35
35
|
token: string;
|
|
36
36
|
usd: string;
|
|
37
37
|
}>;
|
|
38
|
-
uploadUrl
|
|
39
|
-
downloadUrl
|
|
38
|
+
private uploadUrl;
|
|
39
|
+
private downloadUrl;
|
|
40
40
|
}
|
|
41
41
|
export default ProjectsApi;
|
package/dist/Projects/index.js
CHANGED
|
@@ -64,10 +64,20 @@ class ProjectsApi extends ApiGroup_1.default {
|
|
|
64
64
|
this.emit('project', { type: 'completed', projectId: data.jobID });
|
|
65
65
|
return;
|
|
66
66
|
case 'initiatingModel':
|
|
67
|
-
this.emit('job', {
|
|
67
|
+
this.emit('job', {
|
|
68
|
+
type: 'initiating',
|
|
69
|
+
projectId: data.jobID,
|
|
70
|
+
jobId: data.imgID,
|
|
71
|
+
workerName: data.workerName
|
|
72
|
+
});
|
|
68
73
|
return;
|
|
69
74
|
case 'jobStarted': {
|
|
70
|
-
this.emit('job', {
|
|
75
|
+
this.emit('job', {
|
|
76
|
+
type: 'started',
|
|
77
|
+
projectId: data.jobID,
|
|
78
|
+
jobId: data.imgID,
|
|
79
|
+
workerName: data.workerName
|
|
80
|
+
});
|
|
71
81
|
return;
|
|
72
82
|
}
|
|
73
83
|
}
|
|
@@ -190,10 +200,10 @@ class ProjectsApi extends ApiGroup_1.default {
|
|
|
190
200
|
}
|
|
191
201
|
switch (event.type) {
|
|
192
202
|
case 'initiating':
|
|
193
|
-
job._update({ status: 'initiating' });
|
|
203
|
+
job._update({ status: 'initiating', workerName: event.workerName });
|
|
194
204
|
break;
|
|
195
205
|
case 'started':
|
|
196
|
-
job._update({ status: 'processing' });
|
|
206
|
+
job._update({ status: 'processing', workerName: event.workerName });
|
|
197
207
|
break;
|
|
198
208
|
case 'progress':
|
|
199
209
|
job._update({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Projects/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2DAAkD;AAClD,gEAAmC;AASnC,wDAAgC;AAChC,wFAAgE;AAChE,4CAAoD;AAGpD,6DAAqC;AAErC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAEtC,MAAM,WAAY,SAAQ,kBAA0B;IAIlD,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED,YAAY,MAAiB;QAC3B,KAAK,CAAC,MAAM,CAAC,CAAC;QARR,qBAAgB,GAAqB,EAAE,CAAC;QACxC,aAAQ,GAAc,EAAE,CAAC;QAQ/B,kEAAkE;QAClE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACxE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAClE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACxE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAClE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,WAAW,EA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,qBAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,CACpK,CAAC;YACF,OAAO;gBACL,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW;gBAClC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS;aAC/B,CAAC;QACJ,CAAC;KAAA;IAEa,SAAS,CAAC,MAAsB;;YAC5C,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAClC,qBAAqB,EACrB,MAAM,CACP,CAAC;YACF,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;KAAA;IAEa,WAAW,CAAC,MAAsB;;YAC9C,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAClC,uBAAuB,EACvB,MAAM,CACP,CAAC;YACF,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;QAC5B,CAAC;KAAA;CACF;AAED,kBAAe,WAAW,CAAC"}
|
|
@@ -21,9 +21,11 @@ export interface JobEventBase {
|
|
|
21
21
|
}
|
|
22
22
|
export interface JobInitiating extends JobEventBase {
|
|
23
23
|
type: 'initiating';
|
|
24
|
+
workerName: string;
|
|
24
25
|
}
|
|
25
26
|
export interface JobStarted extends JobEventBase {
|
|
26
27
|
type: 'started';
|
|
28
|
+
workerName: string;
|
|
27
29
|
}
|
|
28
30
|
export interface JobProgress extends JobEventBase {
|
|
29
31
|
type: 'progress';
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "0.
|
|
1
|
+
export declare const LIB_VERSION = "0.4.0-aplha.2";
|
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,eAAe,CAAC"}
|
package/package.json
CHANGED
package/src/Account/index.ts
CHANGED
|
@@ -17,6 +17,14 @@ import { SupernetType } from '../ApiClient/WebSocketClient/types';
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Account API methods that let you interact with the user's account.
|
|
20
|
+
* Can be accessed via `client.account`. Look for more samples below.
|
|
21
|
+
*
|
|
22
|
+
* @example Retrieve the current account balance
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const balance = await client.account.refreshBalance();
|
|
25
|
+
* console.log(balance);
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
20
28
|
*/
|
|
21
29
|
class AccountApi extends ApiGroup {
|
|
22
30
|
readonly currentAccount = new CurrentAccount();
|
|
@@ -43,13 +51,27 @@ class AccountApi extends ApiGroup {
|
|
|
43
51
|
this.currentAccount._clear();
|
|
44
52
|
}
|
|
45
53
|
|
|
46
|
-
async getNonce(walletAddress: string): Promise<string> {
|
|
54
|
+
private async getNonce(walletAddress: string): Promise<string> {
|
|
47
55
|
const res = await this.client.rest.post<ApiReponse<Nonce>>('/v1/account/nonce', {
|
|
48
56
|
walletAddress
|
|
49
57
|
});
|
|
50
58
|
return res.data.nonce;
|
|
51
59
|
}
|
|
52
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Create Ethers.js Wallet instance from username and password.
|
|
63
|
+
* This method is used internally to create a wallet for the user.
|
|
64
|
+
* You can use this method to create a wallet if you need to sign transactions.
|
|
65
|
+
*
|
|
66
|
+
* @example Create a wallet from username and password
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const wallet = client.account.getWallet('username', 'password');
|
|
69
|
+
* console.log(wallet.address);
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @param username - Sogni account username
|
|
73
|
+
* @param password - Sogni account password
|
|
74
|
+
*/
|
|
53
75
|
getWallet(username: string, password: string): Wallet {
|
|
54
76
|
const pwd = toUtf8Bytes(username.toLowerCase() + password);
|
|
55
77
|
const salt = toUtf8Bytes('sogni-salt-value');
|
|
@@ -57,6 +79,16 @@ class AccountApi extends ApiGroup {
|
|
|
57
79
|
return new Wallet(pkey, this.provider);
|
|
58
80
|
}
|
|
59
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Create a new account with the given username, email, and password.
|
|
84
|
+
* @internal
|
|
85
|
+
*
|
|
86
|
+
* @param username
|
|
87
|
+
* @param email
|
|
88
|
+
* @param password
|
|
89
|
+
* @param subscribe
|
|
90
|
+
* @param referralCode
|
|
91
|
+
*/
|
|
60
92
|
async create(
|
|
61
93
|
username: string,
|
|
62
94
|
email: string,
|
|
@@ -83,6 +115,31 @@ class AccountApi extends ApiGroup {
|
|
|
83
115
|
return res.data;
|
|
84
116
|
}
|
|
85
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Restore session with username and access token.
|
|
120
|
+
*
|
|
121
|
+
* You can save access token that you get from the login method and restore the session with this method.
|
|
122
|
+
*
|
|
123
|
+
* @example Store access token to local storage
|
|
124
|
+
* ```typescript
|
|
125
|
+
* const { username, token } = await client.account.login('username', 'password');
|
|
126
|
+
* localStorage.setItem('sogni-username', username);
|
|
127
|
+
* localStorage.setItem('sogni-token', token);
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* @example Restore session from local storage
|
|
131
|
+
* ```typescript
|
|
132
|
+
* const username = localStorage.getItem('sogni-username');
|
|
133
|
+
* const token = localStorage.getItem('sogni-token');
|
|
134
|
+
* if (username && token) {
|
|
135
|
+
* client.account.setToken(username, token);
|
|
136
|
+
* console.log('Session restored');
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* @param username
|
|
141
|
+
* @param token
|
|
142
|
+
*/
|
|
86
143
|
setToken(username: string, token: string): void {
|
|
87
144
|
this.client.authenticate(token);
|
|
88
145
|
this.currentAccount._update({
|
|
@@ -93,6 +150,13 @@ class AccountApi extends ApiGroup {
|
|
|
93
150
|
|
|
94
151
|
/**
|
|
95
152
|
* Login with username and password. WebSocket connection is established after successful login.
|
|
153
|
+
*
|
|
154
|
+
* @example Login with username and password
|
|
155
|
+
* ```typescript
|
|
156
|
+
* await client.account.login('username', 'password');
|
|
157
|
+
* console.log('Logged in');
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
96
160
|
* @param username
|
|
97
161
|
* @param password
|
|
98
162
|
*/
|
|
@@ -113,6 +177,12 @@ class AccountApi extends ApiGroup {
|
|
|
113
177
|
|
|
114
178
|
/**
|
|
115
179
|
* Logout the user and close the WebSocket connection.
|
|
180
|
+
*
|
|
181
|
+
* @example Logout the user
|
|
182
|
+
* ```typescript
|
|
183
|
+
* await client.account.logout();
|
|
184
|
+
* console.log('Logged out');
|
|
185
|
+
* ```
|
|
116
186
|
*/
|
|
117
187
|
async logout(): Promise<void> {
|
|
118
188
|
this.client.rest.post('/v1/account/logout').catch((e) => {
|
|
@@ -124,6 +194,16 @@ class AccountApi extends ApiGroup {
|
|
|
124
194
|
|
|
125
195
|
/**
|
|
126
196
|
* Refresh the balance of the current account.
|
|
197
|
+
*
|
|
198
|
+
* Usually, you don't need to call this method manually. Balance is updated automatically
|
|
199
|
+
* through WebSocket events. But you can call this method to force a balance refresh.
|
|
200
|
+
*
|
|
201
|
+
* @example Refresh user account balance
|
|
202
|
+
* ```typescript
|
|
203
|
+
* const balance = await client.account.refreshBalance();
|
|
204
|
+
* console.log(balance);
|
|
205
|
+
* // { net: '100.000000', settled: '100.000000', credit: '0.000000', debit: '0.000000' }
|
|
206
|
+
* ```
|
|
127
207
|
*/
|
|
128
208
|
async refreshBalance(): Promise<BalanceData> {
|
|
129
209
|
const res = await this.client.rest.get<ApiReponse<BalanceData>>('/v1/account/balance');
|
|
@@ -132,7 +212,18 @@ class AccountApi extends ApiGroup {
|
|
|
132
212
|
}
|
|
133
213
|
|
|
134
214
|
/**
|
|
135
|
-
* Get the balance of
|
|
215
|
+
* Get the balance of the wallet address.
|
|
216
|
+
*
|
|
217
|
+
* This method is used to get the balance of the wallet address. It returns $SOGNI and ETH balance.
|
|
218
|
+
*
|
|
219
|
+
* @example Get the balance of the wallet address
|
|
220
|
+
* ```typescript
|
|
221
|
+
* const address = client.account.currentAccount.walletAddress;
|
|
222
|
+
* const balance = await client.account.walletBalance(address);
|
|
223
|
+
* console.log(balance);
|
|
224
|
+
* // { token: '100.000000', ether: '0.000000' }
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
136
227
|
* @param walletAddress
|
|
137
228
|
*/
|
|
138
229
|
async walletBalance(walletAddress: string) {
|
|
@@ -145,6 +236,11 @@ class AccountApi extends ApiGroup {
|
|
|
145
236
|
return res.data;
|
|
146
237
|
}
|
|
147
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Validate the username before signup
|
|
241
|
+
* @internal
|
|
242
|
+
* @param username
|
|
243
|
+
*/
|
|
148
244
|
async validateUsername(username: string) {
|
|
149
245
|
try {
|
|
150
246
|
return await this.client.rest.post<ApiReponse<undefined>>('/v1/account/username/validate', {
|
|
@@ -165,6 +261,14 @@ class AccountApi extends ApiGroup {
|
|
|
165
261
|
* Switch between fast and relaxed networks.
|
|
166
262
|
* Note: This method will close the current WebSocket connection and establish a new one.
|
|
167
263
|
* Do not call this method if you have any active projects.
|
|
264
|
+
*
|
|
265
|
+
* @example Switch to the fast network
|
|
266
|
+
* ```typescript
|
|
267
|
+
* client.apiClient.once('connected', ({ network }) => {
|
|
268
|
+
* console.log('Switched to the network:', network);
|
|
269
|
+
* });
|
|
270
|
+
* await client.account.switchNetwork('fast');
|
|
271
|
+
* ```
|
|
168
272
|
* @param network
|
|
169
273
|
*/
|
|
170
274
|
async switchNetwork(network: SupernetType) {
|
|
@@ -177,7 +281,18 @@ class AccountApi extends ApiGroup {
|
|
|
177
281
|
|
|
178
282
|
/**
|
|
179
283
|
* Get the transaction history of the current account.
|
|
180
|
-
*
|
|
284
|
+
*
|
|
285
|
+
* @example Get the transaction history
|
|
286
|
+
* ```typescript
|
|
287
|
+
* const { entries, next } = await client.account.transactionHistory({
|
|
288
|
+
* status: 'completed',
|
|
289
|
+
* limit: 10,
|
|
290
|
+
* address: client.account.currentAccount.walletAddress
|
|
291
|
+
* });
|
|
292
|
+
* ```
|
|
293
|
+
*
|
|
294
|
+
* @param params - Transaction history query parameters
|
|
295
|
+
* @returns Transaction history entries and next query parameters
|
|
181
296
|
*/
|
|
182
297
|
async transactionHistory(
|
|
183
298
|
params: TxHistoryParams
|
|
@@ -211,6 +326,10 @@ class AccountApi extends ApiGroup {
|
|
|
211
326
|
};
|
|
212
327
|
}
|
|
213
328
|
|
|
329
|
+
/**
|
|
330
|
+
* Get the rewards of the current account.
|
|
331
|
+
* @internal
|
|
332
|
+
*/
|
|
214
333
|
async rewards(): Promise<Reward[]> {
|
|
215
334
|
const r =
|
|
216
335
|
await this.client.rest.get<ApiReponse<{ rewards: RewardRaw[] }>>('/v2/account/rewards');
|
|
@@ -233,6 +352,11 @@ class AccountApi extends ApiGroup {
|
|
|
233
352
|
);
|
|
234
353
|
}
|
|
235
354
|
|
|
355
|
+
/**
|
|
356
|
+
* Claim rewards by reward IDs.
|
|
357
|
+
* @internal
|
|
358
|
+
* @param rewardIds
|
|
359
|
+
*/
|
|
236
360
|
async claimRewards(rewardIds: string[]): Promise<void> {
|
|
237
361
|
await this.client.rest.post('/v2/account/reward/claim', {
|
|
238
362
|
claims: rewardIds
|
package/src/Projects/Job.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface JobData {
|
|
|
17
17
|
status: JobStatus;
|
|
18
18
|
step: number;
|
|
19
19
|
stepCount: number;
|
|
20
|
+
workerName?: string;
|
|
20
21
|
seed?: number;
|
|
21
22
|
isNSFW?: boolean;
|
|
22
23
|
userCanceled?: boolean;
|
|
@@ -108,6 +109,13 @@ class Job extends DataEntity<JobData, JobEventMap> {
|
|
|
108
109
|
return !!this.data.isNSFW;
|
|
109
110
|
}
|
|
110
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Name of the worker that is processing this job.
|
|
114
|
+
*/
|
|
115
|
+
get workerName() {
|
|
116
|
+
return this.data.workerName;
|
|
117
|
+
}
|
|
118
|
+
|
|
111
119
|
private handleUpdated(keys: string[]) {
|
|
112
120
|
if (keys.includes('step') || keys.includes('stepCount')) {
|
|
113
121
|
this.emit('progress', this.progress);
|
package/src/Projects/index.ts
CHANGED
|
@@ -66,10 +66,20 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
66
66
|
this.emit('project', { type: 'completed', projectId: data.jobID });
|
|
67
67
|
return;
|
|
68
68
|
case 'initiatingModel':
|
|
69
|
-
this.emit('job', {
|
|
69
|
+
this.emit('job', {
|
|
70
|
+
type: 'initiating',
|
|
71
|
+
projectId: data.jobID,
|
|
72
|
+
jobId: data.imgID,
|
|
73
|
+
workerName: data.workerName
|
|
74
|
+
});
|
|
70
75
|
return;
|
|
71
76
|
case 'jobStarted': {
|
|
72
|
-
this.emit('job', {
|
|
77
|
+
this.emit('job', {
|
|
78
|
+
type: 'started',
|
|
79
|
+
projectId: data.jobID,
|
|
80
|
+
jobId: data.imgID,
|
|
81
|
+
workerName: data.workerName
|
|
82
|
+
});
|
|
73
83
|
return;
|
|
74
84
|
}
|
|
75
85
|
}
|
|
@@ -149,7 +159,7 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
149
159
|
});
|
|
150
160
|
}
|
|
151
161
|
|
|
152
|
-
handleProjectEvent(event: ProjectEvent) {
|
|
162
|
+
private handleProjectEvent(event: ProjectEvent) {
|
|
153
163
|
let project = this.projects.find((p) => p.id === event.projectId);
|
|
154
164
|
if (!project) {
|
|
155
165
|
return;
|
|
@@ -179,7 +189,7 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
179
189
|
}
|
|
180
190
|
}
|
|
181
191
|
|
|
182
|
-
handleJobEvent(event: JobEvent) {
|
|
192
|
+
private handleJobEvent(event: JobEvent) {
|
|
183
193
|
let project = this.projects.find((p) => p.id === event.projectId);
|
|
184
194
|
if (!project) {
|
|
185
195
|
return;
|
|
@@ -195,10 +205,10 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
195
205
|
}
|
|
196
206
|
switch (event.type) {
|
|
197
207
|
case 'initiating':
|
|
198
|
-
job._update({ status: 'initiating' });
|
|
208
|
+
job._update({ status: 'initiating', workerName: event.workerName });
|
|
199
209
|
break;
|
|
200
210
|
case 'started':
|
|
201
|
-
job._update({ status: 'processing' });
|
|
211
|
+
job._update({ status: 'processing', workerName: event.workerName });
|
|
202
212
|
break;
|
|
203
213
|
case 'progress':
|
|
204
214
|
job._update({
|
|
@@ -320,7 +330,7 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
320
330
|
};
|
|
321
331
|
}
|
|
322
332
|
|
|
323
|
-
async uploadUrl(params: ImageUrlParams) {
|
|
333
|
+
private async uploadUrl(params: ImageUrlParams) {
|
|
324
334
|
const r = await this.client.rest.get<ApiReponse<{ uploadUrl: string }>>(
|
|
325
335
|
`/v1/image/uploadUrl`,
|
|
326
336
|
params
|
|
@@ -328,7 +338,7 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
|
|
|
328
338
|
return r.data.uploadUrl;
|
|
329
339
|
}
|
|
330
340
|
|
|
331
|
-
async downloadUrl(params: ImageUrlParams) {
|
|
341
|
+
private async downloadUrl(params: ImageUrlParams) {
|
|
332
342
|
const r = await this.client.rest.get<ApiReponse<{ downloadUrl: string }>>(
|
|
333
343
|
`/v1/image/downloadUrl`,
|
|
334
344
|
params
|
|
@@ -28,10 +28,12 @@ export interface JobEventBase {
|
|
|
28
28
|
|
|
29
29
|
export interface JobInitiating extends JobEventBase {
|
|
30
30
|
type: 'initiating';
|
|
31
|
+
workerName: string;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export interface JobStarted extends JobEventBase {
|
|
34
35
|
type: 'started';
|
|
36
|
+
workerName: string;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export interface JobProgress extends JobEventBase {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "0.
|
|
1
|
+
export const LIB_VERSION = "0.4.0-aplha.2";
|