@aglyn/plugins-commerce 1.0.0-beta.268 → 1.0.0-beta.270
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/package.json +13 -13
- package/src/lib/components/console/payment-methods-card.component.js +7 -0
- package/src/lib/components/console/payment-methods-card.component.js.map +1 -1
- package/src/lib/components/console/payments-settings-card.component.d.ts +2 -0
- package/src/lib/components/console/payments-settings-card.component.js +2 -0
- package/src/lib/components/console/payments-settings-card.component.js.map +1 -1
- package/src/lib/components/console/pos/pos-kiosk-readiness.component.d.ts +58 -0
- package/src/lib/components/console/pos/pos-kiosk-readiness.component.js +146 -0
- package/src/lib/components/console/pos/pos-kiosk-readiness.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-pairing.component.d.ts +12 -2
- package/src/lib/components/console/pos/pos-pairing.component.js +14 -1
- package/src/lib/components/console/pos/pos-pairing.component.js.map +1 -1
- package/src/lib/components/console/pos-devices-card.component.js +13 -0
- package/src/lib/components/console/pos-devices-card.component.js.map +1 -1
- package/src/lib/contracts.d.ts +237 -0
- package/src/lib/contracts.js +46 -0
- package/src/lib/contracts.js.map +1 -0
- package/src/lib/declarations.console-server.js +8 -0
- package/src/lib/declarations.console-server.js.map +1 -1
- package/src/lib/model/commerce-record-routes.d.ts +7 -0
- package/src/lib/model/commerce-record-routes.js +7 -0
- package/src/lib/model/commerce-record-routes.js.map +1 -1
- package/src/lib/model/commerce-server-search-sources.d.ts +30 -0
- package/src/lib/model/commerce-server-search-sources.js +57 -0
- package/src/lib/model/commerce-server-search-sources.js.map +1 -0
- package/src/lib/model/order-events.d.ts +8 -127
- package/src/lib/model/order-events.js +11 -24
- package/src/lib/model/order-events.js.map +1 -1
- package/src/lib/model/order-history.d.ts +7 -40
- package/src/lib/model/order-history.js +7 -5
- package/src/lib/model/order-history.js.map +1 -1
- package/src/lib/native-nav.d.ts +30 -0
- package/src/lib/native-nav.js +127 -0
- package/src/lib/native-nav.js.map +1 -0
- package/src/lib/server/order-event-triggers.d.ts +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/contracts.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 { definePluginDomainEvent } from '@aglyn/aglyn/plugin-manager/plugin-domain-events'\nimport { definePluginServiceContract } from '@aglyn/aglyn/plugin-manager/plugin-services'\n\n/**\n * What commerce publishes for other plugins (AGL-3980): the order and return\n * events it raises, the checkout it reports, and the order history service it\n * registers — each by its id and its shape, and nothing that runs commerce.\n *\n * Another plugin imports this module as `@aglyn/plugins-commerce/contracts`,\n * names `commerce` in its `uses` in plugins.config.json, and carries\n * `@aglyn/plugins-commerce` as an optional peer. Importing it never loads\n * commerce, so the subscriber still runs with commerce absent: an event it\n * listens for is simply never raised, and the history service resolves to\n * `null`. `check:lib-boundaries` refuses a runtime import here other than\n * `@aglyn/aglyn`, and any other import of commerce from another plugin.\n */\n\n// ── Events (AGL-3611) ────────────────────────────────────────────────────────\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.\n\n/** A shipment as the order itself lists it. */\nexport interface OrderViewFulfillment {\n id: string | null\n lineItemIds: unknown[]\n /** Units per line; a fulfillment recorded before quantities shipped every unit of the lines it names. */\n lines: Array<{ lineItemId: number; quantity: number }>\n status: 'active' | 'cancelled'\n carrier: string | null\n trackingNumber: string | null\n trackingUrl: string | null\n labelUrl: string | null\n /** ISO 8601. */\n at: string | null\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 /** The lines as stored, serialized; their fields are not a contract yet. */\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 /** Optional lines the buyer added at checkout (AGL-3635), inside `totalCents` and outside `itemsCents`. */\n extrasCents?: number\n }\n refundedCents: number\n /** The tax regime: `stripe-automatic`, `manual`, `none`, or `null` when not recorded. */\n taxMode: string | null\n /** Whether real money moved (AGL-3699): `false` for a Stripe test-mode order. */\n livemode?: boolean\n /** The optional lines the buyer added at checkout and whose offer each was (AGL-3635). */\n extras?: Array<{\n id: string\n pluginId: string\n key: string\n label: string\n amountCents: number\n quoteRef: string | null\n }>\n /** Store credit another plugin kept that paid part of the sale (AGL-3640). */\n credits?: Array<{\n providerId: string\n pluginId: string\n reference: string\n label: string\n last4: string\n amountCents: number\n appliedAs: 'discount' | 'tender'\n }>\n /** The merchant's own tax service that priced the sale (AGL-3631); `null` when none was asked. */\n taxEngine?: {\n provider: string\n providerLabel: string\n status: 'quoted' | 'fallback'\n reason: string | null\n sandbox: boolean\n } | null\n disputed?: boolean\n /** The address as stored, serialized; `null` for an order that ships nowhere. */\n shippingAddress?: Record<string, unknown> | null\n couponCode?: string | null\n fulfillments?: OrderViewFulfillment[]\n /** ISO 8601. */\n created?: 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\n/** Every order and return 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 order lifecycle's five events, by name. */\nexport type CommerceOrderEventName = Extract<CommerceEventName, `order.${string}`>\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\n// ── Order history (AGL-3614) ─────────────────────────────────────────────────\n//\n// The events bring every order from the moment a subscriber listens. A plugin\n// that must also read the orders BEFORE that — accounting, posting a\n// merchant's earlier sales from a start date — reads them through this\n// service, in the same public shape the events carry, and never through\n// commerce's storage. Commerce registers the one implementation from its\n// console server declarations; with commerce absent it resolves to `null`.\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":["definePluginDomainEvent","definePluginServiceContract","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","COMMERCE_EVENT_NAMES","ORDER_HISTORY_CONTRACT_ID","ORDER_HISTORY_CONTRACT","multiple"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,uBAAuB,QAAQ,mDAAkD;AAC1F,SAASC,2BAA2B,QAAQ,8CAA6C;AAqJzF,OAAO,MAAMC,mBAAmBF,wBAA2C,cAAa;AACxF,OAAO,MAAMG,wBAAwBH,wBAAoD,mBAAkB;AAC3G,OAAO,MAAMI,wBAAwBJ,wBAA2C,mBAAkB;AAClG,OAAO,MAAMK,uBAAuBL,wBAAmD,kBAAiB;AACxG,OAAO,MAAMM,wBAAwBN,wBAA2C,mBAAkB;AAClG,OAAO,MAAMO,yBAAyBP,wBAA4C,oBAAmB;AACrG,OAAO,MAAMQ,wBAAwBR,wBAA4C,mBAAkB;AACnG,OAAO,MAAMS,wBAAwBT,wBAA4C,mBAAkB;AACnG,OAAO,MAAMU,wBAAwBV,wBAA4C,mBAAkB;AACnG,OAAO,MAAMW,wBAAwBX,wBAA4C,mBAAkB;AAgCnG,OAAO,MAAMY,yBAAyBZ,wBAAqD,oBAAmB;AAkB9G,mDAAmD,GACnD,OAAO,MAAMa,uBAAqD;IAChE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAA;AAyCD,OAAO,MAAMC,4BAA4B,wBAAuB;AAEhE,OAAO,MAAMC,yBAAyBd,4BAAgDa,2BAA2B;IAC/GE,UAAU;AACZ,GAAE"}
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
import { registerApiV1SiteResource } from "@aglyn/tenant-data-admin/server/api-v1-resources";
|
|
19
19
|
import { registerPluginPersonEraser } from "@aglyn/aglyn/plugin-manager/plugin-person-erasure";
|
|
20
20
|
import { registerPluginService } from "@aglyn/aglyn/plugin-manager/plugin-services";
|
|
21
|
+
import { registerPluginSearchSources } from "@aglyn/aglyn/plugin-manager/plugin-search-sources";
|
|
22
|
+
import { COMMERCE_SERVER_SEARCH_SOURCES } from "./model/commerce-server-search-sources.js";
|
|
21
23
|
import { BUNDLE_ID } from "./constants/bundle-common.js";
|
|
22
24
|
import { ORDER_HISTORY_CONTRACT } from "./model/order-history.js";
|
|
23
25
|
import { registerCommerceTransferResources } from "./transfer/register-transfer-resources.js";
|
|
@@ -71,6 +73,12 @@ import { registerCommerceTransferResources } from "./transfer/register-transfer-
|
|
|
71
73
|
// import wizard and the export dialog (AGL-3531): the transfer routes are
|
|
72
74
|
// the console's alone, so they register here.
|
|
73
75
|
registerCommerceTransferResources();
|
|
76
|
+
// What the native apps' one box finds in a store (AGL-3943): products and
|
|
77
|
+
// orders, each under its own plan flag and, for orders, the site role that
|
|
78
|
+
// reads them.
|
|
79
|
+
registerPluginSearchSources(COMMERCE_SERVER_SEARCH_SOURCES, {
|
|
80
|
+
pluginId: BUNDLE_ID
|
|
81
|
+
});
|
|
74
82
|
}
|
|
75
83
|
|
|
76
84
|
//# sourceMappingURL=declarations.console-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/declarations.console-server.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// The registry's own module, not the data layer's barrel: boot needs the\n// registry, not the whole server surface.\nimport { registerApiV1SiteResource } from '@aglyn/tenant-data-admin/server/api-v1-resources'\nimport { registerPluginPersonEraser } from '@aglyn/aglyn/plugin-manager/plugin-person-erasure'\nimport { registerPluginService } from '@aglyn/aglyn/plugin-manager/plugin-services'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { ORDER_HISTORY_CONTRACT } from './model/order-history'\nimport { registerCommerceTransferResources } from './transfer/register-transfer-resources'\n\n/**\n * The commerce plugin's CONSOLE-ONLY server declarations, named under\n * `consoleServerDeclarations` in `plugins.config.json` and run at the\n * console's boot. The tenant runtime registers none of it.\n *\n * It serves a site's products and orders on the customer REST API,\n * `/v1/sites/{siteId}/products/…` and `/v1/sites/{siteId}/orders/…`: the\n * console's router owns the pipeline in front — the key, the plan's API\n * access, the quota, the rate limit, the error envelope — and the site's\n * ownership, and hands every request under each resource here.\n *\n * No plan feature is named on the registrations, though both need\n * `commerce`: the handlers ask the key's scope FIRST and the plan second\n * (AGL-900, AGL-1928), so a key without the scope is told about the scope\n * whatever plan its organization is on, and the router would ask in the\n * opposite order.\n *\n * Light at boot: the handlers are imported with their first request and the\n * descriptions when the document is first built. Registering again replaces\n * this plugin's own entries.\n */\nexport function registerCommerceConsoleServerDeclarations(): void {\n // Commerce's share of a person erasure (AGL-2623, AGL-3080): every order the\n // person placed keeps its amounts, with the buyer taken off it. Required,\n // and loaded with the first erasure.\n registerPluginPersonEraser(\n async (request) => (await import('./server/person-eraser')).commercePersonEraser(request),\n { pluginId: BUNDLE_ID },\n )\n // A site's earlier orders, for a plugin that reads history behind the\n // order events (AGL-3614); the reader is loaded with the first page asked.\n registerPluginService(\n ORDER_HISTORY_CONTRACT,\n { listOrders: async (request) => (await import('./server/order-history')).listOrderHistory(request) },\n { pluginId: BUNDLE_ID },\n )\n registerApiV1SiteResource(\n 'products',\n {\n handle: async (...args) =>\n (await import('./server/api-v1/orders-and-products')).handleProducts(...args),\n describe: async () =>\n (await import('./server/api-v1/openapi')).PRODUCTS_API_V1_DESCRIPTION,\n },\n { pluginId: BUNDLE_ID },\n )\n registerApiV1SiteResource(\n 'orders',\n {\n handle: async (...args) =>\n (await import('./server/api-v1/orders-and-products')).handleOrders(...args),\n describe: async () =>\n (await import('./server/api-v1/openapi')).ORDERS_API_V1_DESCRIPTION,\n },\n { pluginId: BUNDLE_ID },\n )\n // Products, categories, orders, discounts, coupons and gift cards on the\n // import wizard and the export dialog (AGL-3531): the transfer routes are\n // the console's alone, so they register here.\n registerCommerceTransferResources()\n}\n"],"names":["registerApiV1SiteResource","registerPluginPersonEraser","registerPluginService","BUNDLE_ID","ORDER_HISTORY_CONTRACT","registerCommerceTransferResources","registerCommerceConsoleServerDeclarations","request","commercePersonEraser","pluginId","listOrders","listOrderHistory","handle","args","handleProducts","describe","PRODUCTS_API_V1_DESCRIPTION","handleOrders","ORDERS_API_V1_DESCRIPTION"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,yEAAyE;AACzE,0CAA0C;AAC1C,SAASA,yBAAyB,QAAQ,mDAAkD;AAC5F,SAASC,0BAA0B,QAAQ,oDAAmD;AAC9F,SAASC,qBAAqB,QAAQ,8CAA6C;AACnF,SAASC,SAAS,QAAQ,+BAA2B;AACrD,SAASC,sBAAsB,QAAQ,2BAAuB;AAC9D,SAASC,iCAAiC,QAAQ,4CAAwC;AAE1F;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,SAASC;IACd,6EAA6E;IAC7E,0EAA0E;IAC1E,qCAAqC;
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/declarations.console-server.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// The registry's own module, not the data layer's barrel: boot needs the\n// registry, not the whole server surface.\nimport { registerApiV1SiteResource } from '@aglyn/tenant-data-admin/server/api-v1-resources'\nimport { registerPluginPersonEraser } from '@aglyn/aglyn/plugin-manager/plugin-person-erasure'\nimport { registerPluginService } from '@aglyn/aglyn/plugin-manager/plugin-services'\nimport { registerPluginSearchSources } from '@aglyn/aglyn/plugin-manager/plugin-search-sources'\nimport { COMMERCE_SERVER_SEARCH_SOURCES } from './model/commerce-server-search-sources'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { ORDER_HISTORY_CONTRACT } from './model/order-history'\nimport { registerCommerceTransferResources } from './transfer/register-transfer-resources'\n\n/**\n * The commerce plugin's CONSOLE-ONLY server declarations, named under\n * `consoleServerDeclarations` in `plugins.config.json` and run at the\n * console's boot. The tenant runtime registers none of it.\n *\n * It serves a site's products and orders on the customer REST API,\n * `/v1/sites/{siteId}/products/…` and `/v1/sites/{siteId}/orders/…`: the\n * console's router owns the pipeline in front — the key, the plan's API\n * access, the quota, the rate limit, the error envelope — and the site's\n * ownership, and hands every request under each resource here.\n *\n * No plan feature is named on the registrations, though both need\n * `commerce`: the handlers ask the key's scope FIRST and the plan second\n * (AGL-900, AGL-1928), so a key without the scope is told about the scope\n * whatever plan its organization is on, and the router would ask in the\n * opposite order.\n *\n * Light at boot: the handlers are imported with their first request and the\n * descriptions when the document is first built. Registering again replaces\n * this plugin's own entries.\n */\nexport function registerCommerceConsoleServerDeclarations(): void {\n // Commerce's share of a person erasure (AGL-2623, AGL-3080): every order the\n // person placed keeps its amounts, with the buyer taken off it. Required,\n // and loaded with the first erasure.\n registerPluginPersonEraser(\n async (request) => (await import('./server/person-eraser')).commercePersonEraser(request),\n { pluginId: BUNDLE_ID },\n )\n // A site's earlier orders, for a plugin that reads history behind the\n // order events (AGL-3614); the reader is loaded with the first page asked.\n registerPluginService(\n ORDER_HISTORY_CONTRACT,\n { listOrders: async (request) => (await import('./server/order-history')).listOrderHistory(request) },\n { pluginId: BUNDLE_ID },\n )\n registerApiV1SiteResource(\n 'products',\n {\n handle: async (...args) =>\n (await import('./server/api-v1/orders-and-products')).handleProducts(...args),\n describe: async () =>\n (await import('./server/api-v1/openapi')).PRODUCTS_API_V1_DESCRIPTION,\n },\n { pluginId: BUNDLE_ID },\n )\n registerApiV1SiteResource(\n 'orders',\n {\n handle: async (...args) =>\n (await import('./server/api-v1/orders-and-products')).handleOrders(...args),\n describe: async () =>\n (await import('./server/api-v1/openapi')).ORDERS_API_V1_DESCRIPTION,\n },\n { pluginId: BUNDLE_ID },\n )\n // Products, categories, orders, discounts, coupons and gift cards on the\n // import wizard and the export dialog (AGL-3531): the transfer routes are\n // the console's alone, so they register here.\n registerCommerceTransferResources()\n // What the native apps' one box finds in a store (AGL-3943): products and\n // orders, each under its own plan flag and, for orders, the site role that\n // reads them.\n registerPluginSearchSources(COMMERCE_SERVER_SEARCH_SOURCES, { pluginId: BUNDLE_ID })\n}\n"],"names":["registerApiV1SiteResource","registerPluginPersonEraser","registerPluginService","registerPluginSearchSources","COMMERCE_SERVER_SEARCH_SOURCES","BUNDLE_ID","ORDER_HISTORY_CONTRACT","registerCommerceTransferResources","registerCommerceConsoleServerDeclarations","request","commercePersonEraser","pluginId","listOrders","listOrderHistory","handle","args","handleProducts","describe","PRODUCTS_API_V1_DESCRIPTION","handleOrders","ORDERS_API_V1_DESCRIPTION"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,yEAAyE;AACzE,0CAA0C;AAC1C,SAASA,yBAAyB,QAAQ,mDAAkD;AAC5F,SAASC,0BAA0B,QAAQ,oDAAmD;AAC9F,SAASC,qBAAqB,QAAQ,8CAA6C;AACnF,SAASC,2BAA2B,QAAQ,oDAAmD;AAC/F,SAASC,8BAA8B,QAAQ,4CAAwC;AACvF,SAASC,SAAS,QAAQ,+BAA2B;AACrD,SAASC,sBAAsB,QAAQ,2BAAuB;AAC9D,SAASC,iCAAiC,QAAQ,4CAAwC;AAE1F;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,SAASC;IACd,6EAA6E;IAC7E,0EAA0E;IAC1E,qCAAqC;IACrCP,2BACE,OAAOQ,UAAY,AAAC,CAAA,MAAM,MAAM,CAAC,4BAAwB,EAAGC,oBAAoB,CAACD,UACjF;QAAEE,UAAUN;IAAU;IAExB,sEAAsE;IACtE,2EAA2E;IAC3EH,sBACEI,wBACA;QAAEM,YAAY,OAAOH,UAAY,AAAC,CAAA,MAAM,MAAM,CAAC,4BAAwB,EAAGI,gBAAgB,CAACJ;IAAS,GACpG;QAAEE,UAAUN;IAAU;IAExBL,0BACE,YACA;QACEc,QAAQ,OAAO,GAAGC,OAChB,AAAC,CAAA,MAAM,MAAM,CAAC,yCAAqC,EAAGC,cAAc,IAAID;QAC1EE,UAAU,UACR,AAAC,CAAA,MAAM,MAAM,CAAC,6BAAyB,EAAGC,2BAA2B;IACzE,GACA;QAAEP,UAAUN;IAAU;IAExBL,0BACE,UACA;QACEc,QAAQ,OAAO,GAAGC,OAChB,AAAC,CAAA,MAAM,MAAM,CAAC,yCAAqC,EAAGI,YAAY,IAAIJ;QACxEE,UAAU,UACR,AAAC,CAAA,MAAM,MAAM,CAAC,6BAAyB,EAAGG,yBAAyB;IACvE,GACA;QAAET,UAAUN;IAAU;IAExB,yEAAyE;IACzE,0EAA0E;IAC1E,8CAA8C;IAC9CE;IACA,0EAA0E;IAC1E,2EAA2E;IAC3E,cAAc;IACdJ,4BAA4BC,gCAAgC;QAAEO,UAAUN;IAAU;AACpF"}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* See the License for the specific language governing permissions and
|
|
12
12
|
* limitations under the License.
|
|
13
13
|
*/
|
|
14
|
+
import { type PluginRecordRouteContext } from '@aglyn/aglyn/plugin-manager/plugin-record-routes';
|
|
14
15
|
/**
|
|
15
16
|
* Where a product and an order are read, published for every other surface
|
|
16
17
|
* (AGL-3080).
|
|
@@ -37,6 +38,12 @@ export declare const ORDERS_ORDER_PARAM = "order";
|
|
|
37
38
|
* the other is not surprised.
|
|
38
39
|
*/
|
|
39
40
|
export declare const ORDERS_CUSTOMER_PARAM = "email";
|
|
41
|
+
/**
|
|
42
|
+
* One order's address: the Orders list, opening that order's dialog. The
|
|
43
|
+
* same answer the `order` record route gives, for a caller that holds the
|
|
44
|
+
* id but not the registry (the one-box search, AGL-3943).
|
|
45
|
+
*/
|
|
46
|
+
export declare function orderRecordHref(context: PluginRecordRouteContext, id: string): string | null;
|
|
40
47
|
/**
|
|
41
48
|
* Called from the console registrar. The owner is named rather than read off
|
|
42
49
|
* the loader's marker, so the route registers the same way under a spec that
|
|
@@ -50,6 +50,13 @@ function orders(context, key, value) {
|
|
|
50
50
|
[key]: value
|
|
51
51
|
}).toString()}` : `${list}/orders`;
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* One order's address: the Orders list, opening that order's dialog. The
|
|
55
|
+
* same answer the `order` record route gives, for a caller that holds the
|
|
56
|
+
* id but not the registry (the one-box search, AGL-3943).
|
|
57
|
+
*/ export function orderRecordHref(context, id) {
|
|
58
|
+
return id ? orders(context, ORDERS_ORDER_PARAM, id) : null;
|
|
59
|
+
}
|
|
53
60
|
/**
|
|
54
61
|
* The store's settings — payments (Stripe), shipping, tax and returns — under
|
|
55
62
|
* `store-settings` (AGL-3676): where an AI-built store's "Finish your store"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/commerce-record-routes.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\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 * http://www.apache.org/licenses/LICENSE-2.0\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\nimport { buildRoute, Route } from '@aglyn/aglyn/app-utils/console-routes'\nimport {\n registerPluginRecordRoute,\n type PluginRecordRouteContext,\n} from '@aglyn/aglyn/plugin-manager/plugin-record-routes'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { COMMERCE_SETTINGS_PAGE_ZONES } from '../components/commerce-console-sections'\n\n/**\n * Where a product and an order are read, published for every other surface\n * (AGL-3080).\n *\n * A surface elsewhere — the AI plugin's job drawer opening a product it\n * drafted, a contact's timeline opening the order it names, a person's page\n * listing their orders — asks the record-route registry for `product` or\n * `order` rather than spelling this plugin's console path, and gets `null`\n * (text instead of a link) where this plugin is not loaded.\n *\n * Both are a site's, so only a site has an address. The catalog has no page\n * per product — a product opens in the hub's editor — so the record answers\n * the catalog a caller would find it in. An order opens as a dialog over the\n * Orders list, which reads {@link ORDERS_ORDER_PARAM} on arrival; the list\n * narrowed to one buyer reads {@link ORDERS_CUSTOMER_PARAM}.\n */\n\n/** The nav slug the shell resolves the catalog by. */\nexport const PRODUCTS_SLUG = 'products'\n\n/** The query key the Orders list opens one order's dialog by. */\nexport const ORDERS_ORDER_PARAM = 'order'\n\n/**\n * The query key the Orders list narrows to one buyer by — the same word the\n * CRM's contacts list opens a person by, so a reader who edits one URL into\n * the other is not surprised.\n */\nexport const ORDERS_CUSTOMER_PARAM = 'email'\n\nfunction catalog(context: PluginRecordRouteContext): string | null {\n return context.host\n ? buildRoute(Route.HOST_PLUGIN, {\n orgSlug: context.orgSlug,\n host: context.host,\n pluginSlug: PRODUCTS_SLUG,\n })\n : null\n}\n\nfunction orders(context: PluginRecordRouteContext, key?: string, value?: string): string | null {\n const list = catalog(context)\n if (!list) return null\n return key && value\n ? `${list}/orders?${new URLSearchParams({ [key]: value }).toString()}`\n : `${list}/orders`\n}\n\n/**\n * The store's settings — payments (Stripe), shipping, tax and returns — under\n * `store-settings` (AGL-3676): where an AI-built store's \"Finish your store\"\n * list sends its owner, without spelling this plugin's console path.\n *\n * A page each since AGL-3713: the list is Payments, the first of them, and a\n * record is the settings page of that id (`shipping`, `taxes` …). An id that\n * is not a settings page opens the list rather than a 404.\n */\nfunction settings(context: PluginRecordRouteContext, page?: string): string | null {\n const list = catalog(context)\n if (!list) return null\n const id = page && Object.hasOwn(COMMERCE_SETTINGS_PAGE_ZONES, page) ? page : 'payments'\n return `${list}/${id}`\n}\n\n/**\n * Called from the console registrar. The owner is named rather than read off\n * the loader's marker, so the route registers the same way under a spec that\n * calls the registrar directly.\n */\nexport function registerCommerceRecordRoutes(): void {\n registerPluginRecordRoute(\n 'product',\n { list: catalog, record: catalog },\n { pluginId: BUNDLE_ID },\n )\n registerPluginRecordRoute(\n 'store-settings',\n { list: (context) => settings(context), record: settings },\n { pluginId: BUNDLE_ID },\n )\n registerPluginRecordRoute(\n 'order',\n {\n list: (context) => orders(context),\n record: (context, id) => orders(context, ORDERS_ORDER_PARAM, id),\n byEmail: (context, email) => orders(context, ORDERS_CUSTOMER_PARAM, email),\n },\n { pluginId: BUNDLE_ID },\n )\n}\n"],"names":["buildRoute","Route","registerPluginRecordRoute","BUNDLE_ID","COMMERCE_SETTINGS_PAGE_ZONES","PRODUCTS_SLUG","ORDERS_ORDER_PARAM","ORDERS_CUSTOMER_PARAM","catalog","context","host","HOST_PLUGIN","orgSlug","pluginSlug","orders","key","value","list","URLSearchParams","toString","
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/commerce-record-routes.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\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 * http://www.apache.org/licenses/LICENSE-2.0\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\nimport { buildRoute, Route } from '@aglyn/aglyn/app-utils/console-routes'\nimport {\n registerPluginRecordRoute,\n type PluginRecordRouteContext,\n} from '@aglyn/aglyn/plugin-manager/plugin-record-routes'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { COMMERCE_SETTINGS_PAGE_ZONES } from '../components/commerce-console-sections'\n\n/**\n * Where a product and an order are read, published for every other surface\n * (AGL-3080).\n *\n * A surface elsewhere — the AI plugin's job drawer opening a product it\n * drafted, a contact's timeline opening the order it names, a person's page\n * listing their orders — asks the record-route registry for `product` or\n * `order` rather than spelling this plugin's console path, and gets `null`\n * (text instead of a link) where this plugin is not loaded.\n *\n * Both are a site's, so only a site has an address. The catalog has no page\n * per product — a product opens in the hub's editor — so the record answers\n * the catalog a caller would find it in. An order opens as a dialog over the\n * Orders list, which reads {@link ORDERS_ORDER_PARAM} on arrival; the list\n * narrowed to one buyer reads {@link ORDERS_CUSTOMER_PARAM}.\n */\n\n/** The nav slug the shell resolves the catalog by. */\nexport const PRODUCTS_SLUG = 'products'\n\n/** The query key the Orders list opens one order's dialog by. */\nexport const ORDERS_ORDER_PARAM = 'order'\n\n/**\n * The query key the Orders list narrows to one buyer by — the same word the\n * CRM's contacts list opens a person by, so a reader who edits one URL into\n * the other is not surprised.\n */\nexport const ORDERS_CUSTOMER_PARAM = 'email'\n\nfunction catalog(context: PluginRecordRouteContext): string | null {\n return context.host\n ? buildRoute(Route.HOST_PLUGIN, {\n orgSlug: context.orgSlug,\n host: context.host,\n pluginSlug: PRODUCTS_SLUG,\n })\n : null\n}\n\nfunction orders(context: PluginRecordRouteContext, key?: string, value?: string): string | null {\n const list = catalog(context)\n if (!list) return null\n return key && value\n ? `${list}/orders?${new URLSearchParams({ [key]: value }).toString()}`\n : `${list}/orders`\n}\n\n/**\n * One order's address: the Orders list, opening that order's dialog. The\n * same answer the `order` record route gives, for a caller that holds the\n * id but not the registry (the one-box search, AGL-3943).\n */\nexport function orderRecordHref(context: PluginRecordRouteContext, id: string): string | null {\n return id ? orders(context, ORDERS_ORDER_PARAM, id) : null\n}\n\n/**\n * The store's settings — payments (Stripe), shipping, tax and returns — under\n * `store-settings` (AGL-3676): where an AI-built store's \"Finish your store\"\n * list sends its owner, without spelling this plugin's console path.\n *\n * A page each since AGL-3713: the list is Payments, the first of them, and a\n * record is the settings page of that id (`shipping`, `taxes` …). An id that\n * is not a settings page opens the list rather than a 404.\n */\nfunction settings(context: PluginRecordRouteContext, page?: string): string | null {\n const list = catalog(context)\n if (!list) return null\n const id = page && Object.hasOwn(COMMERCE_SETTINGS_PAGE_ZONES, page) ? page : 'payments'\n return `${list}/${id}`\n}\n\n/**\n * Called from the console registrar. The owner is named rather than read off\n * the loader's marker, so the route registers the same way under a spec that\n * calls the registrar directly.\n */\nexport function registerCommerceRecordRoutes(): void {\n registerPluginRecordRoute(\n 'product',\n { list: catalog, record: catalog },\n { pluginId: BUNDLE_ID },\n )\n registerPluginRecordRoute(\n 'store-settings',\n { list: (context) => settings(context), record: settings },\n { pluginId: BUNDLE_ID },\n )\n registerPluginRecordRoute(\n 'order',\n {\n list: (context) => orders(context),\n record: (context, id) => orders(context, ORDERS_ORDER_PARAM, id),\n byEmail: (context, email) => orders(context, ORDERS_CUSTOMER_PARAM, email),\n },\n { pluginId: BUNDLE_ID },\n )\n}\n"],"names":["buildRoute","Route","registerPluginRecordRoute","BUNDLE_ID","COMMERCE_SETTINGS_PAGE_ZONES","PRODUCTS_SLUG","ORDERS_ORDER_PARAM","ORDERS_CUSTOMER_PARAM","catalog","context","host","HOST_PLUGIN","orgSlug","pluginSlug","orders","key","value","list","URLSearchParams","toString","orderRecordHref","id","settings","page","Object","hasOwn","registerCommerceRecordRoutes","record","pluginId","byEmail","email"],"mappings":"AAAA;;;;;;;;;;;;CAYC,GAGD,SAASA,UAAU,EAAEC,KAAK,QAAQ,wCAAuC;AACzE,SACEC,yBAAyB,QAEpB,mDAAkD;AACzD,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SAASC,4BAA4B,QAAQ,6CAAyC;AAEtF;;;;;;;;;;;;;;;CAeC,GAED,oDAAoD,GACpD,OAAO,MAAMC,gBAAgB,WAAU;AAEvC,+DAA+D,GAC/D,OAAO,MAAMC,qBAAqB,QAAO;AAEzC;;;;CAIC,GACD,OAAO,MAAMC,wBAAwB,QAAO;AAE5C,SAASC,QAAQC,OAAiC;IAChD,OAAOA,QAAQC,IAAI,GACfV,WAAWC,MAAMU,WAAW,EAAE;QAC5BC,SAASH,QAAQG,OAAO;QACxBF,MAAMD,QAAQC,IAAI;QAClBG,YAAYR;IACd,KACA;AACN;AAEA,SAASS,OAAOL,OAAiC,EAAEM,GAAY,EAAEC,KAAc;IAC7E,MAAMC,OAAOT,QAAQC;IACrB,IAAI,CAACQ,MAAM,OAAO;IAClB,OAAOF,OAAOC,QACV,GAAGC,KAAK,QAAQ,EAAE,IAAIC,gBAAgB;QAAE,CAACH,IAAI,EAAEC;IAAM,GAAGG,QAAQ,IAAI,GACpE,GAAGF,KAAK,OAAO,CAAC;AACtB;AAEA;;;;CAIC,GACD,OAAO,SAASG,gBAAgBX,OAAiC,EAAEY,EAAU;IAC3E,OAAOA,KAAKP,OAAOL,SAASH,oBAAoBe,MAAM;AACxD;AAEA;;;;;;;;CAQC,GACD,SAASC,SAASb,OAAiC,EAAEc,IAAa;IAChE,MAAMN,OAAOT,QAAQC;IACrB,IAAI,CAACQ,MAAM,OAAO;IAClB,MAAMI,KAAKE,QAAQC,OAAOC,MAAM,CAACrB,8BAA8BmB,QAAQA,OAAO;IAC9E,OAAO,GAAGN,KAAK,CAAC,EAAEI,IAAI;AACxB;AAEA;;;;CAIC,GACD,OAAO,SAASK;IACdxB,0BACE,WACA;QAAEe,MAAMT;QAASmB,QAAQnB;IAAQ,GACjC;QAAEoB,UAAUzB;IAAU;IAExBD,0BACE,kBACA;QAAEe,MAAM,CAACR,UAAYa,SAASb;QAAUkB,QAAQL;IAAS,GACzD;QAAEM,UAAUzB;IAAU;IAExBD,0BACE,SACA;QACEe,MAAM,CAACR,UAAYK,OAAOL;QAC1BkB,QAAQ,CAAClB,SAASY,KAAOP,OAAOL,SAASH,oBAAoBe;QAC7DQ,SAAS,CAACpB,SAASqB,QAAUhB,OAAOL,SAASF,uBAAuBuB;IACtE,GACA;QAAEF,UAAUzB;IAAU;AAE1B"}
|
|
@@ -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 { PluginSearchSource } from '@aglyn/aglyn/plugin-manager/plugin-search-sources';
|
|
18
|
+
/**
|
|
19
|
+
* What the native apps' one box finds in a store (AGL-3943): the products
|
|
20
|
+
* the console's palette finds, and the site's ORDERS, which the palette does
|
|
21
|
+
* not search.
|
|
22
|
+
*
|
|
23
|
+
* An order is found the way the Orders list finds it: the typed word on the
|
|
24
|
+
* list's own query (`ORDER_LIST_QUERY.search`, the `searchTokens` every
|
|
25
|
+
* writer stamps), newest first, on the composite the list already uses. Only
|
|
26
|
+
* a member who may read the site's orders (admin or editor, the rules'
|
|
27
|
+
* `canReadHostSensitive`) is offered the group, and each row opens that
|
|
28
|
+
* order's dialog over the Orders list.
|
|
29
|
+
*/
|
|
30
|
+
export declare const COMMERCE_SERVER_SEARCH_SOURCES: readonly PluginSearchSource[];
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { ORDER_LIST_QUERY } from "../constants/orders-list-query.js";
|
|
17
|
+
import { formatOrderNumber } from "./commerce-orders.js";
|
|
18
|
+
import { orderRecordHref } from "./commerce-record-routes.js";
|
|
19
|
+
import { COMMERCE_SEARCH_SOURCES } from "./commerce-search-sources.js";
|
|
20
|
+
/**
|
|
21
|
+
* What the native apps' one box finds in a store (AGL-3943): the products
|
|
22
|
+
* the console's palette finds, and the site's ORDERS, which the palette does
|
|
23
|
+
* not search.
|
|
24
|
+
*
|
|
25
|
+
* An order is found the way the Orders list finds it: the typed word on the
|
|
26
|
+
* list's own query (`ORDER_LIST_QUERY.search`, the `searchTokens` every
|
|
27
|
+
* writer stamps), newest first, on the composite the list already uses. Only
|
|
28
|
+
* a member who may read the site's orders (admin or editor, the rules'
|
|
29
|
+
* `canReadHostSensitive`) is offered the group, and each row opens that
|
|
30
|
+
* order's dialog over the Orders list.
|
|
31
|
+
*/ export const COMMERCE_SERVER_SEARCH_SOURCES = [
|
|
32
|
+
...COMMERCE_SEARCH_SOURCES,
|
|
33
|
+
{
|
|
34
|
+
id: 'orders',
|
|
35
|
+
group: 'Orders',
|
|
36
|
+
noun: 'orders',
|
|
37
|
+
scope: 'host',
|
|
38
|
+
collection: 'orders',
|
|
39
|
+
nameField: 'number',
|
|
40
|
+
fallbackNameField: 'customerEmail',
|
|
41
|
+
extraFields: [
|
|
42
|
+
'customerEmail'
|
|
43
|
+
],
|
|
44
|
+
featureFlag: 'commerce',
|
|
45
|
+
hostAccess: 'sensitive',
|
|
46
|
+
listQuery: ORDER_LIST_QUERY,
|
|
47
|
+
// Beside the people (40s): an order is looked up as often as a contact.
|
|
48
|
+
order: 50,
|
|
49
|
+
label: (row)=>formatOrderNumber({
|
|
50
|
+
number: typeof row['number'] === 'number' ? row['number'] : undefined
|
|
51
|
+
}, typeof row['$id'] === 'string' ? row['$id'] : undefined),
|
|
52
|
+
detail: (row)=>typeof row['customerEmail'] === 'string' && row['customerEmail'] ? row['customerEmail'] : null,
|
|
53
|
+
href: (row, context)=>orderRecordHref(context, typeof row['$id'] === 'string' ? row['$id'] : '')
|
|
54
|
+
}
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=commerce-server-search-sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/commerce-server-search-sources.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 { PluginSearchSource } from '@aglyn/aglyn/plugin-manager/plugin-search-sources'\nimport { ORDER_LIST_QUERY } from '../constants/orders-list-query'\nimport { formatOrderNumber } from './commerce-orders'\nimport { orderRecordHref } from './commerce-record-routes'\nimport { COMMERCE_SEARCH_SOURCES } from './commerce-search-sources'\n\n/**\n * What the native apps' one box finds in a store (AGL-3943): the products\n * the console's palette finds, and the site's ORDERS, which the palette does\n * not search.\n *\n * An order is found the way the Orders list finds it: the typed word on the\n * list's own query (`ORDER_LIST_QUERY.search`, the `searchTokens` every\n * writer stamps), newest first, on the composite the list already uses. Only\n * a member who may read the site's orders (admin or editor, the rules'\n * `canReadHostSensitive`) is offered the group, and each row opens that\n * order's dialog over the Orders list.\n */\nexport const COMMERCE_SERVER_SEARCH_SOURCES: readonly PluginSearchSource[] = [\n ...COMMERCE_SEARCH_SOURCES,\n {\n id: 'orders',\n group: 'Orders',\n noun: 'orders',\n scope: 'host',\n collection: 'orders',\n nameField: 'number',\n fallbackNameField: 'customerEmail',\n extraFields: ['customerEmail'],\n featureFlag: 'commerce',\n hostAccess: 'sensitive',\n listQuery: ORDER_LIST_QUERY,\n // Beside the people (40s): an order is looked up as often as a contact.\n order: 50,\n label: (row) =>\n formatOrderNumber(\n { number: typeof row['number'] === 'number' ? row['number'] : undefined } as never,\n typeof row['$id'] === 'string' ? row['$id'] : undefined,\n ),\n detail: (row) =>\n typeof row['customerEmail'] === 'string' && row['customerEmail'] ? row['customerEmail'] : null,\n href: (row, context) =>\n orderRecordHref(context, typeof row['$id'] === 'string' ? row['$id'] : ''),\n },\n]\n"],"names":["ORDER_LIST_QUERY","formatOrderNumber","orderRecordHref","COMMERCE_SEARCH_SOURCES","COMMERCE_SERVER_SEARCH_SOURCES","id","group","noun","scope","collection","nameField","fallbackNameField","extraFields","featureFlag","hostAccess","listQuery","order","label","row","number","undefined","detail","href","context"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,SAASA,gBAAgB,QAAQ,oCAAgC;AACjE,SAASC,iBAAiB,QAAQ,uBAAmB;AACrD,SAASC,eAAe,QAAQ,8BAA0B;AAC1D,SAASC,uBAAuB,QAAQ,+BAA2B;AAEnE;;;;;;;;;;;CAWC,GACD,OAAO,MAAMC,iCAAgE;OACxED;IACH;QACEE,IAAI;QACJC,OAAO;QACPC,MAAM;QACNC,OAAO;QACPC,YAAY;QACZC,WAAW;QACXC,mBAAmB;QACnBC,aAAa;YAAC;SAAgB;QAC9BC,aAAa;QACbC,YAAY;QACZC,WAAWf;QACX,wEAAwE;QACxEgB,OAAO;QACPC,OAAO,CAACC,MACNjB,kBACE;gBAAEkB,QAAQ,OAAOD,GAAG,CAAC,SAAS,KAAK,WAAWA,GAAG,CAAC,SAAS,GAAGE;YAAU,GACxE,OAAOF,GAAG,CAAC,MAAM,KAAK,WAAWA,GAAG,CAAC,MAAM,GAAGE;QAElDC,QAAQ,CAACH,MACP,OAAOA,GAAG,CAAC,gBAAgB,KAAK,YAAYA,GAAG,CAAC,gBAAgB,GAAGA,GAAG,CAAC,gBAAgB,GAAG;QAC5FI,MAAM,CAACJ,KAAKK,UACVrB,gBAAgBqB,SAAS,OAAOL,GAAG,CAAC,MAAM,KAAK,WAAWA,GAAG,CAAC,MAAM,GAAG;IAC3E;CACD,CAAA"}
|
|
@@ -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 {
|
|
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
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
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
|
-
|
|
29
|
-
export
|
|
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 {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export
|
|
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
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
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
|
-
|
|
31
|
-
export
|
|
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
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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\
|
|
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"}
|