@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
package/dist/email.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The `email` module's published contract (D-59, issue #114; extended by
|
|
4
|
+
* feature 075's Phase P).
|
|
5
|
+
*
|
|
6
|
+
* `email` owns no route, no entity and no worker: it is two registrations —
|
|
7
|
+
* the platform's outbound transport, and the durable record of what became of
|
|
8
|
+
* each message that left through it.
|
|
9
|
+
*
|
|
10
|
+
* The delivery recorder lives here rather than in the module because a second
|
|
11
|
+
* module reads it: `transactional_emails` decides `suppressed` above the
|
|
12
|
+
* transport and records that decision itself, so the shape is a boundary and
|
|
13
|
+
* not an internal. Feature 075 FR-001 — a type-only reach into another
|
|
14
|
+
* module's `services/` is still a reach.
|
|
15
|
+
*
|
|
16
|
+
* `EmailMailerPort` joins it for the same reason at a larger scale:
|
|
17
|
+
* thirty-two import sites across eight modules named `Mailer` /
|
|
18
|
+
* `MailerSendInput` at `email/services/mailer.ts`, which makes it the single
|
|
19
|
+
* largest contract in the sweep and the one with the smallest surface — two
|
|
20
|
+
* shapes and one method.
|
|
21
|
+
*/
|
|
22
|
+
/** What became of one outbound message. */
|
|
23
|
+
export const emailDeliveryStatusSchema = z.enum(['sent', 'suppressed', 'failed']);
|
|
24
|
+
/**
|
|
25
|
+
* Why a recorded message did not go out; absent for a delivered one.
|
|
26
|
+
*
|
|
27
|
+
* The split down the middle is the load-bearing part: the first two are the
|
|
28
|
+
* platform deliberately not sending, the last three are a message that was
|
|
29
|
+
* meant to go out and did not. An operator reading the record has to be able to
|
|
30
|
+
* tell a configuration from an outage, and since feature 074 shipped per-e-mail
|
|
31
|
+
* deactivation, "not sent" stopped being the same as "broken".
|
|
32
|
+
*/
|
|
33
|
+
export const emailDeliveryReasonSchema = z.enum([
|
|
34
|
+
/** Suppressed: the operator switched this e-mail off. */
|
|
35
|
+
'deactivated',
|
|
36
|
+
/** Suppressed: the transport had already accepted this message id. */
|
|
37
|
+
'duplicate_message_id',
|
|
38
|
+
/** Failed: the transport raised. */
|
|
39
|
+
'transport_error',
|
|
40
|
+
/** Failed: no transport is wired in this composition. */
|
|
41
|
+
'no_transport',
|
|
42
|
+
/** Failed: no template exists for this code. */
|
|
43
|
+
'no_definition',
|
|
44
|
+
]);
|
|
45
|
+
//# sourceMappingURL=email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../src/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,2CAA2C;AAC3C,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGlF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC9C,yDAAyD;IACzD,aAAa;IACb,sEAAsE;IACtE,sBAAsB;IACtB,oCAAoC;IACpC,iBAAiB;IACjB,yDAAyD;IACzD,cAAc;IACd,gDAAgD;IAChD,eAAe;CAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Successful item-response envelope. Example: `{ data: { id: '…', … } }`. */
|
|
3
|
+
export declare function dataEnvelope<T extends z.ZodTypeAny>(inner: T): z.ZodObject<{
|
|
4
|
+
data: T;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
/** Successful collection-response envelope with cursor pagination. */
|
|
7
|
+
export declare function collectionEnvelope<T extends z.ZodTypeAny>(inner: T): z.ZodObject<{
|
|
8
|
+
data: z.ZodArray<T>;
|
|
9
|
+
pagination: z.ZodObject<{
|
|
10
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
11
|
+
hasMore: z.ZodBoolean;
|
|
12
|
+
limit: z.ZodNumber;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
//# sourceMappingURL=envelopes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelopes.d.ts","sourceRoot":"","sources":["../src/envelopes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC;;kBAI5D;AAED,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC;;;;;;;kBAKlE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { paginationSchema } from './pagination.js';
|
|
3
|
+
/** Successful item-response envelope. Example: `{ data: { id: '…', … } }`. */
|
|
4
|
+
export function dataEnvelope(inner) {
|
|
5
|
+
return z.object({
|
|
6
|
+
data: inner,
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
/** Successful collection-response envelope with cursor pagination. */
|
|
10
|
+
export function collectionEnvelope(inner) {
|
|
11
|
+
return z.object({
|
|
12
|
+
data: z.array(inner),
|
|
13
|
+
pagination: paginationSchema,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=envelopes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelopes.js","sourceRoot":"","sources":["../src/envelopes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,8EAA8E;AAC9E,MAAM,UAAU,YAAY,CAAyB,KAAQ;IAC3D,OAAO,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC;AACL,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,kBAAkB,CAAyB,KAAQ;IACjE,OAAO,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;QACpB,UAAU,EAAE,gBAAgB;KAC7B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The environment-input declaration — what a running Endora needs, said once.
|
|
3
|
+
*
|
|
4
|
+
* Normative: `specs/117-instance-bring-up/contracts/environment-inputs.md`
|
|
5
|
+
* §1–§2, FR-001 and FR-005.
|
|
6
|
+
*
|
|
7
|
+
* ## Why the shape lives here
|
|
8
|
+
*
|
|
9
|
+
* Three programs read a declaration and none of them may author a second copy
|
|
10
|
+
* of it (D-100): `endora new instance` and `endora new storefront` (which
|
|
11
|
+
* values to resolve and write), `endora doctor` (which values to require and
|
|
12
|
+
* what their absence costs), and the reconciliation check. Four *authors*
|
|
13
|
+
* write one — the platform, each application, and every module in its own
|
|
14
|
+
* manifest — so the shape is a contract before it is anybody's data, which is
|
|
15
|
+
* what `packages/contracts` is for.
|
|
16
|
+
*
|
|
17
|
+
* ## `describes` carries both languages inline, and that is a decision
|
|
18
|
+
*
|
|
19
|
+
* §R1.1 puts this prose in the translation boundary's case 1 — the reader's
|
|
20
|
+
* language is resolvable when the sentence is composed — and says a module's
|
|
21
|
+
* ships in its own bundle. **A bundle is not reachable here.** The first
|
|
22
|
+
* reader is a CLI on a client's machine: it loads no `_i18n` reconciler, has
|
|
23
|
+
* no settings store to ask, and the *platform's* inputs have no owning
|
|
24
|
+
* module whose bundle they could sit in. So the sentence ships as `{ en, pl }`
|
|
25
|
+
* on the declaration itself, which satisfies the owner's translation policy
|
|
26
|
+
* (English by default, a Polish bundle beside it, English as the fallback)
|
|
27
|
+
* with the one mechanism a standalone program can read. The check holds both
|
|
28
|
+
* languages to a non-empty sentence, so a single-language declaration is a
|
|
29
|
+
* finding rather than a silent English-only input.
|
|
30
|
+
*
|
|
31
|
+
* ## There is deliberately no `default` field
|
|
32
|
+
*
|
|
33
|
+
* §R1.3. A declaration that could carry a default would become the seventieth
|
|
34
|
+
* home of an invented value, blessed by a contract — which is the exact thing
|
|
35
|
+
* the provenance line's `defaulted=0` exists to make impossible. The absence
|
|
36
|
+
* is load-bearing, not an omission.
|
|
37
|
+
*
|
|
38
|
+
* ## `consumers` scopes `requirement`; it does not merely describe it
|
|
39
|
+
*
|
|
40
|
+
* `specs/118-instance-member-selection/` establishes that an instance may
|
|
41
|
+
* deliberately omit a member — its admin being the ruled case (D-215). That
|
|
42
|
+
* member is absent when the operator declines it, or when
|
|
43
|
+
* `@endora-commerce/admin-shell` does not **resolve** at the version being
|
|
44
|
+
* installed (`specs/110-instance-repository/contracts/instance-tree.md` §2.4).
|
|
45
|
+
* This comment read *"while `@endora-commerce/admin-shell` does not exist"*
|
|
46
|
+
* until 2026-09-13, by which time `packages/admin-shell` did — a premise about
|
|
47
|
+
* the tree, written into a source file where nothing re-derives it. An input
|
|
48
|
+
* no written member reads is not "required and missing"; it is **not in this
|
|
49
|
+
* run's population at all**, which is what keeps the provenance line to four
|
|
50
|
+
* outcomes instead of five.
|
|
51
|
+
*
|
|
52
|
+
* **Scope by declared consumer, never by name.** Measured on this tree, the
|
|
53
|
+
* name-based rule is wrong on two of the three inputs that mention the admin:
|
|
54
|
+
*
|
|
55
|
+
* * `VITE_API_BASE_URL` — read by `admin/src` alone. Dropped with the
|
|
56
|
+
* member.
|
|
57
|
+
* * `ADMIN_BASE_URL` — read by the **backend** (`mfa`, when it composes the
|
|
58
|
+
* links it mails). Its *value* names the admin; its consumer is the
|
|
59
|
+
* backend, and it matters **more** when the admin is on another host.
|
|
60
|
+
* * `CORS_ALLOWED_ORIGINS` — read by the backend
|
|
61
|
+
* (`packages/platform/src/http/server.ts`), and its value has to name the
|
|
62
|
+
* admin's origin for the admin to work at all.
|
|
63
|
+
*
|
|
64
|
+
* Two of those three would be dropped by any rule keyed on the spelling.
|
|
65
|
+
*/
|
|
66
|
+
import { z } from 'zod';
|
|
67
|
+
/**
|
|
68
|
+
* The trees that read an environment value.
|
|
69
|
+
*
|
|
70
|
+
* A value read by more than one is a value those trees must **agree** about,
|
|
71
|
+
* and under D-195 and D-207 two of the three are the client's own
|
|
72
|
+
* repositories — so the agreement cannot be checked from inside any one of
|
|
73
|
+
* them. That is `environment-inputs.md` §5's subject and the derivation is
|
|
74
|
+
* this field, never a table (R5.1, R5.4).
|
|
75
|
+
*/
|
|
76
|
+
export declare const ENVIRONMENT_CONSUMERS: readonly ["backend", "admin", "storefront"];
|
|
77
|
+
export declare const EnvironmentConsumerSchema: z.ZodEnum<{
|
|
78
|
+
admin: "admin";
|
|
79
|
+
backend: "backend";
|
|
80
|
+
storefront: "storefront";
|
|
81
|
+
}>;
|
|
82
|
+
export type EnvironmentConsumer = z.infer<typeof EnvironmentConsumerSchema>;
|
|
83
|
+
/**
|
|
84
|
+
* A sentence in every language the platform ships, on the declaration itself.
|
|
85
|
+
*
|
|
86
|
+
* See the header for why this is not a bundle key. Both members are required:
|
|
87
|
+
* "ships `en` and `pl`" enforced by the type rather than by anybody
|
|
88
|
+
* remembering, in the idiom the storefront's own `Record<MessageKey, string>`
|
|
89
|
+
* uses.
|
|
90
|
+
*/
|
|
91
|
+
export declare const LocalizedSentenceSchema: z.ZodObject<{
|
|
92
|
+
en: z.ZodString;
|
|
93
|
+
pl: z.ZodString;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
export type LocalizedSentence = z.infer<typeof LocalizedSentenceSchema>;
|
|
96
|
+
/**
|
|
97
|
+
* Required, conditionally required, or optional — and the middle term is the
|
|
98
|
+
* one that matters (§R1.2).
|
|
99
|
+
*
|
|
100
|
+
* `requiredWhen` is a predicate over **another input**: `MEILISEARCH_URL` is
|
|
101
|
+
* required iff `CATALOG_SEARCH_BACKEND=meilisearch`, and without the predicate
|
|
102
|
+
* a doctor would demand a service two thirds of deployments do not run.
|
|
103
|
+
*
|
|
104
|
+
* `optional` carries **what is lost**, never the word "optional". An operator
|
|
105
|
+
* deciding whether to set `SETTINGS_SECRET_ENCRYPTION_KEY` needs to read
|
|
106
|
+
* *"secret settings cannot be read or written"*, which is the fact; that the
|
|
107
|
+
* boot survives without it is not.
|
|
108
|
+
*/
|
|
109
|
+
export declare const EnvironmentRequirementSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
110
|
+
kind: z.ZodLiteral<"required">;
|
|
111
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
112
|
+
kind: z.ZodLiteral<"requiredWhen">;
|
|
113
|
+
input: z.ZodString;
|
|
114
|
+
equals: z.ZodString;
|
|
115
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
116
|
+
kind: z.ZodLiteral<"optional">;
|
|
117
|
+
without: z.ZodObject<{
|
|
118
|
+
en: z.ZodString;
|
|
119
|
+
pl: z.ZodString;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
}, z.core.$strip>], "kind">;
|
|
122
|
+
export type EnvironmentRequirement = z.infer<typeof EnvironmentRequirementSchema>;
|
|
123
|
+
/**
|
|
124
|
+
* Who declares the input, which is what `foreign-input` is asked against.
|
|
125
|
+
*
|
|
126
|
+
* A module declaring an input another module owns is two answers to one
|
|
127
|
+
* question waiting to disagree, so ownership is a field rather than an
|
|
128
|
+
* inference from where the file sits.
|
|
129
|
+
*/
|
|
130
|
+
export declare const EnvironmentInputOwnerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
131
|
+
kind: z.ZodLiteral<"platform">;
|
|
132
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
133
|
+
kind: z.ZodLiteral<"application">;
|
|
134
|
+
application: z.ZodEnum<{
|
|
135
|
+
admin: "admin";
|
|
136
|
+
backend: "backend";
|
|
137
|
+
storefront: "storefront";
|
|
138
|
+
}>;
|
|
139
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
140
|
+
kind: z.ZodLiteral<"module">;
|
|
141
|
+
moduleId: z.ZodString;
|
|
142
|
+
}, z.core.$strip>], "kind">;
|
|
143
|
+
export type EnvironmentInputOwner = z.infer<typeof EnvironmentInputOwnerSchema>;
|
|
144
|
+
/** One entry per environment variable a running platform reads (§1). */
|
|
145
|
+
export declare const EnvironmentInputSchema: z.ZodObject<{
|
|
146
|
+
name: z.ZodString;
|
|
147
|
+
describes: z.ZodObject<{
|
|
148
|
+
en: z.ZodString;
|
|
149
|
+
pl: z.ZodString;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
requirement: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
152
|
+
kind: z.ZodLiteral<"required">;
|
|
153
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
154
|
+
kind: z.ZodLiteral<"requiredWhen">;
|
|
155
|
+
input: z.ZodString;
|
|
156
|
+
equals: z.ZodString;
|
|
157
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
158
|
+
kind: z.ZodLiteral<"optional">;
|
|
159
|
+
without: z.ZodObject<{
|
|
160
|
+
en: z.ZodString;
|
|
161
|
+
pl: z.ZodString;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
}, z.core.$strip>], "kind">;
|
|
164
|
+
secret: z.ZodBoolean;
|
|
165
|
+
generable: z.ZodBoolean;
|
|
166
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
167
|
+
kind: z.ZodLiteral<"platform">;
|
|
168
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
169
|
+
kind: z.ZodLiteral<"application">;
|
|
170
|
+
application: z.ZodEnum<{
|
|
171
|
+
admin: "admin";
|
|
172
|
+
backend: "backend";
|
|
173
|
+
storefront: "storefront";
|
|
174
|
+
}>;
|
|
175
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
176
|
+
kind: z.ZodLiteral<"module">;
|
|
177
|
+
moduleId: z.ZodString;
|
|
178
|
+
}, z.core.$strip>], "kind">;
|
|
179
|
+
consumers: z.ZodArray<z.ZodEnum<{
|
|
180
|
+
admin: "admin";
|
|
181
|
+
backend: "backend";
|
|
182
|
+
storefront: "storefront";
|
|
183
|
+
}>>;
|
|
184
|
+
addressOf: z.ZodNullable<z.ZodEnum<{
|
|
185
|
+
admin: "admin";
|
|
186
|
+
backend: "backend";
|
|
187
|
+
storefront: "storefront";
|
|
188
|
+
}>>;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
export type EnvironmentInput = z.infer<typeof EnvironmentInputSchema>;
|
|
191
|
+
/** A whole declaration, as an application or the platform publishes it. */
|
|
192
|
+
export declare const EnvironmentInputsSchema: z.ZodArray<z.ZodObject<{
|
|
193
|
+
name: z.ZodString;
|
|
194
|
+
describes: z.ZodObject<{
|
|
195
|
+
en: z.ZodString;
|
|
196
|
+
pl: z.ZodString;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
requirement: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
199
|
+
kind: z.ZodLiteral<"required">;
|
|
200
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
201
|
+
kind: z.ZodLiteral<"requiredWhen">;
|
|
202
|
+
input: z.ZodString;
|
|
203
|
+
equals: z.ZodString;
|
|
204
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
205
|
+
kind: z.ZodLiteral<"optional">;
|
|
206
|
+
without: z.ZodObject<{
|
|
207
|
+
en: z.ZodString;
|
|
208
|
+
pl: z.ZodString;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
}, z.core.$strip>], "kind">;
|
|
211
|
+
secret: z.ZodBoolean;
|
|
212
|
+
generable: z.ZodBoolean;
|
|
213
|
+
owner: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
214
|
+
kind: z.ZodLiteral<"platform">;
|
|
215
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
216
|
+
kind: z.ZodLiteral<"application">;
|
|
217
|
+
application: z.ZodEnum<{
|
|
218
|
+
admin: "admin";
|
|
219
|
+
backend: "backend";
|
|
220
|
+
storefront: "storefront";
|
|
221
|
+
}>;
|
|
222
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
223
|
+
kind: z.ZodLiteral<"module">;
|
|
224
|
+
moduleId: z.ZodString;
|
|
225
|
+
}, z.core.$strip>], "kind">;
|
|
226
|
+
consumers: z.ZodArray<z.ZodEnum<{
|
|
227
|
+
admin: "admin";
|
|
228
|
+
backend: "backend";
|
|
229
|
+
storefront: "storefront";
|
|
230
|
+
}>>;
|
|
231
|
+
addressOf: z.ZodNullable<z.ZodEnum<{
|
|
232
|
+
admin: "admin";
|
|
233
|
+
backend: "backend";
|
|
234
|
+
storefront: "storefront";
|
|
235
|
+
}>>;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
/**
|
|
238
|
+
* Is this input in the population of a run that writes exactly these members?
|
|
239
|
+
*
|
|
240
|
+
* The `specs/118-instance-member-selection/` scoping, as one predicate. An
|
|
241
|
+
* input whose declared consumers are all outside the written set is **out of
|
|
242
|
+
* the population**: not resolved, not prompted for, not counted, not refused.
|
|
243
|
+
*
|
|
244
|
+
* Reading it the other way — "required, and therefore missing" — is what would
|
|
245
|
+
* force a fifth provenance outcome, because such an input can be neither
|
|
246
|
+
* `defaulted` (there is nothing to invent) nor honestly reported as resolved.
|
|
247
|
+
*/
|
|
248
|
+
export declare function isReadByAnyOf(input: EnvironmentInput, members: readonly EnvironmentConsumer[]): boolean;
|
|
249
|
+
/**
|
|
250
|
+
* The declared inputs a run over these members actually has to answer for.
|
|
251
|
+
*
|
|
252
|
+
* Order is the declaration's, which is the order a prompt asks in
|
|
253
|
+
* (`input-resolution.md` §1: "in the declared order"). Sorting here would put
|
|
254
|
+
* the sequence in a comparator rather than in the hands of whoever wrote the
|
|
255
|
+
* declaration, and the first thing an operator is asked would then depend on
|
|
256
|
+
* an alphabet.
|
|
257
|
+
*/
|
|
258
|
+
export declare function scopeToMembers(inputs: readonly EnvironmentInput[], members: readonly EnvironmentConsumer[]): readonly EnvironmentInput[];
|
|
259
|
+
/**
|
|
260
|
+
* Several authors' declarations, as the one population a reader has to answer.
|
|
261
|
+
*
|
|
262
|
+
* The four authors of `EnvironmentInput` are the platform, each application and
|
|
263
|
+
* every module in its own manifest, and nothing joins them: a scaffolded
|
|
264
|
+
* instance reads the platform's declaration **and** the manifest of every module
|
|
265
|
+
* it installed, and a doctor run against that instance reads the same pair. Two
|
|
266
|
+
* programs computing that join separately is two answers waiting to disagree,
|
|
267
|
+
* which is why the join is here rather than in either of them.
|
|
268
|
+
*
|
|
269
|
+
* **First author wins, and order is the first declaration's.** A name that
|
|
270
|
+
* migrates between authors is the case that happens — feature 121 moved
|
|
271
|
+
* `MEILISEARCH_URL` out of a module and into the platform, and a module may not
|
|
272
|
+
* describe a name the platform declares — so during such a move the platform's
|
|
273
|
+
* sentence is the one an operator reads, and the module's stale copy is shadowed
|
|
274
|
+
* rather than duplicated. Callers therefore pass the platform's declaration
|
|
275
|
+
* first. Across authors a shared name is expected and is **not** a finding;
|
|
276
|
+
* `check:env-inputs` says so, and this function is that rule's consequence
|
|
277
|
+
* rather than a second opinion about it.
|
|
278
|
+
*/
|
|
279
|
+
export declare function unionEnvironmentInputs(declarations: readonly (readonly EnvironmentInput[])[]): readonly EnvironmentInput[];
|
|
280
|
+
/**
|
|
281
|
+
* The variables whose value is the address of `member`, in declaration order.
|
|
282
|
+
*
|
|
283
|
+
* One derivation, because the two programs that ask are `endora new storefront`
|
|
284
|
+
* — telling an author which variables to point at their backend — and the
|
|
285
|
+
* acceptance criterion, which points those same variables at the backend it
|
|
286
|
+
* booted. Deriving it twice is two answers waiting to disagree, and that is not
|
|
287
|
+
* hypothetical: the criterion once configured `PUBLIC_API_BASE_URL`, a name no
|
|
288
|
+
* file in the storefront reads, and its boot assertion measured the compiled-in
|
|
289
|
+
* fallback for a whole investigation.
|
|
290
|
+
*
|
|
291
|
+
* The population is the declaration handed in, so it is the **copy's** answer
|
|
292
|
+
* about the copy — under D-195 a client's storefront is theirs, declaring what
|
|
293
|
+
* it reads — and never a list compiled into either program.
|
|
294
|
+
*/
|
|
295
|
+
export declare function addressVariablesFor(inputs: readonly EnvironmentInput[], member: EnvironmentConsumer): readonly string[];
|
|
296
|
+
/**
|
|
297
|
+
* Is this input required, given what the rest of the environment holds?
|
|
298
|
+
*
|
|
299
|
+
* `requiredWhen` is resolved against the **resolved** values rather than
|
|
300
|
+
* against `process.env`, so a condition can be answered by a flag the operator
|
|
301
|
+
* has just supplied — which is the case that happens: a run that sets
|
|
302
|
+
* `CATALOG_SEARCH_BACKEND=meilisearch` on its command line must be asked for
|
|
303
|
+
* `MEILISEARCH_URL` in the same run, not in the next one.
|
|
304
|
+
*/
|
|
305
|
+
export declare function isRequiredGiven(input: EnvironmentInput, values: Readonly<Record<string, string | undefined>>): boolean;
|
|
306
|
+
//# sourceMappingURL=environment-inputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-inputs.d.ts","sourceRoot":"","sources":["../src/environment-inputs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,6CAA8C,CAAC;AAEjF,eAAO,MAAM,yBAAyB;;;;EAAgC,CAAC;AACvE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;2BAcvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;2BAItC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,wEAAwE;AACxE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkDjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAkC,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,SAAS,mBAAmB,EAAE,GACtC,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,OAAO,EAAE,SAAS,mBAAmB,EAAE,GACtC,SAAS,gBAAgB,EAAE,CAE7B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,SAAS,CAAC,SAAS,gBAAgB,EAAE,CAAC,EAAE,GACrD,SAAS,gBAAgB,EAAE,CAQ7B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,MAAM,EAAE,mBAAmB,GAC1B,SAAS,MAAM,EAAE,CAEnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GACnD,OAAO,CAST"}
|