@aifeatures/admin-react 0.10.0 → 0.12.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.cjs +4 -4
- package/dist/index.d.cts +89 -3
- package/dist/index.d.ts +89 -3
- package/dist/index.js +4 -4
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -109,8 +109,24 @@ interface ApiError {
|
|
|
109
109
|
* cannot be answered for this site and period, which is a thing the merchant
|
|
110
110
|
* can act on. Rendering it as "we can't reach analytics" strands them with a
|
|
111
111
|
* filter applied, every report gone, and a Retry that repeats the failure.
|
|
112
|
+
*
|
|
113
|
+
* `range_invalid` is the same kind of fact about an explicit `from`/`to`
|
|
114
|
+
* window: it is inverted, malformed, longer than the maximum span, or sent
|
|
115
|
+
* alongside a `period` that names a different window. The panel does not
|
|
116
|
+
* send ranges today, but a TypeScript consumer of this package that does
|
|
117
|
+
* cannot narrow on a code the union omits.
|
|
118
|
+
*
|
|
119
|
+
* `dimension_unsupported` is the cross-tab equivalent: the report cannot be
|
|
120
|
+
* crossed against the second dimension asked for — because it is `channel`,
|
|
121
|
+
* which is classified rather than stored; because the report already spends
|
|
122
|
+
* its one second-dimension slot on a disambiguator; or because that kind of
|
|
123
|
+
* report has no row set to split at all.
|
|
124
|
+
*
|
|
125
|
+
* All three are EXPECTED consequences of the request, never outages, so a
|
|
126
|
+
* client that cannot tell them apart from an unreachable source shows the
|
|
127
|
+
* wrong recovery for every one of them.
|
|
112
128
|
*/
|
|
113
|
-
code?: 'filter_unsupported';
|
|
129
|
+
code?: 'filter_unsupported' | 'range_invalid' | 'dimension_unsupported';
|
|
114
130
|
}
|
|
115
131
|
/**
|
|
116
132
|
* A site's payment readiness (sites.paymentsStatus)
|
|
@@ -454,6 +470,14 @@ interface LineItem {
|
|
|
454
470
|
variantTitle?: string;
|
|
455
471
|
/** Unit price in the currency's minor unit. */
|
|
456
472
|
unitAmount?: number;
|
|
473
|
+
/** Final line money; amountNet includes inclusive tax, amountTotal adds exclusive tax. */
|
|
474
|
+
amountSubtotal?: number;
|
|
475
|
+
amountDiscount?: number;
|
|
476
|
+
amountNet?: number;
|
|
477
|
+
amountTax?: number;
|
|
478
|
+
amountTotal?: number;
|
|
479
|
+
exclusiveTax?: number;
|
|
480
|
+
unavailableReason?: "oversold";
|
|
457
481
|
quantity?: number;
|
|
458
482
|
/**
|
|
459
483
|
* The product image as it looked at checkout, snapshotted onto the line so a
|
|
@@ -492,6 +516,16 @@ interface LineItem {
|
|
|
492
516
|
* currency's minor unit.
|
|
493
517
|
*/
|
|
494
518
|
interface Order {
|
|
519
|
+
application_fee_original?: number | null;
|
|
520
|
+
application_fee_returned?: number | null;
|
|
521
|
+
application_fee_retained?: number | null;
|
|
522
|
+
application_fee_currency?: string | null;
|
|
523
|
+
application_fee_state?: 'pending' | 'complete' | 'manual_attention' | null;
|
|
524
|
+
amount_subtotal?: number | null;
|
|
525
|
+
discount_total?: number;
|
|
526
|
+
exclusive_tax_total?: number | null;
|
|
527
|
+
/** Zero-paid renewal history; no fulfillment or receipt resend actions. */
|
|
528
|
+
subscription_history_only?: boolean;
|
|
495
529
|
email_deliveries?: EmailDelivery[];
|
|
496
530
|
id: string;
|
|
497
531
|
/**
|
|
@@ -513,6 +547,9 @@ interface Order {
|
|
|
513
547
|
stripe_checkout_session_id: string | null;
|
|
514
548
|
stripe_payment_intent_id: string | null;
|
|
515
549
|
amount_total: number;
|
|
550
|
+
/** Cash collected and account credit; optional for older API responses. */
|
|
551
|
+
amount_paid?: number | null;
|
|
552
|
+
credit_applied?: number | null;
|
|
516
553
|
amount_refunded: number;
|
|
517
554
|
/**
|
|
518
555
|
* Postage Stripe charged on top of amount_total (minor units, charge
|
|
@@ -1429,6 +1466,46 @@ declare const MAX_ANALYTICS_FILTERS = 3;
|
|
|
1429
1466
|
declare const MAX_ANALYTICS_FILTER_VALUES = 100;
|
|
1430
1467
|
/** The breakdown reports the panel can ask for, by path segment. */
|
|
1431
1468
|
type AnalyticsBreakdownName = 'sources' | 'campaigns' | 'utm/medium' | 'utm/source' | 'utm/campaign' | 'utm/content' | 'utm/term' | 'pages' | 'entry-pages' | 'exit-pages' | 'countries' | 'regions' | 'cities' | 'devices' | 'browsers' | 'operating-systems';
|
|
1469
|
+
/** Merchant promotions managed on the connected Stripe account. */
|
|
1470
|
+
interface CreatePromoInput {
|
|
1471
|
+
request_id: string;
|
|
1472
|
+
code: string;
|
|
1473
|
+
name: string;
|
|
1474
|
+
percent_off?: number;
|
|
1475
|
+
amount_off?: number;
|
|
1476
|
+
currency?: string;
|
|
1477
|
+
minimum_amount?: number;
|
|
1478
|
+
expires_at?: string;
|
|
1479
|
+
max_redemptions?: number;
|
|
1480
|
+
duration: 'once' | 'forever' | 'repeating';
|
|
1481
|
+
duration_in_months?: number;
|
|
1482
|
+
}
|
|
1483
|
+
interface Promo {
|
|
1484
|
+
id: string;
|
|
1485
|
+
site_id: string;
|
|
1486
|
+
stripe_account_id: string;
|
|
1487
|
+
code: string;
|
|
1488
|
+
name: string;
|
|
1489
|
+
percent_off: number | null;
|
|
1490
|
+
amount_off: number | null;
|
|
1491
|
+
currency: string | null;
|
|
1492
|
+
minimum_amount: number | null;
|
|
1493
|
+
expires_at: string | null;
|
|
1494
|
+
max_redemptions: number | null;
|
|
1495
|
+
duration: CreatePromoInput['duration'];
|
|
1496
|
+
duration_in_months: number | null;
|
|
1497
|
+
status: 'active' | 'inactive' | 'expired' | 'exhausted' | 'pending' | 'unavailable';
|
|
1498
|
+
times_redeemed: number | null;
|
|
1499
|
+
eligibility_scope: 'connected_account';
|
|
1500
|
+
checkout_enabled: boolean;
|
|
1501
|
+
created_at: string;
|
|
1502
|
+
replaces_id: string | null;
|
|
1503
|
+
}
|
|
1504
|
+
interface PromosListResponse {
|
|
1505
|
+
promos: Promo[];
|
|
1506
|
+
next_cursor: string | null;
|
|
1507
|
+
checkout_enabled: boolean;
|
|
1508
|
+
}
|
|
1432
1509
|
|
|
1433
1510
|
declare class AifeaturesApiError extends Error {
|
|
1434
1511
|
status: number;
|
|
@@ -1446,6 +1523,11 @@ interface AifeaturesApiClient {
|
|
|
1446
1523
|
deleteSubmission(submissionId: string): Promise<void>;
|
|
1447
1524
|
downloadAttachment(submissionId: string, attachment: string | Pick<Attachment, 'id' | 'name'>): Promise<void>;
|
|
1448
1525
|
getPaymentsStatus(): Promise<PaymentsStatusResponse>;
|
|
1526
|
+
getPromos(cursor?: string): Promise<PromosListResponse>;
|
|
1527
|
+
getPromo(id: string): Promise<Promo>;
|
|
1528
|
+
createPromo(input: CreatePromoInput): Promise<Promo>;
|
|
1529
|
+
disablePromo(id: string): Promise<Promo>;
|
|
1530
|
+
replacePromo(id: string, input: CreatePromoInput): Promise<Promo>;
|
|
1449
1531
|
/** Pass `{ include: 'stats' }` to attach rolling-30-day sales stats (owner-side surfaces only). */
|
|
1450
1532
|
getProducts(options?: GetProductsOptions): Promise<Product[]>;
|
|
1451
1533
|
/** Returns the product detail (flat fields + options + variants). */
|
|
@@ -1695,7 +1777,7 @@ interface PaymentsDashboardProps {
|
|
|
1695
1777
|
/** Optional className */
|
|
1696
1778
|
className?: string;
|
|
1697
1779
|
/** Which tab to open initially */
|
|
1698
|
-
defaultTab?: "products" | "orders" | "invoices" | "customers" | "setup";
|
|
1780
|
+
defaultTab?: "products" | "orders" | "invoices" | "customers" | "promos" | "setup";
|
|
1699
1781
|
/**
|
|
1700
1782
|
* Host-app callback that starts (or resumes) Stripe Connect onboarding —
|
|
1701
1783
|
* shown on the Setup tab when the site still needs Stripe.
|
|
@@ -2114,6 +2196,9 @@ interface RetainersPanelProps {
|
|
|
2114
2196
|
}
|
|
2115
2197
|
declare function RetainersPanel({ retainers, isLoading, error, onRetry, onShowCycles, activeRetainerId, total, endedTotal, isLoadingMore, onLoadMore, includeEnded, onIncludeEndedChange, className }: RetainersPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
2116
2198
|
|
|
2199
|
+
/** Shared merchant dashboard surface; all writes use the same API as agent tools. */
|
|
2200
|
+
declare function PromosPanel(): react_jsx_runtime.JSX.Element;
|
|
2201
|
+
|
|
2117
2202
|
interface UseFormsReturn {
|
|
2118
2203
|
forms: Form[];
|
|
2119
2204
|
isLoading: boolean;
|
|
@@ -2620,6 +2705,7 @@ declare function chargedTotal(order: {
|
|
|
2620
2705
|
tax_total?: number;
|
|
2621
2706
|
tax_behavior?: 'inclusive' | 'exclusive' | null;
|
|
2622
2707
|
automatic_tax?: boolean;
|
|
2708
|
+
exclusive_tax_total?: number | null;
|
|
2623
2709
|
}): number;
|
|
2624
2710
|
/**
|
|
2625
2711
|
* Convert a major-unit amount ("29.99") to the currency's integer minor unit
|
|
@@ -2679,4 +2765,4 @@ interface AnalyticsViewProps {
|
|
|
2679
2765
|
*/
|
|
2680
2766
|
declare function AnalyticsView({ filters: filtersProp, onFiltersChange, refreshKey, onBackToWebsite, className, published, lastPublishedAt, }: AnalyticsViewProps): react_jsx_runtime.JSX.Element;
|
|
2681
2767
|
|
|
2682
|
-
export { type AdjustInventoryInput, type AifeaturesApiClient, AifeaturesApiError, type AifeaturesContextValue, AifeaturesProvider, type AifeaturesProviderProps, type AnalyticsBreakdown, type AnalyticsBreakdownName, type AnalyticsBreakdownRow, type AnalyticsChannelRow, type AnalyticsChannels, type AnalyticsFilter, type AnalyticsFilterDimension, type AnalyticsPeriod, type AnalyticsRealtime, type AnalyticsSourced, type AnalyticsStatus, type AnalyticsSummary, type AnalyticsSummaryData, type AnalyticsSummaryMetrics, type AnalyticsTimeseries, type AnalyticsTimeseriesRow, AnalyticsView, type AnalyticsViewProps, type ApiError, type Attachment, type BusinessSummary, type BusinessVisitors, type CreateEventDestinationInput, type CreateFormInput, type CreateOptionInput, type CreateProductInput, type CreateVariantInput, type Customer, type CustomerAddress, CustomerDetail, type CustomerDetail$1 as CustomerDetailData, type CustomerDetailProps, CustomersList, type CustomersListProps, type CustomersListResponse, type EmailDelivery, type EmailSideStatus, type EventDeliveriesListResponse, type EventDelivery, type EventDestination, type EventDestinationSecretResponse, type EventDestinationsListResponse, type Form, FormSettings, type FormSettingsProps, FormSubmissions, type FormSubmissionsProps, FormsDashboard, type FormsDashboardProps, FormsList, type FormsListProps, type FormsListResponse, type GetBusinessSummaryOptions, type GetCustomersOptions, type GetInvoicesOptions, type GetOrdersOptions, type GetPeopleOptions, type GetProductsOptions, type GetSubmissionsOptions, type GetSubscriptionsOptions, type Invoice, type InvoiceAggregates, type InvoiceBillTo, type InvoiceDeliveryState, InvoiceDetail, type InvoiceDetailProps, type InvoiceLabel, InvoiceLabelBadge, type InvoiceLineItem, type InvoicePreview, type InvoiceSettings, InvoicesList, type InvoicesListProps, InvoicesView, type InvoicesViewProps, LeadsView, type LeadsViewProps, type LowStockProduct, MAX_ANALYTICS_FILTERS, MAX_ANALYTICS_FILTER_VALUES, type NeedsAttentionItem, type NeedsAttentionType, type Order, OrderDetail, type OrderDetailProps, type OrderStatus, OrderStatusBadge, OrdersList, type OrdersListProps, OrdersView, type OrdersViewProps, type PaginatedInvoices, type PaginatedOrders, type PaginatedSubmissions, type PaginatedSubscriptions, PaymentsDashboard, type PaymentsDashboardProps, PaymentsSetup, type PaymentsSetupProps, type PaymentsStatus, type PaymentsStatusReason, type PaymentsStatusResponse, type PeopleListResponse, type Person, type PersonDetail, type PersonOrder, type PersonSource, type PersonSubmission, type Product, type ProductDetail, type ProductFulfillment, type ProductFulfillmentType, type ProductOption, ProductSettings, type ProductSettingsProps, type ProductStats, type ProductVariant, ProductsList, type ProductsListProps, type ProductsListResponse, ProductsView, type ProductsViewProps, REALTIME_FAILURES_BEFORE_ERROR, REALTIME_POLL_MS, type RefundRequest, type ReportSlot, RetainerStatusBadge, RetainersPanel, type RetainersPanelProps, type RevenueCurrencyTotal, type RevenuePeriod, type SetInventoryInput, type SetOrderFulfillmentInput, type SettledRevenue, type Submission, SubmissionDetail, type SubmissionDetailProps, type SubmissionMetadata, type Subscription, SubscriptionsView, type SubscriptionsViewProps, type UpdateEventDestinationInput, type UpdateFormInput, type UpdateOptionInput, type UpdateProductInput, type UpdateVariantInput, type UseAnalyticsOptions, type UseAnalyticsReturn, type UseBusinessSummaryOptions, type UseBusinessSummaryReturn, type UseCustomersOptions, type UseCustomersReturn, type UseEventDestinationsReturn, type UseFormsReturn, type UseInvoicesOptions, type UseInvoicesReturn, type UseOrdersOptions, type UseOrdersReturn, type UsePaymentsStatusReturn, type UsePeopleOptions, type UsePeopleReturn, type UsePersonOptions, type UsePersonReturn, type UseProductsOptions, type UseProductsReturn, type UseRealtimeVisitorsReturn, type UseSubmissionsOptions, type UseSubmissionsReturn, type UseSubscriptionsOptions, type UseSubscriptionsReturn, type VariantInventory, type VariantOptionValue, VariantsEditor, type VariantsEditorProps, ViewShell, type ViewShellProps, WebhookDeliveries, type WebhookDeliveriesProps, WebhookSettings, type WebhookSettingsProps, chargedTotal, createApiClient, formatPrice, isZeroDecimalCurrency, toMajorUnits, toMinorUnits, useAifeaturesContext as useAifeatures, useAifeaturesContext, useAnalytics, useBusinessSummary, useCustomers, useEventDestinations, useForms, useInvoices, useOrders, usePaymentsStatus, usePeople, usePerson, useProducts, useRealtimeVisitors, useRetainers, useSubmissions, useSubscriptions };
|
|
2768
|
+
export { type AdjustInventoryInput, type AifeaturesApiClient, AifeaturesApiError, type AifeaturesContextValue, AifeaturesProvider, type AifeaturesProviderProps, type AnalyticsBreakdown, type AnalyticsBreakdownName, type AnalyticsBreakdownRow, type AnalyticsChannelRow, type AnalyticsChannels, type AnalyticsFilter, type AnalyticsFilterDimension, type AnalyticsPeriod, type AnalyticsRealtime, type AnalyticsSourced, type AnalyticsStatus, type AnalyticsSummary, type AnalyticsSummaryData, type AnalyticsSummaryMetrics, type AnalyticsTimeseries, type AnalyticsTimeseriesRow, AnalyticsView, type AnalyticsViewProps, type ApiError, type Attachment, type BusinessSummary, type BusinessVisitors, type CreateEventDestinationInput, type CreateFormInput, type CreateOptionInput, type CreateProductInput, type CreatePromoInput, type CreateVariantInput, type Customer, type CustomerAddress, CustomerDetail, type CustomerDetail$1 as CustomerDetailData, type CustomerDetailProps, CustomersList, type CustomersListProps, type CustomersListResponse, type EmailDelivery, type EmailSideStatus, type EventDeliveriesListResponse, type EventDelivery, type EventDestination, type EventDestinationSecretResponse, type EventDestinationsListResponse, type Form, FormSettings, type FormSettingsProps, FormSubmissions, type FormSubmissionsProps, FormsDashboard, type FormsDashboardProps, FormsList, type FormsListProps, type FormsListResponse, type GetBusinessSummaryOptions, type GetCustomersOptions, type GetInvoicesOptions, type GetOrdersOptions, type GetPeopleOptions, type GetProductsOptions, type GetSubmissionsOptions, type GetSubscriptionsOptions, type Invoice, type InvoiceAggregates, type InvoiceBillTo, type InvoiceDeliveryState, InvoiceDetail, type InvoiceDetailProps, type InvoiceLabel, InvoiceLabelBadge, type InvoiceLineItem, type InvoicePreview, type InvoiceSettings, InvoicesList, type InvoicesListProps, InvoicesView, type InvoicesViewProps, LeadsView, type LeadsViewProps, type LowStockProduct, MAX_ANALYTICS_FILTERS, MAX_ANALYTICS_FILTER_VALUES, type NeedsAttentionItem, type NeedsAttentionType, type Order, OrderDetail, type OrderDetailProps, type OrderStatus, OrderStatusBadge, OrdersList, type OrdersListProps, OrdersView, type OrdersViewProps, type PaginatedInvoices, type PaginatedOrders, type PaginatedSubmissions, type PaginatedSubscriptions, PaymentsDashboard, type PaymentsDashboardProps, PaymentsSetup, type PaymentsSetupProps, type PaymentsStatus, type PaymentsStatusReason, type PaymentsStatusResponse, type PeopleListResponse, type Person, type PersonDetail, type PersonOrder, type PersonSource, type PersonSubmission, type Product, type ProductDetail, type ProductFulfillment, type ProductFulfillmentType, type ProductOption, ProductSettings, type ProductSettingsProps, type ProductStats, type ProductVariant, ProductsList, type ProductsListProps, type ProductsListResponse, ProductsView, type ProductsViewProps, type Promo, type PromosListResponse, PromosPanel, REALTIME_FAILURES_BEFORE_ERROR, REALTIME_POLL_MS, type RefundRequest, type ReportSlot, RetainerStatusBadge, RetainersPanel, type RetainersPanelProps, type RevenueCurrencyTotal, type RevenuePeriod, type SetInventoryInput, type SetOrderFulfillmentInput, type SettledRevenue, type Submission, SubmissionDetail, type SubmissionDetailProps, type SubmissionMetadata, type Subscription, SubscriptionsView, type SubscriptionsViewProps, type UpdateEventDestinationInput, type UpdateFormInput, type UpdateOptionInput, type UpdateProductInput, type UpdateVariantInput, type UseAnalyticsOptions, type UseAnalyticsReturn, type UseBusinessSummaryOptions, type UseBusinessSummaryReturn, type UseCustomersOptions, type UseCustomersReturn, type UseEventDestinationsReturn, type UseFormsReturn, type UseInvoicesOptions, type UseInvoicesReturn, type UseOrdersOptions, type UseOrdersReturn, type UsePaymentsStatusReturn, type UsePeopleOptions, type UsePeopleReturn, type UsePersonOptions, type UsePersonReturn, type UseProductsOptions, type UseProductsReturn, type UseRealtimeVisitorsReturn, type UseSubmissionsOptions, type UseSubmissionsReturn, type UseSubscriptionsOptions, type UseSubscriptionsReturn, type VariantInventory, type VariantOptionValue, VariantsEditor, type VariantsEditorProps, ViewShell, type ViewShellProps, WebhookDeliveries, type WebhookDeliveriesProps, WebhookSettings, type WebhookSettingsProps, chargedTotal, createApiClient, formatPrice, isZeroDecimalCurrency, toMajorUnits, toMinorUnits, useAifeaturesContext as useAifeatures, useAifeaturesContext, useAnalytics, useBusinessSummary, useCustomers, useEventDestinations, useForms, useInvoices, useOrders, usePaymentsStatus, usePeople, usePerson, useProducts, useRealtimeVisitors, useRetainers, useSubmissions, useSubscriptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -109,8 +109,24 @@ interface ApiError {
|
|
|
109
109
|
* cannot be answered for this site and period, which is a thing the merchant
|
|
110
110
|
* can act on. Rendering it as "we can't reach analytics" strands them with a
|
|
111
111
|
* filter applied, every report gone, and a Retry that repeats the failure.
|
|
112
|
+
*
|
|
113
|
+
* `range_invalid` is the same kind of fact about an explicit `from`/`to`
|
|
114
|
+
* window: it is inverted, malformed, longer than the maximum span, or sent
|
|
115
|
+
* alongside a `period` that names a different window. The panel does not
|
|
116
|
+
* send ranges today, but a TypeScript consumer of this package that does
|
|
117
|
+
* cannot narrow on a code the union omits.
|
|
118
|
+
*
|
|
119
|
+
* `dimension_unsupported` is the cross-tab equivalent: the report cannot be
|
|
120
|
+
* crossed against the second dimension asked for — because it is `channel`,
|
|
121
|
+
* which is classified rather than stored; because the report already spends
|
|
122
|
+
* its one second-dimension slot on a disambiguator; or because that kind of
|
|
123
|
+
* report has no row set to split at all.
|
|
124
|
+
*
|
|
125
|
+
* All three are EXPECTED consequences of the request, never outages, so a
|
|
126
|
+
* client that cannot tell them apart from an unreachable source shows the
|
|
127
|
+
* wrong recovery for every one of them.
|
|
112
128
|
*/
|
|
113
|
-
code?: 'filter_unsupported';
|
|
129
|
+
code?: 'filter_unsupported' | 'range_invalid' | 'dimension_unsupported';
|
|
114
130
|
}
|
|
115
131
|
/**
|
|
116
132
|
* A site's payment readiness (sites.paymentsStatus)
|
|
@@ -454,6 +470,14 @@ interface LineItem {
|
|
|
454
470
|
variantTitle?: string;
|
|
455
471
|
/** Unit price in the currency's minor unit. */
|
|
456
472
|
unitAmount?: number;
|
|
473
|
+
/** Final line money; amountNet includes inclusive tax, amountTotal adds exclusive tax. */
|
|
474
|
+
amountSubtotal?: number;
|
|
475
|
+
amountDiscount?: number;
|
|
476
|
+
amountNet?: number;
|
|
477
|
+
amountTax?: number;
|
|
478
|
+
amountTotal?: number;
|
|
479
|
+
exclusiveTax?: number;
|
|
480
|
+
unavailableReason?: "oversold";
|
|
457
481
|
quantity?: number;
|
|
458
482
|
/**
|
|
459
483
|
* The product image as it looked at checkout, snapshotted onto the line so a
|
|
@@ -492,6 +516,16 @@ interface LineItem {
|
|
|
492
516
|
* currency's minor unit.
|
|
493
517
|
*/
|
|
494
518
|
interface Order {
|
|
519
|
+
application_fee_original?: number | null;
|
|
520
|
+
application_fee_returned?: number | null;
|
|
521
|
+
application_fee_retained?: number | null;
|
|
522
|
+
application_fee_currency?: string | null;
|
|
523
|
+
application_fee_state?: 'pending' | 'complete' | 'manual_attention' | null;
|
|
524
|
+
amount_subtotal?: number | null;
|
|
525
|
+
discount_total?: number;
|
|
526
|
+
exclusive_tax_total?: number | null;
|
|
527
|
+
/** Zero-paid renewal history; no fulfillment or receipt resend actions. */
|
|
528
|
+
subscription_history_only?: boolean;
|
|
495
529
|
email_deliveries?: EmailDelivery[];
|
|
496
530
|
id: string;
|
|
497
531
|
/**
|
|
@@ -513,6 +547,9 @@ interface Order {
|
|
|
513
547
|
stripe_checkout_session_id: string | null;
|
|
514
548
|
stripe_payment_intent_id: string | null;
|
|
515
549
|
amount_total: number;
|
|
550
|
+
/** Cash collected and account credit; optional for older API responses. */
|
|
551
|
+
amount_paid?: number | null;
|
|
552
|
+
credit_applied?: number | null;
|
|
516
553
|
amount_refunded: number;
|
|
517
554
|
/**
|
|
518
555
|
* Postage Stripe charged on top of amount_total (minor units, charge
|
|
@@ -1429,6 +1466,46 @@ declare const MAX_ANALYTICS_FILTERS = 3;
|
|
|
1429
1466
|
declare const MAX_ANALYTICS_FILTER_VALUES = 100;
|
|
1430
1467
|
/** The breakdown reports the panel can ask for, by path segment. */
|
|
1431
1468
|
type AnalyticsBreakdownName = 'sources' | 'campaigns' | 'utm/medium' | 'utm/source' | 'utm/campaign' | 'utm/content' | 'utm/term' | 'pages' | 'entry-pages' | 'exit-pages' | 'countries' | 'regions' | 'cities' | 'devices' | 'browsers' | 'operating-systems';
|
|
1469
|
+
/** Merchant promotions managed on the connected Stripe account. */
|
|
1470
|
+
interface CreatePromoInput {
|
|
1471
|
+
request_id: string;
|
|
1472
|
+
code: string;
|
|
1473
|
+
name: string;
|
|
1474
|
+
percent_off?: number;
|
|
1475
|
+
amount_off?: number;
|
|
1476
|
+
currency?: string;
|
|
1477
|
+
minimum_amount?: number;
|
|
1478
|
+
expires_at?: string;
|
|
1479
|
+
max_redemptions?: number;
|
|
1480
|
+
duration: 'once' | 'forever' | 'repeating';
|
|
1481
|
+
duration_in_months?: number;
|
|
1482
|
+
}
|
|
1483
|
+
interface Promo {
|
|
1484
|
+
id: string;
|
|
1485
|
+
site_id: string;
|
|
1486
|
+
stripe_account_id: string;
|
|
1487
|
+
code: string;
|
|
1488
|
+
name: string;
|
|
1489
|
+
percent_off: number | null;
|
|
1490
|
+
amount_off: number | null;
|
|
1491
|
+
currency: string | null;
|
|
1492
|
+
minimum_amount: number | null;
|
|
1493
|
+
expires_at: string | null;
|
|
1494
|
+
max_redemptions: number | null;
|
|
1495
|
+
duration: CreatePromoInput['duration'];
|
|
1496
|
+
duration_in_months: number | null;
|
|
1497
|
+
status: 'active' | 'inactive' | 'expired' | 'exhausted' | 'pending' | 'unavailable';
|
|
1498
|
+
times_redeemed: number | null;
|
|
1499
|
+
eligibility_scope: 'connected_account';
|
|
1500
|
+
checkout_enabled: boolean;
|
|
1501
|
+
created_at: string;
|
|
1502
|
+
replaces_id: string | null;
|
|
1503
|
+
}
|
|
1504
|
+
interface PromosListResponse {
|
|
1505
|
+
promos: Promo[];
|
|
1506
|
+
next_cursor: string | null;
|
|
1507
|
+
checkout_enabled: boolean;
|
|
1508
|
+
}
|
|
1432
1509
|
|
|
1433
1510
|
declare class AifeaturesApiError extends Error {
|
|
1434
1511
|
status: number;
|
|
@@ -1446,6 +1523,11 @@ interface AifeaturesApiClient {
|
|
|
1446
1523
|
deleteSubmission(submissionId: string): Promise<void>;
|
|
1447
1524
|
downloadAttachment(submissionId: string, attachment: string | Pick<Attachment, 'id' | 'name'>): Promise<void>;
|
|
1448
1525
|
getPaymentsStatus(): Promise<PaymentsStatusResponse>;
|
|
1526
|
+
getPromos(cursor?: string): Promise<PromosListResponse>;
|
|
1527
|
+
getPromo(id: string): Promise<Promo>;
|
|
1528
|
+
createPromo(input: CreatePromoInput): Promise<Promo>;
|
|
1529
|
+
disablePromo(id: string): Promise<Promo>;
|
|
1530
|
+
replacePromo(id: string, input: CreatePromoInput): Promise<Promo>;
|
|
1449
1531
|
/** Pass `{ include: 'stats' }` to attach rolling-30-day sales stats (owner-side surfaces only). */
|
|
1450
1532
|
getProducts(options?: GetProductsOptions): Promise<Product[]>;
|
|
1451
1533
|
/** Returns the product detail (flat fields + options + variants). */
|
|
@@ -1695,7 +1777,7 @@ interface PaymentsDashboardProps {
|
|
|
1695
1777
|
/** Optional className */
|
|
1696
1778
|
className?: string;
|
|
1697
1779
|
/** Which tab to open initially */
|
|
1698
|
-
defaultTab?: "products" | "orders" | "invoices" | "customers" | "setup";
|
|
1780
|
+
defaultTab?: "products" | "orders" | "invoices" | "customers" | "promos" | "setup";
|
|
1699
1781
|
/**
|
|
1700
1782
|
* Host-app callback that starts (or resumes) Stripe Connect onboarding —
|
|
1701
1783
|
* shown on the Setup tab when the site still needs Stripe.
|
|
@@ -2114,6 +2196,9 @@ interface RetainersPanelProps {
|
|
|
2114
2196
|
}
|
|
2115
2197
|
declare function RetainersPanel({ retainers, isLoading, error, onRetry, onShowCycles, activeRetainerId, total, endedTotal, isLoadingMore, onLoadMore, includeEnded, onIncludeEndedChange, className }: RetainersPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
2116
2198
|
|
|
2199
|
+
/** Shared merchant dashboard surface; all writes use the same API as agent tools. */
|
|
2200
|
+
declare function PromosPanel(): react_jsx_runtime.JSX.Element;
|
|
2201
|
+
|
|
2117
2202
|
interface UseFormsReturn {
|
|
2118
2203
|
forms: Form[];
|
|
2119
2204
|
isLoading: boolean;
|
|
@@ -2620,6 +2705,7 @@ declare function chargedTotal(order: {
|
|
|
2620
2705
|
tax_total?: number;
|
|
2621
2706
|
tax_behavior?: 'inclusive' | 'exclusive' | null;
|
|
2622
2707
|
automatic_tax?: boolean;
|
|
2708
|
+
exclusive_tax_total?: number | null;
|
|
2623
2709
|
}): number;
|
|
2624
2710
|
/**
|
|
2625
2711
|
* Convert a major-unit amount ("29.99") to the currency's integer minor unit
|
|
@@ -2679,4 +2765,4 @@ interface AnalyticsViewProps {
|
|
|
2679
2765
|
*/
|
|
2680
2766
|
declare function AnalyticsView({ filters: filtersProp, onFiltersChange, refreshKey, onBackToWebsite, className, published, lastPublishedAt, }: AnalyticsViewProps): react_jsx_runtime.JSX.Element;
|
|
2681
2767
|
|
|
2682
|
-
export { type AdjustInventoryInput, type AifeaturesApiClient, AifeaturesApiError, type AifeaturesContextValue, AifeaturesProvider, type AifeaturesProviderProps, type AnalyticsBreakdown, type AnalyticsBreakdownName, type AnalyticsBreakdownRow, type AnalyticsChannelRow, type AnalyticsChannels, type AnalyticsFilter, type AnalyticsFilterDimension, type AnalyticsPeriod, type AnalyticsRealtime, type AnalyticsSourced, type AnalyticsStatus, type AnalyticsSummary, type AnalyticsSummaryData, type AnalyticsSummaryMetrics, type AnalyticsTimeseries, type AnalyticsTimeseriesRow, AnalyticsView, type AnalyticsViewProps, type ApiError, type Attachment, type BusinessSummary, type BusinessVisitors, type CreateEventDestinationInput, type CreateFormInput, type CreateOptionInput, type CreateProductInput, type CreateVariantInput, type Customer, type CustomerAddress, CustomerDetail, type CustomerDetail$1 as CustomerDetailData, type CustomerDetailProps, CustomersList, type CustomersListProps, type CustomersListResponse, type EmailDelivery, type EmailSideStatus, type EventDeliveriesListResponse, type EventDelivery, type EventDestination, type EventDestinationSecretResponse, type EventDestinationsListResponse, type Form, FormSettings, type FormSettingsProps, FormSubmissions, type FormSubmissionsProps, FormsDashboard, type FormsDashboardProps, FormsList, type FormsListProps, type FormsListResponse, type GetBusinessSummaryOptions, type GetCustomersOptions, type GetInvoicesOptions, type GetOrdersOptions, type GetPeopleOptions, type GetProductsOptions, type GetSubmissionsOptions, type GetSubscriptionsOptions, type Invoice, type InvoiceAggregates, type InvoiceBillTo, type InvoiceDeliveryState, InvoiceDetail, type InvoiceDetailProps, type InvoiceLabel, InvoiceLabelBadge, type InvoiceLineItem, type InvoicePreview, type InvoiceSettings, InvoicesList, type InvoicesListProps, InvoicesView, type InvoicesViewProps, LeadsView, type LeadsViewProps, type LowStockProduct, MAX_ANALYTICS_FILTERS, MAX_ANALYTICS_FILTER_VALUES, type NeedsAttentionItem, type NeedsAttentionType, type Order, OrderDetail, type OrderDetailProps, type OrderStatus, OrderStatusBadge, OrdersList, type OrdersListProps, OrdersView, type OrdersViewProps, type PaginatedInvoices, type PaginatedOrders, type PaginatedSubmissions, type PaginatedSubscriptions, PaymentsDashboard, type PaymentsDashboardProps, PaymentsSetup, type PaymentsSetupProps, type PaymentsStatus, type PaymentsStatusReason, type PaymentsStatusResponse, type PeopleListResponse, type Person, type PersonDetail, type PersonOrder, type PersonSource, type PersonSubmission, type Product, type ProductDetail, type ProductFulfillment, type ProductFulfillmentType, type ProductOption, ProductSettings, type ProductSettingsProps, type ProductStats, type ProductVariant, ProductsList, type ProductsListProps, type ProductsListResponse, ProductsView, type ProductsViewProps, REALTIME_FAILURES_BEFORE_ERROR, REALTIME_POLL_MS, type RefundRequest, type ReportSlot, RetainerStatusBadge, RetainersPanel, type RetainersPanelProps, type RevenueCurrencyTotal, type RevenuePeriod, type SetInventoryInput, type SetOrderFulfillmentInput, type SettledRevenue, type Submission, SubmissionDetail, type SubmissionDetailProps, type SubmissionMetadata, type Subscription, SubscriptionsView, type SubscriptionsViewProps, type UpdateEventDestinationInput, type UpdateFormInput, type UpdateOptionInput, type UpdateProductInput, type UpdateVariantInput, type UseAnalyticsOptions, type UseAnalyticsReturn, type UseBusinessSummaryOptions, type UseBusinessSummaryReturn, type UseCustomersOptions, type UseCustomersReturn, type UseEventDestinationsReturn, type UseFormsReturn, type UseInvoicesOptions, type UseInvoicesReturn, type UseOrdersOptions, type UseOrdersReturn, type UsePaymentsStatusReturn, type UsePeopleOptions, type UsePeopleReturn, type UsePersonOptions, type UsePersonReturn, type UseProductsOptions, type UseProductsReturn, type UseRealtimeVisitorsReturn, type UseSubmissionsOptions, type UseSubmissionsReturn, type UseSubscriptionsOptions, type UseSubscriptionsReturn, type VariantInventory, type VariantOptionValue, VariantsEditor, type VariantsEditorProps, ViewShell, type ViewShellProps, WebhookDeliveries, type WebhookDeliveriesProps, WebhookSettings, type WebhookSettingsProps, chargedTotal, createApiClient, formatPrice, isZeroDecimalCurrency, toMajorUnits, toMinorUnits, useAifeaturesContext as useAifeatures, useAifeaturesContext, useAnalytics, useBusinessSummary, useCustomers, useEventDestinations, useForms, useInvoices, useOrders, usePaymentsStatus, usePeople, usePerson, useProducts, useRealtimeVisitors, useRetainers, useSubmissions, useSubscriptions };
|
|
2768
|
+
export { type AdjustInventoryInput, type AifeaturesApiClient, AifeaturesApiError, type AifeaturesContextValue, AifeaturesProvider, type AifeaturesProviderProps, type AnalyticsBreakdown, type AnalyticsBreakdownName, type AnalyticsBreakdownRow, type AnalyticsChannelRow, type AnalyticsChannels, type AnalyticsFilter, type AnalyticsFilterDimension, type AnalyticsPeriod, type AnalyticsRealtime, type AnalyticsSourced, type AnalyticsStatus, type AnalyticsSummary, type AnalyticsSummaryData, type AnalyticsSummaryMetrics, type AnalyticsTimeseries, type AnalyticsTimeseriesRow, AnalyticsView, type AnalyticsViewProps, type ApiError, type Attachment, type BusinessSummary, type BusinessVisitors, type CreateEventDestinationInput, type CreateFormInput, type CreateOptionInput, type CreateProductInput, type CreatePromoInput, type CreateVariantInput, type Customer, type CustomerAddress, CustomerDetail, type CustomerDetail$1 as CustomerDetailData, type CustomerDetailProps, CustomersList, type CustomersListProps, type CustomersListResponse, type EmailDelivery, type EmailSideStatus, type EventDeliveriesListResponse, type EventDelivery, type EventDestination, type EventDestinationSecretResponse, type EventDestinationsListResponse, type Form, FormSettings, type FormSettingsProps, FormSubmissions, type FormSubmissionsProps, FormsDashboard, type FormsDashboardProps, FormsList, type FormsListProps, type FormsListResponse, type GetBusinessSummaryOptions, type GetCustomersOptions, type GetInvoicesOptions, type GetOrdersOptions, type GetPeopleOptions, type GetProductsOptions, type GetSubmissionsOptions, type GetSubscriptionsOptions, type Invoice, type InvoiceAggregates, type InvoiceBillTo, type InvoiceDeliveryState, InvoiceDetail, type InvoiceDetailProps, type InvoiceLabel, InvoiceLabelBadge, type InvoiceLineItem, type InvoicePreview, type InvoiceSettings, InvoicesList, type InvoicesListProps, InvoicesView, type InvoicesViewProps, LeadsView, type LeadsViewProps, type LowStockProduct, MAX_ANALYTICS_FILTERS, MAX_ANALYTICS_FILTER_VALUES, type NeedsAttentionItem, type NeedsAttentionType, type Order, OrderDetail, type OrderDetailProps, type OrderStatus, OrderStatusBadge, OrdersList, type OrdersListProps, OrdersView, type OrdersViewProps, type PaginatedInvoices, type PaginatedOrders, type PaginatedSubmissions, type PaginatedSubscriptions, PaymentsDashboard, type PaymentsDashboardProps, PaymentsSetup, type PaymentsSetupProps, type PaymentsStatus, type PaymentsStatusReason, type PaymentsStatusResponse, type PeopleListResponse, type Person, type PersonDetail, type PersonOrder, type PersonSource, type PersonSubmission, type Product, type ProductDetail, type ProductFulfillment, type ProductFulfillmentType, type ProductOption, ProductSettings, type ProductSettingsProps, type ProductStats, type ProductVariant, ProductsList, type ProductsListProps, type ProductsListResponse, ProductsView, type ProductsViewProps, type Promo, type PromosListResponse, PromosPanel, REALTIME_FAILURES_BEFORE_ERROR, REALTIME_POLL_MS, type RefundRequest, type ReportSlot, RetainerStatusBadge, RetainersPanel, type RetainersPanelProps, type RevenueCurrencyTotal, type RevenuePeriod, type SetInventoryInput, type SetOrderFulfillmentInput, type SettledRevenue, type Submission, SubmissionDetail, type SubmissionDetailProps, type SubmissionMetadata, type Subscription, SubscriptionsView, type SubscriptionsViewProps, type UpdateEventDestinationInput, type UpdateFormInput, type UpdateOptionInput, type UpdateProductInput, type UpdateVariantInput, type UseAnalyticsOptions, type UseAnalyticsReturn, type UseBusinessSummaryOptions, type UseBusinessSummaryReturn, type UseCustomersOptions, type UseCustomersReturn, type UseEventDestinationsReturn, type UseFormsReturn, type UseInvoicesOptions, type UseInvoicesReturn, type UseOrdersOptions, type UseOrdersReturn, type UsePaymentsStatusReturn, type UsePeopleOptions, type UsePeopleReturn, type UsePersonOptions, type UsePersonReturn, type UseProductsOptions, type UseProductsReturn, type UseRealtimeVisitorsReturn, type UseSubmissionsOptions, type UseSubmissionsReturn, type UseSubscriptionsOptions, type UseSubscriptionsReturn, type VariantInventory, type VariantOptionValue, VariantsEditor, type VariantsEditorProps, ViewShell, type ViewShellProps, WebhookDeliveries, type WebhookDeliveriesProps, WebhookSettings, type WebhookSettingsProps, chargedTotal, createApiClient, formatPrice, isZeroDecimalCurrency, toMajorUnits, toMinorUnits, useAifeaturesContext as useAifeatures, useAifeaturesContext, useAnalytics, useBusinessSummary, useCustomers, useEventDestinations, useForms, useInvoices, useOrders, usePaymentsStatus, usePeople, usePerson, useProducts, useRealtimeVisitors, useRetainers, useSubmissions, useSubscriptions };
|