@agentforge-io/sdk-server 4.43.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, 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';
@@ -1,5 +1,5 @@
1
1
  import type { AgentForgeClient } from '../client';
2
- import type { CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectOrderInput, DirectOrderForm, ListCasesInput } from '../types';
2
+ import type { 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);
@@ -49,6 +49,24 @@ export declare class CasesResource {
49
49
  * 400 for a bad order or missing fields, 409 when a product lacks stock.
50
50
  */
51
51
  createDirect(input: CreateDirectOrderInput): Promise<CaseView>;
52
+ /**
53
+ * `POST /api/v1/cases/bookings` — AGF-AGENDA: a booking from your App's agenda
54
+ * (hold the time in your own ledger first). Created sent (`submitted`), or
55
+ * `accepted` at once with `confirmation: 'instant'`, with receipt and events like
56
+ * a direct order. 400 when the service is not bookable or the span is not its
57
+ * duration. A retried `idempotencyKey` returns the same booking.
58
+ */
59
+ createDirectBooking(input: CreateDirectBookingInput): Promise<CaseView>;
60
+ /**
61
+ * `POST /api/v1/cases/:id/assign` — AGF-AGENDA: who of the business attends any
62
+ * open request (your member reference), or null to leave it unassigned.
63
+ * `memberName` updates a booking's «Profesional».
64
+ */
65
+ assign(caseId: string, assigneeRef: string | null, opts?: {
66
+ memberName?: string;
67
+ }): Promise<CaseView>;
68
+ /** `POST /api/v1/cases/:id/slot` — AGF-AGENDA: moves a booking to a time you already hold. */
69
+ updateSlot(caseId: string, input: MoveCaseSlotInput): Promise<CaseView>;
52
70
  /**
53
71
  * `POST /api/v1/cases/:id/payment` — AGF-PAYMENT-ACCOUNTS: the business moves the
54
72
  * payment: `paid` (confirmed, or cash received), `rejected` (did not arrive),
@@ -61,9 +79,12 @@ export declare class CasesResource {
61
79
  }): Promise<CaseView>;
62
80
  /**
63
81
  * `POST /api/v1/cases/receipts/:token/payment/choose` — the customer chooses how
64
- * 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).
65
84
  */
66
- receiptChoosePayment(token: string, accountId: string): Promise<CaseReceipt>;
85
+ receiptChoosePayment(token: string, accountId: string, opts?: {
86
+ cashTenderedCents?: number;
87
+ }): Promise<CaseReceipt>;
67
88
  /**
68
89
  * `POST /api/v1/cases/receipts/:token/payment/report` — the customer says they
69
90
  * paid: the transfer `reference` and/or the `proof` image (jpeg/png/webp, base64,
@@ -22,6 +22,13 @@ class CasesResource {
22
22
  qs.set('since', input.since instanceof Date ? input.since.toISOString() : input.since);
23
23
  if (input.limit !== undefined)
24
24
  qs.set('limit', String(input.limit));
25
+ const at = (v) => (v instanceof Date ? v.toISOString() : v);
26
+ if (input.slotFrom)
27
+ qs.set('slotFrom', at(input.slotFrom));
28
+ if (input.slotTo)
29
+ qs.set('slotTo', at(input.slotTo));
30
+ if (input.assignee)
31
+ qs.set('assignee', input.assignee);
25
32
  const q = qs.toString();
26
33
  return (await this.client.request('GET', `/api/v1/cases${q ? `?${q}` : ''}`)).items;
27
34
  }
@@ -82,6 +89,31 @@ class CasesResource {
82
89
  async createDirect(input) {
83
90
  return this.client.request('POST', '/api/v1/cases/direct', input);
84
91
  }
92
+ /**
93
+ * `POST /api/v1/cases/bookings` — AGF-AGENDA: a booking from your App's agenda
94
+ * (hold the time in your own ledger first). Created sent (`submitted`), or
95
+ * `accepted` at once with `confirmation: 'instant'`, with receipt and events like
96
+ * a direct order. 400 when the service is not bookable or the span is not its
97
+ * duration. A retried `idempotencyKey` returns the same booking.
98
+ */
99
+ async createDirectBooking(input) {
100
+ return this.client.request('POST', '/api/v1/cases/bookings', input);
101
+ }
102
+ /**
103
+ * `POST /api/v1/cases/:id/assign` — AGF-AGENDA: who of the business attends any
104
+ * open request (your member reference), or null to leave it unassigned.
105
+ * `memberName` updates a booking's «Profesional».
106
+ */
107
+ async assign(caseId, assigneeRef, opts = {}) {
108
+ return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/assign`, {
109
+ assigneeRef,
110
+ ...(opts.memberName ? { memberName: opts.memberName } : {}),
111
+ });
112
+ }
113
+ /** `POST /api/v1/cases/:id/slot` — AGF-AGENDA: moves a booking to a time you already hold. */
114
+ async updateSlot(caseId, input) {
115
+ return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/slot`, input);
116
+ }
85
117
  /**
86
118
  * `POST /api/v1/cases/:id/payment` — AGF-PAYMENT-ACCOUNTS: the business moves the
87
119
  * payment: `paid` (confirmed, or cash received), `rejected` (did not arrive),
@@ -97,10 +129,14 @@ class CasesResource {
97
129
  }
98
130
  /**
99
131
  * `POST /api/v1/cases/receipts/:token/payment/choose` — the customer chooses how
100
- * 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).
101
134
  */
