@agentforge-io/sdk-server 4.54.0 → 4.56.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 +1 -1
- package/dist/resources/cases.d.ts +10 -0
- package/dist/resources/cases.js +13 -0
- package/dist/types.d.ts +16 -1
- package/package.json +1 -1
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, 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, 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';
|
|
@@ -106,6 +106,16 @@ export declare class CasesResource {
|
|
|
106
106
|
amountCents?: number;
|
|
107
107
|
accountId?: string;
|
|
108
108
|
}): Promise<CaseView>;
|
|
109
|
+
/**
|
|
110
|
+
* `POST /api/v1/cases/:id/payment/method` — AGF-PAYMENT-METHOD-BUSINESS: the business
|
|
111
|
+
* sets or changes how the customer pays (an `accountId` of `directForm().payment.options`;
|
|
112
|
+
* for Efectivo, `cashTenderedCents` = what they pay with). Only while
|
|
113
|
+
* `payment.methodChangeable` (nothing paid or reported, the case did not end undone);
|
|
114
|
+
* 400 otherwise. The customer hears it in the chat.
|
|
115
|
+
*/
|
|
116
|
+
setPaymentMethod(caseId: string, accountId: string, opts?: {
|
|
117
|
+
cashTenderedCents?: number;
|
|
118
|
+
}): Promise<CaseView>;
|
|
109
119
|
/**
|
|
110
120
|
* `POST /api/v1/cases/receipts/:token/payment/choose` — the customer chooses how
|
|
111
121
|
* to pay on the receipt (an `accountId` from `payment.options`; for Efectivo,
|
package/dist/resources/cases.js
CHANGED
|
@@ -160,6 +160,19 @@ class CasesResource {
|
|
|
160
160
|
...(opts.accountId ? { accountId: opts.accountId } : {}),
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* `POST /api/v1/cases/:id/payment/method` — AGF-PAYMENT-METHOD-BUSINESS: the business
|
|
165
|
+
* sets or changes how the customer pays (an `accountId` of `directForm().payment.options`;
|
|
166
|
+
* for Efectivo, `cashTenderedCents` = what they pay with). Only while
|
|
167
|
+
* `payment.methodChangeable` (nothing paid or reported, the case did not end undone);
|
|
168
|
+
* 400 otherwise. The customer hears it in the chat.
|
|
169
|
+
*/
|
|
170
|
+
async setPaymentMethod(caseId, accountId, opts = {}) {
|
|
171
|
+
return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/payment/method`, {
|
|
172
|
+
accountId,
|
|
173
|
+
...(opts.cashTenderedCents ? { cashTenderedCents: opts.cashTenderedCents } : {}),
|
|
174
|
+
});
|
|
175
|
+
}
|
|
163
176
|
/**
|
|
164
177
|
* `POST /api/v1/cases/receipts/:token/payment/choose` — the customer chooses how
|
|
165
178
|
* to pay on the receipt (an `accountId` from `payment.options`; for Efectivo,
|
package/dist/types.d.ts
CHANGED
|
@@ -2042,6 +2042,9 @@ export interface CaseBusinessState {
|
|
|
2042
2042
|
label: string;
|
|
2043
2043
|
/** Said to the customer when the business moves the case here. */
|
|
2044
2044
|
notifyCustomer?: string;
|
|
2045
|
+
/** AGF-ORDER-STATE-TYPES D1/D3 — what the phase is for, and whom (absent: both pickup and delivery). */
|
|
2046
|
+
type?: 'preparing' | 'ready' | 'out_for_delivery';
|
|
2047
|
+
fulfillment?: 'pickup' | 'delivery';
|
|
2045
2048
|
}
|
|
2046
2049
|
/** One kind of case a team handles (declared by its template). */
|
|
2047
2050
|
export interface CaseType {
|
|
@@ -2066,6 +2069,11 @@ export interface CaseType {
|
|
|
2066
2069
|
* `submitted` (with the business) → `accepted` → the type's business states →
|
|
2067
2070
|
* `completed` | `cancelled` | `rejected` | `abandoned`.
|
|
2068
2071
|
*/
|
|
2072
|
+
/**
|
|
2073
|
+
* AGF-ORDER-STATE-TYPES D1 — what a state is for, whatever the template calls it. Features
|
|
2074
|
+
* (the courier section, dispatch) read the type, never the label.
|
|
2075
|
+
*/
|
|
2076
|
+
export type CaseStateType = 'draft' | 'received' | 'preparing' | 'ready' | 'out_for_delivery' | 'completed' | 'canceled';
|
|
2069
2077
|
/** `no_show`: a booking whose customer did not come (AGF-AGENDA-LIFECYCLE). */
|
|
2070
2078
|
export type CaseState = 'open' | 'review' | 'submitted' | 'accepted' | 'completed' | 'cancelled' | 'rejected' | 'abandoned' | 'no_show' | (string & {});
|
|
2071
2079
|
/** One state a case reached (AGF-CASE-TRACKING). */
|
|
@@ -2104,6 +2112,8 @@ export interface CaseView {
|
|
|
2104
2112
|
typeLabel: string;
|
|
2105
2113
|
state: CaseState;
|
|
2106
2114
|
stateLabel: string;
|
|
2115
|
+
/** AGF-ORDER-STATE-TYPES D5 — what the state is for; absent on a platform from before types. */
|
|
2116
|
+
stateType?: CaseStateType;
|
|
2107
2117
|
/** What the assistant collected, by field key. */
|
|
2108
2118
|
data: Record<string, unknown>;
|
|
2109
2119
|
/** What the customer confirmed (written at review). */
|
|
@@ -2116,7 +2126,8 @@ export interface CaseView {
|
|
|
2116
2126
|
* told when it moves there (AGF-CASES C3; absent when nothing is said). */
|
|
2117
2127
|
nextStates: Array<{
|
|
2118
2128
|
key: string;
|
|
2119
|
-
label: string;
|
|
2129
|
+
label: string; /** AGF-ORDER-STATE-TYPES D5 */
|
|
2130
|
+
type?: CaseStateType;
|
|
2120
2131
|
notifyCustomer?: string;
|
|
2121
2132
|
}>;
|
|
2122
2133
|
/** The collected data as the business reads it, labeled, in the type's order. */
|
|
@@ -2220,6 +2231,8 @@ export interface CasePayment {
|
|
|
2220
2231
|
key: CasePaymentStatus;
|
|
2221
2232
|
label: string;
|
|
2222
2233
|
}>;
|
|
2234
|
+
/** AGF-PAYMENT-METHOD-BUSINESS — the business may set or change the method now (`cases.setPaymentMethod`). Absent on an older platform. */
|
|
2235
|
+
methodChangeable?: boolean;
|
|
2223
2236
|
/** AGF-CHECKOUT-PAYMENT — Efectivo: what the customer pays with, and the change for the total then. */
|
|
2224
2237
|
cashTenderedCents?: number;
|
|
2225
2238
|
changeCents?: number;
|
|
@@ -2323,6 +2336,8 @@ export interface CaseReceipt {
|
|
|
2323
2336
|
customerFirstName: string | null;
|
|
2324
2337
|
state: CaseState;
|
|
2325
2338
|
stateLabel: string;
|
|
2339
|
+
/** AGF-ORDER-STATE-TYPES D5 — what the state is for; absent on a platform from before types. */
|
|
2340
|
+
stateType?: CaseStateType;
|
|
2326
2341
|
/** The road of the case, each step marked when reached. */
|
|
2327
2342
|
path: Array<{
|
|
2328
2343
|
key: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.56.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",
|