@agentforge-io/sdk-server 4.55.0 → 4.57.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, AppCaseWebhookEvent, AppCaseWebhookEventName, AppConversationMessageWebhookEvent, AppChannelStatusWebhookEvent, 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, BusinessReview, BusinessReviewsPage, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseStateStep, CreateDirectOrderInput, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseReportPage, CaseReceipt, CaseReceiptLine, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryRoute, DeliveryRouteInput, 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, AppCaseWebhookEvent, AppCaseWebhookEventName, AppConversationMessageWebhookEvent, AppChannelStatusWebhookEvent, 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, BusinessReview, BusinessReviewsPage, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseStateStep, CreateDirectOrderInput, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseReportPage, CaseReceipt, CaseReceiptLine, CaseProposal, CaseProposalAnswer, CaseProposalChange, CaseProposalInput, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryRoute, DeliveryRouteInput, 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';
@@ -1,5 +1,5 @@
1
1
  import type { AgentForgeClient } from '../client';
2
- import type { CaseClosingReport, CaseReportPage, CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectBookingInput, CreateDirectOrderInput, DirectOrderForm, ListCasesInput, MoveCaseSlotInput } from '../types';
2
+ import type { CaseClosingReport, CaseProposalAnswer, CaseProposalInput, CaseReportPage, CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectBookingInput, CreateDirectOrderInput, DirectOrderForm, ListCasesInput, MoveCaseSlotInput } from '../types';
3
3
  export declare class CasesResource {
4
4
  private readonly client;
5
5
  constructor(client: AgentForgeClient);
@@ -34,6 +34,39 @@ export declare class CasesResource {
34
34
  * then says it was weighed.
35
35
  */
36
36
  weighLine(caseId: string, line: string, weight: number): Promise<CaseView>;
37
+ /**
38
+ * `POST /api/v1/cases/:id/proposal` — AGF-PDK-DISPATCH-PROPOSAL: the business proposes
39
+ * changes while picking (a line out of stock, another product in its place; lines by
40
+ * their receipt `key`). The customer is told in the conversation; the order waits for
41
+ * the answer. Replaces a pending proposal. 400 with the reason when one cannot be made.
42
+ */
43
+ propose(caseId: string, input: CaseProposalInput): Promise<CaseView>;
44
+ /** `POST /api/v1/cases/:id/proposal/withdraw` — takes the pending proposal back: the order can move again. */
45
+ withdrawProposal(caseId: string): Promise<CaseView>;
46
+ /**
47
+ * `POST /api/v1/cases/:id/proposal/answer` — the business records the customer's answer
48
+ * (they said it by phone). The order's lines follow and the receipt is re-issued.
49
+ */
50
+ answerProposal(caseId: string, answer: CaseProposalAnswer): Promise<CaseView>;
51
+ /**
52
+ * `POST /api/v1/cases/receipts/:token/proposal/answer` — the customer answers from the
53
+ * receipt. Same order, same link: the receipt comes back re-issued (revision + 1).
54
+ */
55
+ receiptAnswerProposal(token: string, answer: CaseProposalAnswer): Promise<CaseReceipt>;
56
+ /**
57
+ * `POST /api/v1/cases/receipts/:token/proposal/redo` — «Rehacer pedido»: instead of
58
+ * answering, the customer redoes the same order. It goes back to being edited (same
59
+ * code, same link), its holds are let go, and the business sees it is being changed.
60
+ * Send it again with `createDirect({ ..., reopens: token })`.
61
+ */
62
+ /**
63
+ * `POST /api/v1/cases/receipts/:token/reopen` — «Modificar pedido»: the customer changes an
64
+ * order before it is confirmed (sent, accepted, being prepared). It goes back to being edited
65
+ * with its cart (same code, same link); send it again with `createDirect({ ..., reopens: token })`.
66
+ * 400 once the order is confirmed: a change is a new order.
67
+ */
68
+ receiptReopen(token: string): Promise<CaseReceipt>;
69
+ receiptRedoProposal(token: string): Promise<CaseReceipt>;
37
70
  /**
38
71
  * `POST /api/v1/cases/:id/transition` — the business moves a case:
39
72
  * `accepted` / `rejected` from `submitted`, then the type's states,
@@ -106,6 +139,16 @@ export declare class CasesResource {
106
139
  amountCents?: number;
107
140
  accountId?: string;
108
141
  }): Promise<CaseView>;
142
+ /**
143
+ * `POST /api/v1/cases/:id/payment/method` — AGF-PAYMENT-METHOD-BUSINESS: the business
144
+ * sets or changes how the customer pays (an `accountId` of `directForm().payment.options`;
145
+ * for Efectivo, `cashTenderedCents` = what they pay with). Only while
146
+ * `payment.methodChangeable` (nothing paid or reported, the case did not end undone);
147
+ * 400 otherwise. The customer hears it in the chat.
148
+ */
149
+ setPaymentMethod(caseId: string, accountId: string, opts?: {
150
+ cashTenderedCents?: number;
151
+ }): Promise<CaseView>;
109
152
  /**
110
153
  * `POST /api/v1/cases/receipts/:token/payment/choose` — the customer chooses how
111
154
  * to pay on the receipt (an `accountId` from `payment.options`; for Efectivo,
@@ -69,6 +69,51 @@ class CasesResource {
69
69
  async weighLine(caseId, line, weight) {
70
70
  return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/weigh`, { line, weight });
71
71
  }
72
+ /**
73
+ * `POST /api/v1/cases/:id/proposal` — AGF-PDK-DISPATCH-PROPOSAL: the business proposes
74
+ * changes while picking (a line out of stock, another product in its place; lines by
75
+ * their receipt `key`). The customer is told in the conversation; the order waits for
76
+ * the answer. Replaces a pending proposal. 400 with the reason when one cannot be made.
77
+ */
78
+ async propose(caseId, input) {
79
+ return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/proposal`, input);
80
+ }
81
+ /** `POST /api/v1/cases/:id/proposal/withdraw` — takes the pending proposal back: the order can move again. */
82
+ async withdrawProposal(caseId) {
83
+ return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/proposal/withdraw`, {});
84
+ }
85
+ /**
86
+ * `POST /api/v1/cases/:id/proposal/answer` — the business records the customer's answer
87
+ * (they said it by phone). The order's lines follow and the receipt is re-issued.
88
+ */
89
+ async answerProposal(caseId, answer) {
90
+ return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/proposal/answer`, { answer });
91
+ }
92
+ /**
93
+ * `POST /api/v1/cases/receipts/:token/proposal/answer` — the customer answers from the
94
+ * receipt. Same order, same link: the receipt comes back re-issued (revision + 1).
95
+ */
96
+ async receiptAnswerProposal(token, answer) {
97
+ return this.client.request('POST', `/api/v1/cases/receipts/${encodeURIComponent(token)}/proposal/answer`, { answer });
98
+ }
99
+ /**
100
+ * `POST /api/v1/cases/receipts/:token/proposal/redo` — «Rehacer pedido»: instead of
101
+ * answering, the customer redoes the same order. It goes back to being edited (same
102
+ * code, same link), its holds are let go, and the business sees it is being changed.
103
+ * Send it again with `createDirect({ ..., reopens: token })`.
104
+ */
105
+ /**
106
+ * `POST /api/v1/cases/receipts/:token/reopen` — «Modificar pedido»: the customer changes an
107
+ * order before it is confirmed (sent, accepted, being prepared). It goes back to being edited
108
+ * with its cart (same code, same link); send it again with `createDirect({ ..., reopens: token })`.
109
+ * 400 once the order is confirmed: a change is a new order.
110
+ */
111
+ async receiptReopen(token) {
112
+ return this.client.request('POST', `/api/v1/cases/receipts/${encodeURIComponent(token)}/reopen`, {});
113
+ }
114
+ async receiptRedoProposal(token) {
115
+ return this.client.request('POST', `/api/v1/cases/receipts/${encodeURIComponent(token)}/proposal/redo`, {});
116
+ }
72
117
  /**
73
118
  * `POST /api/v1/cases/:id/transition` — the business moves a case:
74
119
  * `accepted` / `rejected` from `submitted`, then the type's states,
@@ -160,6 +205,19 @@ class CasesResource {
160
205
  ...(opts.accountId ? { accountId: opts.accountId } : {}),
161
206
  });
162
207
  }
208
+ /**
209
+ * `POST /api/v1/cases/:id/payment/method` — AGF-PAYMENT-METHOD-BUSINESS: the business
210
+ * sets or changes how the customer pays (an `accountId` of `directForm().payment.options`;
211
+ * for Efectivo, `cashTenderedCents` = what they pay with). Only while
212
+ * `payment.methodChangeable` (nothing paid or reported, the case did not end undone);
213
+ * 400 otherwise. The customer hears it in the chat.
214
+ */
215
+ async setPaymentMethod(caseId, accountId, opts = {}) {
216
+ return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/payment/method`, {
217
+ accountId,
218
+ ...(opts.cashTenderedCents ? { cashTenderedCents: opts.cashTenderedCents } : {}),
219
+ });
220
+ }
163
221
  /**
164
222
  * `POST /api/v1/cases/receipts/:token/payment/choose` — the customer chooses how
165
223
  * to pay on the receipt (an `accountId` from `payment.options`; for Efectivo,
package/dist/types.d.ts CHANGED
@@ -2073,7 +2073,8 @@ export interface CaseType {
2073
2073
  * AGF-ORDER-STATE-TYPES D1 — what a state is for, whatever the template calls it. Features
2074
2074
  * (the courier section, dispatch) read the type, never the label.
2075
2075
  */
