Добавить UI pairing по коду и обновить документацию агента

This commit is contained in:
AidarKC
2026-06-14 20:39:05 +04:00
parent b166013707
commit c681b4d684
13 changed files with 846 additions and 5 deletions
+62
View File
@@ -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);