@openlup/platform 0.28.0 → 0.29.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.
Files changed (124) hide show
  1. package/CHANGELOG.md +219 -18
  2. package/README.md +143 -4
  3. package/dist/composition/index.d.ts +1 -0
  4. package/dist/composition/index.js +1 -0
  5. package/dist/composition/marketingContribution.d.ts +21 -0
  6. package/dist/composition/marketingContribution.js +29 -0
  7. package/dist/marketing/acquisitionCaseSchemas.d.ts +103 -0
  8. package/dist/marketing/acquisitionCaseSchemas.js +53 -0
  9. package/dist/marketing/acquisitionEvidenceSchemas.d.ts +105 -0
  10. package/dist/marketing/acquisitionEvidenceSchemas.js +55 -0
  11. package/dist/marketing/analytics/dataLayer.d.ts +18 -0
  12. package/dist/marketing/analytics/dataLayer.js +111 -0
  13. package/dist/marketing/analytics/noop.d.ts +9 -0
  14. package/dist/marketing/analytics/noop.js +8 -0
  15. package/dist/marketing/analytics/purchaseFacts.d.ts +4 -0
  16. package/dist/marketing/analytics/purchaseFacts.js +69 -0
  17. package/dist/marketing/analytics/routePolicy.d.ts +10 -0
  18. package/dist/marketing/analytics/routePolicy.js +59 -0
  19. package/dist/marketing/consentEvidence.d.ts +8 -0
  20. package/dist/marketing/consentEvidence.js +32 -0
  21. package/dist/marketing/contactLegal.d.ts +14 -0
  22. package/dist/marketing/contactLegal.js +19 -0
  23. package/dist/marketing/contracts/acquisition.d.ts +88 -0
  24. package/dist/marketing/contracts/acquisition.js +1 -0
  25. package/dist/marketing/contracts/acquisitionPorts.d.ts +49 -0
  26. package/dist/marketing/contracts/acquisitionPorts.js +1 -0
  27. package/dist/marketing/contracts/analytics.d.ts +144 -0
  28. package/dist/marketing/contracts/analytics.js +1 -0
  29. package/dist/marketing/contracts/contactLegal.d.ts +53 -0
  30. package/dist/marketing/contracts/contactLegal.js +1 -0
  31. package/dist/marketing/contracts/index.d.ts +6 -0
  32. package/dist/marketing/contracts/index.js +1 -0
  33. package/dist/marketing/contracts/prelaunch.d.ts +39 -0
  34. package/dist/marketing/contracts/prelaunch.js +1 -0
  35. package/dist/marketing/index.d.ts +16 -0
  36. package/dist/marketing/index.js +14 -0
  37. package/dist/marketing/prelaunchAcquisitionSchemas.d.ts +116 -0
  38. package/dist/marketing/prelaunchAcquisitionSchemas.js +51 -0
  39. package/dist/marketing/seo/jsonLd.d.ts +157 -0
  40. package/dist/marketing/seo/jsonLd.js +127 -0
  41. package/dist/marketing/seo/metadata.d.ts +41 -0
  42. package/dist/marketing/seo/metadata.js +36 -0
  43. package/dist/marketing/seo/serializeJsonLd.d.ts +1 -0
  44. package/dist/marketing/seo/serializeJsonLd.js +6 -0
  45. package/dist/marketing/seo/urls.d.ts +14 -0
  46. package/dist/marketing/seo/urls.js +23 -0
  47. package/dist/marketing/server/acquisitionCaseDirect.d.ts +4 -0
  48. package/dist/marketing/server/acquisitionCaseDirect.js +88 -0
  49. package/dist/marketing/server/acquisitionCaseHandlers.d.ts +28 -0
  50. package/dist/marketing/server/acquisitionCaseHandlers.js +40 -0
  51. package/dist/marketing/server/acquisitionCasePorts.d.ts +42 -0
  52. package/dist/marketing/server/acquisitionCasePorts.js +1 -0
  53. package/dist/marketing/server/acquisitionEvidenceDirect.d.ts +5 -0
  54. package/dist/marketing/server/acquisitionEvidenceDirect.js +100 -0
  55. package/dist/marketing/server/analyticsContext.d.ts +3 -0
  56. package/dist/marketing/server/analyticsContext.js +65 -0
  57. package/dist/marketing/server/analyticsContextPorts.d.ts +31 -0
  58. package/dist/marketing/server/analyticsContextPorts.js +1 -0
  59. package/dist/marketing/server/bindings.d.ts +14 -0
  60. package/dist/marketing/server/bindings.js +18 -0
  61. package/dist/marketing/server/directPorts.d.ts +26 -0
  62. package/dist/marketing/server/directPorts.js +1 -0
  63. package/dist/marketing/server/index.d.ts +14 -0
  64. package/dist/marketing/server/index.js +11 -0
  65. package/dist/marketing/server/postgres/acquisitionCaseRoutines.d.ts +10 -0
  66. package/dist/marketing/server/postgres/acquisitionCaseRoutines.js +204 -0
  67. package/dist/marketing/server/postgres/acquisitionEvidenceRoutines.d.ts +10 -0
  68. package/dist/marketing/server/postgres/acquisitionEvidenceRoutines.js +107 -0
  69. package/dist/marketing/server/postgres/index.d.ts +3 -0
  70. package/dist/marketing/server/postgres/index.js +3 -0
  71. package/dist/marketing/server/prelaunchAcquisitionDirect.d.ts +4 -0
  72. package/dist/marketing/server/prelaunchAcquisitionDirect.js +122 -0
  73. package/dist/marketing/server/privacyContributor.d.ts +66 -0
  74. package/dist/marketing/server/privacyContributor.js +87 -0
  75. package/dist/marketing/server/research/adminSurveyResponsesHandler.d.ts +9 -0
  76. package/dist/marketing/server/research/adminSurveyResponsesHandler.js +53 -0
  77. package/dist/marketing/server/research/managedSurveyResponseSubmit.d.ts +39 -0
  78. package/dist/marketing/server/research/managedSurveyResponseSubmit.js +102 -0
  79. package/dist/marketing/server/research/surveyResponseSubmitHandler.d.ts +8 -0
  80. package/dist/marketing/server/research/surveyResponseSubmitHandler.js +41 -0
  81. package/dist/marketing/validation.d.ts +2 -0
  82. package/dist/marketing/validation.js +3 -0
  83. package/package.json +22 -2
  84. package/release-gates.json +72 -4
  85. package/src/composition/index.ts +1 -0
  86. package/src/composition/marketingContribution.ts +37 -0
  87. package/src/marketing/acquisitionCaseSchemas.ts +75 -0
  88. package/src/marketing/acquisitionEvidenceSchemas.ts +72 -0
  89. package/src/marketing/analytics/dataLayer.ts +100 -0
  90. package/src/marketing/analytics/noop.ts +14 -0
  91. package/src/marketing/analytics/purchaseFacts.ts +63 -0
  92. package/src/marketing/analytics/routePolicy.ts +55 -0
  93. package/src/marketing/consentEvidence.ts +36 -0
  94. package/src/marketing/contactLegal.ts +22 -0
  95. package/src/marketing/contracts/acquisition.ts +50 -0
  96. package/src/marketing/contracts/acquisitionPorts.ts +48 -0
  97. package/src/marketing/contracts/analytics.ts +88 -0
  98. package/src/marketing/contracts/contactLegal.ts +41 -0
  99. package/src/marketing/contracts/index.ts +17 -0
  100. package/src/marketing/contracts/prelaunch.ts +15 -0
  101. package/src/marketing/index.ts +16 -0
  102. package/src/marketing/prelaunchAcquisitionSchemas.ts +64 -0
  103. package/src/marketing/seo/jsonLd.ts +153 -0
  104. package/src/marketing/seo/metadata.ts +62 -0
  105. package/src/marketing/seo/serializeJsonLd.ts +6 -0
  106. package/src/marketing/seo/urls.ts +34 -0
  107. package/src/marketing/server/acquisitionCaseDirect.ts +67 -0
  108. package/src/marketing/server/acquisitionCaseHandlers.ts +57 -0
  109. package/src/marketing/server/acquisitionCasePorts.ts +42 -0
  110. package/src/marketing/server/acquisitionEvidenceDirect.ts +76 -0
  111. package/src/marketing/server/analyticsContext.ts +55 -0
  112. package/src/marketing/server/analyticsContextPorts.ts +28 -0
  113. package/src/marketing/server/bindings.ts +27 -0
  114. package/src/marketing/server/directPorts.ts +27 -0
  115. package/src/marketing/server/index.ts +14 -0
  116. package/src/marketing/server/postgres/acquisitionCaseRoutines.ts +218 -0
  117. package/src/marketing/server/postgres/acquisitionEvidenceRoutines.ts +103 -0
  118. package/src/marketing/server/postgres/index.ts +3 -0
  119. package/src/marketing/server/prelaunchAcquisitionDirect.ts +121 -0
  120. package/src/marketing/server/privacyContributor.ts +123 -0
  121. package/src/marketing/server/research/adminSurveyResponsesHandler.ts +78 -0
  122. package/src/marketing/server/research/managedSurveyResponseSubmit.ts +158 -0
  123. package/src/marketing/server/research/surveyResponseSubmitHandler.ts +57 -0
  124. package/src/marketing/validation.ts +3 -0
