@agentforge-io/sdk-server 4.72.0 → 4.74.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 +2 -1
- package/dist/index.js +8 -2
- package/dist/resources/catalog.d.ts +3 -3
- package/dist/resources/catalog.js +4 -3
- package/dist/resources/reference.d.ts +31 -0
- package/dist/resources/reference.js +75 -0
- package/dist/types.d.ts +89 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { DeliveryResource } from './resources/delivery';
|
|
|
19
19
|
import { BusinessReviewsResource } from './resources/reviews';
|
|
20
20
|
import { CasesResource } from './resources/cases';
|
|
21
21
|
import { CatalogResource } from './resources/catalog';
|
|
22
|
+
import { ReferenceResource } from './resources/reference';
|
|
22
23
|
import { BusinessRolesResource } from './resources/business-roles';
|
|
23
24
|
import { ToolsResource } from './resources/tools';
|
|
24
25
|
import { BillingResource } from './resources/billing';
|
|
@@ -116,6 +117,8 @@ export declare class AgentForgeClient {
|
|
|
116
117
|
readonly reviews: BusinessReviewsResource;
|
|
117
118
|
readonly businessRoles: BusinessRolesResource;
|
|
118
119
|
readonly catalog: CatalogResource;
|
|
120
|
+
/** PDK-GLOBAL-CATALOG — App-level reference product catalog (root client, `sk_live_`; no tenant). */
|
|
121
|
+
readonly reference: ReferenceResource;
|
|
119
122
|
/** PDK-BILLING — the installed tenant's plan, trial and subscription (use `af.forTenant(id).billing`). */
|
|
120
123
|
readonly billing: BillingResource;
|
|
121
124
|
constructor(opts: AgentForgeClientOptions);
|
package/dist/client.js
CHANGED
|
@@ -41,6 +41,7 @@ const delivery_1 = require("./resources/delivery");
|
|
|
41
41
|
const reviews_1 = require("./resources/reviews");
|
|
42
42
|
const cases_1 = require("./resources/cases");
|
|
43
43
|
const catalog_1 = require("./resources/catalog");
|
|
44
|
+
const reference_1 = require("./resources/reference");
|
|
44
45
|
const business_roles_1 = require("./resources/business-roles");
|
|
45
46
|
const tools_1 = require("./resources/tools");
|
|
46
47
|
const billing_1 = require("./resources/billing");
|
|
@@ -93,6 +94,7 @@ class AgentForgeClient {
|
|
|
93
94
|
this.reviews = new reviews_1.BusinessReviewsResource(this);
|
|
94
95
|
this.businessRoles = new business_roles_1.BusinessRolesResource(this);
|
|
95
96
|
this.catalog = new catalog_1.CatalogResource(this);
|
|
97
|
+
this.reference = new reference_1.ReferenceResource(this);
|
|
96
98
|
this.billing = new billing_1.BillingResource(this);
|
|
97
99
|
}
|
|
98
100
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { BillingResource } from './resources/billing';
|
|
|
6
6
|
export type { BillingEntitlement, BillingEntitlementStatus, BillingInterval, BillingLimits, BillingPlan, BillingInvoice, BillingPaymentMethod, BillingCheckoutInput, BillingStartTrialInput, AppBillingWebhookEvent, AppBillingWebhookEventName, AppBillingWebhookData, } from './resources/billing';
|
|
7
7
|
export { APP_WEBHOOK_HEADERS, TOOL_CALLBACK_HEADERS, ToolCallbackSignatureError, signToolCallbackPayload, verifyAppWebhook, verifyToolCallbackSignature, } from './webhooks';
|
|
8
8
|
export { WebhookResource, type SetAppWebhookInput } from './resources/webhook';
|
|
9
|
-
export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AppCaseWebhookEvent, AppCaseWebhookEventName, AppConversationMessageWebhookEvent, AppChannelStatusWebhookEvent, 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, ProfileBlockPlacement, ProfileBlockPosition, CatalogBlockPreview, ServiceCta, ServiceCtaAction, CatalogServicesBlockConfig, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, CheckSystemTemplateResult, TemplatePublishIssue, UpsertSystemTemplateInput, UpsertSystemTemplateResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, BusinessReview, BusinessReviewsPage, ProductRatingSummary, ProductReview, ProductReviewOwner, ProductReviewsPage, ProductReviewsOwnerPage, ListProductReviewsInput, ListProductReviewsForOwnerInput, HideProductReviewInput, ProductLikeResult, ReceiptReviewable, ReceiptReviewables, SaveReceiptReviewInput, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseStateStep, CreateDirectOrderInput, CreateOpenOrderInput, OpenOrderFreeLine, OpenOrderLineMark, OpenOrderPayment, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseReportPage, CaseReceipt, CaseReceiptLine, CaseProposal, CaseProposalAnswer, CaseProposalChange, CaseProposalInput, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryPricePreview, DeliveryPricingPreview, DeliveryPricingPreviewInput, DeliveryRoute, DeliveryRouteInput, DeliveryQuote, AppSelf, AppOwner, 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, AttachCatalogCategoryImageInput, 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';
|
|
9
|
+
export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AppCaseWebhookEvent, AppCaseWebhookEventName, AppConversationMessageWebhookEvent, AppChannelStatusWebhookEvent, 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, ProfileBlockPlacement, ProfileBlockPosition, CatalogBlockPreview, ServiceCta, ServiceCtaAction, CatalogServicesBlockConfig, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, CheckSystemTemplateResult, TemplatePublishIssue, UpsertSystemTemplateInput, UpsertSystemTemplateResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, BusinessReview, BusinessReviewsPage, ProductRatingSummary, ProductReview, ProductReviewOwner, ProductReviewsPage, ProductReviewsOwnerPage, ListProductReviewsInput, ListProductReviewsForOwnerInput, HideProductReviewInput, ProductLikeResult, ReceiptReviewable, ReceiptReviewables, SaveReceiptReviewInput, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseStateStep, CreateDirectOrderInput, CreateOpenOrderInput, OpenOrderFreeLine, OpenOrderLineMark, OpenOrderPayment, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseReportPage, CaseReceipt, CaseReceiptLine, CaseProposal, CaseProposalAnswer, CaseProposalChange, CaseProposalInput, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryPricePreview, DeliveryPricingPreview, DeliveryPricingPreviewInput, DeliveryRoute, DeliveryRouteInput, DeliveryQuote, AppSelf, AppOwner, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, ListCatalogCategoriesInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, AttachCatalogCategoryImageInput, 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, ReferenceMatchItemInput, ReferenceMatchDecisionKind, ReferenceMatchCandidate, ReferenceMatchDecision, ReferenceMatchInput, ReferenceMatchResult, ReferenceProductInput, ReferenceProductsBulkInput, ReferenceProductsBulkResult, ReferenceProduct, ListReferenceProductsInput, ReferenceProductPage, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
|
|
10
10
|
export { AgentsResource } from './resources/agents';
|
|
11
11
|
export { AnalyticsResource } from './resources/analytics';
|
|
12
12
|
export type { GetSupportKpisInput, GetAgentAttentionLogInput, } from './resources/analytics';
|
|
@@ -20,6 +20,7 @@ export { InstallationsResource } from './resources/installations';
|
|
|
20
20
|
export type { InstallAppInput } from './resources/installations';
|
|
21
21
|
export { TemplatesResource, TemplateReviewsResource, TemplateReportsResource } from './resources/templates';
|
|
22
22
|
export type { ListTemplatesInput } from './resources/templates';
|
|
23
|
+
export { ReferenceResource, ReferenceProductsResource, AgentForgeReferenceLimitError, REFERENCE_MATCH_MAX_ITEMS, REFERENCE_BULK_MAX_ITEMS, } from './resources/reference';
|
|
23
24
|
export { MarketplaceResource } from './resources/marketplace';
|
|
24
25
|
export type { ListMarketplaceCategoriesInput } from './resources/marketplace';
|
|
25
26
|
export { TenantConfigResource } from './resources/config';
|
package/dist/index.js
CHANGED
|
@@ -28,8 +28,8 @@
|
|
|
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.
|
|
32
|
-
exports.ToolsResource = exports.TeamsResource = exports.SecretsResource = exports.ProvisioningResource = exports.CATALOG_IMPORT_MAX_ITEMS = exports.AgentForgeCatalogImportLimitError = exports.CatalogSourcesResource = exports.CatalogUnitsResource = exports.CatalogOptionGroupsResource = void 0;
|
|
31
|
+
exports.CatalogProductLikesResource = exports.CatalogProductReviewsResource = exports.CatalogProductsResource = exports.CatalogCategoriesResource = exports.CatalogResource = exports.BusinessRolesResource = exports.CasesResource = exports.DeliveryResource = exports.FilesResource = exports.ContactListsResource = exports.ContactTagsResource = exports.ContactAddressesResource = exports.ContactVerificationResource = exports.ContactsResource = exports.PlacesResource = exports.TenantConfigResource = exports.MarketplaceResource = exports.REFERENCE_BULK_MAX_ITEMS = exports.REFERENCE_MATCH_MAX_ITEMS = exports.AgentForgeReferenceLimitError = exports.ReferenceProductsResource = exports.ReferenceResource = exports.TemplateReportsResource = exports.TemplateReviewsResource = exports.TemplatesResource = exports.InstallationsResource = exports.InboxResource = exports.parseGoogleSheetsPickerResult = exports.ConnectorsResource = exports.ChatResource = exports.AppsResource = exports.AnalyticsResource = exports.AgentsResource = exports.WebhookResource = exports.verifyToolCallbackSignature = exports.verifyAppWebhook = exports.signToolCallbackPayload = exports.ToolCallbackSignatureError = exports.TOOL_CALLBACK_HEADERS = exports.APP_WEBHOOK_HEADERS = exports.BillingResource = exports.AGENTFORGE_BILLING_ERROR_CODES = exports.AgentForgeBillingError = exports.AgentForgeDuplicateContactError = exports.AgentForgeNetworkError = exports.AgentForgeNotFoundError = exports.AgentForgeAuthError = exports.AgentForgeError = exports.INSTALLED_TENANT_HEADER = exports.AgentForgeClient = void 0;
|
|
32
|
+
exports.ToolsResource = exports.TeamsResource = exports.SecretsResource = exports.ProvisioningResource = exports.CATALOG_IMPORT_MAX_ITEMS = exports.AgentForgeCatalogImportLimitError = exports.CatalogSourcesResource = exports.CatalogUnitsResource = exports.CatalogOptionGroupsResource = exports.CatalogMenuImportResource = exports.CatalogFileImportResource = exports.CatalogImportResource = exports.CatalogPhotosResource = exports.CatalogReviewsResource = void 0;
|
|
33
33
|
var client_1 = require("./client");
|
|
34
34
|
Object.defineProperty(exports, "AgentForgeClient", { enumerable: true, get: function () { return client_1.AgentForgeClient; } });
|
|
35
35
|
Object.defineProperty(exports, "INSTALLED_TENANT_HEADER", { enumerable: true, get: function () { return client_1.INSTALLED_TENANT_HEADER; } });
|
|
@@ -71,6 +71,12 @@ var templates_1 = require("./resources/templates");
|
|
|
71
71
|
Object.defineProperty(exports, "TemplatesResource", { enumerable: true, get: function () { return templates_1.TemplatesResource; } });
|
|
72
72
|
Object.defineProperty(exports, "TemplateReviewsResource", { enumerable: true, get: function () { return templates_1.TemplateReviewsResource; } });
|
|
73
73
|
Object.defineProperty(exports, "TemplateReportsResource", { enumerable: true, get: function () { return templates_1.TemplateReportsResource; } });
|
|
74
|
+
var reference_1 = require("./resources/reference");
|
|
75
|
+
Object.defineProperty(exports, "ReferenceResource", { enumerable: true, get: function () { return reference_1.ReferenceResource; } });
|
|
76
|
+
Object.defineProperty(exports, "ReferenceProductsResource", { enumerable: true, get: function () { return reference_1.ReferenceProductsResource; } });
|
|
77
|
+
Object.defineProperty(exports, "AgentForgeReferenceLimitError", { enumerable: true, get: function () { return reference_1.AgentForgeReferenceLimitError; } });
|
|
78
|
+
Object.defineProperty(exports, "REFERENCE_MATCH_MAX_ITEMS", { enumerable: true, get: function () { return reference_1.REFERENCE_MATCH_MAX_ITEMS; } });
|
|
79
|
+
Object.defineProperty(exports, "REFERENCE_BULK_MAX_ITEMS", { enumerable: true, get: function () { return reference_1.REFERENCE_BULK_MAX_ITEMS; } });
|
|
74
80
|
var marketplace_1 = require("./resources/marketplace");
|
|
75
81
|
Object.defineProperty(exports, "MarketplaceResource", { enumerable: true, get: function () { return marketplace_1.MarketplaceResource; } });
|
|
76
82
|
var config_1 = require("./resources/config");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentForgeClient } from '../client';
|
|
2
2
|
import { AgentForgeError } from '../errors';
|
|
3
|
-
import type { AttachCatalogCategoryImageInput, AttachCatalogPhotoInput, Catalog, CatalogCategory, CatalogFileApplyInput, CatalogFileApplyResult, CatalogOptionChange, CatalogOptionChangesPlan, CatalogOptionGroup, CatalogUnit, SaveCatalogUnitInput, SaveCatalogOptionGroupInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogFilePreview, CatalogFilePreviewInput, CatalogImportApplyResult, CatalogImportItem, CatalogImportPreview, CatalogImportSource, CatalogImportSourcePreview, CatalogImportRunResult, CatalogPhotoUploadTarget, CatalogProduct, CatalogProductPage, HideProductReviewInput, ListProductReviewsForOwnerInput, ListProductReviewsInput, ProductLikeResult, ProductReviewOwner, ProductReviewsOwnerPage, ProductReviewsPage, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, CreateCatalogCategoryInput, CreateCatalogImportSourceInput, CreateCatalogProductInput, ListCatalogProductsInput, PreviewCatalogImportSourceInput, SignCatalogPhotoUploadInput, UpdateCatalogCategoryInput, UpdateCatalogImportSourceInput, UpdateCatalogProductInput, UpsertCatalogInput } from '../types';
|
|
3
|
+
import type { AttachCatalogCategoryImageInput, AttachCatalogPhotoInput, Catalog, CatalogCategory, CatalogFileApplyInput, CatalogFileApplyResult, CatalogOptionChange, CatalogOptionChangesPlan, CatalogOptionGroup, CatalogUnit, SaveCatalogUnitInput, SaveCatalogOptionGroupInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogFilePreview, CatalogFilePreviewInput, CatalogImportApplyResult, CatalogImportItem, CatalogImportPreview, CatalogImportSource, CatalogImportSourcePreview, CatalogImportRunResult, CatalogPhotoUploadTarget, CatalogProduct, CatalogProductPage, HideProductReviewInput, ListProductReviewsForOwnerInput, ListProductReviewsInput, ProductLikeResult, ProductReviewOwner, ProductReviewsOwnerPage, ProductReviewsPage, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, CreateCatalogCategoryInput, ListCatalogCategoriesInput, CreateCatalogImportSourceInput, CreateCatalogProductInput, ListCatalogProductsInput, PreviewCatalogImportSourceInput, SignCatalogPhotoUploadInput, UpdateCatalogCategoryInput, UpdateCatalogImportSourceInput, UpdateCatalogProductInput, UpsertCatalogInput } from '../types';
|
|
4
4
|
/** Max structured items per `import.preview/apply` call (platform cap). */
|
|
5
5
|
export declare const CATALOG_IMPORT_MAX_ITEMS = 200;
|
|
6
6
|
/** Thrown client-side, before any request, when `items` exceeds the cap. */
|
|
@@ -11,8 +11,8 @@ export declare class AgentForgeCatalogImportLimitError extends AgentForgeError {
|
|
|
11
11
|
export declare class CatalogCategoriesResource {
|
|
12
12
|
private readonly client;
|
|
13
13
|
constructor(client: AgentForgeClient);
|
|
14
|
-
/** `GET /categories` — ordered by `sortOrder`. */
|
|
15
|
-
list(): Promise<CatalogCategory[]>;
|
|
14
|
+
/** `GET /categories` — ordered by `sortOrder`. `{ kind }` returns that kind plus the kind-less (legacy) categories. */
|
|
15
|
+
list(input?: ListCatalogCategoriesInput): Promise<CatalogCategory[]>;
|
|
16
16
|
/** `POST /categories` */
|
|
17
17
|
create(input: CreateCatalogCategoryInput): Promise<CatalogCategory>;
|
|
18
18
|
/** `PATCH /categories/:id` */
|
|
@@ -58,9 +58,10 @@ class CatalogCategoriesResource {
|
|
|
58
58
|
constructor(client) {
|
|
59
59
|
this.client = client;
|
|
60
60
|
}
|
|
61
|
-
/** `GET /categories` — ordered by `sortOrder`. */
|
|
62
|
-
async list() {
|
|
63
|
-
|
|
61
|
+
/** `GET /categories` — ordered by `sortOrder`. `{ kind }` returns that kind plus the kind-less (legacy) categories. */
|
|
62
|
+
async list(input = {}) {
|
|
63
|
+
const q = input.kind ? `?kind=${encodeURIComponent(input.kind)}` : '';
|
|
64
|
+
return this.client.request('GET', `${BASE}/categories${q}`, undefined, TENANT_AUTH);
|
|
64
65
|
}
|
|
65
66
|
/** `POST /categories` */
|
|
66
67
|
async create(input) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AgentForgeClient } from '../client';
|
|
2
|
+
import { AgentForgeError } from '../errors';
|
|
3
|
+
import type { ListReferenceProductsInput, ReferenceMatchInput, ReferenceMatchResult, ReferenceProduct, ReferenceProductPage, ReferenceProductsBulkInput, ReferenceProductsBulkResult } from '../types';
|
|
4
|
+
/** Max items per `reference.match` call (platform cap). */
|
|
5
|
+
export declare const REFERENCE_MATCH_MAX_ITEMS = 50;
|
|
6
|
+
/** Max items per `reference.products.bulk` call (platform cap). */
|
|
7
|
+
export declare const REFERENCE_BULK_MAX_ITEMS = 200;
|
|
8
|
+
/** Thrown client-side, before any request, when `items` exceeds the cap. */
|
|
9
|
+
export declare class AgentForgeReferenceLimitError extends AgentForgeError {
|
|
10
|
+
readonly count: number;
|
|
11
|
+
readonly max: number;
|
|
12
|
+
constructor(operation: string, max: number, count: number);
|
|
13
|
+
}
|
|
14
|
+
export declare class ReferenceProductsResource {
|
|
15
|
+
private readonly client;
|
|
16
|
+
constructor(client: AgentForgeClient);
|
|
17
|
+
/** `POST /products/bulk` — upsert by normalized title (aliases merged). Max 200 per call. */
|
|
18
|
+
bulk(input: ReferenceProductsBulkInput): Promise<ReferenceProductsBulkResult>;
|
|
19
|
+
/** `GET /products/:id`. */
|
|
20
|
+
get(id: string): Promise<ReferenceProduct>;
|
|
21
|
+
/** `GET /products?q=&status=&page=&pageSize=`. */
|
|
22
|
+
list(input?: ListReferenceProductsInput): Promise<ReferenceProductPage>;
|
|
23
|
+
}
|
|
24
|
+
export declare class ReferenceResource {
|
|
25
|
+
private readonly client;
|
|
26
|
+
readonly products: ReferenceProductsResource;
|
|
27
|
+
constructor(client: AgentForgeClient);
|
|
28
|
+
/** `POST /match` — match free-text items to reference products. Max 50 per call.
|
|
29
|
+
* Never throws on an embedding outage: those items come back `decision: 'unresolved'`. */
|
|
30
|
+
match(input: ReferenceMatchInput): Promise<ReferenceMatchResult>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// reference resource — the App-level global product catalog (PDK-GLOBAL-CATALOG),
|
|
3
|
+
// `/api/v1/reference/*`. It belongs to the App, not to a tenant: use the ROOT
|
|
4
|
+
// client (`af.reference…`, authenticated with the `sk_live_` App secret). Do not
|
|
5
|
+
// call it through `af.forTenant(id)` — no tenant is involved or needed.
|
|
6
|
+
//
|
|
7
|
+
// const { items } = await af.reference.match({ items: [{ key: 'a', text: 'arroz 500g' }], record: true });
|
|
8
|
+
// await af.reference.products.bulk({ items: [{ title: 'Arroz', aliases: ['arroz blanco'] }] });
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.ReferenceResource = exports.ReferenceProductsResource = exports.AgentForgeReferenceLimitError = exports.REFERENCE_BULK_MAX_ITEMS = exports.REFERENCE_MATCH_MAX_ITEMS = void 0;
|
|
11
|
+
const errors_1 = require("../errors");
|
|
12
|
+
const BASE = '/api/v1/reference';
|
|
13
|
+
/** Max items per `reference.match` call (platform cap). */
|
|
14
|
+
exports.REFERENCE_MATCH_MAX_ITEMS = 50;
|
|
15
|
+
/** Max items per `reference.products.bulk` call (platform cap). */
|
|
16
|
+
exports.REFERENCE_BULK_MAX_ITEMS = 200;
|
|
17
|
+
/** Thrown client-side, before any request, when `items` exceeds the cap. */
|
|
18
|
+
class AgentForgeReferenceLimitError extends errors_1.AgentForgeError {
|
|
19
|
+
constructor(operation, max, count) {
|
|
20
|
+
super(400, `${operation} accepts at most ${max} items per call (got ${count}). Split into chunks.`, undefined, 'TOO_MANY_ITEMS');
|
|
21
|
+
this.name = 'AgentForgeReferenceLimitError';
|
|
22
|
+
this.count = count;
|
|
23
|
+
this.max = max;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.AgentForgeReferenceLimitError = AgentForgeReferenceLimitError;
|
|
27
|
+
class ReferenceProductsResource {
|
|
28
|
+
constructor(client) {
|
|
29
|
+
this.client = client;
|
|
30
|
+
}
|
|
31
|
+
/** `POST /products/bulk` — upsert by normalized title (aliases merged). Max 200 per call. */
|
|
32
|
+
async bulk(input) {
|
|
33
|
+
if (input.items.length > exports.REFERENCE_BULK_MAX_ITEMS) {
|
|
34
|
+
throw new AgentForgeReferenceLimitError('reference.products.bulk', exports.REFERENCE_BULK_MAX_ITEMS, input.items.length);
|
|
35
|
+
}
|
|
36
|
+
return this.client.request('POST', `${BASE}/products/bulk`, { items: input.items });
|
|
37
|
+
}
|
|
38
|
+
/** `GET /products/:id`. */
|
|
39
|
+
async get(id) {
|
|
40
|
+
return this.client.request('GET', `${BASE}/products/${encodeURIComponent(id)}`);
|
|
41
|
+
}
|
|
42
|
+
/** `GET /products?q=&status=&page=&pageSize=`. */
|
|
43
|
+
async list(input = {}) {
|
|
44
|
+
const qs = new URLSearchParams();
|
|
45
|
+
if (input.q)
|
|
46
|
+
qs.set('q', input.q);
|
|
47
|
+
if (input.status)
|
|
48
|
+
qs.set('status', input.status);
|
|
49
|
+
if (input.page !== undefined)
|
|
50
|
+
qs.set('page', String(input.page));
|
|
51
|
+
if (input.pageSize !== undefined)
|
|
52
|
+
qs.set('pageSize', String(input.pageSize));
|
|
53
|
+
const query = qs.toString();
|
|
54
|
+
return this.client.request('GET', `${BASE}/products${query ? `?${query}` : ''}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.ReferenceProductsResource = ReferenceProductsResource;
|
|
58
|
+
class ReferenceResource {
|
|
59
|
+
constructor(client) {
|
|
60
|
+
this.client = client;
|
|
61
|
+
this.products = new ReferenceProductsResource(client);
|
|
62
|
+
}
|
|
63
|
+
/** `POST /match` — match free-text items to reference products. Max 50 per call.
|
|
64
|
+
* Never throws on an embedding outage: those items come back `decision: 'unresolved'`. */
|
|
65
|
+
async match(input) {
|
|
66
|
+
if (input.items.length > exports.REFERENCE_MATCH_MAX_ITEMS) {
|
|
67
|
+
throw new AgentForgeReferenceLimitError('reference.match', exports.REFERENCE_MATCH_MAX_ITEMS, input.items.length);
|
|
68
|
+
}
|
|
69
|
+
const body = { items: input.items };
|
|
70
|
+
if (input.record !== undefined)
|
|
71
|
+
body.record = input.record;
|
|
72
|
+
return this.client.request('POST', `${BASE}/match`, body);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.ReferenceResource = ReferenceResource;
|
package/dist/types.d.ts
CHANGED
|
@@ -1310,6 +1310,10 @@ export interface CatalogCategory {
|
|
|
1310
1310
|
/** Storage key backing `imageUrl` (`null` when none). Informational —
|
|
1311
1311
|
* the platform uses it to reclaim the object on replace/remove/delete. */
|
|
1312
1312
|
imageKey: string | null;
|
|
1313
|
+
/** Which kind of item the category groups: `'product'`, `'service'`, or `null`
|
|
1314
|
+
* (legacy / both). Optional on the type so older platform responses still fit;
|
|
1315
|
+
* the platform always returns it (`null` for categories created before it existed). */
|
|
1316
|
+
kind?: CatalogProductKind | null;
|
|
1313
1317
|
createdAt: string;
|
|
1314
1318
|
updatedAt: string;
|
|
1315
1319
|
}
|
|
@@ -1317,10 +1321,18 @@ export interface CreateCatalogCategoryInput {
|
|
|
1317
1321
|
name: string;
|
|
1318
1322
|
/** Derived from `name` when omitted. */
|
|
1319
1323
|
slug?: string;
|
|
1324
|
+
/** `'product' | 'service'`; omitted / `null` = both (legacy). Anything else is 400 `INVALID_KIND`. */
|
|
1325
|
+
kind?: CatalogProductKind | null;
|
|
1320
1326
|
}
|
|
1321
1327
|
export interface UpdateCatalogCategoryInput {
|
|
1322
1328
|
name?: string;
|
|
1323
1329
|
slug?: string;
|
|
1330
|
+
/** Set the kind, or `null` to clear it (applies to both). Omitted = unchanged. 400 `INVALID_KIND` otherwise. */
|
|
1331
|
+
kind?: CatalogProductKind | null;
|
|
1332
|
+
}
|
|
1333
|
+
export interface ListCatalogCategoriesInput {
|
|
1334
|
+
/** Only categories of this kind **plus** the kind-less (legacy) ones. Omitted = all. */
|
|
1335
|
+
kind?: CatalogProductKind;
|
|
1324
1336
|
}
|
|
1325
1337
|
export interface CatalogProductPhoto {
|
|
1326
1338
|
url: string;
|
|
@@ -3280,4 +3292,81 @@ export interface SaveReceiptReviewInput {
|
|
|
3280
3292
|
/** Plain text ≤ 2,000 characters (HTML is stripped); empty or null = stars only. */
|
|
3281
3293
|
body?: string | null;
|
|
3282
3294
|
}
|
|
3295
|
+
/** One item to match against the reference catalog. `key` is echoed back in the decision. */
|
|
3296
|
+
export interface ReferenceMatchItemInput {
|
|
3297
|
+
key: string;
|
|
3298
|
+
text: string;
|
|
3299
|
+
unitKey?: string;
|
|
3300
|
+
categoryHint?: string;
|
|
3301
|
+
}
|
|
3302
|
+
export type ReferenceMatchDecisionKind = 'linked' | 'llm' | 'demand' | 'unresolved';
|
|
3303
|
+
export interface ReferenceMatchCandidate {
|
|
3304
|
+
id: string;
|
|
3305
|
+
title: string;
|
|
3306
|
+
similarity: number;
|
|
3307
|
+
}
|
|
3308
|
+
export interface ReferenceMatchDecision {
|
|
3309
|
+
key: string;
|
|
3310
|
+
decision: ReferenceMatchDecisionKind;
|
|
3311
|
+
referenceProductId?: string;
|
|
3312
|
+
title?: string;
|
|
3313
|
+
similarity?: number;
|
|
3314
|
+
/** Up to 5 nearest reference products. */
|
|
3315
|
+
candidates: ReferenceMatchCandidate[];
|
|
3316
|
+
}
|
|
3317
|
+
export interface ReferenceMatchInput {
|
|
3318
|
+
/** At most 50 per call. */
|
|
3319
|
+
items: ReferenceMatchItemInput[];
|
|
3320
|
+
/** `true` upserts a demand entry and increments `demand_count` for unmatched items. */
|
|
3321
|
+
record?: boolean;
|
|
3322
|
+
}
|
|
3323
|
+
export interface ReferenceMatchResult {
|
|
3324
|
+
model: string;
|
|
3325
|
+
items: ReferenceMatchDecision[];
|
|
3326
|
+
}
|
|
3327
|
+
export interface ReferenceProductInput {
|
|
3328
|
+
title: string;
|
|
3329
|
+
category?: string;
|
|
3330
|
+
unitKey?: string;
|
|
3331
|
+
aliases?: string[];
|
|
3332
|
+
attributes?: Record<string, unknown>;
|
|
3333
|
+
}
|
|
3334
|
+
export interface ReferenceProductsBulkInput {
|
|
3335
|
+
/** At most 200 per call. */
|
|
3336
|
+
items: ReferenceProductInput[];
|
|
3337
|
+
}
|
|
3338
|
+
export interface ReferenceProductsBulkResult {
|
|
3339
|
+
created: number;
|
|
3340
|
+
updated: number;
|
|
3341
|
+
/** Rows embedded in this call. Rows saved without a vector (embedding outage) embed when re-sent. */
|
|
3342
|
+
embedded?: number;
|
|
3343
|
+
items: {
|
|
3344
|
+
id: string;
|
|
3345
|
+
title: string;
|
|
3346
|
+
}[];
|
|
3347
|
+
}
|
|
3348
|
+
export interface ReferenceProduct {
|
|
3349
|
+
id: string;
|
|
3350
|
+
title: string;
|
|
3351
|
+
category?: string | null;
|
|
3352
|
+
unitKey?: string | null;
|
|
3353
|
+
aliases?: string[];
|
|
3354
|
+
attributes?: Record<string, unknown> | null;
|
|
3355
|
+
status?: string;
|
|
3356
|
+
demandCount?: number;
|
|
3357
|
+
createdAt?: string;
|
|
3358
|
+
updatedAt?: string;
|
|
3359
|
+
}
|
|
3360
|
+
export interface ListReferenceProductsInput {
|
|
3361
|
+
q?: string;
|
|
3362
|
+
status?: string;
|
|
3363
|
+
page?: number;
|
|
3364
|
+
pageSize?: number;
|
|
3365
|
+
}
|
|
3366
|
+
export interface ReferenceProductPage {
|
|
3367
|
+
items: ReferenceProduct[];
|
|
3368
|
+
total?: number;
|
|
3369
|
+
page?: number;
|
|
3370
|
+
pageSize?: number;
|
|
3371
|
+
}
|
|
3283
3372
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.74.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",
|