@aglyn/plugins-commerce 1.0.0-beta.269 → 1.0.0-beta.271

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.
Files changed (38) hide show
  1. package/package.json +13 -13
  2. package/src/lib/components/console/entitlement-gate.component.d.ts +11 -16
  3. package/src/lib/components/console/entitlement-gate.component.js +15 -25
  4. package/src/lib/components/console/entitlement-gate.component.js.map +1 -1
  5. package/src/lib/components/console/payment-methods-card.component.js +7 -0
  6. package/src/lib/components/console/payment-methods-card.component.js.map +1 -1
  7. package/src/lib/components/console/payments-settings-card.component.d.ts +2 -0
  8. package/src/lib/components/console/payments-settings-card.component.js +2 -0
  9. package/src/lib/components/console/payments-settings-card.component.js.map +1 -1
  10. package/src/lib/components/console/pos/pos-kiosk-readiness.component.d.ts +58 -0
  11. package/src/lib/components/console/pos/pos-kiosk-readiness.component.js +146 -0
  12. package/src/lib/components/console/pos/pos-kiosk-readiness.component.js.map +1 -0
  13. package/src/lib/components/console/pos/pos-pairing.component.d.ts +12 -2
  14. package/src/lib/components/console/pos/pos-pairing.component.js +14 -1
  15. package/src/lib/components/console/pos/pos-pairing.component.js.map +1 -1
  16. package/src/lib/components/console/pos-devices-card.component.js +13 -0
  17. package/src/lib/components/console/pos-devices-card.component.js.map +1 -1
  18. package/src/lib/contracts.d.ts +237 -0
  19. package/src/lib/contracts.js +46 -0
  20. package/src/lib/contracts.js.map +1 -0
  21. package/src/lib/declarations.console-server.js +8 -0
  22. package/src/lib/declarations.console-server.js.map +1 -1
  23. package/src/lib/model/commerce-record-routes.d.ts +7 -0
  24. package/src/lib/model/commerce-record-routes.js +7 -0
  25. package/src/lib/model/commerce-record-routes.js.map +1 -1
  26. package/src/lib/model/commerce-server-search-sources.d.ts +30 -0
  27. package/src/lib/model/commerce-server-search-sources.js +57 -0
  28. package/src/lib/model/commerce-server-search-sources.js.map +1 -0
  29. package/src/lib/model/order-events.d.ts +8 -127
  30. package/src/lib/model/order-events.js +11 -24
  31. package/src/lib/model/order-events.js.map +1 -1
  32. package/src/lib/model/order-history.d.ts +7 -40
  33. package/src/lib/model/order-history.js +7 -5
  34. package/src/lib/model/order-history.js.map +1 -1
  35. package/src/lib/native-nav.d.ts +30 -0
  36. package/src/lib/native-nav.js +127 -0
  37. package/src/lib/native-nav.js.map +1 -0
  38. package/src/lib/server/order-event-triggers.d.ts +2 -2
@@ -14,137 +14,20 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { type PluginDomainEvent, type PluginDomainEventDeclaration } from '@aglyn/aglyn/plugin-manager/plugin-domain-events';
17
+ import type { PluginDomainEvent, PluginDomainEventDeclaration } from '@aglyn/aglyn/plugin-manager/plugin-domain-events';
18
18
  /**
19
19
  * The order and return events commerce raises (AGL-3611), for other plugins
20
20
  * — accounting, shipping, workflows — and for the merchant's own webhooks.
21
21
  *
22
- * Each payload carries `order` in the public API's shape (`GET
23
- * /v1/sites/{siteId}/orders/{orderId}`), as it stood once the fact was
24
- * written, so a subscriber reads one documented object rather than the
25
- * plugin's storage. A subscriber in another plugin restates the fields it
26
- * reads; these types are this plugin's own.
22
+ * Their names and payloads are commerce's contract with other plugins and
23
+ * live in `../contracts` (AGL-3980), which a subscriber imports as
24
+ * `@aglyn/plugins-commerce/contracts`; they are re-exported here for
25
+ * commerce's own code. What stays here is how commerce offers them to the
26
+ * merchant: the labels, the workflow triggers, the picker order.
27
27
  */
28
- /** An order as the public API returns it. Money is integer cents. */
29
- export interface OrderEventOrder {
30
- id: string;
31
- object: 'order';
32
- number: number | null;
33
- status: string | null;
34
- channel: string;
35
- currency: string;
36
- customerEmail: string | null;
37
- customerName: string | null;
38
- lineItems: unknown;
39
- totals: {
40
- itemsCents: number;
41
- shippingCents: number;
42
- taxCents: number;
43
- discountCents: number;
44
- totalCents: number | null;
45
- feeCents: number;
46
- };
47
- refundedCents: number;
48
- /** The tax regime: `stripe-automatic`, `manual`, `none`, or `null` when not recorded. */
49
- taxMode: string | null;
50
- [key: string]: unknown;
51
- }
52
- /** A shipment as an event carries it. */
53
- export interface OrderEventFulfillment {
54
- id: string;
55
- lines: Array<{
56
- lineItemId: number;
57
- quantity: number;
58
- }>;
59
- carrier: string | null;
60
- trackingNumber: string | null;
61
- trackingUrl: string | null;
62
- labelUrl: string | null;
63
- /** What the shipment cost to send — its label's cost, or the merchant's hand-entered one (AGL-3705) — in integer cents of the order's currency; `null` when unknown (AGL-3693). */
64
- labelCostCents: number | null;
65
- at: string;
66
- }
67
- /** A refund as an event carries it: what THIS refund moved. */
68
- export interface OrderEventRefund {
69
- /** Stripe's refund id, when there is one. */
70
- id: string | null;
71
- amountCents: number;
72
- /** The line indexes refunded by name; empty for an amount-only refund. */
73
- lineItemIds: number[];
74
- /** Whether this refund left nothing more to refund. */
75
- full: boolean;
76
- }
77
- /** A return as an event carries it. */
78
- export interface OrderEventReturn {
79
- id: string;
80
- status: string;
81
- lines: Array<{
82
- lineItemId: number;
83
- quantity: number;
84
- reason: string;
85
- }>;
86
- refundCents: number | null;
87
- /** What went back in stock when the parcel arrived; `null` before then. */
88
- restock?: Array<{
89
- lineItemId: number;
90
- quantity: number;
91
- }> | null;
92
- }
93
- export interface OrderEventPayload {
94
- order: OrderEventOrder;
95
- }
96
- export interface OrderFulfilledEventPayload extends OrderEventPayload {
97
- fulfillment: OrderEventFulfillment;
98
- }
99
- export interface OrderRefundedEventPayload extends OrderEventPayload {
100
- refund: OrderEventRefund;
101
- }
102
- export interface ReturnEventPayload extends OrderEventPayload {
103
- return: OrderEventReturn;
104
- }
105
- export declare const ORDER_PAID_EVENT: PluginDomainEvent<OrderEventPayload>;
106
- export declare const ORDER_FULFILLED_EVENT: PluginDomainEvent<OrderFulfilledEventPayload>;
107
- export declare const ORDER_DELIVERED_EVENT: PluginDomainEvent<OrderEventPayload>;
108
- export declare const ORDER_REFUNDED_EVENT: PluginDomainEvent<OrderRefundedEventPayload>;
109
- export declare const ORDER_CANCELLED_EVENT: PluginDomainEvent<OrderEventPayload>;
110
- export declare const RETURN_REQUESTED_EVENT: PluginDomainEvent<ReturnEventPayload>;
111
- export declare const RETURN_APPROVED_EVENT: PluginDomainEvent<ReturnEventPayload>;
112
- export declare const RETURN_DECLINED_EVENT: PluginDomainEvent<ReturnEventPayload>;
113
- export declare const RETURN_RECEIVED_EVENT: PluginDomainEvent<ReturnEventPayload>;
114
- export declare const RETURN_REFUNDED_EVENT: PluginDomainEvent<ReturnEventPayload>;
115
- /**
116
- * A checkout a shopper reached with an address (AGL-3639): the fact an
117
- * abandoned-cart flow in a merchant's own email platform starts from. Not an
118
- * order event — nothing was bought — so it is raised beside them rather than
119
- * among them: it is not a workflow trigger and not offered to the merchant's
120
- * outbound webhooks, whose events are about orders.
121
- */
122
- export interface CheckoutStartedEventPayload {
123
- checkout: {
124
- /** The checkout session's id: one event per checkout. */
125
- id: string;
126
- email: string;
127
- /** Whether the shopper ticked the store's marketing box at checkout. */
128
- marketingOptIn: boolean;
129
- currency: string;
130
- /** The basket's list value, integer cents, before discounts and shipping. */
131
- itemsCents: number;
132
- /** Where the shopper can pick the checkout up again. */
133
- resumeUrl: string | null;
134
- items: Array<{
135
- productId: string;
136
- variantId: string | null;
137
- name: string;
138
- sku: string | null;
139
- quantity: number;
140
- unitCents: number;
141
- }>;
142
- };
143
- }
144
- export declare const CHECKOUT_STARTED_EVENT: PluginDomainEvent<CheckoutStartedEventPayload>;
28
+ export { CHECKOUT_STARTED_EVENT, COMMERCE_EVENT_NAMES, ORDER_CANCELLED_EVENT, ORDER_DELIVERED_EVENT, ORDER_FULFILLED_EVENT, ORDER_PAID_EVENT, ORDER_REFUNDED_EVENT, RETURN_APPROVED_EVENT, RETURN_DECLINED_EVENT, RETURN_RECEIVED_EVENT, RETURN_REFUNDED_EVENT, RETURN_REQUESTED_EVENT, } from '../contracts';
29
+ export type { CheckoutStartedEventPayload, CommerceEventName, OrderEventFulfillment, OrderEventOrder, OrderEventPayload, OrderEventRefund, OrderEventReturn, OrderFulfilledEventPayload, OrderRefundedEventPayload, OrderViewFulfillment, ReturnEventPayload, } from '../contracts';
145
30
  export declare const CHECKOUT_STARTED_EVENT_DECLARATION: PluginDomainEventDeclaration;
