@openpolicy/core 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +56 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +308 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -9,14 +9,15 @@ type PolicySection = {
|
|
|
9
9
|
body: string;
|
|
10
10
|
};
|
|
11
11
|
type Jurisdiction = "us" | "eu" | "ca" | "au" | "nz" | "other";
|
|
12
|
+
type CompanyConfig = {
|
|
13
|
+
name: string;
|
|
14
|
+
legalName: string;
|
|
15
|
+
address: string;
|
|
16
|
+
contact: string;
|
|
17
|
+
};
|
|
12
18
|
type PrivacyPolicyConfig = {
|
|
13
19
|
effectiveDate: string;
|
|
14
|
-
company:
|
|
15
|
-
name: string;
|
|
16
|
-
legalName: string;
|
|
17
|
-
address: string;
|
|
18
|
-
contact: string;
|
|
19
|
-
};
|
|
20
|
+
company: CompanyConfig;
|
|
20
21
|
dataCollected: Record<string, string[]>;
|
|
21
22
|
legalBasis: string;
|
|
22
23
|
retention: Record<string, string>;
|
|
@@ -31,16 +32,15 @@ type PrivacyPolicyConfig = {
|
|
|
31
32
|
}[];
|
|
32
33
|
userRights: string[];
|
|
33
34
|
jurisdictions: Jurisdiction[];
|
|
35
|
+
children?: {
|
|
36
|
+
underAge: number;
|
|
37
|
+
noticeUrl?: string;
|
|
38
|
+
};
|
|
34
39
|
};
|
|
35
40
|
type DisputeResolutionMethod = "arbitration" | "litigation" | "mediation";
|
|
36
41
|
type TermsOfServiceConfig = {
|
|
37
42
|
effectiveDate: string;
|
|
38
|
-
company:
|
|
39
|
-
name: string;
|
|
40
|
-
legalName: string;
|
|
41
|
-
address: string;
|
|
42
|
-
contact: string;
|
|
43
|
-
};
|
|
43
|
+
company: CompanyConfig;
|
|
44
44
|
acceptance: {
|
|
45
45
|
methods: string[];
|
|
46
46
|
};
|
|
@@ -108,16 +108,54 @@ type TermsOfServiceConfig = {
|
|
|
108
108
|
};
|
|
109
109
|
privacyPolicyUrl?: string;
|
|
110
110
|
};
|
|
111
|
+
type CookiePolicyConfig = {
|
|
112
|
+
effectiveDate: string;
|
|
113
|
+
company: CompanyConfig;
|
|
114
|
+
cookies: {
|
|
115
|
+
essential: boolean;
|
|
116
|
+
analytics: boolean;
|
|
117
|
+
functional: boolean;
|
|
118
|
+
marketing: boolean;
|
|
119
|
+
};
|
|
120
|
+
thirdParties?: {
|
|
121
|
+
name: string;
|
|
122
|
+
purpose: string;
|
|
123
|
+
policyUrl?: string;
|
|
124
|
+
}[];
|
|
125
|
+
trackingTechnologies?: string[];
|
|
126
|
+
consentMechanism?: {
|
|
127
|
+
hasBanner: boolean;
|
|
128
|
+
hasPreferencePanel: boolean;
|
|
129
|
+
canWithdraw: boolean;
|
|
130
|
+
};
|
|
131
|
+
jurisdictions: Jurisdiction[];
|
|
132
|
+
};
|
|
111
133
|
type PolicyInput = ({
|
|
112
134
|
type: "privacy";
|
|
113
135
|
} & PrivacyPolicyConfig) | ({
|
|
114
136
|
type: "terms";
|
|
115
|
-
} & TermsOfServiceConfig)
|
|
137
|
+
} & TermsOfServiceConfig) | ({
|
|
138
|
+
type: "cookie";
|
|
139
|
+
} & CookiePolicyConfig);
|
|
140
|
+
type OpenPolicyConfig = {
|
|
141
|
+
company: CompanyConfig;
|
|
142
|
+
privacy?: Omit<PrivacyPolicyConfig, "company">;
|
|
143
|
+
terms?: Omit<TermsOfServiceConfig, "company">;
|
|
144
|
+
cookie?: Omit<CookiePolicyConfig, "company">;
|
|
145
|
+
};
|
|
146
|
+
declare function isOpenPolicyConfig(value: unknown): value is OpenPolicyConfig;
|
|
116
147
|
type ValidationIssue = {
|
|
117
148
|
level: "error" | "warning";
|
|
118
149
|
message: string;
|
|
119
150
|
};
|
|
120
151
|
//#endregion
|
|
152
|
+
//#region src/cookie.d.ts
|
|
153
|
+
declare function compileCookiePolicy(config: CookiePolicyConfig, options?: CompileOptions): {
|
|
154
|
+
format: OutputFormat;
|
|
155
|
+
content: string;
|
|
156
|
+
sections: PolicySection[];
|
|
157
|
+
}[];
|
|
158
|
+
//#endregion
|
|
121
159
|
//#region src/privacy.d.ts
|
|
122
160
|
declare function compilePrivacyPolicy(config: PrivacyPolicyConfig, options?: CompileOptions): {
|
|
123
161
|
format: OutputFormat;
|
|
@@ -135,15 +173,19 @@ declare function compileTermsOfService(config: TermsOfServiceConfig, options?: C
|
|
|
135
173
|
//#region src/validate.d.ts
|
|
136
174
|
declare function validatePrivacyPolicy(config: PrivacyPolicyConfig): ValidationIssue[];
|
|
137
175
|
//#endregion
|
|
176
|
+
//#region src/validate-cookie.d.ts
|
|
177
|
+
declare function validateCookiePolicy(config: CookiePolicyConfig): ValidationIssue[];
|
|
178
|
+
//#endregion
|
|
138
179
|
//#region src/validate-terms.d.ts
|
|
139
180
|
declare function validateTermsOfService(config: TermsOfServiceConfig): ValidationIssue[];
|
|
140
181
|
//#endregion
|
|
141
182
|
//#region src/index.d.ts
|
|
183
|
+
declare function expandOpenPolicyConfig(config: OpenPolicyConfig): PolicyInput[];
|
|
142
184
|
declare function compilePolicy(input: PolicyInput, options?: CompileOptions): {
|
|
143
185
|
format: OutputFormat;
|
|
144
186
|
content: string;
|
|
145
187
|
sections: PolicySection[];
|
|
146
188
|
}[];
|
|
147
189
|
//#endregion
|
|
148
|
-
export { type CompileOptions, type DisputeResolutionMethod, type Jurisdiction, type OutputFormat, type PolicyInput, type PolicySection, type PrivacyPolicyConfig, type TermsOfServiceConfig, type ValidationIssue, compilePolicy, compilePrivacyPolicy, compileTermsOfService, validatePrivacyPolicy, validateTermsOfService };
|
|
190
|
+
export { type CompanyConfig, type CompileOptions, type CookiePolicyConfig, type DisputeResolutionMethod, type Jurisdiction, type OpenPolicyConfig, type OutputFormat, type PolicyInput, type PolicySection, type PrivacyPolicyConfig, type TermsOfServiceConfig, type ValidationIssue, compileCookiePolicy, compilePolicy, compilePrivacyPolicy, compileTermsOfService, expandOpenPolicyConfig, isOpenPolicyConfig, validateCookiePolicy, validatePrivacyPolicy, validateTermsOfService };
|
|
149
191
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/privacy.ts","../src/terms.ts","../src/validate.ts","../src/validate-terms.ts","../src/index.ts"],"mappings":";KAAY,YAAA;AAAA,KAEA,cAAA;EAAmB,OAAA,EAAS,YAAA;AAAA;AAAA,KAE5B,aAAA;EACX,EAAA;EACA,KAAA;EACA,IAAA;AAAA;AAAA,KAGW,YAAA;AAAA,KAEA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/cookie.ts","../src/privacy.ts","../src/terms.ts","../src/validate.ts","../src/validate-cookie.ts","../src/validate-terms.ts","../src/index.ts"],"mappings":";KAAY,YAAA;AAAA,KAEA,cAAA;EAAmB,OAAA,EAAS,YAAA;AAAA;AAAA,KAE5B,aAAA;EACX,EAAA;EACA,KAAA;EACA,IAAA;AAAA;AAAA,KAGW,YAAA;AAAA,KAEA,aAAA;EACX,IAAA;EACA,SAAA;EACA,OAAA;EACA,OAAA;AAAA;AAAA,KAGW,mBAAA;EACX,aAAA;EACA,OAAA,EAAS,aAAA;EACT,aAAA,EAAe,MAAA;EACf,UAAA;EACA,SAAA,EAAW,MAAA;EACX,OAAA;IAAW,SAAA;IAAoB,SAAA;IAAoB,SAAA;EAAA;EACnD,YAAA;IAAgB,IAAA;IAAc,OAAA;EAAA;EAC9B,UAAA;EACA,aAAA,EAAe,YAAA;EAEf,QAAA;IACC,QAAA;IACA,SAAA;EAAA;AAAA;AAAA,KAIU,uBAAA;AAAA,KAKA,oBAAA;EACX,aAAA;EACA,OAAA,EAAS,aAAA;EACT,UAAA;IAAc,OAAA;EAAA;EACd,WAAA;IAAgB,UAAA;IAAoB,wBAAA;E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A,YAAiB,KAAA,IAAS,gBAAA;AAAA,KAUjD,eAAA;EACX,KAAA;EACA,OAAA;AAAA;;;iBC7Fe,mBAAA,CACf,MAAA,EAAQ,kBAAA,EACR,OAAA,GAAS,cAAA;EACL,MAAA,EAAQ,YAAA;EAAc,OAAA;EAAiB,QAAA,EAAU,aAAA;AAAA;;;iBCLtC,oBAAA,CACf,MAAA,EAAQ,mBAAA,EACR,OAAA,GAAS,cAAA;EACL,MAAA,EAAQ,YAAA;EAAc,OAAA;EAAiB,QAAA,EAAU,aAAA;AAAA;;;iBCStC,qBAAA,CACf,MAAA,EAAQ,oBAAA,EACR,OAAA,GAAS,cAAA;EACL,MAAA,EAAQ,YAAA;EAAc,OAAA;EAAiB,QAAA,EAAU,aAAA;AAAA;;;iBCnDtC,qBAAA,CACf,MAAA,EAAQ,mBAAA,GACN,eAAA;;;iBCFa,oBAAA,CACf,MAAA,EAAQ,kBAAA,GACN,eAAA;;;iBCFa,sBAAA,CACf,MAAA,EAAQ,oBAAA,GACN,eAAA;;;iBCuBa,sBAAA,CACf,MAAA,EAAQ,gBAAA,GACN,WAAA;AAAA,iBAkBa,aAAA,CAAc,KAAA,EAAO,WAAA,EAAa,OAAA,GAAU,cAAA;UAAc,YAAA"}
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,224 @@ function renderHTML(sections) {
|
|
|
9
9
|
return marked(renderMarkdown(sections));
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
|
+
//#region src/templates/cookie/consent.ts
|
|
13
|
+
function buildConsent(config) {
|
|
14
|
+
if (!config.consentMechanism) return null;
|
|
15
|
+
const mechanisms = [];
|
|
16
|
+
if (config.consentMechanism.hasBanner) mechanisms.push("A **cookie consent banner** displayed on your first visit, where you can accept or decline non-essential cookies");
|
|
17
|
+
if (config.consentMechanism.hasPreferencePanel) mechanisms.push("A **preference panel** where you can manage individual cookie categories");
|
|
18
|
+
if (config.consentMechanism.canWithdraw) mechanisms.push("The ability to **withdraw your consent** at any time by updating your cookie preferences");
|
|
19
|
+
return {
|
|
20
|
+
id: "consent",
|
|
21
|
+
title: "User Consent",
|
|
22
|
+
body: `Where required by law, we will request your consent before placing non-essential cookies on your device.${mechanisms.length > 0 ? `\n\nWe provide the following consent controls:\n\n${mechanisms.map((m) => `- ${m}`).join("\n")}` : ""}
|
|
23
|
+
|
|
24
|
+
Essential cookies do not require your consent as they are strictly necessary for the operation of our service.`
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/templates/cookie/contact.ts
|
|
29
|
+
function buildContact$2(config) {
|
|
30
|
+
return {
|
|
31
|
+
id: "contact",
|
|
32
|
+
title: "Contact Us",
|
|
33
|
+
body: `If you have any questions about our use of cookies or this Cookie Policy, please contact us:
|
|
34
|
+
|
|
35
|
+
**${config.company.legalName}**
|
|
36
|
+
${config.company.address}
|
|
37
|
+
${config.company.contact}`
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/templates/cookie/cookie-duration.ts
|
|
42
|
+
function buildCookieDuration(_config) {
|
|
43
|
+
return {
|
|
44
|
+
id: "cookie-duration",
|
|
45
|
+
title: "Cookie Duration",
|
|
46
|
+
body: `Cookies can be either **session cookies** or **persistent cookies**:
|
|
47
|
+
|
|
48
|
+
- **Session cookies** are temporary and are deleted from your device when you close your browser. They are used to carry information across pages of our website and avoid having to re-enter information.
|
|
49
|
+
- **Persistent cookies** remain on your device for a set period of time specified in the cookie. They are activated each time you visit the website that created that particular cookie.
|
|
50
|
+
|
|
51
|
+
The specific duration of each cookie depends on its purpose and is determined at the time it is set.`
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/templates/cookie/cookie-types.ts
|
|
56
|
+
function buildCookieTypes(config) {
|
|
57
|
+
const types = [];
|
|
58
|
+
if (config.cookies.essential) types.push("**Essential Cookies** — These cookies are necessary for our website to function and cannot be switched off. They are usually set in response to actions you take, such as setting your privacy preferences, logging in, or filling in forms.");
|
|
59
|
+
if (config.cookies.analytics) types.push("**Analytics Cookies** — These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand which pages are most and least popular and see how visitors move around the site.");
|
|
60
|
+
if (config.cookies.functional) types.push("**Functional Cookies** — These cookies enable enhanced functionality and personalization, such as remembering your preferences and settings. They may be set by us or by third-party providers whose services we have added to our pages.");
|
|
61
|
+
if (config.cookies.marketing) types.push("**Marketing Cookies** — These cookies may be set through our site by our advertising partners. They may be used to build a profile of your interests and show you relevant advertisements on other sites.");
|
|
62
|
+
return {
|
|
63
|
+
id: "cookie-types",
|
|
64
|
+
title: "Types of Cookies We Use",
|
|
65
|
+
body: `We use the following categories of cookies:\n\n${types.map((t) => `- ${t}`).join("\n")}`
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/templates/cookie/cookie-usage.ts
|
|
70
|
+
function buildCookieUsage(config) {
|
|
71
|
+
const purposes = [];
|
|
72
|
+
if (config.cookies.essential) {
|
|
73
|
+
purposes.push("Providing core website functionality and security");
|
|
74
|
+
purposes.push("Remembering your session and authentication state");
|
|
75
|
+
}
|
|
76
|
+
if (config.cookies.analytics) {
|
|
77
|
+
purposes.push("Measuring website traffic and usage patterns");
|
|
78
|
+
purposes.push("Identifying which pages and features are most popular");
|
|
79
|
+
}
|
|
80
|
+
if (config.cookies.functional) {
|
|
81
|
+
purposes.push("Saving your preferences and settings");
|
|
82
|
+
purposes.push("Providing personalized content and features");
|
|
83
|
+
}
|
|
84
|
+
if (config.cookies.marketing) {
|
|
85
|
+
purposes.push("Delivering targeted advertising");
|
|
86
|
+
purposes.push("Tracking the effectiveness of our marketing campaigns");
|
|
87
|
+
}
|
|
88
|
+
const list = purposes.map((p) => `- ${p}`).join("\n");
|
|
89
|
+
return {
|
|
90
|
+
id: "cookie-usage",
|
|
91
|
+
title: "How We Use Cookies",
|
|
92
|
+
body: `${config.company.name} uses cookies to:\n\n${list}`
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/templates/cookie/introduction.ts
|
|
97
|
+
function buildIntroduction$2(config) {
|
|
98
|
+
return {
|
|
99
|
+
id: "introduction",
|
|
100
|
+
title: "Introduction",
|
|
101
|
+
body: `This Cookie Policy explains how ${config.company.name} ("we", "us", or "our") uses cookies and similar tracking technologies when you visit our website or use our services.
|
|
102
|
+
|
|
103
|
+
**Effective Date:** ${config.effectiveDate}
|
|
104
|
+
|
|
105
|
+
By using our services, you consent to the use of cookies as described in this policy. If you have questions, please contact us at ${config.company.contact}.`
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/templates/cookie/jurisdiction.ts
|
|
110
|
+
function buildJurisdiction(config) {
|
|
111
|
+
if (!config.jurisdictions || config.jurisdictions.length === 0) return null;
|
|
112
|
+
const requirements = [];
|
|
113
|
+
if (config.jurisdictions.includes("eu")) requirements.push("**European Union (GDPR/ePrivacy Directive):** We comply with EU cookie consent requirements. Non-essential cookies require your prior, informed, and freely given consent. You have the right to withdraw consent at any time.");
|
|
114
|
+
if (config.jurisdictions.includes("ca")) requirements.push("**California (CCPA):** California residents have the right to opt out of the sale of personal information collected through cookies. To exercise this right, please contact us.");
|
|
115
|
+
if (config.jurisdictions.includes("us")) requirements.push("**United States:** We comply with applicable U.S. federal and state privacy laws regarding cookie usage and disclosure.");
|
|
116
|
+
if (config.jurisdictions.includes("au")) requirements.push("**Australia (Privacy Act):** We comply with the Australian Privacy Principles regarding the collection of personal information through cookies.");
|
|
117
|
+
if (config.jurisdictions.includes("nz")) requirements.push("**New Zealand (Privacy Act 2020):** We comply with New Zealand privacy requirements for the collection of personal information through cookies.");
|
|
118
|
+
if (config.jurisdictions.includes("other")) requirements.push("**Other Jurisdictions:** We strive to comply with applicable cookie laws and regulations in all jurisdictions where we operate.");
|
|
119
|
+
return {
|
|
120
|
+
id: "jurisdiction",
|
|
121
|
+
title: "Legal Requirements",
|
|
122
|
+
body: `Our cookie practices are designed to comply with applicable laws across the jurisdictions in which we operate:\n\n${requirements.map((r) => `- ${r}`).join("\n")}`
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/templates/cookie/managing-cookies.ts
|
|
127
|
+
function buildManagingCookies(_config) {
|
|
128
|
+
return {
|
|
129
|
+
id: "managing-cookies",
|
|
130
|
+
title: "Managing Your Cookie Preferences",
|
|
131
|
+
body: `You can control and manage cookies in several ways:
|
|
132
|
+
|
|
133
|
+
**Browser settings:** Most browsers allow you to refuse cookies or delete existing ones. The process varies by browser:
|
|
134
|
+
- **Chrome:** Settings → Privacy and security → Cookies and other site data
|
|
135
|
+
- **Firefox:** Settings → Privacy & Security → Cookies and Site Data
|
|
136
|
+
- **Safari:** Preferences → Privacy → Manage Website Data
|
|
137
|
+
- **Edge:** Settings → Cookies and site permissions
|
|
138
|
+
|
|
139
|
+
**Opt-out tools:** For analytics and advertising cookies, you may use industry opt-out tools such as the [NAI opt-out](http://optout.networkadvertising.org/) or [DAA opt-out](http://optout.aboutads.info/).
|
|
140
|
+
|
|
141
|
+
Please note that blocking or deleting cookies may affect your experience on our website, and some features may not function correctly if cookies are disabled.`
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/templates/cookie/third-party-cookies.ts
|
|
146
|
+
function buildThirdPartyCookies(config) {
|
|
147
|
+
if (!config.thirdParties || config.thirdParties.length === 0) return null;
|
|
148
|
+
return {
|
|
149
|
+
id: "third-party-cookies",
|
|
150
|
+
title: "Third-Party Cookies",
|
|
151
|
+
body: `Some cookies on our site are placed by third-party services. These third parties may use cookies to collect information about your online activities across different websites. We do not control these third-party cookies.
|
|
152
|
+
|
|
153
|
+
The following third parties may set cookies through our service:\n\n${config.thirdParties.map((tp) => {
|
|
154
|
+
const policyLink = tp.policyUrl ? ` ([Privacy Policy](${tp.policyUrl}))` : "";
|
|
155
|
+
return `- **${tp.name}** — ${tp.purpose}${policyLink}`;
|
|
156
|
+
}).join("\n")}\n\nWe encourage you to review the privacy policies of these third parties to understand their data practices.`
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/templates/cookie/tracking-technologies.ts
|
|
161
|
+
function buildTrackingTechnologies(config) {
|
|
162
|
+
if (!config.trackingTechnologies || config.trackingTechnologies.length === 0) return null;
|
|
163
|
+
return {
|
|
164
|
+
id: "tracking-technologies",
|
|
165
|
+
title: "Similar Tracking Technologies",
|
|
166
|
+
body: `In addition to cookies, we may use the following tracking technologies:\n\n${config.trackingTechnologies.map((t) => `- ${t}`).join("\n")}\n\nThese technologies work similarly to cookies and are subject to the same controls described in this policy.`
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/templates/cookie/updates.ts
|
|
171
|
+
function buildUpdates(config) {
|
|
172
|
+
return {
|
|
173
|
+
id: "updates",
|
|
174
|
+
title: "Updates to This Policy",
|
|
175
|
+
body: `We may update this Cookie Policy from time to time to reflect changes in our practices or applicable law. When we make changes, we will update the **Effective Date** at the top of this policy.
|
|
176
|
+
|
|
177
|
+
We encourage you to review this Cookie Policy periodically. Your continued use of our services after any changes constitutes your acceptance of the updated policy.
|
|
178
|
+
|
|
179
|
+
If you have questions about changes to this policy, please contact ${config.company.name} at ${config.company.contact}.`
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/templates/cookie/what-are-cookies.ts
|
|
184
|
+
function buildWhatAreCookies(_config) {
|
|
185
|
+
return {
|
|
186
|
+
id: "what-are-cookies",
|
|
187
|
+
title: "What Are Cookies",
|
|
188
|
+
body: `Cookies are small text files that are placed on your device (computer, tablet, or mobile phone) when you visit a website. They are widely used to make websites work, or work more efficiently, and to provide information to the website owner.
|
|
189
|
+
|
|
190
|
+
Cookies are set by the website you visit (first-party cookies) or by third parties whose content appears on that page (third-party cookies). Cookies remain on your device for varying lengths of time depending on their type.`
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/cookie.ts
|
|
195
|
+
const SECTION_BUILDERS$2 = [
|
|
196
|
+
buildIntroduction$2,
|
|
197
|
+
buildWhatAreCookies,
|
|
198
|
+
buildCookieTypes,
|
|
199
|
+
buildTrackingTechnologies,
|
|
200
|
+
buildCookieUsage,
|
|
201
|
+
buildCookieDuration,
|
|
202
|
+
buildConsent,
|
|
203
|
+
buildManagingCookies,
|
|
204
|
+
buildThirdPartyCookies,
|
|
205
|
+
buildJurisdiction,
|
|
206
|
+
buildUpdates,
|
|
207
|
+
buildContact$2
|
|
208
|
+
];
|
|
209
|
+
function compileCookiePolicy(config, options = { formats: ["markdown"] }) {
|
|
210
|
+
const sections = SECTION_BUILDERS$2.map((builder) => builder(config)).filter((s) => s !== null);
|
|
211
|
+
return options.formats.map((format) => {
|
|
212
|
+
switch (format) {
|
|
213
|
+
case "markdown": return {
|
|
214
|
+
format,
|
|
215
|
+
content: renderMarkdown(sections),
|
|
216
|
+
sections
|
|
217
|
+
};
|
|
218
|
+
case "html": return {
|
|
219
|
+
format,
|
|
220
|
+
content: renderHTML(sections),
|
|
221
|
+
sections
|
|
222
|
+
};
|
|
223
|
+
case "pdf": throw new Error("pdf format is not yet implemented");
|
|
224
|
+
case "jsx": throw new Error("jsx format is not yet implemented");
|
|
225
|
+
default: throw new Error(`Unsupported format: ${format}`);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
12
230
|
//#region src/templates/privacy/ccpa-supplement.ts
|
|
13
231
|
function buildCcpaSupplement(config) {
|
|
14
232
|
if (!config.jurisdictions.includes("ca")) return null;
|
|
@@ -29,6 +247,19 @@ To exercise your rights, contact us at ${config.company.contact}.`
|
|
|
29
247
|
};
|
|
30
248
|
}
|
|
31
249
|
//#endregion
|
|
250
|
+
//#region src/templates/privacy/children-privacy.ts
|
|
251
|
+
function buildChildrenPrivacy(config) {
|
|
252
|
+
if (!config.children) return null;
|
|
253
|
+
const { underAge, noticeUrl } = config.children;
|
|
254
|
+
let body = `Our service is not directed at children under ${underAge} years old.`;
|
|
255
|
+
if (noticeUrl) body += ` See our notice for parents and guardians: ${noticeUrl}`;
|
|
256
|
+
return {
|
|
257
|
+
id: "children-privacy",
|
|
258
|
+
title: "Children’s Privacy",
|
|
259
|
+
body
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
32
263
|
//#region src/templates/privacy/contact.ts
|
|
33
264
|
function buildContact$1(config) {
|
|
34
265
|
return {
|
|
@@ -149,6 +380,7 @@ function buildUserRights(config) {
|
|
|
149
380
|
//#region src/privacy.ts
|
|
150
381
|
const SECTION_BUILDERS$1 = [
|
|
151
382
|
buildIntroduction$1,
|
|
383
|
+
buildChildrenPrivacy,
|
|
152
384
|
buildDataCollected,
|
|
153
385
|
buildLegalBasis,
|
|
154
386
|
buildDataRetention,
|
|
@@ -457,6 +689,13 @@ function compileTermsOfService(config, options = { formats: ["markdown"] }) {
|
|
|
457
689
|
});
|
|
458
690
|
}
|
|
459
691
|
//#endregion
|
|
692
|
+
//#region src/types.ts
|
|
693
|
+
function isOpenPolicyConfig(value) {
|
|
694
|
+
if (value === null || typeof value !== "object") return false;
|
|
695
|
+
const obj = value;
|
|
696
|
+
return "company" in obj && !("effectiveDate" in obj) && ("privacy" in obj || "terms" in obj || "cookie" in obj);
|
|
697
|
+
}
|
|
698
|
+
//#endregion
|
|
460
699
|
//#region src/validate.ts
|
|
461
700
|
function validatePrivacyPolicy(config) {
|
|
462
701
|
const issues = [];
|
|
@@ -516,6 +755,51 @@ function validatePrivacyPolicy(config) {
|
|
|
516
755
|
message: `CCPA recommends including the "${right}" right`
|
|
517
756
|
});
|
|
518
757
|
}
|
|
758
|
+
if (config.children) {
|
|
759
|
+
if (config.children.underAge <= 0) issues.push({
|
|
760
|
+
level: "error",
|
|
761
|
+
message: "children.underAge must be a positive number"
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
return issues;
|
|
765
|
+
}
|
|
766
|
+
//#endregion
|
|
767
|
+
//#region src/validate-cookie.ts
|
|
768
|
+
function validateCookiePolicy(config) {
|
|
769
|
+
const issues = [];
|
|
770
|
+
if (!config.effectiveDate) issues.push({
|
|
771
|
+
level: "error",
|
|
772
|
+
message: "effectiveDate is required"
|
|
773
|
+
});
|
|
774
|
+
if (!config.company.name) issues.push({
|
|
775
|
+
level: "error",
|
|
776
|
+
message: "company.name is required"
|
|
777
|
+
});
|
|
778
|
+
if (!config.company.legalName) issues.push({
|
|
779
|
+
level: "error",
|
|
780
|
+
message: "company.legalName is required"
|
|
781
|
+
});
|
|
782
|
+
if (!config.company.address) issues.push({
|
|
783
|
+
level: "error",
|
|
784
|
+
message: "company.address is required"
|
|
785
|
+
});
|
|
786
|
+
if (!config.company.contact) issues.push({
|
|
787
|
+
level: "error",
|
|
788
|
+
message: "company.contact is required"
|
|
789
|
+
});
|
|
790
|
+
const { essential, analytics, functional, marketing } = config.cookies;
|
|
791
|
+
if (!essential && !analytics && !functional && !marketing) issues.push({
|
|
792
|
+
level: "error",
|
|
793
|
+
message: "At least one cookie type must be enabled (essential, analytics, functional, or marketing)"
|
|
794
|
+
});
|
|
795
|
+
if (!config.consentMechanism) issues.push({
|
|
796
|
+
level: "warning",
|
|
797
|
+
message: "consentMechanism is not provided — consider describing how users can manage cookie consent"
|
|
798
|
+
});
|
|
799
|
+
if (config.jurisdictions.includes("eu") && config.consentMechanism && !config.consentMechanism.canWithdraw) issues.push({
|
|
800
|
+
level: "warning",
|
|
801
|
+
message: "GDPR requires that users can withdraw cookie consent — consider setting consentMechanism.canWithdraw to true"
|
|
802
|
+
});
|
|
519
803
|
return issues;
|
|
520
804
|
}
|
|
521
805
|
//#endregion
|
|
@@ -562,6 +846,25 @@ function validateTermsOfService(config) {
|
|
|
562
846
|
}
|
|
563
847
|
//#endregion
|
|
564
848
|
//#region src/index.ts
|
|
849
|
+
function expandOpenPolicyConfig(config) {
|
|
850
|
+
const inputs = [];
|
|
851
|
+
if (config.privacy) inputs.push({
|
|
852
|
+
type: "privacy",
|
|
853
|
+
company: config.company,
|
|
854
|
+
...config.privacy
|
|
855
|
+
});
|
|
856
|
+
if (config.terms) inputs.push({
|
|
857
|
+
type: "terms",
|
|
858
|
+
company: config.company,
|
|
859
|
+
...config.terms
|
|
860
|
+
});
|
|
861
|
+
if (config.cookie) inputs.push({
|
|
862
|
+
type: "cookie",
|
|
863
|
+
company: config.company,
|
|
864
|
+
...config.cookie
|
|
865
|
+
});
|
|
866
|
+
return inputs;
|
|
867
|
+
}
|
|
565
868
|
function compilePolicy(input, options) {
|
|
566
869
|
switch (input.type) {
|
|
567
870
|
case "privacy": {
|
|
@@ -572,9 +875,13 @@ function compilePolicy(input, options) {
|
|
|
572
875
|
const { type: _, ...config } = input;
|
|
573
876
|
return compileTermsOfService(config, options);
|
|
574
877
|
}
|
|
878
|
+
case "cookie": {
|
|
879
|
+
const { type: _, ...config } = input;
|
|
880
|
+
return compileCookiePolicy(config, options);
|
|
881
|
+
}
|
|
575
882
|
}
|
|
576
883
|
}
|
|
577
884
|
//#endregion
|
|
578
|
-
export { compilePolicy, compilePrivacyPolicy, compileTermsOfService, validatePrivacyPolicy, validateTermsOfService };
|
|
885
|
+
export { compileCookiePolicy, compilePolicy, compilePrivacyPolicy, compileTermsOfService, expandOpenPolicyConfig, isOpenPolicyConfig, validateCookiePolicy, validatePrivacyPolicy, validateTermsOfService };
|
|
579
886
|
|
|
580
887
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["buildContact","buildIntroduction","SECTION_BUILDERS","buildIntroduction","buildContact"],"sources":["../src/renderers/markdown.ts","../src/renderers/html.ts","../src/templates/privacy/ccpa-supplement.ts","../src/templates/privacy/contact.ts","../src/templates/privacy/cookies.ts","../src/templates/privacy/data-collected.ts","../src/templates/privacy/data-retention.ts","../src/templates/privacy/gdpr-supplement.ts","../src/templates/privacy/introduction.ts","../src/templates/privacy/legal-basis.ts","../src/templates/privacy/third-parties.ts","../src/templates/privacy/user-rights.ts","../src/privacy.ts","../src/templates/terms/acceptance.ts","../src/templates/terms/accounts.ts","../src/templates/terms/availability.ts","../src/templates/terms/changes-to-terms.ts","../src/templates/terms/contact.ts","../src/templates/terms/disclaimers.ts","../src/templates/terms/dispute-resolution.ts","../src/templates/terms/eligibility.ts","../src/templates/terms/governing-law.ts","../src/templates/terms/indemnification.ts","../src/templates/terms/intellectual-property.ts","../src/templates/terms/introduction.ts","../src/templates/terms/limitation-of-liability.ts","../src/templates/terms/payments.ts","../src/templates/terms/prohibited-use.ts","../src/templates/terms/termination.ts","../src/templates/terms/third-party-services.ts","../src/templates/terms/user-content.ts","../src/terms.ts","../src/validate.ts","../src/validate-terms.ts","../src/index.ts"],"sourcesContent":["import type { PolicySection } from \"../types\";\n\nexport function renderMarkdown(sections: PolicySection[]): string {\n\treturn sections\n\t\t.map((section) => `## ${section.title}\\n\\n${section.body}`)\n\t\t.join(\"\\n\\n---\\n\\n\");\n}\n","import { marked } from \"marked\";\nimport type { PolicySection } from \"../types\";\nimport { renderMarkdown } from \"./markdown\";\n\nexport function renderHTML(sections: PolicySection[]): string {\n\tconst markdown = renderMarkdown(sections);\n\treturn marked(markdown) as string;\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildCcpaSupplement(\n\tconfig: PrivacyPolicyConfig,\n): PolicySection | null {\n\tif (!config.jurisdictions.includes(\"ca\")) return null;\n\n\treturn {\n\t\tid: \"ccpa-supplement\",\n\t\ttitle: \"California Privacy Rights (CCPA)\",\n\t\tbody: `This section applies to California residents under the California Consumer Privacy Act (CCPA) and the California Privacy Rights Act (CPRA).\n\n**Categories of Personal Information Collected:** We collect the categories of personal information described in the \"Information We Collect\" section above.\n\n**Your California Rights:**\n- **Right to Know:** You may request information about the personal information we have collected about you, including the categories of sources, the business purpose for collection, and the categories of third parties with whom we share information.\n- **Right to Delete:** You may request deletion of personal information we have collected from you, subject to certain exceptions.\n- **Right to Opt-Out:** You may opt out of the sale or sharing of your personal information.\n- **Right to Non-Discrimination:** We will not discriminate against you for exercising your California privacy rights.\n\nTo exercise your rights, contact us at ${config.company.contact}.`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildContact(config: PrivacyPolicyConfig): PolicySection {\n\treturn {\n\t\tid: \"contact\",\n\t\ttitle: \"Contact Us\",\n\t\tbody: `If you have questions or concerns about this Privacy Policy or our data practices, please contact us:\n\n**${config.company.legalName}**\n${config.company.address}\n\nEmail: ${config.company.contact}`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildCookies(config: PrivacyPolicyConfig): PolicySection {\n\tconst enabled: string[] = [];\n\tif (config.cookies.essential)\n\t\tenabled.push(\n\t\t\t\"**Essential cookies** — required for the service to function\",\n\t\t);\n\tif (config.cookies.analytics)\n\t\tenabled.push(\n\t\t\t\"**Analytics cookies** — help us understand how visitors interact with our service\",\n\t\t);\n\tif (config.cookies.marketing)\n\t\tenabled.push(\n\t\t\t\"**Marketing cookies** — used to deliver relevant advertisements\",\n\t\t);\n\n\tconst body =\n\t\tenabled.length > 0\n\t\t\t? `We use the following types of cookies and tracking technologies:\\n\\n${enabled.map((e) => `- ${e}`).join(\"\\n\")}`\n\t\t\t: \"We do not use cookies or tracking technologies on our service.\";\n\n\treturn {\n\t\tid: \"cookies\",\n\t\ttitle: \"Cookies and Tracking\",\n\t\tbody,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildDataCollected(config: PrivacyPolicyConfig): PolicySection {\n\tconst entries = Object.entries(config.dataCollected);\n\tconst lines = entries.map(([category, items]) => {\n\t\tconst itemList = items.map((item) => ` - ${item}`).join(\"\\n\");\n\t\treturn `**${category}:**\\n${itemList}`;\n\t});\n\n\treturn {\n\t\tid: \"data-collected\",\n\t\ttitle: \"Information We Collect\",\n\t\tbody: `We collect the following categories of information:\\n\\n${lines.join(\"\\n\\n\")}`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildDataRetention(config: PrivacyPolicyConfig): PolicySection {\n\tconst entries = Object.entries(config.retention);\n\tconst lines = entries.map(\n\t\t([category, period]) => `- **${category}:** ${period}`,\n\t);\n\n\treturn {\n\t\tid: \"data-retention\",\n\t\ttitle: \"Data Retention\",\n\t\tbody: `We retain your information for the following periods:\\n\\n${lines.join(\"\\n\")}`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildGdprSupplement(\n\tconfig: PrivacyPolicyConfig,\n): PolicySection | null {\n\tif (!config.jurisdictions.includes(\"eu\")) return null;\n\n\treturn {\n\t\tid: \"gdpr-supplement\",\n\t\ttitle: \"GDPR Supplemental Disclosures\",\n\t\tbody: `This section applies to individuals in the European Economic Area (EEA) under the General Data Protection Regulation (GDPR).\n\n**Data Controller:** ${config.company.legalName}, ${config.company.address}\n\n**Your GDPR Rights:** In addition to the rights listed above, you have the right to lodge a complaint with your local data protection authority if you believe we have not handled your data in accordance with applicable law.\n\n**International Transfers:** If we transfer your personal data outside the EEA, we ensure adequate safeguards are in place in accordance with GDPR requirements.`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildIntroduction(config: PrivacyPolicyConfig): PolicySection {\n\treturn {\n\t\tid: \"introduction\",\n\t\ttitle: \"Introduction\",\n\t\tbody: `This Privacy Policy describes how ${config.company.name} (\"we\", \"us\", or \"our\") collects, uses, and shares information about you when you use our services.\n\n**Effective Date:** ${config.effectiveDate}\n\nIf you have questions about this policy, please contact us at ${config.company.contact}.`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildLegalBasis(\n\tconfig: PrivacyPolicyConfig,\n): PolicySection | null {\n\tif (!config.jurisdictions.includes(\"eu\")) return null;\n\n\treturn {\n\t\tid: \"legal-basis\",\n\t\ttitle: \"Legal Basis for Processing\",\n\t\tbody: `We process your personal data under the following legal basis:\\n\\n${config.legalBasis}`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildThirdParties(config: PrivacyPolicyConfig): PolicySection {\n\tconst lines = config.thirdParties.map(\n\t\t(tp) => `- **${tp.name}** — ${tp.purpose}`,\n\t);\n\n\tconst body =\n\t\tlines.length > 0\n\t\t\t? `We share data with the following third-party services:\\n\\n${lines.join(\"\\n\")}`\n\t\t\t: \"We do not share your data with third-party services.\";\n\n\treturn {\n\t\tid: \"third-parties\",\n\t\ttitle: \"Third-Party Services\",\n\t\tbody,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nconst RIGHTS_LABELS: Record<string, string> = {\n\taccess: \"Right to access your personal data\",\n\trectification: \"Right to correct inaccurate data\",\n\terasure: \"Right to request deletion of your data\",\n\tportability: \"Right to receive your data in a portable format\",\n\trestriction: \"Right to restrict how we process your data\",\n\tobjection: \"Right to object to processing\",\n\topt_out_sale: \"Right to opt out of the sale of your personal information\",\n\tnon_discrimination:\n\t\t\"Right to non-discriminatory treatment for exercising your rights\",\n};\n\nexport function buildUserRights(config: PrivacyPolicyConfig): PolicySection {\n\tconst lines = config.userRights.map((right) => {\n\t\tconst label = RIGHTS_LABELS[right] ?? right;\n\t\treturn `- ${label}`;\n\t});\n\n\treturn {\n\t\tid: \"user-rights\",\n\t\ttitle: \"Your Rights\",\n\t\tbody: `You have the following rights regarding your personal data:\\n\\n${lines.join(\"\\n\")}`,\n\t};\n}\n","import { renderHTML } from \"./renderers/html\";\nimport { renderMarkdown } from \"./renderers/markdown\";\nimport { buildCcpaSupplement } from \"./templates/privacy/ccpa-supplement\";\nimport { buildContact } from \"./templates/privacy/contact\";\nimport { buildCookies } from \"./templates/privacy/cookies\";\nimport { buildDataCollected } from \"./templates/privacy/data-collected\";\nimport { buildDataRetention } from \"./templates/privacy/data-retention\";\nimport { buildGdprSupplement } from \"./templates/privacy/gdpr-supplement\";\nimport { buildIntroduction } from \"./templates/privacy/introduction\";\nimport { buildLegalBasis } from \"./templates/privacy/legal-basis\";\nimport { buildThirdParties } from \"./templates/privacy/third-parties\";\nimport { buildUserRights } from \"./templates/privacy/user-rights\";\nimport type {\n\tCompileOptions,\n\tOutputFormat,\n\tPolicySection,\n\tPrivacyPolicyConfig,\n} from \"./types\";\n\nconst SECTION_BUILDERS: ((\n\tconfig: PrivacyPolicyConfig,\n) => PolicySection | null)[] = [\n\tbuildIntroduction,\n\tbuildDataCollected,\n\tbuildLegalBasis,\n\tbuildDataRetention,\n\tbuildCookies,\n\tbuildThirdParties,\n\tbuildUserRights,\n\tbuildGdprSupplement,\n\tbuildCcpaSupplement,\n\tbuildContact,\n];\n\nexport function compilePrivacyPolicy(\n\tconfig: PrivacyPolicyConfig,\n\toptions: CompileOptions = { formats: [\"markdown\"] },\n): { format: OutputFormat; content: string; sections: PolicySection[] }[] {\n\tconst sections = SECTION_BUILDERS.map((builder) => builder(config)).filter(\n\t\t(s): s is PolicySection => s !== null,\n\t);\n\n\treturn options.formats.map((format) => {\n\t\tswitch (format) {\n\t\t\tcase \"markdown\":\n\t\t\t\treturn { format, content: renderMarkdown(sections), sections };\n\t\t\tcase \"html\":\n\t\t\t\treturn { format, content: renderHTML(sections), sections };\n\t\t\tcase \"pdf\":\n\t\t\t\tthrow new Error(\"pdf format is not yet implemented\");\n\t\t\tcase \"jsx\":\n\t\t\t\tthrow new Error(\"jsx format is not yet implemented\");\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported format: ${format}`);\n\t\t}\n\t});\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildAcceptance(config: TermsOfServiceConfig): PolicySection {\n\tconst methodList = config.acceptance.methods.map((m) => `- ${m}`).join(\"\\n\");\n\n\treturn {\n\t\tid: \"tos-acceptance\",\n\t\ttitle: \"Acceptance of Terms\",\n\t\tbody: `By accessing or using our services, you agree to be bound by these Terms. You accept these Terms by:\\n\\n${methodList}\\n\\nIf you do not agree to these Terms, you may not use our services.`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildAccounts(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.accounts) return null;\n\n\tconst {\n\t\tregistrationRequired,\n\t\tuserResponsibleForCredentials,\n\t\tcompanyCanTerminate,\n\t} = config.accounts;\n\n\tconst lines: string[] = [];\n\n\tif (registrationRequired) {\n\t\tlines.push(\n\t\t\t\"You must create an account to access certain features of our services. You agree to provide accurate, current, and complete information during registration.\",\n\t\t);\n\t}\n\n\tif (userResponsibleForCredentials) {\n\t\tlines.push(\n\t\t\t\"You are responsible for maintaining the confidentiality of your account credentials and for all activities that occur under your account. You must notify us immediately of any unauthorized use of your account.\",\n\t\t);\n\t}\n\n\tif (companyCanTerminate) {\n\t\tlines.push(\n\t\t\t`${config.company.name} reserves the right to suspend or terminate your account at any time, with or without notice, for any reason including violation of these Terms.`,\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-accounts\",\n\t\ttitle: \"Accounts\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildAvailability(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.availability) return null;\n\n\tconst lines: string[] = [];\n\n\tif (config.availability.noUptimeGuarantee) {\n\t\tlines.push(\n\t\t\t\"We do not guarantee that our services will be available at all times. Our services may be subject to interruptions, delays, or errors.\",\n\t\t);\n\t}\n\n\tif (config.availability.maintenanceWindows) {\n\t\tlines.push(`**Maintenance:** ${config.availability.maintenanceWindows}`);\n\t}\n\n\treturn {\n\t\tid: \"tos-availability\",\n\t\ttitle: \"Service Availability\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildChangesToTerms(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.changesPolicy) return null;\n\n\tconst { noticeMethod, noticePeriodDays } = config.changesPolicy;\n\n\tconst periodText = noticePeriodDays\n\t\t? ` at least **${noticePeriodDays} days** before they take effect`\n\t\t: \" before they take effect\";\n\n\treturn {\n\t\tid: \"tos-changes\",\n\t\ttitle: \"Changes to These Terms\",\n\t\tbody: `We may update these Terms from time to time. We will notify you of material changes via ${noticeMethod}${periodText}. Your continued use of our services after changes become effective constitutes your acceptance of the revised Terms.`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildContact(config: TermsOfServiceConfig): PolicySection {\n\treturn {\n\t\tid: \"tos-contact\",\n\t\ttitle: \"Contact Us\",\n\t\tbody: `If you have any questions about these Terms, please contact us at:\n\n**${config.company.legalName}**\n${config.company.address}\n${config.company.contact}`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildDisclaimers(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.disclaimers) return null;\n\n\tconst lines: string[] = [];\n\n\tif (config.disclaimers.serviceProvidedAsIs) {\n\t\tlines.push(\n\t\t\t'OUR SERVICES ARE PROVIDED \"AS IS\" AND \"AS AVAILABLE\" WITHOUT WARRANTIES OF ANY KIND.',\n\t\t);\n\t}\n\n\tif (config.disclaimers.noWarranties) {\n\t\tlines.push(\n\t\t\t`${config.company.legalName} EXPRESSLY DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.`,\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-disclaimers\",\n\t\ttitle: \"Disclaimer of Warranties\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildDisputeResolution(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.disputeResolution) return null;\n\n\tconst { method, venue, classActionWaiver } = config.disputeResolution;\n\n\tconst methodDescriptions: Record<string, string> = {\n\t\tarbitration:\n\t\t\t\"Any disputes arising out of or relating to these Terms or our services shall be resolved by binding arbitration rather than in court.\",\n\t\tlitigation:\n\t\t\t\"Any disputes arising out of or relating to these Terms or our services shall be resolved through litigation in a court of competent jurisdiction.\",\n\t\tmediation:\n\t\t\t\"Any disputes arising out of or relating to these Terms or our services shall first be submitted to non-binding mediation before pursuing other remedies.\",\n\t};\n\n\tconst lines: string[] = [\n\t\tmethodDescriptions[method] ??\n\t\t\t\"Disputes arising out of or relating to these Terms shall be resolved as described below.\",\n\t];\n\n\tif (venue) {\n\t\tlines.push(`**Venue:** ${venue}`);\n\t}\n\n\tif (classActionWaiver) {\n\t\tlines.push(\n\t\t\t\"**Class Action Waiver:** You agree that any dispute resolution proceedings will be conducted only on an individual basis and not in a class, consolidated, or representative action.\",\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-dispute-resolution\",\n\t\ttitle: \"Dispute Resolution\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildEligibility(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.eligibility) return null;\n\n\tconst { minimumAge, jurisdictionRestrictions } = config.eligibility;\n\n\tlet body = `You must be at least **${minimumAge} years old** to use our services. By using our services, you represent and warrant that you meet this age requirement.`;\n\n\tif (jurisdictionRestrictions && jurisdictionRestrictions.length > 0) {\n\t\tconst list = jurisdictionRestrictions.map((r) => `- ${r}`).join(\"\\n\");\n\t\tbody += `\\n\\nOur services are not available in the following jurisdictions:\\n\\n${list}`;\n\t}\n\n\treturn {\n\t\tid: \"tos-eligibility\",\n\t\ttitle: \"Eligibility\",\n\t\tbody,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildGoverningLaw(config: TermsOfServiceConfig): PolicySection {\n\treturn {\n\t\tid: \"tos-governing-law\",\n\t\ttitle: \"Governing Law\",\n\t\tbody: `These Terms shall be governed by and construed in accordance with the laws of **${config.governingLaw.jurisdiction}**, without regard to its conflict of law provisions.`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildIndemnification(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.indemnification) return null;\n\n\tconst lines: string[] = [];\n\n\tif (config.indemnification.userIndemnifiesCompany) {\n\t\tlines.push(\n\t\t\t`You agree to indemnify and hold harmless ${config.company.legalName} and its officers, directors, employees, and agents from and against any claims, liabilities, damages, losses, and expenses arising out of or in any way connected with your access to or use of our services.`,\n\t\t);\n\t}\n\n\tif (config.indemnification.scope) {\n\t\tlines.push(`**Scope:** ${config.indemnification.scope}`);\n\t}\n\n\treturn {\n\t\tid: \"tos-indemnification\",\n\t\ttitle: \"Indemnification\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildIntellectualProperty(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.intellectualProperty) return null;\n\n\tconst { companyOwnsService, usersMayNotCopy } = config.intellectualProperty;\n\n\tconst lines: string[] = [];\n\n\tif (companyOwnsService) {\n\t\tlines.push(\n\t\t\t`The services and all content, features, and functionality (including but not limited to text, graphics, logos, and software) are owned by ${config.company.legalName} and are protected by intellectual property laws.`,\n\t\t);\n\t}\n\n\tif (usersMayNotCopy) {\n\t\tlines.push(\n\t\t\t\"You may not copy, modify, distribute, sell, or lease any part of our services or included software, nor may you reverse engineer or attempt to extract the source code of that software.\",\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-intellectual-property\",\n\t\ttitle: \"Intellectual Property\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildIntroduction(config: TermsOfServiceConfig): PolicySection {\n\tconst privacyLine = config.privacyPolicyUrl\n\t\t? `\\n\\nFor information about how we collect and use your data, please review our [Privacy Policy](${config.privacyPolicyUrl}).`\n\t\t: \"\";\n\n\treturn {\n\t\tid: \"tos-introduction\",\n\t\ttitle: \"Terms of Service\",\n\t\tbody: `These Terms of Service (\"Terms\") govern your access to and use of the services provided by ${config.company.name} (\"${config.company.name}\", \"we\", \"us\", or \"our\"). By using our services, you agree to these Terms.\n\n**Effective Date:** ${config.effectiveDate}${privacyLine}`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildLimitationOfLiability(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.limitationOfLiability) return null;\n\n\tconst lines: string[] = [];\n\n\tif (config.limitationOfLiability.excludesIndirectDamages) {\n\t\tlines.push(\n\t\t\t`TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, ${config.company.legalName.toUpperCase()} SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR ANY LOSS OF PROFITS OR REVENUES, WHETHER INCURRED DIRECTLY OR INDIRECTLY, OR ANY LOSS OF DATA, USE, GOODWILL, OR OTHER INTANGIBLE LOSSES.`,\n\t\t);\n\t}\n\n\tif (config.limitationOfLiability.liabilityCap) {\n\t\tlines.push(\n\t\t\t`**Liability Cap:** ${config.limitationOfLiability.liabilityCap}`,\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-limitation-of-liability\",\n\t\ttitle: \"Limitation of Liability\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildPayments(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.payments || !config.payments.hasPaidFeatures) return null;\n\n\tconst lines: string[] = [\n\t\t\"Some features of our services require payment. By selecting a paid plan, you agree to pay all applicable fees.\",\n\t];\n\n\tif (config.payments.refundPolicy) {\n\t\tlines.push(`**Refunds:** ${config.payments.refundPolicy}`);\n\t}\n\n\tif (config.payments.priceChangesNotice) {\n\t\tlines.push(`**Price Changes:** ${config.payments.priceChangesNotice}`);\n\t}\n\n\treturn {\n\t\tid: \"tos-payments\",\n\t\ttitle: \"Payments and Billing\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildProhibitedUse(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.prohibitedUses || config.prohibitedUses.length === 0) return null;\n\n\tconst list = config.prohibitedUses.map((u) => `- ${u}`).join(\"\\n\");\n\n\treturn {\n\t\tid: \"tos-prohibited-use\",\n\t\ttitle: \"Prohibited Uses\",\n\t\tbody: `You agree not to use our services for any of the following purposes:\\n\\n${list}`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildTermination(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.termination) return null;\n\n\tconst { companyCanTerminate, userCanTerminate, effectOfTermination } =\n\t\tconfig.termination;\n\n\tconst lines: string[] = [];\n\n\tif (companyCanTerminate) {\n\t\tlines.push(\n\t\t\t`${config.company.name} may suspend or terminate your access to the services at any time, with or without cause, and with or without notice.`,\n\t\t);\n\t}\n\n\tif (userCanTerminate) {\n\t\tlines.push(\n\t\t\t\"You may terminate your account at any time by discontinuing use of our services or by contacting us to close your account.\",\n\t\t);\n\t}\n\n\tif (effectOfTermination) {\n\t\tlines.push(`**Effect of Termination:** ${effectOfTermination}`);\n\t}\n\n\treturn {\n\t\tid: \"tos-termination\",\n\t\ttitle: \"Termination\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildThirdPartyServices(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.thirdPartyServices || config.thirdPartyServices.length === 0)\n\t\treturn null;\n\n\tconst list = config.thirdPartyServices\n\t\t.map((s) => `- **${s.name}** — ${s.purpose}`)\n\t\t.join(\"\\n\");\n\n\treturn {\n\t\tid: \"tos-third-party-services\",\n\t\ttitle: \"Third-Party Services\",\n\t\tbody: `Our services may integrate with or link to third-party services. Your use of those services is governed by their own terms and policies.\\n\\n${list}`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildUserContent(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.userContent) return null;\n\n\tconst {\n\t\tusersOwnContent,\n\t\tlicenseGrantedToCompany,\n\t\tlicenseDescription,\n\t\tcompanyCanRemoveContent,\n\t} = config.userContent;\n\n\tconst lines: string[] = [];\n\n\tif (usersOwnContent) {\n\t\tlines.push(\n\t\t\t'You retain ownership of any content you submit, post, or display on or through our services (\"User Content\").',\n\t\t);\n\t}\n\n\tif (licenseGrantedToCompany) {\n\t\tconst desc = licenseDescription\n\t\t\t? licenseDescription\n\t\t\t: \"a worldwide, royalty-free, non-exclusive license to use, reproduce, modify, and distribute your User Content in connection with operating and improving our services\";\n\t\tlines.push(\n\t\t\t`By submitting User Content, you grant ${config.company.name} ${desc}.`,\n\t\t);\n\t}\n\n\tif (companyCanRemoveContent) {\n\t\tlines.push(\n\t\t\t`${config.company.name} reserves the right to remove any User Content that violates these Terms or that we find objectionable, at our sole discretion.`,\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-user-content\",\n\t\ttitle: \"User Content\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import { renderHTML } from \"./renderers/html\";\nimport { renderMarkdown } from \"./renderers/markdown\";\nimport { buildAcceptance } from \"./templates/terms/acceptance\";\nimport { buildAccounts } from \"./templates/terms/accounts\";\nimport { buildAvailability } from \"./templates/terms/availability\";\nimport { buildChangesToTerms } from \"./templates/terms/changes-to-terms\";\nimport { buildContact } from \"./templates/terms/contact\";\nimport { buildDisclaimers } from \"./templates/terms/disclaimers\";\nimport { buildDisputeResolution } from \"./templates/terms/dispute-resolution\";\nimport { buildEligibility } from \"./templates/terms/eligibility\";\nimport { buildGoverningLaw } from \"./templates/terms/governing-law\";\nimport { buildIndemnification } from \"./templates/terms/indemnification\";\nimport { buildIntellectualProperty } from \"./templates/terms/intellectual-property\";\nimport { buildIntroduction } from \"./templates/terms/introduction\";\nimport { buildLimitationOfLiability } from \"./templates/terms/limitation-of-liability\";\nimport { buildPayments } from \"./templates/terms/payments\";\nimport { buildProhibitedUse } from \"./templates/terms/prohibited-use\";\nimport { buildTermination } from \"./templates/terms/termination\";\nimport { buildThirdPartyServices } from \"./templates/terms/third-party-services\";\nimport { buildUserContent } from \"./templates/terms/user-content\";\nimport type {\n\tCompileOptions,\n\tOutputFormat,\n\tPolicySection,\n\tTermsOfServiceConfig,\n} from \"./types\";\n\nconst SECTION_BUILDERS: ((\n\tconfig: TermsOfServiceConfig,\n) => PolicySection | null)[] = [\n\tbuildIntroduction,\n\tbuildAcceptance,\n\tbuildEligibility,\n\tbuildAccounts,\n\tbuildProhibitedUse,\n\tbuildUserContent,\n\tbuildIntellectualProperty,\n\tbuildPayments,\n\tbuildAvailability,\n\tbuildTermination,\n\tbuildDisclaimers,\n\tbuildLimitationOfLiability,\n\tbuildIndemnification,\n\tbuildThirdPartyServices,\n\tbuildDisputeResolution,\n\tbuildGoverningLaw,\n\tbuildChangesToTerms,\n\tbuildContact,\n];\n\nexport function compileTermsOfService(\n\tconfig: TermsOfServiceConfig,\n\toptions: CompileOptions = { formats: [\"markdown\"] },\n): { format: OutputFormat; content: string; sections: PolicySection[] }[] {\n\tconst sections = SECTION_BUILDERS.map((builder) => builder(config)).filter(\n\t\t(s): s is PolicySection => s !== null,\n\t);\n\n\treturn options.formats.map((format) => {\n\t\tswitch (format) {\n\t\t\tcase \"markdown\":\n\t\t\t\treturn { format, content: renderMarkdown(sections), sections };\n\t\t\tcase \"html\":\n\t\t\t\treturn { format, content: renderHTML(sections), sections };\n\t\t\tcase \"pdf\":\n\t\t\t\tthrow new Error(\"pdf format is not yet implemented\");\n\t\t\tcase \"jsx\":\n\t\t\t\tthrow new Error(\"jsx format is not yet implemented\");\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported format: ${format}`);\n\t\t}\n\t});\n}\n","import type { PrivacyPolicyConfig, ValidationIssue } from \"./types\";\n\nexport function validatePrivacyPolicy(\n\tconfig: PrivacyPolicyConfig,\n): ValidationIssue[] {\n\tconst issues: ValidationIssue[] = [];\n\n\t// Required fields\n\tif (!config.effectiveDate)\n\t\tissues.push({ level: \"error\", message: \"effectiveDate is required\" });\n\tif (!config.company.name)\n\t\tissues.push({ level: \"error\", message: \"company.name is required\" });\n\tif (!config.company.legalName)\n\t\tissues.push({ level: \"error\", message: \"company.legalName is required\" });\n\tif (!config.company.address)\n\t\tissues.push({ level: \"error\", message: \"company.address is required\" });\n\tif (!config.company.contact)\n\t\tissues.push({ level: \"error\", message: \"company.contact is required\" });\n\tif (Object.keys(config.dataCollected).length === 0)\n\t\tissues.push({\n\t\t\tlevel: \"error\",\n\t\t\tmessage: \"dataCollected must have at least one entry\",\n\t\t});\n\tif (config.userRights.length === 0)\n\t\tissues.push({\n\t\t\tlevel: \"warning\",\n\t\t\tmessage: \"userRights is empty — consider listing applicable rights\",\n\t\t});\n\n\t// GDPR checks\n\tif (config.jurisdictions.includes(\"eu\")) {\n\t\tif (!config.legalBasis)\n\t\t\tissues.push({ level: \"error\", message: \"GDPR requires a legalBasis\" });\n\t\tfor (const right of [\n\t\t\t\"access\",\n\t\t\t\"rectification\",\n\t\t\t\"erasure\",\n\t\t\t\"portability\",\n\t\t\t\"restriction\",\n\t\t\t\"objection\",\n\t\t]) {\n\t\t\tif (!config.userRights.includes(right))\n\t\t\t\tissues.push({\n\t\t\t\t\tlevel: \"warning\",\n\t\t\t\t\tmessage: `GDPR recommends including the \"${right}\" right`,\n\t\t\t\t});\n\t\t}\n\t}\n\n\t// CCPA checks\n\tif (config.jurisdictions.includes(\"ca\")) {\n\t\tfor (const right of [\n\t\t\t\"access\",\n\t\t\t\"erasure\",\n\t\t\t\"opt_out_sale\",\n\t\t\t\"non_discrimination\",\n\t\t]) {\n\t\t\tif (!config.userRights.includes(right))\n\t\t\t\tissues.push({\n\t\t\t\t\tlevel: \"warning\",\n\t\t\t\t\tmessage: `CCPA recommends including the \"${right}\" right`,\n\t\t\t\t});\n\t\t}\n\t}\n\n\treturn issues;\n}\n","import type { TermsOfServiceConfig, ValidationIssue } from \"./types\";\n\nexport function validateTermsOfService(\n\tconfig: TermsOfServiceConfig,\n): ValidationIssue[] {\n\tconst issues: ValidationIssue[] = [];\n\n\t// Required fields\n\tif (!config.effectiveDate)\n\t\tissues.push({ level: \"error\", message: \"effectiveDate is required\" });\n\tif (!config.company.name)\n\t\tissues.push({ level: \"error\", message: \"company.name is required\" });\n\tif (!config.company.legalName)\n\t\tissues.push({ level: \"error\", message: \"company.legalName is required\" });\n\tif (!config.company.address)\n\t\tissues.push({ level: \"error\", message: \"company.address is required\" });\n\tif (!config.company.contact)\n\t\tissues.push({ level: \"error\", message: \"company.contact is required\" });\n\tif (!config.governingLaw.jurisdiction)\n\t\tissues.push({\n\t\t\tlevel: \"error\",\n\t\t\tmessage: \"governingLaw.jurisdiction is required\",\n\t\t});\n\n\t// Advisory checks\n\tif (!config.disclaimers) {\n\t\tissues.push({\n\t\t\tlevel: \"warning\",\n\t\t\tmessage:\n\t\t\t\t\"disclaimers is missing — consider adding a disclaimer of warranties\",\n\t\t});\n\t}\n\tif (!config.limitationOfLiability) {\n\t\tissues.push({\n\t\t\tlevel: \"warning\",\n\t\t\tmessage:\n\t\t\t\t\"limitationOfLiability is missing — consider adding a limitation of liability clause\",\n\t\t});\n\t}\n\tif (config.acceptance.methods.length === 0) {\n\t\tissues.push({\n\t\t\tlevel: \"warning\",\n\t\t\tmessage:\n\t\t\t\t\"acceptance.methods is empty — consider listing how users accept these Terms\",\n\t\t});\n\t}\n\n\treturn issues;\n}\n","export { compilePrivacyPolicy } from \"./privacy\";\nexport { compileTermsOfService } from \"./terms\";\nexport type {\n\tCompileOptions,\n\tDisputeResolutionMethod,\n\tJurisdiction,\n\tOutputFormat,\n\tPolicyInput,\n\tPolicySection,\n\tPrivacyPolicyConfig,\n\tTermsOfServiceConfig,\n\tValidationIssue,\n} from \"./types\";\nexport { validatePrivacyPolicy } from \"./validate\";\nexport { validateTermsOfService } from \"./validate-terms\";\n\nimport { compilePrivacyPolicy } from \"./privacy\";\nimport { compileTermsOfService } from \"./terms\";\nimport type { CompileOptions, PolicyInput } from \"./types\";\n\nexport function compilePolicy(input: PolicyInput, options?: CompileOptions) {\n\tswitch (input.type) {\n\t\tcase \"privacy\": {\n\t\t\tconst { type: _, ...config } = input;\n\t\t\treturn compilePrivacyPolicy(config, options);\n\t\t}\n\t\tcase \"terms\": {\n\t\t\tconst { type: _, ...config } = input;\n\t\t\treturn compileTermsOfService(config, options);\n\t\t}\n\t}\n}\n"],"mappings":";;AAEA,SAAgB,eAAe,UAAmC;AACjE,QAAO,SACL,KAAK,YAAY,MAAM,QAAQ,MAAM,MAAM,QAAQ,OAAO,CAC1D,KAAK,cAAc;;;;ACDtB,SAAgB,WAAW,UAAmC;AAE7D,QAAO,OADU,eAAe,SAAS,CAClB;;;;ACJxB,SAAgB,oBACf,QACuB;AACvB,KAAI,CAAC,OAAO,cAAc,SAAS,KAAK,CAAE,QAAO;AAEjD,QAAO;EACN,IAAI;EACJ,OAAO;EACP,MAAM;;;;;;;;;;yCAUiC,OAAO,QAAQ,QAAQ;EAC9D;;;;ACnBF,SAAgBA,eAAa,QAA4C;AACxE,QAAO;EACN,IAAI;EACJ,OAAO;E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C;EACD,CAAC;AAEH,KAAI,OAAO,WAAW,QAAQ,WAAW,EACxC,QAAO,KAAK;EACX,OAAO;EACP,SACC;EACD,CAAC;AAGH,QAAO;;;;AC3BR,SAAgB,cAAc,OAAoB,SAA0B;AAC3E,SAAQ,MAAM,MAAd;EACC,KAAK,WAAW;GACf,MAAM,EAAE,MAAM,GAAG,GAAG,WAAW;AAC/B,UAAO,qBAAqB,QAAQ,QAAQ;;EAE7C,KAAK,SAAS;GACb,MAAM,EAAE,MAAM,GAAG,GAAG,WAAW;AAC/B,UAAO,sBAAsB,QAAQ,QAAQ"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["buildContact","buildIntroduction","SECTION_BUILDERS","buildIntroduction","buildContact","buildContact","buildIntroduction","SECTION_BUILDERS","buildIntroduction","buildContact"],"sources":["../src/renderers/markdown.ts","../src/renderers/html.ts","../src/templates/cookie/consent.ts","../src/templates/cookie/contact.ts","../src/templates/cookie/cookie-duration.ts","../src/templates/cookie/cookie-types.ts","../src/templates/cookie/cookie-usage.ts","../src/templates/cookie/introduction.ts","../src/templates/cookie/jurisdiction.ts","../src/templates/cookie/managing-cookies.ts","../src/templates/cookie/third-party-cookies.ts","../src/templates/cookie/tracking-technologies.ts","../src/templates/cookie/updates.ts","../src/templates/cookie/what-are-cookies.ts","../src/cookie.ts","../src/templates/privacy/ccpa-supplement.ts","../src/templates/privacy/children-privacy.ts","../src/templates/privacy/contact.ts","../src/templates/privacy/cookies.ts","../src/templates/privacy/data-collected.ts","../src/templates/privacy/data-retention.ts","../src/templates/privacy/gdpr-supplement.ts","../src/templates/privacy/introduction.ts","../src/templates/privacy/legal-basis.ts","../src/templates/privacy/third-parties.ts","../src/templates/privacy/user-rights.ts","../src/privacy.ts","../src/templates/terms/acceptance.ts","../src/templates/terms/accounts.ts","../src/templates/terms/availability.ts","../src/templates/terms/changes-to-terms.ts","../src/templates/terms/contact.ts","../src/templates/terms/disclaimers.ts","../src/templates/terms/dispute-resolution.ts","../src/templates/terms/eligibility.ts","../src/templates/terms/governing-law.ts","../src/templates/terms/indemnification.ts","../src/templates/terms/intellectual-property.ts","../src/templates/terms/introduction.ts","../src/templates/terms/limitation-of-liability.ts","../src/templates/terms/payments.ts","../src/templates/terms/prohibited-use.ts","../src/templates/terms/termination.ts","../src/templates/terms/third-party-services.ts","../src/templates/terms/user-content.ts","../src/terms.ts","../src/types.ts","../src/validate.ts","../src/validate-cookie.ts","../src/validate-terms.ts","../src/index.ts"],"sourcesContent":["import type { PolicySection } from \"../types\";\n\nexport function renderMarkdown(sections: PolicySection[]): string {\n\treturn sections\n\t\t.map((section) => `## ${section.title}\\n\\n${section.body}`)\n\t\t.join(\"\\n\\n---\\n\\n\");\n}\n","import { marked } from \"marked\";\nimport type { PolicySection } from \"../types\";\nimport { renderMarkdown } from \"./markdown\";\n\nexport function renderHTML(sections: PolicySection[]): string {\n\tconst markdown = renderMarkdown(sections);\n\treturn marked(markdown) as string;\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildConsent(config: CookiePolicyConfig): PolicySection | null {\n\tif (!config.consentMechanism) return null;\n\n\tconst mechanisms: string[] = [];\n\n\tif (config.consentMechanism.hasBanner) {\n\t\tmechanisms.push(\n\t\t\t\"A **cookie consent banner** displayed on your first visit, where you can accept or decline non-essential cookies\",\n\t\t);\n\t}\n\tif (config.consentMechanism.hasPreferencePanel) {\n\t\tmechanisms.push(\n\t\t\t\"A **preference panel** where you can manage individual cookie categories\",\n\t\t);\n\t}\n\tif (config.consentMechanism.canWithdraw) {\n\t\tmechanisms.push(\n\t\t\t\"The ability to **withdraw your consent** at any time by updating your cookie preferences\",\n\t\t);\n\t}\n\n\tconst list =\n\t\tmechanisms.length > 0\n\t\t\t? `\\n\\nWe provide the following consent controls:\\n\\n${mechanisms.map((m) => `- ${m}`).join(\"\\n\")}`\n\t\t\t: \"\";\n\n\treturn {\n\t\tid: \"consent\",\n\t\ttitle: \"User Consent\",\n\t\tbody: `Where required by law, we will request your consent before placing non-essential cookies on your device.${list}\n\nEssential cookies do not require your consent as they are strictly necessary for the operation of our service.`,\n\t};\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildContact(config: CookiePolicyConfig): PolicySection {\n\treturn {\n\t\tid: \"contact\",\n\t\ttitle: \"Contact Us\",\n\t\tbody: `If you have any questions about our use of cookies or this Cookie Policy, please contact us:\n\n**${config.company.legalName}**\n${config.company.address}\n${config.company.contact}`,\n\t};\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildCookieDuration(\n\t_config: CookiePolicyConfig,\n): PolicySection {\n\treturn {\n\t\tid: \"cookie-duration\",\n\t\ttitle: \"Cookie Duration\",\n\t\tbody: `Cookies can be either **session cookies** or **persistent cookies**:\n\n- **Session cookies** are temporary and are deleted from your device when you close your browser. They are used to carry information across pages of our website and avoid having to re-enter information.\n- **Persistent cookies** remain on your device for a set period of time specified in the cookie. They are activated each time you visit the website that created that particular cookie.\n\nThe specific duration of each cookie depends on its purpose and is determined at the time it is set.`,\n\t};\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildCookieTypes(config: CookiePolicyConfig): PolicySection {\n\tconst types: string[] = [];\n\n\tif (config.cookies.essential) {\n\t\ttypes.push(\n\t\t\t\"**Essential Cookies** — These cookies are necessary for our website to function and cannot be switched off. They are usually set in response to actions you take, such as setting your privacy preferences, logging in, or filling in forms.\",\n\t\t);\n\t}\n\tif (config.cookies.analytics) {\n\t\ttypes.push(\n\t\t\t\"**Analytics Cookies** — These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand which pages are most and least popular and see how visitors move around the site.\",\n\t\t);\n\t}\n\tif (config.cookies.functional) {\n\t\ttypes.push(\n\t\t\t\"**Functional Cookies** — These cookies enable enhanced functionality and personalization, such as remembering your preferences and settings. They may be set by us or by third-party providers whose services we have added to our pages.\",\n\t\t);\n\t}\n\tif (config.cookies.marketing) {\n\t\ttypes.push(\n\t\t\t\"**Marketing Cookies** — These cookies may be set through our site by our advertising partners. They may be used to build a profile of your interests and show you relevant advertisements on other sites.\",\n\t\t);\n\t}\n\n\tconst list = types.map((t) => `- ${t}`).join(\"\\n\");\n\n\treturn {\n\t\tid: \"cookie-types\",\n\t\ttitle: \"Types of Cookies We Use\",\n\t\tbody: `We use the following categories of cookies:\\n\\n${list}`,\n\t};\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildCookieUsage(config: CookiePolicyConfig): PolicySection {\n\tconst purposes: string[] = [];\n\n\tif (config.cookies.essential) {\n\t\tpurposes.push(\"Providing core website functionality and security\");\n\t\tpurposes.push(\"Remembering your session and authentication state\");\n\t}\n\tif (config.cookies.analytics) {\n\t\tpurposes.push(\"Measuring website traffic and usage patterns\");\n\t\tpurposes.push(\"Identifying which pages and features are most popular\");\n\t}\n\tif (config.cookies.functional) {\n\t\tpurposes.push(\"Saving your preferences and settings\");\n\t\tpurposes.push(\"Providing personalized content and features\");\n\t}\n\tif (config.cookies.marketing) {\n\t\tpurposes.push(\"Delivering targeted advertising\");\n\t\tpurposes.push(\"Tracking the effectiveness of our marketing campaigns\");\n\t}\n\n\tconst list = purposes.map((p) => `- ${p}`).join(\"\\n\");\n\n\treturn {\n\t\tid: \"cookie-usage\",\n\t\ttitle: \"How We Use Cookies\",\n\t\tbody: `${config.company.name} uses cookies to:\\n\\n${list}`,\n\t};\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildIntroduction(config: CookiePolicyConfig): PolicySection {\n\treturn {\n\t\tid: \"introduction\",\n\t\ttitle: \"Introduction\",\n\t\tbody: `This Cookie Policy explains how ${config.company.name} (\"we\", \"us\", or \"our\") uses cookies and similar tracking technologies when you visit our website or use our services.\n\n**Effective Date:** ${config.effectiveDate}\n\nBy using our services, you consent to the use of cookies as described in this policy. If you have questions, please contact us at ${config.company.contact}.`,\n\t};\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildJurisdiction(\n\tconfig: CookiePolicyConfig,\n): PolicySection | null {\n\tif (!config.jurisdictions || config.jurisdictions.length === 0) return null;\n\n\tconst requirements: string[] = [];\n\n\tif (config.jurisdictions.includes(\"eu\")) {\n\t\trequirements.push(\n\t\t\t\"**European Union (GDPR/ePrivacy Directive):** We comply with EU cookie consent requirements. Non-essential cookies require your prior, informed, and freely given consent. You have the right to withdraw consent at any time.\",\n\t\t);\n\t}\n\tif (config.jurisdictions.includes(\"ca\")) {\n\t\trequirements.push(\n\t\t\t\"**California (CCPA):** California residents have the right to opt out of the sale of personal information collected through cookies. To exercise this right, please contact us.\",\n\t\t);\n\t}\n\tif (config.jurisdictions.includes(\"us\")) {\n\t\trequirements.push(\n\t\t\t\"**United States:** We comply with applicable U.S. federal and state privacy laws regarding cookie usage and disclosure.\",\n\t\t);\n\t}\n\tif (config.jurisdictions.includes(\"au\")) {\n\t\trequirements.push(\n\t\t\t\"**Australia (Privacy Act):** We comply with the Australian Privacy Principles regarding the collection of personal information through cookies.\",\n\t\t);\n\t}\n\tif (config.jurisdictions.includes(\"nz\")) {\n\t\trequirements.push(\n\t\t\t\"**New Zealand (Privacy Act 2020):** We comply with New Zealand privacy requirements for the collection of personal information through cookies.\",\n\t\t);\n\t}\n\tif (config.jurisdictions.includes(\"other\")) {\n\t\trequirements.push(\n\t\t\t\"**Other Jurisdictions:** We strive to comply with applicable cookie laws and regulations in all jurisdictions where we operate.\",\n\t\t);\n\t}\n\n\tconst list = requirements.map((r) => `- ${r}`).join(\"\\n\");\n\n\treturn {\n\t\tid: \"jurisdiction\",\n\t\ttitle: \"Legal Requirements\",\n\t\tbody: `Our cookie practices are designed to comply with applicable laws across the jurisdictions in which we operate:\\n\\n${list}`,\n\t};\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildManagingCookies(\n\t_config: CookiePolicyConfig,\n): PolicySection {\n\treturn {\n\t\tid: \"managing-cookies\",\n\t\ttitle: \"Managing Your Cookie Preferences\",\n\t\tbody: `You can control and manage cookies in several ways:\n\n**Browser settings:** Most browsers allow you to refuse cookies or delete existing ones. The process varies by browser:\n- **Chrome:** Settings → Privacy and security → Cookies and other site data\n- **Firefox:** Settings → Privacy & Security → Cookies and Site Data\n- **Safari:** Preferences → Privacy → Manage Website Data\n- **Edge:** Settings → Cookies and site permissions\n\n**Opt-out tools:** For analytics and advertising cookies, you may use industry opt-out tools such as the [NAI opt-out](http://optout.networkadvertising.org/) or [DAA opt-out](http://optout.aboutads.info/).\n\nPlease note that blocking or deleting cookies may affect your experience on our website, and some features may not function correctly if cookies are disabled.`,\n\t};\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildThirdPartyCookies(\n\tconfig: CookiePolicyConfig,\n): PolicySection | null {\n\tif (!config.thirdParties || config.thirdParties.length === 0) return null;\n\n\tconst rows = config.thirdParties\n\t\t.map((tp) => {\n\t\t\tconst policyLink = tp.policyUrl\n\t\t\t\t? ` ([Privacy Policy](${tp.policyUrl}))`\n\t\t\t\t: \"\";\n\t\t\treturn `- **${tp.name}** — ${tp.purpose}${policyLink}`;\n\t\t})\n\t\t.join(\"\\n\");\n\n\treturn {\n\t\tid: \"third-party-cookies\",\n\t\ttitle: \"Third-Party Cookies\",\n\t\tbody: `Some cookies on our site are placed by third-party services. These third parties may use cookies to collect information about your online activities across different websites. We do not control these third-party cookies.\n\nThe following third parties may set cookies through our service:\\n\\n${rows}\\n\\nWe encourage you to review the privacy policies of these third parties to understand their data practices.`,\n\t};\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildTrackingTechnologies(\n\tconfig: CookiePolicyConfig,\n): PolicySection | null {\n\tif (!config.trackingTechnologies || config.trackingTechnologies.length === 0)\n\t\treturn null;\n\n\tconst list = config.trackingTechnologies.map((t) => `- ${t}`).join(\"\\n\");\n\n\treturn {\n\t\tid: \"tracking-technologies\",\n\t\ttitle: \"Similar Tracking Technologies\",\n\t\tbody: `In addition to cookies, we may use the following tracking technologies:\\n\\n${list}\\n\\nThese technologies work similarly to cookies and are subject to the same controls described in this policy.`,\n\t};\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildUpdates(config: CookiePolicyConfig): PolicySection {\n\treturn {\n\t\tid: \"updates\",\n\t\ttitle: \"Updates to This Policy\",\n\t\tbody: `We may update this Cookie Policy from time to time to reflect changes in our practices or applicable law. When we make changes, we will update the **Effective Date** at the top of this policy.\n\nWe encourage you to review this Cookie Policy periodically. Your continued use of our services after any changes constitutes your acceptance of the updated policy.\n\nIf you have questions about changes to this policy, please contact ${config.company.name} at ${config.company.contact}.`,\n\t};\n}\n","import type { CookiePolicyConfig, PolicySection } from \"../../types\";\n\nexport function buildWhatAreCookies(\n\t_config: CookiePolicyConfig,\n): PolicySection {\n\treturn {\n\t\tid: \"what-are-cookies\",\n\t\ttitle: \"What Are Cookies\",\n\t\tbody: `Cookies are small text files that are placed on your device (computer, tablet, or mobile phone) when you visit a website. They are widely used to make websites work, or work more efficiently, and to provide information to the website owner.\n\nCookies are set by the website you visit (first-party cookies) or by third parties whose content appears on that page (third-party cookies). Cookies remain on your device for varying lengths of time depending on their type.`,\n\t};\n}\n","import { renderHTML } from \"./renderers/html\";\nimport { renderMarkdown } from \"./renderers/markdown\";\nimport {\n\tbuildConsent,\n\tbuildContact,\n\tbuildCookieDuration,\n\tbuildCookieTypes,\n\tbuildCookieUsage,\n\tbuildIntroduction,\n\tbuildJurisdiction,\n\tbuildManagingCookies,\n\tbuildThirdPartyCookies,\n\tbuildTrackingTechnologies,\n\tbuildUpdates,\n\tbuildWhatAreCookies,\n} from \"./templates/cookie\";\nimport type {\n\tCompileOptions,\n\tCookiePolicyConfig,\n\tOutputFormat,\n\tPolicySection,\n} from \"./types\";\n\nconst SECTION_BUILDERS: ((\n\tconfig: CookiePolicyConfig,\n) => PolicySection | null)[] = [\n\tbuildIntroduction,\n\tbuildWhatAreCookies,\n\tbuildCookieTypes,\n\tbuildTrackingTechnologies,\n\tbuildCookieUsage,\n\tbuildCookieDuration,\n\tbuildConsent,\n\tbuildManagingCookies,\n\tbuildThirdPartyCookies,\n\tbuildJurisdiction,\n\tbuildUpdates,\n\tbuildContact,\n];\n\nexport function compileCookiePolicy(\n\tconfig: CookiePolicyConfig,\n\toptions: CompileOptions = { formats: [\"markdown\"] },\n): { format: OutputFormat; content: string; sections: PolicySection[] }[] {\n\tconst sections = SECTION_BUILDERS.map((builder) => builder(config)).filter(\n\t\t(s): s is PolicySection => s !== null,\n\t);\n\n\treturn options.formats.map((format) => {\n\t\tswitch (format) {\n\t\t\tcase \"markdown\":\n\t\t\t\treturn { format, content: renderMarkdown(sections), sections };\n\t\t\tcase \"html\":\n\t\t\t\treturn { format, content: renderHTML(sections), sections };\n\t\t\tcase \"pdf\":\n\t\t\t\tthrow new Error(\"pdf format is not yet implemented\");\n\t\t\tcase \"jsx\":\n\t\t\t\tthrow new Error(\"jsx format is not yet implemented\");\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported format: ${format}`);\n\t\t}\n\t});\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildCcpaSupplement(\n\tconfig: PrivacyPolicyConfig,\n): PolicySection | null {\n\tif (!config.jurisdictions.includes(\"ca\")) return null;\n\n\treturn {\n\t\tid: \"ccpa-supplement\",\n\t\ttitle: \"California Privacy Rights (CCPA)\",\n\t\tbody: `This section applies to California residents under the California Consumer Privacy Act (CCPA) and the California Privacy Rights Act (CPRA).\n\n**Categories of Personal Information Collected:** We collect the categories of personal information described in the \"Information We Collect\" section above.\n\n**Your California Rights:**\n- **Right to Know:** You may request information about the personal information we have collected about you, including the categories of sources, the business purpose for collection, and the categories of third parties with whom we share information.\n- **Right to Delete:** You may request deletion of personal information we have collected from you, subject to certain exceptions.\n- **Right to Opt-Out:** You may opt out of the sale or sharing of your personal information.\n- **Right to Non-Discrimination:** We will not discriminate against you for exercising your California privacy rights.\n\nTo exercise your rights, contact us at ${config.company.contact}.`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildChildrenPrivacy(\n\tconfig: PrivacyPolicyConfig,\n): PolicySection | null {\n\tif (!config.children) return null;\n\tconst { underAge, noticeUrl } = config.children;\n\tlet body = `Our service is not directed at children under ${underAge} years old.`;\n\tif (noticeUrl) {\n\t\tbody += ` See our notice for parents and guardians: ${noticeUrl}`;\n\t}\n\treturn {\n\t\tid: \"children-privacy\",\n\t\ttitle: \"Children’s Privacy\",\n\t\tbody,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildContact(config: PrivacyPolicyConfig): PolicySection {\n\treturn {\n\t\tid: \"contact\",\n\t\ttitle: \"Contact Us\",\n\t\tbody: `If you have questions or concerns about this Privacy Policy or our data practices, please contact us:\n\n**${config.company.legalName}**\n${config.company.address}\n\nEmail: ${config.company.contact}`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildCookies(config: PrivacyPolicyConfig): PolicySection {\n\tconst enabled: string[] = [];\n\tif (config.cookies.essential)\n\t\tenabled.push(\n\t\t\t\"**Essential cookies** — required for the service to function\",\n\t\t);\n\tif (config.cookies.analytics)\n\t\tenabled.push(\n\t\t\t\"**Analytics cookies** — help us understand how visitors interact with our service\",\n\t\t);\n\tif (config.cookies.marketing)\n\t\tenabled.push(\n\t\t\t\"**Marketing cookies** — used to deliver relevant advertisements\",\n\t\t);\n\n\tconst body =\n\t\tenabled.length > 0\n\t\t\t? `We use the following types of cookies and tracking technologies:\\n\\n${enabled.map((e) => `- ${e}`).join(\"\\n\")}`\n\t\t\t: \"We do not use cookies or tracking technologies on our service.\";\n\n\treturn {\n\t\tid: \"cookies\",\n\t\ttitle: \"Cookies and Tracking\",\n\t\tbody,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildDataCollected(config: PrivacyPolicyConfig): PolicySection {\n\tconst entries = Object.entries(config.dataCollected);\n\tconst lines = entries.map(([category, items]) => {\n\t\tconst itemList = items.map((item) => ` - ${item}`).join(\"\\n\");\n\t\treturn `**${category}:**\\n${itemList}`;\n\t});\n\n\treturn {\n\t\tid: \"data-collected\",\n\t\ttitle: \"Information We Collect\",\n\t\tbody: `We collect the following categories of information:\\n\\n${lines.join(\"\\n\\n\")}`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildDataRetention(config: PrivacyPolicyConfig): PolicySection {\n\tconst entries = Object.entries(config.retention);\n\tconst lines = entries.map(\n\t\t([category, period]) => `- **${category}:** ${period}`,\n\t);\n\n\treturn {\n\t\tid: \"data-retention\",\n\t\ttitle: \"Data Retention\",\n\t\tbody: `We retain your information for the following periods:\\n\\n${lines.join(\"\\n\")}`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildGdprSupplement(\n\tconfig: PrivacyPolicyConfig,\n): PolicySection | null {\n\tif (!config.jurisdictions.includes(\"eu\")) return null;\n\n\treturn {\n\t\tid: \"gdpr-supplement\",\n\t\ttitle: \"GDPR Supplemental Disclosures\",\n\t\tbody: `This section applies to individuals in the European Economic Area (EEA) under the General Data Protection Regulation (GDPR).\n\n**Data Controller:** ${config.company.legalName}, ${config.company.address}\n\n**Your GDPR Rights:** In addition to the rights listed above, you have the right to lodge a complaint with your local data protection authority if you believe we have not handled your data in accordance with applicable law.\n\n**International Transfers:** If we transfer your personal data outside the EEA, we ensure adequate safeguards are in place in accordance with GDPR requirements.`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildIntroduction(config: PrivacyPolicyConfig): PolicySection {\n\treturn {\n\t\tid: \"introduction\",\n\t\ttitle: \"Introduction\",\n\t\tbody: `This Privacy Policy describes how ${config.company.name} (\"we\", \"us\", or \"our\") collects, uses, and shares information about you when you use our services.\n\n**Effective Date:** ${config.effectiveDate}\n\nIf you have questions about this policy, please contact us at ${config.company.contact}.`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildLegalBasis(\n\tconfig: PrivacyPolicyConfig,\n): PolicySection | null {\n\tif (!config.jurisdictions.includes(\"eu\")) return null;\n\n\treturn {\n\t\tid: \"legal-basis\",\n\t\ttitle: \"Legal Basis for Processing\",\n\t\tbody: `We process your personal data under the following legal basis:\\n\\n${config.legalBasis}`,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nexport function buildThirdParties(config: PrivacyPolicyConfig): PolicySection {\n\tconst lines = config.thirdParties.map(\n\t\t(tp) => `- **${tp.name}** — ${tp.purpose}`,\n\t);\n\n\tconst body =\n\t\tlines.length > 0\n\t\t\t? `We share data with the following third-party services:\\n\\n${lines.join(\"\\n\")}`\n\t\t\t: \"We do not share your data with third-party services.\";\n\n\treturn {\n\t\tid: \"third-parties\",\n\t\ttitle: \"Third-Party Services\",\n\t\tbody,\n\t};\n}\n","import type { PolicySection, PrivacyPolicyConfig } from \"../../types\";\n\nconst RIGHTS_LABELS: Record<string, string> = {\n\taccess: \"Right to access your personal data\",\n\trectification: \"Right to correct inaccurate data\",\n\terasure: \"Right to request deletion of your data\",\n\tportability: \"Right to receive your data in a portable format\",\n\trestriction: \"Right to restrict how we process your data\",\n\tobjection: \"Right to object to processing\",\n\topt_out_sale: \"Right to opt out of the sale of your personal information\",\n\tnon_discrimination:\n\t\t\"Right to non-discriminatory treatment for exercising your rights\",\n};\n\nexport function buildUserRights(config: PrivacyPolicyConfig): PolicySection {\n\tconst lines = config.userRights.map((right) => {\n\t\tconst label = RIGHTS_LABELS[right] ?? right;\n\t\treturn `- ${label}`;\n\t});\n\n\treturn {\n\t\tid: \"user-rights\",\n\t\ttitle: \"Your Rights\",\n\t\tbody: `You have the following rights regarding your personal data:\\n\\n${lines.join(\"\\n\")}`,\n\t};\n}\n","import { renderHTML } from \"./renderers/html\";\nimport { renderMarkdown } from \"./renderers/markdown\";\nimport {\n\tbuildCcpaSupplement,\n\tbuildChildrenPrivacy,\n\tbuildContact,\n\tbuildCookies,\n\tbuildDataCollected,\n\tbuildDataRetention,\n\tbuildGdprSupplement,\n\tbuildIntroduction,\n\tbuildLegalBasis,\n\tbuildThirdParties,\n\tbuildUserRights,\n} from \"./templates/privacy\";\nimport type {\n\tCompileOptions,\n\tOutputFormat,\n\tPolicySection,\n\tPrivacyPolicyConfig,\n} from \"./types\";\n\nconst SECTION_BUILDERS: ((\n\tconfig: PrivacyPolicyConfig,\n) => PolicySection | null)[] = [\n\tbuildIntroduction,\n\tbuildChildrenPrivacy,\n\tbuildDataCollected,\n\tbuildLegalBasis,\n\tbuildDataRetention,\n\tbuildCookies,\n\tbuildThirdParties,\n\tbuildUserRights,\n\tbuildGdprSupplement,\n\tbuildCcpaSupplement,\n\tbuildContact,\n];\n\nexport function compilePrivacyPolicy(\n\tconfig: PrivacyPolicyConfig,\n\toptions: CompileOptions = { formats: [\"markdown\"] },\n): { format: OutputFormat; content: string; sections: PolicySection[] }[] {\n\tconst sections = SECTION_BUILDERS.map((builder) => builder(config)).filter(\n\t\t(s): s is PolicySection => s !== null,\n\t);\n\n\treturn options.formats.map((format) => {\n\t\tswitch (format) {\n\t\t\tcase \"markdown\":\n\t\t\t\treturn { format, content: renderMarkdown(sections), sections };\n\t\t\tcase \"html\":\n\t\t\t\treturn { format, content: renderHTML(sections), sections };\n\t\t\tcase \"pdf\":\n\t\t\t\tthrow new Error(\"pdf format is not yet implemented\");\n\t\t\tcase \"jsx\":\n\t\t\t\tthrow new Error(\"jsx format is not yet implemented\");\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported format: ${format}`);\n\t\t}\n\t});\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildAcceptance(config: TermsOfServiceConfig): PolicySection {\n\tconst methodList = config.acceptance.methods.map((m) => `- ${m}`).join(\"\\n\");\n\n\treturn {\n\t\tid: \"tos-acceptance\",\n\t\ttitle: \"Acceptance of Terms\",\n\t\tbody: `By accessing or using our services, you agree to be bound by these Terms. You accept these Terms by:\\n\\n${methodList}\\n\\nIf you do not agree to these Terms, you may not use our services.`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildAccounts(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.accounts) return null;\n\n\tconst {\n\t\tregistrationRequired,\n\t\tuserResponsibleForCredentials,\n\t\tcompanyCanTerminate,\n\t} = config.accounts;\n\n\tconst lines: string[] = [];\n\n\tif (registrationRequired) {\n\t\tlines.push(\n\t\t\t\"You must create an account to access certain features of our services. You agree to provide accurate, current, and complete information during registration.\",\n\t\t);\n\t}\n\n\tif (userResponsibleForCredentials) {\n\t\tlines.push(\n\t\t\t\"You are responsible for maintaining the confidentiality of your account credentials and for all activities that occur under your account. You must notify us immediately of any unauthorized use of your account.\",\n\t\t);\n\t}\n\n\tif (companyCanTerminate) {\n\t\tlines.push(\n\t\t\t`${config.company.name} reserves the right to suspend or terminate your account at any time, with or without notice, for any reason including violation of these Terms.`,\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-accounts\",\n\t\ttitle: \"Accounts\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildAvailability(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.availability) return null;\n\n\tconst lines: string[] = [];\n\n\tif (config.availability.noUptimeGuarantee) {\n\t\tlines.push(\n\t\t\t\"We do not guarantee that our services will be available at all times. Our services may be subject to interruptions, delays, or errors.\",\n\t\t);\n\t}\n\n\tif (config.availability.maintenanceWindows) {\n\t\tlines.push(`**Maintenance:** ${config.availability.maintenanceWindows}`);\n\t}\n\n\treturn {\n\t\tid: \"tos-availability\",\n\t\ttitle: \"Service Availability\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildChangesToTerms(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.changesPolicy) return null;\n\n\tconst { noticeMethod, noticePeriodDays } = config.changesPolicy;\n\n\tconst periodText = noticePeriodDays\n\t\t? ` at least **${noticePeriodDays} days** before they take effect`\n\t\t: \" before they take effect\";\n\n\treturn {\n\t\tid: \"tos-changes\",\n\t\ttitle: \"Changes to These Terms\",\n\t\tbody: `We may update these Terms from time to time. We will notify you of material changes via ${noticeMethod}${periodText}. Your continued use of our services after changes become effective constitutes your acceptance of the revised Terms.`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildContact(config: TermsOfServiceConfig): PolicySection {\n\treturn {\n\t\tid: \"tos-contact\",\n\t\ttitle: \"Contact Us\",\n\t\tbody: `If you have any questions about these Terms, please contact us at:\n\n**${config.company.legalName}**\n${config.company.address}\n${config.company.contact}`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildDisclaimers(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.disclaimers) return null;\n\n\tconst lines: string[] = [];\n\n\tif (config.disclaimers.serviceProvidedAsIs) {\n\t\tlines.push(\n\t\t\t'OUR SERVICES ARE PROVIDED \"AS IS\" AND \"AS AVAILABLE\" WITHOUT WARRANTIES OF ANY KIND.',\n\t\t);\n\t}\n\n\tif (config.disclaimers.noWarranties) {\n\t\tlines.push(\n\t\t\t`${config.company.legalName} EXPRESSLY DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.`,\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-disclaimers\",\n\t\ttitle: \"Disclaimer of Warranties\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildDisputeResolution(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.disputeResolution) return null;\n\n\tconst { method, venue, classActionWaiver } = config.disputeResolution;\n\n\tconst methodDescriptions: Record<string, string> = {\n\t\tarbitration:\n\t\t\t\"Any disputes arising out of or relating to these Terms or our services shall be resolved by binding arbitration rather than in court.\",\n\t\tlitigation:\n\t\t\t\"Any disputes arising out of or relating to these Terms or our services shall be resolved through litigation in a court of competent jurisdiction.\",\n\t\tmediation:\n\t\t\t\"Any disputes arising out of or relating to these Terms or our services shall first be submitted to non-binding mediation before pursuing other remedies.\",\n\t};\n\n\tconst lines: string[] = [\n\t\tmethodDescriptions[method] ??\n\t\t\t\"Disputes arising out of or relating to these Terms shall be resolved as described below.\",\n\t];\n\n\tif (venue) {\n\t\tlines.push(`**Venue:** ${venue}`);\n\t}\n\n\tif (classActionWaiver) {\n\t\tlines.push(\n\t\t\t\"**Class Action Waiver:** You agree that any dispute resolution proceedings will be conducted only on an individual basis and not in a class, consolidated, or representative action.\",\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-dispute-resolution\",\n\t\ttitle: \"Dispute Resolution\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildEligibility(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.eligibility) return null;\n\n\tconst { minimumAge, jurisdictionRestrictions } = config.eligibility;\n\n\tlet body = `You must be at least **${minimumAge} years old** to use our services. By using our services, you represent and warrant that you meet this age requirement.`;\n\n\tif (jurisdictionRestrictions && jurisdictionRestrictions.length > 0) {\n\t\tconst list = jurisdictionRestrictions.map((r) => `- ${r}`).join(\"\\n\");\n\t\tbody += `\\n\\nOur services are not available in the following jurisdictions:\\n\\n${list}`;\n\t}\n\n\treturn {\n\t\tid: \"tos-eligibility\",\n\t\ttitle: \"Eligibility\",\n\t\tbody,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildGoverningLaw(config: TermsOfServiceConfig): PolicySection {\n\treturn {\n\t\tid: \"tos-governing-law\",\n\t\ttitle: \"Governing Law\",\n\t\tbody: `These Terms shall be governed by and construed in accordance with the laws of **${config.governingLaw.jurisdiction}**, without regard to its conflict of law provisions.`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildIndemnification(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.indemnification) return null;\n\n\tconst lines: string[] = [];\n\n\tif (config.indemnification.userIndemnifiesCompany) {\n\t\tlines.push(\n\t\t\t`You agree to indemnify and hold harmless ${config.company.legalName} and its officers, directors, employees, and agents from and against any claims, liabilities, damages, losses, and expenses arising out of or in any way connected with your access to or use of our services.`,\n\t\t);\n\t}\n\n\tif (config.indemnification.scope) {\n\t\tlines.push(`**Scope:** ${config.indemnification.scope}`);\n\t}\n\n\treturn {\n\t\tid: \"tos-indemnification\",\n\t\ttitle: \"Indemnification\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildIntellectualProperty(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.intellectualProperty) return null;\n\n\tconst { companyOwnsService, usersMayNotCopy } = config.intellectualProperty;\n\n\tconst lines: string[] = [];\n\n\tif (companyOwnsService) {\n\t\tlines.push(\n\t\t\t`The services and all content, features, and functionality (including but not limited to text, graphics, logos, and software) are owned by ${config.company.legalName} and are protected by intellectual property laws.`,\n\t\t);\n\t}\n\n\tif (usersMayNotCopy) {\n\t\tlines.push(\n\t\t\t\"You may not copy, modify, distribute, sell, or lease any part of our services or included software, nor may you reverse engineer or attempt to extract the source code of that software.\",\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-intellectual-property\",\n\t\ttitle: \"Intellectual Property\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildIntroduction(config: TermsOfServiceConfig): PolicySection {\n\tconst privacyLine = config.privacyPolicyUrl\n\t\t? `\\n\\nFor information about how we collect and use your data, please review our [Privacy Policy](${config.privacyPolicyUrl}).`\n\t\t: \"\";\n\n\treturn {\n\t\tid: \"tos-introduction\",\n\t\ttitle: \"Terms of Service\",\n\t\tbody: `These Terms of Service (\"Terms\") govern your access to and use of the services provided by ${config.company.name} (\"${config.company.name}\", \"we\", \"us\", or \"our\"). By using our services, you agree to these Terms.\n\n**Effective Date:** ${config.effectiveDate}${privacyLine}`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildLimitationOfLiability(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.limitationOfLiability) return null;\n\n\tconst lines: string[] = [];\n\n\tif (config.limitationOfLiability.excludesIndirectDamages) {\n\t\tlines.push(\n\t\t\t`TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, ${config.company.legalName.toUpperCase()} SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR ANY LOSS OF PROFITS OR REVENUES, WHETHER INCURRED DIRECTLY OR INDIRECTLY, OR ANY LOSS OF DATA, USE, GOODWILL, OR OTHER INTANGIBLE LOSSES.`,\n\t\t);\n\t}\n\n\tif (config.limitationOfLiability.liabilityCap) {\n\t\tlines.push(\n\t\t\t`**Liability Cap:** ${config.limitationOfLiability.liabilityCap}`,\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-limitation-of-liability\",\n\t\ttitle: \"Limitation of Liability\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildPayments(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.payments || !config.payments.hasPaidFeatures) return null;\n\n\tconst lines: string[] = [\n\t\t\"Some features of our services require payment. By selecting a paid plan, you agree to pay all applicable fees.\",\n\t];\n\n\tif (config.payments.refundPolicy) {\n\t\tlines.push(`**Refunds:** ${config.payments.refundPolicy}`);\n\t}\n\n\tif (config.payments.priceChangesNotice) {\n\t\tlines.push(`**Price Changes:** ${config.payments.priceChangesNotice}`);\n\t}\n\n\treturn {\n\t\tid: \"tos-payments\",\n\t\ttitle: \"Payments and Billing\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildProhibitedUse(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.prohibitedUses || config.prohibitedUses.length === 0) return null;\n\n\tconst list = config.prohibitedUses.map((u) => `- ${u}`).join(\"\\n\");\n\n\treturn {\n\t\tid: \"tos-prohibited-use\",\n\t\ttitle: \"Prohibited Uses\",\n\t\tbody: `You agree not to use our services for any of the following purposes:\\n\\n${list}`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildTermination(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.termination) return null;\n\n\tconst { companyCanTerminate, userCanTerminate, effectOfTermination } =\n\t\tconfig.termination;\n\n\tconst lines: string[] = [];\n\n\tif (companyCanTerminate) {\n\t\tlines.push(\n\t\t\t`${config.company.name} may suspend or terminate your access to the services at any time, with or without cause, and with or without notice.`,\n\t\t);\n\t}\n\n\tif (userCanTerminate) {\n\t\tlines.push(\n\t\t\t\"You may terminate your account at any time by discontinuing use of our services or by contacting us to close your account.\",\n\t\t);\n\t}\n\n\tif (effectOfTermination) {\n\t\tlines.push(`**Effect of Termination:** ${effectOfTermination}`);\n\t}\n\n\treturn {\n\t\tid: \"tos-termination\",\n\t\ttitle: \"Termination\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildThirdPartyServices(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.thirdPartyServices || config.thirdPartyServices.length === 0)\n\t\treturn null;\n\n\tconst list = config.thirdPartyServices\n\t\t.map((s) => `- **${s.name}** — ${s.purpose}`)\n\t\t.join(\"\\n\");\n\n\treturn {\n\t\tid: \"tos-third-party-services\",\n\t\ttitle: \"Third-Party Services\",\n\t\tbody: `Our services may integrate with or link to third-party services. Your use of those services is governed by their own terms and policies.\\n\\n${list}`,\n\t};\n}\n","import type { PolicySection, TermsOfServiceConfig } from \"../../types\";\n\nexport function buildUserContent(\n\tconfig: TermsOfServiceConfig,\n): PolicySection | null {\n\tif (!config.userContent) return null;\n\n\tconst {\n\t\tusersOwnContent,\n\t\tlicenseGrantedToCompany,\n\t\tlicenseDescription,\n\t\tcompanyCanRemoveContent,\n\t} = config.userContent;\n\n\tconst lines: string[] = [];\n\n\tif (usersOwnContent) {\n\t\tlines.push(\n\t\t\t'You retain ownership of any content you submit, post, or display on or through our services (\"User Content\").',\n\t\t);\n\t}\n\n\tif (licenseGrantedToCompany) {\n\t\tconst desc = licenseDescription\n\t\t\t? licenseDescription\n\t\t\t: \"a worldwide, royalty-free, non-exclusive license to use, reproduce, modify, and distribute your User Content in connection with operating and improving our services\";\n\t\tlines.push(\n\t\t\t`By submitting User Content, you grant ${config.company.name} ${desc}.`,\n\t\t);\n\t}\n\n\tif (companyCanRemoveContent) {\n\t\tlines.push(\n\t\t\t`${config.company.name} reserves the right to remove any User Content that violates these Terms or that we find objectionable, at our sole discretion.`,\n\t\t);\n\t}\n\n\treturn {\n\t\tid: \"tos-user-content\",\n\t\ttitle: \"User Content\",\n\t\tbody: lines.join(\"\\n\\n\"),\n\t};\n}\n","import { renderHTML } from \"./renderers/html\";\nimport { renderMarkdown } from \"./renderers/markdown\";\nimport { buildAcceptance } from \"./templates/terms/acceptance\";\nimport { buildAccounts } from \"./templates/terms/accounts\";\nimport { buildAvailability } from \"./templates/terms/availability\";\nimport { buildChangesToTerms } from \"./templates/terms/changes-to-terms\";\nimport { buildContact } from \"./templates/terms/contact\";\nimport { buildDisclaimers } from \"./templates/terms/disclaimers\";\nimport { buildDisputeResolution } from \"./templates/terms/dispute-resolution\";\nimport { buildEligibility } from \"./templates/terms/eligibility\";\nimport { buildGoverningLaw } from \"./templates/terms/governing-law\";\nimport { buildIndemnification } from \"./templates/terms/indemnification\";\nimport { buildIntellectualProperty } from \"./templates/terms/intellectual-property\";\nimport { buildIntroduction } from \"./templates/terms/introduction\";\nimport { buildLimitationOfLiability } from \"./templates/terms/limitation-of-liability\";\nimport { buildPayments } from \"./templates/terms/payments\";\nimport { buildProhibitedUse } from \"./templates/terms/prohibited-use\";\nimport { buildTermination } from \"./templates/terms/termination\";\nimport { buildThirdPartyServices } from \"./templates/terms/third-party-services\";\nimport { buildUserContent } from \"./templates/terms/user-content\";\nimport type {\n\tCompileOptions,\n\tOutputFormat,\n\tPolicySection,\n\tTermsOfServiceConfig,\n} from \"./types\";\n\nconst SECTION_BUILDERS: ((\n\tconfig: TermsOfServiceConfig,\n) => PolicySection | null)[] = [\n\tbuildIntroduction,\n\tbuildAcceptance,\n\tbuildEligibility,\n\tbuildAccounts,\n\tbuildProhibitedUse,\n\tbuildUserContent,\n\tbuildIntellectualProperty,\n\tbuildPayments,\n\tbuildAvailability,\n\tbuildTermination,\n\tbuildDisclaimers,\n\tbuildLimitationOfLiability,\n\tbuildIndemnification,\n\tbuildThirdPartyServices,\n\tbuildDisputeResolution,\n\tbuildGoverningLaw,\n\tbuildChangesToTerms,\n\tbuildContact,\n];\n\nexport function compileTermsOfService(\n\tconfig: TermsOfServiceConfig,\n\toptions: CompileOptions = { formats: [\"markdown\"] },\n): { format: OutputFormat; content: string; sections: PolicySection[] }[] {\n\tconst sections = SECTION_BUILDERS.map((builder) => builder(config)).filter(\n\t\t(s): s is PolicySection => s !== null,\n\t);\n\n\treturn options.formats.map((format) => {\n\t\tswitch (format) {\n\t\t\tcase \"markdown\":\n\t\t\t\treturn { format, content: renderMarkdown(sections), sections };\n\t\t\tcase \"html\":\n\t\t\t\treturn { format, content: renderHTML(sections), sections };\n\t\t\tcase \"pdf\":\n\t\t\t\tthrow new Error(\"pdf format is not yet implemented\");\n\t\t\tcase \"jsx\":\n\t\t\t\tthrow new Error(\"jsx format is not yet implemented\");\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported format: ${format}`);\n\t\t}\n\t});\n}\n","export type OutputFormat = \"markdown\" | \"html\" | \"pdf\" | \"jsx\";\n\nexport type CompileOptions = { formats: OutputFormat[] };\n\nexport type PolicySection = {\n\tid: string;\n\ttitle: string;\n\tbody: string;\n};\n\nexport type Jurisdiction = \"us\" | \"eu\" | \"ca\" | \"au\" | \"nz\" | \"other\";\n\nexport type CompanyConfig = {\n\tname: string;\n\tlegalName: string;\n\taddress: string;\n\tcontact: string;\n};\n\nexport type PrivacyPolicyConfig = {\n\teffectiveDate: string;\n\tcompany: CompanyConfig;\n\tdataCollected: Record<string, string[]>;\n\tlegalBasis: string;\n\tretention: Record<string, string>;\n\tcookies: { essential: boolean; analytics: boolean; marketing: boolean };\n\tthirdParties: { name: string; purpose: string }[];\n\tuserRights: string[];\n\tjurisdictions: Jurisdiction[];\n\t// optional children-specific policy\n\tchildren?: {\n\t\tunderAge: number;\n\t\tnoticeUrl?: string;\n\t};\n};\n\nexport type DisputeResolutionMethod =\n\t| \"arbitration\"\n\t| \"litigation\"\n\t| \"mediation\";\n\nexport type TermsOfServiceConfig = {\n\teffectiveDate: string;\n\tcompany: CompanyConfig;\n\tacceptance: { methods: string[] };\n\teligibility?: { minimumAge: number; jurisdictionRestrictions?: string[] };\n\taccounts?: {\n\t\tregistrationRequired: boolean;\n\t\tuserResponsibleForCredentials: boolean;\n\t\tcompanyCanTerminate: boolean;\n\t};\n\tprohibitedUses?: string[];\n\tuserContent?: {\n\t\tusersOwnContent: boolean;\n\t\tlicenseGrantedToCompany: boolean;\n\t\tlicenseDescription?: string;\n\t\tcompanyCanRemoveContent: boolean;\n\t};\n\tintellectualProperty?: {\n\t\tcompanyOwnsService: boolean;\n\t\tusersMayNotCopy: boolean;\n\t};\n\tpayments?: {\n\t\thasPaidFeatures: boolean;\n\t\trefundPolicy?: string;\n\t\tpriceChangesNotice?: string;\n\t};\n\tavailability?: { noUptimeGuarantee: boolean; maintenanceWindows?: string };\n\ttermination?: {\n\t\tcompanyCanTerminate: boolean;\n\t\tuserCanTerminate: boolean;\n\t\teffectOfTermination?: string;\n\t};\n\tdisclaimers?: { serviceProvidedAsIs: boolean; noWarranties: boolean };\n\tlimitationOfLiability?: {\n\t\texcludesIndirectDamages: boolean;\n\t\tliabilityCap?: string;\n\t};\n\tindemnification?: { userIndemnifiesCompany: boolean; scope?: string };\n\tthirdPartyServices?: { name: string; purpose: string }[];\n\tdisputeResolution?: {\n\t\tmethod: DisputeResolutionMethod;\n\t\tvenue?: string;\n\t\tclassActionWaiver?: boolean;\n\t};\n\tgoverningLaw: { jurisdiction: string };\n\tchangesPolicy?: { noticeMethod: string; noticePeriodDays?: number };\n\tprivacyPolicyUrl?: string;\n};\n\nexport type CookiePolicyConfig = {\n\teffectiveDate: string;\n\tcompany: CompanyConfig;\n\tcookies: {\n\t\tessential: boolean;\n\t\tanalytics: boolean;\n\t\tfunctional: boolean;\n\t\tmarketing: boolean;\n\t};\n\tthirdParties?: { name: string; purpose: string; policyUrl?: string }[];\n\ttrackingTechnologies?: string[];\n\tconsentMechanism?: {\n\t\thasBanner: boolean;\n\t\thasPreferencePanel: boolean;\n\t\tcanWithdraw: boolean;\n\t};\n\tjurisdictions: Jurisdiction[];\n};\n\nexport type PolicyInput =\n\t| ({ type: \"privacy\" } & PrivacyPolicyConfig)\n\t| ({ type: \"terms\" } & TermsOfServiceConfig)\n\t| ({ type: \"cookie\" } & CookiePolicyConfig);\n\nexport type OpenPolicyConfig = {\n\tcompany: CompanyConfig;\n\tprivacy?: Omit<PrivacyPolicyConfig, \"company\">;\n\tterms?: Omit<TermsOfServiceConfig, \"company\">;\n\tcookie?: Omit<CookiePolicyConfig, \"company\">;\n};\n\nexport function isOpenPolicyConfig(value: unknown): value is OpenPolicyConfig {\n\tif (value === null || typeof value !== \"object\") return false;\n\tconst obj = value as Record<string, unknown>;\n\treturn (\n\t\t\"company\" in obj &&\n\t\t!(\"effectiveDate\" in obj) &&\n\t\t(\"privacy\" in obj || \"terms\" in obj || \"cookie\" in obj)\n\t);\n}\n\nexport type ValidationIssue = {\n\tlevel: \"error\" | \"warning\";\n\tmessage: string;\n};\n","import type { PrivacyPolicyConfig, ValidationIssue } from \"./types\";\n\nexport function validatePrivacyPolicy(\n\tconfig: PrivacyPolicyConfig,\n): ValidationIssue[] {\n\tconst issues: ValidationIssue[] = [];\n\n\t// Required fields\n\tif (!config.effectiveDate)\n\t\tissues.push({ level: \"error\", message: \"effectiveDate is required\" });\n\tif (!config.company.name)\n\t\tissues.push({ level: \"error\", message: \"company.name is required\" });\n\tif (!config.company.legalName)\n\t\tissues.push({ level: \"error\", message: \"company.legalName is required\" });\n\tif (!config.company.address)\n\t\tissues.push({ level: \"error\", message: \"company.address is required\" });\n\tif (!config.company.contact)\n\t\tissues.push({ level: \"error\", message: \"company.contact is required\" });\n\tif (Object.keys(config.dataCollected).length === 0)\n\t\tissues.push({\n\t\t\tlevel: \"error\",\n\t\t\tmessage: \"dataCollected must have at least one entry\",\n\t\t});\n\tif (config.userRights.length === 0)\n\t\tissues.push({\n\t\t\tlevel: \"warning\",\n\t\t\tmessage: \"userRights is empty — consider listing applicable rights\",\n\t\t});\n\n\t// GDPR checks\n\tif (config.jurisdictions.includes(\"eu\")) {\n\t\tif (!config.legalBasis)\n\t\t\tissues.push({ level: \"error\", message: \"GDPR requires a legalBasis\" });\n\t\tfor (const right of [\n\t\t\t\"access\",\n\t\t\t\"rectification\",\n\t\t\t\"erasure\",\n\t\t\t\"portability\",\n\t\t\t\"restriction\",\n\t\t\t\"objection\",\n\t\t]) {\n\t\t\tif (!config.userRights.includes(right))\n\t\t\t\tissues.push({\n\t\t\t\t\tlevel: \"warning\",\n\t\t\t\t\tmessage: `GDPR recommends including the \"${right}\" right`,\n\t\t\t\t});\n\t\t}\n\t}\n\n\t// CCPA checks\n\tif (config.jurisdictions.includes(\"ca\")) {\n\t\tfor (const right of [\n\t\t\t\"access\",\n\t\t\t\"erasure\",\n\t\t\t\"opt_out_sale\",\n\t\t\t\"non_discrimination\",\n\t\t]) {\n\t\t\tif (!config.userRights.includes(right))\n\t\t\t\tissues.push({\n\t\t\t\t\tlevel: \"warning\",\n\t\t\t\t\tmessage: `CCPA recommends including the \"${right}\" right`,\n\t\t\t\t});\n\t\t}\n\t}\n\n\t// children config sanity\n\tif (config.children) {\n\t\tif (config.children.underAge <= 0) {\n\t\t\tissues.push({\n\t\t\t\tlevel: \"error\",\n\t\t\t\tmessage: \"children.underAge must be a positive number\",\n\t\t\t});\n\t\t}\n\t}\n\n\treturn issues;\n}\n","import type { CookiePolicyConfig, ValidationIssue } from \"./types\";\n\nexport function validateCookiePolicy(\n\tconfig: CookiePolicyConfig,\n): ValidationIssue[] {\n\tconst issues: ValidationIssue[] = [];\n\n\t// Required fields\n\tif (!config.effectiveDate)\n\t\tissues.push({ level: \"error\", message: \"effectiveDate is required\" });\n\tif (!config.company.name)\n\t\tissues.push({ level: \"error\", message: \"company.name is required\" });\n\tif (!config.company.legalName)\n\t\tissues.push({ level: \"error\", message: \"company.legalName is required\" });\n\tif (!config.company.address)\n\t\tissues.push({ level: \"error\", message: \"company.address is required\" });\n\tif (!config.company.contact)\n\t\tissues.push({ level: \"error\", message: \"company.contact is required\" });\n\n\tconst { essential, analytics, functional, marketing } = config.cookies;\n\tif (!essential && !analytics && !functional && !marketing) {\n\t\tissues.push({\n\t\t\tlevel: \"error\",\n\t\t\tmessage:\n\t\t\t\t\"At least one cookie type must be enabled (essential, analytics, functional, or marketing)\",\n\t\t});\n\t}\n\n\t// Advisory checks\n\tif (!config.consentMechanism) {\n\t\tissues.push({\n\t\t\tlevel: \"warning\",\n\t\t\tmessage:\n\t\t\t\t\"consentMechanism is not provided — consider describing how users can manage cookie consent\",\n\t\t});\n\t}\n\n\t// GDPR consent withdrawal check\n\tif (\n\t\tconfig.jurisdictions.includes(\"eu\") &&\n\t\tconfig.consentMechanism &&\n\t\t!config.consentMechanism.canWithdraw\n\t) {\n\t\tissues.push({\n\t\t\tlevel: \"warning\",\n\t\t\tmessage:\n\t\t\t\t\"GDPR requires that users can withdraw cookie consent — consider setting consentMechanism.canWithdraw to true\",\n\t\t});\n\t}\n\n\treturn issues;\n}\n","import type { TermsOfServiceConfig, ValidationIssue } from \"./types\";\n\nexport function validateTermsOfService(\n\tconfig: TermsOfServiceConfig,\n): ValidationIssue[] {\n\tconst issues: ValidationIssue[] = [];\n\n\t// Required fields\n\tif (!config.effectiveDate)\n\t\tissues.push({ level: \"error\", message: \"effectiveDate is required\" });\n\tif (!config.company.name)\n\t\tissues.push({ level: \"error\", message: \"company.name is required\" });\n\tif (!config.company.legalName)\n\t\tissues.push({ level: \"error\", message: \"company.legalName is required\" });\n\tif (!config.company.address)\n\t\tissues.push({ level: \"error\", message: \"company.address is required\" });\n\tif (!config.company.contact)\n\t\tissues.push({ level: \"error\", message: \"company.contact is required\" });\n\tif (!config.governingLaw.jurisdiction)\n\t\tissues.push({\n\t\t\tlevel: \"error\",\n\t\t\tmessage: \"governingLaw.jurisdiction is required\",\n\t\t});\n\n\t// Advisory checks\n\tif (!config.disclaimers) {\n\t\tissues.push({\n\t\t\tlevel: \"warning\",\n\t\t\tmessage:\n\t\t\t\t\"disclaimers is missing — consider adding a disclaimer of warranties\",\n\t\t});\n\t}\n\tif (!config.limitationOfLiability) {\n\t\tissues.push({\n\t\t\tlevel: \"warning\",\n\t\t\tmessage:\n\t\t\t\t\"limitationOfLiability is missing — consider adding a limitation of liability clause\",\n\t\t});\n\t}\n\tif (config.acceptance.methods.length === 0) {\n\t\tissues.push({\n\t\t\tlevel: \"warning\",\n\t\t\tmessage:\n\t\t\t\t\"acceptance.methods is empty — consider listing how users accept these Terms\",\n\t\t});\n\t}\n\n\treturn issues;\n}\n","export { compileCookiePolicy } from \"./cookie\";\nexport { compilePrivacyPolicy } from \"./privacy\";\nexport { compileTermsOfService } from \"./terms\";\nexport type {\n\tCompanyConfig,\n\tCompileOptions,\n\tCookiePolicyConfig,\n\tDisputeResolutionMethod,\n\tJurisdiction,\n\tOpenPolicyConfig,\n\tOutputFormat,\n\tPolicyInput,\n\tPolicySection,\n\tPrivacyPolicyConfig,\n\tTermsOfServiceConfig,\n\tValidationIssue,\n} from \"./types\";\nexport { isOpenPolicyConfig } from \"./types\";\nexport { validatePrivacyPolicy } from \"./validate\";\nexport { validateCookiePolicy } from \"./validate-cookie\";\nexport { validateTermsOfService } from \"./validate-terms\";\n\nimport { compileCookiePolicy } from \"./cookie\";\nimport { compilePrivacyPolicy } from \"./privacy\";\nimport { compileTermsOfService } from \"./terms\";\nimport type { CompileOptions, OpenPolicyConfig, PolicyInput } from \"./types\";\n\nexport function expandOpenPolicyConfig(\n\tconfig: OpenPolicyConfig,\n): PolicyInput[] {\n\tconst inputs: PolicyInput[] = [];\n\tif (config.privacy) {\n\t\tinputs.push({\n\t\t\ttype: \"privacy\",\n\t\t\tcompany: config.company,\n\t\t\t...config.privacy,\n\t\t});\n\t}\n\tif (config.terms) {\n\t\tinputs.push({ type: \"terms\", company: config.company, ...config.terms });\n\t}\n\tif (config.cookie) {\n\t\tinputs.push({ type: \"cookie\", company: config.company, ...config.cookie });\n\t}\n\treturn inputs;\n}\n\nexport function compilePolicy(input: PolicyInput, options?: CompileOptions) {\n\tswitch (input.type) {\n\t\tcase \"privacy\": {\n\t\t\tconst { type: _, ...config } = input;\n\t\t\treturn compilePrivacyPolicy(config, options);\n\t\t}\n\t\tcase \"terms\": {\n\t\t\tconst { type: _, ...config } = input;\n\t\t\treturn compileTermsOfService(config, options);\n\t\t}\n\t\tcase \"cookie\": {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MAAM,GAAG,GAAG,WAAW;AAC/B,UAAO,qBAAqB,QAAQ,QAAQ;;EAE7C,KAAK,SAAS;GACb,MAAM,EAAE,MAAM,GAAG,GAAG,WAAW;AAC/B,UAAO,sBAAsB,QAAQ,QAAQ;;EAE9C,KAAK,UAAU;GACd,MAAM,EAAE,MAAM,GAAG,GAAG,WAAW;AAC/B,UAAO,oBAAoB,QAAQ,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpolicy/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core package for OpenPolicy",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "GPL-3.0-only",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/jamiedavenport/openpolicy",
|