@conto_finance/sdk 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +96 -2
- package/dist/index.d.ts +96 -2
- package/dist/index.js +5 -2
- package/dist/index.mjs +5 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1028,6 +1028,92 @@ interface PaymentRequestInput {
|
|
|
1028
1028
|
/** Client-supplied key for idempotent retries */
|
|
1029
1029
|
idempotencyKey?: string;
|
|
1030
1030
|
}
|
|
1031
|
+
/** Whether a path works: `unknown` means Conto has no evidence either way. */
|
|
1032
|
+
type SetupCapabilityState = 'yes' | 'no' | 'unknown';
|
|
1033
|
+
/**
|
|
1034
|
+
* Stable setup issue codes. New codes can appear within a diagnostics version,
|
|
1035
|
+
* so handle an unrecognized code by its `severity` and `actor`.
|
|
1036
|
+
*/
|
|
1037
|
+
type SetupDiagnosticIssueCode = 'AGENT_PAUSED' | 'AGENT_FROZEN' | 'AGENT_UNAVAILABLE' | 'SDK_KEY_EXPIRED' | 'SDK_KEY_REVOKED' | 'SCOPE_MISSING' | 'NO_WALLET' | 'WALLET_PAUSED' | 'WALLET_UNAVAILABLE' | 'WALLET_VIEW_ONLY' | 'WALLET_UNFUNDED' | 'MAINNET_REQUIRES_PROD_AGENT' | 'LIVE_PAYMENTS_PAUSED' | 'LIVE_PAYMENTS_UNAVAILABLE' | 'EXTERNAL_SIGNER_REQUIRED' | 'SANDBOX_UNCLAIMED' | 'SANDBOX_EXPIRED' | (string & {});
|
|
1038
|
+
/** A next step: a documented command, an API call, or a dashboard page for an owner. */
|
|
1039
|
+
type SetupDiagnosticAction = {
|
|
1040
|
+
type: 'command';
|
|
1041
|
+
command: string;
|
|
1042
|
+
description: string;
|
|
1043
|
+
} | {
|
|
1044
|
+
type: 'api';
|
|
1045
|
+
method: 'GET' | 'POST' | 'PATCH';
|
|
1046
|
+
/** Relative to the Conto base URL. Segments in braces are placeholders. */
|
|
1047
|
+
href: string;
|
|
1048
|
+
credential: 'sdk_key' | 'sandbox_api_key' | 'organization_api_key';
|
|
1049
|
+
requiredScope: string | null;
|
|
1050
|
+
description: string;
|
|
1051
|
+
} | {
|
|
1052
|
+
type: 'owner_url';
|
|
1053
|
+
/** A dashboard page, relative to the Conto base URL. */
|
|
1054
|
+
url: string;
|
|
1055
|
+
description: string;
|
|
1056
|
+
};
|
|
1057
|
+
interface SetupDiagnosticIssue {
|
|
1058
|
+
code: SetupDiagnosticIssueCode;
|
|
1059
|
+
/** `error` blocks a capability of the resource. `info` explains how a path works. */
|
|
1060
|
+
severity: 'error' | 'warning' | 'info';
|
|
1061
|
+
/** Who can resolve it: the agent with its own credentials, or an owner. */
|
|
1062
|
+
actor: 'agent' | 'owner';
|
|
1063
|
+
resource: {
|
|
1064
|
+
type: 'agent' | 'wallet' | 'sdk_key' | 'organization';
|
|
1065
|
+
id: string | null;
|
|
1066
|
+
};
|
|
1067
|
+
message: string;
|
|
1068
|
+
/** The missing scope for SCOPE_MISSING, otherwise null. */
|
|
1069
|
+
requiredScope: string | null;
|
|
1070
|
+
actions: SetupDiagnosticAction[];
|
|
1071
|
+
}
|
|
1072
|
+
interface SetupWalletDiagnostics {
|
|
1073
|
+
walletId: string;
|
|
1074
|
+
/** `simulated` sandbox, `managed` by Conto, `external` signer, or `unknown`. */
|
|
1075
|
+
executionMode: 'simulated' | 'managed' | 'external' | 'unknown';
|
|
1076
|
+
network: 'testnet' | 'mainnet';
|
|
1077
|
+
/** `not_checked`: Conto does not read this wallet's balance. */
|
|
1078
|
+
funding: 'not_required' | 'funded' | 'unfunded' | 'not_checked';
|
|
1079
|
+
walletLimits: boolean;
|
|
1080
|
+
canRequest: SetupCapabilityState;
|
|
1081
|
+
canExecute: SetupCapabilityState;
|
|
1082
|
+
issueCodes: SetupDiagnosticIssueCode[];
|
|
1083
|
+
}
|
|
1084
|
+
interface SetupCardDiagnostics {
|
|
1085
|
+
availability: 'available' | 'unavailable';
|
|
1086
|
+
reason: 'sandbox_organization' | 'disabled' | 'plan' | null;
|
|
1087
|
+
assignedCards: number;
|
|
1088
|
+
activeAuthorizations: number;
|
|
1089
|
+
canUse: 'yes' | 'no';
|
|
1090
|
+
}
|
|
1091
|
+
/** Versioned setup diagnostics from `GET /api/sdk/setup`. */
|
|
1092
|
+
interface SetupDiagnostics {
|
|
1093
|
+
version: 'conto.setup-diagnostics.v1';
|
|
1094
|
+
environment: {
|
|
1095
|
+
kind: 'anonymous_sandbox' | 'claimed_sandbox' | 'account';
|
|
1096
|
+
settlement: 'simulated' | 'per_wallet';
|
|
1097
|
+
agentEnvironment: 'DEV' | 'STAGING' | 'PROD';
|
|
1098
|
+
sandboxExpiresAt: string | null;
|
|
1099
|
+
} | null;
|
|
1100
|
+
status: {
|
|
1101
|
+
authenticated: boolean;
|
|
1102
|
+
canRequest: SetupCapabilityState;
|
|
1103
|
+
canExecute: SetupCapabilityState;
|
|
1104
|
+
ownerActionRequired: boolean;
|
|
1105
|
+
};
|
|
1106
|
+
wallets: SetupWalletDiagnostics[];
|
|
1107
|
+
/** Test and live cards, reported apart from wallets. */
|
|
1108
|
+
connectedCards: {
|
|
1109
|
+
test: SetupCardDiagnostics;
|
|
1110
|
+
live: SetupCardDiagnostics;
|
|
1111
|
+
} | null;
|
|
1112
|
+
controls: {
|
|
1113
|
+
effectivePolicies: number;
|
|
1114
|
+
} | null;
|
|
1115
|
+
issues: SetupDiagnosticIssue[];
|
|
1116
|
+
}
|
|
1031
1117
|
interface AgentSetupResult {
|
|
1032
1118
|
agent: {
|
|
1033
1119
|
id: string;
|
|
@@ -1078,6 +1164,11 @@ interface AgentSetupResult {
|
|
|
1078
1164
|
totalVolume: number;
|
|
1079
1165
|
}>;
|
|
1080
1166
|
scopes: string[];
|
|
1167
|
+
/**
|
|
1168
|
+
* What this key can do and what needs an owner. Null when the server could
|
|
1169
|
+
* not compute it for this request. Absent from servers that predate it.
|
|
1170
|
+
*/
|
|
1171
|
+
diagnostics?: SetupDiagnostics | null;
|
|
1081
1172
|
}
|
|
1082
1173
|
interface ExternalWalletApprovalInput {
|
|
1083
1174
|
amount: number;
|
|
@@ -2338,7 +2429,10 @@ declare class Conto {
|
|
|
2338
2429
|
* reconciliation.
|
|
2339
2430
|
*/
|
|
2340
2431
|
cancelCommerceExecution(executionId: string): Promise<CommerceExecutionResult>;
|
|
2341
|
-
/**
|
|
2432
|
+
/**
|
|
2433
|
+
* Read credentials, linked wallets, effective policies, scopes, and setup
|
|
2434
|
+
* diagnostics without creating a payment.
|
|
2435
|
+
*/
|
|
2342
2436
|
setup(): Promise<AgentSetupResult>;
|
|
2343
2437
|
/** Make an authenticated request to the Conto API */
|
|
2344
2438
|
request<T>(method: string, path: string, body?: Record<string, unknown>, options?: ContoRequestOptions): Promise<T>;
|
|
@@ -2608,4 +2702,4 @@ declare class MppClient {
|
|
|
2608
2702
|
}): Promise<ProtocolServicesResult>;
|
|
2609
2703
|
}
|
|
2610
2704
|
|
|
2611
|
-
export { type AdminExternalCardOverlayEnforcement, type Agent, type AgentCheckoutAction, type AgentCheckoutActionKind, type AgentExternalCard, type AgentSetupResult, type AgentStatus, type AgentType, type AgentWalletLink, type ApprovedExternalCardExecution, type AssignExternalCardInput, type AssignedPolicy, type AuthorizeCheckoutActionResult, type BeginCommerceExecutionInput, type BrowserActionClaimResult, type BrowserActionDispatchObservationInput, BrowserActionFinalizationPendingError, type BrowserActionFinalizeResult, type BrowserCheckoutAction, type BrowserCheckoutTargetResolver, type BrowserCheckoutTargetSnapshot, type BrowserCheckoutTargetVerificationCode, BrowserCheckoutTargetVerificationError, type CanonicalBrowserCheckoutTargetSnapshot, CardsClient, type ChainType, type CheckoutActionAuthorization, type CommerceCheckoutMethod, type CommerceContextRequirement, type CommerceExecution, type CommerceExecutionAdapterKind, type CommerceExecutionArtifactKind, type CommerceExecutionChannel, type CommerceExecutionConstraint, type CommerceExecutionConstraintCoverage, type CommerceExecutionConstraintCoverageLevel, type CommerceExecutionDeliveryMode, type CommerceExecutionEvidence, type CommerceExecutionProvider, type CommerceExecutionResult, type CommerceExecutionSourceKind, type CommerceExecutionStatus, type CommerceFactConfidence, type CommerceFactProvenanceInput, type CommerceFactSource, type CommerceFulfillmentInput, type CommerceLineItemInput, type CommerceProposalFactKey, type CommerceProposalMissingFact, type CommerceProposalResolution, type CommerceProposalState, type CommerceSettlementRail, type CommerceTotalInput, type CommerceTotalType, type ComparePolicyVersionsResponse, type ConnectedCardBrief, type ConnectedCardCredential, type ConnectedCardDrawInput, type ConnectedCardDrawMerchant, type ConnectedCardDrawResult, type ConnectedCardDrawable, type ConnectedCardListResult, type ConnectedCardMandate, type ConnectedCardMandateMerchant, type ConnectedCardReference, ConnectedCardsClient, Conto, ContoAdmin, type ContoAdminConfig, ContoAdminError, type ContoConfig, ContoError, type ContoRequestOptions, type ControlledExternalCardPaymentResult, ControlledExternalCardPaymentTool, type CreateAgentInput, type CreatePolicyInput, type CreatePolicyRuleInput, type CreateSdkKeyInput, type CreateSdkKeyResult, type CreateWalletInput, type CustodyType, type CustomerCustodyMode, type CustomerWalletControlModel, type CustomerWalletKeyAccess, type DelegationType, type ExecuteCommerceExecutionResult, type ExternalCard, type ExternalCardApprovalInput, type ExternalCardApprovalResult, type ExternalCardConfirmationInput, ExternalCardConfirmationPendingError, type ExternalCardConfirmationResult, type ExternalCardExecutionClaimResult, type ExternalCardExecutionResult, type ExternalCardExecutor, type ExternalCardOverlayEnforcement, type ExternalCardRequestStatusResult, type ExternalWalletApprovalInput, type ExternalWalletApprovalResult, type ExternalWalletConfirmationInput, type ExternalWalletConfirmationResult, type FreezeAgentInput, Conto as Giro, type ContoConfig as GiroConfig, ContoError as GiroError, type GuardCheckoutResult, type GuardedBrowserDispatchResult, type GuardedCheckoutInput, type LinkWalletInput, type ListAgentsParams, type ListAgentsResponse, type ListPoliciesParams, type ListPoliciesResponse, type ListPolicyVersionsResponse, type ListStripeLinkPaymentMethodsResult, type ListWalletsParams, type ListWalletsResponse, type MppBudgetResult, type MppPreAuthorizeInput, type MppPreAuthorizeResult, type MppRecordInput, type MppRecordResult, type NormalizeCommerceProposalInput, type OrganizationMember, type PaginatedResponse, type PaginationParams, type PauseExternalCardAssignmentResult, type PaymentExecuteResult, type PaymentRequestInput, type PaymentRequestResult, type PaymentStatusResult, type Policy, type PolicyRule, type PolicyType, type PolicyVersionChangeType, type PolicyVersionDetail, type PolicyVersionDiff, type PolicyVersionFieldChange, type PolicyVersionSnapshot, type PolicyVersionSnapshotRule, type PolicyVersionSummary, type PrivilegedBrowserCheckoutDriver, type ProtocolBudgetResult, type ProtocolPreAuthorizeResult, type ProtocolRecordGrant, type ProtocolRecordGrantResult, type ProtocolServiceSummary, type ProtocolServicesResult, type ProvisionWalletResult, type RefreshBalanceResult, type RegisterExternalCardInput, type RollbackPolicyVersionResponse, type RuleAction, type RuleOperator, type RuleType, type RunGuardedCheckoutResult, type SdkKey, type SdkKeyType, type StripeLinkCheckoutReadiness, type StripeLinkCheckoutReadinessResult, type StripeLinkCheckoutReadinessStatus, type StripeLinkCheckoutVerification, type StripeLinkPaymentMethod, type TestCardCredential, type TestCardDrawResult, type TestCardDrawable, type TestCardListResult, type TestCardReceipt, TestCardsClient, type TestCheckoutInput, type TestCheckoutResult, type TestMerchant, type TestMerchantProduct, type UnfreezeAgentInput, type UpdateAgentInput, type UpdateExternalCardAssignmentInput, type UpdatePolicyInput, type UpdatePolicyRuleInput, type UpdateWalletInput, type VerifiedBrowserCheckoutTarget, type Wallet, type WalletChainBalanceSnapshot, type WalletStatus, type WalletType, type X402Authorization, type X402BudgetResult, type X402PayInput, type X402PayResult, type X402PaymentRequirements, type X402PreAuthorizeInput, type X402PreAuthorizeResult, type X402RecordInput, type X402RecordResult, canonicalizeBrowserCheckoutTarget, createVerifiedBrowserCheckoutDriver, Conto as default, fingerprintBrowserCheckoutTarget };
|
|
2705
|
+
export { type AdminExternalCardOverlayEnforcement, type Agent, type AgentCheckoutAction, type AgentCheckoutActionKind, type AgentExternalCard, type AgentSetupResult, type AgentStatus, type AgentType, type AgentWalletLink, type ApprovedExternalCardExecution, type AssignExternalCardInput, type AssignedPolicy, type AuthorizeCheckoutActionResult, type BeginCommerceExecutionInput, type BrowserActionClaimResult, type BrowserActionDispatchObservationInput, BrowserActionFinalizationPendingError, type BrowserActionFinalizeResult, type BrowserCheckoutAction, type BrowserCheckoutTargetResolver, type BrowserCheckoutTargetSnapshot, type BrowserCheckoutTargetVerificationCode, BrowserCheckoutTargetVerificationError, type CanonicalBrowserCheckoutTargetSnapshot, CardsClient, type ChainType, type CheckoutActionAuthorization, type CommerceCheckoutMethod, type CommerceContextRequirement, type CommerceExecution, type CommerceExecutionAdapterKind, type CommerceExecutionArtifactKind, type CommerceExecutionChannel, type CommerceExecutionConstraint, type CommerceExecutionConstraintCoverage, type CommerceExecutionConstraintCoverageLevel, type CommerceExecutionDeliveryMode, type CommerceExecutionEvidence, type CommerceExecutionProvider, type CommerceExecutionResult, type CommerceExecutionSourceKind, type CommerceExecutionStatus, type CommerceFactConfidence, type CommerceFactProvenanceInput, type CommerceFactSource, type CommerceFulfillmentInput, type CommerceLineItemInput, type CommerceProposalFactKey, type CommerceProposalMissingFact, type CommerceProposalResolution, type CommerceProposalState, type CommerceSettlementRail, type CommerceTotalInput, type CommerceTotalType, type ComparePolicyVersionsResponse, type ConnectedCardBrief, type ConnectedCardCredential, type ConnectedCardDrawInput, type ConnectedCardDrawMerchant, type ConnectedCardDrawResult, type ConnectedCardDrawable, type ConnectedCardListResult, type ConnectedCardMandate, type ConnectedCardMandateMerchant, type ConnectedCardReference, ConnectedCardsClient, Conto, ContoAdmin, type ContoAdminConfig, ContoAdminError, type ContoConfig, ContoError, type ContoRequestOptions, type ControlledExternalCardPaymentResult, ControlledExternalCardPaymentTool, type CreateAgentInput, type CreatePolicyInput, type CreatePolicyRuleInput, type CreateSdkKeyInput, type CreateSdkKeyResult, type CreateWalletInput, type CustodyType, type CustomerCustodyMode, type CustomerWalletControlModel, type CustomerWalletKeyAccess, type DelegationType, type ExecuteCommerceExecutionResult, type ExternalCard, type ExternalCardApprovalInput, type ExternalCardApprovalResult, type ExternalCardConfirmationInput, ExternalCardConfirmationPendingError, type ExternalCardConfirmationResult, type ExternalCardExecutionClaimResult, type ExternalCardExecutionResult, type ExternalCardExecutor, type ExternalCardOverlayEnforcement, type ExternalCardRequestStatusResult, type ExternalWalletApprovalInput, type ExternalWalletApprovalResult, type ExternalWalletConfirmationInput, type ExternalWalletConfirmationResult, type FreezeAgentInput, Conto as Giro, type ContoConfig as GiroConfig, ContoError as GiroError, type GuardCheckoutResult, type GuardedBrowserDispatchResult, type GuardedCheckoutInput, type LinkWalletInput, type ListAgentsParams, type ListAgentsResponse, type ListPoliciesParams, type ListPoliciesResponse, type ListPolicyVersionsResponse, type ListStripeLinkPaymentMethodsResult, type ListWalletsParams, type ListWalletsResponse, type MppBudgetResult, type MppPreAuthorizeInput, type MppPreAuthorizeResult, type MppRecordInput, type MppRecordResult, type NormalizeCommerceProposalInput, type OrganizationMember, type PaginatedResponse, type PaginationParams, type PauseExternalCardAssignmentResult, type PaymentExecuteResult, type PaymentRequestInput, type PaymentRequestResult, type PaymentStatusResult, type Policy, type PolicyRule, type PolicyType, type PolicyVersionChangeType, type PolicyVersionDetail, type PolicyVersionDiff, type PolicyVersionFieldChange, type PolicyVersionSnapshot, type PolicyVersionSnapshotRule, type PolicyVersionSummary, type PrivilegedBrowserCheckoutDriver, type ProtocolBudgetResult, type ProtocolPreAuthorizeResult, type ProtocolRecordGrant, type ProtocolRecordGrantResult, type ProtocolServiceSummary, type ProtocolServicesResult, type ProvisionWalletResult, type RefreshBalanceResult, type RegisterExternalCardInput, type RollbackPolicyVersionResponse, type RuleAction, type RuleOperator, type RuleType, type RunGuardedCheckoutResult, type SdkKey, type SdkKeyType, type SetupCapabilityState, type SetupCardDiagnostics, type SetupDiagnosticAction, type SetupDiagnosticIssue, type SetupDiagnosticIssueCode, type SetupDiagnostics, type SetupWalletDiagnostics, type StripeLinkCheckoutReadiness, type StripeLinkCheckoutReadinessResult, type StripeLinkCheckoutReadinessStatus, type StripeLinkCheckoutVerification, type StripeLinkPaymentMethod, type TestCardCredential, type TestCardDrawResult, type TestCardDrawable, type TestCardListResult, type TestCardReceipt, TestCardsClient, type TestCheckoutInput, type TestCheckoutResult, type TestMerchant, type TestMerchantProduct, type UnfreezeAgentInput, type UpdateAgentInput, type UpdateExternalCardAssignmentInput, type UpdatePolicyInput, type UpdatePolicyRuleInput, type UpdateWalletInput, type VerifiedBrowserCheckoutTarget, type Wallet, type WalletChainBalanceSnapshot, type WalletStatus, type WalletType, type X402Authorization, type X402BudgetResult, type X402PayInput, type X402PayResult, type X402PaymentRequirements, type X402PreAuthorizeInput, type X402PreAuthorizeResult, type X402RecordInput, type X402RecordResult, canonicalizeBrowserCheckoutTarget, createVerifiedBrowserCheckoutDriver, Conto as default, fingerprintBrowserCheckoutTarget };
|
package/dist/index.d.ts
CHANGED
|
@@ -1028,6 +1028,92 @@ interface PaymentRequestInput {
|
|
|
1028
1028
|
/** Client-supplied key for idempotent retries */
|
|
1029
1029
|
idempotencyKey?: string;
|
|
1030
1030
|
}
|
|
1031
|
+
/** Whether a path works: `unknown` means Conto has no evidence either way. */
|
|
1032
|
+
type SetupCapabilityState = 'yes' | 'no' | 'unknown';
|
|
1033
|
+
/**
|
|
1034
|
+
* Stable setup issue codes. New codes can appear within a diagnostics version,
|
|
1035
|
+
* so handle an unrecognized code by its `severity` and `actor`.
|
|
1036
|
+
*/
|
|
1037
|
+
type SetupDiagnosticIssueCode = 'AGENT_PAUSED' | 'AGENT_FROZEN' | 'AGENT_UNAVAILABLE' | 'SDK_KEY_EXPIRED' | 'SDK_KEY_REVOKED' | 'SCOPE_MISSING' | 'NO_WALLET' | 'WALLET_PAUSED' | 'WALLET_UNAVAILABLE' | 'WALLET_VIEW_ONLY' | 'WALLET_UNFUNDED' | 'MAINNET_REQUIRES_PROD_AGENT' | 'LIVE_PAYMENTS_PAUSED' | 'LIVE_PAYMENTS_UNAVAILABLE' | 'EXTERNAL_SIGNER_REQUIRED' | 'SANDBOX_UNCLAIMED' | 'SANDBOX_EXPIRED' | (string & {});
|
|
1038
|
+
/** A next step: a documented command, an API call, or a dashboard page for an owner. */
|
|
1039
|
+
type SetupDiagnosticAction = {
|
|
1040
|
+
type: 'command';
|
|
1041
|
+
command: string;
|
|
1042
|
+
description: string;
|
|
1043
|
+
} | {
|
|
1044
|
+
type: 'api';
|
|
1045
|
+
method: 'GET' | 'POST' | 'PATCH';
|
|
1046
|
+
/** Relative to the Conto base URL. Segments in braces are placeholders. */
|
|
1047
|
+
href: string;
|
|
1048
|
+
credential: 'sdk_key' | 'sandbox_api_key' | 'organization_api_key';
|
|
1049
|
+
requiredScope: string | null;
|
|
1050
|
+
description: string;
|
|
1051
|
+
} | {
|
|
1052
|
+
type: 'owner_url';
|
|
1053
|
+
/** A dashboard page, relative to the Conto base URL. */
|
|
1054
|
+
url: string;
|
|
1055
|
+
description: string;
|
|
1056
|
+
};
|
|
1057
|
+
interface SetupDiagnosticIssue {
|
|
1058
|
+
code: SetupDiagnosticIssueCode;
|
|
1059
|
+
/** `error` blocks a capability of the resource. `info` explains how a path works. */
|
|
1060
|
+
severity: 'error' | 'warning' | 'info';
|
|
1061
|
+
/** Who can resolve it: the agent with its own credentials, or an owner. */
|
|
1062
|
+
actor: 'agent' | 'owner';
|
|
1063
|
+
resource: {
|
|
1064
|
+
type: 'agent' | 'wallet' | 'sdk_key' | 'organization';
|
|
1065
|
+
id: string | null;
|
|
1066
|
+
};
|
|
1067
|
+
message: string;
|
|
1068
|
+
/** The missing scope for SCOPE_MISSING, otherwise null. */
|
|
1069
|
+
requiredScope: string | null;
|
|
1070
|
+
actions: SetupDiagnosticAction[];
|
|
1071
|
+
}
|
|
1072
|
+
interface SetupWalletDiagnostics {
|
|
1073
|
+
walletId: string;
|
|
1074
|
+
/** `simulated` sandbox, `managed` by Conto, `external` signer, or `unknown`. */
|
|
1075
|
+
executionMode: 'simulated' | 'managed' | 'external' | 'unknown';
|
|
1076
|
+
network: 'testnet' | 'mainnet';
|
|
1077
|
+
/** `not_checked`: Conto does not read this wallet's balance. */
|
|
1078
|
+
funding: 'not_required' | 'funded' | 'unfunded' | 'not_checked';
|
|
1079
|
+
walletLimits: boolean;
|
|
1080
|
+
canRequest: SetupCapabilityState;
|
|
1081
|
+
canExecute: SetupCapabilityState;
|
|
1082
|
+
issueCodes: SetupDiagnosticIssueCode[];
|
|
1083
|
+
}
|
|
1084
|
+
interface SetupCardDiagnostics {
|
|
1085
|
+
availability: 'available' | 'unavailable';
|
|
1086
|
+
reason: 'sandbox_organization' | 'disabled' | 'plan' | null;
|
|
1087
|
+
assignedCards: number;
|
|
1088
|
+
activeAuthorizations: number;
|
|
1089
|
+
canUse: 'yes' | 'no';
|
|
1090
|
+
}
|
|
1091
|
+
/** Versioned setup diagnostics from `GET /api/sdk/setup`. */
|
|
1092
|
+
interface SetupDiagnostics {
|
|
1093
|
+
version: 'conto.setup-diagnostics.v1';
|
|
1094
|
+
environment: {
|
|
1095
|
+
kind: 'anonymous_sandbox' | 'claimed_sandbox' | 'account';
|
|
1096
|
+
settlement: 'simulated' | 'per_wallet';
|
|
1097
|
+
agentEnvironment: 'DEV' | 'STAGING' | 'PROD';
|
|
1098
|
+
sandboxExpiresAt: string | null;
|
|
1099
|
+
} | null;
|
|
1100
|
+
status: {
|
|
1101
|
+
authenticated: boolean;
|
|
1102
|
+
canRequest: SetupCapabilityState;
|
|
1103
|
+
canExecute: SetupCapabilityState;
|
|
1104
|
+
ownerActionRequired: boolean;
|
|
1105
|
+
};
|
|
1106
|
+
wallets: SetupWalletDiagnostics[];
|
|
1107
|
+
/** Test and live cards, reported apart from wallets. */
|
|
1108
|
+
connectedCards: {
|
|
1109
|
+
test: SetupCardDiagnostics;
|
|
1110
|
+
live: SetupCardDiagnostics;
|
|
1111
|
+
} | null;
|
|
1112
|
+
controls: {
|
|
1113
|
+
effectivePolicies: number;
|
|
1114
|
+
} | null;
|
|
1115
|
+
issues: SetupDiagnosticIssue[];
|
|
1116
|
+
}
|
|
1031
1117
|
interface AgentSetupResult {
|
|
1032
1118
|
agent: {
|
|
1033
1119
|
id: string;
|
|
@@ -1078,6 +1164,11 @@ interface AgentSetupResult {
|
|
|
1078
1164
|
totalVolume: number;
|
|
1079
1165
|
}>;
|
|
1080
1166
|
scopes: string[];
|
|
1167
|
+
/**
|
|
1168
|
+
* What this key can do and what needs an owner. Null when the server could
|
|
1169
|
+
* not compute it for this request. Absent from servers that predate it.
|
|
1170
|
+
*/
|
|
1171
|
+
diagnostics?: SetupDiagnostics | null;
|
|
1081
1172
|
}
|
|
1082
1173
|
interface ExternalWalletApprovalInput {
|
|
1083
1174
|
amount: number;
|
|
@@ -2338,7 +2429,10 @@ declare class Conto {
|
|
|
2338
2429
|
* reconciliation.
|
|
2339
2430
|
*/
|
|
2340
2431
|
cancelCommerceExecution(executionId: string): Promise<CommerceExecutionResult>;
|
|
2341
|
-
/**
|
|
2432
|
+
/**
|
|
2433
|
+
* Read credentials, linked wallets, effective policies, scopes, and setup
|
|
2434
|
+
* diagnostics without creating a payment.
|
|
2435
|
+
*/
|
|
2342
2436
|
setup(): Promise<AgentSetupResult>;
|
|
2343
2437
|
/** Make an authenticated request to the Conto API */
|
|
2344
2438
|
request<T>(method: string, path: string, body?: Record<string, unknown>, options?: ContoRequestOptions): Promise<T>;
|
|
@@ -2608,4 +2702,4 @@ declare class MppClient {
|
|
|
2608
2702
|
}): Promise<ProtocolServicesResult>;
|
|
2609
2703
|
}
|
|
2610
2704
|
|
|
2611
|
-
export { type AdminExternalCardOverlayEnforcement, type Agent, type AgentCheckoutAction, type AgentCheckoutActionKind, type AgentExternalCard, type AgentSetupResult, type AgentStatus, type AgentType, type AgentWalletLink, type ApprovedExternalCardExecution, type AssignExternalCardInput, type AssignedPolicy, type AuthorizeCheckoutActionResult, type BeginCommerceExecutionInput, type BrowserActionClaimResult, type BrowserActionDispatchObservationInput, BrowserActionFinalizationPendingError, type BrowserActionFinalizeResult, type BrowserCheckoutAction, type BrowserCheckoutTargetResolver, type BrowserCheckoutTargetSnapshot, type BrowserCheckoutTargetVerificationCode, BrowserCheckoutTargetVerificationError, type CanonicalBrowserCheckoutTargetSnapshot, CardsClient, type ChainType, type CheckoutActionAuthorization, type CommerceCheckoutMethod, type CommerceContextRequirement, type CommerceExecution, type CommerceExecutionAdapterKind, type CommerceExecutionArtifactKind, type CommerceExecutionChannel, type CommerceExecutionConstraint, type CommerceExecutionConstraintCoverage, type CommerceExecutionConstraintCoverageLevel, type CommerceExecutionDeliveryMode, type CommerceExecutionEvidence, type CommerceExecutionProvider, type CommerceExecutionResult, type CommerceExecutionSourceKind, type CommerceExecutionStatus, type CommerceFactConfidence, type CommerceFactProvenanceInput, type CommerceFactSource, type CommerceFulfillmentInput, type CommerceLineItemInput, type CommerceProposalFactKey, type CommerceProposalMissingFact, type CommerceProposalResolution, type CommerceProposalState, type CommerceSettlementRail, type CommerceTotalInput, type CommerceTotalType, type ComparePolicyVersionsResponse, type ConnectedCardBrief, type ConnectedCardCredential, type ConnectedCardDrawInput, type ConnectedCardDrawMerchant, type ConnectedCardDrawResult, type ConnectedCardDrawable, type ConnectedCardListResult, type ConnectedCardMandate, type ConnectedCardMandateMerchant, type ConnectedCardReference, ConnectedCardsClient, Conto, ContoAdmin, type ContoAdminConfig, ContoAdminError, type ContoConfig, ContoError, type ContoRequestOptions, type ControlledExternalCardPaymentResult, ControlledExternalCardPaymentTool, type CreateAgentInput, type CreatePolicyInput, type CreatePolicyRuleInput, type CreateSdkKeyInput, type CreateSdkKeyResult, type CreateWalletInput, type CustodyType, type CustomerCustodyMode, type CustomerWalletControlModel, type CustomerWalletKeyAccess, type DelegationType, type ExecuteCommerceExecutionResult, type ExternalCard, type ExternalCardApprovalInput, type ExternalCardApprovalResult, type ExternalCardConfirmationInput, ExternalCardConfirmationPendingError, type ExternalCardConfirmationResult, type ExternalCardExecutionClaimResult, type ExternalCardExecutionResult, type ExternalCardExecutor, type ExternalCardOverlayEnforcement, type ExternalCardRequestStatusResult, type ExternalWalletApprovalInput, type ExternalWalletApprovalResult, type ExternalWalletConfirmationInput, type ExternalWalletConfirmationResult, type FreezeAgentInput, Conto as Giro, type ContoConfig as GiroConfig, ContoError as GiroError, type GuardCheckoutResult, type GuardedBrowserDispatchResult, type GuardedCheckoutInput, type LinkWalletInput, type ListAgentsParams, type ListAgentsResponse, type ListPoliciesParams, type ListPoliciesResponse, type ListPolicyVersionsResponse, type ListStripeLinkPaymentMethodsResult, type ListWalletsParams, type ListWalletsResponse, type MppBudgetResult, type MppPreAuthorizeInput, type MppPreAuthorizeResult, type MppRecordInput, type MppRecordResult, type NormalizeCommerceProposalInput, type OrganizationMember, type PaginatedResponse, type PaginationParams, type PauseExternalCardAssignmentResult, type PaymentExecuteResult, type PaymentRequestInput, type PaymentRequestResult, type PaymentStatusResult, type Policy, type PolicyRule, type PolicyType, type PolicyVersionChangeType, type PolicyVersionDetail, type PolicyVersionDiff, type PolicyVersionFieldChange, type PolicyVersionSnapshot, type PolicyVersionSnapshotRule, type PolicyVersionSummary, type PrivilegedBrowserCheckoutDriver, type ProtocolBudgetResult, type ProtocolPreAuthorizeResult, type ProtocolRecordGrant, type ProtocolRecordGrantResult, type ProtocolServiceSummary, type ProtocolServicesResult, type ProvisionWalletResult, type RefreshBalanceResult, type RegisterExternalCardInput, type RollbackPolicyVersionResponse, type RuleAction, type RuleOperator, type RuleType, type RunGuardedCheckoutResult, type SdkKey, type SdkKeyType, type StripeLinkCheckoutReadiness, type StripeLinkCheckoutReadinessResult, type StripeLinkCheckoutReadinessStatus, type StripeLinkCheckoutVerification, type StripeLinkPaymentMethod, type TestCardCredential, type TestCardDrawResult, type TestCardDrawable, type TestCardListResult, type TestCardReceipt, TestCardsClient, type TestCheckoutInput, type TestCheckoutResult, type TestMerchant, type TestMerchantProduct, type UnfreezeAgentInput, type UpdateAgentInput, type UpdateExternalCardAssignmentInput, type UpdatePolicyInput, type UpdatePolicyRuleInput, type UpdateWalletInput, type VerifiedBrowserCheckoutTarget, type Wallet, type WalletChainBalanceSnapshot, type WalletStatus, type WalletType, type X402Authorization, type X402BudgetResult, type X402PayInput, type X402PayResult, type X402PaymentRequirements, type X402PreAuthorizeInput, type X402PreAuthorizeResult, type X402RecordInput, type X402RecordResult, canonicalizeBrowserCheckoutTarget, createVerifiedBrowserCheckoutDriver, Conto as default, fingerprintBrowserCheckoutTarget };
|
|
2705
|
+
export { type AdminExternalCardOverlayEnforcement, type Agent, type AgentCheckoutAction, type AgentCheckoutActionKind, type AgentExternalCard, type AgentSetupResult, type AgentStatus, type AgentType, type AgentWalletLink, type ApprovedExternalCardExecution, type AssignExternalCardInput, type AssignedPolicy, type AuthorizeCheckoutActionResult, type BeginCommerceExecutionInput, type BrowserActionClaimResult, type BrowserActionDispatchObservationInput, BrowserActionFinalizationPendingError, type BrowserActionFinalizeResult, type BrowserCheckoutAction, type BrowserCheckoutTargetResolver, type BrowserCheckoutTargetSnapshot, type BrowserCheckoutTargetVerificationCode, BrowserCheckoutTargetVerificationError, type CanonicalBrowserCheckoutTargetSnapshot, CardsClient, type ChainType, type CheckoutActionAuthorization, type CommerceCheckoutMethod, type CommerceContextRequirement, type CommerceExecution, type CommerceExecutionAdapterKind, type CommerceExecutionArtifactKind, type CommerceExecutionChannel, type CommerceExecutionConstraint, type CommerceExecutionConstraintCoverage, type CommerceExecutionConstraintCoverageLevel, type CommerceExecutionDeliveryMode, type CommerceExecutionEvidence, type CommerceExecutionProvider, type CommerceExecutionResult, type CommerceExecutionSourceKind, type CommerceExecutionStatus, type CommerceFactConfidence, type CommerceFactProvenanceInput, type CommerceFactSource, type CommerceFulfillmentInput, type CommerceLineItemInput, type CommerceProposalFactKey, type CommerceProposalMissingFact, type CommerceProposalResolution, type CommerceProposalState, type CommerceSettlementRail, type CommerceTotalInput, type CommerceTotalType, type ComparePolicyVersionsResponse, type ConnectedCardBrief, type ConnectedCardCredential, type ConnectedCardDrawInput, type ConnectedCardDrawMerchant, type ConnectedCardDrawResult, type ConnectedCardDrawable, type ConnectedCardListResult, type ConnectedCardMandate, type ConnectedCardMandateMerchant, type ConnectedCardReference, ConnectedCardsClient, Conto, ContoAdmin, type ContoAdminConfig, ContoAdminError, type ContoConfig, ContoError, type ContoRequestOptions, type ControlledExternalCardPaymentResult, ControlledExternalCardPaymentTool, type CreateAgentInput, type CreatePolicyInput, type CreatePolicyRuleInput, type CreateSdkKeyInput, type CreateSdkKeyResult, type CreateWalletInput, type CustodyType, type CustomerCustodyMode, type CustomerWalletControlModel, type CustomerWalletKeyAccess, type DelegationType, type ExecuteCommerceExecutionResult, type ExternalCard, type ExternalCardApprovalInput, type ExternalCardApprovalResult, type ExternalCardConfirmationInput, ExternalCardConfirmationPendingError, type ExternalCardConfirmationResult, type ExternalCardExecutionClaimResult, type ExternalCardExecutionResult, type ExternalCardExecutor, type ExternalCardOverlayEnforcement, type ExternalCardRequestStatusResult, type ExternalWalletApprovalInput, type ExternalWalletApprovalResult, type ExternalWalletConfirmationInput, type ExternalWalletConfirmationResult, type FreezeAgentInput, Conto as Giro, type ContoConfig as GiroConfig, ContoError as GiroError, type GuardCheckoutResult, type GuardedBrowserDispatchResult, type GuardedCheckoutInput, type LinkWalletInput, type ListAgentsParams, type ListAgentsResponse, type ListPoliciesParams, type ListPoliciesResponse, type ListPolicyVersionsResponse, type ListStripeLinkPaymentMethodsResult, type ListWalletsParams, type ListWalletsResponse, type MppBudgetResult, type MppPreAuthorizeInput, type MppPreAuthorizeResult, type MppRecordInput, type MppRecordResult, type NormalizeCommerceProposalInput, type OrganizationMember, type PaginatedResponse, type PaginationParams, type PauseExternalCardAssignmentResult, type PaymentExecuteResult, type PaymentRequestInput, type PaymentRequestResult, type PaymentStatusResult, type Policy, type PolicyRule, type PolicyType, type PolicyVersionChangeType, type PolicyVersionDetail, type PolicyVersionDiff, type PolicyVersionFieldChange, type PolicyVersionSnapshot, type PolicyVersionSnapshotRule, type PolicyVersionSummary, type PrivilegedBrowserCheckoutDriver, type ProtocolBudgetResult, type ProtocolPreAuthorizeResult, type ProtocolRecordGrant, type ProtocolRecordGrantResult, type ProtocolServiceSummary, type ProtocolServicesResult, type ProvisionWalletResult, type RefreshBalanceResult, type RegisterExternalCardInput, type RollbackPolicyVersionResponse, type RuleAction, type RuleOperator, type RuleType, type RunGuardedCheckoutResult, type SdkKey, type SdkKeyType, type SetupCapabilityState, type SetupCardDiagnostics, type SetupDiagnosticAction, type SetupDiagnosticIssue, type SetupDiagnosticIssueCode, type SetupDiagnostics, type SetupWalletDiagnostics, type StripeLinkCheckoutReadiness, type StripeLinkCheckoutReadinessResult, type StripeLinkCheckoutReadinessStatus, type StripeLinkCheckoutVerification, type StripeLinkPaymentMethod, type TestCardCredential, type TestCardDrawResult, type TestCardDrawable, type TestCardListResult, type TestCardReceipt, TestCardsClient, type TestCheckoutInput, type TestCheckoutResult, type TestMerchant, type TestMerchantProduct, type UnfreezeAgentInput, type UpdateAgentInput, type UpdateExternalCardAssignmentInput, type UpdatePolicyInput, type UpdatePolicyRuleInput, type UpdateWalletInput, type VerifiedBrowserCheckoutTarget, type Wallet, type WalletChainBalanceSnapshot, type WalletStatus, type WalletType, type X402Authorization, type X402BudgetResult, type X402PayInput, type X402PayResult, type X402PaymentRequirements, type X402PreAuthorizeInput, type X402PreAuthorizeResult, type X402RecordInput, type X402RecordResult, canonicalizeBrowserCheckoutTarget, createVerifiedBrowserCheckoutDriver, Conto as default, fingerprintBrowserCheckoutTarget };
|
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ var require_package = __commonJS({
|
|
|
46
46
|
"package.json"(exports2, module2) {
|
|
47
47
|
module2.exports = {
|
|
48
48
|
name: "@conto_finance/sdk",
|
|
49
|
-
version: "0.5.
|
|
49
|
+
version: "0.5.5",
|
|
50
50
|
description: "Conto SDK for AI agent payment authorization",
|
|
51
51
|
main: "./dist/index.js",
|
|
52
52
|
module: "./dist/index.mjs",
|
|
@@ -1433,7 +1433,10 @@ var Conto = class {
|
|
|
1433
1433
|
rethrowAmbiguousCommerceMutation(error, executionId, "cancel");
|
|
1434
1434
|
}
|
|
1435
1435
|
}
|
|
1436
|
-
/**
|
|
1436
|
+
/**
|
|
1437
|
+
* Read credentials, linked wallets, effective policies, scopes, and setup
|
|
1438
|
+
* diagnostics without creating a payment.
|
|
1439
|
+
*/
|
|
1437
1440
|
async setup() {
|
|
1438
1441
|
return this.request("GET", "/api/sdk/setup");
|
|
1439
1442
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ var require_package = __commonJS({
|
|
|
17
17
|
"package.json"(exports, module) {
|
|
18
18
|
module.exports = {
|
|
19
19
|
name: "@conto_finance/sdk",
|
|
20
|
-
version: "0.5.
|
|
20
|
+
version: "0.5.5",
|
|
21
21
|
description: "Conto SDK for AI agent payment authorization",
|
|
22
22
|
main: "./dist/index.js",
|
|
23
23
|
module: "./dist/index.mjs",
|
|
@@ -1267,7 +1267,10 @@ var Conto = class {
|
|
|
1267
1267
|
rethrowAmbiguousCommerceMutation(error, executionId, "cancel");
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
|
-
/**
|
|
1270
|
+
/**
|
|
1271
|
+
* Read credentials, linked wallets, effective policies, scopes, and setup
|
|
1272
|
+
* diagnostics without creating a payment.
|
|
1273
|
+
*/
|
|
1271
1274
|
async setup() {
|
|
1272
1275
|
return this.request("GET", "/api/sdk/setup");
|
|
1273
1276
|
}
|