@agentforge-io/sdk-server 4.31.0 → 4.33.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/chat.d.ts +2 -0
- package/dist/resources/places.d.ts +14 -2
- package/dist/resources/places.js +40 -1
- package/dist/types.d.ts +75 -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, 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, SearchPlacesInput, 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, 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, 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';
|
package/dist/resources/chat.d.ts
CHANGED
|
@@ -71,6 +71,8 @@ export interface AppCallerClaims {
|
|
|
71
71
|
/** Where the person is, in the App's words — e.g. the reference of a
|
|
72
72
|
* scanned QR code (`mesa-03`). */
|
|
73
73
|
location?: string;
|
|
74
|
+
/** The delivery address the person chose in the App; the assistant offers it instead of asking (AGF-CUSTOMER-WHERE). */
|
|
75
|
+
deliveryAddress?: string;
|
|
74
76
|
}
|
|
75
77
|
export declare class ChatResource {
|
|
76
78
|
private readonly client;
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import type { AgentForgeClient } from '../client';
|
|
2
|
-
import type { Place, SearchPlacesInput } from '../types';
|
|
2
|
+
import type { AutocompletePlacesInput, Place, PlaceSuggestion, PlacesScope, SearchPlacesInput } from '../types';
|
|
3
3
|
export declare class PlacesResource {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor(client: AgentForgeClient);
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* `GET /api/v1/places/autocomplete` — suggestions while the customer types
|
|
8
|
+
* (AGF-GEO-GOOGLE). Pick one with `details` and the same `sessionToken`.
|
|
9
|
+
*/
|
|
10
|
+
autocomplete(input: AutocompletePlacesInput): Promise<PlaceSuggestion[]>;
|
|
11
|
+
/** `GET /api/v1/places/scope` — where this business's customers' addresses are searched (AGF-GEO-SCOPE). */
|
|
12
|
+
scope(): Promise<PlacesScope>;
|
|
13
|
+
/** `GET /api/v1/places/details/:placeId` — the picked suggestion with its point; null when the id is unknown. */
|
|
14
|
+
details(placeId: string, opts?: {
|
|
15
|
+
sessionToken?: string;
|
|
16
|
+
language?: string;
|
|
17
|
+
}): Promise<Place | null>;
|
|
18
|
+
/** `GET /api/v1/places/search` — places matching a free text (geocoding), with their points. */
|
|
7
19
|
search(input: SearchPlacesInput): Promise<Place[]>;
|
|
8
20
|
/** `GET /api/v1/places/reverse` — the place at a dropped pin (its coordinates are kept). */
|
|
9
21
|
reverse(lat: number, lng: number, opts?: {
|
package/dist/resources/places.js
CHANGED
|
@@ -8,7 +8,46 @@ class PlacesResource {
|
|
|
8
8
|
constructor(client) {
|
|
9
9
|
this.client = client;
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* `GET /api/v1/places/autocomplete` — suggestions while the customer types
|
|
13
|
+
* (AGF-GEO-GOOGLE). Pick one with `details` and the same `sessionToken`.
|
|
14
|
+
*/
|
|
15
|
+
async autocomplete(input) {
|
|
16
|
+
const qs = new URLSearchParams({ q: input.q });
|
|
17
|
+
if (input.sessionToken)
|
|
18
|
+
qs.set('sessionToken', input.sessionToken);
|
|
19
|
+
if (input.near)
|
|
20
|
+
qs.set('near', `${input.near.lat},${input.near.lng}`);
|
|
21
|
+
if (input.language)
|
|
22
|
+
qs.set('language', input.language);
|
|
23
|
+
if (input.area)
|
|
24
|
+
qs.set('area', input.area);
|
|
25
|
+
const res = await this.client.request('GET', `/api/v1/places/autocomplete?${qs.toString()}`);
|
|
26
|
+
return res.items;
|
|
27
|
+
}
|
|
28
|
+
/** `GET /api/v1/places/scope` — where this business's customers' addresses are searched (AGF-GEO-SCOPE). */
|
|
29
|
+
async scope() {
|
|
30
|
+
return this.client.request('GET', '/api/v1/places/scope');
|
|
31
|
+
}
|
|
32
|
+
/** `GET /api/v1/places/details/:placeId` — the picked suggestion with its point; null when the id is unknown. */
|
|
33
|
+
async details(placeId, opts = {}) {
|
|
34
|
+
const qs = new URLSearchParams();
|
|
35
|
+
if (opts.sessionToken)
|
|
36
|
+
qs.set('sessionToken', opts.sessionToken);
|
|
37
|
+
if (opts.language)
|
|
38
|
+
qs.set('language', opts.language);
|
|
39
|
+
const tail = qs.toString() ? `?${qs.toString()}` : '';
|
|
40
|
+
try {
|
|
41
|
+
const res = await this.client.request('GET', `/api/v1/places/details/${encodeURIComponent(placeId)}${tail}`);
|
|
42
|
+
return res.place;
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
if (e.status === 404)
|
|
46
|
+
return null;
|
|
47
|
+
throw e;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** `GET /api/v1/places/search` — places matching a free text (geocoding), with their points. */
|
|
12
51
|
async search(input) {
|
|
13
52
|
const qs = new URLSearchParams({ q: input.q });
|
|
14
53
|
if (input.proximity)
|
package/dist/types.d.ts
CHANGED
|
@@ -1421,6 +1421,64 @@ export interface SearchPlacesInput {
|
|
|
1421
1421
|
/** 1–10, default 5. */
|
|
1422
1422
|
limit?: number;
|
|
1423
1423
|
}
|
|
1424
|
+
/**
|
|
1425
|
+
* A suggestion while the customer types (`places.autocomplete`, AGF-GEO-GOOGLE):
|
|
1426
|
+
* no coordinates until it is picked with `places.details`.
|
|
1427
|
+
*/
|
|
1428
|
+
export interface PlaceSuggestion {
|
|
1429
|
+
placeId: string;
|
|
1430
|
+
/** The whole suggestion ("Calle 45 #13-31, Bogotá, Colombia"). */
|
|
1431
|
+
text: string;
|
|
1432
|
+
/** First line ("Calle 45 #13-31"). */
|
|
1433
|
+
main?: string;
|
|
1434
|
+
/** The rest ("Bogotá, Colombia"). */
|
|
1435
|
+
secondary?: string;
|
|
1436
|
+
}
|
|
1437
|
+
export interface AutocompletePlacesInput {
|
|
1438
|
+
/** 3–200 characters. */
|
|
1439
|
+
q: string;
|
|
1440
|
+
/**
|
|
1441
|
+
* A UUID the App creates when the customer starts typing and passes to every
|
|
1442
|
+
* call and to the `details` call that ends it (the provider bills the
|
|
1443
|
+
* session, not each keystroke). A new one per address search.
|
|
1444
|
+
*/
|
|
1445
|
+
sessionToken?: string;
|
|
1446
|
+
/** Suggestions near this point first; default: the business's own address. */
|
|
1447
|
+
near?: {
|
|
1448
|
+
lat: number;
|
|
1449
|
+
lng: number;
|
|
1450
|
+
};
|
|
1451
|
+
language?: string;
|
|
1452
|
+
/**
|
|
1453
|
+
* AGF-GEO-SCOPE: 'local' (default) = only inside the business's area (see
|
|
1454
|
+
* `places.scope()`); 'country' = all of it, nearest to the business first —
|
|
1455
|
+
* for the owner setting the address itself, or a customer of a business
|
|
1456
|
+
* that ships nationally (`scope.canWiden`).
|
|
1457
|
+
*/
|
|
1458
|
+
area?: 'local' | 'country';
|
|
1459
|
+
}
|
|
1460
|
+
/** Where a business's customers' addresses are searched (`places.scope()`, AGF-GEO-SCOPE). */
|
|
1461
|
+
export interface PlacesScope {
|
|
1462
|
+
/** The business address: the center of every search. */
|
|
1463
|
+
origin?: {
|
|
1464
|
+
lat: number;
|
|
1465
|
+
lng: number;
|
|
1466
|
+
};
|
|
1467
|
+
/** The business address as text: where a pickup is. */
|
|
1468
|
+
address?: string;
|
|
1469
|
+
city?: string;
|
|
1470
|
+
/** Department / state. */
|
|
1471
|
+
region?: string;
|
|
1472
|
+
country?: string;
|
|
1473
|
+
/** Searches stay within this distance of the origin; null = the whole country. */
|
|
1474
|
+
areaKm: number | null;
|
|
1475
|
+
/** It delivers locally (up to its radius). */
|
|
1476
|
+
local: boolean;
|
|
1477
|
+
/** It ships anywhere in the country. */
|
|
1478
|
+
national: boolean;
|
|
1479
|
+
/** A customer may search outside the area (`area: 'country'`). */
|
|
1480
|
+
canWiden: boolean;
|
|
1481
|
+
}
|
|
1424
1482
|
/** A geocoded address: a confirmed pin, never static text. */
|
|
1425
1483
|
export interface AddressValue {
|
|
1426
1484
|
formatted: string;
|
|
@@ -1429,6 +1487,14 @@ export interface AddressValue {
|
|
|
1429
1487
|
placeId?: string;
|
|
1430
1488
|
components?: Place['components'];
|
|
1431
1489
|
notes?: string;
|
|
1490
|
+
/**
|
|
1491
|
+
* Whose point this is (AGF-GEO-GOOGLE D2): 'google' = as `places.details`
|
|
1492
|
+
* gave it (requires `placeId`; the platform refreshes it before the
|
|
1493
|
+
* provider's 30-day limit); 'pin' = the owner moved or confirmed the pin.
|
|
1494
|
+
*/
|
|
1495
|
+
source?: 'google' | 'pin';
|
|
1496
|
+
/** ISO time the point was taken from the provider (set by the platform for 'google'). */
|
|
1497
|
+
geocodedAt?: string;
|
|
1432
1498
|
}
|
|
1433
1499
|
export type DeliveryLocalPricing = {
|
|
1434
1500
|
kind: 'fixed';
|
|
@@ -1670,6 +1736,8 @@ export interface CaseView {
|
|
|
1670
1736
|
customerName: string | null;
|
|
1671
1737
|
/** AGF-ORDER-WITHOUT-AI — the phone given at checkout (orders placed without the chat). */
|
|
1672
1738
|
customerPhone: string | null;
|
|
1739
|
+
/** Where in the business the customer ordered from («Mesa 2», a scanned code). */
|
|
1740
|
+
customerPlace?: string | null;
|
|
1673
1741
|
/** The road the business walks it: sent, accepted, the type's own phases, completed. */
|
|
1674
1742
|
path: Array<{
|
|
1675
1743
|
key: string;
|
|
@@ -1836,7 +1904,13 @@ export interface CaseReceipt {
|
|
|
1836
1904
|
* checkout on the host App. Created already sent (holds, receipt, `case.submitted`).
|
|
1837
1905
|
*/
|
|
1838
1906
|
export interface CreateDirectOrderInput {
|
|
1839
|
-
/** Who orders: the App's visitor id, and the name and phone they gave (both required). */
|
|
1907
|
+
/** Who orders: the App's visitor id, and the name and phone they gave (both required unless `place`). */
|
|
1908
|
+
/**
|
|
1909
|
+
* AGF-CUSTOMER-WHERE: where in the business the customer is («Mesa 2»),
|
|
1910
|
+
* from a code your server resolved — never text the customer typed. With
|
|
1911
|
+
* it, `customer.name` and `customer.phone` may be '' (optional at a table).
|
|
1912
|
+
*/
|
|
1913
|
+
place?: string;
|
|
1840
1914
|
customer: {
|
|
1841
1915
|
ref: string;
|
|
1842
1916
|
name: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.33.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",
|