@agentforge-io/sdk-server 4.50.0 → 4.52.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 +19 -1
- package/dist/resources/cases.js +21 -0
- package/dist/resources/delivery.d.ts +7 -1
- package/dist/resources/delivery.js +8 -0
- package/dist/types.d.ts +39 -0
- 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, 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, 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, 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';
|
|
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, CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectBookingInput, CreateDirectOrderInput, DirectOrderForm, ListCasesInput, MoveCaseSlotInput } from '../types';
|
|
2
|
+
import type { CaseClosingReport, 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);
|
|
@@ -14,6 +14,17 @@ export declare class CasesResource {
|
|
|
14
14
|
from: string | Date;
|
|
15
15
|
to: string | Date;
|
|
16
16
|
}): Promise<CaseClosingReport>;
|
|
17
|
+
/**
|
|
18
|
+
* `GET /api/v1/cases/reports/orders` — AGF-CASH-REGISTER: the cases sent between two
|
|
19
|
+
* instants, (`from`, `to`], oldest first, with what each receipt says. A report of any
|
|
20
|
+
* size, page by page (`limit` ≤ 500): one call a page, never one per case.
|
|
21
|
+
*/
|
|
22
|
+
ordersReport(input: {
|
|
23
|
+
from: string | Date;
|
|
24
|
+
to: string | Date;
|
|
25
|
+
cursor?: string;
|
|
26
|
+
limit?: number;
|
|
27
|
+
}): Promise<CaseReportPage>;
|
|
17
28
|
/** `GET /api/v1/cases/:id` — 404 when it is not this workspace's. */
|
|
18
29
|
get(caseId: string): Promise<CaseView>;
|
|
19
30
|
/**
|
|
@@ -66,6 +77,13 @@ export declare class CasesResource {
|
|
|
66
77
|
* duration. A retried `idempotencyKey` returns the same booking.
|
|
67
78
|
*/
|
|
68
79
|
createDirectBooking(input: CreateDirectBookingInput): Promise<CaseView>;
|
|
80
|
+
/**
|
|
81
|
+
* `POST /api/v1/cases/:id/notice` — AGF-DELIVERY: tells the customer something through the
|
|
82
|
+
* conversation's channel. The same `key` never says it twice.
|
|
83
|
+
*/
|
|
84
|
+
notice(caseId: string, text: string, key: string): Promise<{
|
|
85
|
+
result: string;
|
|
86
|
+
}>;
|
|
69
87
|
/**
|
|
70
88
|
* `POST /api/v1/cases/:id/assign` — AGF-AGENDA: who of the business attends any
|
|
71
89
|
* open request (your member reference), or null to leave it unassigned.
|
package/dist/resources/cases.js
CHANGED
|
@@ -42,6 +42,20 @@ class CasesResource {
|
|
|
42
42
|
const qs = new URLSearchParams({ from: at(input.from), to: at(input.to) });
|
|
43
43
|
return this.client.request('GET', `/api/v1/cases/reports/closing?${qs}`);
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* `GET /api/v1/cases/reports/orders` — AGF-CASH-REGISTER: the cases sent between two
|
|
47
|
+
* instants, (`from`, `to`], oldest first, with what each receipt says. A report of any
|
|
48
|
+
* size, page by page (`limit` ≤ 500): one call a page, never one per case.
|
|
49
|
+
*/
|
|
50
|
+
async ordersReport(input) {
|
|
51
|
+
const at = (v) => (v instanceof Date ? v.toISOString() : v);
|
|
52
|
+
const qs = new URLSearchParams({ from: at(input.from), to: at(input.to) });
|
|
53
|
+
if (input.cursor)
|
|
54
|
+
qs.set('cursor', input.cursor);
|
|
55
|
+
if (input.limit !== undefined)
|
|
56
|
+
qs.set('limit', String(input.limit));
|
|
57
|
+
return this.client.request('GET', `/api/v1/cases/reports/orders?${qs}`);
|
|
58
|
+
}
|
|
45
59
|
/** `GET /api/v1/cases/:id` — 404 when it is not this workspace's. */
|
|
46
60
|
async get(caseId) {
|
|
47
61
|
return this.client.request('GET', `/api/v1/cases/${encodeURIComponent(caseId)}`);
|
|
@@ -109,6 +123,13 @@ class CasesResource {
|
|
|
109
123
|
async createDirectBooking(input) {
|
|
110
124
|
return this.client.request('POST', '/api/v1/cases/bookings', input);
|
|
111
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* `POST /api/v1/cases/:id/notice` — AGF-DELIVERY: tells the customer something through the
|
|
128
|
+
* conversation's channel. The same `key` never says it twice.
|
|
129
|
+
*/
|
|
130
|
+
async notice(caseId, text, key) {
|
|
131
|
+
return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/notice`, { text, key });
|
|
132
|
+
}
|
|
112
133
|
/**
|
|
113
134
|
* `POST /api/v1/cases/:id/assign` — AGF-AGENDA: who of the business attends any
|
|
114
135
|
* open request (your member reference), or null to leave it unassigned.
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { AgentForgeClient } from '../client';
|
|
2
|
-
import type { DeliveryQuote, DeliveryQuoteInput } from '../types';
|
|
2
|
+
import type { DeliveryQuote, DeliveryQuoteInput, DeliveryRoute, DeliveryRouteInput } from '../types';
|
|
3
3
|
export declare class DeliveryResource {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor(client: AgentForgeClient);
|
|
6
6
|
/** `POST /api/v1/delivery/quote` — 404 when the workspace has no delivery settings. */
|
|
7
7
|
quote(input: DeliveryQuoteInput): Promise<DeliveryQuote>;
|
|
8
|
+
/**
|
|
9
|
+
* `POST /api/v1/delivery/route` — the road through some stops, from `from` (else the
|
|
10
|
+
* business), to draw on a Google map (Google's terms bar other maps). Google orders the
|
|
11
|
+
* stops in between. `route` is null when there is no road.
|
|
12
|
+
*/
|
|
13
|
+
route(input: DeliveryRouteInput): Promise<DeliveryRoute>;
|
|
8
14
|
}
|
|
@@ -12,5 +12,13 @@ class DeliveryResource {
|
|
|
12
12
|
async quote(input) {
|
|
13
13
|
return this.client.request('POST', '/api/v1/delivery/quote', input);
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* `POST /api/v1/delivery/route` — the road through some stops, from `from` (else the
|
|
17
|
+
* business), to draw on a Google map (Google's terms bar other maps). Google orders the
|
|
18
|
+
* stops in between. `route` is null when there is no road.
|
|
19
|
+
*/
|
|
20
|
+
async route(input) {
|
|
21
|
+
return this.client.request('POST', '/api/v1/delivery/route', input);
|
|
22
|
+
}
|
|
15
23
|
}
|
|
16
24
|
exports.DeliveryResource = DeliveryResource;
|
package/dist/types.d.ts
CHANGED
|
@@ -1965,6 +1965,35 @@ export type StructuredConfigEntry = ({
|
|
|
1965
1965
|
updatedAt: string;
|
|
1966
1966
|
};
|
|
1967
1967
|
export type DeliveryQuoteStatus = 'free' | 'paid' | 'national' | 'pickup_only' | 'out_of_coverage' | 'no_delivery' | 'needs_confirmation';
|
|
1968
|
+
export interface DeliveryRouteInput {
|
|
1969
|
+
/** Where the courier is now; default: the business. */
|
|
1970
|
+
from?: {
|
|
1971
|
+
lat: number;
|
|
1972
|
+
lng: number;
|
|
1973
|
+
};
|
|
1974
|
+
stops: Array<{
|
|
1975
|
+
lat: number;
|
|
1976
|
+
lng: number;
|
|
1977
|
+
}>;
|
|
1978
|
+
}
|
|
1979
|
+
/** The road through some stops. `order`: the stops' indexes as driven; `legs` the same way. */
|
|
1980
|
+
export interface DeliveryRoute {
|
|
1981
|
+
origin: {
|
|
1982
|
+
lat: number;
|
|
1983
|
+
lng: number;
|
|
1984
|
+
formatted: string;
|
|
1985
|
+
} | null;
|
|
1986
|
+
route: {
|
|
1987
|
+
distanceMeters: number;
|
|
1988
|
+
durationSeconds: number;
|
|
1989
|
+
polyline: string;
|
|
1990
|
+
order: number[];
|
|
1991
|
+
legs: Array<{
|
|
1992
|
+
distanceMeters: number;
|
|
1993
|
+
durationSeconds: number;
|
|
1994
|
+
}>;
|
|
1995
|
+
} | null;
|
|
1996
|
+
}
|
|
1968
1997
|
export interface DeliveryQuoteInput {
|
|
1969
1998
|
/** What the customer typed… */
|
|
1970
1999
|
address?: string;
|
|
@@ -2420,6 +2449,16 @@ export interface DirectOrderForm {
|
|
|
2420
2449
|
options: DirectPaymentOption[];
|
|
2421
2450
|
};
|
|
2422
2451
|
}
|
|
2452
|
+
/** AGF-CASH-REGISTER — a page of the cases sent between two instants, each with what its receipt says. */
|
|
2453
|
+
export interface CaseReportPage {
|
|
2454
|
+
items: Array<{
|
|
2455
|
+
case: CaseView;
|
|
2456
|
+
receipt: Pick<CaseReceipt, 'lines' | 'totalCents' | 'currency'> | null;
|
|
2457
|
+
}>;
|
|
2458
|
+
/** Pass it back as `cursor`; null: this was the last page. */
|
|
2459
|
+
nextCursor: string | null;
|
|
2460
|
+
timeZone: string;
|
|
2461
|
+
}
|
|
2423
2462
|
/** AGF-CASH-REGISTER — one payment method in a closing. */
|
|
2424
2463
|
export interface CaseClosingMethod {
|
|
2425
2464
|
/** The method's key; null when the payment has no account. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.52.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",
|