146
- /** Every event commerce raises, by name. */
147
- export type CommerceEventName = 'order.paid' | 'order.fulfilled' | 'order.delivered' | 'order.refunded' | 'order.cancelled' | 'return.requested' | 'return.approved' | 'return.declined' | 'return.received' | 'return.refunded';
148
31
  /** The events, in the order pickers list them, with their words. */
149
32
  export declare const COMMERCE_EVENT_DECLARATIONS: ReadonlyArray<PluginDomainEventDeclaration & {
150
33
  event: PluginDomainEvent<unknown>;
@@ -152,5 +35,3 @@ export declare const COMMERCE_EVENT_DECLARATIONS: ReadonlyArray<PluginDomainEven
152
35
  }>;
153
36
  /** The workflow trigger an event is offered as. */
154
37
  export declare function commerceHostEventFor(event: string): string | null;
155
- /** The event names, for a webhook's event picker. */
156
- export declare const COMMERCE_EVENT_NAMES: readonly CommerceEventName[];
@@ -13,18 +13,17 @@
13
13
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
- */ import { definePluginDomainEvent } from "@aglyn/aglyn/plugin-manager/plugin-domain-events";
17
- export const ORDER_PAID_EVENT = definePluginDomainEvent('order.paid');
18
- export const ORDER_FULFILLED_EVENT = definePluginDomainEvent('order.fulfilled');
19
- export const ORDER_DELIVERED_EVENT = definePluginDomainEvent('order.delivered');
20
- export const ORDER_REFUNDED_EVENT = definePluginDomainEvent('order.refunded');
21
- export const ORDER_CANCELLED_EVENT = definePluginDomainEvent('order.cancelled');
22
- export const RETURN_REQUESTED_EVENT = definePluginDomainEvent('return.requested');
23
- export const RETURN_APPROVED_EVENT = definePluginDomainEvent('return.approved');
24
- export const RETURN_DECLINED_EVENT = definePluginDomainEvent('return.declined');
25
- export const RETURN_RECEIVED_EVENT = definePluginDomainEvent('return.received');
26
- export const RETURN_REFUNDED_EVENT = definePluginDomainEvent('return.refunded');
27
- export const CHECKOUT_STARTED_EVENT = definePluginDomainEvent('checkout.started');
16
+ */ import { CHECKOUT_STARTED_EVENT, ORDER_CANCELLED_EVENT, ORDER_DELIVERED_EVENT, ORDER_FULFILLED_EVENT, ORDER_PAID_EVENT, ORDER_REFUNDED_EVENT, RETURN_APPROVED_EVENT, RETURN_DECLINED_EVENT, RETURN_RECEIVED_EVENT, RETURN_REFUNDED_EVENT, RETURN_REQUESTED_EVENT } from "../contracts.js";
17
+ /**
18
+ * The order and return events commerce raises (AGL-3611), for other plugins
19
+ * — accounting, shipping, workflows — and for the merchant's own webhooks.
20
+ *
21
+ * Their names and payloads are commerce's contract with other plugins and
22
+ * live in `../contracts` (AGL-3980), which a subscriber imports as
23
+ * `@aglyn/plugins-commerce/contracts`; they are re-exported here for
24
+ * commerce's own code. What stays here is how commerce offers them to the
25
+ * merchant: the labels, the workflow triggers, the picker order.
26
+ */ export { CHECKOUT_STARTED_EVENT, COMMERCE_EVENT_NAMES, ORDER_CANCELLED_EVENT, ORDER_DELIVERED_EVENT, ORDER_FULFILLED_EVENT, ORDER_PAID_EVENT, ORDER_REFUNDED_EVENT, RETURN_APPROVED_EVENT, RETURN_DECLINED_EVENT, RETURN_RECEIVED_EVENT, RETURN_REFUNDED_EVENT, RETURN_REQUESTED_EVENT } from "../contracts.js";
28
27
  export const CHECKOUT_STARTED_EVENT_DECLARATION = {
29
28
  event: CHECKOUT_STARTED_EVENT,
30
29
  label: 'Checkout started',
@@ -137,17 +136,5 @@ export const CHECKOUT_STARTED_EVENT_DECLARATION = {
137
136
  var _COMMERCE_EVENT_DECLARATIONS_find;
138
137
  return (_ref = (_COMMERCE_EVENT_DECLARATIONS_find = COMMERCE_EVENT_DECLARATIONS.find((entry)=>entry.event.id === event)) == null ? void 0 : _COMMERCE_EVENT_DECLARATIONS_find.hostEvent) != null ? _ref : null;
139
138
  }
140
- /** The event names, for a webhook's event picker. */ export const COMMERCE_EVENT_NAMES = [
141
- 'order.paid',
142
- 'order.fulfilled',
143
- 'order.delivered',
144
- 'order.refunded',
145
- 'order.cancelled',
146
- 'return.requested',
147
- 'return.approved',
148
- 'return.declined',
149
- 'return.received',
150
- 'return.refunded'
151
- ];
152
139
 
153
140
  //# sourceMappingURL=order-events.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/order-events.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n definePluginDomainEvent,\n type PluginDomainEvent,\n type PluginDomainEventDeclaration,\n} from '@aglyn/aglyn/plugin-manager/plugin-domain-events'\n\n/**\n * The order and return events commerce raises (AGL-3611), for other plugins\n * — accounting, shipping, workflows — and for the merchant's own webhooks.\n *\n * Each payload carries `order` in the public API's shape (`GET\n * /v1/sites/{siteId}/orders/{orderId}`), as it stood once the fact was\n * written, so a subscriber reads one documented object rather than the\n * plugin's storage. A subscriber in another plugin restates the fields it\n * reads; these types are this plugin's own.\n */\n\n/** An order as the public API returns it. Money is integer cents. */\nexport interface OrderEventOrder {\n id: string\n object: 'order'\n number: number | null\n status: string | null\n channel: string\n currency: string\n customerEmail: string | null\n customerName: string | null\n lineItems: unknown\n totals: {\n itemsCents: number\n shippingCents: number\n taxCents: number\n discountCents: number\n totalCents: number | null\n feeCents: number\n }\n refundedCents: number\n /** The tax regime: `stripe-automatic`, `manual`, `none`, or `null` when not recorded. */\n taxMode: string | null\n [key: string]: unknown\n}\n\n/** A shipment as an event carries it. */\nexport interface OrderEventFulfillment {\n id: string\n lines: Array<{ lineItemId: number; quantity: number }>\n carrier: string | null\n trackingNumber: string | null\n trackingUrl: string | null\n labelUrl: string | null\n /** What the shipment cost to send — its label's cost, or the merchant's hand-entered one (AGL-3705) — in integer cents of the order's currency; `null` when unknown (AGL-3693). */\n labelCostCents: number | null\n at: string\n}\n\n/** A refund as an event carries it: what THIS refund moved. */\nexport interface OrderEventRefund {\n /** Stripe's refund id, when there is one. */\n id: string | null\n amountCents: number\n /** The line indexes refunded by name; empty for an amount-only refund. */\n lineItemIds: number[]\n /** Whether this refund left nothing more to refund. */\n full: boolean\n}\n\n/** A return as an event carries it. */\nexport interface OrderEventReturn {\n id: string\n status: string\n lines: Array<{ lineItemId: number; quantity: number; reason: string }>\n refundCents: number | null\n /** What went back in stock when the parcel arrived; `null` before then. */\n restock?: Array<{ lineItemId: number; quantity: number }> | null\n}\n\nexport interface OrderEventPayload {\n order: OrderEventOrder\n}\nexport interface OrderFulfilledEventPayload extends OrderEventPayload {\n fulfillment: OrderEventFulfillment\n}\nexport interface OrderRefundedEventPayload extends OrderEventPayload {\n refund: OrderEventRefund\n}\nexport interface ReturnEventPayload extends OrderEventPayload {\n return: OrderEventReturn\n}\n\nexport const ORDER_PAID_EVENT = definePluginDomainEvent<OrderEventPayload>('order.paid')\nexport const ORDER_FULFILLED_EVENT = definePluginDomainEvent<OrderFulfilledEventPayload>('order.fulfilled')\nexport const ORDER_DELIVERED_EVENT = definePluginDomainEvent<OrderEventPayload>('order.delivered')\nexport const ORDER_REFUNDED_EVENT = definePluginDomainEvent<OrderRefundedEventPayload>('order.refunded')\nexport const ORDER_CANCELLED_EVENT = definePluginDomainEvent<OrderEventPayload>('order.cancelled')\nexport const RETURN_REQUESTED_EVENT = definePluginDomainEvent<ReturnEventPayload>('return.requested')\nexport const RETURN_APPROVED_EVENT = definePluginDomainEvent<ReturnEventPayload>('return.approved')\nexport const RETURN_DECLINED_EVENT = definePluginDomainEvent<ReturnEventPayload>('return.declined')\nexport const RETURN_RECEIVED_EVENT = definePluginDomainEvent<ReturnEventPayload>('return.received')\nexport const RETURN_REFUNDED_EVENT = definePluginDomainEvent<ReturnEventPayload>('return.refunded')\n\n/**\n * A checkout a shopper reached with an address (AGL-3639): the fact an\n * abandoned-cart flow in a merchant's own email platform starts from. Not an\n * order event — nothing was bought — so it is raised beside them rather than\n * among them: it is not a workflow trigger and not offered to the merchant's\n * outbound webhooks, whose events are about orders.\n */\nexport interface CheckoutStartedEventPayload {\n checkout: {\n /** The checkout session's id: one event per checkout. */\n id: string\n email: string\n /** Whether the shopper ticked the store's marketing box at checkout. */\n marketingOptIn: boolean\n currency: string\n /** The basket's list value, integer cents, before discounts and shipping. */\n itemsCents: number\n /** Where the shopper can pick the checkout up again. */\n resumeUrl: string | null\n items: Array<{\n productId: string\n variantId: string | null\n name: string\n sku: string | null\n quantity: number\n unitCents: number\n }>\n }\n}\n\nexport const CHECKOUT_STARTED_EVENT = definePluginDomainEvent<CheckoutStartedEventPayload>('checkout.started')\n\nexport const CHECKOUT_STARTED_EVENT_DECLARATION: PluginDomainEventDeclaration = {\n event: CHECKOUT_STARTED_EVENT as PluginDomainEvent<unknown>,\n label: 'Checkout started',\n description:\n 'A shopper reached checkout with an email address: the basket, its value and the link back to it. Raised once per checkout, whether or not it is paid.',\n payloadKeys: ['checkout'],\n}\n\n/** Every event commerce raises, by name. */\nexport type CommerceEventName =\n | 'order.paid'\n | 'order.fulfilled'\n | 'order.delivered'\n | 'order.refunded'\n | 'order.cancelled'\n | 'return.requested'\n | 'return.approved'\n | 'return.declined'\n | 'return.received'\n | 'return.refunded'\n\n/** The events, in the order pickers list them, with their words. */\nexport const COMMERCE_EVENT_DECLARATIONS: ReadonlyArray<\n PluginDomainEventDeclaration & { event: PluginDomainEvent<unknown>; hostEvent: string }\n> = [\n {\n event: ORDER_PAID_EVENT,\n hostEvent: 'orderPaid',\n label: 'Order paid',\n description:\n 'An order was paid: a storefront checkout, a buy-now, a paid payment link, a POS sale or a subscription renewal.',\n payloadKeys: ['order'],\n },\n {\n event: ORDER_FULFILLED_EVENT,\n hostEvent: 'orderFulfilled',\n label: 'Order fulfilled',\n description: 'A shipment was recorded on an order, once per shipment, with the units it carried.',\n payloadKeys: ['order', 'fulfillment'],\n },\n {\n event: ORDER_DELIVERED_EVENT,\n hostEvent: 'orderDelivered',\n label: 'Order delivered',\n description: 'An order was marked delivered.',\n payloadKeys: ['order'],\n },\n {\n event: ORDER_REFUNDED_EVENT,\n hostEvent: 'orderRefunded',\n label: 'Order refunded',\n description: 'Money went back to the buyer, in part or in full, once per refund.',\n payloadKeys: ['order', 'refund'],\n },\n {\n event: ORDER_CANCELLED_EVENT,\n hostEvent: 'orderCancelled',\n label: 'Order canceled',\n description: 'An order was canceled and its stock returned.',\n payloadKeys: ['order'],\n },\n {\n event: RETURN_REQUESTED_EVENT,\n hostEvent: 'returnRequested',\n label: 'Return requested',\n description: 'A buyer asked to return items, or the merchant opened a return for them.',\n payloadKeys: ['order', 'return'],\n },\n {\n event: RETURN_APPROVED_EVENT,\n hostEvent: 'returnApproved',\n label: 'Return approved',\n description: 'The store approved a return, or opened one itself.',\n payloadKeys: ['order', 'return'],\n },\n {\n event: RETURN_DECLINED_EVENT,\n hostEvent: 'returnDeclined',\n label: 'Return declined',\n description: 'The store declined a return request.',\n payloadKeys: ['order', 'return'],\n },\n {\n event: RETURN_RECEIVED_EVENT,\n hostEvent: 'returnReceived',\n label: 'Return received',\n description: 'The returned items arrived, with what went back in stock.',\n payloadKeys: ['order', 'return'],\n },\n {\n event: RETURN_REFUNDED_EVENT,\n hostEvent: 'returnRefunded',\n label: 'Return refunded',\n description: 'A return was refunded.',\n payloadKeys: ['order', 'return'],\n },\n]\n\n/** The workflow trigger an event is offered as. */\nexport function commerceHostEventFor(event: string): string | null {\n return COMMERCE_EVENT_DECLARATIONS.find((entry) => entry.event.id === event)?.hostEvent ?? null\n}\n\n/** The event names, for a webhook's event picker. */\nexport const COMMERCE_EVENT_NAMES: readonly CommerceEventName[] = [\n 'order.paid',\n 'order.fulfilled',\n 'order.delivered',\n 'order.refunded',\n 'order.cancelled',\n 'return.requested',\n 'return.approved',\n 'return.declined',\n 'return.received',\n 'return.refunded',\n]\n"],"names":["definePluginDomainEvent","ORDER_PAID_EVENT","ORDER_FULFILLED_EVENT","ORDER_DELIVERED_EVENT","ORDER_REFUNDED_EVENT","ORDER_CANCELLED_EVENT","RETURN_REQUESTED_EVENT","RETURN_APPROVED_EVENT","RETURN_DECLINED_EVENT","RETURN_RECEIVED_EVENT","RETURN_REFUNDED_EVENT","CHECKOUT_STARTED_EVENT","CHECKOUT_STARTED_EVENT_DECLARATION","event","label","description","payloadKeys","COMMERCE_EVENT_DECLARATIONS","hostEvent","commerceHostEventFor","find","entry","id","COMMERCE_EVENT_NAMES"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,uBAAuB,QAGlB,mDAAkD;AAqFzD,OAAO,MAAMC,mBAAmBD,wBAA2C,cAAa;AACxF,OAAO,MAAME,wBAAwBF,wBAAoD,mBAAkB;AAC3G,OAAO,MAAMG,wBAAwBH,wBAA2C,mBAAkB;AAClG,OAAO,MAAMI,uBAAuBJ,wBAAmD,kBAAiB;AACxG,OAAO,MAAMK,wBAAwBL,wBAA2C,mBAAkB;AAClG,OAAO,MAAMM,yBAAyBN,wBAA4C,oBAAmB;AACrG,OAAO,MAAMO,wBAAwBP,wBAA4C,mBAAkB;AACnG,OAAO,MAAMQ,wBAAwBR,wBAA4C,mBAAkB;AACnG,OAAO,MAAMS,wBAAwBT,wBAA4C,mBAAkB;AACnG,OAAO,MAAMU,wBAAwBV,wBAA4C,mBAAkB;AAgCnG,OAAO,MAAMW,yBAAyBX,wBAAqD,oBAAmB;AAE9G,OAAO,MAAMY,qCAAmE;IAC9EC,OAAOF;IACPG,OAAO;IACPC,aACE;IACFC,aAAa;QAAC;KAAW;AAC3B,EAAC;AAeD,kEAAkE,GAClE,OAAO,MAAMC,8BAET;IACF;QACEJ,OAAOZ;QACPiB,WAAW;QACXJ,OAAO;QACPC,aACE;QACFC,aAAa;YAAC;SAAQ;IACxB;IACA;QACEH,OAAOX;QACPgB,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAc;IACvC;IACA;QACEH,OAAOV;QACPe,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;SAAQ;IACxB;IACA;QACEH,OAAOT;QACPc,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;IACA;QACEH,OAAOR;QACPa,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;SAAQ;IACxB;IACA;QACEH,OAAOP;QACPY,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;IACA;QACEH,OAAON;QACPW,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;IACA;QACEH,OAAOL;QACPU,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;IACA;QACEH,OAAOJ;QACPS,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;IACA;QACEH,OAAOH;QACPQ,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;CACD,CAAA;AAED,iDAAiD,GACjD,OAAO,SAASG,qBAAqBN,KAAa;;QACzCI;IAAP,gBAAOA,oCAAAA,4BAA4BG,IAAI,CAAC,CAACC,QAAUA,MAAMR,KAAK,CAACS,EAAE,KAAKT,2BAA/DI,kCAAuEC,SAAS,mBAAI;AAC7F;AAEA,mDAAmD,GACnD,OAAO,MAAMK,uBAAqD;IAChE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA"}
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/order-events.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n PluginDomainEvent,\n PluginDomainEventDeclaration,\n} from '@aglyn/aglyn/plugin-manager/plugin-domain-events'\nimport {\n CHECKOUT_STARTED_EVENT,\n ORDER_CANCELLED_EVENT,\n ORDER_DELIVERED_EVENT,\n ORDER_FULFILLED_EVENT,\n ORDER_PAID_EVENT,\n ORDER_REFUNDED_EVENT,\n RETURN_APPROVED_EVENT,\n RETURN_DECLINED_EVENT,\n RETURN_RECEIVED_EVENT,\n RETURN_REFUNDED_EVENT,\n RETURN_REQUESTED_EVENT,\n} from '../contracts'\n\n/**\n * The order and return events commerce raises (AGL-3611), for other plugins\n * — accounting, shipping, workflows — and for the merchant's own webhooks.\n *\n * Their names and payloads are commerce's contract with other plugins and\n * live in `../contracts` (AGL-3980), which a subscriber imports as\n * `@aglyn/plugins-commerce/contracts`; they are re-exported here for\n * commerce's own code. What stays here is how commerce offers them to the\n * merchant: the labels, the workflow triggers, the picker order.\n */\n\nexport {\n CHECKOUT_STARTED_EVENT,\n COMMERCE_EVENT_NAMES,\n ORDER_CANCELLED_EVENT,\n ORDER_DELIVERED_EVENT,\n ORDER_FULFILLED_EVENT,\n ORDER_PAID_EVENT,\n ORDER_REFUNDED_EVENT,\n RETURN_APPROVED_EVENT,\n RETURN_DECLINED_EVENT,\n RETURN_RECEIVED_EVENT,\n RETURN_REFUNDED_EVENT,\n RETURN_REQUESTED_EVENT,\n} from '../contracts'\nexport type {\n CheckoutStartedEventPayload,\n CommerceEventName,\n OrderEventFulfillment,\n OrderEventOrder,\n OrderEventPayload,\n OrderEventRefund,\n OrderEventReturn,\n OrderFulfilledEventPayload,\n OrderRefundedEventPayload,\n OrderViewFulfillment,\n ReturnEventPayload,\n} from '../contracts'\n\nexport const CHECKOUT_STARTED_EVENT_DECLARATION: PluginDomainEventDeclaration = {\n event: CHECKOUT_STARTED_EVENT as PluginDomainEvent<unknown>,\n label: 'Checkout started',\n description:\n 'A shopper reached checkout with an email address: the basket, its value and the link back to it. Raised once per checkout, whether or not it is paid.',\n payloadKeys: ['checkout'],\n}\n\n/** The events, in the order pickers list them, with their words. */\nexport const COMMERCE_EVENT_DECLARATIONS: ReadonlyArray<\n PluginDomainEventDeclaration & { event: PluginDomainEvent<unknown>; hostEvent: string }\n> = [\n {\n event: ORDER_PAID_EVENT,\n hostEvent: 'orderPaid',\n label: 'Order paid',\n description:\n 'An order was paid: a storefront checkout, a buy-now, a paid payment link, a POS sale or a subscription renewal.',\n payloadKeys: ['order'],\n },\n {\n event: ORDER_FULFILLED_EVENT,\n hostEvent: 'orderFulfilled',\n label: 'Order fulfilled',\n description: 'A shipment was recorded on an order, once per shipment, with the units it carried.',\n payloadKeys: ['order', 'fulfillment'],\n },\n {\n event: ORDER_DELIVERED_EVENT,\n hostEvent: 'orderDelivered',\n label: 'Order delivered',\n description: 'An order was marked delivered.',\n payloadKeys: ['order'],\n },\n {\n event: ORDER_REFUNDED_EVENT,\n hostEvent: 'orderRefunded',\n label: 'Order refunded',\n description: 'Money went back to the buyer, in part or in full, once per refund.',\n payloadKeys: ['order', 'refund'],\n },\n {\n event: ORDER_CANCELLED_EVENT,\n hostEvent: 'orderCancelled',\n label: 'Order canceled',\n description: 'An order was canceled and its stock returned.',\n payloadKeys: ['order'],\n },\n {\n event: RETURN_REQUESTED_EVENT,\n hostEvent: 'returnRequested',\n label: 'Return requested',\n description: 'A buyer asked to return items, or the merchant opened a return for them.',\n payloadKeys: ['order', 'return'],\n },\n {\n event: RETURN_APPROVED_EVENT,\n hostEvent: 'returnApproved',\n label: 'Return approved',\n description: 'The store approved a return, or opened one itself.',\n payloadKeys: ['order', 'return'],\n },\n {\n event: RETURN_DECLINED_EVENT,\n hostEvent: 'returnDeclined',\n label: 'Return declined',\n description: 'The store declined a return request.',\n payloadKeys: ['order', 'return'],\n },\n {\n event: RETURN_RECEIVED_EVENT,\n hostEvent: 'returnReceived',\n label: 'Return received',\n description: 'The returned items arrived, with what went back in stock.',\n payloadKeys: ['order', 'return'],\n },\n {\n event: RETURN_REFUNDED_EVENT,\n hostEvent: 'returnRefunded',\n label: 'Return refunded',\n description: 'A return was refunded.',\n payloadKeys: ['order', 'return'],\n },\n]\n\n/** The workflow trigger an event is offered as. */\nexport function commerceHostEventFor(event: string): string | null {\n return COMMERCE_EVENT_DECLARATIONS.find((entry) => entry.event.id === event)?.hostEvent ?? null\n}\n"],"names":["CHECKOUT_STARTED_EVENT","ORDER_CANCELLED_EVENT","ORDER_DELIVERED_EVENT","ORDER_FULFILLED_EVENT","ORDER_PAID_EVENT","ORDER_REFUNDED_EVENT","RETURN_APPROVED_EVENT","RETURN_DECLINED_EVENT","RETURN_RECEIVED_EVENT","RETURN_REFUNDED_EVENT","RETURN_REQUESTED_EVENT","COMMERCE_EVENT_NAMES","CHECKOUT_STARTED_EVENT_DECLARATION","event","label","description","payloadKeys","COMMERCE_EVENT_DECLARATIONS","hostEvent","commerceHostEventFor","find","entry","id"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAMD,SACEA,sBAAsB,EACtBC,qBAAqB,EACrBC,qBAAqB,EACrBC,qBAAqB,EACrBC,gBAAgB,EAChBC,oBAAoB,EACpBC,qBAAqB,EACrBC,qBAAqB,EACrBC,qBAAqB,EACrBC,qBAAqB,EACrBC,sBAAsB,QACjB,kBAAc;AAErB;;;;;;;;;CASC,GAED,SACEV,sBAAsB,EACtBW,oBAAoB,EACpBV,qBAAqB,EACrBC,qBAAqB,EACrBC,qBAAqB,EACrBC,gBAAgB,EAChBC,oBAAoB,EACpBC,qBAAqB,EACrBC,qBAAqB,EACrBC,qBAAqB,EACrBC,qBAAqB,EACrBC,sBAAsB,QACjB,kBAAc;AAerB,OAAO,MAAME,qCAAmE;IAC9EC,OAAOb;IACPc,OAAO;IACPC,aACE;IACFC,aAAa;QAAC;KAAW;AAC3B,EAAC;AAED,kEAAkE,GAClE,OAAO,MAAMC,8BAET;IACF;QACEJ,OAAOT;QACPc,WAAW;QACXJ,OAAO;QACPC,aACE;QACFC,aAAa;YAAC;SAAQ;IACxB;IACA;QACEH,OAAOV;QACPe,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAc;IACvC;IACA;QACEH,OAAOX;QACPgB,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;SAAQ;IACxB;IACA;QACEH,OAAOR;QACPa,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;IACA;QACEH,OAAOZ;QACPiB,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;SAAQ;IACxB;IACA;QACEH,OAAOH;QACPQ,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;IACA;QACEH,OAAOP;QACPY,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;IACA;QACEH,OAAON;QACPW,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;IACA;QACEH,OAAOL;QACPU,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;IACA;QACEH,OAAOJ;QACPS,WAAW;QACXJ,OAAO;QACPC,aAAa;QACbC,aAAa;YAAC;YAAS;SAAS;IAClC;CACD,CAAA;AAED,iDAAiD,GACjD,OAAO,SAASG,qBAAqBN,KAAa;;QACzCI;IAAP,gBAAOA,oCAAAA,4BAA4BG,IAAI,CAAC,CAACC,QAAUA,MAAMR,KAAK,CAACS,EAAE,KAAKT,2BAA/DI,kCAAuEC,SAAS,mBAAI;AAC7F"}
@@ -14,45 +14,12 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import type { OrderEventOrder } from './order-events';
18
17
  /**
19
- * A site's order HISTORY, for another plugin (AGL-3614).
20
- *
21
- * The order events (`order-events.ts`) bring every order from the moment a
22
- * subscriber listens. A plugin that must also read the orders BEFORE that —
23
- * accounting, posting a merchant's earlier sales from a start date — reads
24
- * them through this service, in the same public shape the events carry, and
25
- * never through commerce's storage. Commerce registers the one
26
- * implementation from its console server declarations; a reader in another
27
- * plugin restates this contract under the same id, as an event subscriber
28
- * restates an event.
18
+ * A site's order HISTORY, for another plugin (AGL-3614). The service is
19
+ * commerce's contract with other plugins and lives in `../contracts`
20
+ * (AGL-3980), which a reader imports as `@aglyn/plugins-commerce/contracts`;
21
+ * it is re-exported here for commerce's own code, which registers the one
22
+ * implementation from its console server declarations.
29
23
  */
