@attesso/types
v2.0.1
Published
Type definitions for Attesso — cybersecurity authorization layer for AI agents.
Maintainers
Readme
@attesso/types
TypeScript type definitions for the Attesso API.
npm install @attesso/typesOverview
Shared TypeScript types used across all Attesso packages. Zero runtime dependencies except for PROCESSING_FEES which is a plain object constant.
Mandates
import type {
Mandate,
MandateResponse,
MandateStatus,
CreateMandateRequest,
FeeMode,
FeeRegion,
MandateFees,
PreviewFeesRequest,
PreviewFeesResponse,
} from '@attesso/types';
// MandateStatus: 'active' | 'issuing' | 'completed' | 'revoked' | 'expired'
// FeeMode: 'markup' | 'inclusive'
// FeeRegion: 'EEA' | 'US' | 'UK' | 'CUSTOM'Mandate Requests
import type {
CreateMandateRequestInput,
CreateMandateRequestResponse,
MandateRequestDetails,
MandateRequestStatus,
ApprovedMandateDetails,
MandateRequestEventType,
MandateRequestWebhookPayload,
} from '@attesso/types';
// MandateRequestStatus: 'pending' | 'approved' | 'expired' | 'rejected' | 'cancelled'Payments and Cards
import type {
Payment,
PaymentResponse,
PaymentStatus,
PaymentError,
PaymentErrorCode,
IssueCardRequest,
IssueCardResponse,
} from '@attesso/types';
// PaymentStatus: 'pending' | 'processing' | 'authorized' | 'completed' | 'failed' | 'cancelled'
// PaymentErrorCode: 'MANDATE_NOT_FOUND' | 'AMOUNT_EXCEEDS_LIMIT' | 'MERCHANT_MISMATCH' | ...Fee Calculation
FeeMode controls how fees relate to the mandate amount:
'markup'-- use for commerce. The amount is the agent's spending limit. Fees are added on top, so the user pays more than the stated amount. Choose this when the agent needs a specific budget (e.g., "buy an item for $100").'inclusive'-- use for fixed budgets. The amount is what the user is charged. Fees are deducted, so the agent's spending limit is less than the stated amount. Choose this for stipends, allowances, or any scenario where the user expects to pay an exact figure.
import type {
FeeMode,
FeeRegion,
MandateFees,
PreviewFeesRequest,
PreviewFeesResponse,
RegionalFeeStructure,
RegionalFees,
InclusiveFeeConfig,
FeeBreakdown,
InclusiveFeeResult,
} from '@attesso/types';
import { PROCESSING_FEES } from '@attesso/types';
// Pre-configured Revolut acquiring rates
PROCESSING_FEES.EEA // { variablePercent: 1.2, fixedCents: 20, currency: 'EUR' }
PROCESSING_FEES.US // { variablePercent: 1.2, fixedCents: 30, currency: 'USD' }
PROCESSING_FEES.UK // { variablePercent: 1.2, fixedCents: 20, currency: 'GBP' }For fee calculation logic, see @attesso/rails.
Users
import type {
User,
BankAccount,
AuthChallengeRequest,
AuthChallengeResponse,
AuthTokenResponse,
} from '@attesso/types';Package Compatibility
This package is used by:
@attesso/sdk-- Client SDK@attesso/mcp-- MCP server
Requirements
- TypeScript 5.0+
Links
- Website: https://www.attesso.com
- Support: [email protected]
License
MIT
