@agentforge-io/sdk-server 4.46.0 → 4.47.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, 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';
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, CaseOrigin, CaseOriginChannel, 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';
package/dist/types.d.ts CHANGED
@@ -2064,6 +2064,10 @@ export interface CaseView {
2064
2064
  customerPhone: string | null;
2065
2065
  /** Where in the business the customer ordered from («Mesa 2», a scanned code). */
2066
2066
  customerPlace?: string | null;
2067
+ /** AGF-ORDER-ORIGIN-POS — where it came from, with its tag («Mesa 2 · QR»); null for cases from before. */
2068
+ origin: (CaseOrigin & {
2069
+ label: string;
2070
+ }) | null;
2067
2071
  /** The road the business walks it: sent, accepted, the type's own phases, completed. */
2068
2072
  path: Array<{
2069
2073
  key: string;
@@ -2254,6 +2258,12 @@ export interface CaseReceipt {
2254
2258
  updatedAt: string;
2255
2259
  /** AGF-PAYMENT-ACCOUNTS — how it is paid; null before the business took it (unless chosen in the checkout). */
2256
2260
  payment: CaseReceiptPayment | null;
2261
+ /** AGF-ORDER-ORIGIN-POS — where it was ordered from, as the customer reads it (no team member); null when unknown. */
2262
+ origin: {
2263
+ channel: CaseOriginChannel;
2264
+ place: string | null;
2265
+ label: string;
2266
+ } | null;
2257
2267
  business: {
2258
2268
  name: string;
2259
2269
  description: string | null;
@@ -2263,23 +2273,47 @@ export interface CaseReceipt {
2263
2273
  timeZone: string | null;
2264
2274
  };
2265
2275
  }
2276
+ /** AGF-ORDER-ORIGIN-POS — the channel an order came by (`pos`: a sale the team registered in the App). */
2277
+ export type CaseOriginChannel = 'qr' | 'nfc' | 'link' | 'page' | 'chat' | 'whatsapp' | 'pos';
2278
+ /** Where an order comes from, frozen when it is created. */
2279
+ export interface CaseOrigin {
2280
+ channel: CaseOriginChannel;
2281
+ /** The code or place it came from; `label` is what people read («Mesa 2», «Sede Norte»). */
2282
+ place?: {
2283
+ linkId?: string;
2284
+ code?: string;
2285
+ ref?: string;
2286
+ label: string;
2287
+ };
2288
+ /** `pos`: the team member who registered the sale. */
2289
+ by?: {
2290
+ accountId: string;
2291
+ name: string;
2292
+ };
2293
+ }
2266
2294
  /**
2267
2295
  * AGF-ORDER-WITHOUT-AI — an order placed without the assistant: a cart and a
2268
2296
  * checkout on the host App. Created already sent (holds, receipt, `case.submitted`).
2269
2297
  */
2270
2298
  export interface CreateDirectOrderInput {
2271
- /** Who orders: the App's visitor id, and the name and phone they gave (both required unless `place`). */
2272
2299
  /**
2273
2300
  * AGF-CUSTOMER-WHERE: where in the business the customer is («Mesa 2»),
2274
2301
  * from a code your server resolved — never text the customer typed. With
2275
2302
  * it, `customer.name` and `customer.phone` may be '' (optional at a table).
2276
2303
  */
2277
2304
  place?: string;
2305
+ /**
2306
+ * Who orders: the App's visitor id, and the name and phone they gave (both required
2307
+ * unless `place`). A sale the team registers (`origin.channel` `pos`) may leave both
2308
+ * out: it is then named after its place («Mostrador», «Mesa 2») and has no phone.
2309
+ */
2278
2310
  customer: {
2279
2311
  ref: string;
2280
- name: string;
2281
- phone: string;
2312
+ name?: string;
2313
+ phone?: string;
2282
2314
  };
2315
+ /** AGF-ORDER-ORIGIN-POS — where it comes from; default `{ channel: 'page' }`. A `pos` sale needs `place` and `by`. */
2316
+ origin?: CaseOrigin;
2283
2317
  /** Products of the business's catalog and how many of each. `options`: the choice for a
2284
2318
  * product with option groups (AGF-MENU-OPTIONS M2; a required group left out → 400). */
2285
2319
  lines: Array<{
@@ -2441,6 +2475,8 @@ export interface AppWebhookEvent {
2441
2475
  /** `case.payment_changed`: where the payment is now, and where it was. */
2442
2476
  paymentStatus?: CasePaymentStatus;
2443
2477
  previousPaymentStatus?: CasePaymentStatus;
2478
+ /** AGF-ORDER-ORIGIN-POS — where the case came from (cases from before carry none). */
2479
+ origin?: CaseOrigin;
2444
2480
  };
2445
2481
  }
2446
2482
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.46.0",
3
+ "version": "4.47.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",