@@ -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";
@@ -0,0 +1,116 @@
1
+ import { z } from "./validation.js";
2
+ export declare const PRELAUNCH_ACQUISITION_VIEW: "prelaunch_acquisition_v1";
3
+ export declare const PRELAUNCH_ACQUISITION_CONTRACT_VERSION: "prelaunch_acquisition_v1";
4
+ export declare const prelaunchAcquisitionListRequestSchema: z.ZodObject<{
5
+ view: z.ZodLiteral<"prelaunch_acquisition_v1">;
6
+ cursor: z.ZodOptional<z.ZodString>;
7
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
8
+ }, z.core.$strict>;
9
+ export declare const prelaunchAcquisitionDetailRequestSchema: z.ZodObject<{
10
+ sourceRef: z.ZodString;
11
+ }, z.core.$strict>;
12
+ export declare const prelaunchAcquisitionLeadSchema: z.ZodObject<{
13
+ sourceRef: z.ZodString;
14
+ contactRef: z.ZodString;
15
+ sourceKind: z.ZodLiteral<"tester_application">;
16
+ consent: z.ZodObject<{
17
+ consentVersion: z.ZodString;
18
+ policyVersion: z.ZodString;
19
+ recordedAt: z.ZodString;
20
+ locale: z.ZodEnum<{
21
+ en: "en";
22
+ pl: "pl";
23
+ }>;
24
+ sourcePath: z.ZodLiteral<"/tester-application">;
25
+ }, z.core.$strict>;
26
+ addressReference: z.ZodNullable<z.ZodObject<{
27
+ source: z.ZodString;
28
+ reference: z.ZodString;
29
+ revision: z.ZodString;
30
+ provenance: z.ZodString;
31
+ }, z.core.$strict>>;
32
+ state: z.ZodEnum<{
33
+ rejected: "rejected";
34
+ active: "active";
35
+ submitted: "submitted";
36
+ withdrawn: "withdrawn";
37
+ approved: "approved";
38
+ }>;
39
+ version: z.ZodNumber;
40
+ createdAt: z.ZodString;
41
+ updatedAt: z.ZodString;
42
+ }, z.core.$strict>;
43
+ export declare const prelaunchAcquisitionListResponseSchema: z.ZodObject<{
44
+ contractVersion: z.ZodLiteral<"prelaunch_acquisition_v1">;
45
+ leads: z.ZodArray<z.ZodObject<{
46
+ sourceRef: z.ZodString;
47
+ contactRef: z.ZodString;
48
+ sourceKind: z.ZodLiteral<"tester_application">;
49
+ consent: z.ZodObject<{
50
+ consentVersion: z.ZodString;
51
+ policyVersion: z.ZodString;
52
+ recordedAt: z.ZodString;
53
+ locale: z.ZodEnum<{
54
+ en: "en";
55
+ pl: "pl";
56
+ }>;
57
+ sourcePath: z.ZodLiteral<"/tester-application">;
58
+ }, z.core.$strict>;
59
+ addressReference: z.ZodNullable<z.ZodObject<{
60
+ source: z.ZodString;
61
+ reference: z.ZodString;
62
+ revision: z.ZodString;
63
+ provenance: z.ZodString;
64
+ }, z.core.$strict>>;
65
+ state: z.ZodEnum<{
66
+ rejected: "rejected";
67
+ active: "active";
68
+ submitted: "submitted";
69
+ withdrawn: "withdrawn";
70
+ approved: "approved";
71
+ }>;
72
+ version: z.ZodNumber;
73
+ createdAt: z.ZodString;
74
+ updatedAt: z.ZodString;
75
+ }, z.core.$strict>>;
76
+ nextCursor: z.ZodNullable<z.ZodString>;
77
+ }, z.core.$strict>;
78
+ export declare const prelaunchAcquisitionDetailResponseSchema: z.ZodObject<{
79
+ contractVersion: z.ZodLiteral<"prelaunch_acquisition_v1">;
80
+ lead: z.ZodObject<{
81
+ sourceRef: z.ZodString;
82
+ contactRef: z.ZodString;
83
+ sourceKind: z.ZodLiteral<"tester_application">;
84
+ consent: z.ZodObject<{
85
+ consentVersion: z.ZodString;
86
+ policyVersion: z.ZodString;
87
+ recordedAt: z.ZodString;
88
+ locale: z.ZodEnum<{
89
+ en: "en";
90
+ pl: "pl";
91
+ }>;
92
+ sourcePath: z.ZodLiteral<"/tester-application">;
93
+ }, z.core.$strict>;
94
+ addressReference: z.ZodNullable<z.ZodObject<{
95
+ source: z.ZodString;
96
+ reference: z.ZodString;
97
+ revision: z.ZodString;
98
+ provenance: z.ZodString;
99
+ }, z.core.$strict>>;
100
+ state: z.ZodEnum<{
101
+ rejected: "rejected";
102
+ active: "active";
103
+ submitted: "submitted";
104
+ withdrawn: "withdrawn";
105
+ approved: "approved";
106
+ }>;
107
+ version: z.ZodNumber;
108
+ createdAt: z.ZodString;
109
+ updatedAt: z.ZodString;
110
+ }, z.core.$strict>;
111
+ }, z.core.$strict>;
112
+ export type PrelaunchAcquisitionListRequest = z.infer<typeof prelaunchAcquisitionListRequestSchema>;
113
+ export type PrelaunchAcquisitionDetailRequest = z.infer<typeof prelaunchAcquisitionDetailRequestSchema>;
114
+ export type PrelaunchAcquisitionLead = z.infer<typeof prelaunchAcquisitionLeadSchema>;
115
+ export type PrelaunchAcquisitionListResponse = z.infer<typeof prelaunchAcquisitionListResponseSchema>;
116
+ export type PrelaunchAcquisitionDetailResponse = z.infer<typeof prelaunchAcquisitionDetailResponseSchema>;
@@ -0,0 +1,51 @@
1
+ import { z } from "./validation.js";
2
+ export const PRELAUNCH_ACQUISITION_VIEW = "prelaunch_acquisition_v1";
3
+ export const PRELAUNCH_ACQUISITION_CONTRACT_VERSION = "prelaunch_acquisition_v1";
4
+ const acquisitionCaseRefSchema = z.string().regex(/^acquisition-case:[0-9a-f-]{36}$/);
5
+ const acquisitionContactRefSchema = z.string().regex(/^acquisition-contact:[0-9a-f-]{36}$/);
6
+ const acquisitionOpaqueRefSchema = z.string().trim().min(8).max(160)
7
+ .regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/);
8
+ const acquisitionDateTimeSchema = z.string().datetime({ offset: true });
9
+ export const prelaunchAcquisitionListRequestSchema = z.object({
10
+ view: z.literal(PRELAUNCH_ACQUISITION_VIEW),
11
+ cursor: acquisitionOpaqueRefSchema.optional(),
12
+ limit: z.coerce.number().int().min(1).max(100).default(25),
13
+ }).strict();
14
+ export const prelaunchAcquisitionDetailRequestSchema = z.object({
15
+ sourceRef: acquisitionCaseRefSchema,
16
+ }).strict();
17
+ export const prelaunchAcquisitionLeadSchema = z.object({
18
+ sourceRef: acquisitionCaseRefSchema,
19
+ contactRef: acquisitionContactRefSchema,
20
+ sourceKind: z.literal("tester_application"),
21
+ consent: z.object({
22
+ consentVersion: z.string().min(1).max(64),
23
+ policyVersion: z.string().min(1).max(64),
24
+ recordedAt: acquisitionDateTimeSchema,
25
+ locale: z.enum(["en", "pl"]),
26
+ sourcePath: z.literal("/tester-application"),
27
+ }).strict(),
28
+ addressReference: z.object({
29
+ source: z.string().trim().min(1).max(48).regex(/^[a-z][a-z0-9_-]*$/),
30
+ reference: acquisitionOpaqueRefSchema,
31
+ revision: z.string().trim().min(1).max(64).regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/),
32
+ provenance: z.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),
33
+ }).strict().nullable(),
34
+ state: z.enum(["submitted", "approved", "active", "rejected", "withdrawn"]),
35
+ version: z.number().int().positive(),
36
+ createdAt: acquisitionDateTimeSchema,
37
+ updatedAt: acquisitionDateTimeSchema,
38
+ }).strict().superRefine((value, context) => {
39
+ if (value.state !== "withdrawn" && value.addressReference === null) {
40
+ context.addIssue({ code: z.ZodIssueCode.custom, path: ["addressReference"], message: "active case requires address reference" });
41
+ }
42
+ });
43
+ export const prelaunchAcquisitionListResponseSchema = z.object({
44
+ contractVersion: z.literal(PRELAUNCH_ACQUISITION_CONTRACT_VERSION),
45
+ leads: z.array(prelaunchAcquisitionLeadSchema).max(100),
46
+ nextCursor: acquisitionOpaqueRefSchema.nullable(),
47
+ }).strict();
48
+ export const prelaunchAcquisitionDetailResponseSchema = z.object({
49
+ contractVersion: z.literal(PRELAUNCH_ACQUISITION_CONTRACT_VERSION),
50
+ lead: prelaunchAcquisitionLeadSchema,
51
+ }).strict();