@endora-commerce/contracts 0.108.0 → 0.109.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin-actions.d.ts +12 -3
- package/dist/admin-actions.d.ts.map +1 -1
- package/dist/admin-actions.js +34 -3
- package/dist/admin-actions.js.map +1 -1
- package/dist/admin-contributions.d.ts +35 -6
- package/dist/admin-contributions.d.ts.map +1 -1
- package/dist/admin-contributions.js +46 -0
- package/dist/admin-contributions.js.map +1 -1
- package/dist/admin-notifications.d.ts +17 -1
- package/dist/admin-notifications.d.ts.map +1 -1
- package/dist/admin-preferences.d.ts +108 -0
- package/dist/admin-preferences.d.ts.map +1 -0
- package/dist/admin-preferences.js +133 -0
- package/dist/admin-preferences.js.map +1 -0
- package/dist/admin.d.ts +15 -1
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +7 -0
- package/dist/admin.js.map +1 -1
- package/dist/assets-library.d.ts +97 -3
- package/dist/assets-library.d.ts.map +1 -1
- package/dist/assets-library.js +5 -0
- package/dist/assets-library.js.map +1 -1
- package/dist/blog.d.ts +57 -0
- package/dist/blog.d.ts.map +1 -1
- package/dist/blog.js +63 -1
- package/dist/blog.js.map +1 -1
- package/dist/carts.d.ts +113 -56
- package/dist/carts.d.ts.map +1 -1
- package/dist/carts.js +66 -13
- package/dist/carts.js.map +1 -1
- package/dist/catalog.d.ts +273 -34
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +256 -20
- package/dist/catalog.js.map +1 -1
- package/dist/cms-brand.d.ts +2233 -0
- package/dist/cms-brand.d.ts.map +1 -0
- package/dist/cms-brand.js +311 -0
- package/dist/cms-brand.js.map +1 -0
- package/dist/cms-contact-form.d.ts +55 -0
- package/dist/cms-contact-form.d.ts.map +1 -0
- package/dist/cms-contact-form.js +100 -0
- package/dist/cms-contact-form.js.map +1 -0
- package/dist/cms.d.ts +537 -3
- package/dist/cms.d.ts.map +1 -1
- package/dist/cms.js +251 -0
- package/dist/cms.js.map +1 -1
- package/dist/crm-rich-text.d.ts +10 -61
- package/dist/crm-rich-text.d.ts.map +1 -1
- package/dist/crm-rich-text.js +10 -300
- package/dist/crm-rich-text.js.map +1 -1
- package/dist/crm.d.ts +110 -82
- package/dist/crm.d.ts.map +1 -1
- package/dist/crm.js +29 -88
- package/dist/crm.js.map +1 -1
- package/dist/custom-fields.d.ts +27 -9
- package/dist/custom-fields.d.ts.map +1 -1
- package/dist/custom-fields.js +6 -0
- package/dist/custom-fields.js.map +1 -1
- package/dist/customer-accounts.d.ts +30 -0
- package/dist/customer-accounts.d.ts.map +1 -1
- package/dist/customer-accounts.js +31 -0
- package/dist/customer-accounts.js.map +1 -1
- package/dist/document-templates.d.ts +27 -15
- package/dist/document-templates.d.ts.map +1 -1
- package/dist/document-values.d.ts +8 -0
- package/dist/document-values.d.ts.map +1 -1
- package/dist/document-values.js +24 -6
- package/dist/document-values.js.map +1 -1
- package/dist/email.d.ts +5 -0
- package/dist/email.d.ts.map +1 -1
- package/dist/errors.d.ts +105 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +123 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -1
- package/dist/index.js.map +1 -1
- package/dist/inventory.d.ts +3 -3
- package/dist/invoices.d.ts +6 -2
- package/dist/invoices.d.ts.map +1 -1
- package/dist/invoices.js +3 -0
- package/dist/invoices.js.map +1 -1
- package/dist/megamenu.d.ts +674 -0
- package/dist/megamenu.d.ts.map +1 -1
- package/dist/megamenu.js +96 -3
- package/dist/megamenu.js.map +1 -1
- package/dist/mfa.d.ts +1 -0
- package/dist/mfa.d.ts.map +1 -1
- package/dist/mfa.js +8 -2
- package/dist/mfa.js.map +1 -1
- package/dist/modules.d.ts +8 -1
- package/dist/modules.d.ts.map +1 -1
- package/dist/modules.js +5 -0
- package/dist/modules.js.map +1 -1
- package/dist/newsletter.d.ts +3 -3
- package/dist/orders.d.ts +25 -0
- package/dist/orders.d.ts.map +1 -1
- package/dist/orders.js +14 -0
- package/dist/orders.js.map +1 -1
- package/dist/page-builder-props.d.ts +1401 -0
- package/dist/page-builder-props.d.ts.map +1 -0
- package/dist/page-builder-props.js +266 -0
- package/dist/page-builder-props.js.map +1 -0
- package/dist/page-builder-values.d.ts +95 -0
- package/dist/page-builder-values.d.ts.map +1 -0
- package/dist/page-builder-values.js +164 -0
- package/dist/page-builder-values.js.map +1 -0
- package/dist/pim-connector.d.ts +1 -1
- package/dist/platform-language.d.ts +9 -0
- package/dist/platform-language.d.ts.map +1 -1
- package/dist/platform-language.js +14 -0
- package/dist/platform-language.js.map +1 -1
- package/dist/price-books.d.ts +60 -60
- package/dist/price-lists.d.ts +44 -10
- package/dist/price-lists.d.ts.map +1 -1
- package/dist/price-lists.js +24 -1
- package/dist/price-lists.js.map +1 -1
- package/dist/product-feeds.d.ts +115 -55
- package/dist/product-feeds.d.ts.map +1 -1
- package/dist/product-feeds.js +18 -0
- package/dist/product-feeds.js.map +1 -1
- package/dist/product-scopes.d.ts +628 -0
- package/dist/product-scopes.d.ts.map +1 -0
- package/dist/product-scopes.js +365 -0
- package/dist/product-scopes.js.map +1 -0
- package/dist/product-summary-text.d.ts +23 -0
- package/dist/product-summary-text.d.ts.map +1 -0
- package/dist/product-summary-text.js +64 -0
- package/dist/product-summary-text.js.map +1 -0
- package/dist/product-url-keys.d.ts +204 -0
- package/dist/product-url-keys.d.ts.map +1 -0
- package/dist/product-url-keys.js +166 -0
- package/dist/product-url-keys.js.map +1 -0
- package/dist/projects.d.ts +2355 -0
- package/dist/projects.d.ts.map +1 -0
- package/dist/projects.js +837 -0
- package/dist/projects.js.map +1 -0
- package/dist/prompt-actions.d.ts +19 -1
- package/dist/prompt-actions.d.ts.map +1 -1
- package/dist/prompt-actions.js +31 -2
- package/dist/prompt-actions.js.map +1 -1
- package/dist/quick-order.d.ts +0 -1
- package/dist/quick-order.d.ts.map +1 -1
- package/dist/quick-order.js +1 -1
- package/dist/quick-order.js.map +1 -1
- package/dist/quote-requests.d.ts +36 -1
- package/dist/quote-requests.d.ts.map +1 -1
- package/dist/quote-requests.js +24 -0
- package/dist/quote-requests.js.map +1 -1
- package/dist/record-references.d.ts +252 -0
- package/dist/record-references.d.ts.map +1 -0
- package/dist/record-references.js +179 -0
- package/dist/record-references.js.map +1 -0
- package/dist/record-rich-text.d.ts +66 -0
- package/dist/record-rich-text.d.ts.map +1 -0
- package/dist/record-rich-text.js +303 -0
- package/dist/record-rich-text.js.map +1 -0
- package/dist/returns.d.ts +26 -0
- package/dist/returns.d.ts.map +1 -1
- package/dist/sales-channels.d.ts +51 -7
- package/dist/sales-channels.d.ts.map +1 -1
- package/dist/sales-channels.js +38 -4
- package/dist/sales-channels.js.map +1 -1
- package/dist/saved-list-views.d.ts +28 -0
- package/dist/saved-list-views.d.ts.map +1 -1
- package/dist/saved-list-views.js +14 -1
- package/dist/saved-list-views.js.map +1 -1
- package/dist/scoped-translations.d.ts +48 -0
- package/dist/scoped-translations.d.ts.map +1 -0
- package/dist/scoped-translations.js +78 -0
- package/dist/scoped-translations.js.map +1 -0
- package/dist/search.d.ts +15 -7
- package/dist/search.d.ts.map +1 -1
- package/dist/seo.d.ts +64 -5
- package/dist/seo.d.ts.map +1 -1
- package/dist/seo.js +31 -4
- package/dist/seo.js.map +1 -1
- package/dist/settings.d.ts +32 -3
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +37 -3
- package/dist/settings.js.map +1 -1
- package/dist/storefront-cache-tags.d.ts +29 -0
- package/dist/storefront-cache-tags.d.ts.map +1 -1
- package/dist/storefront-cache-tags.js +24 -0
- package/dist/storefront-cache-tags.js.map +1 -1
- package/dist/storefront-language-path.d.ts +77 -0
- package/dist/storefront-language-path.d.ts.map +1 -0
- package/dist/storefront-language-path.js +123 -0
- package/dist/storefront-language-path.js.map +1 -0
- package/dist/tasks.d.ts +2842 -0
- package/dist/tasks.d.ts.map +1 -0
- package/dist/tasks.js +901 -0
- package/dist/tasks.js.map +1 -0
- package/dist/transactional-emails.d.ts +7 -4
- package/dist/transactional-emails.d.ts.map +1 -1
- package/dist/transactional-emails.js +13 -0
- package/dist/transactional-emails.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type ProductVisibility } from './common.js';
|
|
3
|
+
import { type ProductAudience } from './catalog.js';
|
|
4
|
+
import type { ProductUrlKeyWrite, UrlKeyWriteOutcome } from './product-url-keys.js';
|
|
5
|
+
/**
|
|
6
|
+
* Feature 163 (`specs/163-product-data-scopes/`) — product data scopes per sales
|
|
7
|
+
* channel and language: the one rule of effective availability, its admin shapes and
|
|
8
|
+
* the ports other modules ask through (`contracts/product-scopes.md`,
|
|
9
|
+
* `contracts/admin-scopes-api.md`, research R1–R7, R18).
|
|
10
|
+
*
|
|
11
|
+
* Scopes, from widest to narrowest: **global** (the `products` row), **channel**
|
|
12
|
+
* (`product_channel_scopes`, one row per product × channel) and **channel × language**
|
|
13
|
+
* (`product_channel_language_scopes`, status only). An override that is absent —
|
|
14
|
+
* `null` on a channel row, no row at all — inherits from the scope above it.
|
|
15
|
+
*
|
|
16
|
+
* Import direction: this file imports from `catalog.ts`, never the reverse, so either
|
|
17
|
+
* may be loaded first without meeting the other half-evaluated.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* The scoped status values (FR-010, R3). The same set as the global product status,
|
|
21
|
+
* and derived from it so there is one list. Every predicate tests `=== 'active'`
|
|
22
|
+
* through {@link isOn} and never enumerates the off values, which is what keeps a
|
|
23
|
+
* later change of this set (owner question Q1) a data migration rather than a rewrite.
|
|
24
|
+
*/
|
|
25
|
+
export declare const PRODUCT_SCOPE_STATUSES: ("active" | "inactive")[];
|
|
26
|
+
export type ProductScopeStatus = (typeof PRODUCT_SCOPE_STATUSES)[number];
|
|
27
|
+
export declare const productScopeStatusSchema: z.ZodEnum<{
|
|
28
|
+
active: "active";
|
|
29
|
+
inactive: "inactive";
|
|
30
|
+
}>;
|
|
31
|
+
/** A publication window — inclusive at both ends; `null` = open on that side (K4). */
|
|
32
|
+
export interface PublicationWindow {
|
|
33
|
+
from: Date | null;
|
|
34
|
+
until: Date | null;
|
|
35
|
+
}
|
|
36
|
+
/** The audience rule — mode and organization list, one value (C4). */
|
|
37
|
+
export interface AudienceRule {
|
|
38
|
+
visibility: ProductVisibility;
|
|
39
|
+
allowedOrganizationIds: string[];
|
|
40
|
+
}
|
|
41
|
+
/** A `product_channel_scopes` row. Every `null` inherits the global value. */
|
|
42
|
+
export interface ProductChannelScopeRecord {
|
|
43
|
+
productId: string;
|
|
44
|
+
channelId: string;
|
|
45
|
+
/** `null` = inherit. */
|
|
46
|
+
status: ProductScopeStatus | null;
|
|
47
|
+
/** `null` = inherit the global pair; a non-null pair replaces it, even when both bounds are open. */
|
|
48
|
+
window: PublicationWindow | null;
|
|
49
|
+
/** `null` = inherit the whole global rule. */
|
|
50
|
+
audience: AudienceRule | null;
|
|
51
|
+
/** `null` = inherit; `1` = no minimum in this channel. */
|
|
52
|
+
minOrderQuantity: number | null;
|
|
53
|
+
/** `null` = inherit. */
|
|
54
|
+
returnable: boolean | null;
|
|
55
|
+
}
|
|
56
|
+
/** A `product_channel_language_scopes` row. Absent = inherit. */
|
|
57
|
+
export interface ProductChannelLanguageScopeRecord {
|
|
58
|
+
productId: string;
|
|
59
|
+
channelId: string;
|
|
60
|
+
languageCode: string;
|
|
61
|
+
status: ProductScopeStatus;
|
|
62
|
+
}
|
|
63
|
+
/** The global values the rule reads off the product row. */
|
|
64
|
+
export interface ProductGlobalScopeFields {
|
|
65
|
+
status: ProductScopeStatus;
|
|
66
|
+
deletedAt: Date | null;
|
|
67
|
+
archivedAt: Date | null;
|
|
68
|
+
window: PublicationWindow;
|
|
69
|
+
visibility: ProductVisibility;
|
|
70
|
+
allowedOrganizationIds: string[];
|
|
71
|
+
minOrderQuantity: number | null;
|
|
72
|
+
returnable: boolean;
|
|
73
|
+
}
|
|
74
|
+
/** A sales channel as the rule needs it: its id and its current content languages. */
|
|
75
|
+
export interface ScopeChannel {
|
|
76
|
+
id: string;
|
|
77
|
+
languages: readonly string[];
|
|
78
|
+
defaultLanguage: string;
|
|
79
|
+
}
|
|
80
|
+
/** Everything that decides a product's effective status, before or after a write. */
|
|
81
|
+
export interface ScopeSnapshot {
|
|
82
|
+
global: ProductGlobalScopeFields;
|
|
83
|
+
channelRows: readonly ProductChannelScopeRecord[];
|
|
84
|
+
languageRows: readonly ProductChannelLanguageScopeRecord[];
|
|
85
|
+
}
|
|
86
|
+
/** `status === 'active'` — the only test of a status value anywhere. */
|
|
87
|
+
export declare function isOn(status: ProductScopeStatus): boolean;
|
|
88
|
+
/** `cl.status ?? c.status ?? global.status`. */
|
|
89
|
+
export declare function effectiveStatus(global: Pick<ProductGlobalScopeFields, 'status'>, channelRow: Pick<ProductChannelScopeRecord, 'status'> | undefined, clRow: Pick<ProductChannelLanguageScopeRecord, 'status'> | undefined): ProductScopeStatus;
|
|
90
|
+
/** The channel's window when it overrides one, else the global window — as a pair (R4). */
|
|
91
|
+
export declare function effectiveWindow(global: Pick<ProductGlobalScopeFields, 'window'>, channelRow: Pick<ProductChannelScopeRecord, 'window'> | undefined): PublicationWindow;
|
|
92
|
+
/** `from ≤ now ≤ until`, to the millisecond; a `null` bound is open (K4). */
|
|
93
|
+
export declare function isInsideWindow(window: PublicationWindow, now: Date): boolean;
|
|
94
|
+
/** The channel's rule when it overrides one, else the global rule — replaced whole, never merged (C4). */
|
|
95
|
+
export declare function effectiveAudience(global: Pick<ProductGlobalScopeFields, 'visibility' | 'allowedOrganizationIds'>, channelRow: Pick<ProductChannelScopeRecord, 'audience'> | undefined): AudienceRule;
|
|
96
|
+
/** Minimum order quantity and the returnable flag in a channel (FR-100). */
|
|
97
|
+
export declare function effectiveOrderRules(global: Pick<ProductGlobalScopeFields, 'minOrderQuantity' | 'returnable'>, channelRow: Pick<ProductChannelScopeRecord, 'minOrderQuantity' | 'returnable'> | undefined): {
|
|
98
|
+
minOrderQuantity: number | null;
|
|
99
|
+
returnable: boolean;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* FR-100, research R26 — `records` with the channel's effective minimum order quantity
|
|
103
|
+
* and returnable flag (`rules`, from `catalogProductAvailabilityPort.effectiveOrderRules`)
|
|
104
|
+
* in place of the global ones, for a seam that judges a basket, an order or a quote
|
|
105
|
+
* line in that channel: the order-minimum rule and the returnable stamp. A record the
|
|
106
|
+
* rules do not name is returned as it is; the input is never mutated. The port's own
|
|
107
|
+
* records keep meaning "global".
|
|
108
|
+
*/
|
|
109
|
+
export declare function withChannelOrderRules<T extends {
|
|
110
|
+
id: string;
|
|
111
|
+
minOrderQuantity: number | null;
|
|
112
|
+
returnable: boolean;
|
|
113
|
+
}>(records: readonly T[], rules: ReadonlyMap<string, {
|
|
114
|
+
minOrderQuantity: number | null;
|
|
115
|
+
returnable: boolean;
|
|
116
|
+
}>): T[];
|
|
117
|
+
export interface ProductAvailabilityInput {
|
|
118
|
+
global: ProductGlobalScopeFields;
|
|
119
|
+
channelRow?: ProductChannelScopeRecord | undefined;
|
|
120
|
+
clRow?: ProductChannelLanguageScopeRecord | undefined;
|
|
121
|
+
/** Membership of the product in `channel`, read through the kernel accessor. */
|
|
122
|
+
isMember: boolean;
|
|
123
|
+
channel: ScopeChannel;
|
|
124
|
+
/** Already resolved by {@link resolveScopeLanguage}. */
|
|
125
|
+
languageCode: string;
|
|
126
|
+
audience: ProductAudience;
|
|
127
|
+
now: Date;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* FR-001 — is the product effectively available at (channel, language) to this
|
|
131
|
+
* audience, now? Not deleted, not archived, a member of the channel, the language
|
|
132
|
+
* offered by the channel, effectively on there, inside its effective window, and
|
|
133
|
+
* admitted by its effective audience rule.
|
|
134
|
+
*
|
|
135
|
+
* Membership and the channel's languages are tested **before** any override is read,
|
|
136
|
+
* which is how orphaned overrides are ignored (FR-015). A row naming another channel
|
|
137
|
+
* or another language is ignored too.
|
|
138
|
+
*
|
|
139
|
+
* Its SQL restatement is `availabilityCondition` in catalog's
|
|
140
|
+
* `product-availability.sql.ts`; a parity test holds the two equal.
|
|
141
|
+
*/
|
|
142
|
+
export declare function isProductEffectivelyAvailable(input: ProductAvailabilityInput): boolean;
|
|
143
|
+
/**
|
|
144
|
+
* The (channel, language) pairs an edit turns on — the completeness gate's subject
|
|
145
|
+
* (R18, N3).
|
|
146
|
+
*
|
|
147
|
+
* **Status only (owner decision M3 → A, 2026-10-22; FR-060).** A pair is returned
|
|
148
|
+
* when the product's effective status there goes from off to on; the window, the
|
|
149
|
+
* audience and archiving are not compared. `channels` is the product's member
|
|
150
|
+
* channels with their languages *after* the write and serves both snapshots, so
|
|
151
|
+
* neither a membership change nor a channel gaining a language produces a pair on
|
|
152
|
+
* its own. Archiving is not a status (spec Session 2026-10-25): setting an archived
|
|
153
|
+
* product `active` turns its pairs on, and a Restore — `archivedAt` alone moving —
|
|
154
|
+
* turns nothing on.
|
|
155
|
+
*/
|
|
156
|
+
export declare function pairsTurningOn(before: ScopeSnapshot, after: ScopeSnapshot, channels: readonly ScopeChannel[]): Array<{
|
|
157
|
+
channelId: string;
|
|
158
|
+
languageCode: string;
|
|
159
|
+
}>;
|
|
160
|
+
/**
|
|
161
|
+
* Which content language "L" a request is in (R7, A-3): the channel's language
|
|
162
|
+
* matching the requested tag case-insensitively, else the first channel language
|
|
163
|
+
* sharing its base language (`pl` ↔ `pl-PL`), else the channel's default. The answer
|
|
164
|
+
* is always spelled as the channel spells it.
|
|
165
|
+
*
|
|
166
|
+
* Not the platform's prose-language resolver: channel content languages are free
|
|
167
|
+
* BCP-47 codes, while the prose resolver normalises to the platform's UI languages.
|
|
168
|
+
*/
|
|
169
|
+
export declare function resolveScopeLanguage(channel: ScopeChannel, requestedTag: string | null | undefined): string;
|
|
170
|
+
export { applyTranslationPatch, effectivePackagingUnitName, sameLanguage, translationAt, translationMapPatchSchema, TRANSLATION_MAP_MAX_LANGUAGES, type TranslationMap, } from './scoped-translations.js';
|
|
171
|
+
/**
|
|
172
|
+
* A channel record as the scope rule reads it. The default language is always
|
|
173
|
+
* one of the languages: a channel whose list is empty, or omits its own
|
|
174
|
+
* default, still offers that default — the language every request on it falls
|
|
175
|
+
* back to. The one home of that normalisation (catalog's availability service
|
|
176
|
+
* and every consumer seam read it from here).
|
|
177
|
+
*/
|
|
178
|
+
export declare function toScopeChannel(channel: {
|
|
179
|
+
id: string;
|
|
180
|
+
languages?: readonly string[] | undefined;
|
|
181
|
+
defaultLanguage: string;
|
|
182
|
+
}): ScopeChannel;
|
|
183
|
+
/**
|
|
184
|
+
* {@link resolveScopeLanguage} over a channel record as a resolver holds it —
|
|
185
|
+
* the scope language L of a buyer request on `channel` that asked in
|
|
186
|
+
* `requestedTag` (the first `Accept-Language` tag, see {@link firstLanguageTag}).
|
|
187
|
+
*/
|
|
188
|
+
export declare function scopeLanguageOf(channel: {
|
|
189
|
+
id: string;
|
|
190
|
+
languages?: readonly string[] | undefined;
|
|
191
|
+
defaultLanguage: string;
|
|
192
|
+
}, requestedTag: string | null | undefined): string;
|
|
193
|
+
/**
|
|
194
|
+
* The first tag of an `Accept-Language` header, without its quality parameter,
|
|
195
|
+
* or `undefined` when the header is absent or empty.
|
|
196
|
+
*/
|
|
197
|
+
export declare function firstLanguageTag(header: string | readonly string[] | undefined): string | undefined;
|
|
198
|
+
/** Where an availability question is asked. */
|
|
199
|
+
export interface ProductAvailabilityScope {
|
|
200
|
+
channelId: string;
|
|
201
|
+
/**
|
|
202
|
+
* Already resolved by {@link resolveScopeLanguage} against this channel, or
|
|
203
|
+
* `null` for the channel's default language — an operator acting for a
|
|
204
|
+
* customer (N2), or a seam that knows no request language.
|
|
205
|
+
*/
|
|
206
|
+
languageCode: string | null;
|
|
207
|
+
audience: ProductAudience;
|
|
208
|
+
/** Default: the time of the call. */
|
|
209
|
+
now?: Date;
|
|
210
|
+
}
|
|
211
|
+
/** A product's availability across one channel, for whole-channel projections. */
|
|
212
|
+
export interface ChannelAvailability {
|
|
213
|
+
/** Channel languages where the effective status is on (member, not archived or deleted). */
|
|
214
|
+
liveLanguages: string[];
|
|
215
|
+
window: PublicationWindow;
|
|
216
|
+
audience: AudienceRule;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Container name: `catalogProductAvailabilityPort`. Owner: `catalog`.
|
|
220
|
+
*
|
|
221
|
+
* The one way another module asks whether a product is available (FR-002). `catalog`
|
|
222
|
+
* is non-deactivatable, so the port is always present. Never asked for an unresolved
|
|
223
|
+
* channel (FR-007): a caller with no channel does not call it.
|
|
224
|
+
*/
|
|
225
|
+
export interface CatalogProductAvailabilityPort {
|
|
226
|
+
/** FR-001 for each id; an id not returned is unavailable for any reason — callers answer one not-found. */
|
|
227
|
+
filterAvailable(productIds: readonly string[], scope: ProductAvailabilityScope): Promise<Set<string>>;
|
|
228
|
+
/** Projection for whole-channel consumers (search documents, sitemap, feeds). Non-members are absent. */
|
|
229
|
+
describeChannelAvailability(productIds: readonly string[], channelId: string): Promise<Map<string, ChannelAvailability>>;
|
|
230
|
+
/**
|
|
231
|
+
* FR-017 — the effective name per id at (channel, language): #384's walk over
|
|
232
|
+
* the channel's overrides, else the storefront's baseline pick. `languageCode`
|
|
233
|
+
* `null` = the channel's default language (an operator, N2).
|
|
234
|
+
*/
|
|
235
|
+
effectiveNames(productIds: readonly string[], scope: {
|
|
236
|
+
channelId: string;
|
|
237
|
+
languageCode: string | null;
|
|
238
|
+
}): Promise<Map<string, string>>;
|
|
239
|
+
/**
|
|
240
|
+
* FR-100 — the effective minimum order quantity and returnable flag in the channel.
|
|
241
|
+
*
|
|
242
|
+
* **Applies no availability** (checkpoint C security review, I8): it answers for
|
|
243
|
+
* every id it is given, whether or not the product is available — or even visible —
|
|
244
|
+
* to anyone in the channel. A buyer-facing caller narrows the ids with
|
|
245
|
+
* {@link filterAvailable} first and never discloses a rule for an id it dropped.
|
|
246
|
+
*/
|
|
247
|
+
effectiveOrderRules(productIds: readonly string[], channelId: string): Promise<Map<string, {
|
|
248
|
+
minOrderQuantity: number | null;
|
|
249
|
+
returnable: boolean;
|
|
250
|
+
}>>;
|
|
251
|
+
}
|
|
252
|
+
/** What an integration writes through {@link CatalogProductScopeWritePort}; only named scopes are touched. */
|
|
253
|
+
export interface ProductScopeWriteInput {
|
|
254
|
+
/** `languageCode: null` = the channel row; `value: null` = use inherited. */
|
|
255
|
+
status?: Array<{
|
|
256
|
+
channelId: string;
|
|
257
|
+
languageCode: string | null;
|
|
258
|
+
value: ProductScopeStatus | null;
|
|
259
|
+
}>;
|
|
260
|
+
/** `channelId: null` = the global window; `value: null` on a channel = use inherited. */
|
|
261
|
+
window?: Array<{
|
|
262
|
+
channelId: string | null;
|
|
263
|
+
value: PublicationWindow | null;
|
|
264
|
+
}>;
|
|
265
|
+
/** `value: null` = use inherited. */
|
|
266
|
+
audience?: Array<{
|
|
267
|
+
channelId: string;
|
|
268
|
+
value: AudienceRule | null;
|
|
269
|
+
}>;
|
|
270
|
+
/** Each field: absent = untouched, `null` = use inherited. */
|
|
271
|
+
orderRules?: Array<{
|
|
272
|
+
channelId: string;
|
|
273
|
+
minOrderQuantity?: number | null;
|
|
274
|
+
returnable?: boolean | null;
|
|
275
|
+
}>;
|
|
276
|
+
urlKeys?: ProductUrlKeyWrite[];
|
|
277
|
+
}
|
|
278
|
+
export interface ProductScopeWriteResult {
|
|
279
|
+
/** One outcome per entry of `urlKeys`, in order. */
|
|
280
|
+
urlKeys: UrlKeyWriteOutcome[];
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Container name: `catalogProductScopeWritePort`. Owner: `catalog` (R17).
|
|
284
|
+
*
|
|
285
|
+
* Scoped writes for imports and connectors. Writes only the scopes named, so writing
|
|
286
|
+
* global values removes no operator override (FR-091); never runs the completeness
|
|
287
|
+
* gate (A-6); never takes over a redirect (FR-093).
|
|
288
|
+
*/
|
|
289
|
+
export interface CatalogProductScopeWritePort {
|
|
290
|
+
applyScopes(productId: string, input: ProductScopeWriteInput, options: {
|
|
291
|
+
source: string;
|
|
292
|
+
}): Promise<ProductScopeWriteResult>;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* What the completeness gate reports missing at a (channel, language) — one
|
|
296
|
+
* vocabulary for the save warning, the `SCOPE_INCOMPLETE` refusal and the scope
|
|
297
|
+
* overview's cells, so they cannot disagree (FR-041, FR-060).
|
|
298
|
+
*/
|
|
299
|
+
export declare const scopeMissingValueSchema: z.ZodUnion<readonly [z.ZodLiteral<"name">, z.ZodLiteral<"urlKey">, z.ZodTemplateLiteral<`attribute:${string}`>]>;
|
|
300
|
+
export type ScopeMissingValue = z.infer<typeof scopeMissingValueSchema>;
|
|
301
|
+
/** §1 — `GET /api/v1/admin/catalog/products/:id/scopes`. */
|
|
302
|
+
export declare const productScopesSchema: z.ZodObject<{
|
|
303
|
+
global: z.ZodObject<{
|
|
304
|
+
status: z.ZodEnum<{
|
|
305
|
+
active: "active";
|
|
306
|
+
inactive: "inactive";
|
|
307
|
+
}>;
|
|
308
|
+
publishFrom: z.ZodNullable<z.ZodString>;
|
|
309
|
+
publishUntil: z.ZodNullable<z.ZodString>;
|
|
310
|
+
visibility: z.ZodEnum<{
|
|
311
|
+
public: "public";
|
|
312
|
+
logged_in_only: "logged_in_only";
|
|
313
|
+
organization_restricted: "organization_restricted";
|
|
314
|
+
}>;
|
|
315
|
+
allowedOrganizationIds: z.ZodArray<z.ZodString>;
|
|
316
|
+
minOrderQuantity: z.ZodNullable<z.ZodNumber>;
|
|
317
|
+
returnable: z.ZodBoolean;
|
|
318
|
+
}, z.core.$strip>;
|
|
319
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
320
|
+
channelId: z.ZodString;
|
|
321
|
+
isMember: z.ZodBoolean;
|
|
322
|
+
languages: z.ZodArray<z.ZodString>;
|
|
323
|
+
status: z.ZodNullable<z.ZodEnum<{
|
|
324
|
+
active: "active";
|
|
325
|
+
inactive: "inactive";
|
|
326
|
+
}>>;
|
|
327
|
+
window: z.ZodNullable<z.ZodObject<{
|
|
328
|
+
from: z.ZodNullable<z.ZodString>;
|
|
329
|
+
until: z.ZodNullable<z.ZodString>;
|
|
330
|
+
}, z.core.$strip>>;
|
|
331
|
+
audience: z.ZodNullable<z.ZodObject<{
|
|
332
|
+
visibility: z.ZodEnum<{
|
|
333
|
+
public: "public";
|
|
334
|
+
logged_in_only: "logged_in_only";
|
|
335
|
+
organization_restricted: "organization_restricted";
|
|
336
|
+
}>;
|
|
337
|
+
allowedOrganizationIds: z.ZodArray<z.ZodString>;
|
|
338
|
+
nonMemberOrganizationIds: z.ZodArray<z.ZodString>;
|
|
339
|
+
}, z.core.$strip>>;
|
|
340
|
+
minOrderQuantity: z.ZodNullable<z.ZodNumber>;
|
|
341
|
+
returnable: z.ZodNullable<z.ZodBoolean>;
|
|
342
|
+
languageStatuses: z.ZodArray<z.ZodObject<{
|
|
343
|
+
languageCode: z.ZodString;
|
|
344
|
+
status: z.ZodEnum<{
|
|
345
|
+
active: "active";
|
|
346
|
+
inactive: "inactive";
|
|
347
|
+
}>;
|
|
348
|
+
orphaned: z.ZodBoolean;
|
|
349
|
+
}, z.core.$strip>>;
|
|
350
|
+
orphaned: z.ZodBoolean;
|
|
351
|
+
}, z.core.$strip>>;
|
|
352
|
+
organizations: z.ZodArray<z.ZodObject<{
|
|
353
|
+
id: z.ZodString;
|
|
354
|
+
name: z.ZodString;
|
|
355
|
+
}, z.core.$strip>>;
|
|
356
|
+
}, z.core.$strip>;
|
|
357
|
+
export type ProductScopes = z.infer<typeof productScopesSchema>;
|
|
358
|
+
export declare const productScopesResponseSchema: z.ZodObject<{
|
|
359
|
+
data: z.ZodObject<{
|
|
360
|
+
global: z.ZodObject<{
|
|
361
|
+
status: z.ZodEnum<{
|
|
362
|
+
active: "active";
|
|
363
|
+
inactive: "inactive";
|
|
364
|
+
}>;
|
|
365
|
+
publishFrom: z.ZodNullable<z.ZodString>;
|
|
366
|
+
publishUntil: z.ZodNullable<z.ZodString>;
|
|
367
|
+
visibility: z.ZodEnum<{
|
|
368
|
+
public: "public";
|
|
369
|
+
logged_in_only: "logged_in_only";
|
|
370
|
+
organization_restricted: "organization_restricted";
|
|
371
|
+
}>;
|
|
372
|
+
allowedOrganizationIds: z.ZodArray<z.ZodString>;
|
|
373
|
+
minOrderQuantity: z.ZodNullable<z.ZodNumber>;
|
|
374
|
+
returnable: z.ZodBoolean;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
377
|
+
channelId: z.ZodString;
|
|
378
|
+
isMember: z.ZodBoolean;
|
|
379
|
+
languages: z.ZodArray<z.ZodString>;
|
|
380
|
+
status: z.ZodNullable<z.ZodEnum<{
|
|
381
|
+
active: "active";
|
|
382
|
+
inactive: "inactive";
|
|
383
|
+
}>>;
|
|
384
|
+
window: z.ZodNullable<z.ZodObject<{
|
|
385
|
+
from: z.ZodNullable<z.ZodString>;
|
|
386
|
+
until: z.ZodNullable<z.ZodString>;
|
|
387
|
+
}, z.core.$strip>>;
|
|
388
|
+
audience: z.ZodNullable<z.ZodObject<{
|
|
389
|
+
visibility: z.ZodEnum<{
|
|
390
|
+
public: "public";
|
|
391
|
+
logged_in_only: "logged_in_only";
|
|
392
|
+
organization_restricted: "organization_restricted";
|
|
393
|
+
}>;
|
|
394
|
+
allowedOrganizationIds: z.ZodArray<z.ZodString>;
|
|
395
|
+
nonMemberOrganizationIds: z.ZodArray<z.ZodString>;
|
|
396
|
+
}, z.core.$strip>>;
|
|
397
|
+
minOrderQuantity: z.ZodNullable<z.ZodNumber>;
|
|
398
|
+
returnable: z.ZodNullable<z.ZodBoolean>;
|
|
399
|
+
languageStatuses: z.ZodArray<z.ZodObject<{
|
|
400
|
+
languageCode: z.ZodString;
|
|
401
|
+
status: z.ZodEnum<{
|
|
402
|
+
active: "active";
|
|
403
|
+
inactive: "inactive";
|
|
404
|
+
}>;
|
|
405
|
+
orphaned: z.ZodBoolean;
|
|
406
|
+
}, z.core.$strip>>;
|
|
407
|
+
orphaned: z.ZodBoolean;
|
|
408
|
+
}, z.core.$strip>>;
|
|
409
|
+
organizations: z.ZodArray<z.ZodObject<{
|
|
410
|
+
id: z.ZodString;
|
|
411
|
+
name: z.ZodString;
|
|
412
|
+
}, z.core.$strip>>;
|
|
413
|
+
}, z.core.$strip>;
|
|
414
|
+
}, z.core.$strip>;
|
|
415
|
+
export type ProductScopesResponse = z.infer<typeof productScopesResponseSchema>;
|
|
416
|
+
/**
|
|
417
|
+
* §2 — `PATCH /api/v1/admin/catalog/products/:id/scopes`. An absent key leaves the
|
|
418
|
+
* value untouched; `null` = use inherited (deletes the override, FR-012). A window
|
|
419
|
+
* whose `from` is not before its `until` passes the schema and is refused by the
|
|
420
|
+
* service with `VALIDATION_FAILED`, `details.field = 'window'`.
|
|
421
|
+
*/
|
|
422
|
+
export declare const patchProductScopesRequestSchema: z.ZodObject<{
|
|
423
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
424
|
+
channelId: z.ZodString;
|
|
425
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
426
|
+
active: "active";
|
|
427
|
+
inactive: "inactive";
|
|
428
|
+
}>>>;
|
|
429
|
+
window: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
430
|
+
from: z.ZodNullable<z.ZodString>;
|
|
431
|
+
until: z.ZodNullable<z.ZodString>;
|
|
432
|
+
}, z.core.$strip>>>;
|
|
433
|
+
audience: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
434
|
+
visibility: z.ZodEnum<{
|
|
435
|
+
public: "public";
|
|
436
|
+
logged_in_only: "logged_in_only";
|
|
437
|
+
organization_restricted: "organization_restricted";
|
|
438
|
+
}>;
|
|
439
|
+
allowedOrganizationIds: z.ZodArray<z.ZodString>;
|
|
440
|
+
}, z.core.$strip>>>;
|
|
441
|
+
minOrderQuantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
442
|
+
returnable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
443
|
+
languageStatuses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
444
|
+
languageCode: z.ZodString;
|
|
445
|
+
status: z.ZodNullable<z.ZodEnum<{
|
|
446
|
+
active: "active";
|
|
447
|
+
inactive: "inactive";
|
|
448
|
+
}>>;
|
|
449
|
+
}, z.core.$strip>>>;
|
|
450
|
+
}, z.core.$strip>>;
|
|
451
|
+
global: z.ZodOptional<z.ZodObject<{
|
|
452
|
+
publishFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
453
|
+
publishUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
454
|
+
}, z.core.$strip>>;
|
|
455
|
+
}, z.core.$strip>;
|
|
456
|
+
export type PatchProductScopesRequest = z.infer<typeof patchProductScopesRequestSchema>;
|
|
457
|
+
export declare const scopeWarningSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
458
|
+
kind: z.ZodLiteral<"completeness">;
|
|
459
|
+
channelId: z.ZodString;
|
|
460
|
+
languageCode: z.ZodString;
|
|
461
|
+
missing: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"name">, z.ZodLiteral<"urlKey">, z.ZodTemplateLiteral<`attribute:${string}`>]>>;
|
|
462
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
463
|
+
kind: z.ZodLiteral<"audience_non_members">;
|
|
464
|
+
channelId: z.ZodString;
|
|
465
|
+
organizationIds: z.ZodArray<z.ZodString>;
|
|
466
|
+
}, z.core.$strip>], "kind">;
|
|
467
|
+
export type ScopeWarning = z.infer<typeof scopeWarningSchema>;
|
|
468
|
+
export declare const patchProductScopesResponseSchema: z.ZodObject<{
|
|
469
|
+
data: z.ZodObject<{
|
|
470
|
+
global: z.ZodObject<{
|
|
471
|
+
status: z.ZodEnum<{
|
|
472
|
+
active: "active";
|
|
473
|
+
inactive: "inactive";
|
|
474
|
+
}>;
|
|
475
|
+
publishFrom: z.ZodNullable<z.ZodString>;
|
|
476
|
+
publishUntil: z.ZodNullable<z.ZodString>;
|
|
477
|
+
visibility: z.ZodEnum<{
|
|
478
|
+
public: "public";
|
|
479
|
+
logged_in_only: "logged_in_only";
|
|
480
|
+
organization_restricted: "organization_restricted";
|
|
481
|
+
}>;
|
|
482
|
+
allowedOrganizationIds: z.ZodArray<z.ZodString>;
|
|
483
|
+
minOrderQuantity: z.ZodNullable<z.ZodNumber>;
|
|
484
|
+
returnable: z.ZodBoolean;
|
|
485
|
+
}, z.core.$strip>;
|
|
486
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
487
|
+
channelId: z.ZodString;
|
|
488
|
+
isMember: z.ZodBoolean;
|
|
489
|
+
languages: z.ZodArray<z.ZodString>;
|
|
490
|
+
status: z.ZodNullable<z.ZodEnum<{
|
|
491
|
+
active: "active";
|
|
492
|
+
inactive: "inactive";
|
|
493
|
+
}>>;
|
|
494
|
+
window: z.ZodNullable<z.ZodObject<{
|
|
495
|
+
from: z.ZodNullable<z.ZodString>;
|
|
496
|
+
until: z.ZodNullable<z.ZodString>;
|
|
497
|
+
}, z.core.$strip>>;
|
|
498
|
+
audience: z.ZodNullable<z.ZodObject<{
|
|
499
|
+
visibility: z.ZodEnum<{
|
|
500
|
+
public: "public";
|
|
501
|
+
logged_in_only: "logged_in_only";
|
|
502
|
+
organization_restricted: "organization_restricted";
|
|
503
|
+
}>;
|
|
504
|
+
allowedOrganizationIds: z.ZodArray<z.ZodString>;
|
|
505
|
+
nonMemberOrganizationIds: z.ZodArray<z.ZodString>;
|
|
506
|
+
}, z.core.$strip>>;
|
|
507
|
+
minOrderQuantity: z.ZodNullable<z.ZodNumber>;
|
|
508
|
+
returnable: z.ZodNullable<z.ZodBoolean>;
|
|
509
|
+
languageStatuses: z.ZodArray<z.ZodObject<{
|
|
510
|
+
languageCode: z.ZodString;
|
|
511
|
+
status: z.ZodEnum<{
|
|
512
|
+
active: "active";
|
|
513
|
+
inactive: "inactive";
|
|
514
|
+
}>;
|
|
515
|
+
orphaned: z.ZodBoolean;
|
|
516
|
+
}, z.core.$strip>>;
|
|
517
|
+
orphaned: z.ZodBoolean;
|
|
518
|
+
}, z.core.$strip>>;
|
|
519
|
+
organizations: z.ZodArray<z.ZodObject<{
|
|
520
|
+
id: z.ZodString;
|
|
521
|
+
name: z.ZodString;
|
|
522
|
+
}, z.core.$strip>>;
|
|
523
|
+
}, z.core.$strip>;
|
|
524
|
+
warnings: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
525
|
+
kind: z.ZodLiteral<"completeness">;
|
|
526
|
+
channelId: z.ZodString;
|
|
527
|
+
languageCode: z.ZodString;
|
|
528
|
+
missing: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"name">, z.ZodLiteral<"urlKey">, z.ZodTemplateLiteral<`attribute:${string}`>]>>;
|
|
529
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
530
|
+
kind: z.ZodLiteral<"audience_non_members">;
|
|
531
|
+
channelId: z.ZodString;
|
|
532
|
+
organizationIds: z.ZodArray<z.ZodString>;
|
|
533
|
+
}, z.core.$strip>], "kind">>;
|
|
534
|
+
}, z.core.$strip>;
|
|
535
|
+
export type PatchProductScopesResponse = z.infer<typeof patchProductScopesResponseSchema>;
|
|
536
|
+
/** `422 SCOPE_INVALID` details (FR-014). */
|
|
537
|
+
export declare const scopeInvalidDetailsSchema: z.ZodObject<{
|
|
538
|
+
channelId: z.ZodString;
|
|
539
|
+
languageCode: z.ZodOptional<z.ZodString>;
|
|
540
|
+
reason: z.ZodEnum<{
|
|
541
|
+
not_a_member: "not_a_member";
|
|
542
|
+
language_not_offered: "language_not_offered";
|
|
543
|
+
}>;
|
|
544
|
+
}, z.core.$strip>;
|
|
545
|
+
export type ScopeInvalidDetails = z.infer<typeof scopeInvalidDetailsSchema>;
|
|
546
|
+
/** `422 SCOPE_INCOMPLETE` details (FR-060). */
|
|
547
|
+
export declare const scopeIncompleteDetailsSchema: z.ZodObject<{
|
|
548
|
+
pairs: z.ZodArray<z.ZodObject<{
|
|
549
|
+
channelId: z.ZodString;
|
|
550
|
+
languageCode: z.ZodString;
|
|
551
|
+
missing: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"name">, z.ZodLiteral<"urlKey">, z.ZodTemplateLiteral<`attribute:${string}`>]>>;
|
|
552
|
+
}, z.core.$strip>>;
|
|
553
|
+
}, z.core.$strip>;
|
|
554
|
+
export type ScopeIncompleteDetails = z.infer<typeof scopeIncompleteDetailsSchema>;
|
|
555
|
+
export declare const scopeLevelSchema: z.ZodEnum<{
|
|
556
|
+
language: "language";
|
|
557
|
+
channel: "channel";
|
|
558
|
+
channel_language: "channel_language";
|
|
559
|
+
}>;
|
|
560
|
+
/** §3 — `GET /api/v1/admin/catalog/products/:id/scope-overview`. */
|
|
561
|
+
export declare const scopeOverviewResponseSchema: z.ZodObject<{
|
|
562
|
+
data: z.ZodObject<{
|
|
563
|
+
channels: z.ZodArray<z.ZodObject<{
|
|
564
|
+
channelId: z.ZodString;
|
|
565
|
+
name: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
566
|
+
isMember: z.ZodBoolean;
|
|
567
|
+
languages: z.ZodArray<z.ZodString>;
|
|
568
|
+
}, z.core.$strip>>;
|
|
569
|
+
languages: z.ZodArray<z.ZodString>;
|
|
570
|
+
cells: z.ZodArray<z.ZodObject<{
|
|
571
|
+
channelId: z.ZodString;
|
|
572
|
+
languageCode: z.ZodString;
|
|
573
|
+
available: z.ZodBoolean;
|
|
574
|
+
effectiveStatus: z.ZodEnum<{
|
|
575
|
+
active: "active";
|
|
576
|
+
inactive: "inactive";
|
|
577
|
+
}>;
|
|
578
|
+
statusSource: z.ZodEnum<{
|
|
579
|
+
channel: "channel";
|
|
580
|
+
global: "global";
|
|
581
|
+
channel_language: "channel_language";
|
|
582
|
+
}>;
|
|
583
|
+
overriddenFields: z.ZodArray<z.ZodObject<{
|
|
584
|
+
field: z.ZodString;
|
|
585
|
+
level: z.ZodEnum<{
|
|
586
|
+
language: "language";
|
|
587
|
+
channel: "channel";
|
|
588
|
+
channel_language: "channel_language";
|
|
589
|
+
}>;
|
|
590
|
+
}, z.core.$strip>>;
|
|
591
|
+
missing: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"name">, z.ZodLiteral<"urlKey">, z.ZodTemplateLiteral<`attribute:${string}`>]>>>;
|
|
592
|
+
}, z.core.$strip>>;
|
|
593
|
+
channelRows: z.ZodArray<z.ZodObject<{
|
|
594
|
+
channelId: z.ZodString;
|
|
595
|
+
overriddenFields: z.ZodArray<z.ZodString>;
|
|
596
|
+
}, z.core.$strip>>;
|
|
597
|
+
languageColumns: z.ZodArray<z.ZodObject<{
|
|
598
|
+
languageCode: z.ZodString;
|
|
599
|
+
overriddenFields: z.ZodArray<z.ZodString>;
|
|
600
|
+
}, z.core.$strip>>;
|
|
601
|
+
orphans: z.ZodArray<z.ZodObject<{
|
|
602
|
+
field: z.ZodString;
|
|
603
|
+
channelId: z.ZodNullable<z.ZodString>;
|
|
604
|
+
languageCode: z.ZodNullable<z.ZodString>;
|
|
605
|
+
reason: z.ZodEnum<{
|
|
606
|
+
not_a_member: "not_a_member";
|
|
607
|
+
language_not_offered: "language_not_offered";
|
|
608
|
+
attribute_scope_changed: "attribute_scope_changed";
|
|
609
|
+
}>;
|
|
610
|
+
}, z.core.$strip>>;
|
|
611
|
+
}, z.core.$strip>;
|
|
612
|
+
}, z.core.$strip>;
|
|
613
|
+
export type ScopeOverviewResponse = z.infer<typeof scopeOverviewResponseSchema>;
|
|
614
|
+
/** §6 — `GET /api/v1/admin/catalog/attributes/:idOrKey/scope-change-preview`. */
|
|
615
|
+
export declare const attributeScopeChangePreviewResponseSchema: z.ZodObject<{
|
|
616
|
+
data: z.ZodObject<{
|
|
617
|
+
orphanedOverrides: z.ZodNumber;
|
|
618
|
+
byChannel: z.ZodArray<z.ZodObject<{
|
|
619
|
+
channelId: z.ZodString;
|
|
620
|
+
count: z.ZodNumber;
|
|
621
|
+
}, z.core.$strip>>;
|
|
622
|
+
}, z.core.$strip>;
|
|
623
|
+
}, z.core.$strip>;
|
|
624
|
+
export type AttributeScopeChangePreviewResponse = z.infer<typeof attributeScopeChangePreviewResponseSchema>;
|
|
625
|
+
/** §5 — the completeness gate's mode (`catalog.scope_completeness_gate`). */
|
|
626
|
+
export declare const SCOPE_COMPLETENESS_GATE_MODES: readonly ["warn", "refuse"];
|
|
627
|
+
export type ScopeCompletenessGateMode = (typeof SCOPE_COMPLETENESS_GATE_MODES)[number];
|
|
628
|
+
//# sourceMappingURL=product-scopes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-scopes.d.ts","sourceRoot":"","sources":["../src/product-scopes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAA2C,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAE7F,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEpF;;;;;;;;;;;;;GAaG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,2BAA8B,CAAC;AAClE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AACzE,eAAO,MAAM,wBAAwB;;;EAAiC,CAAC;AAEvE,sFAAsF;AACtF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB;AAED,sEAAsE;AACtE,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,sBAAsB,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,8EAA8E;AAC9E,MAAM,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