30
- /** One stored order, as the history hands it out. */
31
- export interface OrderHistoryEntry {
32
- id: string;
33
- createdAtMs: number;
34
- /** When it was paid; `null` for one never paid. */
35
- paidAtMs: number | null;
36
- /** The newest refund on its timeline, or `null`. */
37
- lastRefundAtMs: number | null;
38
- /** Whether its prices include the tax. */
39
- taxInclusive: boolean;
40
- /** The tax rate it was charged under, when one was named. */
41
- taxRateId: string | null;
42
- /** The order in the public API's shape. */
43
- order: OrderEventOrder;
44
- }
45
- export interface OrderHistoryPageRequest {
46
- hostId: string;
47
- /** Orders created at or after this… */
48
- fromMs: number;
49
- /** …and before this. */
50
- untilMs: number;
51
- /** At most this many, oldest first; capped at 200. */
52
- limit: number;
53
- }
54
- export interface OrderHistoryReader {
55
- listOrders(request: OrderHistoryPageRequest): Promise<OrderHistoryEntry[]>;
56
- }
57
- export declare const ORDER_HISTORY_CONTRACT_ID = "commerce.orderHistory";
58
- export declare const ORDER_HISTORY_CONTRACT: import("@aglyn/aglyn/src").PluginServiceContract<OrderHistoryReader>;
24
+ export { ORDER_HISTORY_CONTRACT, ORDER_HISTORY_CONTRACT_ID } from '../contracts';
25
+ export type { OrderHistoryEntry, OrderHistoryPageRequest, OrderHistoryReader } from '../contracts';
@@ -13,10 +13,12 @@
13
13
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
- */ import { definePluginServiceContract } from "@aglyn/aglyn/plugin-manager/plugin-services";
17
- export const ORDER_HISTORY_CONTRACT_ID = 'commerce.orderHistory';
18
- export const ORDER_HISTORY_CONTRACT = definePluginServiceContract(ORDER_HISTORY_CONTRACT_ID, {
19
- multiple: false
20
- });
16
+ */ /**
17
+ * A site's order HISTORY, for another plugin (AGL-3614). The service is
18
+ * commerce's contract with other plugins and lives in `../contracts`
19
+ * (AGL-3980), which a reader imports as `@aglyn/plugins-commerce/contracts`;
20
+ * it is re-exported here for commerce's own code, which registers the one
21
+ * implementation from its console server declarations.
22
+ */ export { ORDER_HISTORY_CONTRACT, ORDER_HISTORY_CONTRACT_ID } from "../contracts.js";
21
23
 
