@anthropic-ai/sdk
Version:
The official TypeScript library for the Anthropic API
144 lines • 7.52 kB
JavaScript
import { APIResource } from "../../core/resource.mjs";
import * as APIKeysAPI from "./api-keys.mjs";
import { APIKeys, OrgAPIKeyLimitExceededError, WorkspaceAPIKeyLimitExceededError, } from "./api-keys.mjs";
import * as ComplianceSettingsAPI from "./compliance-settings.mjs";
import { ComplianceSettings, } from "./compliance-settings.mjs";
import * as ExternalKeysAPI from "./external-keys.mjs";
import { ExternalKeyChangedError, ExternalKeyInWorkspacePolicyError, ExternalKeyValidationFailedError, ExternalKeyValidationTimedOutError, ExternalKeys, } from "./external-keys.mjs";
import * as InvitesAPI from "./invites.mjs";
import { AlreadyMemberError, CannotInviteEmailsWithUnverifiedDomainsError, EmailDomainNotAllowedError, InviteAlreadyExistsError, Invites, } from "./invites.mjs";
import * as RateLimitsAPI from "./rate-limits.mjs";
import { RateLimits, } from "./rate-limits.mjs";
import * as UsersAPI from "./users.mjs";
import { CannotRemoveLastMemberError, Users, } from "./users.mjs";
import * as AnalyticsAPI from "./analytics/analytics.mjs";
import { Analytics, } from "./analytics/analytics.mjs";
import * as FederationAPI from "./federation/federation.mjs";
import { Federation } from "./federation/federation.mjs";
import * as RBACGroupsAPI from "./rbac-groups/rbac-groups.mjs";
import { RBACGroupGrantsOwnerAccessError, RBACGroupOwnerAccessUnconfirmedError, RBACGroups, } from "./rbac-groups/rbac-groups.mjs";
import * as RBACRolesAPI from "./rbac-roles/rbac-roles.mjs";
import { RBACRoles, } from "./rbac-roles/rbac-roles.mjs";
import * as ServiceAccountsAPI from "./service-accounts/service-accounts.mjs";
import { ServiceAccounts, } from "./service-accounts/service-accounts.mjs";
import * as SpendLimitsAPI from "./spend-limits/spend-limits.mjs";
import { SpendLimits, } from "./spend-limits/spend-limits.mjs";
import * as WorkspacesAPI from "./workspaces/workspaces.mjs";
import { KeyProfileMismatchError, WorkspaceMemberLimitExceededError, WorkspacePolicyViolationError, Workspaces, } from "./workspaces/workspaces.mjs";
import { BadRequestError, ConflictError, NotFoundError } from "../../core/error.mjs";
import { startApiCallSpan } from "../../internal/tracing.mjs";
/**
* The organization has reached the member limit that Anthropic set for it. Pending
* invites count toward the limit.
*/
export var OrgMemberLimitExceededError = /* @__PURE__ */ (() => {
/**
* The organization has reached the member limit that Anthropic set for it. Pending
* invites count toward the limit.
*/
class OrgMemberLimitExceededError extends BadRequestError {
}
/** @internal */
OrgMemberLimitExceededError._errorName = 'OrgMemberLimitExceededError';
return OrgMemberLimitExceededError;
})();
/**
* No RBAC Role with this ID was found.
*/
export var RBACRoleNotFoundError = /* @__PURE__ */ (() => {
/**
* No RBAC Role with this ID was found.
*/
class RBACRoleNotFoundError extends NotFoundError {
}
/** @internal */
RBACRoleNotFoundError._errorName = 'RBACRoleNotFoundError';
return RBACRoleNotFoundError;
})();
/**
* Another change to the organization's members is in progress. Retry the request
* once it completes.
*/
export var ConcurrentMembershipChangeError = /* @__PURE__ */ (() => {
/**
* Another change to the organization's members is in progress. Retry the request
* once it completes.
*/
class ConcurrentMembershipChangeError extends ConflictError {
}
/** @internal */
ConcurrentMembershipChangeError._errorName = 'ConcurrentMembershipChangeError';
return ConcurrentMembershipChangeError;
})();
export var Organization = /* @__PURE__ */ (() => {
class Organization extends APIResource {
constructor() {
super(...arguments);
this.apiKeys = new APIKeysAPI.APIKeys(this._client);
this.externalKeys = new ExternalKeysAPI.ExternalKeys(this._client);
this.federation = new FederationAPI.Federation(this._client);
this.invites = new InvitesAPI.Invites(this._client);
this.serviceAccounts = new ServiceAccountsAPI.ServiceAccounts(this._client);
this.users = new UsersAPI.Users(this._client);
this.workspaces = new WorkspacesAPI.Workspaces(this._client);
this.rateLimits = new RateLimitsAPI.RateLimits(this._client);
this.complianceSettings = new ComplianceSettingsAPI.ComplianceSettings(this._client);
this.analytics = new AnalyticsAPI.Analytics(this._client);
this.spendLimits = new SpendLimitsAPI.SpendLimits(this._client);
this.rbacGroups = new RBACGroupsAPI.RBACGroups(this._client);
this.rbacRoles = new RBACRolesAPI.RBACRoles(this._client);
}
/**
* Retrieve information about the organization associated with the authenticated
* API key.
*
* @example
* ```ts
* const organizationInfo =
* await client.organization.retrieve();
* ```
*/
retrieve(options) {
return this._client.get('/v1/organizations/me', {
...options,
__span: startApiCallSpan(this._client, 'anthropic.organization.retrieve', options, {
route: '/v1/organizations/me',
}),
});
}
}
Organization.OrgMemberLimitExceededError = OrgMemberLimitExceededError;
Organization.RBACRoleNotFoundError = RBACRoleNotFoundError;
Organization.ConcurrentMembershipChangeError = ConcurrentMembershipChangeError;
Organization.APIKeys = APIKeys;
Organization.OrgAPIKeyLimitExceededError = OrgAPIKeyLimitExceededError;
Organization.WorkspaceAPIKeyLimitExceededError = WorkspaceAPIKeyLimitExceededError;
Organization.ExternalKeys = ExternalKeys;
Organization.ExternalKeyInWorkspacePolicyError = ExternalKeyInWorkspacePolicyError;
Organization.ExternalKeyValidationFailedError = ExternalKeyValidationFailedError;
Organization.ExternalKeyValidationTimedOutError = ExternalKeyValidationTimedOutError;
Organization.ExternalKeyChangedError = ExternalKeyChangedError;
Organization.Federation = Federation;
Organization.Invites = Invites;
Organization.AlreadyMemberError = AlreadyMemberError;
Organization.CannotInviteEmailsWithUnverifiedDomainsError = CannotInviteEmailsWithUnverifiedDomainsError;
Organization.EmailDomainNotAllowedError = EmailDomainNotAllowedError;
Organization.InviteAlreadyExistsError = InviteAlreadyExistsError;
Organization.ServiceAccounts = ServiceAccounts;
Organization.Users = Users;
Organization.CannotRemoveLastMemberError = CannotRemoveLastMemberError;
Organization.Workspaces = Workspaces;
Organization.KeyProfileMismatchError = KeyProfileMismatchError;
Organization.WorkspaceMemberLimitExceededError = WorkspaceMemberLimitExceededError;
Organization.WorkspacePolicyViolationError = WorkspacePolicyViolationError;
Organization.RateLimits = RateLimits;
Organization.ComplianceSettings = ComplianceSettings;
Organization.Analytics = Analytics;
Organization.SpendLimits = SpendLimits;
Organization.RBACGroups = RBACGroups;
Organization.RBACGroupGrantsOwnerAccessError = RBACGroupGrantsOwnerAccessError;
Organization.RBACGroupOwnerAccessUnconfirmedError = RBACGroupOwnerAccessUnconfirmedError;
Organization.RBACRoles = RBACRoles;
return Organization;
})();
//# sourceMappingURL=organization.mjs.map