@agentforge-io/sdk-server 4.37.0 → 4.39.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, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseView, CreateDirectOrderInput, 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, 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, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseView, CreateDirectOrderInput, 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, 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';
@@ -1,6 +1,6 @@
1
1
  import type { AgentForgeClient } from '../client';
2
2
  import { AgentForgeError } from '../errors';
3
- import type { AttachCatalogPhotoInput, Catalog, CatalogCategory, CatalogFileApplyInput, CatalogFileApplyResult, CatalogOptionChange, CatalogOptionChangesPlan, CatalogOptionGroup, CatalogUnit, SaveCatalogUnitInput, SaveCatalogOptionGroupInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogFilePreview, CatalogFilePreviewInput, CatalogImportApplyResult, CatalogImportItem, CatalogImportPreview, CatalogImportSource, CatalogImportSourcePreview, CatalogImportRunResult, CatalogPhotoUploadTarget, CatalogProduct, CatalogProductPage, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, CreateCatalogCategoryInput, CreateCatalogImportSourceInput, CreateCatalogProductInput, ListCatalogProductsInput, PreviewCatalogImportSourceInput, SignCatalogPhotoUploadInput, UpdateCatalogCategoryInput, UpdateCatalogImportSourceInput, UpdateCatalogProductInput, UpsertCatalogInput } from '../types';
3
+ import type { AttachCatalogPhotoInput, Catalog, CatalogCategory, CatalogFileApplyInput, CatalogFileApplyResult, CatalogOptionChange, CatalogOptionChangesPlan, CatalogOptionGroup, CatalogUnit, SaveCatalogUnitInput, SaveCatalogOptionGroupInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogFilePreview, CatalogFilePreviewInput, CatalogImportApplyResult, CatalogImportItem, CatalogImportPreview, CatalogImportSource, CatalogImportSourcePreview, CatalogImportRunResult, CatalogPhotoUploadTarget, CatalogProduct, CatalogProductPage, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, CreateCatalogCategoryInput, CreateCatalogImportSourceInput, CreateCatalogProductInput, ListCatalogProductsInput, PreviewCatalogImportSourceInput, SignCatalogPhotoUploadInput, UpdateCatalogCategoryInput, UpdateCatalogImportSourceInput, UpdateCatalogProductInput, UpsertCatalogInput } from '../types';
4
4
  /** Max structured items per `import.preview/apply` call (platform cap). */
5
5
  export declare const CATALOG_IMPORT_MAX_ITEMS = 200;
6
6
  /** Thrown client-side, before any request, when `items` exceeds the cap. */
