@agentforge-io/sdk-server 4.44.0 → 4.45.0

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.ts CHANGED
@@ -3,7 +3,7 @@ export type { AgentForgeClientOptions, RequestOptions } from './client';
3
3
  export { AgentForgeError, AgentForgeAuthError, AgentForgeNotFoundError, AgentForgeNetworkError, } from './errors';
4
4
  export { APP_WEBHOOK_HEADERS, TOOL_CALLBACK_HEADERS, ToolCallbackSignatureError, signToolCallbackPayload, verifyAppWebhook, verifyToolCallbackSignature, } from './webhooks';
5
5
  export { WebhookResource, type SetAppWebhookInput } from './resources/webhook';
6
- export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, TeamDetail, TeamTheme, TeamBusinessHours, TeamWeekday, TeamProfileBlock, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseView, CreateDirectOrderInput, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogBookingRule, DirectOrderForm, CaseReceipt, CaseReceiptLine, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryQuote, AppSelf, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, CatalogImportItem, CatalogImportPreview, CatalogImportApplyResult, CatalogFileMapping, CatalogFilePlan, CatalogFilePreview, CatalogFileApplyResult, CatalogFileInput, CatalogFilePreviewInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogOption, CatalogOptionGroup, SaveCatalogOptionGroupInput, CatalogOptionChoice, CatalogOptionChange, CatalogOptionChangesPlan, CatalogUnit, SaveCatalogUnitInput, CatalogSaleRule, CatalogFileApplyInput, CatalogFileErrorCode, CatalogImportSourceStatus, CatalogImportColumnMapping, CatalogImportRunResult, CatalogImportSource, CreateCatalogImportSourceInput, UpdateCatalogImportSourceInput, PreviewCatalogImportSourceInput, CatalogImportSourcePreview, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
6
+ export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, TeamDetail, TeamTheme, TeamBusinessHours, TeamWeekday, TeamProfileBlock, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseView, CreateDirectOrderInput, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogBookingRule, DirectOrderForm, DirectPaymentOption, CaseReceipt, CaseReceiptLine, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryQuote, AppSelf, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, CatalogImportItem, CatalogImportPreview, CatalogImportApplyResult, CatalogFileMapping, CatalogFilePlan, CatalogFilePreview, CatalogFileApplyResult, CatalogFileInput, CatalogFilePreviewInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogOption, CatalogOptionGroup, SaveCatalogOptionGroupInput, CatalogOptionChoice, CatalogOptionChange, CatalogOptionChangesPlan, CatalogUnit, SaveCatalogUnitInput, CatalogSaleRule, CatalogFileApplyInput, CatalogFileErrorCode, CatalogImportSourceStatus, CatalogImportColumnMapping, CatalogImportRunResult, CatalogImportSource, CreateCatalogImportSourceInput, UpdateCatalogImportSourceInput, PreviewCatalogImportSourceInput, CatalogImportSourcePreview, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
7
7
  export { AgentsResource } from './resources/agents';
8
8
  export { AnalyticsResource } from './resources/analytics';
9
9
  export type { GetSupportKpisInput, GetAgentAttentionLogInput, } from './resources/analytics';
@@ -79,9 +79,12 @@ export declare class CasesResource {
79
79
  }): Promise<CaseView>;
80
80
  /**
81
81
  * `POST /api/v1/cases/receipts/:token/payment/choose` — the customer chooses how
82
- * to pay on the receipt (an `accountId` from `payment.options`).
82
+ * to pay on the receipt (an `accountId` from `payment.options`; for Efectivo,
83
+ * `cashTenderedCents` = what they pay with — 400 when less than the total).
83
84
  */
84
- receiptChoosePayment(token: string, accountId: string): Promise<CaseReceipt>;
85
+ receiptChoosePayment(token: string, accountId: string, opts?: {
86
+ cashTenderedCents?: number;
87
+ }): Promise<CaseReceipt>;
85
88
  /**
86
89
  * `POST /api/v1/cases/receipts/:token/payment/report` — the customer says they
87
90
  * paid: the transfer `reference` and/or the `proof` image (jpeg/png/webp, base64,
@@ -129,10 +129,14 @@ class CasesResource {
129
129
  }
130
130
  /**
131
131
  * `POST /api/v1/cases/receipts/:token/payment/choose` — the customer chooses how
132
- * to pay on the receipt (an `accountId` from `payment.options`).
132
+ * to pay on the receipt (an `accountId` from `payment.options`; for Efectivo,
133
+ * `cashTenderedCents` = what they pay with — 400 when less than the total).
133
134
  */
