@vivoa/plugin-sdk 0.7.0 → 0.7.2
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/{host-api-CuLAVsQ2.d.mts → host-api-C5EsRbsA.d.mts} +249 -3
- package/dist/{host-api-CuLAVsQ2.d.ts → host-api-C5EsRbsA.d.ts} +249 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +131 -3
- package/dist/index.mjs +132 -3
- package/dist/testing/index.d.mts +7 -1
- package/dist/testing/index.d.ts +7 -1
- package/dist/testing/index.js +9 -0
- package/dist/testing/index.mjs +9 -0
- package/package.json +1 -1
|
@@ -332,6 +332,13 @@ interface PluginManifest {
|
|
|
332
332
|
* `developer` string first-party manifests used to carry.
|
|
333
333
|
*/
|
|
334
334
|
author?: PluginAuthor;
|
|
335
|
+
/**
|
|
336
|
+
* Catalog access hint. `restricted` = the store asks the platform for an
|
|
337
|
+
* entitlement before ENABLING the app (paid/granted apps). Absent or
|
|
338
|
+
* `public` = no entitlement check. Informational for the host: the platform
|
|
339
|
+
* stays the authority on who is allowed.
|
|
340
|
+
*/
|
|
341
|
+
access?: 'public' | 'restricted';
|
|
335
342
|
/**
|
|
336
343
|
* Declarative admin setup screen. When omitted, host renders the legacy
|
|
337
344
|
* auto-form derived from the plugin's configSchema.
|
|
@@ -984,6 +991,12 @@ interface SupplierStock {
|
|
|
984
991
|
interface SupplierListing {
|
|
985
992
|
/** Native id in the supplier catalog (product or catalog-item id). */
|
|
986
993
|
externalId: string;
|
|
994
|
+
/**
|
|
995
|
+
* When `externalId` is an item of the SELLER's catalog (e.g. Drop's
|
|
996
|
+
* catalogId), the id of the marketplace product it wraps: the one the
|
|
997
|
+
* supplier's public catalog uses. Absent when both are the same id.
|
|
998
|
+
*/
|
|
999
|
+
catalogProductId?: string | null;
|
|
987
1000
|
title: string;
|
|
988
1001
|
description?: string | null;
|
|
989
1002
|
sku?: string | null;
|
|
@@ -1573,8 +1586,44 @@ declare enum ContentBlockType {
|
|
|
1573
1586
|
Link = "link",
|
|
1574
1587
|
Divider = "divider",
|
|
1575
1588
|
Action = "action",
|
|
1576
|
-
Card = "card"
|
|
1589
|
+
Card = "card",
|
|
1590
|
+
/** Headline metric (label + pre-formatted value). Pure JSON data. */
|
|
1591
|
+
Stat = "stat",
|
|
1592
|
+
/** Read-only table of scalar cells. Pure JSON data. */
|
|
1593
|
+
Table = "table",
|
|
1594
|
+
/** Simple bar/line chart over labelled series. Pure JSON data. */
|
|
1595
|
+
Chart = "chart",
|
|
1596
|
+
/**
|
|
1597
|
+
* Segmented choice bound to a page param (e.g. `days`). Picking an option
|
|
1598
|
+
* makes the host re-resolve the slot with `params[param] = value`. A VIEW
|
|
1599
|
+
* control, not config input: it never writes plugin settings.
|
|
1600
|
+
*/
|
|
1601
|
+
Filter = "filter",
|
|
1602
|
+
/** Lays its child blocks side by side in N responsive columns. */
|
|
1603
|
+
Grid = "grid",
|
|
1604
|
+
/** Free-text box bound to a page param (debounced by the host). */
|
|
1605
|
+
Search = "search",
|
|
1606
|
+
/** Collapsible section (closed by default): "how to read this", details. */
|
|
1607
|
+
Details = "details",
|
|
1608
|
+
/** One row of view controls (search, filters, links) above a list. */
|
|
1609
|
+
Toolbar = "toolbar"
|
|
1577
1610
|
}
|
|
1611
|
+
/**
|
|
1612
|
+
* A patch over the page params, for IN-PAGE navigation (links, table rows,
|
|
1613
|
+
* stats): the host merges it into the current params; `null` removes one.
|
|
1614
|
+
* It navigates (history entry, so "back" works); filters only replace.
|
|
1615
|
+
*/
|
|
1616
|
+
type PageParams = Record<string, string | null>;
|
|
1617
|
+
/**
|
|
1618
|
+
* Host-owned slots the SDK knows by name. `slot` stays a free string on the
|
|
1619
|
+
* wire (an older host ignores a slot it does not know); these constants only
|
|
1620
|
+
* give first-party plugins one spelling.
|
|
1621
|
+
*/
|
|
1622
|
+
declare const UiSlot: {
|
|
1623
|
+
/** Full-page surface of an app in the admin (the app owns the whole body). */
|
|
1624
|
+
readonly AdminAppPage: "admin:app.page";
|
|
1625
|
+
};
|
|
1626
|
+
type UiSlot = (typeof UiSlot)[keyof typeof UiSlot];
|
|
1578
1627
|
declare enum ContentActionVariant {
|
|
1579
1628
|
Primary = "primary",
|
|
1580
1629
|
Secondary = "secondary",
|
|
@@ -1624,6 +1673,8 @@ interface LinkBlock {
|
|
|
1624
1673
|
href?: string;
|
|
1625
1674
|
computedKey?: string;
|
|
1626
1675
|
external?: boolean;
|
|
1676
|
+
/** In-page navigation instead of `href` (see `PageParams`). */
|
|
1677
|
+
params?: PageParams;
|
|
1627
1678
|
}
|
|
1628
1679
|
interface DividerBlock {
|
|
1629
1680
|
type: ContentBlockType.Divider;
|
|
@@ -1646,7 +1697,158 @@ interface CardBlock {
|
|
|
1646
1697
|
description?: string;
|
|
1647
1698
|
blocks: ContentBlock[];
|
|
1648
1699
|
}
|
|
1649
|
-
|
|
1700
|
+
/**
|
|
1701
|
+
* Headline metric. `value` is already formatted by the plugin (the host does
|
|
1702
|
+
* not guess units/locale). `estimate: true` makes the host label it as an
|
|
1703
|
+
* ESTIMATE next to the value, so a derived number is never shown as a fact.
|
|
1704
|
+
*/
|
|
1705
|
+
interface StatBlock {
|
|
1706
|
+
type: ContentBlockType.Stat;
|
|
1707
|
+
label: string;
|
|
1708
|
+
value?: string;
|
|
1709
|
+
computedKey?: string;
|
|
1710
|
+
hint?: string;
|
|
1711
|
+
variant?: MessageVariant;
|
|
1712
|
+
estimate?: boolean;
|
|
1713
|
+
/** Makes the stat a link to more detail on the same page (e.g. what the KPI means). */
|
|
1714
|
+
params?: PageParams;
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* A cell with more than its text: a second line, a thumbnail, a tone. Still
|
|
1718
|
+
* pure data; the host decides how each part looks.
|
|
1719
|
+
*/
|
|
1720
|
+
interface TableRichCell {
|
|
1721
|
+
text: string;
|
|
1722
|
+
/** Muted second line under the text (e.g. vendor, category). */
|
|
1723
|
+
caption?: string;
|
|
1724
|
+
/**
|
|
1725
|
+
* Thumbnail URL shown before the text. `null` = this row has no picture: the
|
|
1726
|
+
* host shows a placeholder so the column stays aligned.
|
|
1727
|
+
*/
|
|
1728
|
+
image?: string | null;
|
|
1729
|
+
/** Tints the text (e.g. `danger` for "sold out"). Never the only signal: say it in `text`. */
|
|
1730
|
+
tone?: MessageVariant;
|
|
1731
|
+
}
|
|
1732
|
+
type TableCell = string | number | boolean | null | TableRichCell;
|
|
1733
|
+
/** Makes a column header sort the table: the value its param takes when clicked. */
|
|
1734
|
+
interface TableColumnSort {
|
|
1735
|
+
value: string;
|
|
1736
|
+
/** Direction that value sorts in, for the header arrow (default `desc`). */
|
|
1737
|
+
dir?: 'asc' | 'desc';
|
|
1738
|
+
}
|
|
1739
|
+
interface TableColumn {
|
|
1740
|
+
key: string;
|
|
1741
|
+
label: string;
|
|
1742
|
+
align?: 'left' | 'right';
|
|
1743
|
+
/** Short explanation of the column, shown on demand next to its header. */
|
|
1744
|
+
hint?: string;
|
|
1745
|
+
sort?: TableColumnSort;
|
|
1746
|
+
}
|
|
1747
|
+
/** The page param the sortable headers write, and the value the plugin sorted by. */
|
|
1748
|
+
interface TableSort {
|
|
1749
|
+
param: string;
|
|
1750
|
+
value: string;
|
|
1751
|
+
/** Params cleared when the sort changes (e.g. `page`). */
|
|
1752
|
+
resets?: string[];
|
|
1753
|
+
}
|
|
1754
|
+
/**
|
|
1755
|
+
* Paging through a page param (1-based; the host removes the param on page 1).
|
|
1756
|
+
* The plugin already sliced `rows`: the host only shows the range and the pager.
|
|
1757
|
+
*/
|
|
1758
|
+
interface TablePagination {
|
|
1759
|
+
param: string;
|
|
1760
|
+
page: number;
|
|
1761
|
+
pageSize: number;
|
|
1762
|
+
total: number;
|
|
1763
|
+
}
|
|
1764
|
+
/** Read-only table. Cells are looked up by `columns[].key`. */
|
|
1765
|
+
interface TableBlock {
|
|
1766
|
+
type: ContentBlockType.Table;
|
|
1767
|
+
title?: string;
|
|
1768
|
+
columns: TableColumn[];
|
|
1769
|
+
rows: Array<Record<string, TableCell>>;
|
|
1770
|
+
/** Shown instead of the body when `rows` is empty. */
|
|
1771
|
+
emptyText?: string;
|
|
1772
|
+
/** Aligned with `rows`: a row with params is clickable (in-page navigation). */
|
|
1773
|
+
rowParams?: Array<PageParams | null>;
|
|
1774
|
+
/** Columns with `sort` become clickable headers bound to this param. */
|
|
1775
|
+
sort?: TableSort;
|
|
1776
|
+
pagination?: TablePagination;
|
|
1777
|
+
}
|
|
1778
|
+
interface ChartSeries {
|
|
1779
|
+
name: string;
|
|
1780
|
+
/** One value per label; `null` = no observation (a gap, not a zero). */
|
|
1781
|
+
data: Array<number | null>;
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Simple chart: `labels` is the category axis, every series aligns to it.
|
|
1785
|
+
* `hbar` = horizontal bars, one row per label (best for long category names).
|
|
1786
|
+
*/
|
|
1787
|
+
interface ChartBlock {
|
|
1788
|
+
type: ContentBlockType.Chart;
|
|
1789
|
+
kind: 'bar' | 'line' | 'hbar';
|
|
1790
|
+
title?: string;
|
|
1791
|
+
labels: string[];
|
|
1792
|
+
series: ChartSeries[];
|
|
1793
|
+
unit?: string;
|
|
1794
|
+
emptyText?: string;
|
|
1795
|
+
}
|
|
1796
|
+
interface FilterOption {
|
|
1797
|
+
value: string;
|
|
1798
|
+
label: string;
|
|
1799
|
+
}
|
|
1800
|
+
/**
|
|
1801
|
+
* Choice over one page param. `value` is the option the plugin rendered with
|
|
1802
|
+
* (it read it from `UiSlotContext.params`, or chose a default).
|
|
1803
|
+
*/
|
|
1804
|
+
interface FilterBlock {
|
|
1805
|
+
type: ContentBlockType.Filter;
|
|
1806
|
+
param: string;
|
|
1807
|
+
label?: string;
|
|
1808
|
+
value: string;
|
|
1809
|
+
options: FilterOption[];
|
|
1810
|
+
/**
|
|
1811
|
+
* `segmented` (default) for a few options; `select` for many (in a `select`
|
|
1812
|
+
* an option with an empty value means "no filter"); `tabs` for the views of
|
|
1813
|
+
* the page.
|
|
1814
|
+
*/
|
|
1815
|
+
display?: 'segmented' | 'select' | 'tabs';
|
|
1816
|
+
/** Params cleared when this one changes (e.g. `page`). */
|
|
1817
|
+
resets?: string[];
|
|
1818
|
+
}
|
|
1819
|
+
/** Free-text box over one page param; the host debounces and replaces the URL. */
|
|
1820
|
+
interface SearchBlock {
|
|
1821
|
+
type: ContentBlockType.Search;
|
|
1822
|
+
param: string;
|
|
1823
|
+
value: string;
|
|
1824
|
+
label?: string;
|
|
1825
|
+
placeholder?: string;
|
|
1826
|
+
/** Params cleared when the text changes (e.g. `page`). */
|
|
1827
|
+
resets?: string[];
|
|
1828
|
+
}
|
|
1829
|
+
/** Collapsible section, closed unless `open`. Recurses into child `blocks`. */
|
|
1830
|
+
interface DetailsBlock {
|
|
1831
|
+
type: ContentBlockType.Details;
|
|
1832
|
+
summary: string;
|
|
1833
|
+
blocks: ContentBlock[];
|
|
1834
|
+
open?: boolean;
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* One row of view controls above a list: search, filters, a "clear" link. It
|
|
1838
|
+
* wraps on a narrow screen and a search box takes the free width. Use `grid`
|
|
1839
|
+
* for content, this for controls.
|
|
1840
|
+
*/
|
|
1841
|
+
interface ToolbarBlock {
|
|
1842
|
+
type: ContentBlockType.Toolbar;
|
|
1843
|
+
blocks: ContentBlock[];
|
|
1844
|
+
}
|
|
1845
|
+
/** Child blocks in `columns` responsive columns (one column on narrow screens). */
|
|
1846
|
+
interface GridBlock {
|
|
1847
|
+
type: ContentBlockType.Grid;
|
|
1848
|
+
columns: 2 | 3 | 4;
|
|
1849
|
+
blocks: ContentBlock[];
|
|
1850
|
+
}
|
|
1851
|
+
type ContentBlock = TextBlock | BannerBlock | BadgeBlock | KeyValueBlock | CopyFieldBlock | LinkBlock | DividerBlock | ActionBlock | CardBlock | StatBlock | TableBlock | ChartBlock | FilterBlock | GridBlock | SearchBlock | DetailsBlock | ToolbarBlock;
|
|
1650
1852
|
/**
|
|
1651
1853
|
* One block tree the plugin injects into a host slot. `slot` names a host-owned
|
|
1652
1854
|
* target (e.g. "admin:order.detail.sidebar", "storefront:product.below"); the
|
|
@@ -1658,9 +1860,22 @@ interface UiContribution {
|
|
|
1658
1860
|
blocks: ContentBlock[];
|
|
1659
1861
|
order?: number;
|
|
1660
1862
|
}
|
|
1863
|
+
/** Runtime context the host hands to {@link IUiPlugin.resolveContributions}. */
|
|
1864
|
+
interface UiSlotContext {
|
|
1865
|
+
/** Free-form, JSON-serializable params chosen by the page (e.g. country). */
|
|
1866
|
+
params?: Record<string, unknown>;
|
|
1867
|
+
}
|
|
1661
1868
|
/** Impl behind a `ui` capability — the static set a plugin declares up front. */
|
|
1662
1869
|
interface IUiPlugin {
|
|
1663
1870
|
readonly contributions: UiContribution[];
|
|
1871
|
+
/**
|
|
1872
|
+
* Optional dynamic counterpart: for slots whose blocks depend on live data
|
|
1873
|
+
* (a full-page report), the host asks the plugin to build the block tree at
|
|
1874
|
+
* request time. Absent => the host serves the static `contributions`.
|
|
1875
|
+
* MUST resolve to pure-JSON blocks and SHOULD NOT throw: degrade to a
|
|
1876
|
+
* banner block explaining what is missing.
|
|
1877
|
+
*/
|
|
1878
|
+
resolveContributions?(slot: string, ctx: UiSlotContext): Promise<UiContribution[]>;
|
|
1664
1879
|
}
|
|
1665
1880
|
interface UiContributionsValidation {
|
|
1666
1881
|
success: boolean;
|
|
@@ -1779,6 +1994,32 @@ interface StorageBroker {
|
|
|
1779
1994
|
interface SequenceStore {
|
|
1780
1995
|
next(scope: string): Promise<number>;
|
|
1781
1996
|
}
|
|
1997
|
+
/**
|
|
1998
|
+
* A product of THIS store that was imported from a supplier's catalog
|
|
1999
|
+
* (dropshipping). `externalId` is the supplier's own product id, so a plugin
|
|
2000
|
+
* can join it with that supplier's data without reading the host database.
|
|
2001
|
+
*/
|
|
2002
|
+
interface SourcedProduct {
|
|
2003
|
+
/** Local product id in this store. */
|
|
2004
|
+
productId: string;
|
|
2005
|
+
/** Local product title (what the merchant named it). */
|
|
2006
|
+
title: string;
|
|
2007
|
+
/** The supplier's product id. */
|
|
2008
|
+
externalId: string;
|
|
2009
|
+
/**
|
|
2010
|
+
* The supplier marketplace product this one comes from, when the host knows
|
|
2011
|
+
* it (see `SupplierListing.catalogProductId`). `null` = not linked yet.
|
|
2012
|
+
*/
|
|
2013
|
+
catalogProductId: string | null;
|
|
2014
|
+
}
|
|
2015
|
+
/**
|
|
2016
|
+
* Read-only view of the store catalog, scoped by the host to the tenant of the
|
|
2017
|
+
* current call.
|
|
2018
|
+
*/
|
|
2019
|
+
interface CatalogReader {
|
|
2020
|
+
/** Products of this store sourced from `supplierCode` (e.g. `soydrop`). */
|
|
2021
|
+
listSourcedProducts(supplierCode: string): Promise<SourcedProduct[]>;
|
|
2022
|
+
}
|
|
1782
2023
|
type DomainEventName = string;
|
|
1783
2024
|
type DomainEventHandler = (payload: unknown) => void | Promise<void>;
|
|
1784
2025
|
/**
|
|
@@ -1794,10 +2035,15 @@ interface HostApi {
|
|
|
1794
2035
|
readonly secrets: SecretStore;
|
|
1795
2036
|
readonly storage: StorageBroker;
|
|
1796
2037
|
readonly sequence: SequenceStore;
|
|
2038
|
+
/**
|
|
2039
|
+
* Store catalog reads. Optional: a host that does not offer it leaves it
|
|
2040
|
+
* out, so a plugin must handle its absence (degrade, never assume).
|
|
2041
|
+
*/
|
|
2042
|
+
readonly catalog?: CatalogReader;
|
|
1797
2043
|
/** Subscribe to a host domain event (order.created, product.updated, ...). */
|
|
1798
2044
|
on(event: DomainEventName, handler: DomainEventHandler): void;
|
|
1799
2045
|
/** Expose a capability to the host's generic registry. */
|
|
1800
2046
|
registerCapability<T = unknown>(cap: Capability<T>): void;
|
|
1801
2047
|
}
|
|
1802
2048
|
|
|
1803
|
-
export {
|
|
2049
|
+
export { type DomainEventName as $, AUTHOR_HANDLE_RE as A, type BannerBlock$1 as B, ConfigScope as C, type CarrierSettlement as D, type CatalogReader as E, FieldType as F, type ChartBlock as G, type ChartSeries as H, type CodConfig as I, type CodFeeConfig as J, CodFeeType as K, type CodPurchaseTrigger as L, type ConditionalBlock as M, type ConditionalEquals as N, type ConditionalWhen as O, type PluginConfigField as P, type ConfigurablePlugin as Q, ContentActionVariant as R, type SelectOption as S, type ContentBlock as T, ContentBlockType as U, type CopyFieldBlock$1 as V, type CreateShipmentParams as W, type DetailsBlock as X, type DispatchContext as Y, type DividerBlock$1 as Z, type DomainEventHandler as _, type AccordionBlock as a, type PluginActionResult as a$, type EmbedInit as a0, type FieldBlock as a1, type FieldOption as a2, FieldVariant as a3, type FilterBlock as a4, type FilterOption as a5, GatewayEnvironment as a6, type GatewayFeeConfig as a7, type GatewayStaticConfig as a8, type GridBlock as a9, type KeyValueRow$1 as aA, LayoutMode as aB, type LinkBlock as aC, type Logger as aD, type MarkdownBlock as aE, MessageVariant as aF, type PageParams as aG, type PaymentCard as aH, type PaymentConnect as aI, type PaymentConnectExchange as aJ, type PaymentConnectParams as aK, type PaymentCustomer as aL, type PaymentGatewayCode as aM, type PaymentMerchantPricing as aN, type PaymentPayload as aO, type PaymentPluginConfig as aP, type PaymentRenderMode as aQ, type PaymentResult as aR, type PaymentSessionFees as aS, type PaymentSessionPayload as aT, type PaymentSessionResult as aU, type PaymentSettlementFees as aV, type PaymentVerifyPayload as aW, type PaymentWebhookSettlement as aX, type PlaceSupplierOrderInput as aY, type Plugin as aZ, type PluginActionContext as a_, type GroupBlock as aa, type HostApi as ab, type HttpClient as ac, type HttpRequest as ad, type HttpResponse as ae, type IAnalyticsPlugin as af, type IInvoicingPlugin as ag, type IPaymentPlugin as ah, type IPlugin as ai, type IShippingPlugin as aj, type ISuppliersPlugin as ak, type IUiPlugin as al, type InlineRowBlock as am, InvoiceDocumentType as an, type InvoiceLine as ao, type InvoiceMoney as ap, type InvoiceParty as aq, type InvoiceRequest as ar, type InvoiceResult as as, InvoiceStatus as at, type InvoiceTax as au, type InvoicingDefaultConfig as av, InvoicingFeature as aw, type InvoicingPluginConfig as ax, type InvoicingStaticConfig as ay, type KeyValueBlock$1 as az, type AccordionSection as b, type UiContributionsValidation as b$, type PluginAuthor as b0, type PluginConfigFieldDependency as b1, type PluginFactory as b2, type PluginManifest as b3, type RepeaterBlock as b4, RepeaterSource as b5, type SearchBlock as b6, type SecretStore as b7, type SequenceStore as b8, type SetupAction as b9, type SupplierOrderAddressLevel as bA, type SupplierOrderCustomer as bB, type SupplierOrderLine as bC, type SupplierOrderResult as bD, type SupplierOrderStatus as bE, type SupplierShipTo as bF, type SupplierShippingQuote as bG, type SupplierShippingQuoteInput as bH, type SupplierStock as bI, type SuppliersDefaultConfig as bJ, SuppliersFeature as bK, type SuppliersPluginConfig as bL, type SuppliersStaticConfig as bM, type TabItem as bN, type TableBlock as bO, type TableCell as bP, type TableColumn as bQ, type TableColumnSort as bR, type TablePagination as bS, type TableRichCell as bT, type TableSort as bU, type TabsBlock as bV, type ToggleBlock as bW, type ToolbarBlock as bX, type TrackingEvent as bY, TransactionStatus as bZ, type UiContribution as b_, type SetupLayout as ba, type SetupLayoutValidation as bb, type SetupStep as bc, type ShipmentAddress as bd, type ShipmentParcel as be, type ShipmentResult as bf, type ShippingDefaultConfig as bg, ShippingFeature as bh, type ShippingPluginConfig as bi, type ShippingQuote as bj, type ShippingQuoteParams as bk, type ShippingStaticConfig as bl, type SourcedProduct as bm, type StatBlock as bn, StepStatusFrom as bo, type StepStatusFromAction as bp, type StepStatusFromFields as bq, type StepStatusSource as br, type StorageBroker as bs, type SupplierCatalogQuery as bt, type SupplierFulfillmentEvent as bu, type SupplierListing as bv, type SupplierListingAttribute as bw, type SupplierListingPage as bx, type SupplierListingVariant as by, type SupplierMoney as bz, type ActionBlock$1 as c, UiSlot as c0, type UiSlotContext as c1, type VoidInvoiceInput as c2, type WebhookSignatureResult as c3, analyticsCapability as c4, capability as c5, crossValidateSetupLayout as c6, definePlugin as c7, invoicingCapability as c8, isConfigurablePlugin as c9, isPluginFactory as ca, minorUnitDigits as cb, paymentCapability as cc, shippingCapability as cd, suppliersCapability as ce, toMajorUnits as cf, toMinorUnits as cg, uiCapability as ch, validatePluginAuthor as ci, validateSetupLayout as cj, validateUiContributions as ck, ActionVariant as d, type AnalyticsActionSource as e, type AnalyticsConsent as f, type AnalyticsEvent as g, type AnalyticsEventName as h, AnalyticsFeature as i, type AnalyticsItem as j, type AnalyticsMoney as k, type AnalyticsPluginConfig as l, type AnalyticsPurchasePolicy as m, type AnalyticsStaticConfig as n, type AnalyticsUserData as o, type AnalyticsUtm as p, type AuthorValidation as q, type Block as r, type BlockBase as s, BlockType as t, type CalloutBlock as u, type Capability as v, CapabilityKind as w, type CardBlock$1 as x, type CardBrand as y, type CarrierServiceMode as z };
|
|
@@ -332,6 +332,13 @@ interface PluginManifest {
|
|
|
332
332
|
* `developer` string first-party manifests used to carry.
|
|
333
333
|
*/
|
|
334
334
|
author?: PluginAuthor;
|
|
335
|
+
/**
|
|
336
|
+
* Catalog access hint. `restricted` = the store asks the platform for an
|
|
337
|
+
* entitlement before ENABLING the app (paid/granted apps). Absent or
|
|
338
|
+
* `public` = no entitlement check. Informational for the host: the platform
|
|
339
|
+
* stays the authority on who is allowed.
|
|
340
|
+
*/
|
|
341
|
+
access?: 'public' | 'restricted';
|
|
335
342
|
/**
|
|
336
343
|
* Declarative admin setup screen. When omitted, host renders the legacy
|
|
337
344
|
* auto-form derived from the plugin's configSchema.
|
|
@@ -984,6 +991,12 @@ interface SupplierStock {
|
|
|
984
991
|
interface SupplierListing {
|
|
985
992
|
/** Native id in the supplier catalog (product or catalog-item id). */
|
|
986
993
|
externalId: string;
|
|
994
|
+
/**
|
|
995
|
+
* When `externalId` is an item of the SELLER's catalog (e.g. Drop's
|
|
996
|
+
* catalogId), the id of the marketplace product it wraps: the one the
|
|
997
|
+
* supplier's public catalog uses. Absent when both are the same id.
|
|
998
|
+
*/
|
|
999
|
+
catalogProductId?: string | null;
|
|
987
1000
|
title: string;
|
|
988
1001
|
description?: string | null;
|
|
989
1002
|
sku?: string | null;
|
|
@@ -1573,8 +1586,44 @@ declare enum ContentBlockType {
|
|
|
1573
1586
|
Link = "link",
|
|
1574
1587
|
Divider = "divider",
|
|
1575
1588
|
Action = "action",
|
|
1576
|
-
Card = "card"
|
|
1589
|
+
Card = "card",
|
|
1590
|
+
/** Headline metric (label + pre-formatted value). Pure JSON data. */
|
|
1591
|
+
Stat = "stat",
|
|
1592
|
+
/** Read-only table of scalar cells. Pure JSON data. */
|
|
1593
|
+
Table = "table",
|
|
1594
|
+
/** Simple bar/line chart over labelled series. Pure JSON data. */
|
|
1595
|
+
Chart = "chart",
|
|
1596
|
+
/**
|
|
1597
|
+
* Segmented choice bound to a page param (e.g. `days`). Picking an option
|
|
1598
|
+
* makes the host re-resolve the slot with `params[param] = value`. A VIEW
|
|
1599
|
+
* control, not config input: it never writes plugin settings.
|
|
1600
|
+
*/
|
|
1601
|
+
Filter = "filter",
|
|
1602
|
+
/** Lays its child blocks side by side in N responsive columns. */
|
|
1603
|
+
Grid = "grid",
|
|
1604
|
+
/** Free-text box bound to a page param (debounced by the host). */
|
|
1605
|
+
Search = "search",
|
|
1606
|
+
/** Collapsible section (closed by default): "how to read this", details. */
|
|
1607
|
+
Details = "details",
|
|
1608
|
+
/** One row of view controls (search, filters, links) above a list. */
|
|
1609
|
+
Toolbar = "toolbar"
|
|
1577
1610
|
}
|
|
1611
|
+
/**
|
|
1612
|
+
* A patch over the page params, for IN-PAGE navigation (links, table rows,
|
|
1613
|
+
* stats): the host merges it into the current params; `null` removes one.
|
|
1614
|
+
* It navigates (history entry, so "back" works); filters only replace.
|
|
1615
|
+
*/
|
|
1616
|
+
type PageParams = Record<string, string | null>;
|
|
1617
|
+
/**
|
|
1618
|
+
* Host-owned slots the SDK knows by name. `slot` stays a free string on the
|
|
1619
|
+
* wire (an older host ignores a slot it does not know); these constants only
|
|
1620
|
+
* give first-party plugins one spelling.
|
|
1621
|
+
*/
|
|
1622
|
+
declare const UiSlot: {
|
|
1623
|
+
/** Full-page surface of an app in the admin (the app owns the whole body). */
|
|
1624
|
+
readonly AdminAppPage: "admin:app.page";
|
|
1625
|
+
};
|
|
1626
|
+
type UiSlot = (typeof UiSlot)[keyof typeof UiSlot];
|
|
1578
1627
|
declare enum ContentActionVariant {
|
|
1579
1628
|
Primary = "primary",
|
|
1580
1629
|
Secondary = "secondary",
|
|
@@ -1624,6 +1673,8 @@ interface LinkBlock {
|
|
|
1624
1673
|
href?: string;
|
|
1625
1674
|
computedKey?: string;
|
|
1626
1675
|
external?: boolean;
|
|
1676
|
+
/** In-page navigation instead of `href` (see `PageParams`). */
|
|
1677
|
+
params?: PageParams;
|
|
1627
1678
|
}
|
|
1628
1679
|
interface DividerBlock {
|
|
1629
1680
|
type: ContentBlockType.Divider;
|
|
@@ -1646,7 +1697,158 @@ interface CardBlock {
|
|
|
1646
1697
|
description?: string;
|
|
1647
1698
|
blocks: ContentBlock[];
|
|
1648
1699
|
}
|
|
1649
|
-
|
|
1700
|
+
/**
|
|
1701
|
+
* Headline metric. `value` is already formatted by the plugin (the host does
|
|
1702
|
+
* not guess units/locale). `estimate: true` makes the host label it as an
|
|
1703
|
+
* ESTIMATE next to the value, so a derived number is never shown as a fact.
|
|
1704
|
+
*/
|
|
1705
|
+
interface StatBlock {
|
|
1706
|
+
type: ContentBlockType.Stat;
|
|
1707
|
+
label: string;
|
|
1708
|
+
value?: string;
|
|
1709
|
+
computedKey?: string;
|
|
1710
|
+
hint?: string;
|
|
1711
|
+
variant?: MessageVariant;
|
|
1712
|
+
estimate?: boolean;
|
|
1713
|
+
/** Makes the stat a link to more detail on the same page (e.g. what the KPI means). */
|
|
1714
|
+
params?: PageParams;
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* A cell with more than its text: a second line, a thumbnail, a tone. Still
|
|
1718
|
+
* pure data; the host decides how each part looks.
|
|
1719
|
+
*/
|
|
1720
|
+
interface TableRichCell {
|
|
1721
|
+
text: string;
|
|
1722
|
+
/** Muted second line under the text (e.g. vendor, category). */
|
|
1723
|
+
caption?: string;
|
|
1724
|
+
/**
|
|
1725
|
+
* Thumbnail URL shown before the text. `null` = this row has no picture: the
|
|
1726
|
+
* host shows a placeholder so the column stays aligned.
|
|
1727
|
+
*/
|
|
1728
|
+
image?: string | null;
|
|
1729
|
+
/** Tints the text (e.g. `danger` for "sold out"). Never the only signal: say it in `text`. */
|
|
1730
|
+
tone?: MessageVariant;
|
|
1731
|
+
}
|
|
1732
|
+
type TableCell = string | number | boolean | null | TableRichCell;
|
|
1733
|
+
/** Makes a column header sort the table: the value its param takes when clicked. */
|
|
1734
|
+
interface TableColumnSort {
|
|
1735
|
+
value: string;
|
|
1736
|
+
/** Direction that value sorts in, for the header arrow (default `desc`). */
|
|
1737
|
+
dir?: 'asc' | 'desc';
|
|
1738
|
+
}
|
|
1739
|
+
interface TableColumn {
|
|
1740
|
+
key: string;
|
|
1741
|
+
label: string;
|
|
1742
|
+
align?: 'left' | 'right';
|
|
1743
|
+
/** Short explanation of the column, shown on demand next to its header. */
|
|
1744
|
+
hint?: string;
|
|
1745
|
+
sort?: TableColumnSort;
|
|
1746
|
+
}
|
|
1747
|
+
/** The page param the sortable headers write, and the value the plugin sorted by. */
|
|
1748
|
+
interface TableSort {
|
|
1749
|
+
param: string;
|
|
1750
|
+
value: string;
|
|
1751
|
+
/** Params cleared when the sort changes (e.g. `page`). */
|
|
1752
|
+
resets?: string[];
|
|
1753
|
+
}
|
|
1754
|
+
/**
|
|
1755
|
+
* Paging through a page param (1-based; the host removes the param on page 1).
|
|
1756
|
+
* The plugin already sliced `rows`: the host only shows the range and the pager.
|
|
1757
|
+
*/
|
|
1758
|
+
interface TablePagination {
|
|
1759
|
+
param: string;
|
|
1760
|
+
page: number;
|
|
1761
|
+
pageSize: number;
|
|
1762
|
+
total: number;
|
|
1763
|
+
}
|
|
1764
|
+
/** Read-only table. Cells are looked up by `columns[].key`. */
|
|
1765
|
+
interface TableBlock {
|
|
1766
|
+
type: ContentBlockType.Table;
|
|
1767
|
+
title?: string;
|
|
1768
|
+
columns: TableColumn[];
|
|
1769
|
+
rows: Array<Record<string, TableCell>>;
|
|
1770
|
+
/** Shown instead of the body when `rows` is empty. */
|
|
1771
|
+
emptyText?: string;
|
|
1772
|
+
/** Aligned with `rows`: a row with params is clickable (in-page navigation). */
|
|
1773
|
+
rowParams?: Array<PageParams | null>;
|
|
1774
|
+
/** Columns with `sort` become clickable headers bound to this param. */
|
|
1775
|
+
sort?: TableSort;
|
|
1776
|
+
pagination?: TablePagination;
|
|
1777
|
+
}
|
|
1778
|
+
interface ChartSeries {
|
|
1779
|
+
name: string;
|
|
1780
|
+
/** One value per label; `null` = no observation (a gap, not a zero). */
|
|
1781
|
+
data: Array<number | null>;
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Simple chart: `labels` is the category axis, every series aligns to it.
|
|
1785
|
+
* `hbar` = horizontal bars, one row per label (best for long category names).
|
|
1786
|
+
*/
|
|
1787
|
+
interface ChartBlock {
|
|
1788
|
+
type: ContentBlockType.Chart;
|
|
1789
|
+
kind: 'bar' | 'line' | 'hbar';
|
|
1790
|
+
title?: string;
|
|
1791
|
+
labels: string[];
|
|
1792
|
+
series: ChartSeries[];
|
|
1793
|
+
unit?: string;
|
|
1794
|
+
emptyText?: string;
|
|
1795
|
+
}
|
|
1796
|
+
interface FilterOption {
|
|
1797
|
+
value: string;
|
|
1798
|
+
label: string;
|
|
1799
|
+
}
|
|
1800
|
+
/**
|
|
1801
|
+
* Choice over one page param. `value` is the option the plugin rendered with
|
|
1802
|
+
* (it read it from `UiSlotContext.params`, or chose a default).
|
|
1803
|
+
*/
|
|
1804
|
+
interface FilterBlock {
|
|
1805
|
+
type: ContentBlockType.Filter;
|
|
1806
|
+
param: string;
|
|
1807
|
+
label?: string;
|
|
1808
|
+
value: string;
|
|
1809
|
+
options: FilterOption[];
|
|
1810
|
+
/**
|
|
1811
|
+
* `segmented` (default) for a few options; `select` for many (in a `select`
|
|
1812
|
+
* an option with an empty value means "no filter"); `tabs` for the views of
|
|
1813
|
+
* the page.
|
|
1814
|
+
*/
|
|
1815
|
+
display?: 'segmented' | 'select' | 'tabs';
|
|
1816
|
+
/** Params cleared when this one changes (e.g. `page`). */
|
|
1817
|
+
resets?: string[];
|
|
1818
|
+
}
|
|
1819
|
+
/** Free-text box over one page param; the host debounces and replaces the URL. */
|
|
1820
|
+
interface SearchBlock {
|
|
1821
|
+
type: ContentBlockType.Search;
|
|
1822
|
+
param: string;
|
|
1823
|
+
value: string;
|
|
1824
|
+
label?: string;
|
|
1825
|
+
placeholder?: string;
|
|
1826
|
+
/** Params cleared when the text changes (e.g. `page`). */
|
|
1827
|
+
resets?: string[];
|
|
1828
|
+
}
|
|
1829
|
+
/** Collapsible section, closed unless `open`. Recurses into child `blocks`. */
|
|
1830
|
+
interface DetailsBlock {
|
|
1831
|
+
type: ContentBlockType.Details;
|
|
1832
|
+
summary: string;
|
|
1833
|
+
blocks: ContentBlock[];
|
|
1834
|
+
open?: boolean;
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* One row of view controls above a list: search, filters, a "clear" link. It
|
|
1838
|
+
* wraps on a narrow screen and a search box takes the free width. Use `grid`
|
|
1839
|
+
* for content, this for controls.
|
|
1840
|
+
*/
|
|
1841
|
+
interface ToolbarBlock {
|
|
1842
|
+
type: ContentBlockType.Toolbar;
|
|
1843
|
+
blocks: ContentBlock[];
|
|
1844
|
+
}
|
|
1845
|
+
/** Child blocks in `columns` responsive columns (one column on narrow screens). */
|
|
1846
|
+
interface GridBlock {
|
|
1847
|
+
type: ContentBlockType.Grid;
|
|
1848
|
+
columns: 2 | 3 | 4;
|
|
1849
|
+
blocks: ContentBlock[];
|
|
1850
|
+
}
|
|
1851
|
+
type ContentBlock = TextBlock | BannerBlock | BadgeBlock | KeyValueBlock | CopyFieldBlock | LinkBlock | DividerBlock | ActionBlock | CardBlock | StatBlock | TableBlock | ChartBlock | FilterBlock | GridBlock | SearchBlock | DetailsBlock | ToolbarBlock;
|
|
1650
1852
|
/**
|
|
1651
1853
|
* One block tree the plugin injects into a host slot. `slot` names a host-owned
|
|
1652
1854
|
* target (e.g. "admin:order.detail.sidebar", "storefront:product.below"); the
|
|
@@ -1658,9 +1860,22 @@ interface UiContribution {
|
|
|
1658
1860
|
blocks: ContentBlock[];
|
|
1659
1861
|
order?: number;
|
|
1660
1862
|
}
|
|
1863
|
+
/** Runtime context the host hands to {@link IUiPlugin.resolveContributions}. */
|
|
1864
|
+
interface UiSlotContext {
|
|
1865
|
+
/** Free-form, JSON-serializable params chosen by the page (e.g. country). */
|
|
1866
|
+
params?: Record<string, unknown>;
|
|
1867
|
+
}
|
|
1661
1868
|
/** Impl behind a `ui` capability — the static set a plugin declares up front. */
|
|
1662
1869
|
interface IUiPlugin {
|
|
1663
1870
|
readonly contributions: UiContribution[];
|
|
1871
|
+
/**
|
|
1872
|
+
* Optional dynamic counterpart: for slots whose blocks depend on live data
|
|
1873
|
+
* (a full-page report), the host asks the plugin to build the block tree at
|
|
1874
|
+
* request time. Absent => the host serves the static `contributions`.
|
|
1875
|
+
* MUST resolve to pure-JSON blocks and SHOULD NOT throw: degrade to a
|
|
1876
|
+
* banner block explaining what is missing.
|
|
1877
|
+
*/
|
|
1878
|
+
resolveContributions?(slot: string, ctx: UiSlotContext): Promise<UiContribution[]>;
|
|
1664
1879
|
}
|
|
1665
1880
|
interface UiContributionsValidation {
|
|
1666
1881
|
success: boolean;
|
|
@@ -1779,6 +1994,32 @@ interface StorageBroker {
|
|
|
1779
1994
|
interface SequenceStore {
|
|
1780
1995
|
next(scope: string): Promise<number>;
|
|
1781
1996
|
}
|
|
1997
|
+
/**
|
|
1998
|
+
* A product of THIS store that was imported from a supplier's catalog
|
|
1999
|
+
* (dropshipping). `externalId` is the supplier's own product id, so a plugin
|
|
2000
|
+
* can join it with that supplier's data without reading the host database.
|
|
2001
|
+
*/
|
|
2002
|
+
interface SourcedProduct {
|
|
2003
|
+
/** Local product id in this store. */
|
|
2004
|
+
productId: string;
|
|
2005
|
+
/** Local product title (what the merchant named it). */
|
|
2006
|
+
title: string;
|
|
2007
|
+
/** The supplier's product id. */
|
|
2008
|
+
externalId: string;
|
|
2009
|
+
/**
|
|
2010
|
+
* The supplier marketplace product this one comes from, when the host knows
|
|
2011
|
+
* it (see `SupplierListing.catalogProductId`). `null` = not linked yet.
|
|
2012
|
+
*/
|
|
2013
|
+
catalogProductId: string | null;
|
|
2014
|
+
}
|
|
2015
|
+
/**
|
|
2016
|
+
* Read-only view of the store catalog, scoped by the host to the tenant of the
|
|
2017
|
+
* current call.
|
|
2018
|
+
*/
|
|
2019
|
+
interface CatalogReader {
|
|
2020
|
+
/** Products of this store sourced from `supplierCode` (e.g. `soydrop`). */
|
|
2021
|
+
listSourcedProducts(supplierCode: string): Promise<SourcedProduct[]>;
|
|
2022
|
+
}
|
|
1782
2023
|
type DomainEventName = string;
|
|
1783
2024
|
type DomainEventHandler = (payload: unknown) => void | Promise<void>;
|
|
1784
2025
|
/**
|
|
@@ -1794,10 +2035,15 @@ interface HostApi {
|
|
|
1794
2035
|
readonly secrets: SecretStore;
|
|
1795
2036
|
readonly storage: StorageBroker;
|
|
1796
2037
|
readonly sequence: SequenceStore;
|
|
2038
|
+
/**
|
|
2039
|
+
* Store catalog reads. Optional: a host that does not offer it leaves it
|
|
2040
|
+
* out, so a plugin must handle its absence (degrade, never assume).
|
|
2041
|
+
*/
|
|
2042
|
+
readonly catalog?: CatalogReader;
|
|
1797
2043
|
/** Subscribe to a host domain event (order.created, product.updated, ...). */
|
|
1798
2044
|
on(event: DomainEventName, handler: DomainEventHandler): void;
|
|
1799
2045
|
/** Expose a capability to the host's generic registry. */
|
|
1800
2046
|
registerCapability<T = unknown>(cap: Capability<T>): void;
|
|
1801
2047
|
}
|
|
1802
2048
|
|
|
1803
|
-
export {
|
|
2049
|
+
export { type DomainEventName as $, AUTHOR_HANDLE_RE as A, type BannerBlock$1 as B, ConfigScope as C, type CarrierSettlement as D, type CatalogReader as E, FieldType as F, type ChartBlock as G, type ChartSeries as H, type CodConfig as I, type CodFeeConfig as J, CodFeeType as K, type CodPurchaseTrigger as L, type ConditionalBlock as M, type ConditionalEquals as N, type ConditionalWhen as O, type PluginConfigField as P, type ConfigurablePlugin as Q, ContentActionVariant as R, type SelectOption as S, type ContentBlock as T, ContentBlockType as U, type CopyFieldBlock$1 as V, type CreateShipmentParams as W, type DetailsBlock as X, type DispatchContext as Y, type DividerBlock$1 as Z, type DomainEventHandler as _, type AccordionBlock as a, type PluginActionResult as a$, type EmbedInit as a0, type FieldBlock as a1, type FieldOption as a2, FieldVariant as a3, type FilterBlock as a4, type FilterOption as a5, GatewayEnvironment as a6, type GatewayFeeConfig as a7, type GatewayStaticConfig as a8, type GridBlock as a9, type KeyValueRow$1 as aA, LayoutMode as aB, type LinkBlock as aC, type Logger as aD, type MarkdownBlock as aE, MessageVariant as aF, type PageParams as aG, type PaymentCard as aH, type PaymentConnect as aI, type PaymentConnectExchange as aJ, type PaymentConnectParams as aK, type PaymentCustomer as aL, type PaymentGatewayCode as aM, type PaymentMerchantPricing as aN, type PaymentPayload as aO, type PaymentPluginConfig as aP, type PaymentRenderMode as aQ, type PaymentResult as aR, type PaymentSessionFees as aS, type PaymentSessionPayload as aT, type PaymentSessionResult as aU, type PaymentSettlementFees as aV, type PaymentVerifyPayload as aW, type PaymentWebhookSettlement as aX, type PlaceSupplierOrderInput as aY, type Plugin as aZ, type PluginActionContext as a_, type GroupBlock as aa, type HostApi as ab, type HttpClient as ac, type HttpRequest as ad, type HttpResponse as ae, type IAnalyticsPlugin as af, type IInvoicingPlugin as ag, type IPaymentPlugin as ah, type IPlugin as ai, type IShippingPlugin as aj, type ISuppliersPlugin as ak, type IUiPlugin as al, type InlineRowBlock as am, InvoiceDocumentType as an, type InvoiceLine as ao, type InvoiceMoney as ap, type InvoiceParty as aq, type InvoiceRequest as ar, type InvoiceResult as as, InvoiceStatus as at, type InvoiceTax as au, type InvoicingDefaultConfig as av, InvoicingFeature as aw, type InvoicingPluginConfig as ax, type InvoicingStaticConfig as ay, type KeyValueBlock$1 as az, type AccordionSection as b, type UiContributionsValidation as b$, type PluginAuthor as b0, type PluginConfigFieldDependency as b1, type PluginFactory as b2, type PluginManifest as b3, type RepeaterBlock as b4, RepeaterSource as b5, type SearchBlock as b6, type SecretStore as b7, type SequenceStore as b8, type SetupAction as b9, type SupplierOrderAddressLevel as bA, type SupplierOrderCustomer as bB, type SupplierOrderLine as bC, type SupplierOrderResult as bD, type SupplierOrderStatus as bE, type SupplierShipTo as bF, type SupplierShippingQuote as bG, type SupplierShippingQuoteInput as bH, type SupplierStock as bI, type SuppliersDefaultConfig as bJ, SuppliersFeature as bK, type SuppliersPluginConfig as bL, type SuppliersStaticConfig as bM, type TabItem as bN, type TableBlock as bO, type TableCell as bP, type TableColumn as bQ, type TableColumnSort as bR, type TablePagination as bS, type TableRichCell as bT, type TableSort as bU, type TabsBlock as bV, type ToggleBlock as bW, type ToolbarBlock as bX, type TrackingEvent as bY, TransactionStatus as bZ, type UiContribution as b_, type SetupLayout as ba, type SetupLayoutValidation as bb, type SetupStep as bc, type ShipmentAddress as bd, type ShipmentParcel as be, type ShipmentResult as bf, type ShippingDefaultConfig as bg, ShippingFeature as bh, type ShippingPluginConfig as bi, type ShippingQuote as bj, type ShippingQuoteParams as bk, type ShippingStaticConfig as bl, type SourcedProduct as bm, type StatBlock as bn, StepStatusFrom as bo, type StepStatusFromAction as bp, type StepStatusFromFields as bq, type StepStatusSource as br, type StorageBroker as bs, type SupplierCatalogQuery as bt, type SupplierFulfillmentEvent as bu, type SupplierListing as bv, type SupplierListingAttribute as bw, type SupplierListingPage as bx, type SupplierListingVariant as by, type SupplierMoney as bz, type ActionBlock$1 as c, UiSlot as c0, type UiSlotContext as c1, type VoidInvoiceInput as c2, type WebhookSignatureResult as c3, analyticsCapability as c4, capability as c5, crossValidateSetupLayout as c6, definePlugin as c7, invoicingCapability as c8, isConfigurablePlugin as c9, isPluginFactory as ca, minorUnitDigits as cb, paymentCapability as cc, shippingCapability as cd, suppliersCapability as ce, toMajorUnits as cf, toMinorUnits as cg, uiCapability as ch, validatePluginAuthor as ci, validateSetupLayout as cj, validateUiContributions as ck, ActionVariant as d, type AnalyticsActionSource as e, type AnalyticsConsent as f, type AnalyticsEvent as g, type AnalyticsEventName as h, AnalyticsFeature as i, type AnalyticsItem as j, type AnalyticsMoney as k, type AnalyticsPluginConfig as l, type AnalyticsPurchasePolicy as m, type AnalyticsStaticConfig as n, type AnalyticsUserData as o, type AnalyticsUtm as p, type AuthorValidation as q, type Block as r, type BlockBase as s, BlockType as t, type CalloutBlock as u, type Capability as v, CapabilityKind as w, type CardBlock$1 as x, type CardBrand as y, type CarrierServiceMode as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FieldType, C as ConfigScope, S as SelectOption, P as PluginConfigField } from './host-api-
|
|
2
|
-
export { A as AUTHOR_HANDLE_RE, a as AccordionBlock, b as AccordionSection, c as ActionBlock, d as ActionVariant, e as AnalyticsActionSource, f as AnalyticsConsent, g as AnalyticsEvent, h as AnalyticsEventName, i as AnalyticsFeature, j as AnalyticsItem, k as AnalyticsMoney, l as AnalyticsPluginConfig, m as AnalyticsPurchasePolicy, n as AnalyticsStaticConfig, o as AnalyticsUserData, p as AnalyticsUtm, q as AuthorValidation, B as BannerBlock, r as Block, s as BlockBase, t as BlockType, u as CalloutBlock, v as Capability, w as CapabilityKind, x as CardBlock, y as CardBrand, z as CarrierServiceMode, D as CarrierSettlement, E as
|
|
1
|
+
import { F as FieldType, C as ConfigScope, S as SelectOption, P as PluginConfigField } from './host-api-C5EsRbsA.mjs';
|
|
2
|
+
export { A as AUTHOR_HANDLE_RE, a as AccordionBlock, b as AccordionSection, c as ActionBlock, d as ActionVariant, e as AnalyticsActionSource, f as AnalyticsConsent, g as AnalyticsEvent, h as AnalyticsEventName, i as AnalyticsFeature, j as AnalyticsItem, k as AnalyticsMoney, l as AnalyticsPluginConfig, m as AnalyticsPurchasePolicy, n as AnalyticsStaticConfig, o as AnalyticsUserData, p as AnalyticsUtm, q as AuthorValidation, B as BannerBlock, r as Block, s as BlockBase, t as BlockType, u as CalloutBlock, v as Capability, w as CapabilityKind, x as CardBlock, y as CardBrand, z as CarrierServiceMode, D as CarrierSettlement, E as CatalogReader, G as ChartBlock, H as ChartSeries, I as CodConfig, J as CodFeeConfig, K as CodFeeType, L as CodPurchaseTrigger, M as ConditionalBlock, N as ConditionalEquals, O as ConditionalWhen, Q as ConfigurablePlugin, R as ContentActionVariant, T as ContentBlock, U as ContentBlockType, V as CopyFieldBlock, W as CreateShipmentParams, X as DetailsBlock, Y as DispatchContext, Z as DividerBlock, _ as DomainEventHandler, $ as DomainEventName, a0 as EmbedInit, a1 as FieldBlock, a2 as FieldOption, a3 as FieldVariant, a4 as FilterBlock, a5 as FilterOption, a6 as GatewayEnvironment, a7 as GatewayFeeConfig, a8 as GatewayStaticConfig, a9 as GridBlock, aa as GroupBlock, ab as HostApi, ac as HttpClient, ad as HttpRequest, ae as HttpResponse, af as IAnalyticsPlugin, ag as IInvoicingPlugin, ah as IPaymentPlugin, ai as IPlugin, aj as IShippingPlugin, ak as ISuppliersPlugin, al as IUiPlugin, am as InlineRowBlock, an as InvoiceDocumentType, ao as InvoiceLine, ap as InvoiceMoney, aq as InvoiceParty, ar as InvoiceRequest, as as InvoiceResult, at as InvoiceStatus, au as InvoiceTax, av as InvoicingDefaultConfig, aw as InvoicingFeature, ax as InvoicingPluginConfig, ay as InvoicingStaticConfig, az as KeyValueBlock, aA as KeyValueRow, aB as LayoutMode, aC as LinkBlock, aD as Logger, aE as MarkdownBlock, aF as MessageVariant, aG as PageParams, aH as PaymentCard, aI as PaymentConnect, aJ as PaymentConnectExchange, aK as PaymentConnectParams, aL as PaymentCustomer, aM as PaymentGatewayCode, aN as PaymentMerchantPricing, aO as PaymentPayload, aP as PaymentPluginConfig, aQ as PaymentRenderMode, aR as PaymentResult, aS as PaymentSessionFees, aT as PaymentSessionPayload, aU as PaymentSessionResult, aV as PaymentSettlementFees, aW as PaymentVerifyPayload, aX as PaymentWebhookSettlement, aY as PlaceSupplierOrderInput, aZ as Plugin, a_ as PluginActionContext, a$ as PluginActionResult, b0 as PluginAuthor, b1 as PluginConfigFieldDependency, b2 as PluginFactory, b3 as PluginManifest, b4 as RepeaterBlock, b5 as RepeaterSource, b6 as SearchBlock, b7 as SecretStore, b8 as SequenceStore, b9 as SetupAction, ba as SetupLayout, bb as SetupLayoutValidation, bc as SetupStep, bd as ShipmentAddress, be as ShipmentParcel, bf as ShipmentResult, bg as ShippingDefaultConfig, bh as ShippingFeature, bi as ShippingPluginConfig, bj as ShippingQuote, bk as ShippingQuoteParams, bl as ShippingStaticConfig, bm as SourcedProduct, bn as StatBlock, bo as StepStatusFrom, bp as StepStatusFromAction, bq as StepStatusFromFields, br as StepStatusSource, bs as StorageBroker, bt as SupplierCatalogQuery, bu as SupplierFulfillmentEvent, bv as SupplierListing, bw as SupplierListingAttribute, bx as SupplierListingPage, by as SupplierListingVariant, bz as SupplierMoney, bA as SupplierOrderAddressLevel, bB as SupplierOrderCustomer, bC as SupplierOrderLine, bD as SupplierOrderResult, bE as SupplierOrderStatus, bF as SupplierShipTo, bG as SupplierShippingQuote, bH as SupplierShippingQuoteInput, bI as SupplierStock, bJ as SuppliersDefaultConfig, bK as SuppliersFeature, bL as SuppliersPluginConfig, bM as SuppliersStaticConfig, bN as TabItem, bO as TableBlock, bP as TableCell, bQ as TableColumn, bR as TableColumnSort, bS as TablePagination, bT as TableRichCell, bU as TableSort, bV as TabsBlock, bW as ToggleBlock, bX as ToolbarBlock, bY as TrackingEvent, bZ as TransactionStatus, b_ as UiContribution, b$ as UiContributionsValidation, c0 as UiSlot, c1 as UiSlotContext, c2 as VoidInvoiceInput, c3 as WebhookSignatureResult, c4 as analyticsCapability, c5 as capability, c6 as crossValidateSetupLayout, c7 as definePlugin, c8 as invoicingCapability, c9 as isConfigurablePlugin, ca as isPluginFactory, cb as minorUnitDigits, cc as paymentCapability, cd as shippingCapability, ce as suppliersCapability, cf as toMajorUnits, cg as toMinorUnits, ch as uiCapability, ci as validatePluginAuthor, cj as validateSetupLayout, ck as validateUiContributions } from './host-api-C5EsRbsA.mjs';
|
|
3
3
|
|
|
4
4
|
declare const PAYMENT_PLUGIN_TOKEN: "PAYMENT_PLUGINS";
|
|
5
5
|
declare const SHIPPING_PLUGIN_TOKEN: "SHIPPING_PLUGINS";
|
|
@@ -74,7 +74,7 @@ declare function checkPermissions(required: string[], grantedRaw: string[]): Per
|
|
|
74
74
|
* - MINOR: additive (new optional fields, new tokens) — backwards compatible.
|
|
75
75
|
* - PATCH: docs/fixes with zero shape changes.
|
|
76
76
|
*/
|
|
77
|
-
declare const SDK_VERSION = "0.7.
|
|
77
|
+
declare const SDK_VERSION = "0.7.2";
|
|
78
78
|
/**
|
|
79
79
|
* True when a plugin built against `pluginSdkVersion` can run on a host that
|
|
80
80
|
* ships `hostSdkVersion`. Rule: same major, host minor >= plugin minor.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FieldType, C as ConfigScope, S as SelectOption, P as PluginConfigField } from './host-api-
|
|
2
|
-
export { A as AUTHOR_HANDLE_RE, a as AccordionBlock, b as AccordionSection, c as ActionBlock, d as ActionVariant, e as AnalyticsActionSource, f as AnalyticsConsent, g as AnalyticsEvent, h as AnalyticsEventName, i as AnalyticsFeature, j as AnalyticsItem, k as AnalyticsMoney, l as AnalyticsPluginConfig, m as AnalyticsPurchasePolicy, n as AnalyticsStaticConfig, o as AnalyticsUserData, p as AnalyticsUtm, q as AuthorValidation, B as BannerBlock, r as Block, s as BlockBase, t as BlockType, u as CalloutBlock, v as Capability, w as CapabilityKind, x as CardBlock, y as CardBrand, z as CarrierServiceMode, D as CarrierSettlement, E as
|
|
1
|
+
import { F as FieldType, C as ConfigScope, S as SelectOption, P as PluginConfigField } from './host-api-C5EsRbsA.js';
|
|
2
|
+
export { A as AUTHOR_HANDLE_RE, a as AccordionBlock, b as AccordionSection, c as ActionBlock, d as ActionVariant, e as AnalyticsActionSource, f as AnalyticsConsent, g as AnalyticsEvent, h as AnalyticsEventName, i as AnalyticsFeature, j as AnalyticsItem, k as AnalyticsMoney, l as AnalyticsPluginConfig, m as AnalyticsPurchasePolicy, n as AnalyticsStaticConfig, o as AnalyticsUserData, p as AnalyticsUtm, q as AuthorValidation, B as BannerBlock, r as Block, s as BlockBase, t as BlockType, u as CalloutBlock, v as Capability, w as CapabilityKind, x as CardBlock, y as CardBrand, z as CarrierServiceMode, D as CarrierSettlement, E as CatalogReader, G as ChartBlock, H as ChartSeries, I as CodConfig, J as CodFeeConfig, K as CodFeeType, L as CodPurchaseTrigger, M as ConditionalBlock, N as ConditionalEquals, O as ConditionalWhen, Q as ConfigurablePlugin, R as ContentActionVariant, T as ContentBlock, U as ContentBlockType, V as CopyFieldBlock, W as CreateShipmentParams, X as DetailsBlock, Y as DispatchContext, Z as DividerBlock, _ as DomainEventHandler, $ as DomainEventName, a0 as EmbedInit, a1 as FieldBlock, a2 as FieldOption, a3 as FieldVariant, a4 as FilterBlock, a5 as FilterOption, a6 as GatewayEnvironment, a7 as GatewayFeeConfig, a8 as GatewayStaticConfig, a9 as GridBlock, aa as GroupBlock, ab as HostApi, ac as HttpClient, ad as HttpRequest, ae as HttpResponse, af as IAnalyticsPlugin, ag as IInvoicingPlugin, ah as IPaymentPlugin, ai as IPlugin, aj as IShippingPlugin, ak as ISuppliersPlugin, al as IUiPlugin, am as InlineRowBlock, an as InvoiceDocumentType, ao as InvoiceLine, ap as InvoiceMoney, aq as InvoiceParty, ar as InvoiceRequest, as as InvoiceResult, at as InvoiceStatus, au as InvoiceTax, av as InvoicingDefaultConfig, aw as InvoicingFeature, ax as InvoicingPluginConfig, ay as InvoicingStaticConfig, az as KeyValueBlock, aA as KeyValueRow, aB as LayoutMode, aC as LinkBlock, aD as Logger, aE as MarkdownBlock, aF as MessageVariant, aG as PageParams, aH as PaymentCard, aI as PaymentConnect, aJ as PaymentConnectExchange, aK as PaymentConnectParams, aL as PaymentCustomer, aM as PaymentGatewayCode, aN as PaymentMerchantPricing, aO as PaymentPayload, aP as PaymentPluginConfig, aQ as PaymentRenderMode, aR as PaymentResult, aS as PaymentSessionFees, aT as PaymentSessionPayload, aU as PaymentSessionResult, aV as PaymentSettlementFees, aW as PaymentVerifyPayload, aX as PaymentWebhookSettlement, aY as PlaceSupplierOrderInput, aZ as Plugin, a_ as PluginActionContext, a$ as PluginActionResult, b0 as PluginAuthor, b1 as PluginConfigFieldDependency, b2 as PluginFactory, b3 as PluginManifest, b4 as RepeaterBlock, b5 as RepeaterSource, b6 as SearchBlock, b7 as SecretStore, b8 as SequenceStore, b9 as SetupAction, ba as SetupLayout, bb as SetupLayoutValidation, bc as SetupStep, bd as ShipmentAddress, be as ShipmentParcel, bf as ShipmentResult, bg as ShippingDefaultConfig, bh as ShippingFeature, bi as ShippingPluginConfig, bj as ShippingQuote, bk as ShippingQuoteParams, bl as ShippingStaticConfig, bm as SourcedProduct, bn as StatBlock, bo as StepStatusFrom, bp as StepStatusFromAction, bq as StepStatusFromFields, br as StepStatusSource, bs as StorageBroker, bt as SupplierCatalogQuery, bu as SupplierFulfillmentEvent, bv as SupplierListing, bw as SupplierListingAttribute, bx as SupplierListingPage, by as SupplierListingVariant, bz as SupplierMoney, bA as SupplierOrderAddressLevel, bB as SupplierOrderCustomer, bC as SupplierOrderLine, bD as SupplierOrderResult, bE as SupplierOrderStatus, bF as SupplierShipTo, bG as SupplierShippingQuote, bH as SupplierShippingQuoteInput, bI as SupplierStock, bJ as SuppliersDefaultConfig, bK as SuppliersFeature, bL as SuppliersPluginConfig, bM as SuppliersStaticConfig, bN as TabItem, bO as TableBlock, bP as TableCell, bQ as TableColumn, bR as TableColumnSort, bS as TablePagination, bT as TableRichCell, bU as TableSort, bV as TabsBlock, bW as ToggleBlock, bX as ToolbarBlock, bY as TrackingEvent, bZ as TransactionStatus, b_ as UiContribution, b$ as UiContributionsValidation, c0 as UiSlot, c1 as UiSlotContext, c2 as VoidInvoiceInput, c3 as WebhookSignatureResult, c4 as analyticsCapability, c5 as capability, c6 as crossValidateSetupLayout, c7 as definePlugin, c8 as invoicingCapability, c9 as isConfigurablePlugin, ca as isPluginFactory, cb as minorUnitDigits, cc as paymentCapability, cd as shippingCapability, ce as suppliersCapability, cf as toMajorUnits, cg as toMinorUnits, ch as uiCapability, ci as validatePluginAuthor, cj as validateSetupLayout, ck as validateUiContributions } from './host-api-C5EsRbsA.js';
|
|
3
3
|
|
|
4
4
|
declare const PAYMENT_PLUGIN_TOKEN: "PAYMENT_PLUGINS";
|
|
5
5
|
declare const SHIPPING_PLUGIN_TOKEN: "SHIPPING_PLUGINS";
|
|
@@ -74,7 +74,7 @@ declare function checkPermissions(required: string[], grantedRaw: string[]): Per
|
|
|
74
74
|
* - MINOR: additive (new optional fields, new tokens) — backwards compatible.
|
|
75
75
|
* - PATCH: docs/fixes with zero shape changes.
|
|
76
76
|
*/
|
|
77
|
-
declare const SDK_VERSION = "0.7.
|
|
77
|
+
declare const SDK_VERSION = "0.7.2";
|
|
78
78
|
/**
|
|
79
79
|
* True when a plugin built against `pluginSdkVersion` can run on a host that
|
|
80
80
|
* ships `hostSdkVersion`. Rule: same major, host minor >= plugin minor.
|
package/dist/index.js
CHANGED
|
@@ -48,6 +48,7 @@ __export(index_exports, {
|
|
|
48
48
|
StepStatusFrom: () => StepStatusFrom,
|
|
49
49
|
SuppliersFeature: () => SuppliersFeature,
|
|
50
50
|
TransactionStatus: () => TransactionStatus,
|
|
51
|
+
UiSlot: () => UiSlot,
|
|
51
52
|
analyticsCapability: () => analyticsCapability,
|
|
52
53
|
capability: () => capability,
|
|
53
54
|
checkPermissions: () => checkPermissions,
|
|
@@ -568,8 +569,20 @@ var ContentBlockType = /* @__PURE__ */ ((ContentBlockType2) => {
|
|
|
568
569
|
ContentBlockType2["Divider"] = "divider";
|
|
569
570
|
ContentBlockType2["Action"] = "action";
|
|
570
571
|
ContentBlockType2["Card"] = "card";
|
|
572
|
+
ContentBlockType2["Stat"] = "stat";
|
|
573
|
+
ContentBlockType2["Table"] = "table";
|
|
574
|
+
ContentBlockType2["Chart"] = "chart";
|
|
575
|
+
ContentBlockType2["Filter"] = "filter";
|
|
576
|
+
ContentBlockType2["Grid"] = "grid";
|
|
577
|
+
ContentBlockType2["Search"] = "search";
|
|
578
|
+
ContentBlockType2["Details"] = "details";
|
|
579
|
+
ContentBlockType2["Toolbar"] = "toolbar";
|
|
571
580
|
return ContentBlockType2;
|
|
572
581
|
})(ContentBlockType || {});
|
|
582
|
+
var UiSlot = {
|
|
583
|
+
/** Full-page surface of an app in the admin (the app owns the whole body). */
|
|
584
|
+
AdminAppPage: "admin:app.page"
|
|
585
|
+
};
|
|
573
586
|
var ContentActionVariant = /* @__PURE__ */ ((ContentActionVariant2) => {
|
|
574
587
|
ContentActionVariant2["Primary"] = "primary";
|
|
575
588
|
ContentActionVariant2["Secondary"] = "secondary";
|
|
@@ -611,12 +624,14 @@ var sCopyFieldBlock2 = (0, import_superstruct3.object)({
|
|
|
611
624
|
value: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
612
625
|
computedKey: (0, import_superstruct3.optional)((0, import_superstruct3.string)())
|
|
613
626
|
});
|
|
627
|
+
var sPageParams = (0, import_superstruct3.record)((0, import_superstruct3.string)(), (0, import_superstruct3.union)([(0, import_superstruct3.string)(), (0, import_superstruct3.literal)(null)]));
|
|
614
628
|
var sLinkBlock = (0, import_superstruct3.object)({
|
|
615
629
|
type: (0, import_superstruct3.literal)("link" /* Link */),
|
|
616
630
|
label: (0, import_superstruct3.string)(),
|
|
617
631
|
href: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
618
632
|
computedKey: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
619
|
-
external: (0, import_superstruct3.optional)((0, import_superstruct3.boolean)())
|
|
633
|
+
external: (0, import_superstruct3.optional)((0, import_superstruct3.boolean)()),
|
|
634
|
+
params: (0, import_superstruct3.optional)(sPageParams)
|
|
620
635
|
});
|
|
621
636
|
var sDividerBlock2 = (0, import_superstruct3.object)({ type: (0, import_superstruct3.literal)("divider" /* Divider */) });
|
|
622
637
|
var sActionBlock2 = (0, import_superstruct3.object)({
|
|
@@ -625,6 +640,110 @@ var sActionBlock2 = (0, import_superstruct3.object)({
|
|
|
625
640
|
label: (0, import_superstruct3.string)(),
|
|
626
641
|
variant: (0, import_superstruct3.optional)(sContentActionVariant)
|
|
627
642
|
});
|
|
643
|
+
var sTableCell = (0, import_superstruct3.union)([
|
|
644
|
+
(0, import_superstruct3.string)(),
|
|
645
|
+
(0, import_superstruct3.number)(),
|
|
646
|
+
(0, import_superstruct3.boolean)(),
|
|
647
|
+
(0, import_superstruct3.literal)(null),
|
|
648
|
+
(0, import_superstruct3.object)({
|
|
649
|
+
text: (0, import_superstruct3.string)(),
|
|
650
|
+
caption: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
651
|
+
image: (0, import_superstruct3.optional)((0, import_superstruct3.union)([(0, import_superstruct3.string)(), (0, import_superstruct3.literal)(null)])),
|
|
652
|
+
tone: (0, import_superstruct3.optional)(sMessageVariant2)
|
|
653
|
+
})
|
|
654
|
+
]);
|
|
655
|
+
var sStatBlock = (0, import_superstruct3.object)({
|
|
656
|
+
type: (0, import_superstruct3.literal)("stat" /* Stat */),
|
|
657
|
+
label: (0, import_superstruct3.string)(),
|
|
658
|
+
value: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
659
|
+
computedKey: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
660
|
+
hint: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
661
|
+
variant: (0, import_superstruct3.optional)(sMessageVariant2),
|
|
662
|
+
estimate: (0, import_superstruct3.optional)((0, import_superstruct3.boolean)()),
|
|
663
|
+
params: (0, import_superstruct3.optional)(sPageParams)
|
|
664
|
+
});
|
|
665
|
+
var sTableBlock = (0, import_superstruct3.object)({
|
|
666
|
+
type: (0, import_superstruct3.literal)("table" /* Table */),
|
|
667
|
+
title: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
668
|
+
columns: (0, import_superstruct3.array)(
|
|
669
|
+
(0, import_superstruct3.object)({
|
|
670
|
+
key: (0, import_superstruct3.string)(),
|
|
671
|
+
label: (0, import_superstruct3.string)(),
|
|
672
|
+
align: (0, import_superstruct3.optional)((0, import_superstruct3.enums)(["left", "right"])),
|
|
673
|
+
hint: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
674
|
+
sort: (0, import_superstruct3.optional)(
|
|
675
|
+
(0, import_superstruct3.object)({
|
|
676
|
+
value: (0, import_superstruct3.string)(),
|
|
677
|
+
dir: (0, import_superstruct3.optional)((0, import_superstruct3.enums)(["asc", "desc"]))
|
|
678
|
+
})
|
|
679
|
+
)
|
|
680
|
+
})
|
|
681
|
+
),
|
|
682
|
+
rows: (0, import_superstruct3.array)((0, import_superstruct3.record)((0, import_superstruct3.string)(), sTableCell)),
|
|
683
|
+
emptyText: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
684
|
+
rowParams: (0, import_superstruct3.optional)((0, import_superstruct3.array)((0, import_superstruct3.union)([sPageParams, (0, import_superstruct3.literal)(null)]))),
|
|
685
|
+
sort: (0, import_superstruct3.optional)(
|
|
686
|
+
(0, import_superstruct3.object)({
|
|
687
|
+
param: (0, import_superstruct3.string)(),
|
|
688
|
+
value: (0, import_superstruct3.string)(),
|
|
689
|
+
resets: (0, import_superstruct3.optional)((0, import_superstruct3.array)((0, import_superstruct3.string)()))
|
|
690
|
+
})
|
|
691
|
+
),
|
|
692
|
+
pagination: (0, import_superstruct3.optional)(
|
|
693
|
+
(0, import_superstruct3.object)({
|
|
694
|
+
param: (0, import_superstruct3.string)(),
|
|
695
|
+
page: (0, import_superstruct3.number)(),
|
|
696
|
+
pageSize: (0, import_superstruct3.number)(),
|
|
697
|
+
total: (0, import_superstruct3.number)()
|
|
698
|
+
})
|
|
699
|
+
)
|
|
700
|
+
});
|
|
701
|
+
var sChartBlock = (0, import_superstruct3.object)({
|
|
702
|
+
type: (0, import_superstruct3.literal)("chart" /* Chart */),
|
|
703
|
+
kind: (0, import_superstruct3.enums)(["bar", "line", "hbar"]),
|
|
704
|
+
title: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
705
|
+
labels: (0, import_superstruct3.array)((0, import_superstruct3.string)()),
|
|
706
|
+
series: (0, import_superstruct3.array)(
|
|
707
|
+
(0, import_superstruct3.object)({
|
|
708
|
+
name: (0, import_superstruct3.string)(),
|
|
709
|
+
data: (0, import_superstruct3.array)((0, import_superstruct3.union)([(0, import_superstruct3.number)(), (0, import_superstruct3.literal)(null)]))
|
|
710
|
+
})
|
|
711
|
+
),
|
|
712
|
+
unit: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
713
|
+
emptyText: (0, import_superstruct3.optional)((0, import_superstruct3.string)())
|
|
714
|
+
});
|
|
715
|
+
var sFilterBlock = (0, import_superstruct3.object)({
|
|
716
|
+
type: (0, import_superstruct3.literal)("filter" /* Filter */),
|
|
717
|
+
param: (0, import_superstruct3.string)(),
|
|
718
|
+
label: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
719
|
+
value: (0, import_superstruct3.string)(),
|
|
720
|
+
options: (0, import_superstruct3.size)((0, import_superstruct3.array)((0, import_superstruct3.object)({ value: (0, import_superstruct3.string)(), label: (0, import_superstruct3.string)() })), 1, Infinity),
|
|
721
|
+
display: (0, import_superstruct3.optional)((0, import_superstruct3.enums)(["segmented", "select", "tabs"])),
|
|
722
|
+
resets: (0, import_superstruct3.optional)((0, import_superstruct3.array)((0, import_superstruct3.string)()))
|
|
723
|
+
});
|
|
724
|
+
var sSearchBlock = (0, import_superstruct3.object)({
|
|
725
|
+
type: (0, import_superstruct3.literal)("search" /* Search */),
|
|
726
|
+
param: (0, import_superstruct3.string)(),
|
|
727
|
+
value: (0, import_superstruct3.string)(),
|
|
728
|
+
label: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
729
|
+
placeholder: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
730
|
+
resets: (0, import_superstruct3.optional)((0, import_superstruct3.array)((0, import_superstruct3.string)()))
|
|
731
|
+
});
|
|
732
|
+
var sToolbarBlock = (0, import_superstruct3.object)({
|
|
733
|
+
type: (0, import_superstruct3.literal)("toolbar" /* Toolbar */),
|
|
734
|
+
blocks: (0, import_superstruct3.array)((0, import_superstruct3.lazy)(() => sContentBlock))
|
|
735
|
+
});
|
|
736
|
+
var sGridBlock = (0, import_superstruct3.object)({
|
|
737
|
+
type: (0, import_superstruct3.literal)("grid" /* Grid */),
|
|
738
|
+
columns: (0, import_superstruct3.union)([(0, import_superstruct3.literal)(2), (0, import_superstruct3.literal)(3), (0, import_superstruct3.literal)(4)]),
|
|
739
|
+
blocks: (0, import_superstruct3.array)((0, import_superstruct3.lazy)(() => sContentBlock))
|
|
740
|
+
});
|
|
741
|
+
var sDetailsBlock = (0, import_superstruct3.object)({
|
|
742
|
+
type: (0, import_superstruct3.literal)("details" /* Details */),
|
|
743
|
+
summary: (0, import_superstruct3.string)(),
|
|
744
|
+
blocks: (0, import_superstruct3.array)((0, import_superstruct3.lazy)(() => sContentBlock)),
|
|
745
|
+
open: (0, import_superstruct3.optional)((0, import_superstruct3.boolean)())
|
|
746
|
+
});
|
|
628
747
|
var sCardBlock2 = (0, import_superstruct3.object)({
|
|
629
748
|
type: (0, import_superstruct3.literal)("card" /* Card */),
|
|
630
749
|
title: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
|
|
@@ -640,7 +759,15 @@ var sContentBlock = (0, import_superstruct3.union)([
|
|
|
640
759
|
sLinkBlock,
|
|
641
760
|
sDividerBlock2,
|
|
642
761
|
sActionBlock2,
|
|
643
|
-
sCardBlock2
|
|
762
|
+
sCardBlock2,
|
|
763
|
+
sStatBlock,
|
|
764
|
+
sTableBlock,
|
|
765
|
+
sChartBlock,
|
|
766
|
+
sFilterBlock,
|
|
767
|
+
sGridBlock,
|
|
768
|
+
sSearchBlock,
|
|
769
|
+
sDetailsBlock,
|
|
770
|
+
sToolbarBlock
|
|
644
771
|
]);
|
|
645
772
|
var sUiContribution = (0, import_superstruct3.object)({
|
|
646
773
|
slot: (0, import_superstruct3.string)(),
|
|
@@ -741,7 +868,7 @@ function checkPermissions(required, grantedRaw) {
|
|
|
741
868
|
}
|
|
742
869
|
|
|
743
870
|
// src/version.ts
|
|
744
|
-
var SDK_VERSION = "0.7.
|
|
871
|
+
var SDK_VERSION = "0.7.2";
|
|
745
872
|
function isSdkCompatible(pluginSdkVersion, hostSdkVersion) {
|
|
746
873
|
const parse = (v) => {
|
|
747
874
|
const m = /^(\d+)\.(\d+)\.(\d+)/.exec(v);
|
|
@@ -786,6 +913,7 @@ function isSdkCompatible(pluginSdkVersion, hostSdkVersion) {
|
|
|
786
913
|
StepStatusFrom,
|
|
787
914
|
SuppliersFeature,
|
|
788
915
|
TransactionStatus,
|
|
916
|
+
UiSlot,
|
|
789
917
|
analyticsCapability,
|
|
790
918
|
capability,
|
|
791
919
|
checkPermissions,
|
package/dist/index.mjs
CHANGED
|
@@ -517,6 +517,8 @@ import {
|
|
|
517
517
|
number as number3,
|
|
518
518
|
object as object2,
|
|
519
519
|
optional as optional3,
|
|
520
|
+
record,
|
|
521
|
+
size,
|
|
520
522
|
string as string3,
|
|
521
523
|
union as union2,
|
|
522
524
|
validate as validate3
|
|
@@ -531,8 +533,20 @@ var ContentBlockType = /* @__PURE__ */ ((ContentBlockType2) => {
|
|
|
531
533
|
ContentBlockType2["Divider"] = "divider";
|
|
532
534
|
ContentBlockType2["Action"] = "action";
|
|
533
535
|
ContentBlockType2["Card"] = "card";
|
|
536
|
+
ContentBlockType2["Stat"] = "stat";
|
|
537
|
+
ContentBlockType2["Table"] = "table";
|
|
538
|
+
ContentBlockType2["Chart"] = "chart";
|
|
539
|
+
ContentBlockType2["Filter"] = "filter";
|
|
540
|
+
ContentBlockType2["Grid"] = "grid";
|
|
541
|
+
ContentBlockType2["Search"] = "search";
|
|
542
|
+
ContentBlockType2["Details"] = "details";
|
|
543
|
+
ContentBlockType2["Toolbar"] = "toolbar";
|
|
534
544
|
return ContentBlockType2;
|
|
535
545
|
})(ContentBlockType || {});
|
|
546
|
+
var UiSlot = {
|
|
547
|
+
/** Full-page surface of an app in the admin (the app owns the whole body). */
|
|
548
|
+
AdminAppPage: "admin:app.page"
|
|
549
|
+
};
|
|
536
550
|
var ContentActionVariant = /* @__PURE__ */ ((ContentActionVariant2) => {
|
|
537
551
|
ContentActionVariant2["Primary"] = "primary";
|
|
538
552
|
ContentActionVariant2["Secondary"] = "secondary";
|
|
@@ -574,12 +588,14 @@ var sCopyFieldBlock2 = object2({
|
|
|
574
588
|
value: optional3(string3()),
|
|
575
589
|
computedKey: optional3(string3())
|
|
576
590
|
});
|
|
591
|
+
var sPageParams = record(string3(), union2([string3(), literal2(null)]));
|
|
577
592
|
var sLinkBlock = object2({
|
|
578
593
|
type: literal2("link" /* Link */),
|
|
579
594
|
label: string3(),
|
|
580
595
|
href: optional3(string3()),
|
|
581
596
|
computedKey: optional3(string3()),
|
|
582
|
-
external: optional3(boolean3())
|
|
597
|
+
external: optional3(boolean3()),
|
|
598
|
+
params: optional3(sPageParams)
|
|
583
599
|
});
|
|
584
600
|
var sDividerBlock2 = object2({ type: literal2("divider" /* Divider */) });
|
|
585
601
|
var sActionBlock2 = object2({
|
|
@@ -588,6 +604,110 @@ var sActionBlock2 = object2({
|
|
|
588
604
|
label: string3(),
|
|
589
605
|
variant: optional3(sContentActionVariant)
|
|
590
606
|
});
|
|
607
|
+
var sTableCell = union2([
|
|
608
|
+
string3(),
|
|
609
|
+
number3(),
|
|
610
|
+
boolean3(),
|
|
611
|
+
literal2(null),
|
|
612
|
+
object2({
|
|
613
|
+
text: string3(),
|
|
614
|
+
caption: optional3(string3()),
|
|
615
|
+
image: optional3(union2([string3(), literal2(null)])),
|
|
616
|
+
tone: optional3(sMessageVariant2)
|
|
617
|
+
})
|
|
618
|
+
]);
|
|
619
|
+
var sStatBlock = object2({
|
|
620
|
+
type: literal2("stat" /* Stat */),
|
|
621
|
+
label: string3(),
|
|
622
|
+
value: optional3(string3()),
|
|
623
|
+
computedKey: optional3(string3()),
|
|
624
|
+
hint: optional3(string3()),
|
|
625
|
+
variant: optional3(sMessageVariant2),
|
|
626
|
+
estimate: optional3(boolean3()),
|
|
627
|
+
params: optional3(sPageParams)
|
|
628
|
+
});
|
|
629
|
+
var sTableBlock = object2({
|
|
630
|
+
type: literal2("table" /* Table */),
|
|
631
|
+
title: optional3(string3()),
|
|
632
|
+
columns: array2(
|
|
633
|
+
object2({
|
|
634
|
+
key: string3(),
|
|
635
|
+
label: string3(),
|
|
636
|
+
align: optional3(enums3(["left", "right"])),
|
|
637
|
+
hint: optional3(string3()),
|
|
638
|
+
sort: optional3(
|
|
639
|
+
object2({
|
|
640
|
+
value: string3(),
|
|
641
|
+
dir: optional3(enums3(["asc", "desc"]))
|
|
642
|
+
})
|
|
643
|
+
)
|
|
644
|
+
})
|
|
645
|
+
),
|
|
646
|
+
rows: array2(record(string3(), sTableCell)),
|
|
647
|
+
emptyText: optional3(string3()),
|
|
648
|
+
rowParams: optional3(array2(union2([sPageParams, literal2(null)]))),
|
|
649
|
+
sort: optional3(
|
|
650
|
+
object2({
|
|
651
|
+
param: string3(),
|
|
652
|
+
value: string3(),
|
|
653
|
+
resets: optional3(array2(string3()))
|
|
654
|
+
})
|
|
655
|
+
),
|
|
656
|
+
pagination: optional3(
|
|
657
|
+
object2({
|
|
658
|
+
param: string3(),
|
|
659
|
+
page: number3(),
|
|
660
|
+
pageSize: number3(),
|
|
661
|
+
total: number3()
|
|
662
|
+
})
|
|
663
|
+
)
|
|
664
|
+
});
|
|
665
|
+
var sChartBlock = object2({
|
|
666
|
+
type: literal2("chart" /* Chart */),
|
|
667
|
+
kind: enums3(["bar", "line", "hbar"]),
|
|
668
|
+
title: optional3(string3()),
|
|
669
|
+
labels: array2(string3()),
|
|
670
|
+
series: array2(
|
|
671
|
+
object2({
|
|
672
|
+
name: string3(),
|
|
673
|
+
data: array2(union2([number3(), literal2(null)]))
|
|
674
|
+
})
|
|
675
|
+
),
|
|
676
|
+
unit: optional3(string3()),
|
|
677
|
+
emptyText: optional3(string3())
|
|
678
|
+
});
|
|
679
|
+
var sFilterBlock = object2({
|
|
680
|
+
type: literal2("filter" /* Filter */),
|
|
681
|
+
param: string3(),
|
|
682
|
+
label: optional3(string3()),
|
|
683
|
+
value: string3(),
|
|
684
|
+
options: size(array2(object2({ value: string3(), label: string3() })), 1, Infinity),
|
|
685
|
+
display: optional3(enums3(["segmented", "select", "tabs"])),
|
|
686
|
+
resets: optional3(array2(string3()))
|
|
687
|
+
});
|
|
688
|
+
var sSearchBlock = object2({
|
|
689
|
+
type: literal2("search" /* Search */),
|
|
690
|
+
param: string3(),
|
|
691
|
+
value: string3(),
|
|
692
|
+
label: optional3(string3()),
|
|
693
|
+
placeholder: optional3(string3()),
|
|
694
|
+
resets: optional3(array2(string3()))
|
|
695
|
+
});
|
|
696
|
+
var sToolbarBlock = object2({
|
|
697
|
+
type: literal2("toolbar" /* Toolbar */),
|
|
698
|
+
blocks: array2(lazy2(() => sContentBlock))
|
|
699
|
+
});
|
|
700
|
+
var sGridBlock = object2({
|
|
701
|
+
type: literal2("grid" /* Grid */),
|
|
702
|
+
columns: union2([literal2(2), literal2(3), literal2(4)]),
|
|
703
|
+
blocks: array2(lazy2(() => sContentBlock))
|
|
704
|
+
});
|
|
705
|
+
var sDetailsBlock = object2({
|
|
706
|
+
type: literal2("details" /* Details */),
|
|
707
|
+
summary: string3(),
|
|
708
|
+
blocks: array2(lazy2(() => sContentBlock)),
|
|
709
|
+
open: optional3(boolean3())
|
|
710
|
+
});
|
|
591
711
|
var sCardBlock2 = object2({
|
|
592
712
|
type: literal2("card" /* Card */),
|
|
593
713
|
title: optional3(string3()),
|
|
@@ -603,7 +723,15 @@ var sContentBlock = union2([
|
|
|
603
723
|
sLinkBlock,
|
|
604
724
|
sDividerBlock2,
|
|
605
725
|
sActionBlock2,
|
|
606
|
-
sCardBlock2
|
|
726
|
+
sCardBlock2,
|
|
727
|
+
sStatBlock,
|
|
728
|
+
sTableBlock,
|
|
729
|
+
sChartBlock,
|
|
730
|
+
sFilterBlock,
|
|
731
|
+
sGridBlock,
|
|
732
|
+
sSearchBlock,
|
|
733
|
+
sDetailsBlock,
|
|
734
|
+
sToolbarBlock
|
|
607
735
|
]);
|
|
608
736
|
var sUiContribution = object2({
|
|
609
737
|
slot: string3(),
|
|
@@ -672,7 +800,7 @@ function isPluginFactory(value) {
|
|
|
672
800
|
}
|
|
673
801
|
|
|
674
802
|
// src/version.ts
|
|
675
|
-
var SDK_VERSION = "0.7.
|
|
803
|
+
var SDK_VERSION = "0.7.2";
|
|
676
804
|
function isSdkCompatible(pluginSdkVersion, hostSdkVersion) {
|
|
677
805
|
const parse = (v) => {
|
|
678
806
|
const m = /^(\d+)\.(\d+)\.(\d+)/.exec(v);
|
|
@@ -716,6 +844,7 @@ export {
|
|
|
716
844
|
StepStatusFrom,
|
|
717
845
|
SuppliersFeature,
|
|
718
846
|
TransactionStatus,
|
|
847
|
+
UiSlot,
|
|
719
848
|
analyticsCapability,
|
|
720
849
|
capability,
|
|
721
850
|
checkPermissions,
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ab as HostApi, ad as HttpRequest, $ as DomainEventName, v as Capability, _ as DomainEventHandler, ae as HttpResponse, bm as SourcedProduct, Y as DispatchContext } from '../host-api-C5EsRbsA.mjs';
|
|
2
2
|
|
|
3
3
|
/** Every recorded interaction, keyed by `"port.method"`. */
|
|
4
4
|
interface MockHostCalls {
|
|
@@ -10,6 +10,7 @@ interface MockHostCalls {
|
|
|
10
10
|
body: Uint8Array | string;
|
|
11
11
|
}>;
|
|
12
12
|
'sequence.next': string[];
|
|
13
|
+
'catalog.listSourcedProducts': string[];
|
|
13
14
|
'host.on': DomainEventName[];
|
|
14
15
|
}
|
|
15
16
|
interface MockHostOptions {
|
|
@@ -29,6 +30,11 @@ interface MockHostOptions {
|
|
|
29
30
|
httpResponses?: Record<string, HttpResponse>;
|
|
30
31
|
/** Seed values for named sequence scopes (monotonic from here). */
|
|
31
32
|
sequences?: Record<string, number>;
|
|
33
|
+
/**
|
|
34
|
+
* Canned store products by supplier code (sourced products). When set, the mock exposes
|
|
35
|
+
* `catalog`; omit it to test a plugin against a host without that port.
|
|
36
|
+
*/
|
|
37
|
+
sourcedProducts?: Record<string, SourcedProduct[]>;
|
|
32
38
|
}
|
|
33
39
|
interface MockHostApi extends HostApi {
|
|
34
40
|
/** Every port call recorded in order. */
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ab as HostApi, ad as HttpRequest, $ as DomainEventName, v as Capability, _ as DomainEventHandler, ae as HttpResponse, bm as SourcedProduct, Y as DispatchContext } from '../host-api-C5EsRbsA.js';
|
|
2
2
|
|
|
3
3
|
/** Every recorded interaction, keyed by `"port.method"`. */
|
|
4
4
|
interface MockHostCalls {
|
|
@@ -10,6 +10,7 @@ interface MockHostCalls {
|
|
|
10
10
|
body: Uint8Array | string;
|
|
11
11
|
}>;
|
|
12
12
|
'sequence.next': string[];
|
|
13
|
+
'catalog.listSourcedProducts': string[];
|
|
13
14
|
'host.on': DomainEventName[];
|
|
14
15
|
}
|
|
15
16
|
interface MockHostOptions {
|
|
@@ -29,6 +30,11 @@ interface MockHostOptions {
|
|
|
29
30
|
httpResponses?: Record<string, HttpResponse>;
|
|
30
31
|
/** Seed values for named sequence scopes (monotonic from here). */
|
|
31
32
|
sequences?: Record<string, number>;
|
|
33
|
+
/**
|
|
34
|
+
* Canned store products by supplier code (sourced products). When set, the mock exposes
|
|
35
|
+
* `catalog`; omit it to test a plugin against a host without that port.
|
|
36
|
+
*/
|
|
37
|
+
sourcedProducts?: Record<string, SourcedProduct[]>;
|
|
32
38
|
}
|
|
33
39
|
interface MockHostApi extends HostApi {
|
|
34
40
|
/** Every port call recorded in order. */
|
package/dist/testing/index.js
CHANGED
|
@@ -66,6 +66,7 @@ function createMockHostApi(opts = {}) {
|
|
|
66
66
|
"storage.getUrl": [],
|
|
67
67
|
"storage.put": [],
|
|
68
68
|
"sequence.next": [],
|
|
69
|
+
"catalog.listSourcedProducts": [],
|
|
69
70
|
"host.on": []
|
|
70
71
|
};
|
|
71
72
|
const registered = [];
|
|
@@ -128,12 +129,20 @@ function createMockHostApi(opts = {}) {
|
|
|
128
129
|
return Promise.resolve(next);
|
|
129
130
|
}
|
|
130
131
|
};
|
|
132
|
+
const listings = opts.sourcedProducts;
|
|
133
|
+
const catalog = listings ? {
|
|
134
|
+
listSourcedProducts: (code) => {
|
|
135
|
+
calls["catalog.listSourcedProducts"].push(code);
|
|
136
|
+
return Promise.resolve(listings[code] ?? []);
|
|
137
|
+
}
|
|
138
|
+
} : void 0;
|
|
131
139
|
const host = {
|
|
132
140
|
logger,
|
|
133
141
|
http,
|
|
134
142
|
secrets,
|
|
135
143
|
storage,
|
|
136
144
|
sequence,
|
|
145
|
+
...catalog ? { catalog } : {},
|
|
137
146
|
calls,
|
|
138
147
|
registered,
|
|
139
148
|
handlers,
|
package/dist/testing/index.mjs
CHANGED
|
@@ -11,6 +11,7 @@ function createMockHostApi(opts = {}) {
|
|
|
11
11
|
"storage.getUrl": [],
|
|
12
12
|
"storage.put": [],
|
|
13
13
|
"sequence.next": [],
|
|
14
|
+
"catalog.listSourcedProducts": [],
|
|
14
15
|
"host.on": []
|
|
15
16
|
};
|
|
16
17
|
const registered = [];
|
|
@@ -73,12 +74,20 @@ function createMockHostApi(opts = {}) {
|
|
|
73
74
|
return Promise.resolve(next);
|
|
74
75
|
}
|
|
75
76
|
};
|
|
77
|
+
const listings = opts.sourcedProducts;
|
|
78
|
+
const catalog = listings ? {
|
|
79
|
+
listSourcedProducts: (code) => {
|
|
80
|
+
calls["catalog.listSourcedProducts"].push(code);
|
|
81
|
+
return Promise.resolve(listings[code] ?? []);
|
|
82
|
+
}
|
|
83
|
+
} : void 0;
|
|
76
84
|
const host = {
|
|
77
85
|
logger,
|
|
78
86
|
http,
|
|
79
87
|
secrets,
|
|
80
88
|
storage,
|
|
81
89
|
sequence,
|
|
90
|
+
...catalog ? { catalog } : {},
|
|
82
91
|
calls,
|
|
83
92
|
registered,
|
|
84
93
|
handlers,
|