2076
- export type CaseStateType = 'draft' | 'received' | 'preparing' | 'ready' | 'out_for_delivery' | 'completed' | 'canceled';
2076
+ /** `confirmed` (AGF-PDK-DISPATCH-PROPOSAL): an order's definitive version, after its preparation; from it on, a change is a new order. */
2077
+ export type CaseStateType = 'draft' | 'received' | 'preparing' | 'confirmed' | 'ready' | 'out_for_delivery' | 'completed' | 'canceled';
2077
2078
  /** `no_show`: a booking whose customer did not come (AGF-AGENDA-LIFECYCLE). */
2078
2079
  export type CaseState = 'open' | 'review' | 'submitted' | 'accepted' | 'completed' | 'cancelled' | 'rejected' | 'abandoned' | 'no_show' | (string & {});
2079
2080
  /** One state a case reached (AGF-CASE-TRACKING). */
@@ -2168,6 +2169,8 @@ export interface CaseView {
2168
2169
  } | null;
2169
2170
  /** AGF-PAYMENT-ACCOUNTS — how it is paid: null before the business took it (or closed undone with nothing chosen). */
2170
2171
  payment: CasePayment | null;
2172
+ /** AGF-PDK-DISPATCH-PROPOSAL — the latest proposed changes and their answer (absent on an older platform). */
2173
+ proposal?: CaseProposal | null;
2171
2174
  /** AGF-AGENDA — who of the business attends it: your member reference (set with `cases.assign`). */
