@agentforge-io/sdk-server 4.88.0 → 4.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/resources/cases.d.ts +20 -1
- package/dist/resources/cases.js +21 -0
- package/dist/types.d.ts +87 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { BillingResource } from './resources/billing';
|
|
|
9
9
|
export type { BillingCurrency, BillingEntitlement, BillingEntitlementStatus, BillingInterval, BillingLimits, BillingPlan, BillingInvoice, BillingInvoicePage, BillingInvoicesQuery, BillingPaymentMethod, BillingCheckoutInput, BillingStartTrialInput, AppBillingWebhookEvent, AppBillingWebhookEventName, AppBillingWebhookData, } from './resources/billing';
|
|
10
10
|
export { APP_WEBHOOK_HEADERS, TOOL_CALLBACK_HEADERS, ToolCallbackSignatureError, signToolCallbackPayload, verifyAppWebhook, verifyToolCallbackSignature, } from './webhooks';
|
|
11
11
|
export { WebhookResource, type SetAppWebhookInput } from './resources/webhook';
|
|
12
|
-
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, ThemedColor, TeamBusinessHours, TeamWeekday, TeamProfileBlock, ProfileBlockPlacement, ProfileBlockPosition, CatalogBlockPreview, ServiceCta, ServiceCtaAction, CatalogServicesBlockConfig, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, CheckSystemTemplateResult, SetSystemAppProfileResult, SystemAppProfileView, 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, CaseContactLink, CaseStateStep, CreateDirectOrderInput, CreateOpenOrderInput, CaseOffCatalogLine, CaseOffCatalogView, ConfirmCaseLineInput, CreateOffCatalogLineInput, OpenOrderFreeLine, OpenOrderLineMark, OpenOrderPayment, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseClosingReceivables, CaseAccount, SetOnAccountInput, SetOnAccountResult, 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, GoogleCalendarAccount, GoogleCalendarEventInput, GoogleCalendarUpsertResult, GoogleCalendarBusyInput, GoogleCalendarBusyResult, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
|
|
12
|
+
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, ThemedColor, TeamBusinessHours, TeamWeekday, TeamProfileBlock, ProfileBlockPlacement, ProfileBlockPosition, CatalogBlockPreview, ServiceCta, ServiceCtaAction, CatalogServicesBlockConfig, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, CheckSystemTemplateResult, SetSystemAppProfileResult, SystemAppProfileView, 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, CaseContactLink, CaseStateStep, CreateDirectOrderInput, CreateOpenOrderInput, CaseOffCatalogLine, CaseOffCatalogView, ConfirmCaseLineInput, SetCaseLinePriceInput, CaseLinePrices, CaseLinePriceEntry, CaseLinePriceHistoryEntry, CaseLinePriceSet, CaseLinePriceActor, CaseLinePriceBreakdownItem, CreateOffCatalogLineInput, OpenOrderFreeLine, OpenOrderLineMark, OpenOrderPayment, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseClosingReceivables, CaseAccount, SetOnAccountInput, SetOnAccountResult, 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, GoogleCalendarAccount, GoogleCalendarEventInput, GoogleCalendarUpsertResult, GoogleCalendarBusyInput, GoogleCalendarBusyResult, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
|
|
13
13
|
export { AgentsResource } from './resources/agents';
|
|
14
14
|
export { AnalyticsResource } from './resources/analytics';
|
|
15
15
|
export type { GetSupportKpisInput, GetAgentAttentionLogInput, } from './resources/analytics';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentForgeClient } from '../client';
|
|
2
|
-
import type { CaseAccount, ConfirmCaseLineInput, CaseClosingReport, CaseProposalAnswer, CaseProposalInput, CaseReportPage, CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectBookingInput, CreateDirectOrderInput, CreateDirectRentalInput, CreateOpenOrderInput, DirectOrderForm, ListCasesInput, MoveCaseSlotInput, ProductReview, ReceiptReviewables, SaveReceiptReviewInput, SetOnAccountInput, SetOnAccountResult, UpdateCaseRentalInput } from '../types';
|
|
2
|
+
import type { CaseAccount, ConfirmCaseLineInput, CaseClosingReport, CaseProposalAnswer, CaseProposalInput, CaseReportPage, CasePaymentStatus, CaseReceipt, CaseState, CaseView, CreateDirectBookingInput, CreateDirectOrderInput, CreateDirectRentalInput, CreateOpenOrderInput, DirectOrderForm, ListCasesInput, MoveCaseSlotInput, ProductReview, ReceiptReviewables, SaveReceiptReviewInput, SetCaseLinePriceInput, SetOnAccountInput, SetOnAccountResult, UpdateCaseRentalInput } from '../types';
|
|
3
3
|
export declare class CasesResource {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor(client: AgentForgeClient);
|
|
@@ -52,6 +52,25 @@ export declare class CasesResource {
|
|
|
52
52
|
* Returns the updated case.
|
|
53
53
|
*/
|
|
54
54
|
confirmLine(caseId: string, input: ConfirmCaseLineInput): Promise<CaseView>;
|
|
55
|
+
/**
|
|
56
|
+
* `POST /api/v1/cases/:id/lines/price` — PDK-SERVICE-CHANGES: the business sets the price of ONE line of THIS request
|
|
57
|
+
* (a service «a consultar» / «desde» / hourly rate, a booking, a rental, a product), by its receipt `key`.
|
|
58
|
+
*
|
|
59
|
+
* - `answer: 'required'` — a quote: the customer gets a `price` proposal (`proposal.linePrice`, `requiresAnswer`, never
|
|
60
|
+
* auto-accepted) and answers it on the receipt (`receiptAnswerProposal`) or you record it (`answerProposal`). The price
|
|
61
|
+
* applies only when they accept (receipt re-issued, revision + 1); a rejection leaves the line as it was and the case's
|
|
62
|
+
* `linePrices[line].history` notes it. Several lines may be quoted in a row: they join one proposal.
|
|
63
|
+
* - `answer: 'notify'` — applied now: the receipt is re-issued (revision + 1) with the line's `priceSet` («Precio
|
|
64
|
+
* actualizado») and the customer is told.
|
|
65
|
+
*
|
|
66
|
+
* `unitCents` is the price of ONE unit (0 = «gratis», distinct from no price). It wins over the catalog, «desde», a rate and
|
|
67
|
+
* a rental's `periodRates` (on a rented line it is one unit over the whole range). The same price again is a no-op.
|
|
68
|
+
* Until every line has a price the platform refuses to charge (`total_pending`; `receipt.pricePending`).
|
|
69
|
+
* 400 closed / still edited / free `off#n` line (use `confirmLine`) / value line / invalid body, 404 unknown line,
|
|
70
|
+
* 409 another proposal waiting, the line already has a different quote waiting, or the payment was already reported or made.
|
|
71
|
+
* Returns the updated case.
|
|
72
|
+
*/
|
|
73
|
+
setLinePrice(caseId: string, input: SetCaseLinePriceInput): Promise<CaseView>;
|
|
55
74
|
/**
|
|
56
75
|
* `POST /api/v1/cases/:id/weigh` — AGF-UNITS U3: what a line sold by value
|
|
57
76
|
* («$3.000 de queso») really weighed, in the product's unit (`line` = the
|
package/dist/resources/cases.js
CHANGED
|
@@ -95,6 +95,27 @@ class CasesResource {
|
|
|
95
95
|
async confirmLine(caseId, input) {
|
|
96
96
|
return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/lines/confirm`, input);
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* `POST /api/v1/cases/:id/lines/price` — PDK-SERVICE-CHANGES: the business sets the price of ONE line of THIS request
|
|
100
|
+
* (a service «a consultar» / «desde» / hourly rate, a booking, a rental, a product), by its receipt `key`.
|
|
101
|
+
*
|
|
102
|
+
* - `answer: 'required'` — a quote: the customer gets a `price` proposal (`proposal.linePrice`, `requiresAnswer`, never
|
|
103
|
+
* auto-accepted) and answers it on the receipt (`receiptAnswerProposal`) or you record it (`answerProposal`). The price
|
|
104
|
+
* applies only when they accept (receipt re-issued, revision + 1); a rejection leaves the line as it was and the case's
|
|
105
|
+
* `linePrices[line].history` notes it. Several lines may be quoted in a row: they join one proposal.
|
|
106
|
+
* - `answer: 'notify'` — applied now: the receipt is re-issued (revision + 1) with the line's `priceSet` («Precio
|
|
107
|
+
* actualizado») and the customer is told.
|
|
108
|
+
*
|
|
109
|
+
* `unitCents` is the price of ONE unit (0 = «gratis», distinct from no price). It wins over the catalog, «desde», a rate and
|
|
110
|
+
* a rental's `periodRates` (on a rented line it is one unit over the whole range). The same price again is a no-op.
|
|
111
|
+
* Until every line has a price the platform refuses to charge (`total_pending`; `receipt.pricePending`).
|
|
112
|
+
* 400 closed / still edited / free `off#n` line (use `confirmLine`) / value line / invalid body, 404 unknown line,
|
|
113
|
+
* 409 another proposal waiting, the line already has a different quote waiting, or the payment was already reported or made.
|
|
114
|
+
* Returns the updated case.
|
|
115
|
+
*/
|
|
116
|
+
async setLinePrice(caseId, input) {
|
|
117
|
+
return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/lines/price`, input);
|
|
118
|
+
}
|
|
98
119
|
/**
|
|
99
120
|
* `POST /api/v1/cases/:id/weigh` — AGF-UNITS U3: what a line sold by value
|
|
100
121
|
* («$3.000 de queso») really weighed, in the product's unit (`line` = the
|
package/dist/types.d.ts
CHANGED
|
@@ -2441,7 +2441,8 @@ export interface CaseType {
|
|
|
2441
2441
|
* (the courier section, dispatch) read the type, never the label.
|
|
2442
2442
|
*/
|
|
2443
2443
|
/** `confirmed` (AGF-PDK-DISPATCH-PROPOSAL): an order's definitive version, after its preparation; from it on, a change is a new order. */
|
|
2444
|
-
|
|
2444
|
+
/** `in_progress` (a service being worked on) was missing here while the platform already sent it. */
|
|
2445
|
+
export type CaseStateType = 'draft' | 'received' | 'preparing' | 'confirmed' | 'ready' | 'out_for_delivery' | 'in_progress' | 'completed' | 'canceled';
|
|
2445
2446
|
/** `no_show`: a booking whose customer did not come (AGF-AGENDA-LIFECYCLE). */
|
|
2446
2447
|
export type CaseState = 'open' | 'review' | 'submitted' | 'accepted' | 'completed' | 'cancelled' | 'rejected' | 'abandoned' | 'no_show' | (string & {});
|
|
2447
2448
|
/** One state a case reached (AGF-CASE-TRACKING). */
|
|
@@ -2546,7 +2547,15 @@ export interface CaseView {
|
|
|
2546
2547
|
confirmedSubtotalCents?: number;
|
|
2547
2548
|
/** PDK-OFF-CATALOG — how many free lines still wait for the business; the total is null while it is above 0. */
|
|
2548
2549
|
pendingLines?: number;
|
|
2550
|
+
/**
|
|
2551
|
+
* PDK-SERVICE-CHANGES — a line has no price yet (a service «a consultar», a «desde», a rate, a free line to confirm): the
|
|
2552
|
+
* total is unknown and the platform refuses to charge (`total_pending`) until the business prices it with
|
|
2553
|
+
* `cases.setLinePrice`. Hide payment prompts while true. Absent on an older platform.
|
|
2554
|
+
*/
|
|
2555
|
+
pricePending?: boolean;
|
|
2549
2556
|
} | null;
|
|
2557
|
+
/** PDK-SERVICE-CHANGES — the prices the business set for lines of this request, by receipt line `key`, with their history; null/absent: none. */
|
|
2558
|
+
linePrices?: CaseLinePrices | null;
|
|
2550
2559
|
/** PDK-OFF-CATALOG — the order's «comodín» lines (products asked for by name that are not in the catalog) and what is left to confirm; null/absent: none. */
|
|
2551
2560
|
offCatalog?: CaseOffCatalogView | null;
|
|
2552
2561
|
/** What the customer asked after the business took the case (change, cancel), until the business moves it. */
|
|
@@ -2806,6 +2815,72 @@ export interface CaseReceiptLine {
|
|
|
2806
2815
|
askedPriceCents?: number;
|
|
2807
2816
|
confirmedBy?: string;
|
|
2808
2817
|
confirmedAt?: string;
|
|
2818
|
+
/**
|
|
2819
|
+
* PDK-SERVICE-CHANGES — the business set this line's price for THIS request (`cases.setLinePrice`); `unitCents` is then
|
|
2820
|
+
* that price and `priceKind` is `fixed`. `answer`: `accepted` (the customer accepted the quote) or `notify` (the business
|
|
2821
|
+
* told them); `updated: true` = show the «Precio actualizado» marker. Absent: the price is the catalog's (or the rental's rate).
|
|
2822
|
+
*/
|
|
2823
|
+
priceSet?: CaseLinePriceSet;
|
|
2824
|
+
}
|
|
2825
|
+
/** PDK-SERVICE-CHANGES — who set a line price. */
|
|
2826
|
+
export interface CaseLinePriceActor {
|
|
2827
|
+
id: string;
|
|
2828
|
+
name?: string;
|
|
2829
|
+
role?: string;
|
|
2830
|
+
}
|
|
2831
|
+
/** PDK-SERVICE-CHANGES — one part of a line price («Visita», «Mano de obra», «Repuestos»); the parts add up to `unitCents`. */
|
|
2832
|
+
export interface CaseLinePriceBreakdownItem {
|
|
2833
|
+
label: string;
|
|
2834
|
+
cents: number;
|
|
2835
|
+
}
|
|
2836
|
+
/** PDK-SERVICE-CHANGES — what a receipt line says of the price the business set (`CaseReceiptLine.priceSet`). */
|
|
2837
|
+
export interface CaseLinePriceSet {
|
|
2838
|
+
by: CaseLinePriceActor;
|
|
2839
|
+
at: string;
|
|
2840
|
+
note?: string;
|
|
2841
|
+
breakdown?: CaseLinePriceBreakdownItem[];
|
|
2842
|
+
answer: 'notify' | 'accepted';
|
|
2843
|
+
updated?: true;
|
|
2844
|
+
}
|
|
2845
|
+
/** PDK-SERVICE-CHANGES — one move of a line's price. A refused quote has `outcome: 'rejected'` and changed nothing. */
|
|
2846
|
+
export interface CaseLinePriceHistoryEntry {
|
|
2847
|
+
/** The price in force before this move (cents); null: the line had none. */
|
|
2848
|
+
before: number | null;
|
|
2849
|
+
/** The price this move set (a rejected quote: the one that was proposed). */
|
|
2850
|
+
after: number;
|
|
2851
|
+
by: CaseLinePriceActor;
|
|
2852
|
+
at: string;
|
|
2853
|
+
note?: string;
|
|
2854
|
+
/** `applied` (default) or `rejected`. */
|
|
2855
|
+
outcome?: 'applied' | 'rejected';
|
|
2856
|
+
answer?: 'notify' | 'accepted';
|
|
2857
|
+
}
|
|
2858
|
+
/** PDK-SERVICE-CHANGES — one line's price override with its history (oldest first). */
|
|
2859
|
+
export interface CaseLinePriceEntry {
|
|
2860
|
+
/** The price of ONE unit of the line (cents; 0 = «gratis»). null: it was never priced (only rejected quotes in `history`). */
|
|
2861
|
+
unitCents: number | null;
|
|
2862
|
+
note?: string;
|
|
2863
|
+
breakdown?: CaseLinePriceBreakdownItem[];
|
|
2864
|
+
by: CaseLinePriceActor;
|
|
2865
|
+
at: string;
|
|
2866
|
+
history: CaseLinePriceHistoryEntry[];
|
|
2867
|
+
}
|
|
2868
|
+
/** PDK-SERVICE-CHANGES — `CaseView.linePrices`: the line prices by receipt line `key`. */
|
|
2869
|
+
export type CaseLinePrices = Record<string, CaseLinePriceEntry>;
|
|
2870
|
+
/** PDK-SERVICE-CHANGES — what `cases.setLinePrice` sends. */
|
|
2871
|
+
export interface SetCaseLinePriceInput {
|
|
2872
|
+
/** The receipt line's `key` (a line of the order: product, service, booking or rental; not a free `off#n` line). */
|
|
2873
|
+
line: string;
|
|
2874
|
+
/** Price of ONE unit, whole cents, 0..2147483647 (0 = «gratis»). On a rented line: one unit over the whole range. */
|
|
2875
|
+
unitCents: number;
|
|
2876
|
+
/** `required`: a quote — the customer must accept or reject it; it applies only when they accept. `notify`: applied now and the customer is told. */
|
|
2877
|
+
answer: 'required' | 'notify';
|
|
2878
|
+
/** Words for the customer (≤ 500). */
|
|
2879
|
+
note?: string;
|
|
2880
|
+
/** What the price is made of; must add up to `unitCents` (≤ 10 items, label ≤ 80). */
|
|
2881
|
+
breakdown?: CaseLinePriceBreakdownItem[];
|
|
2882
|
+
/** Who of the business set it; default `{ id: 'business' }`. */
|
|
2883
|
+
by?: CaseLinePriceActor;
|
|
2809
2884
|
}
|
|
2810
2885
|
/** One option group's choice on a proposed alternative: the group and what was picked in it (ids, or names). */
|
|
2811
2886
|
export interface CaseProposalSwapOption {
|
|
@@ -2826,6 +2901,13 @@ export interface CaseProposalChange {
|
|
|
2826
2901
|
newAmountCents?: number;
|
|
2827
2902
|
/** PDK-OFF-CATALOG — what the customer said the whole line costs. */
|
|
2828
2903
|
askedAmountCents?: number;
|
|
2904
|
+
/** PDK-SERVICE-CHANGES — a quote of a line price (`cases.setLinePrice` with `answer: 'required'`): the unit price (and why) that applies only if the customer accepts (`answer: 'keep'`). */
|
|
2905
|
+
linePrice?: {
|
|
2906
|
+
unitCents: number;
|
|
2907
|
+
note?: string;
|
|
2908
|
+
breakdown?: CaseLinePriceBreakdownItem[];
|
|
2909
|
+
by: CaseLinePriceActor;
|
|
2910
|
+
};
|
|
2829
2911
|
swap?: {
|
|
2830
2912
|
/** '' for a free line's alternative (`free: true`): it is text, not a catalog product, unless the business linked one. */
|
|
2831
2913
|
productId: string;
|
|
@@ -2867,6 +2949,8 @@ export interface CaseProposal {
|
|
|
2867
2949
|
currency: string | null;
|
|
2868
2950
|
/** PDK-OFF-CATALOG — made by the business confirming free lines (`cases.confirmLine`), not proposed by hand. */
|
|
2869
2951
|
offCatalog?: true;
|
|
2952
|
+
/** PDK-SERVICE-CHANGES — a quote of line prices (`cases.setLinePrice`, `answer: 'required'`): the customer must accept or reject (`requiresAnswer` is true, never auto-accepted); each accepted price becomes the line's price and the receipt is re-issued; a rejected one leaves the line as it was. */
|
|
2953
|
+
linePrice?: true;
|
|
2870
2954
|
/** PDK-OFF-CATALOG — the customer MUST answer (a line is out or swapped, or its amount is over what they said × 1.2); payment waits for it. */
|
|
2871
2955
|
requiresAnswer?: boolean;
|
|
2872
2956
|
/**
|
|
@@ -2928,6 +3012,8 @@ export interface CaseReceipt {
|
|
|
2928
3012
|
confirmedSubtotalCents?: number;
|
|
2929
3013
|
/** PDK-OFF-CATALOG — free lines still waiting for the business (`totalCents` is null while it is above 0). */
|
|
2930
3014
|
pendingLines?: number;
|
|
3015
|
+
/** PDK-SERVICE-CHANGES — a line has no price yet: `totalCents` is null and nothing can be charged until the business prices it. Hide payment prompts while true (absent on an older platform). */
|
|
3016
|
+
pricePending?: boolean;
|
|
2931
3017
|
fields: Array<{
|
|
2932
3018
|
label: string;
|
|
2933
3019
|
value: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.89.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",
|