ts / dist / esm / sharing.js
214 words
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { checkGate } from './gate.js';
import * as http from './http.js';
/** GET /domains/registrations/{id}/grants — Who has delegated access to this domain (outgoing). */
export const listDomainGrants = (client, id) => http.get(client, '/domains/registrations/{id}/grants', { params: { id } });
/** POST /domains/registrations/{id}/grants — Invite another customer to manage parts of this domain. */
export const invite = async (client, id, body) => {
    await checkGate(client, 'POST /domains/registrations/{id}/grants', { registrationId: id });
    return http.post(client, '/domains/registrations/{id}/grants', { params: { id }, body });
};
/** DELETE /domains/registrations/{id}/grants/{grant-id} — Revoke delegated access. */
export const revokeGrant = async (client, id, grantId) => {
    await checkGate(client, 'DELETE /domains/registrations/{id}/grants/{grant-id}', { registrationId: id });
    return http.del(client, '/domains/registrations/{id}/grants/{grant-id}', { params: { id, 'grant-id': grantId } });
};
/** GET /grants — Domains shared with this account (incoming). */
export const listGrants = (client) => http.get(client, '/grants');
/** POST /grants/{id}/accept — Accept a delegated-access invite. */
export const acceptGrant = (client, id) => http.post(client, '/grants/{id}/accept', { params: { id } });
/** POST /grants/{id}/decline — Decline a delegated-access invite. */
export const declineGrant = (client, id) => http.post(client, '/grants/{id}/decline', { params: { id } });
/** POST /grants/{id}/leave — Walk away from an active grant. */
export const leaveGrant = (client, id) => http.post(client, '/grants/{id}/leave', { params: { id } });

static mirror of HEAD · about · clone: git clone https://ird.cod-sursa.ro/ts.git