@openlup/platform 0.28.0 → 0.30.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/CHANGELOG.md +369 -156
- package/README.md +220 -4
- package/dist/composition/index.d.ts +1 -0
- package/dist/composition/index.js +1 -0
- package/dist/composition/marketingContribution.d.ts +21 -0
- package/dist/composition/marketingContribution.js +29 -0
- package/dist/composition/nodeHost.d.ts +1 -1
- package/dist/composition/nodeHost.js +3 -2
- package/dist/lifecycle/appUpgrade.d.ts +52 -0
- package/dist/lifecycle/appUpgrade.js +180 -0
- package/dist/lifecycle/index.d.ts +2 -0
- package/dist/lifecycle/index.js +2 -0
- package/dist/lifecycle/postgresInstallQualification.d.ts +51 -0
- package/dist/lifecycle/postgresInstallQualification.js +74 -0
- package/dist/marketing/acquisitionCaseSchemas.d.ts +103 -0
- package/dist/marketing/acquisitionCaseSchemas.js +53 -0
- package/dist/marketing/acquisitionEvidenceSchemas.d.ts +105 -0
- package/dist/marketing/acquisitionEvidenceSchemas.js +55 -0
- package/dist/marketing/analytics/dataLayer.d.ts +18 -0
- package/dist/marketing/analytics/dataLayer.js +111 -0
- package/dist/marketing/analytics/noop.d.ts +9 -0
- package/dist/marketing/analytics/noop.js +8 -0
- package/dist/marketing/analytics/purchaseFacts.d.ts +4 -0
- package/dist/marketing/analytics/purchaseFacts.js +69 -0
- package/dist/marketing/analytics/routePolicy.d.ts +10 -0
- package/dist/marketing/analytics/routePolicy.js +59 -0
- package/dist/marketing/consentEvidence.d.ts +8 -0
- package/dist/marketing/consentEvidence.js +32 -0
- package/dist/marketing/contactLegal.d.ts +14 -0
- package/dist/marketing/contactLegal.js +19 -0
- package/dist/marketing/contracts/acquisition.d.ts +88 -0
- package/dist/marketing/contracts/acquisition.js +1 -0
- package/dist/marketing/contracts/acquisitionPorts.d.ts +49 -0
- package/dist/marketing/contracts/acquisitionPorts.js +1 -0
- package/dist/marketing/contracts/analytics.d.ts +144 -0
- package/dist/marketing/contracts/analytics.js +1 -0
- package/dist/marketing/contracts/contactLegal.d.ts +53 -0
- package/dist/marketing/contracts/contactLegal.js +1 -0
- package/dist/marketing/contracts/index.d.ts +6 -0
- package/dist/marketing/contracts/index.js +1 -0
- package/dist/marketing/contracts/prelaunch.d.ts +39 -0
- package/dist/marketing/contracts/prelaunch.js +1 -0
- package/dist/marketing/index.d.ts +16 -0
- package/dist/marketing/index.js +14 -0
- package/dist/marketing/prelaunchAcquisitionSchemas.d.ts +116 -0
- package/dist/marketing/prelaunchAcquisitionSchemas.js +51 -0
- package/dist/marketing/seo/jsonLd.d.ts +157 -0
- package/dist/marketing/seo/jsonLd.js +127 -0
- package/dist/marketing/seo/metadata.d.ts +41 -0
- package/dist/marketing/seo/metadata.js +36 -0
- package/dist/marketing/seo/serializeJsonLd.d.ts +1 -0
- package/dist/marketing/seo/serializeJsonLd.js +6 -0
- package/dist/marketing/seo/urls.d.ts +14 -0
- package/dist/marketing/seo/urls.js +23 -0
- package/dist/marketing/server/acquisitionCaseDirect.d.ts +4 -0
- package/dist/marketing/server/acquisitionCaseDirect.js +88 -0
- package/dist/marketing/server/acquisitionCaseHandlers.d.ts +28 -0
- package/dist/marketing/server/acquisitionCaseHandlers.js +40 -0
- package/dist/marketing/server/acquisitionCasePorts.d.ts +42 -0
- package/dist/marketing/server/acquisitionCasePorts.js +1 -0
- package/dist/marketing/server/acquisitionEvidenceDirect.d.ts +5 -0
- package/dist/marketing/server/acquisitionEvidenceDirect.js +100 -0
- package/dist/marketing/server/analyticsContext.d.ts +3 -0
- package/dist/marketing/server/analyticsContext.js +65 -0
- package/dist/marketing/server/analyticsContextPorts.d.ts +31 -0
- package/dist/marketing/server/analyticsContextPorts.js +1 -0
- package/dist/marketing/server/bindings.d.ts +14 -0
- package/dist/marketing/server/bindings.js +18 -0
- package/dist/marketing/server/directPorts.d.ts +26 -0
- package/dist/marketing/server/directPorts.js +1 -0
- package/dist/marketing/server/index.d.ts +14 -0
- package/dist/marketing/server/index.js +11 -0
- package/dist/marketing/server/postgres/acquisitionCaseRoutines.d.ts +10 -0
- package/dist/marketing/server/postgres/acquisitionCaseRoutines.js +204 -0
- package/dist/marketing/server/postgres/acquisitionEvidenceRoutines.d.ts +10 -0
- package/dist/marketing/server/postgres/acquisitionEvidenceRoutines.js +107 -0
- package/dist/marketing/server/postgres/index.d.ts +3 -0
- package/dist/marketing/server/postgres/index.js +3 -0
- package/dist/marketing/server/prelaunchAcquisitionDirect.d.ts +4 -0
- package/dist/marketing/server/prelaunchAcquisitionDirect.js +122 -0
- package/dist/marketing/server/privacyContributor.d.ts +66 -0
- package/dist/marketing/server/privacyContributor.js +87 -0
- package/dist/marketing/server/research/adminSurveyResponsesHandler.d.ts +9 -0
- package/dist/marketing/server/research/adminSurveyResponsesHandler.js +53 -0
- package/dist/marketing/server/research/managedSurveyResponseSubmit.d.ts +39 -0
- package/dist/marketing/server/research/managedSurveyResponseSubmit.js +102 -0
- package/dist/marketing/server/research/surveyResponseSubmitHandler.d.ts +8 -0
- package/dist/marketing/server/research/surveyResponseSubmitHandler.js +41 -0
- package/dist/marketing/validation.d.ts +2 -0
- package/dist/marketing/validation.js +3 -0
- package/dist/migrations/postgresRunner.d.ts +9 -0
- package/dist/migrations/postgresRunner.js +17 -10
- package/dist/operations/adminAlertsSchemas.d.ts +153 -0
- package/dist/operations/adminAlertsSchemas.js +69 -0
- package/dist/operations/adminAlertsView.d.ts +73 -0
- package/dist/operations/adminAlertsView.js +184 -0
- package/dist/operations/alertPagingPolicy.d.ts +15 -0
- package/dist/operations/alertPagingPolicy.js +43 -0
- package/dist/operations/alertThrottlePolicy.d.ts +3 -0
- package/dist/operations/alertThrottlePolicy.js +18 -0
- package/dist/operations/clients.d.ts +17 -0
- package/dist/operations/clients.js +32 -0
- package/dist/operations/contracts/admin.d.ts +93 -0
- package/dist/operations/contracts/admin.js +1 -0
- package/dist/operations/contracts/adminAlertsContracts.d.ts +40 -0
- package/dist/operations/contracts/adminAlertsContracts.js +1 -0
- package/dist/operations/contracts/alertHumanContext.d.ts +7 -0
- package/dist/operations/contracts/alertHumanContext.js +1 -0
- package/dist/operations/contracts/index.d.ts +6 -0
- package/dist/operations/contracts/index.js +6 -0
- package/dist/operations/contracts/observabilityContracts.d.ts +41 -0
- package/dist/operations/contracts/observabilityContracts.js +1 -0
- package/dist/operations/contracts/observabilityPorts.d.ts +18 -0
- package/dist/operations/contracts/observabilityPorts.js +1 -0
- package/dist/operations/contracts/ports.d.ts +19 -0
- package/dist/operations/contracts/ports.js +1 -0
- package/dist/operations/errors.d.ts +6 -0
- package/dist/operations/errors.js +6 -0
- package/dist/operations/index.d.ts +9 -0
- package/dist/operations/index.js +9 -0
- package/dist/operations/schemas.d.ts +138 -0
- package/dist/operations/schemas.js +104 -0
- package/dist/operations/server/adminAlertsHandlers.d.ts +16 -0
- package/dist/operations/server/adminAlertsHandlers.js +35 -0
- package/dist/operations/server/adminPipelineHandlers.d.ts +12 -0
- package/dist/operations/server/adminPipelineHandlers.js +48 -0
- package/dist/operations/server/adminSettingsHandlers.d.ts +14 -0
- package/dist/operations/server/adminSettingsHandlers.js +82 -0
- package/dist/operations/server/controlPlaneHandler.d.ts +7 -0
- package/dist/operations/server/controlPlaneHandler.js +54 -0
- package/dist/operations/server/controlPlaneStore.d.ts +12 -0
- package/dist/operations/server/controlPlaneStore.js +138 -0
- package/dist/operations/server/controlPlaneWatchdog.d.ts +7 -0
- package/dist/operations/server/controlPlaneWatchdog.js +20 -0
- package/dist/operations/server/index.d.ts +12 -0
- package/dist/operations/server/index.js +12 -0
- package/dist/operations/server/migrations.d.ts +14 -0
- package/dist/operations/server/migrations.js +7 -0
- package/dist/operations/server/platformWatchdogDecision.d.ts +34 -0
- package/dist/operations/server/platformWatchdogDecision.js +71 -0
- package/dist/operations/server/platformWatchdogDeliveryPolicy.d.ts +10 -0
- package/dist/operations/server/platformWatchdogDeliveryPolicy.js +53 -0
- package/dist/operations/server/platformWatchdogQueue.d.ts +11 -0
- package/dist/operations/server/platformWatchdogQueue.js +94 -0
- package/dist/operations/server/platformWatchdogService.d.ts +47 -0
- package/dist/operations/server/platformWatchdogService.js +105 -0
- package/dist/operations/validation.d.ts +2 -0
- package/dist/operations/validation.js +3 -0
- package/dist/portability/filesystemObjects.d.ts +12 -0
- package/dist/portability/filesystemObjects.js +191 -0
- package/dist/portability/index.d.ts +5 -0
- package/dist/portability/index.js +4 -0
- package/dist/portability/objects.d.ts +63 -0
- package/dist/portability/objects.js +138 -0
- package/dist/portability/postgresRows.d.ts +64 -0
- package/dist/portability/postgresRows.js +182 -0
- package/dist/scheduler/advisoryLock.js +20 -2
- package/dist/scheduler/nodeScheduler.d.ts +2 -2
- package/dist/scheduler/nodeScheduler.js +35 -6
- package/package.json +47 -2
- package/release-gates.json +143 -9
- package/sql/20260814010000_platform_control_plane.sql +286 -0
- package/src/composition/index.ts +1 -0
- package/src/composition/marketingContribution.ts +37 -0
- package/src/composition/nodeHost.ts +4 -3
- package/src/lifecycle/appUpgrade.ts +186 -0
- package/src/lifecycle/index.ts +19 -0
- package/src/lifecycle/postgresInstallQualification.ts +125 -0
- package/src/marketing/acquisitionCaseSchemas.ts +75 -0
- package/src/marketing/acquisitionEvidenceSchemas.ts +72 -0
- package/src/marketing/analytics/dataLayer.ts +100 -0
- package/src/marketing/analytics/noop.ts +14 -0
- package/src/marketing/analytics/purchaseFacts.ts +63 -0
- package/src/marketing/analytics/routePolicy.ts +55 -0
- package/src/marketing/consentEvidence.ts +36 -0
- package/src/marketing/contactLegal.ts +22 -0
- package/src/marketing/contracts/acquisition.ts +50 -0
- package/src/marketing/contracts/acquisitionPorts.ts +48 -0
- package/src/marketing/contracts/analytics.ts +88 -0
- package/src/marketing/contracts/contactLegal.ts +41 -0
- package/src/marketing/contracts/index.ts +17 -0
- package/src/marketing/contracts/prelaunch.ts +15 -0
- package/src/marketing/index.ts +16 -0
- package/src/marketing/prelaunchAcquisitionSchemas.ts +64 -0
- package/src/marketing/seo/jsonLd.ts +153 -0
- package/src/marketing/seo/metadata.ts +62 -0
- package/src/marketing/seo/serializeJsonLd.ts +6 -0
- package/src/marketing/seo/urls.ts +34 -0
- package/src/marketing/server/acquisitionCaseDirect.ts +67 -0
- package/src/marketing/server/acquisitionCaseHandlers.ts +57 -0
- package/src/marketing/server/acquisitionCasePorts.ts +42 -0
- package/src/marketing/server/acquisitionEvidenceDirect.ts +76 -0
- package/src/marketing/server/analyticsContext.ts +55 -0
- package/src/marketing/server/analyticsContextPorts.ts +28 -0
- package/src/marketing/server/bindings.ts +27 -0
- package/src/marketing/server/directPorts.ts +27 -0
- package/src/marketing/server/index.ts +14 -0
- package/src/marketing/server/postgres/acquisitionCaseRoutines.ts +218 -0
- package/src/marketing/server/postgres/acquisitionEvidenceRoutines.ts +103 -0
- package/src/marketing/server/postgres/index.ts +3 -0
- package/src/marketing/server/prelaunchAcquisitionDirect.ts +121 -0
- package/src/marketing/server/privacyContributor.ts +123 -0
- package/src/marketing/server/research/adminSurveyResponsesHandler.ts +78 -0
- package/src/marketing/server/research/managedSurveyResponseSubmit.ts +158 -0
- package/src/marketing/server/research/surveyResponseSubmitHandler.ts +57 -0
- package/src/marketing/validation.ts +3 -0
- package/src/migrations/postgresRunner.ts +24 -9
- package/src/operations/adminAlertsSchemas.ts +78 -0
- package/src/operations/adminAlertsView.ts +238 -0
- package/src/operations/alertPagingPolicy.ts +50 -0
- package/src/operations/alertThrottlePolicy.ts +22 -0
- package/src/operations/clients.ts +44 -0
- package/src/operations/contracts/admin.ts +24 -0
- package/src/operations/contracts/adminAlertsContracts.ts +13 -0
- package/src/operations/contracts/alertHumanContext.ts +17 -0
- package/src/operations/contracts/index.ts +6 -0
- package/src/operations/contracts/observabilityContracts.ts +40 -0
- package/src/operations/contracts/observabilityPorts.ts +30 -0
- package/src/operations/contracts/ports.ts +22 -0
- package/src/operations/errors.ts +6 -0
- package/src/operations/index.ts +9 -0
- package/src/operations/schemas.ts +122 -0
- package/src/operations/server/adminAlertsHandlers.ts +61 -0
- package/src/operations/server/adminPipelineHandlers.ts +73 -0
- package/src/operations/server/adminSettingsHandlers.ts +114 -0
- package/src/operations/server/controlPlaneHandler.ts +56 -0
- package/src/operations/server/controlPlaneStore.ts +150 -0
- package/src/operations/server/controlPlaneWatchdog.ts +28 -0
- package/src/operations/server/index.ts +12 -0
- package/src/operations/server/migrations.ts +7 -0
- package/src/operations/server/platformWatchdogDecision.ts +93 -0
- package/src/operations/server/platformWatchdogDeliveryPolicy.ts +92 -0
- package/src/operations/server/platformWatchdogQueue.ts +96 -0
- package/src/operations/server/platformWatchdogService.ts +209 -0
- package/src/operations/validation.ts +3 -0
- package/src/portability/filesystemObjects.ts +138 -0
- package/src/portability/index.ts +12 -0
- package/src/portability/objects.ts +160 -0
- package/src/portability/postgresRows.ts +169 -0
- package/src/scheduler/advisoryLock.ts +20 -5
- package/src/scheduler/nodeScheduler.ts +28 -8
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const MAX_ITEMS = 200;
|
|
2
|
+
export function projectPaidPurchase(recap, suppressPurchase = () => null) {
|
|
3
|
+
if (recap.status !== "paid")
|
|
4
|
+
return suppressPurchase("order_not_paid");
|
|
5
|
+
if (recap.paymentStatus !== "succeeded")
|
|
6
|
+
return suppressPurchase("payment_not_succeeded");
|
|
7
|
+
if (recap.checkoutKind !== "one_time" && recap.checkoutKind !== "subscription_initial"
|
|
8
|
+
&& recap.checkoutKind !== "subscription_renewal")
|
|
9
|
+
return suppressPurchase("checkout_kind_unsupported");
|
|
10
|
+
if (!recap.moneyReconciled)
|
|
11
|
+
return suppressPurchase("money_unreconciled");
|
|
12
|
+
if (recap.items.length === 0)
|
|
13
|
+
return suppressPurchase("items_empty");
|
|
14
|
+
let effectiveNet = 0;
|
|
15
|
+
const items = [];
|
|
16
|
+
for (const item of recap.items) {
|
|
17
|
+
if (!item.sku)
|
|
18
|
+
return suppressPurchase("sku_missing");
|
|
19
|
+
if (!Number.isSafeInteger(item.quantity) || item.quantity <= 0)
|
|
20
|
+
return suppressPurchase("quantity_invalid");
|
|
21
|
+
if (item.quantity > MAX_ITEMS)
|
|
22
|
+
return suppressPurchase("item_limit_exceeded");
|
|
23
|
+
if (!isNonNegativeSafeInteger(item.catalogTotalGross) || !isNonNegativeSafeInteger(item.effectiveNet)
|
|
24
|
+
|| !isNonNegativeSafeInteger(item.vatRateBps) || item.vatRateBps > 10_000)
|
|
25
|
+
return suppressPurchase("line_money_invalid");
|
|
26
|
+
const catalogNet = netFromGross(item.catalogTotalGross, item.vatRateBps);
|
|
27
|
+
const netDiscount = catalogNet - item.effectiveNet;
|
|
28
|
+
if (netDiscount < 0)
|
|
29
|
+
return suppressPurchase("net_discount_invalid");
|
|
30
|
+
const projected = allocateLineItems({ sku: item.sku, variantCode: item.variantCode,
|
|
31
|
+
quantity: item.quantity, effectiveNet: item.effectiveNet, netDiscount });
|
|
32
|
+
if (items.length + projected.length > MAX_ITEMS)
|
|
33
|
+
return suppressPurchase("item_limit_exceeded");
|
|
34
|
+
items.push(...projected);
|
|
35
|
+
effectiveNet += item.effectiveNet;
|
|
36
|
+
}
|
|
37
|
+
const tax = recap.totals.tax.amountMinor;
|
|
38
|
+
const total = recap.totals.total.amountMinor;
|
|
39
|
+
const effectiveShippingNet = total - tax - effectiveNet;
|
|
40
|
+
if (!isNonNegativeSafeInteger(effectiveShippingNet))
|
|
41
|
+
return suppressPurchase("shipping_net_invalid");
|
|
42
|
+
return { transaction_id: recap.orderId, currency: recap.totals.total.currency, value: effectiveNet / 100,
|
|
43
|
+
shipping: effectiveShippingNet / 100, tax: tax / 100,
|
|
44
|
+
checkout_mode: recap.checkoutKind === "one_time" ? "one_time" : "subscription", items };
|
|
45
|
+
}
|
|
46
|
+
function allocateLineItems(input) {
|
|
47
|
+
const priceBase = Math.floor(input.effectiveNet / input.quantity);
|
|
48
|
+
const priceRemainder = input.effectiveNet % input.quantity;
|
|
49
|
+
const discountBase = Math.floor(input.netDiscount / input.quantity);
|
|
50
|
+
const discountRemainder = input.netDiscount % input.quantity;
|
|
51
|
+
const grouped = new Map();
|
|
52
|
+
for (let position = 0; position < input.quantity; position += 1) {
|
|
53
|
+
const priceMinor = priceBase + (position < priceRemainder ? 1 : 0);
|
|
54
|
+
const discountMinor = discountBase + (position < discountRemainder ? 1 : 0);
|
|
55
|
+
const key = `${priceMinor}:${discountMinor}`;
|
|
56
|
+
const current = grouped.get(key);
|
|
57
|
+
if (current)
|
|
58
|
+
current.quantity += 1;
|
|
59
|
+
else
|
|
60
|
+
grouped.set(key, { priceMinor, discountMinor, quantity: 1 });
|
|
61
|
+
}
|
|
62
|
+
return [...grouped.values()].map(group => ({ item_id: input.sku,
|
|
63
|
+
...(input.variantCode ? { item_variant: input.variantCode } : {}), price: group.priceMinor / 100,
|
|
64
|
+
discount: group.discountMinor / 100, quantity: group.quantity }));
|
|
65
|
+
}
|
|
66
|
+
function netFromGross(grossMinor, vatRateBps) {
|
|
67
|
+
return Math.round(grossMinor * 10_000 / (10_000 + vatRateBps));
|
|
68
|
+
}
|
|
69
|
+
function isNonNegativeSafeInteger(value) { return Number.isSafeInteger(value) && value >= 0; }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AnalyticsRoutePolicyInput } from "../contracts/analytics.js";
|
|
2
|
+
export type { AnalyticsRoutePolicyInput } from "../contracts/analytics.js";
|
|
3
|
+
export declare function normalizeAnalyticsPathname(pathname: string): string;
|
|
4
|
+
/** Route manifests and sensitive paths are explicit host policy. */
|
|
5
|
+
export declare function createAnalyticsRoutePolicy(input: AnalyticsRoutePolicyInput): {
|
|
6
|
+
isSensitiveAnalyticsPath: (pathname: string) => boolean;
|
|
7
|
+
isOptionalAnalyticsRouteEligible: (pathname: string) => boolean;
|
|
8
|
+
isDeploymentAnalyticsRouteEligible: (pathname: string, additionalPublicPaths?: ReadonlySet<string>) => boolean;
|
|
9
|
+
sanitizeDeploymentAnalyticsUrl: (rawUrl: string, currentOrigin: string, additionalPublicPaths?: ReadonlySet<string>) => string | null;
|
|
10
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const CAMPAIGN_KEYS = ["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term"];
|
|
2
|
+
const CAMPAIGN_VALUE = /^[A-Za-z0-9_-]{1,100}$/;
|
|
3
|
+
const NO_ADDITIONAL_PATHS = new Set();
|
|
4
|
+
export function normalizeAnalyticsPathname(pathname) {
|
|
5
|
+
const withLeadingSlash = pathname.startsWith("/") ? pathname : `/${pathname}`;
|
|
6
|
+
const withoutTrailingSlash = withLeadingSlash.length > 1
|
|
7
|
+
? withLeadingSlash.replace(/\/+$/, "") : withLeadingSlash;
|
|
8
|
+
return withoutTrailingSlash.toLowerCase();
|
|
9
|
+
}
|
|
10
|
+
/** Route manifests and sensitive paths are explicit host policy. */
|
|
11
|
+
export function createAnalyticsRoutePolicy(input) {
|
|
12
|
+
const manifestPaths = new Set(input.publicPaths.map(normalizeAnalyticsPathname));
|
|
13
|
+
const redirectPaths = new Set(input.redirectSources.filter(source => !source.includes(":"))
|
|
14
|
+
.map(normalizeAnalyticsPathname));
|
|
15
|
+
function isSensitiveAnalyticsPath(pathname) {
|
|
16
|
+
const capabilityPath = pathname.toLowerCase();
|
|
17
|
+
return input.privatePathPrefixes.some(prefix => pathname === prefix || pathname.startsWith(`${prefix}/`))
|
|
18
|
+
|| input.privateAuthPaths.includes(pathname)
|
|
19
|
+
|| input.capabilityPathPrefixes.some(prefix => capabilityPath === prefix || capabilityPath.startsWith(`${prefix}/`));
|
|
20
|
+
}
|
|
21
|
+
function isOptionalAnalyticsRouteEligible(pathname) {
|
|
22
|
+
return !isSensitiveAnalyticsPath(pathname);
|
|
23
|
+
}
|
|
24
|
+
function isDeploymentAnalyticsRouteEligible(pathname, additionalPublicPaths = NO_ADDITIONAL_PATHS) {
|
|
25
|
+
const path = normalizeAnalyticsPathname(pathname);
|
|
26
|
+
if (isSensitiveAnalyticsPath(path))
|
|
27
|
+
return false;
|
|
28
|
+
return manifestPaths.has(path) || redirectPaths.has(path) || additionalPublicPaths.has(path);
|
|
29
|
+
}
|
|
30
|
+
function sanitizeDeploymentAnalyticsUrl(rawUrl, currentOrigin, additionalPublicPaths) {
|
|
31
|
+
let base;
|
|
32
|
+
let url;
|
|
33
|
+
try {
|
|
34
|
+
base = new URL(currentOrigin);
|
|
35
|
+
url = new URL(rawUrl, base);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
if ((url.protocol !== "http:" && url.protocol !== "https:") || url.username || url.password
|
|
41
|
+
|| url.origin !== base.origin)
|
|
42
|
+
return null;
|
|
43
|
+
const pathname = normalizeAnalyticsPathname(url.pathname);
|
|
44
|
+
if (!isDeploymentAnalyticsRouteEligible(pathname, additionalPublicPaths))
|
|
45
|
+
return null;
|
|
46
|
+
const campaign = new URLSearchParams();
|
|
47
|
+
for (const key of CAMPAIGN_KEYS) {
|
|
48
|
+
const values = url.searchParams.getAll(key);
|
|
49
|
+
if (values.length === 1 && CAMPAIGN_VALUE.test(values[0]))
|
|
50
|
+
campaign.set(key, values[0]);
|
|
51
|
+
}
|
|
52
|
+
url.pathname = pathname;
|
|
53
|
+
url.search = campaign.toString();
|
|
54
|
+
url.hash = "";
|
|
55
|
+
return url.href;
|
|
56
|
+
}
|
|
57
|
+
return { isSensitiveAnalyticsPath, isOptionalAnalyticsRouteEligible,
|
|
58
|
+
isDeploymentAnalyticsRouteEligible, sanitizeDeploymentAnalyticsUrl };
|
|
59
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MarketingHistoricalConsentCommand, MarketingHistoricalConsentState, MarketingHistoricalConsentResult } from "./contracts/analytics.js";
|
|
2
|
+
export type { MarketingHistoricalConsentCommand, MarketingHistoricalConsentState, MarketingHistoricalConsentResult } from "./contracts/analytics.js";
|
|
3
|
+
/** Transport chronology after authorization; never changes the local consent grant. */
|
|
4
|
+
export declare function selectMarketingHistoricalConsentTime(input: {
|
|
5
|
+
command: MarketingHistoricalConsentCommand;
|
|
6
|
+
state: MarketingHistoricalConsentState;
|
|
7
|
+
now: Date;
|
|
8
|
+
}): MarketingHistoricalConsentResult;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "./validation.js";
|
|
2
|
+
const historicalTimestamp = z.string().max(80).datetime({ offset: true });
|
|
3
|
+
const HISTORICAL_MIN_AGE_MS = 5 * 60 * 1000;
|
|
4
|
+
/** Transport chronology after authorization; never changes the local consent grant. */
|
|
5
|
+
export function selectMarketingHistoricalConsentTime(input) {
|
|
6
|
+
const { command, state, now } = input;
|
|
7
|
+
if (!Number.isFinite(now.getTime()))
|
|
8
|
+
return { kind: "hold", reason: "consent_time_invalid" };
|
|
9
|
+
let selected = command.consentedAt;
|
|
10
|
+
if (state.consent === "SUBSCRIBED") {
|
|
11
|
+
const native = historicalTimestamp.safeParse(state.nativeConsentAt);
|
|
12
|
+
if (!native.success || !Number.isFinite(Date.parse(native.data)) || Date.parse(native.data) >= now.getTime()) {
|
|
13
|
+
return { kind: "hold", reason: "provider_state_unknown" };
|
|
14
|
+
}
|
|
15
|
+
const overriding = state.suppressions.some(item => item.reason === "UNSUBSCRIBE"
|
|
16
|
+
&& (item.listId === null || item.listId === command.listId));
|
|
17
|
+
if (!overriding)
|
|
18
|
+
selected = native.data;
|
|
19
|
+
else if (Date.parse(command.consentedAt ?? "") > Date.parse(native.data)) {
|
|
20
|
+
return { kind: "hold", reason: "provider_state_unknown" };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const parsed = historicalTimestamp.safeParse(selected);
|
|
24
|
+
if (!parsed.success || !Number.isFinite(Date.parse(parsed.data)) || Date.parse(parsed.data) >= now.getTime()) {
|
|
25
|
+
return { kind: "hold", reason: "consent_time_invalid" };
|
|
26
|
+
}
|
|
27
|
+
// Parsing truncates fractional milliseconds; round only the age boundary up.
|
|
28
|
+
const discarded = /\.\d{3}(\d+)(?:Z|[+-]\d{2}:\d{2})$/.exec(parsed.data)?.[1];
|
|
29
|
+
const matureAt = Date.parse(parsed.data) + (discarded && /[1-9]/.test(discarded) ? 1 : 0) + HISTORICAL_MIN_AGE_MS;
|
|
30
|
+
return now.getTime() < matureAt ? { kind: "defer", retryAt: new Date(matureAt).toISOString() }
|
|
31
|
+
: { kind: "ready", providerConsentedAt: parsed.data };
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ContactContent, LegalDocumentContent } from "./contracts/contactLegal.js";
|
|
2
|
+
export declare function contactContent(facts: ContactContent): {
|
|
3
|
+
supportEmail: string;
|
|
4
|
+
companyLines: string[];
|
|
5
|
+
};
|
|
6
|
+
export declare function legalDocumentContent(content: LegalDocumentContent): {
|
|
7
|
+
lastUpdated?: string | undefined;
|
|
8
|
+
title: string;
|
|
9
|
+
intro: string;
|
|
10
|
+
sections: {
|
|
11
|
+
title: string;
|
|
12
|
+
body: string;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function contactContent(facts) {
|
|
2
|
+
return {
|
|
3
|
+
supportEmail: facts.supportEmail,
|
|
4
|
+
companyLines: [
|
|
5
|
+
facts.organization.legalName,
|
|
6
|
+
facts.addressLine,
|
|
7
|
+
facts.registrationIdentifiers.map(({ label, value }) => `${label} ${value}`).join(" · "),
|
|
8
|
+
...(facts.registrationAuthority !== undefined ? [facts.registrationAuthority] : []),
|
|
9
|
+
],
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function legalDocumentContent(content) {
|
|
13
|
+
return {
|
|
14
|
+
title: content.title,
|
|
15
|
+
intro: content.intro,
|
|
16
|
+
sections: content.sections.map(({ title, body }) => ({ title, body })),
|
|
17
|
+
...(content.lastUpdated !== undefined ? { lastUpdated: content.lastUpdated } : {}),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export type AcquisitionOpaqueReference = string;
|
|
2
|
+
export type AcquisitionAddressReference = {
|
|
3
|
+
source: string;
|
|
4
|
+
reference: string;
|
|
5
|
+
revision: string;
|
|
6
|
+
provenance: string;
|
|
7
|
+
};
|
|
8
|
+
export type AcquisitionCaseState = "submitted" | "approved" | "active" | "rejected" | "withdrawn";
|
|
9
|
+
export type AcquisitionCaseProjection = {
|
|
10
|
+
contractVersion: "tester_application_v1";
|
|
11
|
+
caseRef: string;
|
|
12
|
+
contactRef: string;
|
|
13
|
+
sourceKind: "tester_application";
|
|
14
|
+
consent: {
|
|
15
|
+
consentVersion: string;
|
|
16
|
+
policyVersion: string;
|
|
17
|
+
recordedAt: string;
|
|
18
|
+
locale: "en" | "pl";
|
|
19
|
+
sourcePath: "/tester-application";
|
|
20
|
+
};
|
|
21
|
+
addressReference: AcquisitionAddressReference | null;
|
|
22
|
+
state: AcquisitionCaseState;
|
|
23
|
+
version: number;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
};
|
|
27
|
+
export type AcquisitionCaseListRequest = {
|
|
28
|
+
view: "acquisition_case_v1";
|
|
29
|
+
cursor?: string | undefined;
|
|
30
|
+
limit: number;
|
|
31
|
+
};
|
|
32
|
+
export type AcquisitionCaseListResponse = {
|
|
33
|
+
contractVersion: "tester_application_v1";
|
|
34
|
+
cases: AcquisitionCaseProjection[];
|
|
35
|
+
nextCursor: string | null;
|
|
36
|
+
};
|
|
37
|
+
export type AcquisitionCaseActiveCountResponse = {
|
|
38
|
+
activeTesterCount: number;
|
|
39
|
+
};
|
|
40
|
+
export type AcquisitionIdempotencyKey = string;
|
|
41
|
+
export type AcquisitionSurveySubmit = {
|
|
42
|
+
view: "acquisition_survey_v1";
|
|
43
|
+
caseReference: string;
|
|
44
|
+
surveyType: "producer" | "consumer";
|
|
45
|
+
responseData: Record<string, unknown>;
|
|
46
|
+
};
|
|
47
|
+
export type AcquisitionSurveyEvidence = {
|
|
48
|
+
evidenceReference: string;
|
|
49
|
+
caseReference: string;
|
|
50
|
+
contactReference: string;
|
|
51
|
+
surveyType: "producer" | "consumer";
|
|
52
|
+
responseDigest: string;
|
|
53
|
+
answerCount: number;
|
|
54
|
+
recordedAt: string;
|
|
55
|
+
};
|
|
56
|
+
export type AcquisitionSurveySubmitResponse = {
|
|
57
|
+
contractVersion: "acquisition_survey_v1";
|
|
58
|
+
evidence: AcquisitionSurveyEvidence;
|
|
59
|
+
replayed: boolean;
|
|
60
|
+
};
|
|
61
|
+
export type AcquisitionSurveyListQuery = {
|
|
62
|
+
view: "acquisition_survey_v1";
|
|
63
|
+
surveyType?: "producer" | "consumer" | undefined;
|
|
64
|
+
limit: number;
|
|
65
|
+
};
|
|
66
|
+
export type AcquisitionSurveyListResponse = {
|
|
67
|
+
contractVersion: "acquisition_survey_v1";
|
|
68
|
+
rows: AcquisitionSurveyEvidence[];
|
|
69
|
+
totalCount: number;
|
|
70
|
+
};
|
|
71
|
+
export type AcquisitionNewsletterConsentEvent = {
|
|
72
|
+
contractVersion: "acquisition_newsletter_consent_v1";
|
|
73
|
+
caseReference: string;
|
|
74
|
+
contactReference: string;
|
|
75
|
+
eventReference: string;
|
|
76
|
+
eventType: "subscribe" | "unsubscribe" | "suppress" | "complaint" | "update";
|
|
77
|
+
purpose: "marketing_launch_offer" | "marketing_newsletter";
|
|
78
|
+
explicitOptInEvidence: boolean;
|
|
79
|
+
occurredAt: string;
|
|
80
|
+
};
|
|
81
|
+
export type AcquisitionNewsletterConsentResponse = {
|
|
82
|
+
contractVersion: "acquisition_newsletter_consent_v1";
|
|
83
|
+
eventReference: string;
|
|
84
|
+
outcome: "applied" | "ignored" | "stale";
|
|
85
|
+
consentState: "granted" | "suppressed" | null;
|
|
86
|
+
auditReference: string;
|
|
87
|
+
replayed: boolean;
|
|
88
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { AcquisitionCaseListResponse, AcquisitionCaseProjection, AcquisitionNewsletterConsentEvent, AcquisitionNewsletterConsentResponse, AcquisitionSurveyListQuery, AcquisitionSurveyListResponse, AcquisitionSurveySubmit, AcquisitionSurveySubmitResponse } from "./acquisition.js";
|
|
2
|
+
export type AcquisitionCaseFailureKind = "conflict" | "invalid" | "not_found" | "rate_limited" | "unavailable";
|
|
3
|
+
export type AcquisitionCaseResult<T> = {
|
|
4
|
+
ok: true;
|
|
5
|
+
value: T;
|
|
6
|
+
replayed?: boolean;
|
|
7
|
+
} | {
|
|
8
|
+
ok: false;
|
|
9
|
+
error: {
|
|
10
|
+
kind: AcquisitionCaseFailureKind;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export interface AcquisitionCaseListQuery {
|
|
14
|
+
actorRef: string;
|
|
15
|
+
scope: "public_tester_application";
|
|
16
|
+
cursor?: string;
|
|
17
|
+
limit: number;
|
|
18
|
+
}
|
|
19
|
+
export interface AcquisitionCaseGetQuery {
|
|
20
|
+
actorRef: string;
|
|
21
|
+
scope: "public_tester_application";
|
|
22
|
+
caseRef: string;
|
|
23
|
+
}
|
|
24
|
+
export interface AcquisitionCasePort {
|
|
25
|
+
list(query: AcquisitionCaseListQuery): Promise<AcquisitionCaseResult<AcquisitionCaseListResponse>>;
|
|
26
|
+
get(query: AcquisitionCaseGetQuery): Promise<AcquisitionCaseResult<AcquisitionCaseProjection>>;
|
|
27
|
+
activeCount(scope: "public_tester_application"): Promise<AcquisitionCaseResult<number>>;
|
|
28
|
+
close(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export type AcquisitionEvidenceFailure = "invalid" | "not_found" | "conflict" | "unavailable";
|
|
31
|
+
export type AcquisitionEvidenceResult<T> = {
|
|
32
|
+
ok: true;
|
|
33
|
+
value: T;
|
|
34
|
+
} | {
|
|
35
|
+
ok: false;
|
|
36
|
+
error: {
|
|
37
|
+
kind: AcquisitionEvidenceFailure;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export interface AcquisitionEvidencePort {
|
|
41
|
+
submitSurvey(input: AcquisitionSurveySubmit & {
|
|
42
|
+
idempotencyKey: string;
|
|
43
|
+
}): Promise<AcquisitionEvidenceResult<AcquisitionSurveySubmitResponse>>;
|
|
44
|
+
listSurveys(input: AcquisitionSurveyListQuery & {
|
|
45
|
+
actorReference: string;
|
|
46
|
+
}): Promise<AcquisitionEvidenceResult<AcquisitionSurveyListResponse>>;
|
|
47
|
+
applyNewsletterConsent(input: AcquisitionNewsletterConsentEvent): Promise<AcquisitionEvidenceResult<AcquisitionNewsletterConsentResponse>>;
|
|
48
|
+
close(): Promise<void>;
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/** The host supplies its own literal step vocabulary. */
|
|
2
|
+
export type AnalyticsStepName<StepName extends string = string> = StepName;
|
|
3
|
+
export interface AnalyticsCheckoutItem {
|
|
4
|
+
item_id: string;
|
|
5
|
+
quantity: number;
|
|
6
|
+
}
|
|
7
|
+
export interface AnalyticsPurchaseItem extends AnalyticsCheckoutItem {
|
|
8
|
+
item_variant?: string;
|
|
9
|
+
price: number;
|
|
10
|
+
discount: number;
|
|
11
|
+
}
|
|
12
|
+
export type AnalyticsCheckoutMode = "one_time" | "subscription";
|
|
13
|
+
/** No answer describes an ended wait, without asserting payment failure. */
|
|
14
|
+
export type AnalyticsPaymentWaitOutcome = "confirmed" | "refused" | "no_answer";
|
|
15
|
+
export interface AnalyticsEventMap<StepName extends string = string> {
|
|
16
|
+
page_view: {
|
|
17
|
+
page_path: string;
|
|
18
|
+
};
|
|
19
|
+
configurator_start: {
|
|
20
|
+
entry_view: "hero" | "configurator";
|
|
21
|
+
};
|
|
22
|
+
configurator_step_view: {
|
|
23
|
+
step_number: number;
|
|
24
|
+
step_name: AnalyticsStepName<StepName>;
|
|
25
|
+
};
|
|
26
|
+
begin_checkout: {
|
|
27
|
+
checkout_mode: AnalyticsCheckoutMode;
|
|
28
|
+
items: AnalyticsCheckoutItem[];
|
|
29
|
+
};
|
|
30
|
+
purchase: {
|
|
31
|
+
transaction_id: string;
|
|
32
|
+
currency: string;
|
|
33
|
+
value: number;
|
|
34
|
+
shipping: number;
|
|
35
|
+
tax: number;
|
|
36
|
+
checkout_mode: AnalyticsCheckoutMode;
|
|
37
|
+
items: AnalyticsPurchaseItem[];
|
|
38
|
+
};
|
|
39
|
+
payment_wait_start: {
|
|
40
|
+
checkoutMode: AnalyticsCheckoutMode;
|
|
41
|
+
};
|
|
42
|
+
payment_wait_end: {
|
|
43
|
+
outcome: AnalyticsPaymentWaitOutcome;
|
|
44
|
+
checkoutMode: AnalyticsCheckoutMode;
|
|
45
|
+
};
|
|
46
|
+
configurator_draft_restored: {
|
|
47
|
+
draft_context: "public";
|
|
48
|
+
};
|
|
49
|
+
configurator_draft_save_failed: {
|
|
50
|
+
draft_context: "public";
|
|
51
|
+
reason: "unavailable" | "quota" | "conflict";
|
|
52
|
+
};
|
|
53
|
+
configurator_draft_reset: {
|
|
54
|
+
draft_context: "public";
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export type AnalyticsEventName = keyof AnalyticsEventMap;
|
|
58
|
+
export interface AnalyticsSinkAttemptMask {
|
|
59
|
+
deployment: boolean;
|
|
60
|
+
optional: boolean;
|
|
61
|
+
}
|
|
62
|
+
/** Synchronous local acceptance only; never transport delivery or business acknowledgement. */
|
|
63
|
+
export interface AnalyticsSinkAdmission {
|
|
64
|
+
deployment: boolean;
|
|
65
|
+
optional: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface AnalyticsCookieConsent {
|
|
68
|
+
necessary: boolean;
|
|
69
|
+
functional: boolean;
|
|
70
|
+
analytics: boolean;
|
|
71
|
+
marketing: boolean;
|
|
72
|
+
}
|
|
73
|
+
export type AnalyticsBrowserWindow = Pick<Window, "localStorage" | "addEventListener" | "removeEventListener"> & {
|
|
74
|
+
dataLayer?: unknown[];
|
|
75
|
+
};
|
|
76
|
+
export interface AnalyticsDataLayerOptions<StepName extends string = string> {
|
|
77
|
+
consentStorageKey?: string;
|
|
78
|
+
consentChangeEvent?: string;
|
|
79
|
+
/** Host wire names, analytics first then advertising in supplied order. Omission disables consent commands and optional event admission. */
|
|
80
|
+
consentSignalNames?: {
|
|
81
|
+
analytics: string;
|
|
82
|
+
advertising: readonly string[];
|
|
83
|
+
};
|
|
84
|
+
eventPrefix?: string;
|
|
85
|
+
readContainerId?: () => string | null;
|
|
86
|
+
trackDeploymentEvent?: <K extends AnalyticsEventName>(event: K, properties: AnalyticsEventMap<StepName>[K]) => boolean;
|
|
87
|
+
getWindow?: () => AnalyticsBrowserWindow | undefined;
|
|
88
|
+
}
|
|
89
|
+
export interface AnalyticsRoutePolicyInput {
|
|
90
|
+
publicPaths: readonly string[];
|
|
91
|
+
redirectSources: readonly string[];
|
|
92
|
+
privatePathPrefixes: readonly string[];
|
|
93
|
+
privateAuthPaths: readonly string[];
|
|
94
|
+
capabilityPathPrefixes: readonly string[];
|
|
95
|
+
}
|
|
96
|
+
/** Only paid recap facts read by the projection; money remains the host's truth. */
|
|
97
|
+
export interface PurchaseOrder {
|
|
98
|
+
orderId: string;
|
|
99
|
+
status: string;
|
|
100
|
+
paymentStatus: string | null;
|
|
101
|
+
checkoutKind: "one_time" | "subscription_initial" | "subscription_renewal" | null;
|
|
102
|
+
moneyReconciled: boolean;
|
|
103
|
+
items: Array<{
|
|
104
|
+
sku: string | null;
|
|
105
|
+
variantCode: string | null;
|
|
106
|
+
quantity: number;
|
|
107
|
+
catalogTotalGross: number;
|
|
108
|
+
effectiveNet: number;
|
|
109
|
+
vatRateBps: number;
|
|
110
|
+
}>;
|
|
111
|
+
totals: {
|
|
112
|
+
tax: {
|
|
113
|
+
amountMinor: number;
|
|
114
|
+
};
|
|
115
|
+
total: {
|
|
116
|
+
amountMinor: number;
|
|
117
|
+
currency: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export type PurchaseSuppressionReason = "order_not_paid" | "payment_not_succeeded" | "checkout_kind_unsupported" | "money_unreconciled" | "items_empty" | "sku_missing" | "quantity_invalid" | "line_money_invalid" | "net_discount_invalid" | "item_limit_exceeded" | "shipping_net_invalid";
|
|
122
|
+
export interface MarketingHistoricalConsentCommand {
|
|
123
|
+
consentedAt: string | null;
|
|
124
|
+
listId: string | null;
|
|
125
|
+
}
|
|
126
|
+
/** Native state literals are compatibility inputs supplied by the host adapter. */
|
|
127
|
+
export interface MarketingHistoricalConsentState {
|
|
128
|
+
consent: "SUBSCRIBED" | "UNSUBSCRIBED" | "NEVER_SUBSCRIBED" | "unknown";
|
|
129
|
+
nativeConsentAt?: string | null;
|
|
130
|
+
suppressions: Array<{
|
|
131
|
+
reason: "UNSUBSCRIBE" | "SPAM_REPORT" | "USER_SUPPRESSED" | "HARD_BOUNCE" | "INVALID_EMAIL" | "unknown";
|
|
132
|
+
listId: string | null;
|
|
133
|
+
}>;
|
|
134
|
+
}
|
|
135
|
+
export type MarketingHistoricalConsentResult = {
|
|
136
|
+
kind: "ready";
|
|
137
|
+
providerConsentedAt: string;
|
|
138
|
+
} | {
|
|
139
|
+
kind: "defer";
|
|
140
|
+
retryAt: string;
|
|
141
|
+
} | {
|
|
142
|
+
kind: "hold";
|
|
143
|
+
reason: string;
|
|
144
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface OrganizationFacts {
|
|
2
|
+
name: string;
|
|
3
|
+
legalName: string;
|
|
4
|
+
url: string;
|
|
5
|
+
logo: {
|
|
6
|
+
url: string;
|
|
7
|
+
contentUrl: string;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
email: string;
|
|
12
|
+
vatID: string;
|
|
13
|
+
taxID: string;
|
|
14
|
+
areaServed: string;
|
|
15
|
+
sameAs: string[];
|
|
16
|
+
contactPoint: {
|
|
17
|
+
email: string;
|
|
18
|
+
contactType: string;
|
|
19
|
+
availableLanguage: string[];
|
|
20
|
+
};
|
|
21
|
+
address: {
|
|
22
|
+
streetAddress: string;
|
|
23
|
+
addressLocality: string;
|
|
24
|
+
postalCode: string;
|
|
25
|
+
addressRegion: string;
|
|
26
|
+
addressCountry: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface ContactContent {
|
|
30
|
+
organization: OrganizationFacts;
|
|
31
|
+
supportEmail: string;
|
|
32
|
+
addressLine: string;
|
|
33
|
+
registrationIdentifiers: {
|
|
34
|
+
label: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}[];
|
|
37
|
+
registrationAuthority?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface LegalDocumentContent {
|
|
40
|
+
title: string;
|
|
41
|
+
intro: string;
|
|
42
|
+
sections: {
|
|
43
|
+
title: string;
|
|
44
|
+
body: string;
|
|
45
|
+
}[];
|
|
46
|
+
lastUpdated?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface PrivacyProcessorDisclosure {
|
|
49
|
+
processorName: string;
|
|
50
|
+
purpose: string;
|
|
51
|
+
dataCategories: string[];
|
|
52
|
+
details?: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type * from "./acquisition.js";
|
|
2
|
+
export type { MarketingResearchJson, ResearchSurveyType, AdminSurveyResponsesRequest, AdminSurveyResponseRow, AdminSurveyResponsesResponse, ResearchSurveySubmitRequest, ResearchSurveySubmitResponse, MarketingResearchSurveyResponsesReadPort, MarketingResearchSurveyRequestHeaders, MarketingResearchSurveySubmitPort, } from "@openlup/core/marketing/research";
|
|
3
|
+
export type * from "./acquisitionPorts.js";
|
|
4
|
+
export type * from "./prelaunch.js";
|
|
5
|
+
export type * from "./analytics.js";
|
|
6
|
+
export type * from "./contactLegal.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type PrelaunchAcquisitionListRequest = {
|
|
2
|
+
view: "prelaunch_acquisition_v1";
|
|
3
|
+
cursor?: string | undefined;
|
|
4
|
+
limit: number;
|
|
5
|
+
};
|
|
6
|
+
export type PrelaunchAcquisitionDetailRequest = {
|
|
7
|
+
sourceRef: string;
|
|
8
|
+
};
|
|
9
|
+
export type PrelaunchAcquisitionLead = {
|
|
10
|
+
sourceRef: string;
|
|
11
|
+
contactRef: string;
|
|
12
|
+
sourceKind: "tester_application";
|
|
13
|
+
consent: {
|
|
14
|
+
consentVersion: string;
|
|
15
|
+
policyVersion: string;
|
|
16
|
+
recordedAt: string;
|
|
17
|
+
locale: "en" | "pl";
|
|
18
|
+
sourcePath: "/tester-application";
|
|
19
|
+
};
|
|
20
|
+
addressReference: {
|
|
21
|
+
source: string;
|
|
22
|
+
reference: string;
|
|
23
|
+
revision: string;
|
|
24
|
+
provenance: string;
|
|
25
|
+
} | null;
|
|
26
|
+
state: "submitted" | "approved" | "active" | "rejected" | "withdrawn";
|
|
27
|
+
version: number;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
updatedAt: string;
|
|
30
|
+
};
|
|
31
|
+
export type PrelaunchAcquisitionListResponse = {
|
|
32
|
+
contractVersion: "prelaunch_acquisition_v1";
|
|
33
|
+
leads: PrelaunchAcquisitionLead[];
|
|
34
|
+
nextCursor: string | null;
|
|
35
|
+
};
|
|
36
|
+
export type PrelaunchAcquisitionDetailResponse = {
|
|
37
|
+
contractVersion: "prelaunch_acquisition_v1";
|
|
38
|
+
lead: PrelaunchAcquisitionLead;
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./acquisitionCaseSchemas.js";
|
|
2
|
+
export * from "./acquisitionEvidenceSchemas.js";
|
|
3
|
+
export * from "@openlup/core/marketing/research";
|
|
4
|
+
export * from "./prelaunchAcquisitionSchemas.js";
|
|
5
|
+
export type * from "./contracts/acquisitionPorts.js";
|
|
6
|
+
export * from "./analytics/noop.js";
|
|
7
|
+
export * from "./analytics/dataLayer.js";
|
|
8
|
+
export * from "./analytics/routePolicy.js";
|
|
9
|
+
export * from "./analytics/purchaseFacts.js";
|
|
10
|
+
export * from "./consentEvidence.js";
|
|
11
|
+
export * from "./seo/serializeJsonLd.js";
|
|
12
|
+
export * from "./seo/urls.js";
|
|
13
|
+
export * from "./seo/metadata.js";
|
|
14
|
+
export * from "./seo/jsonLd.js";
|
|
15
|
+
export type * from "./contracts/contactLegal.js";
|
|
16
|
+
export * from "./contactLegal.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./acquisitionCaseSchemas.js";
|
|
2
|
+
export * from "./acquisitionEvidenceSchemas.js";
|
|
3
|
+
export * from "@openlup/core/marketing/research";
|
|
4
|
+
export * from "./prelaunchAcquisitionSchemas.js";
|
|
5
|
+
export * from "./analytics/noop.js";
|
|
6
|
+
export * from "./analytics/dataLayer.js";
|
|
7
|
+
export * from "./analytics/routePolicy.js";
|
|
8
|
+
export * from "./analytics/purchaseFacts.js";
|
|
9
|
+
export * from "./consentEvidence.js";
|
|
10
|
+
export * from "./seo/serializeJsonLd.js";
|
|
11
|
+
export * from "./seo/urls.js";
|
|
12
|
+
export * from "./seo/metadata.js";
|
|
13
|
+
export * from "./seo/jsonLd.js";
|
|
14
|
+
export * from "./contactLegal.js";
|