UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

59 lines • 2.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Invites = exports.BaseInvites = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../core/resource.js"); const pagination_1 = require("../../core/pagination.js"); const path_1 = require("../../internal/utils/path.js"); var BaseInvites = /* @__PURE__ */ (() => { class BaseInvites extends resource_1.APIResource { /** * Lists all invitations associated with my user. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const invite of client.user.invites.list()) { * // ... * } * ``` */ list(options) { return this._client.getAPIList('/user/invites', (pagination_1.SinglePage), options); } /** * Responds to an invitation. * * @example * ```ts * const invite = await client.user.invites.edit( * '4f5f0c14a2a41d5063dd301b2f829f04', * { status: 'accepted' }, * ); * ``` */ edit(inviteID, body, options) { return this._client.patch((0, path_1.path) `/user/invites/${inviteID}`, { body, ...options })._thenUnwrap((obj) => obj.result); } /** * Gets the details of an invitation. * * @example * ```ts * const invite = await client.user.invites.get( * '4f5f0c14a2a41d5063dd301b2f829f04', * ); * ``` */ get(inviteID, options) { return this._client.get((0, path_1.path) `/user/invites/${inviteID}`, options)._thenUnwrap((obj) => obj.result); } } BaseInvites._key = Object.freeze(['user', 'invites']); return BaseInvites; })(); exports.BaseInvites = BaseInvites; class Invites extends BaseInvites { } exports.Invites = Invites; //# sourceMappingURL=invites.js.map