22
24
  //# sourceMappingURL=order-history.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/order-history.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { definePluginServiceContract } from '@aglyn/aglyn/plugin-manager/plugin-services'\nimport type { OrderEventOrder } from './order-events'\n\n/**\n * A site's order HISTORY, for another plugin (AGL-3614).\n *\n * The order events (`order-events.ts`) bring every order from the moment a\n * subscriber listens. A plugin that must also read the orders BEFORE that —\n * accounting, posting a merchant's earlier sales from a start date — reads\n * them through this service, in the same public shape the events carry, and\n * never through commerce's storage. Commerce registers the one\n * implementation from its console server declarations; a reader in another\n * plugin restates this contract under the same id, as an event subscriber\n * restates an event.\n */\n\n/** One stored order, as the history hands it out. */\nexport interface OrderHistoryEntry {\n id: string\n createdAtMs: number\n /** When it was paid; `null` for one never paid. */\n paidAtMs: number | null\n /** The newest refund on its timeline, or `null`. */\n lastRefundAtMs: number | null\n /** Whether its prices include the tax. */\n taxInclusive: boolean\n /** The tax rate it was charged under, when one was named. */\n taxRateId: string | null\n /** The order in the public API's shape. */\n order: OrderEventOrder\n}\n\nexport interface OrderHistoryPageRequest {\n hostId: string\n /** Orders created at or after this… */\n fromMs: number\n /** …and before this. */\n untilMs: number\n /** At most this many, oldest first; capped at 200. */\n limit: number\n}\n\nexport interface OrderHistoryReader {\n listOrders(request: OrderHistoryPageRequest): Promise<OrderHistoryEntry[]>\n}\n\nexport const ORDER_HISTORY_CONTRACT_ID = 'commerce.orderHistory'\n\nexport const ORDER_HISTORY_CONTRACT = definePluginServiceContract<OrderHistoryReader>(ORDER_HISTORY_CONTRACT_ID, {\n multiple: false,\n})\n"],"names":["definePluginServiceContract","ORDER_HISTORY_CONTRACT_ID","ORDER_HISTORY_CONTRACT","multiple"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,2BAA2B,QAAQ,8CAA6C;AA8CzF,OAAO,MAAMC,4BAA4B,wBAAuB;AAEhE,OAAO,MAAMC,yBAAyBF,4BAAgDC,2BAA2B;IAC/GE,UAAU;AACZ,GAAE"}
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/order-history.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A site's order HISTORY, for another plugin (AGL-3614). The service is\n * commerce's contract with other plugins and lives in `../contracts`\n * (AGL-3980), which a reader imports as `@aglyn/plugins-commerce/contracts`;\n * it is re-exported here for commerce's own code, which registers the one\n * implementation from its console server declarations.\n */\n\nexport { ORDER_HISTORY_CONTRACT, ORDER_HISTORY_CONTRACT_ID } from '../contracts'\nexport type { OrderHistoryEntry, OrderHistoryPageRequest, OrderHistoryReader } from '../contracts'\n"],"names":["ORDER_HISTORY_CONTRACT","ORDER_HISTORY_CONTRACT_ID"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;CAMC,GAED,SAASA,sBAAsB,EAAEC,yBAAyB,QAAQ,kBAAc"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { type NativeNavContribution, type NativeNavCreateContribution, type NativeNavElsewhere } from '@aglyn/aglyn/app-utils/native-nav';
18
+ /**
19
+ * Orders and Products in the native apps' navigation (AGL-3943): the rows this plugin
20
+ * adds to the manifest the shells draw, placed into the core's lists by
21
+ * `order` (`assembleNativeNav`, `generate:native-contracts`). Labels are the
22
+ * console's words, held by `apps/console/specs/native-nav-manifest.spec.ts`.
23
+ *
24
+ * Imports only the core's plain nav module, so the native contracts read it.
25
+ */
26
+ export declare const NATIVE_NAV_ROWS: readonly NativeNavContribution[];
27
+ /** The console's POS tab is the register app's, not a row of this one. */
28
+ export declare const NATIVE_NAV_ELSEWHERE: readonly NativeNavElsewhere[];
29
+ /** A product ("Add product" on Catalog) and a draft order ("Draft order" on Orders). */
30
+ export declare const NATIVE_NAV_CREATE: readonly NativeNavCreateContribution[];
@@ -0,0 +1,127 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import { nativeNavHubSection, nativeNavIcon, nativeNavRef } from "@aglyn/aglyn/app-utils/native-nav";
17
+ /**
18
+ * Orders and Products in the native apps' navigation (AGL-3943): the rows this plugin
19
+ * adds to the manifest the shells draw, placed into the core's lists by
20
+ * `order` (`assembleNativeNav`, `generate:native-contracts`). Labels are the
21
+ * console's words, held by `apps/console/specs/native-nav-manifest.spec.ts`.
22
+ *
23
+ * Imports only the core's plain nav module, so the native contracts read it.
24
+ */ export const NATIVE_NAV_ROWS = [
25
+ {
26
+ list: 'site',
27
+ group: 'sell',
28
+ row: {
29
+ id: 'orders',
30
+ label: 'Orders',
31
+ icon: nativeNavIcon('bag', 'shopping_bag'),
32
+ screen: 'commerce.orders',
33
+ pluginId: 'commerce',
34
+ order: 10,
35
+ sections: [
36
+ nativeNavHubSection('host', '/products', 'orders', 'Orders', 'commerce.orders'),
37
+ nativeNavHubSection('host', '/products', 'returns', 'Returns', 'commerce.returns'),
38
+ nativeNavHubSection('host', '/products', 'reservations', 'Reservations', 'commerce.reservations')
39
+ ],
40
+ docs: '/commerce-and-bookings/commerce/overview',
41
+ console: nativeNavRef('hostPluginSection', '/products/orders')
42
+ }
43
+ },
44
+ {
45
+ list: 'site',
46
+ group: 'sell',
47
+ row: {
48
+ id: 'products',
49
+ label: 'Products',
50
+ icon: nativeNavIcon('tag', 'sell'),
51
+ screen: 'commerce.products',
52
+ pluginId: 'commerce',
53
+ order: 20,
54
+ keywords: [
55
+ 'catalog',
56
+ 'stock',
57
+ 'inventory'
58
+ ],
59
+ sections: [
60
+ nativeNavHubSection('host', '/products', 'catalog', 'Catalog', 'commerce.products'),
61
+ nativeNavHubSection('host', '/products', 'promotions', 'Promotions', 'commerce.promotions'),
62
+ nativeNavHubSection('host', '/products', 'analytics', 'Analytics', 'commerce.sales')
63
+ ],
64
+ actions: [
65
+ {
66
+ id: 'scan',
67
+ label: 'Scan stock',
68
+ icon: nativeNavIcon('barcode.viewfinder', 'qr_code_scanner'),
69
+ screen: 'commerce.scan'
70
+ },
71
+ {
72
+ id: 'newProduct',
73
+ label: 'New product',
74
+ icon: nativeNavIcon('plus', 'add'),
75
+ screen: 'commerce.product',
76
+ params: {
77
+ new: '1'
78
+ }
79
+ }
80
+ ],
81
+ docs: '/commerce-and-bookings/commerce/overview',
82
+ console: nativeNavRef('hostPluginTab', '/products')
83
+ }
84
+ }
85
+ ];
86
+ /** The console's POS tab is the register app's, not a row of this one. */ export const NATIVE_NAV_ELSEWHERE = [
87
+ {
88
+ console: nativeNavRef('hostPluginTab', '/pos'),
89
+ where: 'The POS app'
90
+ }
91
+ ];
92
+ /** A product ("Add product" on Catalog) and a draft order ("Draft order" on Orders). */ export const NATIVE_NAV_CREATE = [
93
+ {
94
+ scope: 'site',
95
+ item: {
96
+ id: 'product',
97
+ label: 'Product',
98
+ icon: nativeNavIcon('tag', 'sell'),
99
+ screen: 'commerce.product',
100
+ params: {
101
+ new: '1'
102
+ },
103
+ pluginId: 'commerce',
104
+ planFeature: 'commerce',
105
+ order: 20,
106
+ console: nativeNavRef('hostPluginSection', '/products/catalog')
107
+ }
108
+ },
109
+ {
110
+ scope: 'site',
111
+ item: {
112
+ id: 'draftOrder',
113
+ label: 'Draft order',
114
+ icon: nativeNavIcon('link.badge.plus', 'link'),
115
+ screen: 'commerce.orders',
116
+ params: {
117
+ new: '1'
118
+ },
119
+ pluginId: 'commerce',
120
+ planFeature: 'commerce',
121
+ order: 30,
122
+ console: nativeNavRef('hostPluginSection', '/products/orders')
123
+ }
124
+ }
125
+ ];
126
+
127
+ //# sourceMappingURL=native-nav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/native-nav.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type NativeNavContribution,\n type NativeNavCreateContribution,\n type NativeNavElsewhere,\n nativeNavHubSection,\n nativeNavIcon,\n nativeNavRef,\n} from '@aglyn/aglyn/app-utils/native-nav'\n\n/**\n * Orders and Products in the native apps' navigation (AGL-3943): the rows this plugin\n * adds to the manifest the shells draw, placed into the core's lists by\n * `order` (`assembleNativeNav`, `generate:native-contracts`). Labels are the\n * console's words, held by `apps/console/specs/native-nav-manifest.spec.ts`.\n *\n * Imports only the core's plain nav module, so the native contracts read it.\n */\n\nexport const NATIVE_NAV_ROWS: readonly NativeNavContribution[] = [\n {\n list: 'site',\n group: 'sell',\n row: {\n id: 'orders',\n label: 'Orders',\n icon: nativeNavIcon('bag', 'shopping_bag'),\n screen: 'commerce.orders',\n pluginId: 'commerce',\n order: 10,\n sections: [\n nativeNavHubSection('host', '/products', 'orders', 'Orders', 'commerce.orders'),\n nativeNavHubSection('host', '/products', 'returns', 'Returns', 'commerce.returns'),\n nativeNavHubSection('host', '/products', 'reservations', 'Reservations', 'commerce.reservations'),\n ],\n docs: '/commerce-and-bookings/commerce/overview',\n console: nativeNavRef('hostPluginSection', '/products/orders'),\n },\n },\n {\n list: 'site',\n group: 'sell',\n row: {\n id: 'products',\n label: 'Products',\n icon: nativeNavIcon('tag', 'sell'),\n screen: 'commerce.products',\n pluginId: 'commerce',\n order: 20,\n keywords: ['catalog', 'stock', 'inventory'],\n sections: [\n nativeNavHubSection('host', '/products', 'catalog', 'Catalog', 'commerce.products'),\n nativeNavHubSection('host', '/products', 'promotions', 'Promotions', 'commerce.promotions'),\n nativeNavHubSection('host', '/products', 'analytics', 'Analytics', 'commerce.sales'),\n ],\n actions: [\n {\n id: 'scan',\n label: 'Scan stock',\n icon: nativeNavIcon('barcode.viewfinder', 'qr_code_scanner'),\n screen: 'commerce.scan',\n },\n {\n id: 'newProduct',\n label: 'New product',\n icon: nativeNavIcon('plus', 'add'),\n screen: 'commerce.product',\n params: { new: '1' },\n },\n ],\n docs: '/commerce-and-bookings/commerce/overview',\n console: nativeNavRef('hostPluginTab', '/products'),\n },\n },\n]\n\n/** The console's POS tab is the register app's, not a row of this one. */\nexport const NATIVE_NAV_ELSEWHERE: readonly NativeNavElsewhere[] = [\n { console: nativeNavRef('hostPluginTab', '/pos'), where: 'The POS app' },\n]\n\n/** A product (\"Add product\" on Catalog) and a draft order (\"Draft order\" on Orders). */\nexport const NATIVE_NAV_CREATE: readonly NativeNavCreateContribution[] = [\n {\n scope: 'site',\n item: {\n id: 'product',\n label: 'Product',\n icon: nativeNavIcon('tag', 'sell'),\n screen: 'commerce.product',\n params: { new: '1' },\n pluginId: 'commerce',\n planFeature: 'commerce',\n order: 20,\n console: nativeNavRef('hostPluginSection', '/products/catalog'),\n },\n },\n {\n scope: 'site',\n item: {\n id: 'draftOrder',\n label: 'Draft order',\n icon: nativeNavIcon('link.badge.plus', 'link'),\n screen: 'commerce.orders',\n params: { new: '1' },\n pluginId: 'commerce',\n planFeature: 'commerce',\n order: 30,\n console: nativeNavRef('hostPluginSection', '/products/orders'),\n },\n },\n]\n"],"names":["nativeNavHubSection","nativeNavIcon","nativeNavRef","NATIVE_NAV_ROWS","list","group","row","id","label","icon","screen","pluginId","order","sections","docs","console","keywords","actions","params","new","NATIVE_NAV_ELSEWHERE","where","NATIVE_NAV_CREATE","scope","item","planFeature"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAIEA,mBAAmB,EACnBC,aAAa,EACbC,YAAY,QACP,oCAAmC;AAE1C;;;;;;;CAOC,GAED,OAAO,MAAMC,kBAAoD;IAC/D;QACEC,MAAM;QACNC,OAAO;QACPC,KAAK;YACHC,IAAI;YACJC,OAAO;YACPC,MAAMR,cAAc,OAAO;YAC3BS,QAAQ;YACRC,UAAU;YACVC,OAAO;YACPC,UAAU;gBACRb,oBAAoB,QAAQ,aAAa,UAAU,UAAU;gBAC7DA,oBAAoB,QAAQ,aAAa,WAAW,WAAW;gBAC/DA,oBAAoB,QAAQ,aAAa,gBAAgB,gBAAgB;aAC1E;YACDc,MAAM;YACNC,SAASb,aAAa,qBAAqB;QAC7C;IACF;IACA;QACEE,MAAM;QACNC,OAAO;QACPC,KAAK;YACHC,IAAI;YACJC,OAAO;YACPC,MAAMR,cAAc,OAAO;YAC3BS,QAAQ;YACRC,UAAU;YACVC,OAAO;YACPI,UAAU;gBAAC;gBAAW;gBAAS;aAAY;YAC3CH,UAAU;gBACRb,oBAAoB,QAAQ,aAAa,WAAW,WAAW;gBAC/DA,oBAAoB,QAAQ,aAAa,cAAc,cAAc;gBACrEA,oBAAoB,QAAQ,aAAa,aAAa,aAAa;aACpE;YACDiB,SAAS;gBACP;oBACEV,IAAI;oBACJC,OAAO;oBACPC,MAAMR,cAAc,sBAAsB;oBAC1CS,QAAQ;gBACV;gBACA;oBACEH,IAAI;oBACJC,OAAO;oBACPC,MAAMR,cAAc,QAAQ;oBAC5BS,QAAQ;oBACRQ,QAAQ;wBAAEC,KAAK;oBAAI;gBACrB;aACD;YACDL,MAAM;YACNC,SAASb,aAAa,iBAAiB;QACzC;IACF;CACD,CAAA;AAED,wEAAwE,GACxE,OAAO,MAAMkB,uBAAsD;IACjE;QAAEL,SAASb,aAAa,iBAAiB;QAASmB,OAAO;IAAc;CACxE,CAAA;AAED,sFAAsF,GACtF,OAAO,MAAMC,oBAA4D;IACvE;QACEC,OAAO;QACPC,MAAM;YACJjB,IAAI;YACJC,OAAO;YACPC,MAAMR,cAAc,OAAO;YAC3BS,QAAQ;YACRQ,QAAQ;gBAAEC,KAAK;YAAI;YACnBR,UAAU;YACVc,aAAa;YACbb,OAAO;YACPG,SAASb,aAAa,qBAAqB;QAC7C;IACF;IACA;QACEqB,OAAO;QACPC,MAAM;YACJjB,IAAI;YACJC,OAAO;YACPC,MAAMR,cAAc,mBAAmB;YACvCS,QAAQ;YACRQ,QAAQ;gBAAEC,KAAK;YAAI;YACnBR,UAAU;YACVc,aAAa;YACbb,OAAO;YACPG,SAASb,aAAa,qBAAqB;QAC7C;IACF;CACD,CAAA"}
@@ -34,6 +34,6 @@ export declare function hostEventPayloadFor(envelope: Pick<PluginDomainEventEnve
34
34
  */
35
35
  export declare function registerCommerceEventTriggers(): void;
36
36
  /** The order events that schedule a review request (AGL-3736). */
37
- export declare const REVIEW_REQUEST_EVENTS: readonly [import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../model").OrderFulfilledEventPayload>, import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../model").OrderEventPayload>, import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../model").OrderEventPayload>];
37
+ export declare const REVIEW_REQUEST_EVENTS: readonly [import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../contracts").OrderFulfilledEventPayload>, import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../contracts").OrderEventPayload>, import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../contracts").OrderEventPayload>];
38
38
  /** The order events that change what ShippingEasy should hold. */
39
- export declare const SHIPPINGEASY_EVENTS: readonly [import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../model").OrderEventPayload>, import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../model").OrderEventPayload>, import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../model").OrderRefundedEventPayload>];
39
+ export declare const SHIPPINGEASY_EVENTS: readonly [import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../contracts").OrderEventPayload>, import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../contracts").OrderEventPayload>, import("@aglyn/aglyn/plugin-manager/plugin-domain-events").PluginDomainEvent<import("../contracts").OrderRefundedEventPayload>];