SHA256
Добавить UI pairing по коду и обновить документацию агента
This commit is contained in:
@@ -966,6 +966,68 @@ export class AuthService {
|
||||
if (response.status !== 200) throw opError('CloseActiveSession', response);
|
||||
}
|
||||
|
||||
async upsertEspPairingSettings({ enabled, passwordHash = '', ttlSeconds = 180 }) {
|
||||
const response = await this.ws.request('UpsertEspPairingSettings', {
|
||||
enabled: !!enabled,
|
||||
passwordHash: String(passwordHash || '').trim(),
|
||||
ttlSeconds: Number(ttlSeconds) || 180,
|
||||
});
|
||||
if (response.status !== 200) throw opError('UpsertEspPairingSettings', response);
|
||||
return response.payload || {};
|
||||
}
|
||||
|
||||
async startEspPairing({
|
||||
login,
|
||||
passwordHash,
|
||||
requesterSessionKey,
|
||||
requesterSessionType = SESSION_TYPE_CLIENT,
|
||||
requesterClientPlatform = makeClientPlatform(),
|
||||
payloadType = 3,
|
||||
}) {
|
||||
const response = await this.ws.request('StartEspPairing', {
|
||||
login: String(login || '').trim(),
|
||||
passwordHash: String(passwordHash || '').trim(),
|
||||
requesterSessionKey: String(requesterSessionKey || '').trim(),
|
||||
requesterSessionType: Number(requesterSessionType) || SESSION_TYPE_CLIENT,
|
||||
requesterClientPlatform: String(requesterClientPlatform || '').trim() || makeClientPlatform(),
|
||||
payloadType: Number(payloadType) || 3,
|
||||
});
|
||||
if (response.status !== 200) throw opError('StartEspPairing', response);
|
||||
return response.payload || {};
|
||||
}
|
||||
|
||||
async listEspPairingRequests() {
|
||||
const response = await this.ws.request('ListEspPairingRequests', {});
|
||||
if (response.status !== 200) throw opError('ListEspPairingRequests', response);
|
||||
return Array.isArray(response?.payload?.requests) ? response.payload.requests : [];
|
||||
}
|
||||
|
||||
async approveEspPairing(pairingId, encryptedPayload) {
|
||||
const response = await this.ws.request('ApproveEspPairing', {
|
||||
pairingId: String(pairingId || '').trim(),
|
||||
encryptedPayload: String(encryptedPayload || '').trim(),
|
||||
});
|
||||
if (response.status !== 200) throw opError('ApproveEspPairing', response);
|
||||
return response.payload || {};
|
||||
}
|
||||
|
||||
async rejectEspPairing(pairingId, reason = '') {
|
||||
const response = await this.ws.request('RejectEspPairing', {
|
||||
pairingId: String(pairingId || '').trim(),
|
||||
reason: String(reason || '').trim(),
|
||||
});
|
||||
if (response.status !== 200) throw opError('RejectEspPairing', response);
|
||||
return response.payload || {};
|
||||
}
|
||||
|
||||
async getEspPairingStatus(pairingId) {
|
||||
const response = await this.ws.request('GetEspPairingStatus', {
|
||||
pairingId: String(pairingId || '').trim(),
|
||||
});
|
||||
if (response.status !== 200) throw opError('GetEspPairingStatus', response);
|
||||
return response.payload || {};
|
||||
}
|
||||
|
||||
async listSubscriptionsFeed(login, limit = 200) {
|
||||
const response = await this.ws.request('ListSubscriptionsFeed', { login, limit });
|
||||
if (response.status !== 200) throw opError('ListSubscriptionsFeed', response);
|
||||
|
||||
Reference in New Issue
Block a user