@agentforge-io/sdk-server 4.74.0 → 4.76.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/billing.d.ts +17 -5
- package/dist/resources/billing.js +1 -1
- 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, AgentForgeBillingError, AGENTFORGE_BILLING_ERROR_CODES, } from './errors';
|
|
4
4
|
export type { AgentForgeBillingErrorCode } from './errors';
|
|
5
5
|
export { BillingResource } from './resources/billing';
|
|
6
|
-
export type { BillingEntitlement, BillingEntitlementStatus, BillingInterval, BillingLimits, BillingPlan, BillingInvoice, BillingPaymentMethod, BillingCheckoutInput, BillingStartTrialInput, AppBillingWebhookEvent, AppBillingWebhookEventName, AppBillingWebhookData, } from './resources/billing';
|
|
6
|
+
export type { BillingCurrency, BillingEntitlement, BillingEntitlementStatus, BillingInterval, BillingLimits, BillingPlan, BillingInvoice, BillingPaymentMethod, BillingCheckoutInput, BillingStartTrialInput, AppBillingWebhookEvent, AppBillingWebhookEventName, AppBillingWebhookData, } from './resources/billing';
|
|
7
7
|
export { APP_WEBHOOK_HEADERS, TOOL_CALLBACK_HEADERS, ToolCallbackSignatureError, signToolCallbackPayload, verifyAppWebhook, verifyToolCallbackSignature, } from './webhooks';
|
|
8
8
|
export { WebhookResource, type SetAppWebhookInput } from './resources/webhook';
|
|
9
9
|
export type { AppWebhook, AppWebhookEvent, AppWebhookEventName, AppCaseWebhookEvent, AppCaseWebhookEventName, AppConversationMessageWebhookEvent, AppChannelStatusWebhookEvent, AgentMe, AgentSummary, AppUserConnectorStatus, ApprovalCopyBundle, ChannelContext, ChatStreamChunk, ChatStreamEvent, ChatTokenRecord, ConnectorDefaultsResult, ConnectorDefaultsSource, ConnectorResourceItem, ConnectorStatus, ConnectorToolInfo, ConversationHistory, ConversationStatus, CreateAgentInput, CreateClickupTaskInput, CreateClickupTaskResult, ExternalToolSummary, IssueChatTokenInput, ListAgentsResult, ListConnectorResourcesResult, McpServerConfig, MessageRecord, MessageRole, PublicAppBranding, PublicProfileBlock, PublicProfileTemplate, PublicTeamLanding, CreateTeamInput, UpdateTeamInput, TeamSummary, TeamDetail, TeamTheme, TeamBusinessHours, TeamWeekday, TeamProfileBlock, ProfileBlockPlacement, ProfileBlockPosition, CatalogBlockPreview, ServiceCta, ServiceCtaAction, CatalogServicesBlockConfig, AppInstallation, TemplateConfigField, TemplateSummary, TemplateDetail, TemplateInstallStats, TemplatePublisher, TemplateAuthor, AppTemplatePolicy, TemplateCategoryRef, MarketplaceCategory, MarketplaceCategoryGroup, MarketplaceLocale, TemplateInstallResult, CheckSystemTemplateResult, TemplatePublishIssue, UpsertSystemTemplateInput, UpsertSystemTemplateResult, TemplateReview, TemplateRatingSummary, TemplateReviewsPage, BusinessReview, BusinessReviewsPage, ProductRatingSummary, ProductReview, ProductReviewOwner, ProductReviewsPage, ProductReviewsOwnerPage, ListProductReviewsInput, ListProductReviewsForOwnerInput, HideProductReviewInput, ProductLikeResult, ReceiptReviewable, ReceiptReviewables, SaveReceiptReviewInput, ListTemplateReviewsInput, SaveTemplateReviewInput, TemplateReportKind, CreateTemplateReportInput, TenantConfigEntry, Place, PlaceSuggestion, SearchPlacesInput, AutocompletePlacesInput, PlacesScope, CaseField, CaseBusinessState, CaseType, CaseState, CaseStateType, CasePayment, CasePaymentAccount, CasePaymentStatus, CaseReceiptPayment, CaseDestination, CaseView, CaseStateStep, CreateDirectOrderInput, CreateOpenOrderInput, OpenOrderFreeLine, OpenOrderLineMark, OpenOrderPayment, CreateDirectBookingInput, MoveCaseSlotInput, CaseSlot, CatalogAttendedAt, CatalogBookingRule, CaseOrigin, CaseOriginChannel, DirectOrderForm, DirectPaymentOption, CaseClosingMethod, CaseClosingOrder, CaseClosingReport, CaseReportPage, CaseReceipt, CaseReceiptLine, CaseProposal, CaseProposalAnswer, CaseProposalChange, CaseProposalInput, ListCasesInput, AddressValue, DeliveryLocalPricing, DeliverySettings, PaymentMethodKind, PaymentSettings, PaymentSettingsInput, PaymentAccount, PaymentCountry, PaymentFieldDef, PaymentMethodDef, StructuredConfigInput, StructuredConfigEntry, DeliveryQuoteStatus, DeliveryQuoteInput, DeliveryPricePreview, DeliveryPricingPreview, DeliveryPricingPreviewInput, DeliveryRoute, DeliveryRouteInput, DeliveryQuote, AppSelf, AppOwner, AppSelfConnector, AppSelfConnectors, AppSelfConnectorTools, AppSelfConnectorToolsResponse, RegisterToolInput, RegisterToolsInput, BusinessRoleEntry, Catalog, CatalogCheckoutCta, CatalogCategory, CatalogProduct, CatalogProductPhoto, CatalogProductKind, CatalogProductStatus, CatalogPriceKind, CatalogAvailability, CatalogLockableField, CatalogProductPage, UpsertCatalogInput, CreateCatalogCategoryInput, ListCatalogCategoriesInput, UpdateCatalogCategoryInput, CreateCatalogProductInput, UpdateCatalogProductInput, ListCatalogProductsInput, CatalogPhotoUploadTarget, SignCatalogPhotoUploadInput, AttachCatalogPhotoInput, AttachCatalogCategoryImageInput, CatalogImportItem, CatalogImportPreview, CatalogImportApplyResult, CatalogFileMapping, CatalogFilePlan, CatalogFilePreview, CatalogFileApplyResult, CatalogFileInput, CatalogFilePreviewInput, CatalogMenuItem, CatalogMenuRead, CatalogMenuReadInput, CatalogMenuAttachInput, CatalogMenuChatFile, CatalogMenuKeepInSyncInput, CatalogMenuKeepInSyncResult, CatalogOption, CatalogOptionGroup, SaveCatalogOptionGroupInput, CatalogOptionChoice, CatalogOptionChange, CatalogOptionChangesPlan, CatalogUnit, SaveCatalogUnitInput, CatalogSaleRule, CatalogFileApplyInput, CatalogFileErrorCode, CatalogImportSourceStatus, CatalogImportColumnMapping, CatalogImportRunResult, CatalogImportSource, CreateCatalogImportSourceInput, UpdateCatalogImportSourceInput, PreviewCatalogImportSourceInput, CatalogImportSourcePreview, CatalogSheetTab, CatalogTemplateSheet, CreateCatalogTemplateSheetInput, ReferenceMatchItemInput, ReferenceMatchDecisionKind, ReferenceMatchCandidate, ReferenceMatchDecision, ReferenceMatchInput, ReferenceMatchResult, ReferenceProductInput, ReferenceProductsBulkInput, ReferenceProductsBulkResult, ReferenceProduct, ListReferenceProductsInput, ReferenceProductPage, GoogleSheetsPickerInput, GoogleSheetsPickerSession, GoogleSheetsPickerErrorCode, GoogleSheetsPickerResult, RegisterToolsResult, ToolCallbackPayload, ToolCallRecord, ToolPermission, ToolPermissionMode, TokenUsage, TenantSecretEntry, UpdateAgentInput, InboxThreadMode, InboxMessageDirection, InboxMessageSource, InboxMessageType, InboxThreadCustomerProfileView, InboxThreadView, InboxMessageView, SupportKpiTotals, SupportKpiResponse, AgentAttentionLogRow, } from './types';
|
|
@@ -17,6 +17,12 @@ export interface BillingLimits {
|
|
|
17
17
|
maxChatTokens?: number;
|
|
18
18
|
custom?: Record<string, number>;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* ISO 4217 currency of an App's billing plans (PDK-BILLING-COP). One currency per App, set when its plans are seeded;
|
|
22
|
+
* `priceInCents` is in that currency's minor units (COP: 36.900 COP = 3690000, as Lemon Squeezy). The platform's own
|
|
23
|
+
* plans stay USD. New currencies are added server-side (`BILLING_CURRENCIES`) and here.
|
|
24
|
+
*/
|
|
25
|
+
export type BillingCurrency = 'USD' | 'COP';
|
|
20
26
|
/** What the tenant is entitled to right now. `canceled` + `cancelAtPeriodEnd` still has access until `currentPeriodEnd`. */
|
|
21
27
|
export interface BillingEntitlement {
|
|
22
28
|
planId: string;
|
|
@@ -30,7 +36,7 @@ export interface BillingEntitlement {
|
|
|
30
36
|
cancelAtPeriodEnd: boolean;
|
|
31
37
|
priceInCents: number | null;
|
|
32
38
|
interval: BillingInterval | null;
|
|
33
|
-
currency:
|
|
39
|
+
currency: BillingCurrency;
|
|
34
40
|
features: string[];
|
|
35
41
|
limits: BillingLimits;
|
|
36
42
|
subscriptionId: string | null;
|
|
@@ -41,7 +47,7 @@ export interface BillingPlan {
|
|
|
41
47
|
description: string | null;
|
|
42
48
|
priceInCents: number | null;
|
|
43
49
|
interval: BillingInterval | null;
|
|
44
|
-
currency:
|
|
50
|
+
currency: BillingCurrency;
|
|
45
51
|
isDefault: boolean;
|
|
46
52
|
features: string[];
|
|
47
53
|
limits: BillingLimits;
|
|
@@ -64,8 +70,14 @@ export interface BillingPaymentMethod {
|
|
|
64
70
|
export interface BillingStartTrialInput {
|
|
65
71
|
/** Slug of the plan to trial (not the default plan). */
|
|
66
72
|
planId: string;
|
|
67
|
-
/** 1 to 90. */
|
|
68
|
-
days
|
|
73
|
+
/** 1 to 90, from now. Send `days` OR `endsAt`, not both. */
|
|
74
|
+
days?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Explicit end of the trial (ISO 8601 with offset/`Z`), to run it from an earlier date, e.g. the business's registration.
|
|
77
|
+
* Must be in the future and at most 90 days from now: the platform rejects an already-over trial with
|
|
78
|
+
* `invalid_request` (the App just does not start one). Send `days` OR `endsAt`, not both.
|
|
79
|
+
*/
|
|
80
|
+
endsAt?: string;
|
|
69
81
|
}
|
|
70
82
|
export interface BillingCheckoutInput {
|
|
71
83
|
planId: string;
|
|
@@ -103,7 +115,7 @@ export declare class BillingResource {
|
|
|
103
115
|
private call;
|
|
104
116
|
/** `GET /api/v1/billing/entitlements` — plan, status, trial, period, limits. Self-heals an expired trial. */
|
|
105
117
|
entitlements(): Promise<BillingEntitlement>;
|
|
106
|
-
/** `POST /api/v1/billing/trial/start` — a no-card trial, once per tenant. `trial_already_used` / `already_subscribed` (409). */
|
|
118
|
+
/** `POST /api/v1/billing/trial/start` — a no-card trial (`days` from now, or until `endsAt`), once per tenant. `trial_already_used` / `already_subscribed` (409). */
|
|
107
119
|
startTrial(input: BillingStartTrialInput): Promise<BillingEntitlement>;
|
|
108
120
|
/** `GET /api/v1/billing/plans` — the App's plans, without provider refs. */
|
|
109
121
|
plans(): Promise<BillingPlan[]>;
|
|
@@ -50,7 +50,7 @@ class BillingResource {
|
|
|
50
50
|
entitlements() {
|
|
51
51
|
return this.call('GET', '/entitlements');
|
|
52
52
|
}
|
|
53
|
-
/** `POST /api/v1/billing/trial/start` — a no-card trial, once per tenant. `trial_already_used` / `already_subscribed` (409). */
|
|
53
|
+
/** `POST /api/v1/billing/trial/start` — a no-card trial (`days` from now, or until `endsAt`), once per tenant. `trial_already_used` / `already_subscribed` (409). */
|
|
54
54
|
startTrial(input) {
|
|
55
55
|
return this.call('POST', '/trial/start', input);
|
|
56
56
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.76.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",
|