@agentforge-io/sdk-server 4.31.0 → 4.32.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/places.d.ts +12 -2
- package/dist/resources/places.js +34 -1
- package/dist/types.d.ts +37 -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, 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, 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';
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import type { AgentForgeClient } from '../client';
|
|
2
|
-
import type { Place, SearchPlacesInput } from '../types';
|
|
2
|
+
import type { AutocompletePlacesInput, Place, PlaceSuggestion, 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/details/:placeId` — the picked suggestion with its point; null when the id is unknown. */
|
|
12
|
+
details(placeId: string, opts?: {
|
|
13
|
+
sessionToken?: string;
|
|
14
|
+
language?: string;
|
|
15
|
+
}): Promise<Place | null>;
|
|
16
|
+
/** `GET /api/v1/places/search` — places matching a free text (geocoding), with their points. */
|
|
7
17
|
search(input: SearchPlacesInput): Promise<Place[]>;
|
|
8
18
|
/** `GET /api/v1/places/reverse` — the place at a dropped pin (its coordinates are kept). */
|
|
9
19
|
reverse(lat: number, lng: number, opts?: {
|
package/dist/resources/places.js
CHANGED
|
@@ -8,7 +8,40 @@ 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
|
+
const res = await this.client.request('GET', `/api/v1/places/autocomplete?${qs.toString()}`);
|
|
24
|
+
return res.items;
|
|
25
|
+
}
|
|
26
|
+
/** `GET /api/v1/places/details/:placeId` — the picked suggestion with its point; null when the id is unknown. */
|
|
27
|
+
async details(placeId, opts = {}) {
|
|
28
|
+
const qs = new URLSearchParams();
|
|
29
|
+
if (opts.sessionToken)
|
|
30
|
+
qs.set('sessionToken', opts.sessionToken);
|
|
31
|
+
if (opts.language)
|
|
32
|
+
qs.set('language', opts.language);
|
|
33
|
+
const tail = qs.toString() ? `?${qs.toString()}` : '';
|
|
34
|
+
try {
|
|
35
|
+
const res = await this.client.request('GET', `/api/v1/places/details/${encodeURIComponent(placeId)}${tail}`);
|
|
36
|
+
return res.place;
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
if (e.status === 404)
|
|
40
|
+
return null;
|
|
41
|
+
throw e;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** `GET /api/v1/places/search` — places matching a free text (geocoding), with their points. */
|
|
12
45
|
async search(input) {
|
|
13
46
|
const qs = new URLSearchParams({ q: input.q });
|
|
14
47
|
if (input.proximity)
|
package/dist/types.d.ts
CHANGED
|
@@ -1421,6 +1421,35 @@ 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
|
+
}
|
|
1424
1453
|
/** A geocoded address: a confirmed pin, never static text. */
|
|
1425
1454
|
export interface AddressValue {
|
|
1426
1455
|
formatted: string;
|
|
@@ -1429,6 +1458,14 @@ export interface AddressValue {
|
|
|
1429
1458
|
placeId?: string;
|
|
1430
1459
|
components?: Place['components'];
|
|
1431
1460
|
notes?: string;
|
|
1461
|
+
/**
|
|
1462
|
+
* Whose point this is (AGF-GEO-GOOGLE D2): 'google' = as `places.details`
|
|
1463
|
+
* gave it (requires `placeId`; the platform refreshes it before the
|
|
1464
|
+
* provider's 30-day limit); 'pin' = the owner moved or confirmed the pin.
|
|
1465
|
+
*/
|
|
1466
|
+
source?: 'google' | 'pin';
|
|
1467
|
+
/** ISO time the point was taken from the provider (set by the platform for 'google'). */
|
|
1468
|
+
geocodedAt?: string;
|
|
1432
1469
|
}
|
|
1433
1470
|
export type DeliveryLocalPricing = {
|
|
1434
1471
|
kind: 'fixed';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.32.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",
|