102
- async receiptChoosePayment(token, accountId) {
103
- 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
+ });
104
140
  }
105
141
  /**
106
142
  * `POST /api/v1/cases/receipts/:token/payment/report` — the customer says they
package/dist/types.d.ts CHANGED
@@ -802,6 +802,13 @@ export type TeamProfileBlock = {
802
802
  kind: 'catalog';
803
803
  catalogId: string;
804
804
  [field: string]: unknown;
805
+ }
806
+ /** AGF-AGENDA — the business's agenda: free times of its bookable services (the host computes them). */
807
+ | {
808
+ kind: 'agenda';
809
+ serviceIds?: string[];
810
+ customerPicksMember?: boolean;
811
+ layout?: 'chips' | 'list';
805
812
  });
806
813
  /** `GET /api/v1/teams/:id` — the team with its page settings, and its members. */
807
814
  export interface TeamDetail {
@@ -874,6 +881,9 @@ export interface TemplateSummary {
874
881
  * ask the owner for products (`af.catalog`) instead of a product field.
875
882
  * Absent on platforms older than the field: treat as `false`. */
876
883
  usesCatalog?: boolean;
884
+ /** AGF-AGENDA — the template books times (an enabled `agenda` block or a case type marked
885
+ * `booking`); the host should give the business an agenda. Always derived. Absent on older platforms: `false`. */
886
+ usesAgenda?: boolean;
877
887
  installsCount: number;
878
888
  /** AGF-PDK-TEMPLATE-PAGE. Average of the visible reviews (one decimal),
879
889
  * null with none. Absent on platforms older than reviews. */
@@ -1118,6 +1128,8 @@ export interface CatalogProduct {
1118
1128
  /** AGF-UNITS U2 — how it is sold; null = by unit. Sold by measure, `stock` counts the unit
1119
1129
  * kind's base (g, ml, cm): divide by the unit's `base` to read it in the product's unit. */
1120
1130
  saleRule?: CatalogSaleRule | null;
1131
+ /** AGF-AGENDA — a service's duration and buffer; null = not bookable. */
1132
+ booking?: CatalogBookingRule | null;
1121
1133
  lastSoldAt?: string | null;
1122
1134
  demandCount: number;
1123
1135
  createdAt: string;
@@ -1143,6 +1155,9 @@ export interface CreateCatalogProductInput {
1143
1155
  attributes?: Record<string, unknown>;
1144
1156
  availability?: CatalogAvailability | null;
1145
1157
  lockedFields?: CatalogLockableField[];
1158
+ /** AGF-AGENDA — a service's `{ durationMinutes, bufferMinutes? }`; null makes it not bookable.
1159
+ * Only `kind: 'service'` (400 NOT_A_SERVICE), 5–720 and 0–120 minutes (400 INVALID_BOOKING). */
1160
+ booking?: CatalogBookingRule | null;
1146
1161
  }
1147
1162
  export interface UpdateCatalogProductInput extends Partial<CreateCatalogProductInput> {
1148
1163
  sortOrder?: number;
@@ -1152,6 +1167,11 @@ export interface UpdateCatalogProductInput extends Partial<CreateCatalogProductI
1152
1167
  * Switching converts the stock; a measure needs a weight/volume/length/area/time unit. */
1153
1168
  saleRule?: CatalogSaleRule;
1154
1169
  }
1170
+ /** AGF-AGENDA — how long a bookable service takes, and the time after it before the next. */
1171
+ export interface CatalogBookingRule {
1172
+ durationMinutes: number;
1173
+ bufferMinutes?: number;
1174
+ }
1155
1175
  /** AGF-UNITS U2 — how a product is sold. */
1156
1176
  export interface CatalogSaleRule {
1157
1177
  by: 'unit' | 'measure';
@@ -1993,7 +2013,8 @@ export interface CaseType {
1993
2013
  * `submitted` (with the business) → `accepted` → the type's business states →
1994
2014
  * `completed` | `cancelled` | `rejected` | `abandoned`.
1995
2015
  */
1996
- export type CaseState = 'open' | 'review' | 'submitted' | 'accepted' | 'completed' | 'cancelled' | 'rejected' | 'abandoned' | (string & {});
2016
+ /** `no_show`: a booking whose customer did not come (AGF-AGENDA-LIFECYCLE). */
2017
+ export type CaseState = 'open' | 'review' | 'submitted' | 'accepted' | 'completed' | 'cancelled' | 'rejected' | 'abandoned' | 'no_show' | (string & {});
1997
2018
  export interface CaseView {
1998
2019
  id: string;
1999
2020
  /** Per workspace, sequential (ordering). People read `code`. */
@@ -2055,6 +2076,12 @@ export interface CaseView {
2055
2076
  } | null;
2056
2077
  /** AGF-PAYMENT-ACCOUNTS — how it is paid: null before the business took it (or closed undone with nothing chosen). */
2057
2078
  payment: CasePayment | null;
2079
+ /** AGF-AGENDA — who of the business attends it: your member reference (set with `cases.assign`). */
2080
+ assigneeRef: string | null;
2081
+ /** AGF-AGENDA — the time a booking holds, and how it reads («lunes, 9 de noviembre, 10:00–10:45»). */
2082
+ slot: (CaseSlot & {
2083
+ label: string;
2084
+ }) | null;
2058
2085
  openedAt: string;
2059
2086
  reviewedAt: string | null;
2060
2087
  submittedAt: string | null;
@@ -2104,6 +2131,13 @@ export interface CasePayment {
2104
2131
  key: CasePaymentStatus;
2105
2132
  label: string;
2106
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;
2107
2141
  history: Array<{
2108
2142
  status: CasePaymentStatus;
2109
2143
  by: 'assistant' | 'customer' | 'business' | 'system';
@@ -2134,6 +2168,11 @@ export interface CaseReceiptPayment {
2134
2168
  }>;
2135
2169
  /** The customer may say they paid now (`cases.receiptReportPayment`). */
2136
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;
2137
2176
  }
2138
2177
  /** AGF-CASE-RECEIPT — one product line, with the price it had when the receipt was issued. */
2139
2178
  export interface CaseReceiptLine {
@@ -2199,7 +2238,7 @@ export interface CaseReceipt {
2199
2238
  /** Closed without being done (rejected, cancelled, abandoned). */
2200
2239
  stopped: boolean;
2201
2240
  updatedAt: string;
2202
- /** 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). */
2203
2242
  payment: CaseReceiptPayment | null;
2204
2243
  business: {
2205
2244
  name: string;
@@ -2246,6 +2285,28 @@ export interface CreateDirectOrderInput {
2246
2285
  conversationId?: string;
2247
2286
  /** Same key → same order: a retried submit never makes two. 8–80 of [A-Za-z0-9_.:-]. */
2248
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;
2249
2310
  }
2250
2311
  /** What a checkout asks besides the cart, the name and the phone (AGF-ORDER-WITHOUT-AI). */
2251
2312
  export interface DirectOrderForm {
@@ -2261,6 +2322,10 @@ export interface DirectOrderForm {
2261
2322
  hint?: string;
2262
2323
  options?: string[];
2263
2324
  }>;
2325
+ /** AGF-CHECKOUT-PAYMENT — the business's usable payment methods, in its order (empty: none set up). */
2326
+ payment: {
2327
+ options: DirectPaymentOption[];
2328
+ };
2264
2329
  }
2265
2330
  export interface ListCasesInput {
2266
2331
  state?: CaseState[];
@@ -2270,6 +2335,64 @@ export interface ListCasesInput {
2270
2335
  since?: string | Date;
2271
2336
  /** 1–200, default 50. */
2272
2337
  limit?: number;
2338
+ /** AGF-AGENDA — bookings whose time starts in [slotFrom, slotTo), earliest first. */
2339
+ slotFrom?: string | Date;
2340
+ slotTo?: string | Date;
2341
+ /** AGF-AGENDA — one member's requests (your reference), or `none` for unassigned ones. */
2342
+ assignee?: string;
2343
+ }
2344
+ /** The time a booking holds (a snapshot: your App's agenda decides what is free). */
2345
+ export interface CaseSlot {
2346
+ /** ISO instants. */
2347
+ startsAt: string;
2348
+ endsAt: string;
2349
+ /** IANA zone the business reads it in. */
2350
+ timezone: string;
2351
+ serviceId?: string;
2352
+ serviceName?: string;
2353
+ /** Who attends, as you named them when you booked. */
2354
+ memberName?: string;
2355
+ }
2356
+ /**
2357
+ * `POST /api/v1/cases/bookings` — a booking from your App's agenda. Reserve the
2358
+ * time in your own ledger first; the platform checks the service is a bookable
2359
+ * one of the business (`booking.durationMinutes`) and that the span is exactly
2360
+ * that duration.
2361
+ */
2362
+ export interface CreateDirectBookingInput {
2363
+ customer: {
2364
+ ref: string;
2365
+ name: string;
2366
+ phone: string;
2367
+ };
2368
+ /** A catalog service of the business with a `booking` rule. */
2369
+ serviceId: string;
2370
+ /** ISO instants with their offset (Z or ±hh:mm). */
2371
+ startsAt: string;
2372
+ endsAt: string;
2373
+ /** IANA zone (the business's opening hours' zone). */
2374
+ timezone: string;
2375
+ /** Your member reference of who attends, and their name for the request («Profesional»). */
2376
+ assigneeRef?: string;
2377
+ assigneeName?: string;
2378
+ /** `review` (default): the business accepts it; `instant`: accepted as booked. */
2379
+ confirmation?: 'review' | 'instant';
2380
+ /** The booking type's other fields (notas…), by key. */
2381
+ fields?: Record<string, unknown>;
2382
+ /** The team's booking type; default: its first type marked `booking`, else the built-in «cita». */
2383
+ type?: string;
2384
+ /** The customer's chat conversation, when booked from the chat. */
2385
+ conversationId?: string;
2386
+ /** Same key → same booking. 8–80 of [A-Za-z0-9_.:-]. */
2387
+ idempotencyKey: string;
2388
+ }
2389
+ /** `POST /api/v1/cases/:id/slot` — the new time (you already hold it), optionally another member. */
2390
+ export interface MoveCaseSlotInput {
2391
+ startsAt: string;
2392
+ endsAt: string;
2393
+ timezone?: string;
2394
+ assigneeRef?: string | null;
2395
+ assigneeName?: string;
2273
2396
  }
2274
2397
  export type AppWebhookEventName = 'case.submitted' | 'case.state_changed' | 'case.closed' | 'case.customer_request' | 'case.payment_changed';
2275
2398
  export interface AppWebhook {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.43.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",