2172
2175
  assigneeRef: string | null;
2173
2176
  /** AGF-AGENDA — the time a booking holds, and how it reads («lunes, 9 de noviembre, 10:00–10:45»). */
@@ -2231,6 +2234,8 @@ export interface CasePayment {
2231
2234
  key: CasePaymentStatus;
2232
2235
  label: string;
2233
2236
  }>;
2237
+ /** AGF-PAYMENT-METHOD-BUSINESS — the business may set or change the method now (`cases.setPaymentMethod`). Absent on an older platform. */
2238
+ methodChangeable?: boolean;
2234
2239
  /** AGF-CHECKOUT-PAYMENT — Efectivo: what the customer pays with, and the change for the total then. */
2235
2240
  cashTenderedCents?: number;
2236
2241
  changeCents?: number;
@@ -2297,7 +2302,71 @@ export interface CaseReceiptLine {
2297
2302
  name: string;
2298
2303
  deltaCents: number;
2299
2304
  }>;
2305
+ /** AGF-PDK-DISPATCH-PROPOSAL — the line's identity (product + choice): what `cases.propose` names.
2306
+ * Absent on an older platform. */
2307
+ key?: string;
2308
+ productId?: string;
2309
+ /** The product's cover photo, when it has one. */
2310
+ coverUrl?: string;
2311
+ }
2312
+ /** AGF-PDK-DISPATCH-PROPOSAL — one change to a line: out of stock, or swapped for another product. */
2313
+ export interface CaseProposalChange {
2314
+ /** The receipt line's `key`. */
2315
+ line: string;
2316
+ title: string;
2317
+ qty: number;
2318
+ /** What the line costs now; null when it has no fixed price. */
2319
+ amountCents: number | null;
2320
+ kind: 'out' | 'swap';
2321
+ swap?: {
2322
+ productId: string;
2323
+ title: string;
2324
+ /** One unit, in cents; null when its price is not fixed. */
2325
+ unitCents: number | null;
2326
+ currency: string;
2327
+ coverUrl: string | null;
2328
+ /** What it costs for the line's quantity; null when that cannot be said. */
2329
+ amountCents: number | null;
2330
+ };
2331
+ /** The answer to an alternative (an out-of-stock line is always `drop`); absent while pending. */
2332
+ answer?: 'keep' | 'drop';
2333
+ }
2334
+ /**
2335
+ * AGF-PDK-DISPATCH-PROPOSAL — changes the business proposed while picking an order. Same
2336
+ * order, same link: answered, the receipt is re-issued (revision + 1). While `pending`
2337
+ * the order cannot move forward (it can still be cancelled or rejected).
2338
+ */
2339
+ export interface CaseProposal {
2340
+ id: string;
2341
+ /** `redone`: the customer chose «Rehacer pedido» (the order went back to being edited). */
2342
+ status: 'pending' | 'accepted' | 'withdrawn' | 'redone';
2343
+ sentAt: string;
2344
+ answeredAt?: string;
2345
+ /** The receipt revision it was made on. */
2346
+ revision: number;
2347
+ note: string | null;
2348
+ changes: CaseProposalChange[];
2349
+ totalBeforeCents: number | null;
2350
+ /** The total if every alternative is kept (once answered: with what was kept); null when it cannot be said. */
2351
+ totalAfterCents: number | null;
2352
+ currency: string | null;
2300
2353
  }
