@agentforge-io/sdk-server 4.87.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 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';
@@ -29,7 +29,7 @@ export type { ListMarketplaceCategoriesInput } from './resources/marketplace';
29
29
  export { TenantConfigResource } from './resources/config';
30
30
  export { PlacesResource } from './resources/places';
31
31
  export { ContactsResource, ContactVerificationResource, ContactAddressesResource, ContactTagsResource, ContactListsResource, } from './resources/contacts';
32
- export type { ContactVerificationChannel, LinkContactInput, LinkContactResult, AppContact, ContactAvatarUploadTarget, ClaimContactInput, ClaimContactResult, StartVerificationInput, StartVerificationResult, ConfirmVerificationInput, ConfirmVerificationResult, ContactDocumentType, ContactDocumentInput, ContactDocument, ContactMatchedBy, ContactSummary, ContactSegment, ContactSort, ContactStats, ContactNote, BusinessContact, ContactPage, SearchContactsInput, CreateBusinessContactInput, UpdateBusinessContactInput, ContactAddress, ContactAddressInput, ContactTag, ContactList, } from './resources/contacts';
32
+ export type { ContactVerificationChannel, LinkContactInput, LinkContactResult, AppContact, ContactAvatarUploadTarget, ClaimContactInput, ClaimContactResult, StartVerificationInput, StartVerificationResult, ConfirmVerificationInput, ConfirmVerificationResult, ContactDocumentType, ContactDocumentInput, ContactDocument, ContactMatchedBy, ContactSummary, ContactSegment, ContactSort, ContactStats, ContactNote, BusinessContact, ContactProperties, ContactPropertiesPatch, ContactPropertyValue, ContactPage, SearchContactsInput, CreateBusinessContactInput, UpdateBusinessContactInput, ContactAddress, ContactAddressInput, ContactTag, ContactList, } from './resources/contacts';
33
33
  export { FilesResource } from './resources/files';
34
34
  export type { AppFileKind, SignAppFileInput, AppFileUploadTarget } from './resources/files';
35
35
  export { DeliveryResource } from './resources/delivery';
@@ -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
@@ -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
@@ -203,7 +203,24 @@ export interface ContactNote {
203
203
  createdAt: string;
204
204
  updatedAt: string;
205
205
  }
