@endora-commerce/contracts 0.100.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/LICENSE +21 -0
- package/README.md +34 -0
- package/dist/actor.d.ts +79 -0
- package/dist/actor.d.ts.map +1 -0
- package/dist/actor.js +41 -0
- package/dist/actor.js.map +1 -0
- package/dist/addresses.d.ts +134 -0
- package/dist/addresses.d.ts.map +1 -0
- package/dist/addresses.js +16 -0
- package/dist/addresses.js.map +1 -0
- package/dist/admin-actions.d.ts +367 -0
- package/dist/admin-actions.d.ts.map +1 -0
- package/dist/admin-actions.js +287 -0
- package/dist/admin-actions.js.map +1 -0
- package/dist/admin-contributions.d.ts +518 -0
- package/dist/admin-contributions.d.ts.map +1 -0
- package/dist/admin-contributions.js +495 -0
- package/dist/admin-contributions.js.map +1 -0
- package/dist/admin-i18n.d.ts +135 -0
- package/dist/admin-i18n.d.ts.map +1 -0
- package/dist/admin-i18n.js +72 -0
- package/dist/admin-i18n.js.map +1 -0
- package/dist/admin-notifications.d.ts +55 -0
- package/dist/admin-notifications.d.ts.map +1 -0
- package/dist/admin-notifications.js +16 -0
- package/dist/admin-notifications.js.map +1 -0
- package/dist/admin-roles.d.ts +125 -0
- package/dist/admin-roles.d.ts.map +1 -0
- package/dist/admin-roles.js +2 -0
- package/dist/admin-roles.js.map +1 -0
- package/dist/admin-users.d.ts +178 -0
- package/dist/admin-users.d.ts.map +1 -0
- package/dist/admin-users.js +14 -0
- package/dist/admin-users.js.map +1 -0
- package/dist/admin.d.ts +243 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +246 -0
- package/dist/admin.js.map +1 -0
- package/dist/analytics.d.ts +123 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.js +68 -0
- package/dist/analytics.js.map +1 -0
- package/dist/api-keys.d.ts +97 -0
- package/dist/api-keys.d.ts.map +1 -0
- package/dist/api-keys.js +64 -0
- package/dist/api-keys.js.map +1 -0
- package/dist/assets-library.d.ts +684 -0
- package/dist/assets-library.d.ts.map +1 -0
- package/dist/assets-library.js +181 -0
- package/dist/assets-library.js.map +1 -0
- package/dist/audit-logs.d.ts +141 -0
- package/dist/audit-logs.d.ts.map +1 -0
- package/dist/audit-logs.js +31 -0
- package/dist/audit-logs.js.map +1 -0
- package/dist/auth.d.ts +174 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +27 -0
- package/dist/auth.js.map +1 -0
- package/dist/blog.d.ts +669 -0
- package/dist/blog.d.ts.map +1 -0
- package/dist/blog.js +360 -0
- package/dist/blog.js.map +1 -0
- package/dist/capabilities.d.ts +40 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +38 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/carts.d.ts +1367 -0
- package/dist/carts.d.ts.map +1 -0
- package/dist/carts.js +405 -0
- package/dist/carts.js.map +1 -0
- package/dist/catalog.d.ts +2855 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +1543 -0
- package/dist/catalog.js.map +1 -0
- package/dist/cms.d.ts +872 -0
- package/dist/cms.d.ts.map +1 -0
- package/dist/cms.js +468 -0
- package/dist/cms.js.map +1 -0
- package/dist/common.d.ts +82 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +72 -0
- package/dist/common.js.map +1 -0
- package/dist/comparisons.d.ts +487 -0
- package/dist/comparisons.d.ts.map +1 -0
- package/dist/comparisons.js +221 -0
- package/dist/comparisons.js.map +1 -0
- package/dist/credentials.d.ts +292 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +142 -0
- package/dist/credentials.js.map +1 -0
- package/dist/credit-limits.d.ts +111 -0
- package/dist/credit-limits.d.ts.map +1 -0
- package/dist/credit-limits.js +35 -0
- package/dist/credit-limits.js.map +1 -0
- package/dist/currencies.d.ts +127 -0
- package/dist/currencies.d.ts.map +1 -0
- package/dist/currencies.js +20 -0
- package/dist/currencies.js.map +1 -0
- package/dist/custom-fields.d.ts +345 -0
- package/dist/custom-fields.d.ts.map +1 -0
- package/dist/custom-fields.js +185 -0
- package/dist/custom-fields.js.map +1 -0
- package/dist/customer-accounts.d.ts +690 -0
- package/dist/customer-accounts.d.ts.map +1 -0
- package/dist/customer-accounts.js +41 -0
- package/dist/customer-accounts.js.map +1 -0
- package/dist/customers.d.ts +305 -0
- package/dist/customers.d.ts.map +1 -0
- package/dist/customers.js +158 -0
- package/dist/customers.js.map +1 -0
- package/dist/dictionary.d.ts +580 -0
- package/dist/dictionary.d.ts.map +1 -0
- package/dist/dictionary.js +297 -0
- package/dist/dictionary.js.map +1 -0
- package/dist/email-address.d.ts +62 -0
- package/dist/email-address.d.ts.map +1 -0
- package/dist/email-address.js +64 -0
- package/dist/email-address.js.map +1 -0
- package/dist/email.d.ts +175 -0
- package/dist/email.d.ts.map +1 -0
- package/dist/email.js +45 -0
- package/dist/email.js.map +1 -0
- package/dist/envelopes.d.ts +15 -0
- package/dist/envelopes.d.ts.map +1 -0
- package/dist/envelopes.js +16 -0
- package/dist/envelopes.js.map +1 -0
- package/dist/environment-inputs.d.ts +306 -0
- package/dist/environment-inputs.d.ts.map +1 -0
- package/dist/environment-inputs.js +277 -0
- package/dist/environment-inputs.js.map +1 -0
- package/dist/erp-connector.d.ts +52 -0
- package/dist/erp-connector.d.ts.map +1 -0
- package/dist/erp-connector.js +34 -0
- package/dist/erp-connector.js.map +1 -0
- package/dist/errors.d.ts +455 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +532 -0
- package/dist/errors.js.map +1 -0
- package/dist/google-analytics.d.ts +181 -0
- package/dist/google-analytics.d.ts.map +1 -0
- package/dist/google-analytics.js +176 -0
- package/dist/google-analytics.js.map +1 -0
- package/dist/google-tag-manager.d.ts +111 -0
- package/dist/google-tag-manager.d.ts.map +1 -0
- package/dist/google-tag-manager.js +129 -0
- package/dist/google-tag-manager.js.map +1 -0
- package/dist/i18n.d.ts +69 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +59 -0
- package/dist/i18n.js.map +1 -0
- package/dist/import-export.d.ts +63 -0
- package/dist/import-export.d.ts.map +1 -0
- package/dist/import-export.js +37 -0
- package/dist/import-export.js.map +1 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +126 -0
- package/dist/index.js.map +1 -0
- package/dist/inventory.d.ts +673 -0
- package/dist/inventory.d.ts.map +1 -0
- package/dist/inventory.js +412 -0
- package/dist/inventory.js.map +1 -0
- package/dist/invoice-ledger.d.ts +366 -0
- package/dist/invoice-ledger.d.ts.map +1 -0
- package/dist/invoice-ledger.js +114 -0
- package/dist/invoice-ledger.js.map +1 -0
- package/dist/invoices.d.ts +845 -0
- package/dist/invoices.d.ts.map +1 -0
- package/dist/invoices.js +314 -0
- package/dist/invoices.js.map +1 -0
- package/dist/kernel.d.ts +49 -0
- package/dist/kernel.d.ts.map +1 -0
- package/dist/kernel.js +19 -0
- package/dist/kernel.js.map +1 -0
- package/dist/languages.d.ts +122 -0
- package/dist/languages.d.ts.map +1 -0
- package/dist/languages.js +24 -0
- package/dist/languages.js.map +1 -0
- package/dist/linkedin-ads.d.ts +167 -0
- package/dist/linkedin-ads.d.ts.map +1 -0
- package/dist/linkedin-ads.js +156 -0
- package/dist/linkedin-ads.js.map +1 -0
- package/dist/megamenu.d.ts +556 -0
- package/dist/megamenu.d.ts.map +1 -0
- package/dist/megamenu.js +186 -0
- package/dist/megamenu.js.map +1 -0
- package/dist/meta-ads.d.ts +126 -0
- package/dist/meta-ads.d.ts.map +1 -0
- package/dist/meta-ads.js +112 -0
- package/dist/meta-ads.js.map +1 -0
- package/dist/mfa.d.ts +274 -0
- package/dist/mfa.d.ts.map +1 -0
- package/dist/mfa.js +187 -0
- package/dist/mfa.js.map +1 -0
- package/dist/modules.d.ts +1706 -0
- package/dist/modules.d.ts.map +1 -0
- package/dist/modules.js +1390 -0
- package/dist/modules.js.map +1 -0
- package/dist/newsletter.d.ts +611 -0
- package/dist/newsletter.d.ts.map +1 -0
- package/dist/newsletter.js +345 -0
- package/dist/newsletter.js.map +1 -0
- package/dist/orders.d.ts +1175 -0
- package/dist/orders.d.ts.map +1 -0
- package/dist/orders.js +630 -0
- package/dist/orders.js.map +1 -0
- package/dist/organizations.d.ts +938 -0
- package/dist/organizations.d.ts.map +1 -0
- package/dist/organizations.js +418 -0
- package/dist/organizations.js.map +1 -0
- package/dist/pagination.d.ts +21 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +22 -0
- package/dist/pagination.js.map +1 -0
- package/dist/payment-methods.d.ts +472 -0
- package/dist/payment-methods.d.ts.map +1 -0
- package/dist/payment-methods.js +175 -0
- package/dist/payment-methods.js.map +1 -0
- package/dist/payment-return-url.d.ts +53 -0
- package/dist/payment-return-url.d.ts.map +1 -0
- package/dist/payment-return-url.js +35 -0
- package/dist/payment-return-url.js.map +1 -0
- package/dist/payments.d.ts +386 -0
- package/dist/payments.d.ts.map +1 -0
- package/dist/payments.js +84 -0
- package/dist/payments.js.map +1 -0
- package/dist/pim-connector.d.ts +60 -0
- package/dist/pim-connector.d.ts.map +1 -0
- package/dist/pim-connector.js +43 -0
- package/dist/pim-connector.js.map +1 -0
- package/dist/pim-field-path.d.ts +6 -0
- package/dist/pim-field-path.d.ts.map +1 -0
- package/dist/pim-field-path.js +101 -0
- package/dist/pim-field-path.js.map +1 -0
- package/dist/platform-language.d.ts +20 -0
- package/dist/platform-language.d.ts.map +1 -0
- package/dist/platform-language.js +22 -0
- package/dist/platform-language.js.map +1 -0
- package/dist/price-lists.d.ts +685 -0
- package/dist/price-lists.d.ts.map +1 -0
- package/dist/price-lists.js +330 -0
- package/dist/price-lists.js.map +1 -0
- package/dist/product-feeds.d.ts +2837 -0
- package/dist/product-feeds.d.ts.map +1 -0
- package/dist/product-feeds.js +1504 -0
- package/dist/product-feeds.js.map +1 -0
- package/dist/product-scope-overrides.d.ts +134 -0
- package/dist/product-scope-overrides.d.ts.map +1 -0
- package/dist/product-scope-overrides.js +82 -0
- package/dist/product-scope-overrides.js.map +1 -0
- package/dist/product-value-resolver.d.ts +88 -0
- package/dist/product-value-resolver.d.ts.map +1 -0
- package/dist/product-value-resolver.js +128 -0
- package/dist/product-value-resolver.js.map +1 -0
- package/dist/promotions.d.ts +678 -0
- package/dist/promotions.d.ts.map +1 -0
- package/dist/promotions.js +479 -0
- package/dist/promotions.js.map +1 -0
- package/dist/prompt-actions.d.ts +582 -0
- package/dist/prompt-actions.d.ts.map +1 -0
- package/dist/prompt-actions.js +221 -0
- package/dist/prompt-actions.js.map +1 -0
- package/dist/pwa.d.ts +293 -0
- package/dist/pwa.d.ts.map +1 -0
- package/dist/pwa.js +204 -0
- package/dist/pwa.js.map +1 -0
- package/dist/quick-order.d.ts +340 -0
- package/dist/quick-order.d.ts.map +1 -0
- package/dist/quick-order.js +177 -0
- package/dist/quick-order.js.map +1 -0
- package/dist/quote-requests.d.ts +538 -0
- package/dist/quote-requests.d.ts.map +1 -0
- package/dist/quote-requests.js +308 -0
- package/dist/quote-requests.js.map +1 -0
- package/dist/returns.d.ts +774 -0
- package/dist/returns.d.ts.map +1 -0
- package/dist/returns.js +389 -0
- package/dist/returns.js.map +1 -0
- package/dist/sales-channels.d.ts +392 -0
- package/dist/sales-channels.d.ts.map +1 -0
- package/dist/sales-channels.js +285 -0
- package/dist/sales-channels.js.map +1 -0
- package/dist/scope-notice.d.ts +60 -0
- package/dist/scope-notice.d.ts.map +1 -0
- package/dist/scope-notice.js +56 -0
- package/dist/scope-notice.js.map +1 -0
- package/dist/search.d.ts +321 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +160 -0
- package/dist/search.js.map +1 -0
- package/dist/seo.d.ts +113 -0
- package/dist/seo.d.ts.map +1 -0
- package/dist/seo.js +63 -0
- package/dist/seo.js.map +1 -0
- package/dist/settings.d.ts +453 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +337 -0
- package/dist/settings.js.map +1 -0
- package/dist/shipments.d.ts +140 -0
- package/dist/shipments.d.ts.map +1 -0
- package/dist/shipments.js +14 -0
- package/dist/shipments.js.map +1 -0
- package/dist/shipping-methods.d.ts +350 -0
- package/dist/shipping-methods.d.ts.map +1 -0
- package/dist/shipping-methods.js +99 -0
- package/dist/shipping-methods.js.map +1 -0
- package/dist/shopping-lists.d.ts +122 -0
- package/dist/shopping-lists.d.ts.map +1 -0
- package/dist/shopping-lists.js +92 -0
- package/dist/shopping-lists.js.map +1 -0
- package/dist/taxes.d.ts +106 -0
- package/dist/taxes.d.ts.map +1 -0
- package/dist/taxes.js +80 -0
- package/dist/taxes.js.map +1 -0
- package/dist/text-normalization.d.ts +199 -0
- package/dist/text-normalization.d.ts.map +1 -0
- package/dist/text-normalization.js +205 -0
- package/dist/text-normalization.js.map +1 -0
- package/dist/transactional-emails.d.ts +459 -0
- package/dist/transactional-emails.d.ts.map +1 -0
- package/dist/transactional-emails.js +212 -0
- package/dist/transactional-emails.js.map +1 -0
- package/dist/webhooks.d.ts +69 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +53 -0
- package/dist/webhooks.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const REGIONS: readonly ["Africa", "Americas", "Asia", "Europe", "Oceania", "Antarctic"];
|
|
3
|
+
export declare const regionSchema: z.ZodEnum<{
|
|
4
|
+
Africa: "Africa";
|
|
5
|
+
Americas: "Americas";
|
|
6
|
+
Asia: "Asia";
|
|
7
|
+
Europe: "Europe";
|
|
8
|
+
Oceania: "Oceania";
|
|
9
|
+
Antarctic: "Antarctic";
|
|
10
|
+
}>;
|
|
11
|
+
export type Region = z.infer<typeof regionSchema>;
|
|
12
|
+
export declare const symbolPositionSchema: z.ZodEnum<{
|
|
13
|
+
prefix: "prefix";
|
|
14
|
+
suffix: "suffix";
|
|
15
|
+
}>;
|
|
16
|
+
export type SymbolPosition = z.infer<typeof symbolPositionSchema>;
|
|
17
|
+
export declare const dictionaryEntryTypeSchema: z.ZodEnum<{
|
|
18
|
+
language: "language";
|
|
19
|
+
currency: "currency";
|
|
20
|
+
country: "country";
|
|
21
|
+
}>;
|
|
22
|
+
export type DictionaryEntryType = z.infer<typeof dictionaryEntryTypeSchema>;
|
|
23
|
+
export declare const countrySchema: z.ZodObject<{
|
|
24
|
+
code: z.ZodString;
|
|
25
|
+
alpha3Code: z.ZodString;
|
|
26
|
+
numericCode: z.ZodString;
|
|
27
|
+
label: z.ZodString;
|
|
28
|
+
region: z.ZodEnum<{
|
|
29
|
+
Africa: "Africa";
|
|
30
|
+
Americas: "Americas";
|
|
31
|
+
Asia: "Asia";
|
|
32
|
+
Europe: "Europe";
|
|
33
|
+
Oceania: "Oceania";
|
|
34
|
+
Antarctic: "Antarctic";
|
|
35
|
+
}>;
|
|
36
|
+
subregion: z.ZodNullable<z.ZodString>;
|
|
37
|
+
dialCode: z.ZodNullable<z.ZodString>;
|
|
38
|
+
isEuMember: z.ZodBoolean;
|
|
39
|
+
defaultCurrencyCode: z.ZodNullable<z.ZodString>;
|
|
40
|
+
isActive: z.ZodBoolean;
|
|
41
|
+
isDefault: z.ZodBoolean;
|
|
42
|
+
sortOrder: z.ZodNumber;
|
|
43
|
+
createdAt: z.ZodString;
|
|
44
|
+
updatedAt: z.ZodString;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export type Country = z.infer<typeof countrySchema>;
|
|
47
|
+
export declare const createCountryRequestSchema: z.ZodObject<{
|
|
48
|
+
code: z.ZodString;
|
|
49
|
+
alpha3Code: z.ZodString;
|
|
50
|
+
numericCode: z.ZodString;
|
|
51
|
+
label: z.ZodString;
|
|
52
|
+
region: z.ZodEnum<{
|
|
53
|
+
Africa: "Africa";
|
|
54
|
+
Americas: "Americas";
|
|
55
|
+
Asia: "Asia";
|
|
56
|
+
Europe: "Europe";
|
|
57
|
+
Oceania: "Oceania";
|
|
58
|
+
Antarctic: "Antarctic";
|
|
59
|
+
}>;
|
|
60
|
+
subregion: z.ZodOptional<z.ZodString>;
|
|
61
|
+
dialCode: z.ZodOptional<z.ZodString>;
|
|
62
|
+
isEuMember: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
defaultCurrencyCode: z.ZodOptional<z.ZodString>;
|
|
64
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export type CreateCountryRequest = z.infer<typeof createCountryRequestSchema>;
|
|
68
|
+
export declare const updateCountryRequestSchema: z.ZodObject<{
|
|
69
|
+
alpha3Code: z.ZodOptional<z.ZodString>;
|
|
70
|
+
numericCode: z.ZodOptional<z.ZodString>;
|
|
71
|
+
label: z.ZodOptional<z.ZodString>;
|
|
72
|
+
region: z.ZodOptional<z.ZodEnum<{
|
|
73
|
+
Africa: "Africa";
|
|
74
|
+
Americas: "Americas";
|
|
75
|
+
Asia: "Asia";
|
|
76
|
+
Europe: "Europe";
|
|
77
|
+
Oceania: "Oceania";
|
|
78
|
+
Antarctic: "Antarctic";
|
|
79
|
+
}>>;
|
|
80
|
+
subregion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
81
|
+
dialCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
82
|
+
isEuMember: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
defaultCurrencyCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
export type UpdateCountryRequest = z.infer<typeof updateCountryRequestSchema>;
|
|
88
|
+
export declare const dictionaryCurrencySchema: z.ZodObject<{
|
|
89
|
+
code: z.ZodString;
|
|
90
|
+
label: z.ZodString;
|
|
91
|
+
symbol: z.ZodString;
|
|
92
|
+
symbolPosition: z.ZodEnum<{
|
|
93
|
+
prefix: "prefix";
|
|
94
|
+
suffix: "suffix";
|
|
95
|
+
}>;
|
|
96
|
+
decimalPlaces: z.ZodNumber;
|
|
97
|
+
isDefault: z.ZodBoolean;
|
|
98
|
+
isActive: z.ZodBoolean;
|
|
99
|
+
sortOrder: z.ZodNumber;
|
|
100
|
+
createdAt: z.ZodString;
|
|
101
|
+
updatedAt: z.ZodString;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export type DictionaryCurrency = z.infer<typeof dictionaryCurrencySchema>;
|
|
104
|
+
export declare const createDictionaryCurrencyRequestSchema: z.ZodObject<{
|
|
105
|
+
code: z.ZodString;
|
|
106
|
+
label: z.ZodString;
|
|
107
|
+
symbol: z.ZodString;
|
|
108
|
+
symbolPosition: z.ZodOptional<z.ZodEnum<{
|
|
109
|
+
prefix: "prefix";
|
|
110
|
+
suffix: "suffix";
|
|
111
|
+
}>>;
|
|
112
|
+
decimalPlaces: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
export type CreateDictionaryCurrencyRequest = z.infer<typeof createDictionaryCurrencyRequestSchema>;
|
|
117
|
+
export declare const updateDictionaryCurrencyRequestSchema: z.ZodObject<{
|
|
118
|
+
label: z.ZodOptional<z.ZodString>;
|
|
119
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
120
|
+
symbolPosition: z.ZodOptional<z.ZodEnum<{
|
|
121
|
+
prefix: "prefix";
|
|
122
|
+
suffix: "suffix";
|
|
123
|
+
}>>;
|
|
124
|
+
decimalPlaces: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
export type UpdateDictionaryCurrencyRequest = z.infer<typeof updateDictionaryCurrencyRequestSchema>;
|
|
129
|
+
export declare const dictionaryLanguageSchema: z.ZodObject<{
|
|
130
|
+
code: z.ZodString;
|
|
131
|
+
label: z.ZodString;
|
|
132
|
+
nativeLabel: z.ZodString;
|
|
133
|
+
isRtl: z.ZodBoolean;
|
|
134
|
+
fallbackCode: z.ZodNullable<z.ZodString>;
|
|
135
|
+
isDefault: z.ZodBoolean;
|
|
136
|
+
isActive: z.ZodBoolean;
|
|
137
|
+
sortOrder: z.ZodNumber;
|
|
138
|
+
countries: z.ZodArray<z.ZodString>;
|
|
139
|
+
createdAt: z.ZodString;
|
|
140
|
+
updatedAt: z.ZodString;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
export type DictionaryLanguage = z.infer<typeof dictionaryLanguageSchema>;
|
|
143
|
+
export declare const createDictionaryLanguageRequestSchema: z.ZodObject<{
|
|
144
|
+
code: z.ZodString;
|
|
145
|
+
label: z.ZodString;
|
|
146
|
+
nativeLabel: z.ZodString;
|
|
147
|
+
isRtl: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
fallbackCode: z.ZodOptional<z.ZodString>;
|
|
149
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
}, z.core.$strip>;
|
|
152
|
+
export type CreateDictionaryLanguageRequest = z.infer<typeof createDictionaryLanguageRequestSchema>;
|
|
153
|
+
export declare const updateDictionaryLanguageRequestSchema: z.ZodObject<{
|
|
154
|
+
label: z.ZodOptional<z.ZodString>;
|
|
155
|
+
nativeLabel: z.ZodOptional<z.ZodString>;
|
|
156
|
+
isRtl: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
+
fallbackCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
158
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
159
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
export type UpdateDictionaryLanguageRequest = z.infer<typeof updateDictionaryLanguageRequestSchema>;
|
|
162
|
+
export declare const dictionaryTranslationSchema: z.ZodObject<{
|
|
163
|
+
entryType: z.ZodEnum<{
|
|
164
|
+
language: "language";
|
|
165
|
+
currency: "currency";
|
|
166
|
+
country: "country";
|
|
167
|
+
}>;
|
|
168
|
+
entryCode: z.ZodString;
|
|
169
|
+
languageCode: z.ZodString;
|
|
170
|
+
label: z.ZodString;
|
|
171
|
+
createdAt: z.ZodString;
|
|
172
|
+
updatedAt: z.ZodString;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
export type DictionaryTranslation = z.infer<typeof dictionaryTranslationSchema>;
|
|
175
|
+
export declare const upsertTranslationRequestSchema: z.ZodObject<{
|
|
176
|
+
label: z.ZodString;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
export type UpsertTranslationRequest = z.infer<typeof upsertTranslationRequestSchema>;
|
|
179
|
+
export declare const languageCountrySchema: z.ZodObject<{
|
|
180
|
+
languageCode: z.ZodString;
|
|
181
|
+
countryCode: z.ZodString;
|
|
182
|
+
isPrimary: z.ZodBoolean;
|
|
183
|
+
createdAt: z.ZodString;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
export type LanguageCountry = z.infer<typeof languageCountrySchema>;
|
|
186
|
+
export declare const upsertLanguageCountryRequestSchema: z.ZodObject<{
|
|
187
|
+
isPrimary: z.ZodOptional<z.ZodBoolean>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
export type UpsertLanguageCountryRequest = z.infer<typeof upsertLanguageCountryRequestSchema>;
|
|
190
|
+
export declare const dictionaryCountriesPageResponseSchema: z.ZodObject<{
|
|
191
|
+
data: z.ZodArray<z.ZodObject<{
|
|
192
|
+
code: z.ZodString;
|
|
193
|
+
alpha3Code: z.ZodString;
|
|
194
|
+
numericCode: z.ZodString;
|
|
195
|
+
label: z.ZodString;
|
|
196
|
+
region: z.ZodEnum<{
|
|
197
|
+
Africa: "Africa";
|
|
198
|
+
Americas: "Americas";
|
|
199
|
+
Asia: "Asia";
|
|
200
|
+
Europe: "Europe";
|
|
201
|
+
Oceania: "Oceania";
|
|
202
|
+
Antarctic: "Antarctic";
|
|
203
|
+
}>;
|
|
204
|
+
subregion: z.ZodNullable<z.ZodString>;
|
|
205
|
+
dialCode: z.ZodNullable<z.ZodString>;
|
|
206
|
+
isEuMember: z.ZodBoolean;
|
|
207
|
+
defaultCurrencyCode: z.ZodNullable<z.ZodString>;
|
|
208
|
+
isActive: z.ZodBoolean;
|
|
209
|
+
isDefault: z.ZodBoolean;
|
|
210
|
+
sortOrder: z.ZodNumber;
|
|
211
|
+
createdAt: z.ZodString;
|
|
212
|
+
updatedAt: z.ZodString;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
pagination: z.ZodObject<{
|
|
215
|
+
page: z.ZodNumber;
|
|
216
|
+
pageSize: z.ZodNumber;
|
|
217
|
+
total: z.ZodNumber;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
export type DictionaryCountriesPageResponse = z.infer<typeof dictionaryCountriesPageResponseSchema>;
|
|
221
|
+
export declare const dictionaryCurrenciesPageResponseSchema: z.ZodObject<{
|
|
222
|
+
data: z.ZodArray<z.ZodObject<{
|
|
223
|
+
code: z.ZodString;
|
|
224
|
+
label: z.ZodString;
|
|
225
|
+
symbol: z.ZodString;
|
|
226
|
+
symbolPosition: z.ZodEnum<{
|
|
227
|
+
prefix: "prefix";
|
|
228
|
+
suffix: "suffix";
|
|
229
|
+
}>;
|
|
230
|
+
decimalPlaces: z.ZodNumber;
|
|
231
|
+
isDefault: z.ZodBoolean;
|
|
232
|
+
isActive: z.ZodBoolean;
|
|
233
|
+
sortOrder: z.ZodNumber;
|
|
234
|
+
createdAt: z.ZodString;
|
|
235
|
+
updatedAt: z.ZodString;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
pagination: z.ZodObject<{
|
|
238
|
+
page: z.ZodNumber;
|
|
239
|
+
pageSize: z.ZodNumber;
|
|
240
|
+
total: z.ZodNumber;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
}, z.core.$strip>;
|
|
243
|
+
export type DictionaryCurrenciesPageResponse = z.infer<typeof dictionaryCurrenciesPageResponseSchema>;
|
|
244
|
+
export declare const dictionaryLanguagesPageResponseSchema: z.ZodObject<{
|
|
245
|
+
data: z.ZodArray<z.ZodObject<{
|
|
246
|
+
code: z.ZodString;
|
|
247
|
+
label: z.ZodString;
|
|
248
|
+
nativeLabel: z.ZodString;
|
|
249
|
+
isRtl: z.ZodBoolean;
|
|
250
|
+
fallbackCode: z.ZodNullable<z.ZodString>;
|
|
251
|
+
isDefault: z.ZodBoolean;
|
|
252
|
+
isActive: z.ZodBoolean;
|
|
253
|
+
sortOrder: z.ZodNumber;
|
|
254
|
+
countries: z.ZodArray<z.ZodString>;
|
|
255
|
+
createdAt: z.ZodString;
|
|
256
|
+
updatedAt: z.ZodString;
|
|
257
|
+
}, z.core.$strip>>;
|
|
258
|
+
pagination: z.ZodObject<{
|
|
259
|
+
page: z.ZodNumber;
|
|
260
|
+
pageSize: z.ZodNumber;
|
|
261
|
+
total: z.ZodNumber;
|
|
262
|
+
}, z.core.$strip>;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
export type DictionaryLanguagesPageResponse = z.infer<typeof dictionaryLanguagesPageResponseSchema>;
|
|
265
|
+
export declare const resolvedCountrySchema: z.ZodObject<{
|
|
266
|
+
code: z.ZodString;
|
|
267
|
+
label: z.ZodString;
|
|
268
|
+
alpha3Code: z.ZodString;
|
|
269
|
+
numericCode: z.ZodString;
|
|
270
|
+
region: z.ZodEnum<{
|
|
271
|
+
Africa: "Africa";
|
|
272
|
+
Americas: "Americas";
|
|
273
|
+
Asia: "Asia";
|
|
274
|
+
Europe: "Europe";
|
|
275
|
+
Oceania: "Oceania";
|
|
276
|
+
Antarctic: "Antarctic";
|
|
277
|
+
}>;
|
|
278
|
+
subregion: z.ZodNullable<z.ZodString>;
|
|
279
|
+
dialCode: z.ZodNullable<z.ZodString>;
|
|
280
|
+
isEuMember: z.ZodBoolean;
|
|
281
|
+
defaultCurrencyCode: z.ZodNullable<z.ZodString>;
|
|
282
|
+
sortOrder: z.ZodNumber;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
export type ResolvedCountry = z.infer<typeof resolvedCountrySchema>;
|
|
285
|
+
export declare const resolvedCurrencySchema: z.ZodObject<{
|
|
286
|
+
code: z.ZodString;
|
|
287
|
+
label: z.ZodString;
|
|
288
|
+
symbol: z.ZodString;
|
|
289
|
+
symbolPosition: z.ZodEnum<{
|
|
290
|
+
prefix: "prefix";
|
|
291
|
+
suffix: "suffix";
|
|
292
|
+
}>;
|
|
293
|
+
decimalPlaces: z.ZodNumber;
|
|
294
|
+
sortOrder: z.ZodNumber;
|
|
295
|
+
}, z.core.$strip>;
|
|
296
|
+
export type ResolvedCurrency = z.infer<typeof resolvedCurrencySchema>;
|
|
297
|
+
export declare const resolvedLanguageSchema: z.ZodObject<{
|
|
298
|
+
code: z.ZodString;
|
|
299
|
+
label: z.ZodString;
|
|
300
|
+
nativeLabel: z.ZodString;
|
|
301
|
+
isRtl: z.ZodBoolean;
|
|
302
|
+
fallbackCode: z.ZodNullable<z.ZodString>;
|
|
303
|
+
countries: z.ZodArray<z.ZodString>;
|
|
304
|
+
sortOrder: z.ZodNumber;
|
|
305
|
+
}, z.core.$strip>;
|
|
306
|
+
export type ResolvedLanguage = z.infer<typeof resolvedLanguageSchema>;
|
|
307
|
+
export declare const dictionaryRegistryResponseSchema: z.ZodObject<{
|
|
308
|
+
data: z.ZodObject<{
|
|
309
|
+
countries: z.ZodArray<z.ZodObject<{
|
|
310
|
+
code: z.ZodString;
|
|
311
|
+
label: z.ZodString;
|
|
312
|
+
alpha3Code: z.ZodString;
|
|
313
|
+
numericCode: z.ZodString;
|
|
314
|
+
region: z.ZodEnum<{
|
|
315
|
+
Africa: "Africa";
|
|
316
|
+
Americas: "Americas";
|
|
317
|
+
Asia: "Asia";
|
|
318
|
+
Europe: "Europe";
|
|
319
|
+
Oceania: "Oceania";
|
|
320
|
+
Antarctic: "Antarctic";
|
|
321
|
+
}>;
|
|
322
|
+
subregion: z.ZodNullable<z.ZodString>;
|
|
323
|
+
dialCode: z.ZodNullable<z.ZodString>;
|
|
324
|
+
isEuMember: z.ZodBoolean;
|
|
325
|
+
defaultCurrencyCode: z.ZodNullable<z.ZodString>;
|
|
326
|
+
sortOrder: z.ZodNumber;
|
|
327
|
+
}, z.core.$strip>>;
|
|
328
|
+
currencies: z.ZodArray<z.ZodObject<{
|
|
329
|
+
code: z.ZodString;
|
|
330
|
+
label: z.ZodString;
|
|
331
|
+
symbol: z.ZodString;
|
|
332
|
+
symbolPosition: z.ZodEnum<{
|
|
333
|
+
prefix: "prefix";
|
|
334
|
+
suffix: "suffix";
|
|
335
|
+
}>;
|
|
336
|
+
decimalPlaces: z.ZodNumber;
|
|
337
|
+
sortOrder: z.ZodNumber;
|
|
338
|
+
}, z.core.$strip>>;
|
|
339
|
+
languages: z.ZodArray<z.ZodObject<{
|
|
340
|
+
code: z.ZodString;
|
|
341
|
+
label: z.ZodString;
|
|
342
|
+
nativeLabel: z.ZodString;
|
|
343
|
+
isRtl: z.ZodBoolean;
|
|
344
|
+
fallbackCode: z.ZodNullable<z.ZodString>;
|
|
345
|
+
countries: z.ZodArray<z.ZodString>;
|
|
346
|
+
sortOrder: z.ZodNumber;
|
|
347
|
+
}, z.core.$strip>>;
|
|
348
|
+
defaults: z.ZodObject<{
|
|
349
|
+
country: z.ZodNullable<z.ZodString>;
|
|
350
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
351
|
+
language: z.ZodNullable<z.ZodString>;
|
|
352
|
+
}, z.core.$strip>;
|
|
353
|
+
}, z.core.$strip>;
|
|
354
|
+
}, z.core.$strip>;
|
|
355
|
+
export type DictionaryRegistryResponse = z.infer<typeof dictionaryRegistryResponseSchema>;
|
|
356
|
+
export declare const dictionaryByCodeResponseSchema: z.ZodObject<{
|
|
357
|
+
data: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
358
|
+
entryType: z.ZodLiteral<"country">;
|
|
359
|
+
entry: z.ZodObject<{
|
|
360
|
+
code: z.ZodString;
|
|
361
|
+
label: z.ZodString;
|
|
362
|
+
alpha3Code: z.ZodString;
|
|
363
|
+
numericCode: z.ZodString;
|
|
364
|
+
region: z.ZodEnum<{
|
|
365
|
+
Africa: "Africa";
|
|
366
|
+
Americas: "Americas";
|
|
367
|
+
Asia: "Asia";
|
|
368
|
+
Europe: "Europe";
|
|
369
|
+
Oceania: "Oceania";
|
|
370
|
+
Antarctic: "Antarctic";
|
|
371
|
+
}>;
|
|
372
|
+
subregion: z.ZodNullable<z.ZodString>;
|
|
373
|
+
dialCode: z.ZodNullable<z.ZodString>;
|
|
374
|
+
isEuMember: z.ZodBoolean;
|
|
375
|
+
defaultCurrencyCode: z.ZodNullable<z.ZodString>;
|
|
376
|
+
sortOrder: z.ZodNumber;
|
|
377
|
+
isActive: z.ZodBoolean;
|
|
378
|
+
}, z.core.$strip>;
|
|
379
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
380
|
+
entryType: z.ZodLiteral<"currency">;
|
|
381
|
+
entry: z.ZodObject<{
|
|
382
|
+
code: z.ZodString;
|
|
383
|
+
label: z.ZodString;
|
|
384
|
+
symbol: z.ZodString;
|
|
385
|
+
symbolPosition: z.ZodEnum<{
|
|
386
|
+
prefix: "prefix";
|
|
387
|
+
suffix: "suffix";
|
|
388
|
+
}>;
|
|
389
|
+
decimalPlaces: z.ZodNumber;
|
|
390
|
+
sortOrder: z.ZodNumber;
|
|
391
|
+
isActive: z.ZodBoolean;
|
|
392
|
+
}, z.core.$strip>;
|
|
393
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
394
|
+
entryType: z.ZodLiteral<"language">;
|
|
395
|
+
entry: z.ZodObject<{
|
|
396
|
+
code: z.ZodString;
|
|
397
|
+
label: z.ZodString;
|
|
398
|
+
nativeLabel: z.ZodString;
|
|
399
|
+
isRtl: z.ZodBoolean;
|
|
400
|
+
fallbackCode: z.ZodNullable<z.ZodString>;
|
|
401
|
+
countries: z.ZodArray<z.ZodString>;
|
|
402
|
+
sortOrder: z.ZodNumber;
|
|
403
|
+
isActive: z.ZodBoolean;
|
|
404
|
+
}, z.core.$strip>;
|
|
405
|
+
}, z.core.$strip>], "entryType">;
|
|
406
|
+
}, z.core.$strip>;
|
|
407
|
+
export type DictionaryByCodeResponse = z.infer<typeof dictionaryByCodeResponseSchema>;
|
|
408
|
+
/**
|
|
409
|
+
* Write-mode dispatch for the DictionaryValidator port.
|
|
410
|
+
*
|
|
411
|
+
* - `create-or-change`: a new write OR an update that changes the field.
|
|
412
|
+
* Both existence and active-status are required.
|
|
413
|
+
* - `unchanged`: an update that does NOT change the field. Existence is
|
|
414
|
+
* required, active-status is NOT enforced — covers FR-016 (stored
|
|
415
|
+
* references that go inactive must remain readable).
|
|
416
|
+
*/
|
|
417
|
+
export type DictionaryWriteMode = 'create-or-change' | 'unchanged';
|
|
418
|
+
/**
|
|
419
|
+
* Container name: `dictionaryValidator`. Owner: `dictionaries`.
|
|
420
|
+
*
|
|
421
|
+
* Consumed by every module that accepts a country/currency/language reference
|
|
422
|
+
* on a write path — nine of them today, which is why the shape is declared
|
|
423
|
+
* here rather than in each of them: a consumer names this type and the
|
|
424
|
+
* container, never a file under `dictionaries` (Principle I).
|
|
425
|
+
*
|
|
426
|
+
* The wording used to say "wired via the composition root — consumer modules
|
|
427
|
+
* accept this port via plugin options". That stopped being true when the
|
|
428
|
+
* modules were composed by the kernel container (feature 072): the owner
|
|
429
|
+
* registers the name with `ctx.di.providePort` and each consumer resolves it
|
|
430
|
+
* with `lazyPort`.
|
|
431
|
+
*
|
|
432
|
+
* **Owner off:** the seam fails closed — resolving the port throws
|
|
433
|
+
* `ModuleDisabledError` and the call answers 503 `MODULE_DISABLED`, so a write
|
|
434
|
+
* that cannot have its country code checked is refused rather than accepted
|
|
435
|
+
* unchecked. Whether `dictionaries` has an off state at all is its manifest's
|
|
436
|
+
* `activation` to say, not this line's.
|
|
437
|
+
*/
|
|
438
|
+
export interface DictionaryValidator {
|
|
439
|
+
validateCountryCode(code: string, mode: DictionaryWriteMode): Promise<void>;
|
|
440
|
+
validateCurrencyCode(code: string, mode: DictionaryWriteMode): Promise<void>;
|
|
441
|
+
validateLanguageCode(code: string, mode: DictionaryWriteMode): Promise<void>;
|
|
442
|
+
/** Clear the in-process LRU. Called by every Dictionary write path. */
|
|
443
|
+
invalidate(): void;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Typed error thrown by the validator. Consumer modules' HTTP error handlers
|
|
447
|
+
* translate this into a 409 envelope per contracts/dictionary-validation.contract.md.
|
|
448
|
+
*/
|
|
449
|
+
export declare class DictionaryReferenceError extends Error {
|
|
450
|
+
readonly code: 'DICTIONARY_ENTRY_NOT_FOUND' | 'DICTIONARY_ENTRY_INACTIVE';
|
|
451
|
+
readonly entryType: DictionaryEntryType;
|
|
452
|
+
readonly entryCode: string;
|
|
453
|
+
constructor(args: {
|
|
454
|
+
code: 'DICTIONARY_ENTRY_NOT_FOUND' | 'DICTIONARY_ENTRY_INACTIVE';
|
|
455
|
+
entryType: DictionaryEntryType;
|
|
456
|
+
entryCode: string;
|
|
457
|
+
message?: string;
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Decide which write mode a dictionary-referencing field is being validated
|
|
462
|
+
* under: `create-or-change` when the field is new or its value moved,
|
|
463
|
+
* `unchanged` when it did not.
|
|
464
|
+
*
|
|
465
|
+
* Relocated here from `dictionaries/services/dispatch-validator-mode.ts`
|
|
466
|
+
* (feature 075, Phase P) and published as a **function, not a port** — which
|
|
467
|
+
* contradicts `contracts/port-publication.md` §1.5, and the code is why. That
|
|
468
|
+
* section cites this file as the worked example of "yes, it reads state the
|
|
469
|
+
* module owns, so make it a port"; it reads nothing. It is three comparisons
|
|
470
|
+
* over its two arguments, and switching `dictionaries` off cannot change the
|
|
471
|
+
* answer, so a gated port would answer 503 to a question about two strings the
|
|
472
|
+
* caller already holds (FR-013).
|
|
473
|
+
*
|
|
474
|
+
* Five modules call it — `addresses`, `inventory`, `promotions`,
|
|
475
|
+
* `sales_channels` and `taxes` — immediately before calling the validator
|
|
476
|
+
* port, which *is* gated and *does* read state. Splitting the pure decision
|
|
477
|
+
* from the stateful validation is what lets the second fail closed without the
|
|
478
|
+
* first inventing a mode.
|
|
479
|
+
*/
|
|
480
|
+
export declare function dispatchValidatorMode(currentValue: string | null | undefined, incomingValue: string | null | undefined): DictionaryWriteMode;
|
|
481
|
+
/**
|
|
482
|
+
* One consumer's answer about one dictionary code.
|
|
483
|
+
*
|
|
484
|
+
* The four descriptive fields are what the operator sees in the orphan report,
|
|
485
|
+
* and `ownerModuleId` is what attributes a refused delete to a module.
|
|
486
|
+
*/
|
|
487
|
+
export interface DictionaryReference {
|
|
488
|
+
ownerModuleId: string;
|
|
489
|
+
/** Operator-facing name of the consuming surface, e.g. `blog`. */
|
|
490
|
+
consumer: string;
|
|
491
|
+
/** The consumer's own table holding the reference. */
|
|
492
|
+
tableName: string;
|
|
493
|
+
/** The column, or the JSON path inside it, e.g. `registered_address.country`. */
|
|
494
|
+
columnName: string;
|
|
495
|
+
code: string;
|
|
496
|
+
count: number;
|
|
497
|
+
/**
|
|
498
|
+
* Whether this reference refuses the delete.
|
|
499
|
+
*
|
|
500
|
+
* `false` where the consumer's own foreign key clears the value instead
|
|
501
|
+
* (`on delete set null`) — the reference is still reported, because an
|
|
502
|
+
* operator about to blank a column wants to know, but it does not block.
|
|
503
|
+
* The decision belongs to the module that owns the referencing table, which
|
|
504
|
+
* is why it travels on the descriptor rather than in a caller's exception
|
|
505
|
+
* list.
|
|
506
|
+
*/
|
|
507
|
+
blocking: boolean;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* One contributed "who points at this dictionary entry" scanner.
|
|
511
|
+
*
|
|
512
|
+
* A module that stores a country, language or currency code registers one of
|
|
513
|
+
* these per column it stores it in, from its own `ctx.onBoot`. It queries its
|
|
514
|
+
* **own** tables and nothing else — which is the whole point: before this
|
|
515
|
+
* existed, `dictionaries`, `languages` and `currencies` each hand-wrote SQL
|
|
516
|
+
* naming twelve other modules' tables, invisible to every import-level
|
|
517
|
+
* boundary check because raw SQL names no specifier (D-87).
|
|
518
|
+
*
|
|
519
|
+
* `ownerModuleId` is required and is the whole mechanism (D-39): without it the
|
|
520
|
+
* registry could not state a policy for an absent owner at all.
|
|
521
|
+
*/
|
|
522
|
+
export interface DictionaryReferenceDescriptor {
|
|
523
|
+
ownerModuleId: string;
|
|
524
|
+
consumer: string;
|
|
525
|
+
tableName: string;
|
|
526
|
+
columnName: string;
|
|
527
|
+
/** See {@link DictionaryReference.blocking}. */
|
|
528
|
+
blocking: boolean;
|
|
529
|
+
/**
|
|
530
|
+
* How many of this consumer's rows reference `code`. Asked before a delete,
|
|
531
|
+
* so it must be a point query the consumer's own indexes can serve.
|
|
532
|
+
*/
|
|
533
|
+
countReferences(code: string): Promise<number>;
|
|
534
|
+
/**
|
|
535
|
+
* Every code this consumer stores, with its row count. Asked by the orphan
|
|
536
|
+
* report, which is a full-table audit by nature — the caller subtracts the
|
|
537
|
+
* dictionary's own codes to find the danglers.
|
|
538
|
+
*/
|
|
539
|
+
usedCodes(): Promise<ReadonlyArray<{
|
|
540
|
+
code: string;
|
|
541
|
+
count: number;
|
|
542
|
+
}>>;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Container name: `countryReferenceRegistry`. Owner: `dictionaries`.
|
|
546
|
+
* Container name: `languageReferenceRegistry`. Owner: `languages`.
|
|
547
|
+
* Container name: `currencyReferenceRegistry`. Owner: `currencies`.
|
|
548
|
+
*
|
|
549
|
+
* One shape, three instances — one per dictionary, each owned by the module
|
|
550
|
+
* that owns the table being pointed at. Three rather than one because the
|
|
551
|
+
* enumeration policy and the 409 belong to the owner of the entry being
|
|
552
|
+
* deleted, and because a single registry would have to live in a module that
|
|
553
|
+
* two of the three readers cannot declare without closing a manifest cycle
|
|
554
|
+
* (`dictionaries` already depends on `languages` and `currencies`).
|
|
555
|
+
*
|
|
556
|
+
* A **contribution seam**: contributors push from a boot hook and read nothing
|
|
557
|
+
* back, so the registration is a plain `ctx.di.register` rather than a
|
|
558
|
+
* `providePort` — a boot hook that resolved a gate would stop the backend from
|
|
559
|
+
* starting whenever the registry's owner was switched off. All three owners are
|
|
560
|
+
* `nonDeactivatable` today, which is why no reader here degrades.
|
|
561
|
+
*
|
|
562
|
+
* **Enumeration policy: honoured while the contributing module is absent.**
|
|
563
|
+
* D-39's default is to skip, and honouring needs a written reason: this is
|
|
564
|
+
* referential integrity, not a surface. If `blog` is switched off its posts
|
|
565
|
+
* still exist and still carry language codes; skipping `blog`'s descriptor
|
|
566
|
+
* would let an operator delete a language that comes back as a dangling
|
|
567
|
+
* reference the moment `blog` is switched on again — data loss caused by an
|
|
568
|
+
* action Constitution XVII promises is non-destructive and reversible. Nobody
|
|
569
|
+
* sees a descriptor; they exist to refuse a delete and to report a dangler.
|
|
570
|
+
*/
|
|
571
|
+
export interface DictionaryReferenceRegistryPort {
|
|
572
|
+
register(descriptor: DictionaryReferenceDescriptor): void;
|
|
573
|
+
/** The contributing module of every registered descriptor, in registration order. */
|
|
574
|
+
owners(): readonly string[];
|
|
575
|
+
/** Every reference pointing at one code, across all descriptors. Zero counts dropped. */
|
|
576
|
+
countReferences(code: string): Promise<DictionaryReference[]>;
|
|
577
|
+
/** Every code every descriptor stores, with its row count. */
|
|
578
|
+
usedCodes(): Promise<DictionaryReference[]>;
|
|
579
|
+
}
|
|
580
|
+
//# sourceMappingURL=dictionary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KA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