@agentforge-io/sdk-server 4.64.0 → 4.66.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 +2 -2
- package/dist/index.js +5 -2
- package/dist/resources/cases.d.ts +15 -1
- package/dist/resources/cases.js +18 -0
- package/dist/resources/catalog.d.ts +53 -1
- package/dist/resources/catalog.js +94 -1
- package/dist/resources/chat.d.ts +12 -0
- package/dist/types.d.ts +134 -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, AgentForgeDuplicateContactError, } 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, 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, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, UpsertSystemTemplateInput, UpsertSystemTemplateResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, BusinessReview, BusinessReviewsPage, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseStateStep, CreateDirectOrderInput, 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, 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, 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, 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, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, 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, 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, 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';
|
|
7
7
|
export { AgentsResource } from './resources/agents';
|
|
8
8
|
export { AnalyticsResource } from './resources/analytics';
|
|
9
9
|
export type { GetSupportKpisInput, GetAgentAttentionLogInput, } from './resources/analytics';
|
|
@@ -28,7 +28,7 @@ export type { AppFileKind, SignAppFileInput, AppFileUploadTarget } from './resou
|
|
|
28
28
|
export { DeliveryResource } from './resources/delivery';
|
|
29
29
|
export { CasesResource } from './resources/cases';
|
|
30
30
|
export { BusinessRolesResource } from './resources/business-roles';
|
|
31
|
-
export { CatalogResource, CatalogCategoriesResource, CatalogProductsResource, CatalogPhotosResource, CatalogImportResource, CatalogFileImportResource, CatalogMenuImportResource, CatalogOptionGroupsResource, CatalogUnitsResource, CatalogSourcesResource, AgentForgeCatalogImportLimitError, CATALOG_IMPORT_MAX_ITEMS, } from './resources/catalog';
|
|
31
|
+
export { CatalogResource, CatalogCategoriesResource, CatalogProductsResource, CatalogProductReviewsResource, CatalogProductLikesResource, CatalogReviewsResource, CatalogPhotosResource, CatalogImportResource, CatalogFileImportResource, CatalogMenuImportResource, CatalogOptionGroupsResource, CatalogUnitsResource, CatalogSourcesResource, AgentForgeCatalogImportLimitError, CATALOG_IMPORT_MAX_ITEMS, } from './resources/catalog';
|
|
32
32
|
export type { ListThreadsOptions, ListNewestMessagesOptions, NewestMessagesPage, SendMessageInput, AssignThreadInput, UnassignThreadInput, SetThreadModeInput, CloseThreadInput, } from './resources/inbox';
|
|
33
33
|
export { ProvisioningResource } from './resources/provisioning';
|
|
34
34
|
export type { ProvisionedTenant, ProvisionedApp, ProvisionedTeam, } from './resources/provisioning';
|
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 = void 0;
|
|
31
|
+
exports.CatalogSourcesResource = exports.CatalogUnitsResource = exports.CatalogOptionGroupsResource = exports.CatalogMenuImportResource = exports.CatalogFileImportResource = exports.CatalogImportResource = exports.CatalogPhotosResource = exports.CatalogReviewsResource = 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.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.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 = 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; } });
|
|
@@ -91,6 +91,9 @@ var catalog_1 = require("./resources/catalog");
|
|
|
91
91
|
Object.defineProperty(exports, "CatalogResource", { enumerable: true, get: function () { return catalog_1.CatalogResource; } });
|
|
92
92
|
Object.defineProperty(exports, "CatalogCategoriesResource", { enumerable: true, get: function () { return catalog_1.CatalogCategoriesResource; } });
|
|
93
93
|
Object.defineProperty(exports, "CatalogProductsResource", { enumerable: true, get: function () { return catalog_1.CatalogProductsResource; } });
|
|
94
|
+
Object.defineProperty(exports, "CatalogProductReviewsResource", { enumerable: true, get: function () { return catalog_1.CatalogProductReviewsResource; } });
|
|
95
|
+
Object.defineProperty(exports, "CatalogProductLikesResource", { enumerable: true, get: function () { return catalog_1.CatalogProductLikesResource; } });
|
|
96
|
+
Object.defineProperty(exports, "CatalogReviewsResource", { enumerable: true, get: function () { return catalog_1.CatalogReviewsResource; } });
|
|
94
97
|
Object.defineProperty(exports, "CatalogPhotosResource", { enumerable: true, get: function () { return catalog_1.CatalogPhotosResource; } });
|
|
95
98
|
Object.defineProperty(exports, "CatalogImportResource", { enumerable: true, get: function () { return catalog_1.CatalogImportResource; } });
|
|
96
99
|
Object.defineProperty(exports, "CatalogFileImportResource", { enumerable: true, get: function () { return catalog_1.CatalogFileImportResource; } });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentForgeClient } from '../client';
|
|
2
|
-
import type { CaseClosingReport, CaseProposalAnswer, CaseProposalInput, CaseReportPage, CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectBookingInput, CreateDirectOrderInput, DirectOrderForm, ListCasesInput, MoveCaseSlotInput } from '../types';
|
|
2
|
+
import type { CaseClosingReport, CaseProposalAnswer, CaseProposalInput, CaseReportPage, CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectBookingInput, CreateDirectOrderInput, DirectOrderForm, ListCasesInput, MoveCaseSlotInput, ProductReview, ReceiptReviewables, SaveReceiptReviewInput } from '../types';
|
|
3
3
|
export declare class CasesResource {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor(client: AgentForgeClient);
|
|
@@ -108,6 +108,20 @@ export declare class CasesResource {
|
|
|
108
108
|
* it was accepted or once closed. Returns the receipt as it is now.
|
|
109
109
|
*/
|
|
110
110
|
receiptReceived(token: string): Promise<CaseReceipt>;
|
|
111
|
+
/**
|
|
112
|
+
* `GET /api/v1/cases/receipts/:token/reviewables` — AGF-PDK-PRODUCT-REVIEWS: the order's
|
|
113
|
+
* products the buyer can review (catalog products of a COMPLETED order; free-text lines are
|
|
114
|
+
* not), each with their existing review (also when the business hid it). `eligible: false`
|
|
115
|
+
* with no items until the order is completed.
|
|
116
|
+
*/
|
|
117
|
+
receiptReviewables(token: string): Promise<ReceiptReviewables>;
|
|
118
|
+
/**
|
|
119
|
+
* `PUT /api/v1/cases/receipts/:token/review` — create or edit (upsert) the buyer's verified
|
|
120
|
+
* review of one product of the order. Sending it again from the same receipt edits it.
|
|
121
|
+
* 403 `not_eligible` before the order is completed, 400 `product_not_in_order` / `invalid_rating`
|
|
122
|
+
* / `body_too_long`. The reviewer's name comes from the order, never from the caller.
|
|
123
|
+
*/
|
|
124
|
+
receiptReview(token: string, input: SaveReceiptReviewInput): Promise<ProductReview>;
|
|
111
125
|
/**
|
|
112
126
|
* `GET /api/v1/cases/direct/form` — what a checkout asks besides the cart, the name
|
|
113
127
|
* and the phone: the order type and its other fields (chips for a closed choice).
|
package/dist/resources/cases.js
CHANGED
|
@@ -163,6 +163,24 @@ class CasesResource {
|
|
|
163
163
|
async receiptReceived(token) {
|
|
164
164
|
return this.client.request('POST', `/api/v1/cases/receipts/${encodeURIComponent(token)}/received`, {});
|
|
165
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* `GET /api/v1/cases/receipts/:token/reviewables` — AGF-PDK-PRODUCT-REVIEWS: the order's
|
|
168
|
+
* products the buyer can review (catalog products of a COMPLETED order; free-text lines are
|
|
169
|
+
* not), each with their existing review (also when the business hid it). `eligible: false`
|
|
170
|
+
* with no items until the order is completed.
|
|
171
|
+
*/
|
|
172
|
+
async receiptReviewables(token) {
|
|
173
|
+
return this.client.request('GET', `/api/v1/cases/receipts/${encodeURIComponent(token)}/reviewables`);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* `PUT /api/v1/cases/receipts/:token/review` — create or edit (upsert) the buyer's verified
|
|
177
|
+
* review of one product of the order. Sending it again from the same receipt edits it.
|
|
178
|
+
* 403 `not_eligible` before the order is completed, 400 `product_not_in_order` / `invalid_rating`
|
|
179
|
+
* / `body_too_long`. The reviewer's name comes from the order, never from the caller.
|
|
180
|
+
*/
|
|
181
|
+
async receiptReview(token, input) {
|
|
182
|
+
return this.client.request('PUT', `/api/v1/cases/receipts/${encodeURIComponent(token)}/review`, input);
|
|
183
|
+
}
|
|
166
184
|
/**
|
|
167
185
|
* `GET /api/v1/cases/direct/form` — what a checkout asks besides the cart, the name
|
|
168
186
|
* and the phone: the order type and its other fields (chips for a closed choice).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentForgeClient } from '../client';
|
|
2
2
|
import { AgentForgeError } from '../errors';
|
|
3
|
-
import type { 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, 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, 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. */
|
|
@@ -21,6 +21,18 @@ export declare class CatalogCategoriesResource {
|
|
|
21
21
|
delete(categoryId: string): Promise<void>;
|
|
22
22
|
/** `PATCH /categories/reorder` — `orderedIds` must be exactly the current set. */
|
|
23
23
|
reorder(orderedIds: string[]): Promise<CatalogCategory[]>;
|
|
24
|
+
/** `POST /categories/:id/image/sign-upload` — signed direct-upload target
|
|
25
|
+
* for the category photo (same storage, types and 8 MB cap as product
|
|
26
|
+
* photos). PUT the bytes to `uploadUrl`, then `attachImage(id, { url: publicUrl, key })`.
|
|
27
|
+
* 404 when the category is not this tenant's; nothing is signed. */
|
|
28
|
+
signImageUpload(categoryId: string, input: SignCatalogPhotoUploadInput): Promise<CatalogPhotoUploadTarget>;
|
|
29
|
+
/** `POST /categories/:id/image` — persist the uploaded photo; returns the
|
|
30
|
+
* category with `imageUrl` set. Replaces (and reclaims) a previous photo.
|
|
31
|
+
* 400 when `url`/`key` are not the signed object of this category. */
|
|
32
|
+
attachImage(categoryId: string, input: AttachCatalogCategoryImageInput): Promise<CatalogCategory>;
|
|
33
|
+
/** `DELETE /categories/:id/image` — clear the photo (`imageUrl: null`) and
|
|
34
|
+
* delete the stored object (best-effort). Idempotent. Returns the category. */
|
|
35
|
+
removeImage(categoryId: string): Promise<CatalogCategory>;
|
|
24
36
|
}
|
|
25
37
|
export declare class CatalogPhotosResource {
|
|
26
38
|
private readonly client;
|
|
@@ -77,9 +89,47 @@ export declare class CatalogOptionGroupsResource {
|
|
|
77
89
|
/** `PATCH /option-groups/:id/availability` — one option on or off («hoy no hay BBQ»). */
|
|
78
90
|
setAvailability(groupId: string, option: string, isAvailable: boolean): Promise<CatalogOptionGroup>;
|
|
79
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* A product's reviews (AGF-PDK-PRODUCT-REVIEWS). Writing one happens from the order's receipt
|
|
94
|
+
* (`cases.receiptReview`); here the public list and summary.
|
|
95
|
+
*/
|
|
96
|
+
export declare class CatalogProductReviewsResource {
|
|
97
|
+
private readonly client;
|
|
98
|
+
constructor(client: AgentForgeClient);
|
|
99
|
+
/** `GET /products/:id/reviews` — visible reviews newest first, the rating summary and the like count. 404 for another business's product. */
|
|
100
|
+
list(productId: string, input?: ListProductReviewsInput): Promise<ProductReviewsPage>;
|
|
101
|
+
}
|
|
102
|
+
/** Likes of signed-in customers (AGF-PDK-PRODUCT-REVIEWS): one per customer and product, removable. Needs an App secret (sk_live_). */
|
|
103
|
+
export declare class CatalogProductLikesResource {
|
|
104
|
+
private readonly client;
|
|
105
|
+
constructor(client: AgentForgeClient);
|
|
106
|
+
/** `PUT /products/:id/like` — like or unlike; idempotent. `externalUserId` is the App's stable customer id. */
|
|
107
|
+
set(productId: string, externalUserId: string, liked: boolean): Promise<ProductLikeResult>;
|
|
108
|
+
/** `POST /likes/mine` — which of these products (≤ 100) the customer liked. */
|
|
109
|
+
mine(externalUserId: string, productIds: string[]): Promise<string[]>;
|
|
110
|
+
}
|
|
111
|
+
/** The business's review inbox and moderation (AGF-PDK-PRODUCT-REVIEWS). The owner can reply, hide and unhide — never edit or delete. */
|
|
112
|
+
export declare class CatalogReviewsResource {
|
|
113
|
+
private readonly client;
|
|
114
|
+
constructor(client: AgentForgeClient);
|
|
115
|
+
/** `GET /reviews` — every review of the business, hidden ones too, newest first. */
|
|
116
|
+
listForOwner(input?: ListProductReviewsForOwnerInput): Promise<ProductReviewsOwnerPage>;
|
|
117
|
+
/** `PUT /reviews/:id/reply` — the business's public reply (≤ 1,000 characters, plain text); `body: null` removes it. */
|
|
118
|
+
reply(reviewId: string, input: {
|
|
119
|
+
body: string | null;
|
|
120
|
+
}): Promise<ProductReviewOwner>;
|
|
121
|
+
/** `POST /reviews/:id/hide` — takes an abusive review off the public list and the rating; the reason is required and kept. */
|
|
122
|
+
hide(reviewId: string, input: HideProductReviewInput): Promise<ProductReviewOwner>;
|
|
123
|
+
/** `POST /reviews/:id/unhide` — shows it again. */
|
|
124
|
+
unhide(reviewId: string): Promise<ProductReviewOwner>;
|
|
125
|
+
}
|
|
80
126
|
export declare class CatalogProductsResource {
|
|
81
127
|
private readonly client;
|
|
82
128
|
readonly photos: CatalogPhotosResource;
|
|
129
|
+
/** AGF-PDK-PRODUCT-REVIEWS — a product's public reviews and rating. */
|
|
130
|
+
readonly reviews: CatalogProductReviewsResource;
|
|
131
|
+
/** AGF-PDK-PRODUCT-REVIEWS — likes of signed-in customers. */
|
|
132
|
+
readonly likes: CatalogProductLikesResource;
|
|
83
133
|
constructor(client: AgentForgeClient);
|
|
84
134
|
/** `GET /products` — includes drafts/archived (owner view). Paginated. */
|
|
85
135
|
list(input?: ListCatalogProductsInput): Promise<CatalogProductPage>;
|
|
@@ -207,6 +257,8 @@ export declare class CatalogResource {
|
|
|
207
257
|
readonly sources: CatalogSourcesResource;
|
|
208
258
|
readonly optionGroups: CatalogOptionGroupsResource;
|
|
209
259
|
readonly units: CatalogUnitsResource;
|
|
260
|
+
/** AGF-PDK-PRODUCT-REVIEWS — the business's review inbox and moderation. */
|
|
261
|
+
readonly reviews: CatalogReviewsResource;
|
|
210
262
|
constructor(client: AgentForgeClient);
|
|
211
263
|
/** `GET /api/v1/catalog` — the tenant's catalog, or `null` when it has none yet
|
|
212
264
|
* (404 `CATALOG_NOT_FOUND`). Other 404s still throw. */
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// machine-readable code (`CATALOG_NOT_FOUND`, `FILE_EMPTY_FILE`,
|
|
17
17
|
// `INVALID_MAPPING`, `TOO_MANY_ITEMS`, …).
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.CatalogResource = exports.CatalogSourcesResource = exports.CatalogImportResource = exports.CatalogMenuImportResource = exports.CatalogFileImportResource = exports.CatalogProductsResource = exports.CatalogOptionGroupsResource = exports.CatalogUnitsResource = exports.CatalogPhotosResource = exports.CatalogCategoriesResource = exports.AgentForgeCatalogImportLimitError = exports.CATALOG_IMPORT_MAX_ITEMS = void 0;
|
|
19
|
+
exports.CatalogResource = exports.CatalogSourcesResource = exports.CatalogImportResource = exports.CatalogMenuImportResource = exports.CatalogFileImportResource = exports.CatalogProductsResource = exports.CatalogReviewsResource = exports.CatalogProductLikesResource = exports.CatalogProductReviewsResource = exports.CatalogOptionGroupsResource = exports.CatalogUnitsResource = exports.CatalogPhotosResource = exports.CatalogCategoriesResource = exports.AgentForgeCatalogImportLimitError = exports.CATALOG_IMPORT_MAX_ITEMS = void 0;
|
|
20
20
|
const errors_1 = require("../errors");
|
|
21
21
|
const BASE = '/api/v1/catalog';
|
|
22
22
|
const TENANT_AUTH = { forceApiKey: true };
|
|
@@ -78,6 +78,24 @@ class CatalogCategoriesResource {
|
|
|
78
78
|
async reorder(orderedIds) {
|
|
79
79
|
return this.client.request('PATCH', `${BASE}/categories/reorder`, { orderedIds }, TENANT_AUTH);
|
|
80
80
|
}
|
|
81
|
+
/** `POST /categories/:id/image/sign-upload` — signed direct-upload target
|
|
82
|
+
* for the category photo (same storage, types and 8 MB cap as product
|
|
83
|
+
* photos). PUT the bytes to `uploadUrl`, then `attachImage(id, { url: publicUrl, key })`.
|
|
84
|
+
* 404 when the category is not this tenant's; nothing is signed. */
|
|
85
|
+
async signImageUpload(categoryId, input) {
|
|
86
|
+
return this.client.request('POST', `${BASE}/categories/${seg(categoryId)}/image/sign-upload`, input, TENANT_AUTH);
|
|
87
|
+
}
|
|
88
|
+
/** `POST /categories/:id/image` — persist the uploaded photo; returns the
|
|
89
|
+
* category with `imageUrl` set. Replaces (and reclaims) a previous photo.
|
|
90
|
+
* 400 when `url`/`key` are not the signed object of this category. */
|
|
91
|
+
async attachImage(categoryId, input) {
|
|
92
|
+
return this.client.request('POST', `${BASE}/categories/${seg(categoryId)}/image`, input, TENANT_AUTH);
|
|
93
|
+
}
|
|
94
|
+
/** `DELETE /categories/:id/image` — clear the photo (`imageUrl: null`) and
|
|
95
|
+
* delete the stored object (best-effort). Idempotent. Returns the category. */
|
|
96
|
+
async removeImage(categoryId) {
|
|
97
|
+
return this.client.request('DELETE', `${BASE}/categories/${seg(categoryId)}/image`, undefined, TENANT_AUTH);
|
|
98
|
+
}
|
|
81
99
|
}
|
|
82
100
|
exports.CatalogCategoriesResource = CatalogCategoriesResource;
|
|
83
101
|
class CatalogPhotosResource {
|
|
@@ -163,10 +181,80 @@ class CatalogOptionGroupsResource {
|
|
|
163
181
|
}
|
|
164
182
|
}
|
|
165
183
|
exports.CatalogOptionGroupsResource = CatalogOptionGroupsResource;
|
|
184
|
+
/**
|
|
185
|
+
* A product's reviews (AGF-PDK-PRODUCT-REVIEWS). Writing one happens from the order's receipt
|
|
186
|
+
* (`cases.receiptReview`); here the public list and summary.
|
|
187
|
+
*/
|
|
188
|
+
class CatalogProductReviewsResource {
|
|
189
|
+
constructor(client) {
|
|
190
|
+
this.client = client;
|
|
191
|
+
}
|
|
192
|
+
/** `GET /products/:id/reviews` — visible reviews newest first, the rating summary and the like count. 404 for another business's product. */
|
|
193
|
+
async list(productId, input = {}) {
|
|
194
|
+
const qs = new URLSearchParams();
|
|
195
|
+
if (input.cursor)
|
|
196
|
+
qs.set('cursor', input.cursor);
|
|
197
|
+
if (input.limit !== undefined)
|
|
198
|
+
qs.set('limit', String(input.limit));
|
|
199
|
+
const q = qs.toString();
|
|
200
|
+
return this.client.request('GET', `${BASE}/products/${seg(productId)}/reviews${q ? `?${q}` : ''}`, undefined, TENANT_AUTH);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
exports.CatalogProductReviewsResource = CatalogProductReviewsResource;
|
|
204
|
+
/** Likes of signed-in customers (AGF-PDK-PRODUCT-REVIEWS): one per customer and product, removable. Needs an App secret (sk_live_). */
|
|
205
|
+
class CatalogProductLikesResource {
|
|
206
|
+
constructor(client) {
|
|
207
|
+
this.client = client;
|
|
208
|
+
}
|
|
209
|
+
/** `PUT /products/:id/like` — like or unlike; idempotent. `externalUserId` is the App's stable customer id. */
|
|
210
|
+
async set(productId, externalUserId, liked) {
|
|
211
|
+
return this.client.request('PUT', `${BASE}/products/${seg(productId)}/like`, { externalUserId, liked }, TENANT_AUTH);
|
|
212
|
+
}
|
|
213
|
+
/** `POST /likes/mine` — which of these products (≤ 100) the customer liked. */
|
|
214
|
+
async mine(externalUserId, productIds) {
|
|
215
|
+
return (await this.client.request('POST', `${BASE}/likes/mine`, { externalUserId, productIds }, TENANT_AUTH)).productIds;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
exports.CatalogProductLikesResource = CatalogProductLikesResource;
|
|
219
|
+
/** The business's review inbox and moderation (AGF-PDK-PRODUCT-REVIEWS). The owner can reply, hide and unhide — never edit or delete. */
|
|
220
|
+
class CatalogReviewsResource {
|
|
221
|
+
constructor(client) {
|
|
222
|
+
this.client = client;
|
|
223
|
+
}
|
|
224
|
+
/** `GET /reviews` — every review of the business, hidden ones too, newest first. */
|
|
225
|
+
async listForOwner(input = {}) {
|
|
226
|
+
const qs = new URLSearchParams();
|
|
227
|
+
if (input.status)
|
|
228
|
+
qs.set('status', input.status);
|
|
229
|
+
if (input.productId)
|
|
230
|
+
qs.set('productId', input.productId);
|
|
231
|
+
if (input.cursor)
|
|
232
|
+
qs.set('cursor', input.cursor);
|
|
233
|
+
if (input.limit !== undefined)
|
|
234
|
+
qs.set('limit', String(input.limit));
|
|
235
|
+
const q = qs.toString();
|
|
236
|
+
return this.client.request('GET', `${BASE}/reviews${q ? `?${q}` : ''}`, undefined, TENANT_AUTH);
|
|
237
|
+
}
|
|
238
|
+
/** `PUT /reviews/:id/reply` — the business's public reply (≤ 1,000 characters, plain text); `body: null` removes it. */
|
|
239
|
+
async reply(reviewId, input) {
|
|
240
|
+
return this.client.request('PUT', `${BASE}/reviews/${seg(reviewId)}/reply`, input, TENANT_AUTH);
|
|
241
|
+
}
|
|
242
|
+
/** `POST /reviews/:id/hide` — takes an abusive review off the public list and the rating; the reason is required and kept. */
|
|
243
|
+
async hide(reviewId, input) {
|
|
244
|
+
return this.client.request('POST', `${BASE}/reviews/${seg(reviewId)}/hide`, input, TENANT_AUTH);
|
|
245
|
+
}
|
|
246
|
+
/** `POST /reviews/:id/unhide` — shows it again. */
|
|
247
|
+
async unhide(reviewId) {
|
|
248
|
+
return this.client.request('POST', `${BASE}/reviews/${seg(reviewId)}/unhide`, {}, TENANT_AUTH);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
exports.CatalogReviewsResource = CatalogReviewsResource;
|
|
166
252
|
class CatalogProductsResource {
|
|
167
253
|
constructor(client) {
|
|
168
254
|
this.client = client;
|
|
169
255
|
this.photos = new CatalogPhotosResource(client);
|
|
256
|
+
this.reviews = new CatalogProductReviewsResource(client);
|
|
257
|
+
this.likes = new CatalogProductLikesResource(client);
|
|
170
258
|
}
|
|
171
259
|
/** `GET /products` — includes drafts/archived (owner view). Paginated. */
|
|
172
260
|
async list(input = {}) {
|
|
@@ -183,6 +271,10 @@ class CatalogProductsResource {
|
|
|
183
271
|
qs.set('page', String(input.page));
|
|
184
272
|
if (input.pageSize !== undefined)
|
|
185
273
|
qs.set('pageSize', String(input.pageSize));
|
|
274
|
+
if (input.categoryIds?.length)
|
|
275
|
+
qs.set('categoryIds', input.categoryIds.join(','));
|
|
276
|
+
if (input.productIds?.length)
|
|
277
|
+
qs.set('productIds', input.productIds.join(','));
|
|
186
278
|
const q = qs.toString();
|
|
187
279
|
return this.client.request('GET', `${BASE}/products${q ? `?${q}` : ''}`, undefined, TENANT_AUTH);
|
|
188
280
|
}
|
|
@@ -373,6 +465,7 @@ exports.CatalogSourcesResource = CatalogSourcesResource;
|
|
|
373
465
|
class CatalogResource {
|
|
374
466
|
constructor(client) {
|
|
375
467
|
this.client = client;
|
|
468
|
+
this.reviews = new CatalogReviewsResource(client);
|
|
376
469
|
this.categories = new CatalogCategoriesResource(client);
|
|
377
470
|
this.products = new CatalogProductsResource(client);
|
|
378
471
|
this.import = new CatalogImportResource(client);
|
package/dist/resources/chat.d.ts
CHANGED
|
@@ -73,6 +73,18 @@ export interface AppCallerClaims {
|
|
|
73
73
|
location?: string;
|
|
74
74
|
/** The delivery address the person chose in the App; the assistant offers it instead of asking (AGF-CUSTOMER-WHERE). */
|
|
75
75
|
deliveryAddress?: string;
|
|
76
|
+
/**
|
|
77
|
+
* AGF-LOCATION-FOCUS: what the person is looking at in the App, by name. The
|
|
78
|
+
* assistant prioritizes it and the rest of the catalog stays available. Never
|
|
79
|
+
* where the person is: that is `location`, and only `location` means they are
|
|
80
|
+
* attended there. A case opened without a `location` takes `focus.place` as its
|
|
81
|
+
* origin. Capped by the platform: 20 categories, 30 products.
|
|
82
|
+
*/
|
|
83
|
+
focus?: {
|
|
84
|
+
place?: string;
|
|
85
|
+
categories?: string[];
|
|
86
|
+
products?: string[];
|
|
87
|
+
};
|
|
76
88
|
}
|
|
77
89
|
export declare class ChatResource {
|
|
78
90
|
private readonly client;
|
package/dist/types.d.ts
CHANGED
|
@@ -1189,6 +1189,12 @@ export interface CatalogCategory {
|
|
|
1189
1189
|
name: string;
|
|
1190
1190
|
slug: string;
|
|
1191
1191
|
sortOrder: number;
|
|
1192
|
+
/** Public URL of the category photo, or `null` when it has none. Set via
|
|
1193
|
+
* `catalog.categories.signImageUpload` -> PUT -> `attachImage`. */
|
|
1194
|
+
imageUrl: string | null;
|
|
1195
|
+
/** Storage key backing `imageUrl` (`null` when none). Informational —
|
|
1196
|
+
* the platform uses it to reclaim the object on replace/remove/delete. */
|
|
1197
|
+
imageKey: string | null;
|
|
1192
1198
|
createdAt: string;
|
|
1193
1199
|
updatedAt: string;
|
|
1194
1200
|
}
|
|
@@ -1255,6 +1261,10 @@ export interface CatalogProduct {
|
|
|
1255
1261
|
booking?: CatalogBookingRule | null;
|
|
1256
1262
|
lastSoldAt?: string | null;
|
|
1257
1263
|
demandCount: number;
|
|
1264
|
+
/** AGF-PDK-PRODUCT-REVIEWS — over the visible reviews (absent on an older platform). */
|
|
1265
|
+
rating?: ProductRatingSummary;
|
|
1266
|
+
/** AGF-PDK-PRODUCT-REVIEWS — customers who liked it (absent on an older platform). */
|
|
1267
|
+
likeCount?: number;
|
|
1258
1268
|
createdAt: string;
|
|
1259
1269
|
updatedAt: string;
|
|
1260
1270
|
}
|
|
@@ -1438,6 +1448,14 @@ export interface ListCatalogProductsInput {
|
|
|
1438
1448
|
page?: number;
|
|
1439
1449
|
/** Default 20, max 100 (server-capped). */
|
|
1440
1450
|
pageSize?: number;
|
|
1451
|
+
/**
|
|
1452
|
+
* AGF-LOCATION-FOCUS: a selection of the catalog, products in these categories
|
|
1453
|
+
* OR with these ids, on top of every other filter (`categoryId` included). UUIDs,
|
|
1454
|
+
* at most 30 categories and 100 products (else 400). Omitted or both empty: no
|
|
1455
|
+
* restriction.
|
|
1456
|
+
*/
|
|
1457
|
+
categoryIds?: string[];
|
|
1458
|
+
productIds?: string[];
|
|
1441
1459
|
}
|
|
1442
1460
|
export interface CatalogProductPage {
|
|
1443
1461
|
items: CatalogProduct[];
|
|
@@ -1458,6 +1476,13 @@ export interface SignCatalogPhotoUploadInput {
|
|
|
1458
1476
|
contentType: string;
|
|
1459
1477
|
contentLength?: number;
|
|
1460
1478
|
}
|
|
1479
|
+
/** `POST /categories/:id/image` — the `publicUrl` + `key` that
|
|
1480
|
+
* `categories.signImageUpload` returned (both required; the platform refuses
|
|
1481
|
+
* a url/key that is not the object it signed for this category). */
|
|
1482
|
+
export interface AttachCatalogCategoryImageInput {
|
|
1483
|
+
url: string;
|
|
1484
|
+
key: string;
|
|
1485
|
+
}
|
|
1461
1486
|
export interface AttachCatalogPhotoInput {
|
|
1462
1487
|
url: string;
|
|
1463
1488
|
isCover?: boolean;
|
|
@@ -2934,4 +2959,113 @@ export interface AppCaseWebhookEvent extends AppWebhookEventBase {
|
|
|
2934
2959
|
origin?: CaseOrigin;
|
|
2935
2960
|
};
|
|
2936
2961
|
}
|
|
2962
|
+
/** A product's rating over its VISIBLE reviews (hidden ones never count). */
|
|
2963
|
+
export interface ProductRatingSummary {
|
|
2964
|
+
/** One decimal; null with no reviews. */
|
|
2965
|
+
average: number | null;
|
|
2966
|
+
count: number;
|
|
2967
|
+
/** Reviews per star. */
|
|
2968
|
+
distribution: {
|
|
2969
|
+
1: number;
|
|
2970
|
+
2: number;
|
|
2971
|
+
3: number;
|
|
2972
|
+
4: number;
|
|
2973
|
+
5: number;
|
|
2974
|
+
};
|
|
2975
|
+
}
|
|
2976
|
+
/**
|
|
2977
|
+
* A buyer's review of a product, written from the receipt of a completed order
|
|
2978
|
+
* (so every one is a verified purchase). Never carries the reviewer's ids or contact data.
|
|
2979
|
+
*/
|
|
2980
|
+
export interface ProductReview {
|
|
2981
|
+
id: string;
|
|
2982
|
+
productId: string;
|
|
2983
|
+
/** Whole number 1–5. */
|
|
2984
|
+
rating: number;
|
|
2985
|
+
/** Plain text, or null for stars only. */
|
|
2986
|
+
body: string | null;
|
|
2987
|
+
/** The customer's first name + last initial («Laura G.»). */
|
|
2988
|
+
reviewerName: string;
|
|
2989
|
+
reviewerAvatarUrl: string | null;
|
|
2990
|
+
/** Always true: «Compra verificada». */
|
|
2991
|
+
verifiedPurchase: true;
|
|
2992
|
+
/** Public lists only carry `visible`; a buyer's own review (receipt) can be `hidden`. */
|
|
2993
|
+
status: 'visible' | 'hidden';
|
|
2994
|
+
/** The business's public reply under the review. */
|
|
2995
|
+
reply: {
|
|
2996
|
+
body: string;
|
|
2997
|
+
at: string;
|
|
2998
|
+
} | null;
|
|
2999
|
+
createdAt: string;
|
|
3000
|
+
updatedAt: string;
|
|
3001
|
+
}
|
|
3002
|
+
/** A review as the business reads it in its inbox: moderation details and the order. */
|
|
3003
|
+
export interface ProductReviewOwner extends ProductReview {
|
|
3004
|
+
productTitle: string | null;
|
|
3005
|
+
productSlug: string | null;
|
|
3006
|
+
/** The order it was written from. */
|
|
3007
|
+
caseId: string;
|
|
3008
|
+
hiddenReason: string | null;
|
|
3009
|
+
hiddenAt: string | null;
|
|
3010
|
+
/** Who of the business hid it (what the App sent as `hiddenBy`). */
|
|
3011
|
+
hiddenBy: string | null;
|
|
3012
|
+
}
|
|
3013
|
+
/** `GET /api/v1/catalog/products/:id/reviews`. */
|
|
3014
|
+
export interface ProductReviewsPage {
|
|
3015
|
+
/** Visible reviews, newest first. */
|
|
3016
|
+
items: ProductReview[];
|
|
3017
|
+
summary: ProductRatingSummary;
|
|
3018
|
+
likeCount: number;
|
|
3019
|
+
nextCursor: string | null;
|
|
3020
|
+
}
|
|
3021
|
+
export interface ListProductReviewsInput {
|
|
3022
|
+
cursor?: string;
|
|
3023
|
+
/** 1–50, default 20. */
|
|
3024
|
+
limit?: number;
|
|
3025
|
+
}
|
|
3026
|
+
/** `GET /api/v1/catalog/reviews` (the business's inbox). */
|
|
3027
|
+
export interface ProductReviewsOwnerPage {
|
|
3028
|
+
items: ProductReviewOwner[];
|
|
3029
|
+
nextCursor: string | null;
|
|
3030
|
+
}
|
|
3031
|
+
export interface ListProductReviewsForOwnerInput {
|
|
3032
|
+
/** Absent = both. */
|
|
3033
|
+
status?: 'visible' | 'hidden';
|
|
3034
|
+
productId?: string;
|
|
3035
|
+
cursor?: string;
|
|
3036
|
+
/** 1–50, default 20. */
|
|
3037
|
+
limit?: number;
|
|
3038
|
+
}
|
|
3039
|
+
export interface HideProductReviewInput {
|
|
3040
|
+
/** Required, ≤ 500 characters; kept with the review. */
|
|
3041
|
+
reason: string;
|
|
3042
|
+
/** Who of the business hides it (e.g. `member:<id>`), for the audit trail. */
|
|
3043
|
+
hiddenBy?: string;
|
|
3044
|
+
}
|
|
3045
|
+
/** `PUT /api/v1/catalog/products/:id/like`. */
|
|
3046
|
+
export interface ProductLikeResult {
|
|
3047
|
+
liked: boolean;
|
|
3048
|
+
likeCount: number;
|
|
3049
|
+
}
|
|
3050
|
+
/** One product of a completed order the buyer can review, with their review of it (also when hidden). */
|
|
3051
|
+
export interface ReceiptReviewable {
|
|
3052
|
+
productId: string;
|
|
3053
|
+
title: string;
|
|
3054
|
+
coverUrl: string | null;
|
|
3055
|
+
review: ProductReview | null;
|
|
3056
|
+
}
|
|
3057
|
+
/** `GET /api/v1/cases/receipts/:token/reviewables`. */
|
|
3058
|
+
export interface ReceiptReviewables {
|
|
3059
|
+
/** The order is completed. When false, `items` is empty (cancelled, rejected or still open orders are never reviewable). */
|
|
3060
|
+
eligible: boolean;
|
|
3061
|
+
items: ReceiptReviewable[];
|
|
3062
|
+
}
|
|
3063
|
+
/** `PUT /api/v1/cases/receipts/:token/review`. 403 `not_eligible` until the order is completed; 400 `product_not_in_order`. */
|
|
3064
|
+
export interface SaveReceiptReviewInput {
|
|
3065
|
+
productId: string;
|
|
3066
|
+
/** Whole number 1–5. */
|
|
3067
|
+
rating: number;
|
|
3068
|
+
/** Plain text ≤ 2,000 characters (HTML is stripped); empty or null = stars only. */
|
|
3069
|
+
body?: string | null;
|
|
3070
|
+
}
|
|
2937
3071
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.66.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",
|