134
- async receiptChoosePayment(token, accountId) {
135
- return this.client.request('POST', `/api/v1/cases/receipts/${encodeURIComponent(token)}/payment/choose`, { accountId });
135
+ async receiptChoosePayment(token, accountId, opts = {}) {
136
+ return this.client.request('POST', `/api/v1/cases/receipts/${encodeURIComponent(token)}/payment/choose`, {
137
+ accountId,
138
+ ...(opts.cashTenderedCents ? { cashTenderedCents: opts.cashTenderedCents } : {}),
139
+ });
136
140
  }
137
141
  /**
138
142
  * `POST /api/v1/cases/receipts/:token/payment/report` — the customer says they
package/dist/types.d.ts CHANGED
@@ -2131,6 +2131,13 @@ export interface CasePayment {
2131
2131
  key: CasePaymentStatus;
2132
2132
  label: string;
2133
2133
  }>;
2134
+ /** AGF-CHECKOUT-PAYMENT — Efectivo: what the customer pays with, and the change for the total then. */
2135
+ cashTenderedCents?: number;
2136
+ changeCents?: number;
2137
+ /** Where the customer chose it: in the checkout (before the business accepted), the chat or the receipt. */
2138
+ chosenAt?: 'checkout' | 'chat' | 'receipt';
2139
+ /** The order ended undone after the customer reported (or the business confirmed) the payment: check it and refund. */
2140
+ refundDue?: boolean;
2134
2141
  history: Array<{
2135
2142
  status: CasePaymentStatus;
2136
2143
  by: 'assistant' | 'customer' | 'business' | 'system';
@@ -2161,6 +2168,11 @@ export interface CaseReceiptPayment {
2161
2168
  }>;
2162
2169
  /** The customer may say they paid now (`cases.receiptReportPayment`). */
2163
2170
  canReport: boolean;
2171
+ /** AGF-CHECKOUT-PAYMENT — Efectivo: what the customer pays with, and the change (absent on an older platform). */
2172
+ cashTenderedCents?: number | null;
2173
+ changeCents?: number | null;
2174
+ /** The order ended undone after the customer reported or paid: the business gives the money back. */
2175
+ refundDue?: boolean;
2164
2176
  }
2165
2177
  /** AGF-CASE-RECEIPT — one product line, with the price it had when the receipt was issued. */
2166
2178
  export interface CaseReceiptLine {
@@ -2226,7 +2238,7 @@ export interface CaseReceipt {
2226
2238
  /** Closed without being done (rejected, cancelled, abandoned). */
2227
2239
  stopped: boolean;
2228
2240
  updatedAt: string;
2229
- /** AGF-PAYMENT-ACCOUNTS — how it is paid; null before the business took it. */
2241
+ /** AGF-PAYMENT-ACCOUNTS — how it is paid; null before the business took it (unless chosen in the checkout). */
2230
2242
  payment: CaseReceiptPayment | null;
2231
2243
  business: {
2232
2244
  name: string;
@@ -2273,6 +2285,28 @@ export interface CreateDirectOrderInput {
2273
2285
  conversationId?: string;
2274
2286
  /** Same key → same order: a retried submit never makes two. 8–80 of [A-Za-z0-9_.:-]. */
2275
2287
  idempotencyKey: string;
2288
+ /**
2289
+ * AGF-CHECKOUT-PAYMENT — how the customer pays, chosen in the checkout: an
2290
+ * `accountId` of `directForm().payment.options`; `cashTenderedCents` for Efectivo
2291
+ * (what they pay with; the change is computed from the total). The order starts
2292
+ * `awaiting_payment` and the customer may pay before the business accepts it.
2293
+ */
2294
+ payment?: {
2295
+ accountId: string;
2296
+ cashTenderedCents?: number;
2297
+ };
2298
+ }
2299
+ /** A payment method a checkout offers (no account data — that is on the receipt once the order is sent). */
2300
+ export interface DirectPaymentOption {
2301
+ accountId: string;
2302
+ method: string;
2303
+ methodName: string;
2304
+ label?: string;
2305
+ when: 'before' | 'on_delivery';
2306
+ /** One line of context («tarjeta débito y crédito, al recibir»). */
2307
+ detail?: string;
2308
+ /** False: not offered on a delivery (a datáfono only at the place). */
2309
+ onDelivery: boolean;
2276
2310
  }
2277
2311
  /** What a checkout asks besides the cart, the name and the phone (AGF-ORDER-WITHOUT-AI). */
2278
2312
  export interface DirectOrderForm {
@@ -2288,6 +2322,10 @@ export interface DirectOrderForm {
2288
2322
  hint?: string;
2289
2323
  options?: string[];
2290
2324
  }>;
2325
+ /** AGF-CHECKOUT-PAYMENT — the business's usable payment methods, in its order (empty: none set up). */
2326
+ payment: {
2327
+ options: DirectPaymentOption[];
2328
+ };
2291
2329
  }
2292
2330
  export interface ListCasesInput {
2293
2331
  state?: CaseState[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.44.0",
3
+ "version": "4.45.0",
4
4
  "description": "Server-side SDK for backend apps integrating with AgentForge platform. Auth via ChatToken, ak_live_ API key or App secret (sk_live_), with App installations across tenants.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",