2354
+ /** What `cases.propose` sends: each change names a receipt line by its `key`. */
2355
+ export interface CaseProposalInput {
2356
+ changes: Array<{
2357
+ line: string;
2358
+ out: true;
2359
+ } | {
2360
+ line: string;
2361
+ swap: {
2362
+ productId: string;
2363
+ };
2364
+ }>;
2365
+ /** Words for the customer (≤ 500). */
2366
+ note?: string;
2367
+ }
2368
+ /** The customer's answer: `all` keeps every alternative, or each alternative's line key → keep | drop. */
2369
+ export type CaseProposalAnswer = 'all' | Record<string, 'keep' | 'drop'>;
2301
2370
  /**
2302
2371
  * AGF-CASE-RECEIPT — a case's receipt as its public link shows it: what the
2303
2372
  * customer sent (frozen when sent), the live state, and the business's look.
@@ -2353,6 +2422,8 @@ export interface CaseReceipt {
2353
2422
  place: string | null;
2354
2423
  label: string;
2355
2424
  } | null;
2425
+ /** AGF-PDK-DISPATCH-PROPOSAL — the business's latest proposed changes and their answer (absent on an older platform). */
2426
+ proposal?: CaseProposal | null;
2356
2427
  business: {
2357
2428
  name: string;
2358
2429
  description: string | null;
@@ -2434,6 +2505,13 @@ export interface CreateDirectOrderInput {
2434
2505
  };
2435
2506
  /** AGF-DELIVERY D0 — where it is taken, set by your server. Not with `place`. */
2436
2507
  destination?: CaseDestination;
2508
+ /**
2509
+ * AGF-PDK-DISPATCH-PROPOSAL — «Rehacer pedido»: the receipt token of the order the
2510
+ * customer is redoing (`cases.receiptRedoProposal`). This cart goes into THAT order
2511
+ * (same code, same link, a new revision) instead of making a new one. 400 when that
2512
+ * order is not being redone; a retried submit returns it as sent.
2513
+ */
2514
+ reopens?: string;
2437
2515
  }
2438
2516
  /** A payment method a checkout offers (no account data — that is on the receipt once the order is sent). */
2439
2517
  export interface DirectPaymentOption {
@@ -2652,7 +2730,7 @@ export interface MoveCaseSlotInput {
2652
2730
  assigneeRef?: string | null;
2653
2731
  assigneeName?: string;
2654
2732
  }
2655
- export type AppCaseWebhookEventName = 'case.submitted' | 'case.state_changed' | 'case.closed' | 'case.customer_request' | 'case.payment_changed';
2733
+ export type AppCaseWebhookEventName = 'case.submitted' | 'case.state_changed' | 'case.closed' | 'case.customer_request' | 'case.payment_changed' | 'case.proposal';
2656
2734
  export type AppWebhookEventName = AppCaseWebhookEventName | 'conversation.message' | 'channel.status_changed';
2657
2735
  export interface AppWebhook {
2658
2736
  url: string;
@@ -2720,6 +2798,8 @@ export interface AppCaseWebhookEvent extends AppWebhookEventBase {
2720
2798
  /** `case.payment_changed`: where the payment is now, and where it was. */
2721
2799
  paymentStatus?: CasePaymentStatus;
2722
2800
  previousPaymentStatus?: CasePaymentStatus;
2801
+ /** `case.proposal` (AGF-PDK-DISPATCH-PROPOSAL): the business sent or withdrew changes, or they were answered. */
2802
+ proposal?: 'sent' | 'accepted' | 'withdrawn' | 'redone';
2723
2803
  /** AGF-ORDER-ORIGIN-POS — where the case came from (cases from before carry none). */
2724
2804
  origin?: CaseOrigin;
2725
2805
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.55.0",
3
+ "version": "4.57.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",