@agentforge-io/sdk-server 4.44.0 → 4.46.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, CaseStateStep, 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
@@ -2015,6 +2015,14 @@ export interface CaseType {
2015
2015
  */
2016
2016
  /** `no_show`: a booking whose customer did not come (AGF-AGENDA-LIFECYCLE). */
2017
2017
  export type CaseState = 'open' | 'review' | 'submitted' | 'accepted' | 'completed' | 'cancelled' | 'rejected' | 'abandoned' | 'no_show' | (string & {});
2018
+ /** One state a case reached (AGF-CASE-TRACKING). */
2019
+ export interface CaseStateStep {
2020
+ state: string;
2021
+ /** ISO time it got there. */
2022
+ at: string;
2023
+ /** Who moved it; null when only the case itself tells (older cases, a move just made). */
2024
+ by: 'assistant' | 'business' | 'system' | 'customer' | null;
2025
+ }
2018
2026
  export interface CaseView {
2019
2027
  id: string;
2020
2028
  /** Per workspace, sequential (ordering). People read `code`. */
@@ -2087,6 +2095,12 @@ export interface CaseView {
2087
2095
  submittedAt: string | null;
2088
2096
  closedAt: string | null;
2089
2097
  lastActivityAt: string;
2098
+ /**
2099
+ * AGF-CASE-TRACKING — every state it reached from its sending, oldest first, with
2100
+ * when and who moved it. On `cases.get` and the business's moves (`transition`,
2101
+ * `setPayment`, `weighLine`, `assign`, `updateSlot`); absent on `cases.list`.
2102
+ */
2103
+ history?: CaseStateStep[];
2090
2104
  }
2091
2105
  /**
2092
2106
  * The payment's own lifecycle, apart from the case's states: `unpaid` →
@@ -2131,6 +2145,13 @@ export interface CasePayment {
2131
2145
  key: CasePaymentStatus;
2132
2146
  label: string;
2133
2147
  }>;
2148
+ /** AGF-CHECKOUT-PAYMENT — Efectivo: what the customer pays with, and the change for the total then. */
2149
+ cashTenderedCents?: number;
2150
+ changeCents?: number;
2151
+ /** Where the customer chose it: in the checkout (before the business accepted), the chat or the receipt. */
2152
+ chosenAt?: 'checkout' | 'chat' | 'receipt';
2153
+ /** The order ended undone after the customer reported (or the business confirmed) the payment: check it and refund. */
2154
+ refundDue?: boolean;
2134
2155
  history: Array<{
2135
2156
  status: CasePaymentStatus;
2136
2157
  by: 'assistant' | 'customer' | 'business' | 'system';
@@ -2161,6 +2182,11 @@ export interface CaseReceiptPayment {
2161
2182
  }>;
2162
2183
  /** The customer may say they paid now (`cases.receiptReportPayment`). */
2163
2184
  canReport: boolean;
2185
+ /** AGF-CHECKOUT-PAYMENT — Efectivo: what the customer pays with, and the change (absent on an older platform). */
2186
+ cashTenderedCents?: number | null;
2187
+ changeCents?: number | null;
2188
+ /** The order ended undone after the customer reported or paid: the business gives the money back. */
2189
+ refundDue?: boolean;
2164
2190
  }
2165
2191
  /** AGF-CASE-RECEIPT — one product line, with the price it had when the receipt was issued. */
2166
2192
  export interface CaseReceiptLine {
@@ -2226,7 +2252,7 @@ export interface CaseReceipt {
2226
2252
  /** Closed without being done (rejected, cancelled, abandoned). */
2227
2253
  stopped: boolean;
2228
2254
  updatedAt: string;
2229
- /** AGF-PAYMENT-ACCOUNTS — how it is paid; null before the business took it. */
2255
+ /** AGF-PAYMENT-ACCOUNTS — how it is paid; null before the business took it (unless chosen in the checkout). */
2230
2256
  payment: CaseReceiptPayment | null;
2231
2257
  business: {
2232
2258
  name: string;
@@ -2273,6 +2299,28 @@ export interface CreateDirectOrderInput {
2273
2299
  conversationId?: string;
2274
2300
  /** Same key → same order: a retried submit never makes two. 8–80 of [A-Za-z0-9_.:-]. */
2275
2301
  idempotencyKey: string;
2302
+ /**
2303
+ * AGF-CHECKOUT-PAYMENT — how the customer pays, chosen in the checkout: an
2304
+ * `accountId` of `directForm().payment.options`; `cashTenderedCents` for Efectivo
2305
+ * (what they pay with; the change is computed from the total). The order starts
2306
+ * `awaiting_payment` and the customer may pay before the business accepts it.
2307
+ */
2308
+ payment?: {
2309
+ accountId: string;
2310
+ cashTenderedCents?: number;
2311
+ };
2312
+ }
2313
+ /** A payment method a checkout offers (no account data — that is on the receipt once the order is sent). */
2314
+ export interface DirectPaymentOption {
2315
+ accountId: string;
2316
+ method: string;
2317
+ methodName: string;
2318
+ label?: string;
2319
+ when: 'before' | 'on_delivery';
2320
+ /** One line of context («tarjeta débito y crédito, al recibir»). */
2321
+ detail?: string;
2322
+ /** False: not offered on a delivery (a datáfono only at the place). */
2323
+ onDelivery: boolean;
2276
2324
  }
2277
2325
  /** What a checkout asks besides the cart, the name and the phone (AGF-ORDER-WITHOUT-AI). */
2278
2326
  export interface DirectOrderForm {
@@ -2288,6 +2336,10 @@ export interface DirectOrderForm {
2288
2336
  hint?: string;
2289
2337
  options?: string[];
2290
2338
  }>;
2339
+ /** AGF-CHECKOUT-PAYMENT — the business's usable payment methods, in its order (empty: none set up). */
2340
+ payment: {
2341
+ options: DirectPaymentOption[];
2342
+ };
2291
2343
  }
2292
2344
  export interface ListCasesInput {
2293
2345
  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.46.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",