@agentforge-io/sdk-server 4.47.0 → 4.49.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/client.d.ts +3 -0
- package/dist/client.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/resources/reviews.d.ts +14 -0
- package/dist/resources/reviews.js +32 -0
- package/dist/types.d.ts +43 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { MarketplaceResource } from './resources/marketplace';
|
|
|
16
16
|
import { TenantConfigResource } from './resources/config';
|
|
17
17
|
import { PlacesResource } from './resources/places';
|
|
18
18
|
import { DeliveryResource } from './resources/delivery';
|
|
19
|
+
import { BusinessReviewsResource } from './resources/reviews';
|
|
19
20
|
import { CasesResource } from './resources/cases';
|
|
20
21
|
import { CatalogResource } from './resources/catalog';
|
|
21
22
|
import { BusinessRolesResource } from './resources/business-roles';
|
|
@@ -110,6 +111,8 @@ export declare class AgentForgeClient {
|
|
|
110
111
|
readonly delivery: DeliveryResource;
|
|
111
112
|
/** AGF-CASES — what customers came for in conversations (orders, bookings…). */
|
|
112
113
|
readonly cases: CasesResource;
|
|
114
|
+
/** AGF-BUSINESS-REVIEWS — customers' reviews of this business. */
|
|
115
|
+
readonly reviews: BusinessReviewsResource;
|
|
113
116
|
readonly businessRoles: BusinessRolesResource;
|
|
114
117
|
readonly catalog: CatalogResource;
|
|
115
118
|
constructor(opts: AgentForgeClientOptions);
|
package/dist/client.js
CHANGED
|
@@ -38,6 +38,7 @@ const marketplace_1 = require("./resources/marketplace");
|
|
|
38
38
|
const config_1 = require("./resources/config");
|
|
39
39
|
const places_1 = require("./resources/places");
|
|
40
40
|
const delivery_1 = require("./resources/delivery");
|
|
41
|
+
const reviews_1 = require("./resources/reviews");
|
|
41
42
|
const cases_1 = require("./resources/cases");
|
|
42
43
|
const catalog_1 = require("./resources/catalog");
|
|
43
44
|
const business_roles_1 = require("./resources/business-roles");
|
|
@@ -88,6 +89,7 @@ class AgentForgeClient {
|
|
|
88
89
|
this.places = new places_1.PlacesResource(this);
|
|
89
90
|
this.delivery = new delivery_1.DeliveryResource(this);
|
|
90
91
|
this.cases = new cases_1.CasesResource(this);
|
|
92
|
+
this.reviews = new reviews_1.BusinessReviewsResource(this);
|
|
91
93
|
this.businessRoles = new business_roles_1.BusinessRolesResource(this);
|
|
92
94
|
this.catalog = new catalog_1.CatalogResource(this);
|
|
93
95
|
}
|
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, CaseStateStep, CreateDirectOrderInput, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogBookingRule, CaseOrigin, CaseOriginChannel, 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';
|
|
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, 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';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentForgeClient } from '../client';
|
|
2
|
+
import type { BusinessReview, BusinessReviewsPage, ListTemplateReviewsInput, SaveTemplateReviewInput } from '../types';
|
|
3
|
+
export declare class BusinessReviewsResource {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: AgentForgeClient);
|
|
6
|
+
/** `GET /api/v1/reviews` — visible reviews + summary; with `externalUserId`, `mine` and `canReview`. */
|
|
7
|
+
list(input?: ListTemplateReviewsInput): Promise<BusinessReviewsPage>;
|
|
8
|
+
/** `PUT /api/v1/reviews/mine` — create or edit. 403 `no_order` before a received order, 400 on bad input. */
|
|
9
|
+
save(input: SaveTemplateReviewInput): Promise<BusinessReview>;
|
|
10
|
+
/** `DELETE /api/v1/reviews/mine` — no error when there was none. */
|
|
11
|
+
remove(input: {
|
|
12
|
+
externalUserId: string;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// reviews resource (AGF-BUSINESS-REVIEWS) — customers' reviews of the
|
|
3
|
+
// credential's business (its tenant). Anyone the App shows them to reads them;
|
|
4
|
+
// a customer (`externalUserId`) writes one, once they received an order from it.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BusinessReviewsResource = void 0;
|
|
7
|
+
class BusinessReviewsResource {
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/** `GET /api/v1/reviews` — visible reviews + summary; with `externalUserId`, `mine` and `canReview`. */
|
|
12
|
+
async list(input = {}) {
|
|
13
|
+
const qs = new URLSearchParams();
|
|
14
|
+
if (input.externalUserId)
|
|
15
|
+
qs.set('externalUserId', input.externalUserId);
|
|
16
|
+
if (input.cursor)
|
|
17
|
+
qs.set('cursor', input.cursor);
|
|
18
|
+
if (input.limit !== undefined)
|
|
19
|
+
qs.set('limit', String(input.limit));
|
|
20
|
+
const query = qs.toString();
|
|
21
|
+
return this.client.request('GET', `/api/v1/reviews${query ? `?${query}` : ''}`);
|
|
22
|
+
}
|
|
23
|
+
/** `PUT /api/v1/reviews/mine` — create or edit. 403 `no_order` before a received order, 400 on bad input. */
|
|
24
|
+
async save(input) {
|
|
25
|
+
return this.client.request('PUT', '/api/v1/reviews/mine', input);
|
|
26
|
+
}
|
|
27
|
+
/** `DELETE /api/v1/reviews/mine` — no error when there was none. */
|
|
28
|
+
async remove(input) {
|
|
29
|
+
await this.client.request('DELETE', `/api/v1/reviews/mine?externalUserId=${encodeURIComponent(input.externalUserId)}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.BusinessReviewsResource = BusinessReviewsResource;
|
package/dist/types.d.ts
CHANGED
|
@@ -961,6 +961,19 @@ export interface SaveTemplateReviewInput {
|
|
|
961
961
|
/** https photo. */
|
|
962
962
|
reviewerAvatarUrl?: string | null;
|
|
963
963
|
}
|
|
964
|
+
/** AGF-BUSINESS-REVIEWS. A customer's review of a business (one per customer, editable). */
|
|
965
|
+
export type BusinessReview = Omit<TemplateReview, 'version'>;
|
|
966
|
+
/** `GET /api/v1/reviews`. */
|
|
967
|
+
export interface BusinessReviewsPage {
|
|
968
|
+
/** Visible reviews, newest first. */
|
|
969
|
+
items: BusinessReview[];
|
|
970
|
+
/** The `externalUserId`'s own review (also when hidden), or null. */
|
|
971
|
+
mine: BusinessReview | null;
|
|
972
|
+
/** With `externalUserId`: they received an order from the business, so they may write one. */
|
|
973
|
+
canReview?: boolean;
|
|
974
|
+
summary: TemplateRatingSummary;
|
|
975
|
+
nextCursor: string | null;
|
|
976
|
+
}
|
|
964
977
|
/** AGF-PDK-TEMPLATE-PAGE. What kind of problem a report is about. */
|
|
965
978
|
export type TemplateReportKind = 'bug' | 'inappropriate' | 'misleading' | 'other';
|
|
966
979
|
/** `POST /api/v1/templates/:id/reports` — private to the author and admins. 429 past 10 a day. */
|
|
@@ -1171,7 +1184,10 @@ export interface UpdateCatalogProductInput extends Partial<CreateCatalogProductI
|
|
|
1171
1184
|
export interface CatalogBookingRule {
|
|
1172
1185
|
durationMinutes: number;
|
|
1173
1186
|
bufferMinutes?: number;
|
|
1187
|
+
/** AGF-DELIVERY D0 — where it is performed; left out: at the business. */
|
|
1188
|
+
attendedAt?: CatalogAttendedAt;
|
|
1174
1189
|
}
|
|
1190
|
+
export type CatalogAttendedAt = 'business' | 'customer' | 'both';
|
|
1175
1191
|
/** AGF-UNITS U2 — how a product is sold. */
|
|
1176
1192
|
export interface CatalogSaleRule {
|
|
1177
1193
|
by: 'unit' | 'measure';
|
|
@@ -2023,6 +2039,22 @@ export interface CaseStateStep {
|
|
|
2023
2039
|
/** Who moved it; null when only the case itself tells (older cases, a move just made). */
|
|
2024
2040
|
by: 'assistant' | 'business' | 'system' | 'customer' | null;
|
|
2025
2041
|
}
|
|
2042
|
+
/**
|
|
2043
|
+
* AGF-DELIVERY D0 — where an order is taken or a service performed. `lat`/`lng` are
|
|
2044
|
+
* null for an address nobody located. `quote` is what the delivery costs the
|
|
2045
|
+
* customer: the receipt shows it apart and adds it to the total (`CaseReceipt.delivery`).
|
|
2046
|
+
*/
|
|
2047
|
+
export interface CaseDestination {
|
|
2048
|
+
address: string;
|
|
2049
|
+
lat?: number | null;
|
|
2050
|
+
lng?: number | null;
|
|
2051
|
+
placeId?: string;
|
|
2052
|
+
distanceKm?: number;
|
|
2053
|
+
quote?: {
|
|
2054
|
+
feeCents: number;
|
|
2055
|
+
currency: string;
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2026
2058
|
export interface CaseView {
|
|
2027
2059
|
id: string;
|
|
2028
2060
|
/** Per workspace, sequential (ordering). People read `code`. */
|
|
@@ -2094,6 +2126,8 @@ export interface CaseView {
|
|
|
2094
2126
|
slot: (CaseSlot & {
|
|
2095
2127
|
label: string;
|
|
2096
2128
|
}) | null;
|
|
2129
|
+
/** AGF-DELIVERY D0 — where it is taken or performed (absent on an older platform). */
|
|
2130
|
+
destination?: CaseDestination | null;
|
|
2097
2131
|
openedAt: string;
|
|
2098
2132
|
reviewedAt: string | null;
|
|
2099
2133
|
submittedAt: string | null;
|
|
@@ -2238,6 +2272,11 @@ export interface CaseReceipt {
|
|
|
2238
2272
|
issuedAt: string;
|
|
2239
2273
|
lines: CaseReceiptLine[];
|
|
2240
2274
|
/** Σ of the lines; null when a line has no fixed price or there are no lines. */
|
|
2275
|
+
/** The delivery the total includes (0: free); absent when there is none. */
|
|
2276
|
+
delivery?: {
|
|
2277
|
+
feeCents: number;
|
|
2278
|
+
distanceKm?: number;
|
|
2279
|
+
};
|
|
2241
2280
|
totalCents: number | null;
|
|
2242
2281
|
currency: string | null;
|
|
2243
2282
|
fields: Array<{
|
|
@@ -2343,6 +2382,8 @@ export interface CreateDirectOrderInput {
|
|
|
2343
2382
|
accountId: string;
|
|
2344
2383
|
cashTenderedCents?: number;
|
|
2345
2384
|
};
|
|
2385
|
+
/** AGF-DELIVERY D0 — where it is taken, set by your server. Not with `place`. */
|
|
2386
|
+
destination?: CaseDestination;
|
|
2346
2387
|
}
|
|
2347
2388
|
/** A payment method a checkout offers (no account data — that is on the receipt once the order is sent). */
|
|
2348
2389
|
export interface DirectPaymentOption {
|
|
@@ -2433,6 +2474,8 @@ export interface CreateDirectBookingInput {
|
|
|
2433
2474
|
conversationId?: string;
|
|
2434
2475
|
/** Same key → same booking. 8–80 of [A-Za-z0-9_.:-]. */
|
|
2435
2476
|
idempotencyKey: string;
|
|
2477
|
+
/** AGF-DELIVERY D0 — where it is performed: required for a service `attendedAt: 'customer'`, refused for one at the business. */
|
|
2478
|
+
destination?: CaseDestination;
|
|
2436
2479
|
}
|
|
2437
2480
|
/** `POST /api/v1/cases/:id/slot` — the new time (you already hold it), optionally another member. */
|
|
2438
2481
|
export interface MoveCaseSlotInput {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.49.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",
|