@sixtyninecommerce/admin 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2739 -17
- package/dist/api-tokens/index.d.ts +15 -5
- package/dist/api-tokens/index.js +1 -0
- package/dist/apps/event-subscription.d.ts +59 -0
- package/dist/apps/event-subscription.js +32 -0
- package/dist/apps/hook-secret.d.ts +22 -0
- package/dist/apps/hook-secret.js +36 -0
- package/dist/apps/index.d.ts +54 -3
- package/dist/apps/index.js +17 -0
- package/dist/audit/index.d.ts +7 -0
- package/dist/auth/queries.d.ts +5 -1
- package/dist/auth/queries.js +6 -0
- package/dist/bulk/index.d.ts +323 -0
- package/dist/bulk/index.js +162 -0
- package/dist/catalog/assets.d.ts +147 -0
- package/dist/catalog/assets.js +164 -0
- package/dist/catalog/collections.d.ts +109 -0
- package/dist/catalog/collections.js +91 -0
- package/dist/catalog/facets.d.ts +103 -0
- package/dist/catalog/facets.js +100 -0
- package/dist/catalog/index.d.ts +115 -0
- package/dist/catalog/index.js +21 -0
- package/dist/catalog/options.d.ts +89 -0
- package/dist/catalog/options.js +88 -0
- package/dist/catalog/products-bulk.d.ts +21 -0
- package/dist/catalog/products-bulk.js +58 -0
- package/dist/catalog/products.d.ts +650 -0
- package/dist/catalog/products.js +458 -0
- package/dist/catalog/properties.d.ts +234 -0
- package/dist/catalog/properties.js +158 -0
- package/dist/catalog/types.d.ts +174 -0
- package/dist/catalog/types.js +141 -0
- package/dist/catalog/variants.d.ts +324 -0
- package/dist/catalog/variants.js +288 -0
- package/dist/catalog/visibility.d.ts +57 -0
- package/dist/catalog/visibility.js +59 -0
- package/dist/client.d.ts +192 -3
- package/dist/client.js +87 -12
- package/dist/compliance/index.d.ts +88 -0
- package/dist/compliance/index.js +88 -0
- package/dist/customer-data-redaction.d.ts +14 -0
- package/dist/customer-data-redaction.js +22 -0
- package/dist/customers/index.d.ts +428 -17
- package/dist/customers/index.js +322 -15
- package/dist/documents/index.d.ts +513 -16
- package/dist/documents/index.js +229 -3
- package/dist/events/index.d.ts +259 -0
- package/dist/events/index.js +147 -0
- package/dist/feeds/ai.d.ts +46 -0
- package/dist/feeds/ai.js +43 -0
- package/dist/feeds/categories.d.ts +50 -0
- package/dist/feeds/categories.js +56 -0
- package/dist/feeds/configs.d.ts +54 -0
- package/dist/feeds/configs.js +85 -0
- package/dist/feeds/identifier-fields.d.ts +25 -0
- package/dist/feeds/identifier-fields.js +29 -0
- package/dist/feeds/index.d.ts +54 -0
- package/dist/feeds/index.js +46 -0
- package/dist/feeds/preserve.d.ts +38 -0
- package/dist/feeds/preserve.js +74 -0
- package/dist/feeds/rules.d.ts +42 -0
- package/dist/feeds/rules.js +56 -0
- package/dist/feeds/types.d.ts +654 -0
- package/dist/feeds/types.js +135 -0
- package/dist/fulfillments/index.d.ts +437 -0
- package/dist/fulfillments/index.js +534 -0
- package/dist/heads/index.d.ts +60 -0
- package/dist/heads/index.js +45 -0
- package/dist/hooks/assignments.d.ts +90 -0
- package/dist/hooks/assignments.js +53 -0
- package/dist/hooks/index.d.ts +97 -0
- package/dist/hooks/index.js +76 -0
- package/dist/index.d.ts +95 -9
- package/dist/index.js +21 -1
- package/dist/integrations/index.d.ts +14 -0
- package/dist/integrations/index.js +9 -0
- package/dist/integrations/pipelines.d.ts +113 -0
- package/dist/integrations/pipelines.js +62 -0
- package/dist/integrations/types.d.ts +176 -0
- package/dist/integrations/types.js +8 -0
- package/dist/jobs/bulk-action-run.d.ts +74 -0
- package/dist/jobs/bulk-action-run.js +69 -0
- package/dist/locations/index.d.ts +6 -2
- package/dist/meta/index.d.ts +32 -0
- package/dist/orders/bulk.d.ts +75 -0
- package/dist/orders/bulk.js +150 -0
- package/dist/orders/commit-edit.d.ts +123 -0
- package/dist/orders/commit-edit.js +142 -0
- package/dist/orders/deposit-policy.d.ts +103 -0
- package/dist/orders/deposit-policy.js +202 -0
- package/dist/orders/get.d.ts +722 -0
- package/dist/orders/get.js +530 -0
- package/dist/orders/index.d.ts +186 -21
- package/dist/orders/index.js +57 -0
- package/dist/orders/line-price-preview.d.ts +297 -0
- package/dist/orders/line-price-preview.js +50 -0
- package/dist/orders/manual-discounts.d.ts +141 -0
- package/dist/orders/manual-discounts.js +97 -0
- package/dist/orders/manual-pricing.d.ts +192 -0
- package/dist/orders/manual-pricing.js +72 -0
- package/dist/orders/order-entry.d.ts +566 -0
- package/dist/orders/order-entry.js +129 -0
- package/dist/orders/parcel-charge.d.ts +45 -0
- package/dist/orders/parcel-charge.js +55 -0
- package/dist/orders/plan-edit.d.ts +489 -0
- package/dist/orders/plan-edit.js +93 -0
- package/dist/orders/status.d.ts +235 -0
- package/dist/orders/status.js +96 -0
- package/dist/orders/surcharges.d.ts +75 -2
- package/dist/orders/surcharges.js +110 -4
- package/dist/payments/account-credit.d.ts +171 -0
- package/dist/payments/account-credit.js +107 -0
- package/dist/payments/index.d.ts +241 -9
- package/dist/payments/index.js +92 -0
- package/dist/payments/methods.d.ts +37 -0
- package/dist/payments/methods.js +33 -0
- package/dist/platform/catalog.d.ts +148 -0
- package/dist/platform/catalog.js +74 -0
- package/dist/platform/entitlements.d.ts +111 -0
- package/dist/platform/entitlements.js +86 -0
- package/dist/platform/legal-entities.d.ts +139 -0
- package/dist/platform/legal-entities.js +126 -0
- package/dist/platform/legal-entity-numbering.d.ts +103 -0
- package/dist/platform/legal-entity-numbering.js +101 -0
- package/dist/platform/organization-membership.d.ts +80 -0
- package/dist/platform/organization-membership.js +71 -0
- package/dist/platform/organization-settings.d.ts +33 -0
- package/dist/platform/organization-settings.js +42 -0
- package/dist/platform/organization-sharing.d.ts +172 -0
- package/dist/platform/organization-sharing.js +120 -0
- package/dist/platform/organizations.d.ts +205 -0
- package/dist/platform/organizations.js +180 -0
- package/dist/platform/provision-store.d.ts +88 -8
- package/dist/platform/provision-store.js +12 -0
- package/dist/platform/reports.d.ts +46 -0
- package/dist/platform/reports.js +31 -0
- package/dist/platform/server-metrics.d.ts +58 -0
- package/dist/platform/server-metrics.js +11 -0
- package/dist/pos/index.d.ts +567 -0
- package/dist/pos/index.js +205 -0
- package/dist/pricing/index.d.ts +408 -0
- package/dist/pricing/index.js +353 -0
- package/dist/pricing/vouchers.d.ts +103 -0
- package/dist/pricing/vouchers.js +69 -0
- package/dist/provenance/index.d.ts +93 -0
- package/dist/provenance/index.js +53 -0
- package/dist/reports/index.d.ts +199 -0
- package/dist/reports/index.js +154 -0
- package/dist/returns/index.d.ts +225 -0
- package/dist/returns/index.js +160 -0
- package/dist/search/index.d.ts +99 -0
- package/dist/search/index.js +62 -0
- package/dist/shipping/parcel-count-suggestion.d.ts +52 -0
- package/dist/shipping/parcel-count-suggestion.js +73 -0
- package/dist/shipping/parcel-rule.d.ts +48 -0
- package/dist/shipping/parcel-rule.js +91 -0
- package/dist/stock/index.d.ts +166 -0
- package/dist/stock/index.js +115 -0
- package/dist/stock/transfers.d.ts +520 -0
- package/dist/stock/transfers.js +437 -0
- package/dist/stored-value/index.d.ts +154 -0
- package/dist/stored-value/index.js +130 -0
- package/dist/tenant/capabilities.d.ts +10 -0
- package/dist/tenant/entitlements.d.ts +35 -0
- package/dist/tenant/entitlements.js +15 -0
- package/dist/tenant/field-groups.d.ts +64 -0
- package/dist/tenant/field-groups.js +34 -0
- package/dist/tenant/legal-entity.d.ts +32 -0
- package/dist/tenant/legal-entity.js +41 -0
- package/dist/tenant/notifications.d.ts +148 -0
- package/dist/tenant/notifications.js +79 -0
- package/dist/tenant/retention.d.ts +10 -4
- package/dist/tenant/settings-sources.d.ts +103 -0
- package/dist/tenant/settings-sources.js +92 -0
- package/dist/types.d.ts +86 -11
- package/dist/uploads/index.d.ts +11 -7
- package/dist/users/index.d.ts +104 -0
- package/dist/users/index.js +80 -0
- package/package.json +3 -2
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { type OrderScope, type Page, type Transport } from '@sixtyninecommerce/core';
|
|
2
|
+
import type { BulkModule, BulkOperation } from '../bulk/index.js';
|
|
3
|
+
import type { JobHandle, JobsModule } from '../jobs/index.js';
|
|
4
|
+
import type { Call, ListOptions } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* A report period (spec §9.3).
|
|
7
|
+
*
|
|
8
|
+
* Each bound is EITHER a date, `YYYY-MM-DD`, read as a whole day in the
|
|
9
|
+
* STORE's time zone (`Channel.customFields.timezone`, else Europe/Amsterdam) —
|
|
10
|
+
* never yours, never the server's — OR an ISO-8601 instant WITH an explicit
|
|
11
|
+
* offset (`2026-09-01T00:00:00+02:00`, `…Z`); a time without an offset is
|
|
12
|
+
* refused (`INVALID_REPORT_PERIOD`, a `ValidationError`).
|
|
13
|
+
*
|
|
14
|
+
* `from` is inclusive. `to` is inclusive as a DATE (`{ from: '2026-09-01',
|
|
15
|
+
* to: '2026-09-30' }` is all of September) and exclusive as an instant. At most
|
|
16
|
+
* 366 days.
|
|
17
|
+
*/
|
|
18
|
+
export interface ReportPeriod {
|
|
19
|
+
from: string;
|
|
20
|
+
to: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ReportOverviewInput {
|
|
23
|
+
period: ReportPeriod;
|
|
24
|
+
/**
|
|
25
|
+
* One stock location of this store (`stockLocationId`). Keeps the orders whose
|
|
26
|
+
* stock was allocated or sold there, or that stated it at entry; an order
|
|
27
|
+
* touching two locations counts at both. A location of another store is
|
|
28
|
+
* refused with `LOCATION_NOT_IN_CHANNEL` (`ValidationError`). Omitted, the
|
|
29
|
+
* client's `tenant.location` (`x-location`) applies, as on every
|
|
30
|
+
* location-taking read. A credential restricted to some locations
|
|
31
|
+
* (`locationIds`) is refused elsewhere with `LOCATION_NOT_ALLOWED`
|
|
32
|
+
* (`PermissionDeniedError`) and, naming none, reads only its own locations'
|
|
33
|
+
* orders.
|
|
34
|
+
*/
|
|
35
|
+
locationId?: string;
|
|
36
|
+
/** One storefront's orders: `CONSUMER` (retail) or `TRADE` (B2B). */
|
|
37
|
+
orderScope?: OrderScope;
|
|
38
|
+
}
|
|
39
|
+
/** The money of one period. Every `…Minor` is an integer in minor units of `currencyCode`. */
|
|
40
|
+
export interface ReportTotals {
|
|
41
|
+
/** Placed, uncancelled orders — every currency. Carts never count. */
|
|
42
|
+
orderCount: number;
|
|
43
|
+
cancelledCount: number;
|
|
44
|
+
/**
|
|
45
|
+
* What those orders BILLED: the sum of each order's total with its goodwill
|
|
46
|
+
* rounding folded in — the same figure its invoice and its payment position
|
|
47
|
+
* read — for the orders in `currencyCode`.
|
|
48
|
+
*/
|
|
49
|
+
revenueMinor: number;
|
|
50
|
+
/** The same orders' billable net totals, the rounding split at each order's own VAT rate. */
|
|
51
|
+
revenueNetMinor: number;
|
|
52
|
+
/** `revenueMinor` ÷ the orders in `currencyCode`, rounded half up. */
|
|
53
|
+
averageOrderValueMinor: number;
|
|
54
|
+
averageOrderValueNetMinor: number;
|
|
55
|
+
/** Orders placed in another currency: in `orderCount`, in no `…Minor` figure. */
|
|
56
|
+
ordersInOtherCurrencies: number;
|
|
57
|
+
}
|
|
58
|
+
/** One day of the store's calendar. */
|
|
59
|
+
export interface ReportDay {
|
|
60
|
+
/** The instant the day begins in the store's zone, ISO-8601 UTC. A DST day is 23 or 25 hours long. */
|
|
61
|
+
startsAt: string;
|
|
62
|
+
orderCount: number;
|
|
63
|
+
revenueMinor: number;
|
|
64
|
+
revenueNetMinor: number;
|
|
65
|
+
}
|
|
66
|
+
export interface ReportOverview {
|
|
67
|
+
/** ISO 4217. The store's default currency; every `…Minor` value is in it. */
|
|
68
|
+
currencyCode: string;
|
|
69
|
+
/** IANA zone the days are cut in — the store's. */
|
|
70
|
+
timeZone: string;
|
|
71
|
+
/** The resolved period, ISO-8601 UTC: `from` inclusive, `to` exclusive. */
|
|
72
|
+
from: string;
|
|
73
|
+
to: string;
|
|
74
|
+
/** The comparison window immediately before, same length. */
|
|
75
|
+
previousFrom: string;
|
|
76
|
+
previousTo: string;
|
|
77
|
+
current: ReportTotals;
|
|
78
|
+
previous: ReportTotals;
|
|
79
|
+
days: ReportDay[];
|
|
80
|
+
newCustomers: number;
|
|
81
|
+
previousNewCustomers: number;
|
|
82
|
+
/** Live, not period-scoped: placed orders whose goods have not all been handed off. */
|
|
83
|
+
awaitingFulfillment: number;
|
|
84
|
+
/** Placed orders of the period by lifecycle (`open`, `completed`, `cancelled`). */
|
|
85
|
+
statusBreakdown: Array<{
|
|
86
|
+
status: string;
|
|
87
|
+
count: number;
|
|
88
|
+
}>;
|
|
89
|
+
topProducts: Array<{
|
|
90
|
+
productVariantId: string;
|
|
91
|
+
productId: string;
|
|
92
|
+
name: string;
|
|
93
|
+
sku: string;
|
|
94
|
+
unitsSold: number;
|
|
95
|
+
}>;
|
|
96
|
+
}
|
|
97
|
+
export interface PopularVariantsInput {
|
|
98
|
+
/** 1–50, default 8. */
|
|
99
|
+
take?: number;
|
|
100
|
+
/** 1–3650, default 90. */
|
|
101
|
+
sinceDays?: number;
|
|
102
|
+
}
|
|
103
|
+
export interface PopularVariant {
|
|
104
|
+
id: string;
|
|
105
|
+
productId: string;
|
|
106
|
+
name: string;
|
|
107
|
+
sku: string;
|
|
108
|
+
}
|
|
109
|
+
export interface LowStockInput extends ListOptions {
|
|
110
|
+
/** Rows whose `available` is at or below this; a whole number, 0–1,000,000. */
|
|
111
|
+
threshold: number;
|
|
112
|
+
/**
|
|
113
|
+
* One stock location of this store. Omitted: the client's `tenant.location`
|
|
114
|
+
* (`x-location`), else every location this credential may act at.
|
|
115
|
+
*/
|
|
116
|
+
locationId?: string;
|
|
117
|
+
}
|
|
118
|
+
/** One variant at one stock location. */
|
|
119
|
+
export interface LowStockVariant {
|
|
120
|
+
productVariantId: string;
|
|
121
|
+
productId: string;
|
|
122
|
+
sku: string;
|
|
123
|
+
name: string;
|
|
124
|
+
stockLocationId: string;
|
|
125
|
+
stockLocationName: string;
|
|
126
|
+
stockOnHand: number;
|
|
127
|
+
stockAllocated: number;
|
|
128
|
+
/** Units the out-of-stock threshold holds back from sale: `max(0, threshold)`. */
|
|
129
|
+
reserved: number;
|
|
130
|
+
/**
|
|
131
|
+
* `stockOnHand − stockAllocated − threshold` — the same figure `admin.stock`
|
|
132
|
+
* reports; negative when more is allocated than can be sold.
|
|
133
|
+
*/
|
|
134
|
+
available: number;
|
|
135
|
+
}
|
|
136
|
+
/** The reports `export` can produce. */
|
|
137
|
+
export type ReportExportKind = 'overview';
|
|
138
|
+
export interface ReportExportFilter {
|
|
139
|
+
period: ReportPeriod;
|
|
140
|
+
/**
|
|
141
|
+
* Omitted, the client's (or the call's) `tenant.location` is used — the same
|
|
142
|
+
* fallback `overview` gets from `x-location` — so a file and the screen it
|
|
143
|
+
* mirrors cover the same place.
|
|
144
|
+
*/
|
|
145
|
+
locationId?: string;
|
|
146
|
+
orderScope?: OrderScope;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* A finished export: a bulk operation whose `resultUrl` is a short-lived
|
|
150
|
+
* signed link to the JSONL — one line per store day:
|
|
151
|
+
* `{ date, startsAt, timeZone, currencyCode, orderCount, revenueMinor, revenueNetMinor }`.
|
|
152
|
+
* Read `status` before the file: a failed run carries `error.code`.
|
|
153
|
+
*/
|
|
154
|
+
export type ReportExport = Omit<BulkOperation, 'entity'> & {
|
|
155
|
+
/** Export-only report entities are not among the importable `BulkEntity` values. */
|
|
156
|
+
entity: 'report_overview';
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Tenant reporting (spec §9.2 `reports`): the order-analytics surface the
|
|
160
|
+
* dashboard reads, with money in integer minor units + `currencyCode` and time
|
|
161
|
+
* as ISO-8601 UTC (§9.3).
|
|
162
|
+
*
|
|
163
|
+
* Everything is scoped to the client's store; nothing here reads another.
|
|
164
|
+
* `overview` needs `ReadOrder`, `lowStock` `ReadCatalog` or `ReadProduct`,
|
|
165
|
+
* `popularVariants` `ReadOrder`, `export` `ReadOrder`. The cross-store fleet is
|
|
166
|
+
* `admin.platform.reports.fleet` (SuperAdmin session only).
|
|
167
|
+
*/
|
|
168
|
+
export interface ReportsModule {
|
|
169
|
+
/** Orders, revenue and customers of a period, by the store's own days. */
|
|
170
|
+
overview(input: ReportOverviewInput, options?: Call): Promise<ReportOverview>;
|
|
171
|
+
/**
|
|
172
|
+
* Variants ranked by units sold in placed orders of the last `sinceDays`
|
|
173
|
+
* days, most first. A `Page` because every list is one; it is always a
|
|
174
|
+
* single, final page.
|
|
175
|
+
*/
|
|
176
|
+
popularVariants(input?: PopularVariantsInput, options?: Call): Promise<Page<PopularVariant>>;
|
|
177
|
+
/**
|
|
178
|
+
* Variants at or below `threshold` available units, per stock location,
|
|
179
|
+
* lowest first. Untracked variants are never low.
|
|
180
|
+
*/
|
|
181
|
+
lowStock(input: LowStockInput): Promise<Page<LowStockVariant>>;
|
|
182
|
+
/**
|
|
183
|
+
* Write a report to a file, as a job (`kind: report.export`). `wait()`
|
|
184
|
+
* resolves with the operation and a freshly signed `resultUrl`. The filter's
|
|
185
|
+
* shape is checked when you call; its meaning (a real period, a location of
|
|
186
|
+
* this store) when the job runs, so a bad location fails the JOB. A
|
|
187
|
+
* location-restricted credential must name one of its own locations
|
|
188
|
+
* (`LOCATION_NOT_ALLOWED` otherwise) — a store-wide file is what its
|
|
189
|
+
* restriction withholds.
|
|
190
|
+
*/
|
|
191
|
+
export(kind: ReportExportKind, filter: ReportExportFilter, options?: Call): Promise<JobHandle<ReportExport>>;
|
|
192
|
+
}
|
|
193
|
+
/** Only the §9.3 generation is selected — never the deprecated Float/String fields. */
|
|
194
|
+
export declare const REPORT_OVERVIEW_QUERY = "\n query ReportOverview($range: ReportPeriodInput!, $locationId: ID, $orderScope: OrderScope) {\n commerceOverviewMetrics(range: $range, locationId: $locationId, orderScope: $orderScope) {\n currencyCode\n timeZone\n from\n to\n previousFrom\n previousTo\n current { \n orderCount\n cancelledCount\n revenueMinor\n revenueNetMinor\n averageOrderValueMinor\n averageOrderValueNetMinor\n ordersInOtherCurrencies\n }\n previous { \n orderCount\n cancelledCount\n revenueMinor\n revenueNetMinor\n averageOrderValueMinor\n averageOrderValueNetMinor\n ordersInOtherCurrencies\n }\n revenueSeries { startsAt valueMinor valueNetMinor }\n orderSeries { startsAt value }\n newCustomers\n previousNewCustomers\n awaitingFulfillment\n statusBreakdown { state count }\n topProducts { productVariantId productId name sku unitsSold }\n }\n }\n";
|
|
195
|
+
export declare const POPULAR_VARIANTS_QUERY = "\n query ReportPopularVariants($take: Int, $sinceDays: Int) {\n popularProductVariantsInChannel(take: $take, sinceDays: $sinceDays) {\n id\n productId\n name\n sku\n }\n }\n";
|
|
196
|
+
export declare const LOW_STOCK_QUERY = "\n query ReportLowStock($threshold: Int!, $locationId: ID, $options: LowStockVariantListOptions) {\n lowStockVariants(threshold: $threshold, locationId: $locationId, options: $options) {\n items {\n productVariantId\n productId\n sku\n name\n stockLocationId\n stockLocationName\n stockOnHand\n stockAllocated\n reserved\n available\n }\n totalItems\n }\n }\n";
|
|
197
|
+
export declare function createReportsModule(transport: Transport, bulk: BulkModule, jobs: JobsModule,
|
|
198
|
+
/** The client's `tenant.location`, read per call (a derived client has its own). */
|
|
199
|
+
clientLocation?: () => string | undefined): ReportsModule;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { createPage, pageFromVendureList, readOffsetCursor, } from '@sixtyninecommerce/core';
|
|
2
|
+
const TOTALS_FIELDS = /* GraphQL */ `
|
|
3
|
+
orderCount
|
|
4
|
+
cancelledCount
|
|
5
|
+
revenueMinor
|
|
6
|
+
revenueNetMinor
|
|
7
|
+
averageOrderValueMinor
|
|
8
|
+
averageOrderValueNetMinor
|
|
9
|
+
ordersInOtherCurrencies
|
|
10
|
+
`;
|
|
11
|
+
/** Only the §9.3 generation is selected — never the deprecated Float/String fields. */
|
|
12
|
+
export const REPORT_OVERVIEW_QUERY = /* GraphQL */ `
|
|
13
|
+
query ReportOverview($range: ReportPeriodInput!, $locationId: ID, $orderScope: OrderScope) {
|
|
14
|
+
commerceOverviewMetrics(range: $range, locationId: $locationId, orderScope: $orderScope) {
|
|
15
|
+
currencyCode
|
|
16
|
+
timeZone
|
|
17
|
+
from
|
|
18
|
+
to
|
|
19
|
+
previousFrom
|
|
20
|
+
previousTo
|
|
21
|
+
current { ${TOTALS_FIELDS} }
|
|
22
|
+
previous { ${TOTALS_FIELDS} }
|
|
23
|
+
revenueSeries { startsAt valueMinor valueNetMinor }
|
|
24
|
+
orderSeries { startsAt value }
|
|
25
|
+
newCustomers
|
|
26
|
+
previousNewCustomers
|
|
27
|
+
awaitingFulfillment
|
|
28
|
+
statusBreakdown { state count }
|
|
29
|
+
topProducts { productVariantId productId name sku unitsSold }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
export const POPULAR_VARIANTS_QUERY = /* GraphQL */ `
|
|
34
|
+
query ReportPopularVariants($take: Int, $sinceDays: Int) {
|
|
35
|
+
popularProductVariantsInChannel(take: $take, sinceDays: $sinceDays) {
|
|
36
|
+
id
|
|
37
|
+
productId
|
|
38
|
+
name
|
|
39
|
+
sku
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
export const LOW_STOCK_QUERY = /* GraphQL */ `
|
|
44
|
+
query ReportLowStock($threshold: Int!, $locationId: ID, $options: LowStockVariantListOptions) {
|
|
45
|
+
lowStockVariants(threshold: $threshold, locationId: $locationId, options: $options) {
|
|
46
|
+
items {
|
|
47
|
+
productVariantId
|
|
48
|
+
productId
|
|
49
|
+
sku
|
|
50
|
+
name
|
|
51
|
+
stockLocationId
|
|
52
|
+
stockLocationName
|
|
53
|
+
stockOnHand
|
|
54
|
+
stockAllocated
|
|
55
|
+
reserved
|
|
56
|
+
available
|
|
57
|
+
}
|
|
58
|
+
totalItems
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
const DEFAULT_LOW_STOCK_PAGE = 50;
|
|
63
|
+
/** The bulk entity a report kind is exported as. */
|
|
64
|
+
const EXPORT_ENTITY = { overview: 'report_overview' };
|
|
65
|
+
/** Filter keys travel as the service spells them — see `bulk/index.ts`'s `FILTER_PASSTHROUGH`. */
|
|
66
|
+
const FILTER_PASSTHROUGH = new Set(['filter']);
|
|
67
|
+
export function createReportsModule(transport, bulk, jobs,
|
|
68
|
+
/** The client's `tenant.location`, read per call (a derived client has its own). */
|
|
69
|
+
clientLocation = () => undefined) {
|
|
70
|
+
const lowStockPage = async (input, skip, take) => {
|
|
71
|
+
const data = await transport.graphql({
|
|
72
|
+
api: 'admin',
|
|
73
|
+
query: LOW_STOCK_QUERY,
|
|
74
|
+
variables: {
|
|
75
|
+
threshold: input.threshold,
|
|
76
|
+
locationId: input.locationId ?? null,
|
|
77
|
+
options: { skip, take },
|
|
78
|
+
},
|
|
79
|
+
}, input);
|
|
80
|
+
return pageFromVendureList(data.lowStockVariants, skip, take, (cursor) => lowStockPage(input, readOffsetCursor(cursor), take));
|
|
81
|
+
};
|
|
82
|
+
return {
|
|
83
|
+
async overview(input, options) {
|
|
84
|
+
const data = await transport.graphql({
|
|
85
|
+
api: 'admin',
|
|
86
|
+
query: REPORT_OVERVIEW_QUERY,
|
|
87
|
+
variables: {
|
|
88
|
+
range: { from: input.period.from, to: input.period.to },
|
|
89
|
+
locationId: input.locationId ?? null,
|
|
90
|
+
orderScope: input.orderScope ?? null,
|
|
91
|
+
},
|
|
92
|
+
}, options);
|
|
93
|
+
const { revenueSeries, orderSeries, statusBreakdown, ...rest } = data.commerceOverviewMetrics;
|
|
94
|
+
// The two series are the same buckets; joined on the instant rather than
|
|
95
|
+
// the index so a reordering on the server could never pair two days.
|
|
96
|
+
const orders = new Map(orderSeries.map((point) => [point.startsAt, point.value]));
|
|
97
|
+
return {
|
|
98
|
+
...rest,
|
|
99
|
+
days: revenueSeries.map((point) => ({
|
|
100
|
+
startsAt: point.startsAt,
|
|
101
|
+
orderCount: orders.get(point.startsAt) ?? 0,
|
|
102
|
+
revenueMinor: point.valueMinor ?? 0,
|
|
103
|
+
revenueNetMinor: point.valueNetMinor ?? 0,
|
|
104
|
+
})),
|
|
105
|
+
statusBreakdown: statusBreakdown.map((row) => ({ status: row.state, count: row.count })),
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
async popularVariants(input, options) {
|
|
109
|
+
const data = await transport.graphql({
|
|
110
|
+
api: 'admin',
|
|
111
|
+
query: POPULAR_VARIANTS_QUERY,
|
|
112
|
+
variables: { take: input?.take ?? null, sinceDays: input?.sinceDays ?? null },
|
|
113
|
+
}, options);
|
|
114
|
+
const items = data.popularProductVariantsInChannel;
|
|
115
|
+
return createPage(items, { nextCursor: null, hasNext: false, total: items.length }, () => {
|
|
116
|
+
// Unreachable while `hasNext` is false — `Page.next()` short-circuits.
|
|
117
|
+
throw new Error('popularVariants returns one ranked list; there is no next page');
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
lowStock(input) {
|
|
121
|
+
const take = input.limit ?? DEFAULT_LOW_STOCK_PAGE;
|
|
122
|
+
const skip = input.after === undefined ? 0 : readOffsetCursor(input.after);
|
|
123
|
+
return lowStockPage(input, skip, take);
|
|
124
|
+
},
|
|
125
|
+
async export(kind, filter, options) {
|
|
126
|
+
// The worker runs without the caller's `x-location`, so the fallback
|
|
127
|
+
// `overview` gets from that header is applied here, explicitly.
|
|
128
|
+
const locationId = filter.locationId ?? options?.tenant?.location ?? clientLocation();
|
|
129
|
+
const { jobId } = await transport.rest('plugins', {
|
|
130
|
+
method: 'POST',
|
|
131
|
+
path: '/bulk/exports',
|
|
132
|
+
body: {
|
|
133
|
+
entity: EXPORT_ENTITY[kind],
|
|
134
|
+
filter: {
|
|
135
|
+
from: filter.period.from,
|
|
136
|
+
to: filter.period.to,
|
|
137
|
+
...(locationId === undefined ? {} : { location_id: locationId }),
|
|
138
|
+
...(filter.orderScope === undefined ? {} : { order_scope: filter.orderScope }),
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
}, { ...options, preserveKeys: FILTER_PASSTHROUGH });
|
|
142
|
+
return {
|
|
143
|
+
runId: jobId,
|
|
144
|
+
async wait(waitOptions) {
|
|
145
|
+
// Wait on the JOB, then read the operation once: its signed link is
|
|
146
|
+
// minted per read, so one minted while the run was going would have
|
|
147
|
+
// expired by the time the file existed.
|
|
148
|
+
await jobs.wait(jobId, { ...options, ...waitOptions });
|
|
149
|
+
return (await bulk.get(jobId, options));
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `admin.returns`: the single-return reads of the returns (RMA) plugin, and the
|
|
3
|
+
* plan for settling one (headless plan W9-47).
|
|
4
|
+
*
|
|
5
|
+
* A first, minimal module: the reads the order and return pages need. The list
|
|
6
|
+
* (`orderReturns`) and the writes (create, approve, reject, cancel, receipt,
|
|
7
|
+
* settle, notes, numbering) are phase 7. Money is in MINOR UNITS throughout,
|
|
8
|
+
* as everywhere in this SDK.
|
|
9
|
+
*
|
|
10
|
+
* Every value set below is the engine's own and grows over time, so each field
|
|
11
|
+
* that carries one also accepts a string this version does not name: treat an
|
|
12
|
+
* unknown value as "not available".
|
|
13
|
+
*/
|
|
14
|
+
import type { Transport } from '@sixtyninecommerce/core';
|
|
15
|
+
import type { Call } from '../types.js';
|
|
16
|
+
/** A return's state: the latest row of its status log. */
|
|
17
|
+
export declare const RETURN_STATES: readonly ["requested", "approved", "rejected", "cancelled", "items_received", "settlement_pending", "settlement_failed", "settled"];
|
|
18
|
+
export type ReturnState = (typeof RETURN_STATES)[number];
|
|
19
|
+
/**
|
|
20
|
+
* How a return is settled. `refund` gives money back to an original payment.
|
|
21
|
+
* `store_credit` issues a credit note: on a store with an accounts-receivable
|
|
22
|
+
* ledger it credits the customer's account, elsewhere it credits the order's
|
|
23
|
+
* invoice and moves no money.
|
|
24
|
+
*/
|
|
25
|
+
export declare const RETURN_SETTLEMENT_METHODS: readonly ["refund", "store_credit"];
|
|
26
|
+
export type ReturnSettlementMethod = (typeof RETURN_SETTLEMENT_METHODS)[number];
|
|
27
|
+
export interface OrderReturnLine {
|
|
28
|
+
id: string;
|
|
29
|
+
returnId: string;
|
|
30
|
+
orderLineId: string;
|
|
31
|
+
productVariantId: string;
|
|
32
|
+
productVariantName: string;
|
|
33
|
+
productVariantSku: string;
|
|
34
|
+
requestedQty: number;
|
|
35
|
+
/** Null until approval; 0 means the line was declined. */
|
|
36
|
+
approvedQty: number | null;
|
|
37
|
+
/** Units received back, across every receipt. */
|
|
38
|
+
receivedQty: number;
|
|
39
|
+
restockQty: number;
|
|
40
|
+
writeOffQty: number;
|
|
41
|
+
restockLocationId: string | null;
|
|
42
|
+
/** `damaged`, `defective`, `wrong_item`, `not_as_described`, `arrived_late`, `no_longer_needed`, `order_error`, `other`. */
|
|
43
|
+
reasonCode: string;
|
|
44
|
+
reasonNote: string | null;
|
|
45
|
+
/** The order line's prorated unit price incl. tax, rounded per unit. Display only. */
|
|
46
|
+
unitPriceWithTax: number;
|
|
47
|
+
/**
|
|
48
|
+
* The same price before per-unit rounding; null for returns requested before
|
|
49
|
+
* it was recorded. Multiply by a quantity and round ONCE to estimate a line.
|
|
50
|
+
*/
|
|
51
|
+
unitPriceWithTaxUnrounded: number | null;
|
|
52
|
+
/** What the line refunds; null until approved. */
|
|
53
|
+
refundAmount: number | null;
|
|
54
|
+
createdAt: string;
|
|
55
|
+
updatedAt: string;
|
|
56
|
+
}
|
|
57
|
+
/** One row of a return's status log. */
|
|
58
|
+
export interface OrderReturnStatusLogEntry {
|
|
59
|
+
state: ReturnState | (string & {});
|
|
60
|
+
/** `customer`, `admin` or `system`. */
|
|
61
|
+
actor: string;
|
|
62
|
+
actorUserId: string | null;
|
|
63
|
+
reason: string | null;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
}
|
|
66
|
+
export interface OrderReturn {
|
|
67
|
+
id: string;
|
|
68
|
+
/** The human-facing RMA code, e.g. `RMA-000042`. */
|
|
69
|
+
code: string;
|
|
70
|
+
channelId: string;
|
|
71
|
+
orderId: string;
|
|
72
|
+
orderCode: string;
|
|
73
|
+
customerId: string;
|
|
74
|
+
currencyCode: string;
|
|
75
|
+
state: ReturnState | (string & {});
|
|
76
|
+
/** `customer` or `admin`. */
|
|
77
|
+
initiator: string;
|
|
78
|
+
customerNote: string | null;
|
|
79
|
+
adminNote: string | null;
|
|
80
|
+
preferredSettlementMethod: ReturnSettlementMethod | (string & {}) | null;
|
|
81
|
+
/** The method it was settled with; null until settled. */
|
|
82
|
+
settlementMethod: ReturnSettlementMethod | (string & {}) | null;
|
|
83
|
+
/** Shipping refunded on top of the lines. */
|
|
84
|
+
shippingRefundAmount: number;
|
|
85
|
+
/** What was settled; null until settled. */
|
|
86
|
+
settledAmount: number | null;
|
|
87
|
+
refundId: string | null;
|
|
88
|
+
creditNoteId: string | null;
|
|
89
|
+
creditNoteNumber: string | null;
|
|
90
|
+
requestedAt: string;
|
|
91
|
+
resolvedAt: string | null;
|
|
92
|
+
lines: OrderReturnLine[];
|
|
93
|
+
createdAt: string;
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
}
|
|
96
|
+
/** {@link OrderReturn} with its status log, newest first: what `get` answers. */
|
|
97
|
+
export interface OrderReturnDetail extends OrderReturn {
|
|
98
|
+
history: OrderReturnStatusLogEntry[];
|
|
99
|
+
}
|
|
100
|
+
/** One order line and what of it can still be returned. */
|
|
101
|
+
export interface ReturnableOrderLine {
|
|
102
|
+
orderLineId: string;
|
|
103
|
+
productVariantId: string;
|
|
104
|
+
productVariantName: string;
|
|
105
|
+
productVariantSku: string;
|
|
106
|
+
/** Units shipped or delivered. */
|
|
107
|
+
fulfilledQty: number;
|
|
108
|
+
/** `fulfilledQty` less the units other open returns already claim. */
|
|
109
|
+
returnableQty: number;
|
|
110
|
+
unitPriceWithTax: number;
|
|
111
|
+
unitPriceWithTaxUnrounded: number;
|
|
112
|
+
}
|
|
113
|
+
export interface ReturnEligibility {
|
|
114
|
+
orderId: string;
|
|
115
|
+
/** False only when nothing is returnable: an admin may return outside the window. */
|
|
116
|
+
eligible: boolean;
|
|
117
|
+
/** Why not, when not eligible. */
|
|
118
|
+
reason: string | null;
|
|
119
|
+
/** ISO-8601 with offset; null when the store sets no window. */
|
|
120
|
+
returnWindowEndsAt: string | null;
|
|
121
|
+
/** Lines with a fulfilled quantity only. */
|
|
122
|
+
lines: ReturnableOrderLine[];
|
|
123
|
+
}
|
|
124
|
+
/** Why a return cannot be settled now, in the order the engine checks them. */
|
|
125
|
+
export declare const RETURN_SETTLEMENT_BLOCKERS: readonly ["OUTCOME_UNKNOWN", "ALREADY_SETTLED", "IN_PROGRESS", "RECEIPT_REQUIRED", "STATE"];
|
|
126
|
+
/**
|
|
127
|
+
* - `OUTCOME_UNKNOWN`: the refund it waits on reached the provider and was never
|
|
128
|
+
* confirmed. Record the provider's answer first (`reconcileRefundOutcome`):
|
|
129
|
+
* made completes the return, not made lets it be settled again.
|
|
130
|
+
* - `ALREADY_SETTLED`: settled, or settled by a credit note.
|
|
131
|
+
* - `IN_PROGRESS`: a refund is on its way and settles the return when the
|
|
132
|
+
* provider confirms it.
|
|
133
|
+
* - `RECEIPT_REQUIRED`: approved, and the store requires the goods received first.
|
|
134
|
+
* - `STATE`: requested, rejected or cancelled.
|
|
135
|
+
*/
|
|
136
|
+
export type ReturnSettlementBlocker = (typeof RETURN_SETTLEMENT_BLOCKERS)[number];
|
|
137
|
+
/**
|
|
138
|
+
* - `NO_REFUNDABLE_PAYMENT`: no settled payment can still give money back (net
|
|
139
|
+
* terms, everything refunded, reserved by a refund of unknown outcome, or
|
|
140
|
+
* moved to the customer's account).
|
|
141
|
+
* - `REFUND_ORPHAN_EXISTS`: a refund of the invoiced order stands that no credit
|
|
142
|
+
* note names; another refund could pay the same money back twice.
|
|
143
|
+
*/
|
|
144
|
+
export type ReturnRefundUnavailableReason = 'NO_REFUNDABLE_PAYMENT' | 'REFUND_ORPHAN_EXISTS';
|
|
145
|
+
/**
|
|
146
|
+
* - `AR`: the store keeps an accounts-receivable ledger; the credit note credits
|
|
147
|
+
* the customer's account, which is money.
|
|
148
|
+
* - `RETAIL`: the credit note credits the order's invoice and moves no money.
|
|
149
|
+
*/
|
|
150
|
+
export type ReturnCreditNoteLedger = 'AR' | 'RETAIL';
|
|
151
|
+
/**
|
|
152
|
+
* - `ISSUER_UNAVAILABLE`: the server runs without the plugin that issues it.
|
|
153
|
+
* - `CURRENCY_MISMATCH` (`AR`): the order is not in the store's default currency.
|
|
154
|
+
* - `NO_CREDITABLE_INVOICE` (`RETAIL`): the order has no live invoice to credit.
|
|
155
|
+
* - `REFUND_ORPHAN_EXISTS` (`AR`): as for the refund.
|
|
156
|
+
*/
|
|
157
|
+
export type ReturnCreditNoteUnavailableReason = 'ISSUER_UNAVAILABLE' | 'CURRENCY_MISMATCH' | 'NO_CREDITABLE_INVOICE' | 'REFUND_ORPHAN_EXISTS';
|
|
158
|
+
/** A settled payment a refund may name, with what it can still give back. */
|
|
159
|
+
export interface ReturnSettlementPayment {
|
|
160
|
+
paymentId: string;
|
|
161
|
+
method: string;
|
|
162
|
+
/** As the platform's refund position counts it. */
|
|
163
|
+
refundable: number;
|
|
164
|
+
}
|
|
165
|
+
export interface ReturnSettlementOptions {
|
|
166
|
+
returnId: string;
|
|
167
|
+
currencyCode: string;
|
|
168
|
+
settleable: boolean;
|
|
169
|
+
/** Null exactly when `settleable`. */
|
|
170
|
+
blockedBy: ReturnSettlementBlocker | (string & {}) | null;
|
|
171
|
+
refund: {
|
|
172
|
+
available: boolean;
|
|
173
|
+
/** Null exactly when `available`. */
|
|
174
|
+
reasonCode: ReturnRefundUnavailableReason | (string & {}) | null;
|
|
175
|
+
/** Empty when not available. */
|
|
176
|
+
payments: ReturnSettlementPayment[];
|
|
177
|
+
};
|
|
178
|
+
creditNote: {
|
|
179
|
+
available: boolean;
|
|
180
|
+
ledger: ReturnCreditNoteLedger | (string & {});
|
|
181
|
+
/** Null exactly when `available`. */
|
|
182
|
+
reasonCode: ReturnCreditNoteUnavailableReason | (string & {}) | null;
|
|
183
|
+
/** `RETAIL` only: the invoice it would credit, when known. */
|
|
184
|
+
invoiceNumber: string | null;
|
|
185
|
+
};
|
|
186
|
+
/** The credit note when asked for or when no refund is possible, and it is available; else `refund`. */
|
|
187
|
+
initialMethod: ReturnSettlementMethod | (string & {});
|
|
188
|
+
/** The approved line total: what a settlement without an override settles, before shipping. */
|
|
189
|
+
defaultAmount: number;
|
|
190
|
+
}
|
|
191
|
+
export declare const RETURN_QUERY = "\n query SdkOrderReturn($id: ID!) {\n orderReturn(id: $id) {\n \n id\n code\n channelId\n orderId\n orderCode\n customerId\n currencyCode\n state\n initiator\n customerNote\n adminNote\n preferredSettlementMethod\n settlementMethod\n shippingRefundAmount\n settledAmount\n refundId\n creditNoteId\n creditNoteNumber\n requestedAt\n resolvedAt\n createdAt\n updatedAt\n lines {\n id\n returnId\n orderLineId\n productVariantId\n productVariantName\n productVariantSku\n requestedQty\n approvedQty\n receivedQty\n restockQty\n writeOffQty\n restockLocationId\n reasonCode\n reasonNote\n unitPriceWithTax\n unitPriceWithTaxUnrounded\n refundAmount\n createdAt\n updatedAt\n }\n\n history {\n state\n actor\n actorUserId\n reason\n createdAt\n }\n }\n }\n";
|
|
192
|
+
export declare const RETURNS_FOR_ORDER_QUERY = "\n query SdkReturnsForOrder($orderId: ID!) {\n returnsForOrder(orderId: $orderId) {\n \n id\n code\n channelId\n orderId\n orderCode\n customerId\n currencyCode\n state\n initiator\n customerNote\n adminNote\n preferredSettlementMethod\n settlementMethod\n shippingRefundAmount\n settledAmount\n refundId\n creditNoteId\n creditNoteNumber\n requestedAt\n resolvedAt\n createdAt\n updatedAt\n lines {\n id\n returnId\n orderLineId\n productVariantId\n productVariantName\n productVariantSku\n requestedQty\n approvedQty\n receivedQty\n restockQty\n writeOffQty\n restockLocationId\n reasonCode\n reasonNote\n unitPriceWithTax\n unitPriceWithTaxUnrounded\n refundAmount\n createdAt\n updatedAt\n }\n\n }\n }\n";
|
|
193
|
+
export declare const RETURN_ELIGIBILITY_QUERY = "\n query SdkReturnEligibility($orderId: ID!) {\n returnEligibilityForOrder(orderId: $orderId) {\n orderId\n eligible\n reason\n returnWindowEndsAt\n lines {\n orderLineId\n productVariantId\n productVariantName\n productVariantSku\n fulfilledQty\n returnableQty\n unitPriceWithTax\n unitPriceWithTaxUnrounded\n }\n }\n }\n";
|
|
194
|
+
export declare const RETURN_SETTLEMENT_OPTIONS_QUERY = "\n query SdkReturnSettlementOptions($returnId: ID!) {\n returnSettlementOptions(returnId: $returnId) {\n returnId\n currencyCode\n settleable\n blockedBy\n refund {\n available\n reasonCode\n payments {\n paymentId\n method\n refundable\n }\n }\n creditNote {\n available\n ledger\n reasonCode\n invoiceNumber\n }\n initialMethod\n defaultAmount\n }\n }\n";
|
|
195
|
+
export interface ReturnsModule {
|
|
196
|
+
/**
|
|
197
|
+
* One return with its lines and its status log (newest first), or `null`
|
|
198
|
+
* when this store holds no return with that id. Needs `ReadOrderReturn`.
|
|
199
|
+
*/
|
|
200
|
+
get(id: string, options?: Call): Promise<OrderReturnDetail | null>;
|
|
201
|
+
/** Every return of one order, newest first. Needs `ReadOrderReturn`. */
|
|
202
|
+
forOrder(orderId: string, options?: Call): Promise<OrderReturn[]>;
|
|
203
|
+
/**
|
|
204
|
+
* What of an order can still be returned, line by line, and the return
|
|
205
|
+
* window. The window is reported, never enforced here: an admin may return
|
|
206
|
+
* outside it. Needs `ReadOrderReturn`.
|
|
207
|
+
*/
|
|
208
|
+
eligibility(orderId: string, options?: Call): Promise<ReturnEligibility>;
|
|
209
|
+
/**
|
|
210
|
+
* How a return can be settled now: whether it is settleable (and why not),
|
|
211
|
+
* which methods are open (with the payments a refund may name and what each
|
|
212
|
+
* can still give back), and which method to preselect. Needs
|
|
213
|
+
* `ReadOrderReturn` AND `ReadOrder`: it names the order's payments.
|
|
214
|
+
*
|
|
215
|
+
* This is the PLAN. The write (`settleReturn`) loads its own facts and judges
|
|
216
|
+
* again, so settling can still be refused when something changed in between,
|
|
217
|
+
* and an `amountOverride` above a payment's headroom is refused there. A
|
|
218
|
+
* return this store does not hold is a `NotFoundError` (`ENTITY_NOT_FOUND`).
|
|
219
|
+
*
|
|
220
|
+
* Needs an engine that serves `returnSettlementOptions`; against an older one
|
|
221
|
+
* this call fails validation and nothing else does.
|
|
222
|
+
*/
|
|
223
|
+
settlementOptions(returnId: string, options?: Call): Promise<ReturnSettlementOptions>;
|
|
224
|
+
}
|
|
225
|
+
export declare function createReturnsModule(transport: Transport): ReturnsModule;
|