@agentforge-io/sdk-server 4.19.0 → 4.20.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 +4 -0
- package/dist/client.js +4 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -1
- package/dist/resources/config.d.ts +11 -1
- package/dist/resources/config.js +19 -0
- package/dist/resources/delivery.d.ts +8 -0
- package/dist/resources/delivery.js +16 -0
- package/dist/resources/places.d.ts +12 -0
- package/dist/resources/places.js +34 -0
- package/dist/types.d.ts +138 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ import { TeamsResource } from './resources/teams';
|
|
|
11
11
|
import { TemplatesResource } from './resources/templates';
|
|
12
12
|
import { MarketplaceResource } from './resources/marketplace';
|
|
13
13
|
import { TenantConfigResource } from './resources/config';
|
|
14
|
+
import { PlacesResource } from './resources/places';
|
|
15
|
+
import { DeliveryResource } from './resources/delivery';
|
|
14
16
|
import { CatalogResource } from './resources/catalog';
|
|
15
17
|
import { BusinessRolesResource } from './resources/business-roles';
|
|
16
18
|
import { ToolsResource } from './resources/tools';
|
|
@@ -94,6 +96,8 @@ export declare class AgentForgeClient {
|
|
|
94
96
|
readonly templates: TemplatesResource;
|
|
95
97
|
readonly marketplace: MarketplaceResource;
|
|
96
98
|
readonly config: TenantConfigResource;
|
|
99
|
+
readonly places: PlacesResource;
|
|
100
|
+
readonly delivery: DeliveryResource;
|
|
97
101
|
readonly businessRoles: BusinessRolesResource;
|
|
98
102
|
readonly catalog: CatalogResource;
|
|
99
103
|
constructor(opts: AgentForgeClientOptions);
|
package/dist/client.js
CHANGED
|
@@ -33,6 +33,8 @@ const teams_1 = require("./resources/teams");
|
|
|
33
33
|
const templates_1 = require("./resources/templates");
|
|
34
34
|
const marketplace_1 = require("./resources/marketplace");
|
|
35
35
|
const config_1 = require("./resources/config");
|
|
36
|
+
const places_1 = require("./resources/places");
|
|
37
|
+
const delivery_1 = require("./resources/delivery");
|
|
36
38
|
const catalog_1 = require("./resources/catalog");
|
|
37
39
|
const business_roles_1 = require("./resources/business-roles");
|
|
38
40
|
const tools_1 = require("./resources/tools");
|
|
@@ -76,6 +78,8 @@ class AgentForgeClient {
|
|
|
76
78
|
this.templates = new templates_1.TemplatesResource(this);
|
|
77
79
|
this.marketplace = new marketplace_1.MarketplaceResource(this);
|
|
78
80
|
this.config = new config_1.TenantConfigResource(this);
|
|
81
|
+
this.places = new places_1.PlacesResource(this);
|
|
82
|
+
this.delivery = new delivery_1.DeliveryResource(this);
|
|
79
83
|
this.businessRoles = new business_roles_1.BusinessRolesResource(this);
|
|
80
84
|
this.catalog = new catalog_1.CatalogResource(this);
|
|
81
85
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { AgentForgeClient, INSTALLED_TENANT_HEADER } from './client';
|
|
|
2
2
|
export type { AgentForgeClientOptions, RequestOptions } from './client';
|
|
3
3
|
export { AgentForgeError, AgentForgeAuthError, AgentForgeNotFoundError, AgentForgeNetworkError, } from './errors';
|
|
4
4
|
export { TOOL_CALLBACK_HEADERS, ToolCallbackSignatureError, signToolCallbackPayload, verifyToolCallbackSignature, } from './webhooks';
|
|
5
|
-
export type { 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, 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';
|
|
5
|
+
export type { 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, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, 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
6
|
export { AgentsResource } from './resources/agents';
|
|
7
7
|
export { AnalyticsResource } from './resources/analytics';
|
|
8
8
|
export type { GetSupportKpisInput, GetAgentAttentionLogInput, } from './resources/analytics';
|
|
@@ -19,6 +19,8 @@ export type { ListTemplatesInput } from './resources/templates';
|
|
|
19
19
|
export { MarketplaceResource } from './resources/marketplace';
|
|
20
20
|
export type { ListMarketplaceCategoriesInput } from './resources/marketplace';
|
|
21
21
|
export { TenantConfigResource } from './resources/config';
|
|
22
|
+
export { PlacesResource } from './resources/places';
|
|
23
|
+
export { DeliveryResource } from './resources/delivery';
|
|
22
24
|
export { BusinessRolesResource } from './resources/business-roles';
|
|
23
25
|
export { CatalogResource, CatalogCategoriesResource, CatalogProductsResource, CatalogPhotosResource, CatalogImportResource, CatalogFileImportResource, CatalogSourcesResource, AgentForgeCatalogImportLimitError, CATALOG_IMPORT_MAX_ITEMS, } from './resources/catalog';
|
|
24
26
|
export type { ListThreadsOptions, SendMessageInput, AssignThreadInput, UnassignThreadInput, SetThreadModeInput, CloseThreadInput, } from './resources/inbox';
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
// const payload = af.tools.verifyCallback({ rawBody, signatureHeader, secretPlaintext });
|
|
29
29
|
// await af.tools.respondToCallback({ resultUrl: payload.resultUrl, tenantId: payload.tenantId, secret, result });
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.ToolsResource = exports.TeamsResource = exports.SecretsResource = exports.ProvisioningResource = exports.CATALOG_IMPORT_MAX_ITEMS = exports.AgentForgeCatalogImportLimitError = exports.CatalogSourcesResource = exports.CatalogFileImportResource = exports.CatalogImportResource = exports.CatalogPhotosResource = exports.CatalogProductsResource = exports.CatalogCategoriesResource = exports.CatalogResource = exports.BusinessRolesResource = exports.TenantConfigResource = exports.MarketplaceResource = exports.TemplatesResource = exports.InstallationsResource = exports.InboxResource = exports.parseGoogleSheetsPickerResult = exports.ConnectorsResource = exports.ChatResource = exports.AppsResource = exports.AnalyticsResource = exports.AgentsResource = exports.verifyToolCallbackSignature = exports.signToolCallbackPayload = exports.ToolCallbackSignatureError = exports.TOOL_CALLBACK_HEADERS = exports.AgentForgeNetworkError = exports.AgentForgeNotFoundError = exports.AgentForgeAuthError = exports.AgentForgeError = exports.INSTALLED_TENANT_HEADER = exports.AgentForgeClient = void 0;
|
|
31
|
+
exports.ToolsResource = exports.TeamsResource = exports.SecretsResource = exports.ProvisioningResource = exports.CATALOG_IMPORT_MAX_ITEMS = exports.AgentForgeCatalogImportLimitError = exports.CatalogSourcesResource = exports.CatalogFileImportResource = exports.CatalogImportResource = exports.CatalogPhotosResource = exports.CatalogProductsResource = exports.CatalogCategoriesResource = exports.CatalogResource = exports.BusinessRolesResource = exports.DeliveryResource = exports.PlacesResource = exports.TenantConfigResource = exports.MarketplaceResource = exports.TemplatesResource = exports.InstallationsResource = exports.InboxResource = exports.parseGoogleSheetsPickerResult = exports.ConnectorsResource = exports.ChatResource = exports.AppsResource = exports.AnalyticsResource = exports.AgentsResource = exports.verifyToolCallbackSignature = exports.signToolCallbackPayload = exports.ToolCallbackSignatureError = exports.TOOL_CALLBACK_HEADERS = exports.AgentForgeNetworkError = exports.AgentForgeNotFoundError = exports.AgentForgeAuthError = exports.AgentForgeError = exports.INSTALLED_TENANT_HEADER = exports.AgentForgeClient = void 0;
|
|
32
32
|
var client_1 = require("./client");
|
|
33
33
|
Object.defineProperty(exports, "AgentForgeClient", { enumerable: true, get: function () { return client_1.AgentForgeClient; } });
|
|
34
34
|
Object.defineProperty(exports, "INSTALLED_TENANT_HEADER", { enumerable: true, get: function () { return client_1.INSTALLED_TENANT_HEADER; } });
|
|
@@ -63,6 +63,10 @@ var marketplace_1 = require("./resources/marketplace");
|
|
|
63
63
|
Object.defineProperty(exports, "MarketplaceResource", { enumerable: true, get: function () { return marketplace_1.MarketplaceResource; } });
|
|
64
64
|
var config_1 = require("./resources/config");
|
|
65
65
|
Object.defineProperty(exports, "TenantConfigResource", { enumerable: true, get: function () { return config_1.TenantConfigResource; } });
|
|
66
|
+
var places_1 = require("./resources/places");
|
|
67
|
+
Object.defineProperty(exports, "PlacesResource", { enumerable: true, get: function () { return places_1.PlacesResource; } });
|
|
68
|
+
var delivery_1 = require("./resources/delivery");
|
|
69
|
+
Object.defineProperty(exports, "DeliveryResource", { enumerable: true, get: function () { return delivery_1.DeliveryResource; } });
|
|
66
70
|
var business_roles_1 = require("./resources/business-roles");
|
|
67
71
|
Object.defineProperty(exports, "BusinessRolesResource", { enumerable: true, get: function () { return business_roles_1.BusinessRolesResource; } });
|
|
68
72
|
var catalog_1 = require("./resources/catalog");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentForgeClient } from '../client';
|
|
2
|
-
import type { TenantConfigEntry } from '../types';
|
|
2
|
+
import type { StructuredConfigEntry, StructuredConfigInput, TenantConfigEntry } from '../types';
|
|
3
3
|
export declare class TenantConfigResource {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor(client: AgentForgeClient);
|
|
@@ -8,4 +8,14 @@ export declare class TenantConfigResource {
|
|
|
8
8
|
/** `PUT /api/v1/config/:key` — set one variable (created when missing).
|
|
9
9
|
* 409 when the key is a secret, not a config variable. */
|
|
10
10
|
set(key: string, value: string): Promise<TenantConfigEntry>;
|
|
11
|
+
/**
|
|
12
|
+
* AGF-PDK-DELIVERY — fields of a structured type (`address`, `delivery`,
|
|
13
|
+
* `payments`). The variable of the same key holds their readable text.
|
|
14
|
+
*/
|
|
15
|
+
readonly structured: {
|
|
16
|
+
/** `GET /api/v1/config/:key/structured` — null when not set. */
|
|
17
|
+
get: (key: string) => Promise<StructuredConfigEntry | null>;
|
|
18
|
+
/** `PUT /api/v1/config/:key/structured` — validated by type; 400 with the reason otherwise. */
|
|
19
|
+
set: (key: string, input: StructuredConfigInput) => Promise<StructuredConfigEntry>;
|
|
20
|
+
};
|
|
11
21
|
}
|
package/dist/resources/config.js
CHANGED
|
@@ -8,6 +8,25 @@ exports.TenantConfigResource = void 0;
|
|
|
8
8
|
class TenantConfigResource {
|
|
9
9
|
constructor(client) {
|
|
10
10
|
this.client = client;
|
|
11
|
+
/**
|
|
12
|
+
* AGF-PDK-DELIVERY — fields of a structured type (`address`, `delivery`,
|
|
13
|
+
* `payments`). The variable of the same key holds their readable text.
|
|
14
|
+
*/
|
|
15
|
+
this.structured = {
|
|
16
|
+
/** `GET /api/v1/config/:key/structured` — null when not set. */
|
|
17
|
+
get: async (key) => {
|
|
18
|
+
try {
|
|
19
|
+
return await this.client.request('GET', `/api/v1/config/${encodeURIComponent(key)}/structured`);
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
if (e.status === 404)
|
|
23
|
+
return null;
|
|
24
|
+
throw e;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
/** `PUT /api/v1/config/:key/structured` — validated by type; 400 with the reason otherwise. */
|
|
28
|
+
set: (key, input) => this.client.request('PUT', `/api/v1/config/${encodeURIComponent(key)}/structured`, input),
|
|
29
|
+
};
|
|
11
30
|
}
|
|
12
31
|
/** `GET /api/v1/config` — config variables that have a value. */
|
|
13
32
|
async list() {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentForgeClient } from '../client';
|
|
2
|
+
import type { DeliveryQuote, DeliveryQuoteInput } from '../types';
|
|
3
|
+
export declare class DeliveryResource {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: AgentForgeClient);
|
|
6
|
+
/** `POST /api/v1/delivery/quote` — 404 when the workspace has no delivery settings. */
|
|
7
|
+
quote(input: DeliveryQuoteInput): Promise<DeliveryQuote>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// delivery resource (AGF-PDK-DELIVERY) — quote a delivery to an address with
|
|
3
|
+
// the workspace's delivery settings (`config.structured`, type 'delivery').
|
|
4
|
+
// The same quote the assistant's tool gives, for a host App's "try an address".
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DeliveryResource = void 0;
|
|
7
|
+
class DeliveryResource {
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/** `POST /api/v1/delivery/quote` — 404 when the workspace has no delivery settings. */
|
|
12
|
+
async quote(input) {
|
|
13
|
+
return this.client.request('POST', '/api/v1/delivery/quote', input);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.DeliveryResource = DeliveryResource;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AgentForgeClient } from '../client';
|
|
2
|
+
import type { Place, SearchPlacesInput } from '../types';
|
|
3
|
+
export declare class PlacesResource {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: AgentForgeClient);
|
|
6
|
+
/** `GET /api/v1/places/search` — places matching a text, for an autocomplete. */
|
|
7
|
+
search(input: SearchPlacesInput): Promise<Place[]>;
|
|
8
|
+
/** `GET /api/v1/places/reverse` — the place at a dropped pin (its coordinates are kept). */
|
|
9
|
+
reverse(lat: number, lng: number, opts?: {
|
|
10
|
+
language?: string;
|
|
11
|
+
}): Promise<Place | null>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// places resource (AGF-PDK-DELIVERY) — address search and reverse geocoding
|
|
3
|
+
// for the tenant the client acts in. The maps provider and its key stay on
|
|
4
|
+
// the platform; a host App shows suggestions and confirms a pin.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PlacesResource = void 0;
|
|
7
|
+
class PlacesResource {
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.client = client;
|
|
10
|
+
}
|
|
11
|
+
/** `GET /api/v1/places/search` — places matching a text, for an autocomplete. */
|
|
12
|
+
async search(input) {
|
|
13
|
+
const qs = new URLSearchParams({ q: input.q });
|
|
14
|
+
if (input.proximity)
|
|
15
|
+
qs.set('proximity', `${input.proximity.lng},${input.proximity.lat}`);
|
|
16
|
+
if (input.country)
|
|
17
|
+
qs.set('country', input.country);
|
|
18
|
+
if (input.language)
|
|
19
|
+
qs.set('language', input.language);
|
|
20
|
+
if (input.limit !== undefined)
|
|
21
|
+
qs.set('limit', String(input.limit));
|
|
22
|
+
const res = await this.client.request('GET', `/api/v1/places/search?${qs.toString()}`);
|
|
23
|
+
return res.items;
|
|
24
|
+
}
|
|
25
|
+
/** `GET /api/v1/places/reverse` — the place at a dropped pin (its coordinates are kept). */
|
|
26
|
+
async reverse(lat, lng, opts = {}) {
|
|
27
|
+
const qs = new URLSearchParams({ lat: String(lat), lng: String(lng) });
|
|
28
|
+
if (opts.language)
|
|
29
|
+
qs.set('language', opts.language);
|
|
30
|
+
const res = await this.client.request('GET', `/api/v1/places/reverse?${qs.toString()}`);
|
|
31
|
+
return res.place;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.PlacesResource = PlacesResource;
|
package/dist/types.d.ts
CHANGED
|
@@ -825,7 +825,9 @@ export interface TemplateConfigField {
|
|
|
825
825
|
key: string;
|
|
826
826
|
label: string;
|
|
827
827
|
help?: string;
|
|
828
|
-
/** 'text' | '
|
|
828
|
+
/** 'text' | 'longtext' | 'phone' | 'address' | 'url' | 'google_sheet' | 'drive_file' | 'hours'
|
|
829
|
+
* | 'delivery' | 'payments' (AGF-PDK-DELIVERY: `address`, `delivery` and `payments` hold
|
|
830
|
+
* structured values — `config.structured`; the variable keeps their readable text). */
|
|
829
831
|
type: string;
|
|
830
832
|
required: boolean;
|
|
831
833
|
/** Resource picker for connector-backed fields (e.g. a Google Sheet). */
|
|
@@ -1376,4 +1378,139 @@ export type GoogleSheetsPickerResult = {
|
|
|
1376
1378
|
ok: false;
|
|
1377
1379
|
error: GoogleSheetsPickerErrorCode | (string & {});
|
|
1378
1380
|
};
|
|
1381
|
+
/** A place as the platform returns it (`places.search` / `places.reverse`). */
|
|
1382
|
+
export interface Place {
|
|
1383
|
+
formatted: string;
|
|
1384
|
+
lat: number;
|
|
1385
|
+
lng: number;
|
|
1386
|
+
placeId?: string;
|
|
1387
|
+
components?: {
|
|
1388
|
+
country?: string;
|
|
1389
|
+
region?: string;
|
|
1390
|
+
city?: string;
|
|
1391
|
+
postcode?: string;
|
|
1392
|
+
};
|
|
1393
|
+
/** 0–1: how sure the provider is. */
|
|
1394
|
+
relevance?: number;
|
|
1395
|
+
}
|
|
1396
|
+
export interface SearchPlacesInput {
|
|
1397
|
+
/** 3–200 characters. */
|
|
1398
|
+
q: string;
|
|
1399
|
+
/** Results near this point first. */
|
|
1400
|
+
proximity?: {
|
|
1401
|
+
lat: number;
|
|
1402
|
+
lng: number;
|
|
1403
|
+
};
|
|
1404
|
+
/** ISO 3166-1 alpha-2 ("co"). */
|
|
1405
|
+
country?: string;
|
|
1406
|
+
language?: string;
|
|
1407
|
+
/** 1–10, default 5. */
|
|
1408
|
+
limit?: number;
|
|
1409
|
+
}
|
|
1410
|
+
/** A geocoded address: a confirmed pin, never static text. */
|
|
1411
|
+
export interface AddressValue {
|
|
1412
|
+
formatted: string;
|
|
1413
|
+
lat: number;
|
|
1414
|
+
lng: number;
|
|
1415
|
+
placeId?: string;
|
|
1416
|
+
components?: Place['components'];
|
|
1417
|
+
notes?: string;
|
|
1418
|
+
}
|
|
1419
|
+
export type DeliveryLocalPricing = {
|
|
1420
|
+
kind: 'fixed';
|
|
1421
|
+
amount: number;
|
|
1422
|
+
} | {
|
|
1423
|
+
kind: 'distance';
|
|
1424
|
+
base: number;
|
|
1425
|
+
perKm: number;
|
|
1426
|
+
roundTo?: number;
|
|
1427
|
+
};
|
|
1428
|
+
/** Delivery coverage and prices (SDD AGF-PDK-DELIVERY §3.2). */
|
|
1429
|
+
export interface DeliverySettings {
|
|
1430
|
+
/** ISO 4217 ("COP"). */
|
|
1431
|
+
currency: string;
|
|
1432
|
+
locale?: 'es' | 'en';
|
|
1433
|
+
pickup: {
|
|
1434
|
+
enabled: boolean;
|
|
1435
|
+
};
|
|
1436
|
+
local: {
|
|
1437
|
+
enabled: boolean;
|
|
1438
|
+
/** The `address` field distances are measured from (usually BUSINESS_ADDRESS). */
|
|
1439
|
+
originKey: string;
|
|
1440
|
+
/** Free up to here; null = never free. */
|
|
1441
|
+
freeRadiusKm: number | null;
|
|
1442
|
+
/** No coverage beyond here. */
|
|
1443
|
+
maxRadiusKm: number;
|
|
1444
|
+
pricing: DeliveryLocalPricing;
|
|
1445
|
+
minOrder?: number;
|
|
1446
|
+
etaText?: string;
|
|
1447
|
+
};
|
|
1448
|
+
national: {
|
|
1449
|
+
enabled: boolean;
|
|
1450
|
+
pricing: {
|
|
1451
|
+
kind: 'flat';
|
|
1452
|
+
amount: number;
|
|
1453
|
+
} | {
|
|
1454
|
+
kind: 'quote';
|
|
1455
|
+
};
|
|
1456
|
+
etaText?: string;
|
|
1457
|
+
};
|
|
1458
|
+
}
|
|
1459
|
+
export type PaymentMethodKind = 'cash' | 'bank_transfer' | 'card_on_delivery' | 'payment_link' | 'card_in_store' | 'other';
|
|
1460
|
+
export interface PaymentSettings {
|
|
1461
|
+
locale?: 'es' | 'en';
|
|
1462
|
+
methods: Array<{
|
|
1463
|
+
kind: PaymentMethodKind;
|
|
1464
|
+
label?: string;
|
|
1465
|
+
notes?: string;
|
|
1466
|
+
}>;
|
|
1467
|
+
notes?: string;
|
|
1468
|
+
}
|
|
1469
|
+
export type StructuredConfigInput = {
|
|
1470
|
+
type: 'address';
|
|
1471
|
+
value: AddressValue;
|
|
1472
|
+
} | {
|
|
1473
|
+
type: 'delivery';
|
|
1474
|
+
value: DeliverySettings;
|
|
1475
|
+
} | {
|
|
1476
|
+
type: 'payments';
|
|
1477
|
+
value: PaymentSettings;
|
|
1478
|
+
};
|
|
1479
|
+
export type StructuredConfigEntry = StructuredConfigInput & {
|
|
1480
|
+
key: string;
|
|
1481
|
+
/** The readable text the `{{config:KEY}}` variable now holds. */
|
|
1482
|
+
text: string;
|
|
1483
|
+
updatedAt: string;
|
|
1484
|
+
};
|
|
1485
|
+
export type DeliveryQuoteStatus = 'free' | 'paid' | 'national' | 'pickup_only' | 'out_of_coverage' | 'no_delivery' | 'needs_confirmation';
|
|
1486
|
+
export interface DeliveryQuoteInput {
|
|
1487
|
+
/** What the customer typed… */
|
|
1488
|
+
address?: string;
|
|
1489
|
+
/** …or a point (a shared location). */
|
|
1490
|
+
lat?: number;
|
|
1491
|
+
lng?: number;
|
|
1492
|
+
/** The delivery settings to use; omitted = the workspace's only one. */
|
|
1493
|
+
deliveryKey?: string;
|
|
1494
|
+
language?: string;
|
|
1495
|
+
}
|
|
1496
|
+
export interface DeliveryQuote {
|
|
1497
|
+
status: DeliveryQuoteStatus;
|
|
1498
|
+
address?: {
|
|
1499
|
+
formatted: string;
|
|
1500
|
+
lat: number;
|
|
1501
|
+
lng: number;
|
|
1502
|
+
};
|
|
1503
|
+
/** `needs_confirmation`: up to three places to choose from. */
|
|
1504
|
+
candidates?: Array<{
|
|
1505
|
+
formatted: string;
|
|
1506
|
+
lat: number;
|
|
1507
|
+
lng: number;
|
|
1508
|
+
}>;
|
|
1509
|
+
distanceKm?: number;
|
|
1510
|
+
price?: number;
|
|
1511
|
+
currency: string;
|
|
1512
|
+
etaText?: string;
|
|
1513
|
+
/** One line in the business's language, to relay as is. */
|
|
1514
|
+
summary: string;
|
|
1515
|
+
}
|
|
1379
1516
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.20.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",
|