206
+ /** PDK-CONTACT-FIELDS C1 — a custom property value. Strings ≤ 500 characters; numbers finite. */
207
+ export type ContactPropertyValue = string | number | boolean;
208
+ /** What `BusinessContact.properties` holds: this App's properties of the contact. */
209
+ export type ContactProperties = Record<string, ContactPropertyValue>;
210
+ /**
211
+ * PDK-CONTACT-FIELDS C1 — `properties` on create/update (and `customer.properties` of `cases.createDirect*`).
212
+ * MERGED into the App's stored properties: a value sets or overwrites the key, `null` deletes it, absent keys are kept.
213
+ * Limits (400 otherwise, `error` = `invalid_properties` | `invalid_property_key` | `invalid_property_value` |
214
+ * `too_many_properties`): keys match `/^[a-z][a-z0-9_]{0,39}$/`, string values ≤ 500 characters, at most 50 keys
215
+ * stored per App per contact.
216
+ */
217
+ export type ContactPropertiesPatch = Record<string, ContactPropertyValue | null>;
206
218
  export interface BusinessContact extends ContactSummary {
219
+ /**
220
+ * PDK-CONTACT-FIELDS C1 — the custom properties YOUR App stored on this contact (namespaced per App: another App's
221
+ * keys are never visible nor overwritten). `{}` when none. Absent on a platform older than C1.
222
+ */
223
+ properties?: ContactProperties;
207
224
  marketingConsent: boolean;
208
225
  marketingConsentAt: string | null;
209
226
  notes: string | null;
@@ -240,6 +257,8 @@ export interface CreateBusinessContactInput {
240
257
  tags?: string[];
241
258
  /** «Acepta recibir promociones» (Ley 1581). Default `false`. */
242
259
  marketingConsent?: boolean;
260
+ /** PDK-CONTACT-FIELDS C1 — custom properties of this App on the contact (see `ContactPropertiesPatch`). */
261
+ properties?: ContactPropertiesPatch;
243
262
  }
244
263
  export interface UpdateBusinessContactInput {
245
264
  /** The business contact to change (`ContactSummary.id`). */
@@ -254,6 +273,8 @@ export interface UpdateBusinessContactInput {
254
273
  addTags?: string[];
255
274
  removeTags?: string[];
256
275
  marketingConsent?: boolean;
276
+ /** PDK-CONTACT-FIELDS C1 — MERGED into this App's properties; a `null` value deletes that key. */
277
+ properties?: ContactPropertiesPatch;
257
278
  }
258
279
  export interface ContactAddress {
259
280
  id: string;
@@ -25,6 +25,8 @@
25
25
  // - `create(...)` — needs a name, a phone or a document; a phone/document that
26
26
  // already exists throws `AgentForgeDuplicateContactError` (`existingId`).
27
27
  // - `getById(id)` · `update({ contactId, ... })` (documents, tags, consent).
28
+ // - `properties` (PDK-CONTACT-FIELDS C1) on `create` / `update` / `getById`: custom fields of YOUR App on the contact,
29
+ // merged per key (`null` deletes), namespaced per App (≤ 50 keys, key `[a-z][a-z0-9_]{0,39}`, string ≤ 500).
28
30
  // - `addresses.*` · `tags.*` (per-business catalog) · `lists.*` (static lists).
29
31
  Object.defineProperty(exports, "__esModule", { value: true });
30
32
  exports.ContactsResource = exports.ContactListsResource = exports.ContactTagsResource = exports.ContactNotesResource = exports.ContactAddressesResource = exports.ContactVerificationResource = void 0;
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
- export type CaseStateType = 'draft' | 'received' | 'preparing' | 'confirmed' | 'ready' | 'out_for_delivery' | 'completed' | 'canceled';
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;
@@ -2998,12 +3084,16 @@ export interface CreateDirectOrderInput {
2998
3084
  * Who orders: the App's visitor id, and the name and phone they gave (both required
2999
3085
  * unless `place`). A sale the team registers (`origin.channel` `pos`) may leave both
3000
3086
  * out: it is then named after its place («Mostrador», «Mesa 2») and has no phone.
3087
+ * `customer.properties` (PDK-CONTACT-FIELDS C1, also on open orders, bookings and rentals): custom contact properties of
3088
+ * your App, merged (`null` deletes) onto the contact the case links to once it is created; no linked contact → not
3089
+ * written. 400 (`invalid_property_*`) before anything is held when malformed.
3001
3090
  */
3002
3091
  customer: {
3003
3092
  ref: string;
3004
3093
  name?: string;
3005
3094
  phone?: string;
3006
3095
  contactId?: string;
3096
+ properties?: ContactPropertiesPatch;
3007
3097
  };
3008
3098
  /** AGF-ORDER-ORIGIN-POS — where it comes from; default `{ channel: 'page' }`. A `pos` sale needs `place` and `by`. */
3009
3099
  origin?: CaseOrigin;
@@ -3108,6 +3198,7 @@ export interface CreateOpenOrderInput {
3108
3198
  name?: string;
3109
3199
  phone?: string;
3110
3200
  contactId?: string;
3201
+ properties?: ContactPropertiesPatch;
3111
3202
  };
3112
3203
  origin: {
3113
3204
  channel: 'link';
@@ -3417,6 +3508,7 @@ export interface CreateDirectBookingInput {
3417
3508
  name: string;
3418
3509
  phone: string;
3419
3510
  contactId?: string;
3511
+ properties?: ContactPropertiesPatch;
3420
3512
  };
3421
3513
  /** A catalog service of the business with a `booking` rule. */
3422
3514
  serviceId: string;
@@ -3529,6 +3621,7 @@ export interface MoveCaseSlotInput {
3529
3621
  assigneeName?: string;
3530
3622
  }
3531
3623
  import type { AppBillingWebhookEvent } from './resources/billing';
3624
+ import type { ContactPropertiesPatch } from './resources/contacts';
3532
3625
  export type AppCaseWebhookEventName = 'case.submitted' | 'case.state_changed' | 'case.closed' | 'case.customer_request' | 'case.payment_changed' | 'case.proposal';
3533
3626
  export type AppWebhookEventName = AppCaseWebhookEventName | 'conversation.message' | 'channel.status_changed' | 'billing.plan_changed' | 'billing.trial_ended';
3534
3627
  export interface AppWebhook {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.87.0",
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",