@@ -122,6 +122,13 @@ export declare class CatalogMenuImportResource {
122
122
  constructor(client: AgentForgeClient);
123
123
  /** `POST /import/menu/read` (multipart) — `text` and/or a `file` (≤10 MB). Can take a minute. */
124
124
  read(input: CatalogMenuReadInput): Promise<CatalogMenuRead>;
125
+ /**
126
+ * `POST /import/menu/files` (multipart) — a file the owner attached in their
127
+ * chat, kept 30 min for the assistant: the message carries
128
+ * `[filename](file:<fileId>)` and the staff tool `catalog_staff_menu_preview`
129
+ * reads it by `fileId`. Writes nothing.
130
+ */
131
+ attach(input: CatalogMenuAttachInput): Promise<CatalogMenuChatFile>;
125
132
  /** `POST /import/menu/apply` — the confirmed items (max 200). */
126
133
  apply(items: CatalogMenuItem[], opts?: {
127
134
  kind?: 'product' | 'service';
@@ -255,6 +255,20 @@ class CatalogMenuImportResource {
255
255
  const res = await this.client.requestRaw('POST', `${BASE}/import/menu/read`, { ...TENANT_AUTH, formData: form, timeoutMs: 180000 });
256
256
  return (await res.json());
257
257
  }
258
+ /**
259
+ * `POST /import/menu/files` (multipart) — a file the owner attached in their
260
+ * chat, kept 30 min for the assistant: the message carries
261
+ * `[filename](file:<fileId>)` and the staff tool `catalog_staff_menu_preview`
262
+ * reads it by `fileId`. Writes nothing.
263
+ */
264
+ async attach(input) {
265
+ const form = new FormData();
266
+ const raw = toBlob(input.file);
267
+ const blob = input.mimeType && !raw.type ? new Blob([raw], { type: input.mimeType }) : raw;
268
+ form.append('file', blob, input.filename ?? 'menu');
269
+ const res = await this.client.requestRaw('POST', `${BASE}/import/menu/files`, { ...TENANT_AUTH, formData: form, timeoutMs: 60000 });
270
+ return (await res.json());
271
+ }
258
272
  /** `POST /import/menu/apply` — the confirmed items (max 200). */
259
273
  async apply(items, opts = {}) {
260
274
  return this.client.request('POST', `${BASE}/import/menu/apply`, { items, ...opts }, { ...TENANT_AUTH, timeoutMs: 120000 });
package/dist/types.d.ts CHANGED
@@ -1298,6 +1298,8 @@ export interface CatalogFileMapping {
1298
1298
  image?: string;
1299
1299
  /** The template's "tipo" column (product | service). */
1300
1300
  kind?: string;
1301
+ /** AGF-UNITS — the unit of measure column («unidad»: kg, libra, caja, canasta…). Blank cells = unidades. */
1302
+ unit?: string;
1301
1303
  }
1302
1304
  export interface CatalogFilePlan {
1303
1305
  willCreate: number;
@@ -1305,6 +1307,8 @@ export interface CatalogFilePlan {
1305
1307
  unchanged: number;
1306
1308
  skipped: number;
1307
1309
  categoriesToCreate: string[];
1310
+ /** AGF-UNITS — units the file writes that the business does not have yet: the import creates them as its own. */
1311
+ unitsToCreate?: string[];
1308
1312
  }
1309
1313
  export interface CatalogFilePreview {
1310
1314
  headers: string[];
@@ -1323,6 +1327,8 @@ export interface CatalogFileApplyResult {
1323
1327
  skipped: number;
1324
1328
  unchanged: number;
1325
1329
  categoriesCreated: string[];
1330
+ /** AGF-UNITS — the business's own units the import created. */
1331
+ unitsCreated?: string[];
1326
1332
  photosImported: number;
1327
1333
  warnings: string[];
1328
1334
  }
@@ -1347,6 +1353,8 @@ export interface CatalogMenuItem {
1347
1353
  priceDeltaCents: number;
1348
1354
  }>;
1349
1355
  }>;
1356
+ /** AGF-UNITS — what the price is per, when the menu says it («libra», «kg»); absent = unidad. */
1357
+ unit?: string;
1350
1358
  }
1351
1359
  export interface CatalogMenuReadInput {
1352
1360
  /** The pasted menu, or a note to go with the file. */
@@ -1356,6 +1364,21 @@ export interface CatalogMenuReadInput {
1356
1364
  filename?: string;
1357
1365
  mimeType?: string;
1358
1366
  }
1367
+ /** A file the owner attached in their chat (`catalog.import.menu.attach`). */
1368
+ export interface CatalogMenuAttachInput {
1369
+ /** A photo (JPG/PNG/WebP), PDF, .docx, .xlsx, .csv or .txt (≤10 MB). */
1370
+ file: CatalogFileInput;
1371
+ filename?: string;
1372
+ mimeType?: string;
1373
+ }
1374
+ /** Kept 30 min for the assistant: the message carries `[filename](file:<fileId>)`. */
1375
+ export interface CatalogMenuChatFile {
1376
+ fileId: string;
1377
+ filename: string;
1378
+ size: number;
1379
+ /** Epoch ms. */
1380
+ expiresAt: number;
1381
+ }
1359
1382
  export interface CatalogMenuRead {
1360
1383
  items: CatalogMenuItem[];
1361
1384
  source: 'text' | 'image' | 'pdf' | 'document' | 'sheet';
@@ -1413,6 +1436,8 @@ export interface CatalogImportColumnMapping {
1413
1436
  * other value → product with a warning. Optional; omit for sources
1414
1437
  * without such a column. */
1415
1438
  kind?: string;
1439
+ /** AGF-UNITS — the unit of measure column («unidad»). Optional; blank cells = unidades. */
1440
+ unit?: string;
1416
1441
  }
1417
1442
  export interface CatalogImportRunResult {
1418
1443
  created: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.37.0",
3
+ "version": "4.39.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",