@openpolicy/core 0.0.16 → 0.0.18
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 +21 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
//#region src/types.d.ts
|
|
2
|
-
type OutputFormat = "markdown" | "html" | "pdf"
|
|
2
|
+
type OutputFormat = "markdown" | "html" | "pdf";
|
|
3
3
|
type CompileOptions = {
|
|
4
4
|
formats: OutputFormat[];
|
|
5
5
|
};
|
|
6
6
|
type Jurisdiction = "us" | "eu" | "ca" | "au" | "nz" | "other";
|
|
7
|
+
type UserRight = "access" | "rectification" | "erasure" | "portability" | "restriction" | "objection" | "opt_out_sale" | "non_discrimination";
|
|
8
|
+
type LegalBasis = "consent" | "contract" | "legal_obligation" | "vital_interests" | "public_task" | "legitimate_interests";
|
|
7
9
|
type CompanyConfig = {
|
|
8
10
|
name: string;
|
|
9
11
|
legalName: string;
|
|
@@ -14,7 +16,7 @@ type PrivacyPolicyConfig = {
|
|
|
14
16
|
effectiveDate: string;
|
|
15
17
|
company: CompanyConfig;
|
|
16
18
|
dataCollected: Record<string, string[]>;
|
|
17
|
-
legalBasis:
|
|
19
|
+
legalBasis: LegalBasis | LegalBasis[];
|
|
18
20
|
retention: Record<string, string>;
|
|
19
21
|
cookies: {
|
|
20
22
|
essential: boolean;
|
|
@@ -24,8 +26,9 @@ type PrivacyPolicyConfig = {
|
|
|
24
26
|
thirdParties: {
|
|
25
27
|
name: string;
|
|
26
28
|
purpose: string;
|
|
29
|
+
policyUrl?: string;
|
|
27
30
|
}[];
|
|
28
|
-
userRights:
|
|
31
|
+
userRights: UserRight[];
|
|
29
32
|
jurisdictions: Jurisdiction[];
|
|
30
33
|
children?: {
|
|
31
34
|
underAge: number;
|
|
@@ -103,15 +106,14 @@ type TermsOfServiceConfig = {
|
|
|
103
106
|
};
|
|
104
107
|
privacyPolicyUrl?: string;
|
|
105
108
|
};
|
|
109
|
+
type CookiePolicyCookies = {
|
|
110
|
+
essential: boolean;
|
|
111
|
+
[key: string]: boolean;
|
|
112
|
+
};
|
|
106
113
|
type CookiePolicyConfig = {
|
|
107
114
|
effectiveDate: string;
|
|
108
115
|
company: CompanyConfig;
|
|
109
|
-
cookies:
|
|
110
|
-
essential: boolean;
|
|
111
|
-
analytics: boolean;
|
|
112
|
-
functional: boolean;
|
|
113
|
-
marketing: boolean;
|
|
114
|
-
};
|
|
116
|
+
cookies: CookiePolicyCookies;
|
|
115
117
|
thirdParties?: {
|
|
116
118
|
name: string;
|
|
117
119
|
purpose: string;
|
|
@@ -144,6 +146,15 @@ type ValidationIssue = {
|
|
|
144
146
|
message: string;
|
|
145
147
|
};
|
|
146
148
|
//#endregion
|
|
149
|
+
//#region src/consent.d.ts
|
|
150
|
+
type CookieConsent = {
|
|
151
|
+
essential: true;
|
|
152
|
+
[key: string]: boolean;
|
|
153
|
+
};
|
|
154
|
+
type CookieConsentStatus = "undecided" | "completed";
|
|
155
|
+
declare function acceptAll(config: CookiePolicyConfig): CookieConsent;
|
|
156
|
+
declare function rejectAll(config?: CookiePolicyConfig): CookieConsent;
|
|
157
|
+
//#endregion
|
|
147
158
|
//#region src/documents/types.d.ts
|
|
148
159
|
type NodeContext = {
|
|
149
160
|
reason?: string;
|
|
@@ -235,5 +246,5 @@ declare function validateTermsOfService(config: TermsOfServiceConfig): Validatio
|
|
|
235
246
|
//#region src/index.d.ts
|
|
236
247
|
declare function expandOpenPolicyConfig(config: OpenPolicyConfig): PolicyInput[];
|
|
237
248
|
//#endregion
|
|
238
|
-
export { type BoldNode, type CompanyConfig, type CompileOptions, type ContentNode, type CookiePolicyConfig, type DisputeResolutionMethod, type Document, type DocumentSection, type HeadingNode, type InlineNode, type ItalicNode, type Jurisdiction, type LinkNode, type ListItemNode, type ListNode, type Node, type NodeContext, type OpenPolicyConfig, type OutputFormat, type ParagraphNode, type PolicyInput, type PolicyType, type PrivacyPolicyConfig, type TermsOfServiceConfig, type TextNode, type ValidationIssue, bold, compile, expandOpenPolicyConfig, heading, isOpenPolicyConfig, italic, li, link, ol, p, section, text, ul, validateCookiePolicy, validatePrivacyPolicy, validateTermsOfService };
|
|
249
|
+
export { type BoldNode, type CompanyConfig, type CompileOptions, type ContentNode, type CookieConsent, type CookieConsentStatus, type CookiePolicyConfig, type DisputeResolutionMethod, type Document, type DocumentSection, type HeadingNode, type InlineNode, type ItalicNode, type Jurisdiction, type LegalBasis, type LinkNode, type ListItemNode, type ListNode, type Node, type NodeContext, type OpenPolicyConfig, type OutputFormat, type ParagraphNode, type PolicyInput, type PolicyType, type PrivacyPolicyConfig, type TermsOfServiceConfig, type TextNode, type UserRight, type ValidationIssue, acceptAll, bold, compile, expandOpenPolicyConfig, heading, isOpenPolicyConfig, italic, li, link, ol, p, rejectAll, section, text, ul, validateCookiePolicy, validatePrivacyPolicy, validateTermsOfService };
|
|
239
250
|
//# 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/documents/types.ts","../src/documents/helpers.ts","../src/documents/index.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,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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/consent.ts","../src/documents/types.ts","../src/documents/helpers.ts","../src/documents/index.ts","../src/validate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ACZ,QAAA,YAAoB,UAAA,KACpB,OAAA,GAAU,WAAA,KACR,aAAA;AAAA,cAKU,EAAA,GACZ,QAAA,YAAoB,UAAA,GAAa,QAAA,KACjC,OAAA,GAAU,WAAA,KACR,YAAA;AAAA,cAKU,EAAA,GAAM,KAAA,EAAO,YAAA,IAAgB,OAAA,GAAU,WAAA,KAAc,QAAA;AAAA,cAKrD,EAAA,GAAM,KAAA,EAAO,YAAA,IAAgB,OAAA,GAAU,WAAA,KAAc,QAAA;AAAA,cAMrD,OAAA,GACZ,EAAA,UACA,OAAA,EAAS,WAAA,IACT,OAAA,GAAU,WAAA,KACR,eAAA;;;iBC1Ea,OAAA,CAAQ,KAAA,EAAO,WAAA,GAAc,QAAA;;;iBCJ7B,qBAAA,CACf,MAAA,EAAQ,mBAAA,GACN,eAAA;;;iBCFa,oBAAA,CACf,MAAA,EAAQ,kBAAA,GACN,eAAA;;;iBCFa,sBAAA,CACf,MAAA,EAAQ,oBAAA,GACN,eAAA;;;iBCkDa,sBAAA,CACf,MAAA,EAAQ,gBAAA,GACN,WAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
//#region src/consent.ts
|
|
2
|
+
function acceptAll(config) {
|
|
3
|
+
const consent = { essential: true };
|
|
4
|
+
for (const [key, value] of Object.entries(config.cookies)) {
|
|
5
|
+
if (key === "essential") continue;
|
|
6
|
+
consent[key] = Boolean(value);
|
|
7
|
+
}
|
|
8
|
+
return consent;
|
|
9
|
+
}
|
|
10
|
+
function rejectAll(config) {
|
|
11
|
+
const consent = { essential: true };
|
|
12
|
+
if (config) for (const key of Object.keys(config.cookies)) {
|
|
13
|
+
if (key === "essential") continue;
|
|
14
|
+
consent[key] = false;
|
|
15
|
+
}
|
|
16
|
+
return consent;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
1
19
|
//#region src/documents/helpers.ts
|
|
2
20
|
const heading = (value, levelOrContext, context) => {
|
|
3
21
|
const level = typeof levelOrContext === "number" ? levelOrContext : void 0;
|
|
@@ -176,6 +194,14 @@ function compileCookieDocument(config) {
|
|
|
176
194
|
}
|
|
177
195
|
//#endregion
|
|
178
196
|
//#region src/documents/privacy.ts
|
|
197
|
+
const LEGAL_BASIS_LABELS = {
|
|
198
|
+
consent: "Consent (Article 6(1)(a))",
|
|
199
|
+
contract: "Performance of a contract (Article 6(1)(b))",
|
|
200
|
+
legal_obligation: "Compliance with a legal obligation (Article 6(1)(c))",
|
|
201
|
+
vital_interests: "Protection of vital interests (Article 6(1)(d))",
|
|
202
|
+
public_task: "Performance of a public task (Article 6(1)(e))",
|
|
203
|
+
legitimate_interests: "Legitimate interests (Article 6(1)(f))"
|
|
204
|
+
};
|
|
179
205
|
const RIGHTS_LABELS = {
|
|
180
206
|
access: "Right to access your personal data",
|
|
181
207
|
rectification: "Right to correct inaccurate data",
|
|
@@ -216,7 +242,8 @@ function buildDataCollected(config) {
|
|
|
216
242
|
}
|
|
217
243
|
function buildLegalBasis(config) {
|
|
218
244
|
if (!config.jurisdictions.includes("eu")) return null;
|
|
219
|
-
|
|
245
|
+
const labelled = (Array.isArray(config.legalBasis) ? config.legalBasis : [config.legalBasis]).map((b) => LEGAL_BASIS_LABELS[b] ?? b);
|
|
246
|
+
return section("legal-basis", [heading("Legal Basis for Processing", { reason: "Required by GDPR Article 13" }), p([labelled.join(" and ")])]);
|
|
220
247
|
}
|
|
221
248
|
function buildDataRetention(config) {
|
|
222
249
|
const items = Object.entries(config.retention).map(([category, period]) => li([
|
|
@@ -248,7 +275,7 @@ function buildThirdParties(config) {
|
|
|
248
275
|
heading("Third-Party Services"),
|
|
249
276
|
p(["We share data with the following third-party services:"]),
|
|
250
277
|
ul(config.thirdParties.map((t) => li([
|
|
251
|
-
bold(t.name),
|
|
278
|
+
t.policyUrl ? link(t.policyUrl, t.name) : bold(t.name),
|
|
252
279
|
" — ",
|
|
253
280
|
t.purpose
|
|
254
281
|
])))
|
|
@@ -296,9 +323,21 @@ function buildContact$1(config) {
|
|
|
296
323
|
heading("Contact Us"),
|
|
297
324
|
p(["Contact us:"]),
|
|
298
325
|
ul([
|
|
299
|
-
li([
|
|
300
|
-
|
|
301
|
-
|
|
326
|
+
li([
|
|
327
|
+
bold("Legal Name:"),
|
|
328
|
+
" ",
|
|
329
|
+
config.company.legalName
|
|
330
|
+
]),
|
|
331
|
+
li([
|
|
332
|
+
bold("Address:"),
|
|
333
|
+
" ",
|
|
334
|
+
config.company.address
|
|
335
|
+
]),
|
|
336
|
+
li([
|
|
337
|
+
bold("Email:"),
|
|
338
|
+
" ",
|
|
339
|
+
config.company.contact
|
|
340
|
+
])
|
|
302
341
|
])
|
|
303
342
|
]);
|
|
304
343
|
}
|
|
@@ -458,9 +497,21 @@ function buildContact(config) {
|
|
|
458
497
|
heading("Contact Us"),
|
|
459
498
|
p(["If you have questions about these Terms, please contact us:"]),
|
|
460
499
|
ul([
|
|
461
|
-
li([
|
|
462
|
-
|
|
463
|
-
|
|
500
|
+
li([
|
|
501
|
+
bold("Legal Name:"),
|
|
502
|
+
" ",
|
|
503
|
+
config.company.legalName
|
|
504
|
+
]),
|
|
505
|
+
li([
|
|
506
|
+
bold("Address:"),
|
|
507
|
+
" ",
|
|
508
|
+
config.company.address
|
|
509
|
+
]),
|
|
510
|
+
li([
|
|
511
|
+
bold("Email:"),
|
|
512
|
+
" ",
|
|
513
|
+
config.company.contact
|
|
514
|
+
])
|
|
464
515
|
])
|
|
465
516
|
]);
|
|
466
517
|
}
|
|
@@ -553,7 +604,8 @@ function validatePrivacyPolicy(config) {
|
|
|
553
604
|
message: "userRights is empty — consider listing applicable rights"
|
|
554
605
|
});
|
|
555
606
|
if (config.jurisdictions.includes("eu")) {
|
|
556
|
-
|
|
607
|
+
const basisArray = Array.isArray(config.legalBasis) ? config.legalBasis : [config.legalBasis];
|
|
608
|
+
if (basisArray.length === 0 || basisArray.length === 1 && !basisArray[0]) issues.push({
|
|
557
609
|
level: "error",
|
|
558
610
|
message: "GDPR requires a legalBasis"
|
|
559
611
|
});
|
|
@@ -691,6 +743,6 @@ function expandOpenPolicyConfig(config) {
|
|
|
691
743
|
return inputs;
|
|
692
744
|
}
|
|
693
745
|
//#endregion
|
|
694
|
-
export { bold, compile, expandOpenPolicyConfig, heading, isOpenPolicyConfig, italic, li, link, ol, p, section, text, ul, validateCookiePolicy, validatePrivacyPolicy, validateTermsOfService };
|
|
746
|
+
export { acceptAll, bold, compile, expandOpenPolicyConfig, heading, isOpenPolicyConfig, italic, li, link, ol, p, rejectAll, section, text, ul, validateCookiePolicy, validatePrivacyPolicy, validateTermsOfService };
|
|
695
747
|
|
|
696
748
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["buildIntroduction","buildThirdParties","buildContact","SECTION_BUILDERS","buildIntroduction","buildContact","SECTION_BUILDERS"],"sources":["../src/documents/helpers.ts","../src/documents/cookie.ts","../src/documents/privacy.ts","../src/documents/terms.ts","../src/documents/index.ts","../src/types.ts","../src/validate.ts","../src/validate-cookie.ts","../src/validate-terms.ts","../src/index.ts"],"sourcesContent":["import type {\n\tBoldNode,\n\tContentNode,\n\tDocumentSection,\n\tHeadingNode,\n\tInlineNode,\n\tItalicNode,\n\tLinkNode,\n\tListItemNode,\n\tListNode,\n\tNodeContext,\n\tParagraphNode,\n\tTextNode,\n} from \"./types\";\n\nexport const heading = (\n\tvalue: string,\n\tlevelOrContext?: (1 | 2 | 3 | 4 | 5 | 6) | NodeContext,\n\tcontext?: NodeContext,\n): HeadingNode => {\n\tconst level = typeof levelOrContext === \"number\" ? levelOrContext : undefined;\n\tconst ctx = typeof levelOrContext === \"object\" ? levelOrContext : context;\n\treturn {\n\t\ttype: \"heading\",\n\t\t...(level !== undefined && { level }),\n\t\tvalue,\n\t\t...(ctx && { context: ctx }),\n\t};\n};\nexport const text = (value: string, context?: NodeContext): TextNode => ({\n\ttype: \"text\",\n\tvalue,\n\t...(context && { context }),\n});\nexport const bold = (value: string, context?: NodeContext): BoldNode => ({\n\ttype: \"bold\",\n\tvalue,\n\t...(context && { context }),\n});\nexport const italic = (value: string, context?: NodeContext): ItalicNode => ({\n\ttype: \"italic\",\n\tvalue,\n\t...(context && { context }),\n});\nexport const link = (\n\thref: string,\n\tvalue: string,\n\tcontext?: NodeContext,\n): LinkNode => ({ type: \"link\", href, value, ...(context && { context }) });\nexport const p = (\n\tchildren: (string | InlineNode)[],\n\tcontext?: NodeContext,\n): ParagraphNode => ({\n\ttype: \"paragraph\",\n\tchildren: children.map((c) => (typeof c === \"string\" ? text(c) : c)),\n\t...(context && { context }),\n});\nexport const li = (\n\tchildren: (string | InlineNode | ListNode)[],\n\tcontext?: NodeContext,\n): ListItemNode => ({\n\ttype: \"listItem\",\n\tchildren: children.map((c) => (typeof c === \"string\" ? text(c) : c)),\n\t...(context && { context }),\n});\nexport const ul = (items: ListItemNode[], context?: NodeContext): ListNode => ({\n\ttype: \"list\",\n\titems,\n\t...(context && { context }),\n});\nexport const ol = (items: ListItemNode[], context?: NodeContext): ListNode => ({\n\ttype: \"list\",\n\tordered: true,\n\titems,\n\t...(context && { context }),\n});\nexport const section = (\n\tid: string,\n\tcontent: ContentNode[],\n\tcontext?: NodeContext,\n): DocumentSection => ({\n\ttype: \"section\",\n\tid,\n\tcontent,\n\t...(context && { context }),\n});\n","import type { CookiePolicyConfig } from \"../types\";\nimport { bold, heading, li, link, p, section, ul } from \"./helpers\";\nimport type { DocumentSection } from \"./types\";\n\nfunction buildIntroduction(config: CookiePolicyConfig): DocumentSection {\n\treturn section(\"cookie-introduction\", [\n\t\theading(\"Cookie Policy\"),\n\t\tp([\n\t\t\t`This Cookie Policy explains how ${config.company.name} (\"we\", \"us\", or \"our\") uses cookies and similar tracking technologies on our services. Effective Date: ${config.effectiveDate}.`,\n\t\t]),\n\t]);\n}\n\nfunction buildWhatAreCookies(): DocumentSection {\n\treturn section(\"cookie-what-are-cookies\", [\n\t\theading(\"What Are Cookies?\"),\n\t\tp([\n\t\t\t\"Cookies are small text files placed on your device by websites you visit. They are widely used to make websites work more efficiently and to provide information to site owners.\",\n\t\t]),\n\t\tp([\n\t\t\t'Cookies can be \"session cookies\" (deleted when you close your browser) or \"persistent cookies\" (remain on your device until they expire or you delete them).',\n\t\t]),\n\t]);\n}\n\nfunction buildTypes(config: CookiePolicyConfig): DocumentSection {\n\tconst types: { label: string; description: string }[] = [];\n\tif (config.cookies.essential)\n\t\ttypes.push({\n\t\t\tlabel: \"Essential Cookies\",\n\t\t\tdescription:\n\t\t\t\t\"Required for the basic functioning of our services. These cannot be disabled.\",\n\t\t});\n\tif (config.cookies.analytics)\n\t\ttypes.push({\n\t\t\tlabel: \"Analytics Cookies\",\n\t\t\tdescription:\n\t\t\t\t\"Help us understand how visitors interact with our services so we can improve them.\",\n\t\t});\n\tif (config.cookies.functional)\n\t\ttypes.push({\n\t\t\tlabel: \"Functional Cookies\",\n\t\t\tdescription:\n\t\t\t\t\"Enable enhanced functionality and personalisation, such as remembering your preferences.\",\n\t\t});\n\tif (config.cookies.marketing)\n\t\ttypes.push({\n\t\t\tlabel: \"Marketing Cookies\",\n\t\t\tdescription:\n\t\t\t\t\"Used to deliver advertisements more relevant to you and your interests.\",\n\t\t});\n\n\tif (types.length === 0) {\n\t\treturn section(\"cookie-types\", [\n\t\t\theading(\"Types of Cookies We Use\"),\n\t\t\tp([\"We do not currently use any cookies.\"]),\n\t\t]);\n\t}\n\n\treturn section(\"cookie-types\", [\n\t\theading(\"Types of Cookies We Use\"),\n\t\tul(types.map((t) => li([bold(t.label), \" \\u2014 \", t.description]))),\n\t]);\n}\n\nfunction buildTrackingTechnologies(\n\tconfig: CookiePolicyConfig,\n): DocumentSection | null {\n\tif (!config.trackingTechnologies || config.trackingTechnologies.length === 0)\n\t\treturn null;\n\treturn section(\"cookie-tracking-technologies\", [\n\t\theading(\"Other Tracking Technologies\"),\n\t\tp([\n\t\t\t\"In addition to cookies, we may use the following tracking technologies:\",\n\t\t]),\n\t\tul(config.trackingTechnologies.map((t) => li([t]))),\n\t]);\n}\n\nfunction buildThirdParties(config: CookiePolicyConfig): DocumentSection | null {\n\tif (!config.thirdParties || config.thirdParties.length === 0) return null;\n\treturn section(\"cookie-third-parties\", [\n\t\theading(\"Third-Party Cookies\"),\n\t\tp([\"The following third parties may set cookies through our services:\"]),\n\t\tul(\n\t\t\tconfig.thirdParties.map((t) =>\n\t\t\t\tli([\n\t\t\t\t\tbold(t.name),\n\t\t\t\t\t\" \\u2014 \",\n\t\t\t\t\tt.purpose,\n\t\t\t\t\t...(t.policyUrl\n\t\t\t\t\t\t? [\" (\", link(t.policyUrl, \"Privacy Policy\"), \")\"]\n\t\t\t\t\t\t: []),\n\t\t\t\t]),\n\t\t\t),\n\t\t),\n\t]);\n}\n\nfunction buildConsent(config: CookiePolicyConfig): DocumentSection | null {\n\tif (!config.consentMechanism) return null;\n\tconst { hasBanner, hasPreferencePanel, canWithdraw } =\n\t\tconfig.consentMechanism;\n\tconst items: string[] = [];\n\tif (hasBanner)\n\t\titems.push(\n\t\t\t\"We display a cookie consent banner when you first visit our services.\",\n\t\t);\n\tif (hasPreferencePanel)\n\t\titems.push(\n\t\t\t\"You can manage your cookie preferences at any time via our preference panel.\",\n\t\t);\n\tif (canWithdraw)\n\t\titems.push(\n\t\t\t\"You may withdraw your consent at any time; however, this will not affect the lawfulness of processing based on consent before its withdrawal.\",\n\t\t);\n\tif (items.length === 0) return null;\n\treturn section(\"cookie-consent\", [\n\t\theading(\"Your Consent\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildManaging(): DocumentSection {\n\treturn section(\"cookie-managing\", [\n\t\theading(\"Managing Cookies\"),\n\t\tp([\n\t\t\t\"Most web browsers allow you to control cookies through their settings. You can:\",\n\t\t]),\n\t\tul([\n\t\t\tli([\"Delete cookies already stored on your device\"]),\n\t\t\tli([\"Block cookies from being set on your device\"]),\n\t\t\tli([\"Set your browser to notify you when a cookie is being set\"]),\n\t\t]),\n\t\tp([\n\t\t\t\"Please note that restricting cookies may impact the functionality of our services. Consult your browser's help documentation for instructions on managing cookies.\",\n\t\t]),\n\t]);\n}\n\nfunction buildJurisdictionEu(\n\tconfig: CookiePolicyConfig,\n): DocumentSection | null {\n\tif (!config.jurisdictions.includes(\"eu\")) return null;\n\treturn section(\"cookie-jurisdiction-eu\", [\n\t\theading(\"European Users (GDPR)\", {\n\t\t\treason: \"Required under ePrivacy Directive and GDPR\",\n\t\t}),\n\t\tp([\n\t\t\t\"If you are located in the European Economic Area, we rely on your consent as our legal basis for setting non-essential cookies. You have the right to withdraw consent at any time.\",\n\t\t]),\n\t\tp([\n\t\t\t\"Essential cookies are set on the basis of our legitimate interests to provide you with a functioning service.\",\n\t\t]),\n\t]);\n}\n\nfunction buildContact(config: CookiePolicyConfig): DocumentSection {\n\treturn section(\"cookie-contact\", [\n\t\theading(\"Contact Us\"),\n\t\tp([\"If you have questions about this Cookie Policy, please contact us:\"]),\n\t\tul([\n\t\t\tli([bold(\"Legal Name: \"), config.company.legalName]),\n\t\t\tli([bold(\"Address: \"), config.company.address]),\n\t\t\tli([bold(\"Email: \"), config.company.contact]),\n\t\t]),\n\t]);\n}\n\nconst SECTION_BUILDERS: ((\n\tconfig: CookiePolicyConfig,\n) => DocumentSection | null)[] = [\n\tbuildIntroduction,\n\t() => buildWhatAreCookies(),\n\tbuildTypes,\n\tbuildTrackingTechnologies,\n\tbuildThirdParties,\n\tbuildConsent,\n\t() => buildManaging(),\n\tbuildJurisdictionEu,\n\tbuildContact,\n];\n\nexport function compileCookieDocument(\n\tconfig: CookiePolicyConfig,\n): DocumentSection[] {\n\treturn SECTION_BUILDERS.map((builder) => builder(config)).filter(\n\t\t(s): s is DocumentSection => s !== null,\n\t);\n}\n","import type { PrivacyPolicyConfig } from \"../types\";\nimport { bold, heading, li, link, p, section, ul } from \"./helpers\";\nimport type { DocumentSection } 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\nfunction buildIntroduction(config: PrivacyPolicyConfig): DocumentSection {\n\treturn section(\"introduction\", [\n\t\theading(\"Introduction\"),\n\t\tp([\n\t\t\t`This Privacy Policy describes how ${config.company.name} (\"we\", \"us\", or \"our\") collects, uses, and shares information about you when you use our services. Effective Date: ${config.effectiveDate}.`,\n\t\t]),\n\t\tp([\n\t\t\t`If you have questions about this policy, please contact us at ${config.company.contact}.`,\n\t\t]),\n\t]);\n}\n\nfunction buildChildrenPrivacy(\n\tconfig: PrivacyPolicyConfig,\n): DocumentSection | null {\n\tif (!config.children) return null;\n\tconst { underAge, noticeUrl } = config.children;\n\treturn section(\"children-privacy\", [\n\t\theading(\"Children's Privacy\", { reason: \"Required by COPPA\" }),\n\t\tp([\n\t\t\t`Our services are not directed to children under the age of ${underAge}. We do not knowingly collect personal information from children under ${underAge}. If you believe we have collected information from a child, please contact us immediately.`,\n\t\t]),\n\t\t...(noticeUrl\n\t\t\t? [\n\t\t\t\t\tp([\n\t\t\t\t\t\t\"For more information, see our \",\n\t\t\t\t\t\tlink(noticeUrl, \"Children's Privacy Notice\"),\n\t\t\t\t\t\t\".\",\n\t\t\t\t\t]),\n\t\t\t\t]\n\t\t\t: []),\n\t]);\n}\n\nfunction buildDataCollected(config: PrivacyPolicyConfig): DocumentSection {\n\tconst items = Object.entries(config.dataCollected).map(([category, fields]) =>\n\t\tli([bold(category), ul(fields.map((f) => li([f])))]),\n\t);\n\treturn section(\"data-collected\", [\n\t\theading(\"Information We Collect\"),\n\t\tp([\"We collect the following categories of information:\"]),\n\t\tul(items),\n\t]);\n}\n\nfunction buildLegalBasis(config: PrivacyPolicyConfig): DocumentSection | null {\n\tif (!config.jurisdictions.includes(\"eu\")) return null;\n\treturn section(\"legal-basis\", [\n\t\theading(\"Legal Basis for Processing\", {\n\t\t\treason: \"Required by GDPR Article 13\",\n\t\t}),\n\t\tp([config.legalBasis]),\n\t]);\n}\n\nfunction buildDataRetention(config: PrivacyPolicyConfig): DocumentSection {\n\tconst items = Object.entries(config.retention).map(([category, period]) =>\n\t\tli([bold(category), \": \", period]),\n\t);\n\treturn section(\"data-retention\", [\n\t\theading(\"Data Retention\"),\n\t\tp([\"We retain your data for the following periods:\"]),\n\t\tul(items),\n\t]);\n}\n\nfunction buildCookies(config: PrivacyPolicyConfig): DocumentSection {\n\tconst enabled: string[] = [];\n\tif (config.cookies.essential)\n\t\tenabled.push(\"Essential cookies — required for the service to function\");\n\tif (config.cookies.analytics)\n\t\tenabled.push(\n\t\t\t\"Analytics cookies — help us understand how the service is used\",\n\t\t);\n\tif (config.cookies.marketing)\n\t\tenabled.push(\"Marketing cookies — used to deliver relevant advertisements\");\n\n\tif (enabled.length === 0) {\n\t\treturn section(\"cookies\", [\n\t\t\theading(\"Cookies and Tracking\"),\n\t\t\tp([\"We do not use cookies or similar tracking technologies.\"]),\n\t\t]);\n\t}\n\treturn section(\"cookies\", [\n\t\theading(\"Cookies and Tracking\"),\n\t\tp([\"We use the following types of cookies and tracking technologies:\"]),\n\t\tul(enabled.map((e) => li([e]))),\n\t]);\n}\n\nfunction buildThirdParties(config: PrivacyPolicyConfig): DocumentSection {\n\tif (config.thirdParties.length === 0) {\n\t\treturn section(\"third-parties\", [\n\t\t\theading(\"Third-Party Services\"),\n\t\t\tp([\n\t\t\t\t\"We do not share your personal information with third parties except as required by law.\",\n\t\t\t]),\n\t\t]);\n\t}\n\treturn section(\"third-parties\", [\n\t\theading(\"Third-Party Services\"),\n\t\tp([\"We share data with the following third-party services:\"]),\n\t\tul(\n\t\t\tconfig.thirdParties.map((t) => li([bold(t.name), \" \\u2014 \", t.purpose])),\n\t\t),\n\t]);\n}\n\nfunction buildUserRights(config: PrivacyPolicyConfig): DocumentSection {\n\tconst items = config.userRights.map((right) => {\n\t\tconst label = RIGHTS_LABELS[right] ?? right;\n\t\treturn li([label]);\n\t});\n\treturn section(\"user-rights\", [\n\t\theading(\"Your Rights\"),\n\t\tp([\"You have the following rights regarding your personal data:\"]),\n\t\tul(items),\n\t]);\n}\n\nfunction buildGdprSupplement(\n\tconfig: PrivacyPolicyConfig,\n): DocumentSection | null {\n\tif (!config.jurisdictions.includes(\"eu\")) return null;\n\treturn section(\"gdpr-supplement\", [\n\t\theading(\"GDPR Supplemental Disclosures\", {\n\t\t\treason: \"Required by GDPR Article 13\",\n\t\t}),\n\t\tp([\n\t\t\t\"This section applies to individuals in the European Economic Area (EEA) under the General Data Protection Regulation (GDPR).\",\n\t\t]),\n\t\tp([\n\t\t\t\"Data Controller: \",\n\t\t\tbold(config.company.legalName),\n\t\t\t`, ${config.company.address}`,\n\t\t]),\n\t\tp([\n\t\t\t\"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\t\t]),\n\t\tp([\n\t\t\t\"If we transfer your personal data outside the EEA, we ensure adequate safeguards are in place in accordance with GDPR requirements.\",\n\t\t]),\n\t]);\n}\n\nfunction buildCcpaSupplement(\n\tconfig: PrivacyPolicyConfig,\n): DocumentSection | null {\n\tif (!config.jurisdictions.includes(\"ca\")) return null;\n\treturn section(\"ccpa-supplement\", [\n\t\theading(\"California Privacy Rights (CCPA)\", { reason: \"Required by CCPA\" }),\n\t\tp([\n\t\t\t\"If you are a California resident, you have the following additional rights:\",\n\t\t]),\n\t\tul([\n\t\t\tli([\n\t\t\t\t\"Right to Know — You may request disclosure of the personal information we collect, use, and share about you.\",\n\t\t\t]),\n\t\t\tli([\n\t\t\t\t\"Right to Delete — You may request deletion of personal information we have collected about you.\",\n\t\t\t]),\n\t\t\tli([\n\t\t\t\t\"Right to Opt-Out — You may opt out of the sale of your personal information.\",\n\t\t\t]),\n\t\t\tli([\n\t\t\t\t\"Right to Non-Discrimination — We will not discriminate against you for exercising your CCPA rights.\",\n\t\t\t]),\n\t\t]),\n\t]);\n}\n\nfunction buildContact(config: PrivacyPolicyConfig): DocumentSection {\n\treturn section(\"contact\", [\n\t\theading(\"Contact Us\"),\n\t\tp([\"Contact us:\"]),\n\t\tul([\n\t\t\tli([bold(\"Legal Name: \"), config.company.legalName]),\n\t\t\tli([bold(\"Address: \"), config.company.address]),\n\t\t\tli([bold(\"Email: \"), config.company.contact]),\n\t\t]),\n\t]);\n}\n\nconst SECTION_BUILDERS: ((\n\tconfig: PrivacyPolicyConfig,\n) => DocumentSection | 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 compilePrivacyDocument(\n\tconfig: PrivacyPolicyConfig,\n): DocumentSection[] {\n\treturn SECTION_BUILDERS.map((builder) => builder(config)).filter(\n\t\t(s): s is DocumentSection => s !== null,\n\t);\n}\n","import type { TermsOfServiceConfig } from \"../types\";\nimport { bold, heading, li, p, section, ul } from \"./helpers\";\nimport type { DocumentSection } from \"./types\";\n\nfunction buildIntroduction(config: TermsOfServiceConfig): DocumentSection {\n\treturn section(\"tos-introduction\", [\n\t\theading(\"Terms of Service\"),\n\t\tp([\n\t\t\t`These Terms of Service (\"Terms\") govern your use of services provided by ${config.company.name} (\"we\", \"us\", or \"our\"). By using our services, you agree to these Terms. Effective Date: ${config.effectiveDate}.`,\n\t\t]),\n\t]);\n}\n\nfunction buildAcceptance(config: TermsOfServiceConfig): DocumentSection {\n\treturn section(\"tos-acceptance\", [\n\t\theading(\"Acceptance of Terms\"),\n\t\tp([\"You accept these Terms by:\"]),\n\t\tul(config.acceptance.methods.map((m) => li([m]))),\n\t]);\n}\n\nfunction buildEligibility(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.eligibility) return null;\n\tconst { minimumAge, jurisdictionRestrictions } = config.eligibility;\n\treturn section(\"tos-eligibility\", [\n\t\theading(\"Eligibility\"),\n\t\tp([\n\t\t\t`You must be at least ${minimumAge} years old to use our services. By using the services, you represent that you meet this age requirement.`,\n\t\t]),\n\t\t...(jurisdictionRestrictions && jurisdictionRestrictions.length > 0\n\t\t\t? [\n\t\t\t\t\tp([\"Our services are not available in the following jurisdictions:\"]),\n\t\t\t\t\tul(jurisdictionRestrictions.map((j) => li([j]))),\n\t\t\t\t]\n\t\t\t: []),\n\t]);\n}\n\nfunction buildAccounts(config: TermsOfServiceConfig): DocumentSection | null {\n\tif (!config.accounts) return null;\n\tconst {\n\t\tregistrationRequired,\n\t\tuserResponsibleForCredentials,\n\t\tcompanyCanTerminate,\n\t} = config.accounts;\n\tconst items: string[] = [];\n\tif (registrationRequired)\n\t\titems.push(\n\t\t\t\"Registration is required to access certain features of our services.\",\n\t\t);\n\tif (userResponsibleForCredentials)\n\t\titems.push(\n\t\t\t\"You are responsible for maintaining the confidentiality of your account credentials and for all activity under your account.\",\n\t\t);\n\tif (companyCanTerminate)\n\t\titems.push(\n\t\t\t\"We reserve the right to terminate or suspend accounts at our discretion.\",\n\t\t);\n\treturn section(\"tos-accounts\", [\n\t\theading(\"Accounts\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildProhibitedUses(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.prohibitedUses || config.prohibitedUses.length === 0) return null;\n\treturn section(\"tos-prohibited-uses\", [\n\t\theading(\"Prohibited Uses\"),\n\t\tp([\"You may not use our services for the following purposes:\"]),\n\t\tul(config.prohibitedUses.map((u) => li([u]))),\n\t]);\n}\n\nfunction buildUserContent(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.userContent) return null;\n\tconst {\n\t\tusersOwnContent,\n\t\tlicenseGrantedToCompany,\n\t\tlicenseDescription,\n\t\tcompanyCanRemoveContent,\n\t} = config.userContent;\n\tconst items: string[] = [];\n\tif (usersOwnContent)\n\t\titems.push(\"You retain ownership of content you submit to our services.\");\n\tif (licenseGrantedToCompany)\n\t\titems.push(\n\t\t\tlicenseDescription ??\n\t\t\t\t\"By submitting content, you grant us a license to use, reproduce, and display that content in connection with our services.\",\n\t\t);\n\tif (companyCanRemoveContent)\n\t\titems.push(\n\t\t\t\"We reserve the right to remove content that violates these Terms or that we find objectionable.\",\n\t\t);\n\treturn section(\"tos-user-content\", [\n\t\theading(\"User Content\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildIntellectualProperty(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.intellectualProperty) return null;\n\tconst { companyOwnsService, usersMayNotCopy } = config.intellectualProperty;\n\tconst items: string[] = [];\n\tif (companyOwnsService)\n\t\titems.push(\n\t\t\t`All content, features, and functionality of our services are owned by ${config.company.name} and are protected by intellectual property laws.`,\n\t\t);\n\tif (usersMayNotCopy)\n\t\titems.push(\n\t\t\t\"You may not copy, modify, distribute, sell, or lease any part of our services without our express written permission.\",\n\t\t);\n\treturn section(\"tos-intellectual-property\", [\n\t\theading(\"Intellectual Property\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildPayments(config: TermsOfServiceConfig): DocumentSection | null {\n\tif (!config.payments) return null;\n\tconst { hasPaidFeatures, refundPolicy, priceChangesNotice } = config.payments;\n\tconst items: string[] = [];\n\tif (hasPaidFeatures)\n\t\titems.push(\"Some features of our services require payment.\");\n\tif (refundPolicy) items.push(refundPolicy);\n\tif (priceChangesNotice) items.push(priceChangesNotice);\n\tif (items.length === 0) return null;\n\treturn section(\"tos-payments\", [\n\t\theading(\"Payments\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildAvailability(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.availability) return null;\n\tconst { noUptimeGuarantee, maintenanceWindows } = config.availability;\n\tconst items: string[] = [];\n\tif (noUptimeGuarantee)\n\t\titems.push(\n\t\t\t\"We do not guarantee uninterrupted or error-free access to our services.\",\n\t\t);\n\tif (maintenanceWindows) items.push(maintenanceWindows);\n\treturn section(\"tos-availability\", [\n\t\theading(\"Service Availability\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildTermination(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.termination) return null;\n\tconst { companyCanTerminate, userCanTerminate, effectOfTermination } =\n\t\tconfig.termination;\n\tconst items: string[] = [];\n\tif (companyCanTerminate)\n\t\titems.push(\n\t\t\t\"We may terminate or suspend your access to our services at any time, with or without cause or notice.\",\n\t\t);\n\tif (userCanTerminate)\n\t\titems.push(\"You may terminate your use of our services at any time.\");\n\tif (effectOfTermination) items.push(effectOfTermination);\n\treturn section(\"tos-termination\", [\n\t\theading(\"Termination\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildDisclaimers(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.disclaimers) return null;\n\tconst { serviceProvidedAsIs, noWarranties } = config.disclaimers;\n\tconst items: string[] = [];\n\tif (serviceProvidedAsIs)\n\t\titems.push(\n\t\t\t'Our services are provided on an \"as is\" and \"as available\" basis.',\n\t\t);\n\tif (noWarranties)\n\t\titems.push(\n\t\t\t\"We make no warranties, express or implied, regarding the reliability, accuracy, or fitness for a particular purpose of our services.\",\n\t\t);\n\treturn section(\"tos-disclaimers\", [\n\t\theading(\"Disclaimers\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildLimitationOfLiability(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.limitationOfLiability) return null;\n\tconst { excludesIndirectDamages, liabilityCap } =\n\t\tconfig.limitationOfLiability;\n\tconst items: string[] = [];\n\tif (excludesIndirectDamages)\n\t\titems.push(\n\t\t\t\"To the fullest extent permitted by law, we shall not be liable for any indirect, incidental, special, or consequential damages.\",\n\t\t);\n\tif (liabilityCap) items.push(liabilityCap);\n\treturn section(\"tos-limitation-of-liability\", [\n\t\theading(\"Limitation of Liability\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildIndemnification(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.indemnification) return null;\n\tconst { userIndemnifiesCompany, scope } = config.indemnification;\n\tif (!userIndemnifiesCompany) return null;\n\treturn section(\"tos-indemnification\", [\n\t\theading(\"Indemnification\"),\n\t\tp([\n\t\t\tscope ??\n\t\t\t\t`You agree to indemnify and hold harmless ${config.company.name} and its officers, directors, employees, and agents from any claims arising out of your use of the services or violation of these Terms.`,\n\t\t]),\n\t]);\n}\n\nfunction buildThirdPartyServices(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.thirdPartyServices || config.thirdPartyServices.length === 0)\n\t\treturn null;\n\treturn section(\"tos-third-party-services\", [\n\t\theading(\"Third-Party Services\"),\n\t\tp([\"Our services may integrate with or link to third-party services:\"]),\n\t\tul(\n\t\t\tconfig.thirdPartyServices.map((t) =>\n\t\t\t\tli([bold(t.name), \" \\u2014 \", t.purpose]),\n\t\t\t),\n\t\t),\n\t]);\n}\n\nfunction buildDisputeResolution(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.disputeResolution) return null;\n\tconst { method, venue, classActionWaiver } = config.disputeResolution;\n\tconst items: string[] = [];\n\tconst methodLabel =\n\t\tmethod === \"arbitration\"\n\t\t\t? \"binding arbitration\"\n\t\t\t: method === \"mediation\"\n\t\t\t\t? \"mediation\"\n\t\t\t\t: \"litigation\";\n\titems.push(\n\t\t`Any disputes arising from these Terms or your use of our services shall be resolved through ${methodLabel}.`,\n\t);\n\tif (venue) items.push(`Venue: ${venue}.`);\n\tif (classActionWaiver)\n\t\titems.push(\n\t\t\t\"You waive any right to participate in class action lawsuits or class-wide arbitration.\",\n\t\t);\n\treturn section(\"tos-dispute-resolution\", [\n\t\theading(\"Dispute Resolution\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildGoverningLaw(config: TermsOfServiceConfig): DocumentSection {\n\treturn section(\"tos-governing-law\", [\n\t\theading(\"Governing Law\"),\n\t\tp([\n\t\t\t`These Terms are governed by the laws of ${config.governingLaw.jurisdiction}, without regard to conflict of law principles.`,\n\t\t]),\n\t]);\n}\n\nfunction buildChanges(config: TermsOfServiceConfig): DocumentSection | null {\n\tif (!config.changesPolicy) return null;\n\tconst { noticeMethod, noticePeriodDays } = config.changesPolicy;\n\tconst notice = noticePeriodDays\n\t\t? `at least ${noticePeriodDays} days' notice via ${noticeMethod}`\n\t\t: `notice via ${noticeMethod}`;\n\treturn section(\"tos-changes\", [\n\t\theading(\"Changes to These Terms\"),\n\t\tp([\n\t\t\t`We may update these Terms from time to time. We will provide ${notice} before changes take effect. Continued use of our services after changes constitutes acceptance of the revised Terms.`,\n\t\t]),\n\t]);\n}\n\nfunction buildContact(config: TermsOfServiceConfig): DocumentSection {\n\treturn section(\"tos-contact\", [\n\t\theading(\"Contact Us\"),\n\t\tp([\"If you have questions about these Terms, please contact us:\"]),\n\t\tul([\n\t\t\tli([bold(\"Legal Name: \"), config.company.legalName]),\n\t\t\tli([bold(\"Address: \"), config.company.address]),\n\t\t\tli([bold(\"Email: \"), config.company.contact]),\n\t\t]),\n\t]);\n}\n\nconst SECTION_BUILDERS: ((\n\tconfig: TermsOfServiceConfig,\n) => DocumentSection | null)[] = [\n\tbuildIntroduction,\n\tbuildAcceptance,\n\tbuildEligibility,\n\tbuildAccounts,\n\tbuildProhibitedUses,\n\tbuildUserContent,\n\tbuildIntellectualProperty,\n\tbuildPayments,\n\tbuildAvailability,\n\tbuildTermination,\n\tbuildDisclaimers,\n\tbuildLimitationOfLiability,\n\tbuildIndemnification,\n\tbuildThirdPartyServices,\n\tbuildDisputeResolution,\n\tbuildGoverningLaw,\n\tbuildChanges,\n\tbuildContact,\n];\n\nexport function compileTermsDocument(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection[] {\n\treturn SECTION_BUILDERS.map((builder) => builder(config)).filter(\n\t\t(s): s is DocumentSection => s !== null,\n\t);\n}\n","import type { PolicyInput } from \"../types\";\nimport { compileCookieDocument } from \"./cookie\";\nimport { compilePrivacyDocument } from \"./privacy\";\nimport { compileTermsDocument } from \"./terms\";\nimport type { Document } from \"./types\";\n\nexport function compile(input: PolicyInput): Document {\n\tif (input.type === \"privacy\") {\n\t\tconst { type: _, ...config } = input;\n\t\treturn {\n\t\t\ttype: \"document\",\n\t\t\tpolicyType: \"privacy\",\n\t\t\tsections: compilePrivacyDocument(config),\n\t\t};\n\t}\n\tif (input.type === \"terms\") {\n\t\tconst { type: _, ...config } = input;\n\t\treturn {\n\t\t\ttype: \"document\",\n\t\t\tpolicyType: \"terms\",\n\t\t\tsections: compileTermsDocument(config),\n\t\t};\n\t}\n\tconst { type: _, ...config } = input;\n\treturn {\n\t\ttype: \"document\",\n\t\tpolicyType: \"cookie\",\n\t\tsections: compileCookieDocument(config),\n\t};\n}\n\nexport {\n\tbold,\n\theading,\n\titalic,\n\tli,\n\tlink,\n\tol,\n\tp,\n\tsection,\n\ttext,\n\tul,\n} from \"./helpers\";\nexport type {\n\tBoldNode,\n\tContentNode,\n\tDocument,\n\tDocumentSection,\n\tHeadingNode,\n\tInlineNode,\n\tItalicNode,\n\tLinkNode,\n\tListItemNode,\n\tListNode,\n\tNode,\n\tNodeContext,\n\tParagraphNode,\n\tPolicyType,\n\tTextNode,\n} from \"./types\";\n","export type OutputFormat = \"markdown\" | \"html\" | \"pdf\" | \"jsx\";\n\nexport type CompileOptions = { formats: OutputFormat[] };\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 type {\n\tBoldNode,\n\tContentNode,\n\tDocument,\n\tDocumentSection,\n\tHeadingNode,\n\tInlineNode,\n\tItalicNode,\n\tLinkNode,\n\tListItemNode,\n\tListNode,\n\tNode,\n\tNodeContext,\n\tParagraphNode,\n\tPolicyType,\n\tTextNode,\n} from \"./documents\";\nexport {\n\tbold,\n\tcompile,\n\theading,\n\titalic,\n\tli,\n\tlink,\n\tol,\n\tp,\n\tsection,\n\ttext,\n\tul,\n} from \"./documents\";\nexport type {\n\tCompanyConfig,\n\tCompileOptions,\n\tCookiePolicyConfig,\n\tDisputeResolutionMethod,\n\tJurisdiction,\n\tOpenPolicyConfig,\n\tOutputFormat,\n\tPolicyInput,\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 type { 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"],"mappings":";AAeA,MAAa,WACZ,OACA,gBACA,YACiB;CACjB,MAAM,QAAQ,OAAO,mBAAmB,WAAW,iBAAiB,KAAA;CACpE,MAAM,MAAM,OAAO,mBAAmB,WAAW,iBAAiB;AAClE,QAAO;EACN,MAAM;EACN,GAAI,UAAU,KAAA,KAAa,EAAE,OAAO;EACpC;EACA,GAAI,OAAO,EAAE,SAAS,KAAK;EAC3B;;AAEF,MAAa,QAAQ,OAAe,aAAqC;CACxE,MAAM;CACN;CACA,GAAI,WAAW,EAAE,SAAS;CAC1B;AACD,MAAa,QAAQ,OAAe,aAAqC;CACxE,MAAM;CACN;CACA,GAAI,WAAW,EAAE,SAAS;CAC1B;AACD,MAAa,UAAU,OAAe,aAAuC;CAC5E,MAAM;CACN;CACA,GAAI,WAAW,EAAE,SAAS;CAC1B;AACD,MAAa,QACZ,MACA,OACA,aACe;CAAE,MAAM;CAAQ;CAAM;CAAO,GAAI,WAAW,EAAE,SAAS;CAAG;AAC1E,MAAa,KACZ,UACA,aACoB;CACpB,MAAM;CACN,UAAU,SAAS,KAAK,MAAO,OAAO,MAAM,WAAW,KAAK,EAAE,GAAG,EAAG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KAAK;EAAE,OAAO;EAAS,SAAS;EAA+B,CAAC;AACxE,KAAI,CAAC,OAAO,QAAQ,QACnB,QAAO,KAAK;EAAE,OAAO;EAAS,SAAS;EAA+B,CAAC;AACxE,KAAI,CAAC,OAAO,aAAa,aACxB,QAAO,KAAK;EACX,OAAO;EACP,SAAS;EACT,CAAC;AAGH,KAAI,CAAC,OAAO,YACX,QAAO,KAAK;EACX,OAAO;EACP,SACC;EACD,CAAC;AAEH,KAAI,CAAC,OAAO,sBACX,QAAO,KAAK;EACX,OAAO;EACP,SACC;EACD,CAAC;AAEH,KAAI,OAAO,WAAW,QAAQ,WAAW,EACxC,QAAO,KAAK;EACX,OAAO;EACP,SACC;EACD,CAAC;AAGH,QAAO;;;;ACGR,SAAgB,uBACf,QACgB;CAChB,MAAM,SAAwB,EAAE;AAChC,KAAI,OAAO,QACV,QAAO,KAAK;EACX,MAAM;EACN,SAAS,OAAO;EAChB,GAAG,OAAO;EACV,CAAC;AAEH,KAAI,OAAO,MACV,QAAO,KAAK;EAAE,MAAM;EAAS,SAAS,OAAO;EAAS,GAAG,OAAO;EAAO,CAAC;AAEzE,KAAI,OAAO,OACV,QAAO,KAAK;EAAE,MAAM;EAAU,SAAS,OAAO;EAAS,GAAG,OAAO;EAAQ,CAAC;AAE3E,QAAO"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["buildIntroduction","buildThirdParties","buildContact","SECTION_BUILDERS","buildIntroduction","buildContact","SECTION_BUILDERS"],"sources":["../src/consent.ts","../src/documents/helpers.ts","../src/documents/cookie.ts","../src/documents/privacy.ts","../src/documents/terms.ts","../src/documents/index.ts","../src/types.ts","../src/validate.ts","../src/validate-cookie.ts","../src/validate-terms.ts","../src/index.ts"],"sourcesContent":["import type { CookiePolicyConfig } from \"./types\";\n\nexport type CookieConsent = {\n\tessential: true;\n\t[key: string]: boolean;\n};\n\nexport type CookieConsentStatus = \"undecided\" | \"completed\";\n\nexport function acceptAll(config: CookiePolicyConfig): CookieConsent {\n\tconst consent: CookieConsent = { essential: true };\n\tfor (const [key, value] of Object.entries(config.cookies)) {\n\t\tif (key === \"essential\") continue;\n\t\tconsent[key] = Boolean(value);\n\t}\n\treturn consent;\n}\n\nexport function rejectAll(config?: CookiePolicyConfig): CookieConsent {\n\tconst consent: CookieConsent = { essential: true };\n\tif (config) {\n\t\tfor (const key of Object.keys(config.cookies)) {\n\t\t\tif (key === \"essential\") continue;\n\t\t\tconsent[key] = false;\n\t\t}\n\t}\n\treturn consent;\n}\n","import type {\n\tBoldNode,\n\tContentNode,\n\tDocumentSection,\n\tHeadingNode,\n\tInlineNode,\n\tItalicNode,\n\tLinkNode,\n\tListItemNode,\n\tListNode,\n\tNodeContext,\n\tParagraphNode,\n\tTextNode,\n} from \"./types\";\n\nexport const heading = (\n\tvalue: string,\n\tlevelOrContext?: (1 | 2 | 3 | 4 | 5 | 6) | NodeContext,\n\tcontext?: NodeContext,\n): HeadingNode => {\n\tconst level = typeof levelOrContext === \"number\" ? levelOrContext : undefined;\n\tconst ctx = typeof levelOrContext === \"object\" ? levelOrContext : context;\n\treturn {\n\t\ttype: \"heading\",\n\t\t...(level !== undefined && { level }),\n\t\tvalue,\n\t\t...(ctx && { context: ctx }),\n\t};\n};\nexport const text = (value: string, context?: NodeContext): TextNode => ({\n\ttype: \"text\",\n\tvalue,\n\t...(context && { context }),\n});\nexport const bold = (value: string, context?: NodeContext): BoldNode => ({\n\ttype: \"bold\",\n\tvalue,\n\t...(context && { context }),\n});\nexport const italic = (value: string, context?: NodeContext): ItalicNode => ({\n\ttype: \"italic\",\n\tvalue,\n\t...(context && { context }),\n});\nexport const link = (\n\thref: string,\n\tvalue: string,\n\tcontext?: NodeContext,\n): LinkNode => ({ type: \"link\", href, value, ...(context && { context }) });\nexport const p = (\n\tchildren: (string | InlineNode)[],\n\tcontext?: NodeContext,\n): ParagraphNode => ({\n\ttype: \"paragraph\",\n\tchildren: children.map((c) => (typeof c === \"string\" ? text(c) : c)),\n\t...(context && { context }),\n});\nexport const li = (\n\tchildren: (string | InlineNode | ListNode)[],\n\tcontext?: NodeContext,\n): ListItemNode => ({\n\ttype: \"listItem\",\n\tchildren: children.map((c) => (typeof c === \"string\" ? text(c) : c)),\n\t...(context && { context }),\n});\nexport const ul = (items: ListItemNode[], context?: NodeContext): ListNode => ({\n\ttype: \"list\",\n\titems,\n\t...(context && { context }),\n});\nexport const ol = (items: ListItemNode[], context?: NodeContext): ListNode => ({\n\ttype: \"list\",\n\tordered: true,\n\titems,\n\t...(context && { context }),\n});\nexport const section = (\n\tid: string,\n\tcontent: ContentNode[],\n\tcontext?: NodeContext,\n): DocumentSection => ({\n\ttype: \"section\",\n\tid,\n\tcontent,\n\t...(context && { context }),\n});\n","import type { CookiePolicyConfig } from \"../types\";\nimport { bold, heading, li, link, p, section, ul } from \"./helpers\";\nimport type { DocumentSection } from \"./types\";\n\nfunction buildIntroduction(config: CookiePolicyConfig): DocumentSection {\n\treturn section(\"cookie-introduction\", [\n\t\theading(\"Cookie Policy\"),\n\t\tp([\n\t\t\t`This Cookie Policy explains how ${config.company.name} (\"we\", \"us\", or \"our\") uses cookies and similar tracking technologies on our services. Effective Date: ${config.effectiveDate}.`,\n\t\t]),\n\t]);\n}\n\nfunction buildWhatAreCookies(): DocumentSection {\n\treturn section(\"cookie-what-are-cookies\", [\n\t\theading(\"What Are Cookies?\"),\n\t\tp([\n\t\t\t\"Cookies are small text files placed on your device by websites you visit. They are widely used to make websites work more efficiently and to provide information to site owners.\",\n\t\t]),\n\t\tp([\n\t\t\t'Cookies can be \"session cookies\" (deleted when you close your browser) or \"persistent cookies\" (remain on your device until they expire or you delete them).',\n\t\t]),\n\t]);\n}\n\nfunction buildTypes(config: CookiePolicyConfig): DocumentSection {\n\tconst types: { label: string; description: string }[] = [];\n\tif (config.cookies.essential)\n\t\ttypes.push({\n\t\t\tlabel: \"Essential Cookies\",\n\t\t\tdescription:\n\t\t\t\t\"Required for the basic functioning of our services. These cannot be disabled.\",\n\t\t});\n\tif (config.cookies.analytics)\n\t\ttypes.push({\n\t\t\tlabel: \"Analytics Cookies\",\n\t\t\tdescription:\n\t\t\t\t\"Help us understand how visitors interact with our services so we can improve them.\",\n\t\t});\n\tif (config.cookies.functional)\n\t\ttypes.push({\n\t\t\tlabel: \"Functional Cookies\",\n\t\t\tdescription:\n\t\t\t\t\"Enable enhanced functionality and personalisation, such as remembering your preferences.\",\n\t\t});\n\tif (config.cookies.marketing)\n\t\ttypes.push({\n\t\t\tlabel: \"Marketing Cookies\",\n\t\t\tdescription:\n\t\t\t\t\"Used to deliver advertisements more relevant to you and your interests.\",\n\t\t});\n\n\tif (types.length === 0) {\n\t\treturn section(\"cookie-types\", [\n\t\t\theading(\"Types of Cookies We Use\"),\n\t\t\tp([\"We do not currently use any cookies.\"]),\n\t\t]);\n\t}\n\n\treturn section(\"cookie-types\", [\n\t\theading(\"Types of Cookies We Use\"),\n\t\tul(types.map((t) => li([bold(t.label), \" \\u2014 \", t.description]))),\n\t]);\n}\n\nfunction buildTrackingTechnologies(\n\tconfig: CookiePolicyConfig,\n): DocumentSection | null {\n\tif (!config.trackingTechnologies || config.trackingTechnologies.length === 0)\n\t\treturn null;\n\treturn section(\"cookie-tracking-technologies\", [\n\t\theading(\"Other Tracking Technologies\"),\n\t\tp([\n\t\t\t\"In addition to cookies, we may use the following tracking technologies:\",\n\t\t]),\n\t\tul(config.trackingTechnologies.map((t) => li([t]))),\n\t]);\n}\n\nfunction buildThirdParties(config: CookiePolicyConfig): DocumentSection | null {\n\tif (!config.thirdParties || config.thirdParties.length === 0) return null;\n\treturn section(\"cookie-third-parties\", [\n\t\theading(\"Third-Party Cookies\"),\n\t\tp([\"The following third parties may set cookies through our services:\"]),\n\t\tul(\n\t\t\tconfig.thirdParties.map((t) =>\n\t\t\t\tli([\n\t\t\t\t\tbold(t.name),\n\t\t\t\t\t\" \\u2014 \",\n\t\t\t\t\tt.purpose,\n\t\t\t\t\t...(t.policyUrl\n\t\t\t\t\t\t? [\" (\", link(t.policyUrl, \"Privacy Policy\"), \")\"]\n\t\t\t\t\t\t: []),\n\t\t\t\t]),\n\t\t\t),\n\t\t),\n\t]);\n}\n\nfunction buildConsent(config: CookiePolicyConfig): DocumentSection | null {\n\tif (!config.consentMechanism) return null;\n\tconst { hasBanner, hasPreferencePanel, canWithdraw } =\n\t\tconfig.consentMechanism;\n\tconst items: string[] = [];\n\tif (hasBanner)\n\t\titems.push(\n\t\t\t\"We display a cookie consent banner when you first visit our services.\",\n\t\t);\n\tif (hasPreferencePanel)\n\t\titems.push(\n\t\t\t\"You can manage your cookie preferences at any time via our preference panel.\",\n\t\t);\n\tif (canWithdraw)\n\t\titems.push(\n\t\t\t\"You may withdraw your consent at any time; however, this will not affect the lawfulness of processing based on consent before its withdrawal.\",\n\t\t);\n\tif (items.length === 0) return null;\n\treturn section(\"cookie-consent\", [\n\t\theading(\"Your Consent\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildManaging(): DocumentSection {\n\treturn section(\"cookie-managing\", [\n\t\theading(\"Managing Cookies\"),\n\t\tp([\n\t\t\t\"Most web browsers allow you to control cookies through their settings. You can:\",\n\t\t]),\n\t\tul([\n\t\t\tli([\"Delete cookies already stored on your device\"]),\n\t\t\tli([\"Block cookies from being set on your device\"]),\n\t\t\tli([\"Set your browser to notify you when a cookie is being set\"]),\n\t\t]),\n\t\tp([\n\t\t\t\"Please note that restricting cookies may impact the functionality of our services. Consult your browser's help documentation for instructions on managing cookies.\",\n\t\t]),\n\t]);\n}\n\nfunction buildJurisdictionEu(\n\tconfig: CookiePolicyConfig,\n): DocumentSection | null {\n\tif (!config.jurisdictions.includes(\"eu\")) return null;\n\treturn section(\"cookie-jurisdiction-eu\", [\n\t\theading(\"European Users (GDPR)\", {\n\t\t\treason: \"Required under ePrivacy Directive and GDPR\",\n\t\t}),\n\t\tp([\n\t\t\t\"If you are located in the European Economic Area, we rely on your consent as our legal basis for setting non-essential cookies. You have the right to withdraw consent at any time.\",\n\t\t]),\n\t\tp([\n\t\t\t\"Essential cookies are set on the basis of our legitimate interests to provide you with a functioning service.\",\n\t\t]),\n\t]);\n}\n\nfunction buildContact(config: CookiePolicyConfig): DocumentSection {\n\treturn section(\"cookie-contact\", [\n\t\theading(\"Contact Us\"),\n\t\tp([\"If you have questions about this Cookie Policy, please contact us:\"]),\n\t\tul([\n\t\t\tli([bold(\"Legal Name: \"), config.company.legalName]),\n\t\t\tli([bold(\"Address: \"), config.company.address]),\n\t\t\tli([bold(\"Email: \"), config.company.contact]),\n\t\t]),\n\t]);\n}\n\nconst SECTION_BUILDERS: ((\n\tconfig: CookiePolicyConfig,\n) => DocumentSection | null)[] = [\n\tbuildIntroduction,\n\t() => buildWhatAreCookies(),\n\tbuildTypes,\n\tbuildTrackingTechnologies,\n\tbuildThirdParties,\n\tbuildConsent,\n\t() => buildManaging(),\n\tbuildJurisdictionEu,\n\tbuildContact,\n];\n\nexport function compileCookieDocument(\n\tconfig: CookiePolicyConfig,\n): DocumentSection[] {\n\treturn SECTION_BUILDERS.map((builder) => builder(config)).filter(\n\t\t(s): s is DocumentSection => s !== null,\n\t);\n}\n","import type { PrivacyPolicyConfig } from \"../types\";\nimport { bold, heading, li, link, p, section, ul } from \"./helpers\";\nimport type { DocumentSection } from \"./types\";\n\nconst LEGAL_BASIS_LABELS: Record<string, string> = {\n\tconsent: \"Consent (Article 6(1)(a))\",\n\tcontract: \"Performance of a contract (Article 6(1)(b))\",\n\tlegal_obligation: \"Compliance with a legal obligation (Article 6(1)(c))\",\n\tvital_interests: \"Protection of vital interests (Article 6(1)(d))\",\n\tpublic_task: \"Performance of a public task (Article 6(1)(e))\",\n\tlegitimate_interests: \"Legitimate interests (Article 6(1)(f))\",\n};\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\nfunction buildIntroduction(config: PrivacyPolicyConfig): DocumentSection {\n\treturn section(\"introduction\", [\n\t\theading(\"Introduction\"),\n\t\tp([\n\t\t\t`This Privacy Policy describes how ${config.company.name} (\"we\", \"us\", or \"our\") collects, uses, and shares information about you when you use our services. Effective Date: ${config.effectiveDate}.`,\n\t\t]),\n\t\tp([\n\t\t\t`If you have questions about this policy, please contact us at ${config.company.contact}.`,\n\t\t]),\n\t]);\n}\n\nfunction buildChildrenPrivacy(\n\tconfig: PrivacyPolicyConfig,\n): DocumentSection | null {\n\tif (!config.children) return null;\n\tconst { underAge, noticeUrl } = config.children;\n\treturn section(\"children-privacy\", [\n\t\theading(\"Children's Privacy\", { reason: \"Required by COPPA\" }),\n\t\tp([\n\t\t\t`Our services are not directed to children under the age of ${underAge}. We do not knowingly collect personal information from children under ${underAge}. If you believe we have collected information from a child, please contact us immediately.`,\n\t\t]),\n\t\t...(noticeUrl\n\t\t\t? [\n\t\t\t\t\tp([\n\t\t\t\t\t\t\"For more information, see our \",\n\t\t\t\t\t\tlink(noticeUrl, \"Children's Privacy Notice\"),\n\t\t\t\t\t\t\".\",\n\t\t\t\t\t]),\n\t\t\t\t]\n\t\t\t: []),\n\t]);\n}\n\nfunction buildDataCollected(config: PrivacyPolicyConfig): DocumentSection {\n\tconst items = Object.entries(config.dataCollected).map(([category, fields]) =>\n\t\tli([bold(category), ul(fields.map((f) => li([f])))]),\n\t);\n\treturn section(\"data-collected\", [\n\t\theading(\"Information We Collect\"),\n\t\tp([\"We collect the following categories of information:\"]),\n\t\tul(items),\n\t]);\n}\n\nfunction buildLegalBasis(config: PrivacyPolicyConfig): DocumentSection | null {\n\tif (!config.jurisdictions.includes(\"eu\")) return null;\n\tconst bases = Array.isArray(config.legalBasis)\n\t\t? config.legalBasis\n\t\t: [config.legalBasis];\n\tconst labelled = bases.map((b) => LEGAL_BASIS_LABELS[b] ?? b);\n\treturn section(\"legal-basis\", [\n\t\theading(\"Legal Basis for Processing\", {\n\t\t\treason: \"Required by GDPR Article 13\",\n\t\t}),\n\t\tp([labelled.join(\" and \")]),\n\t]);\n}\n\nfunction buildDataRetention(config: PrivacyPolicyConfig): DocumentSection {\n\tconst items = Object.entries(config.retention).map(([category, period]) =>\n\t\tli([bold(category), \": \", period]),\n\t);\n\treturn section(\"data-retention\", [\n\t\theading(\"Data Retention\"),\n\t\tp([\"We retain your data for the following periods:\"]),\n\t\tul(items),\n\t]);\n}\n\nfunction buildCookies(config: PrivacyPolicyConfig): DocumentSection {\n\tconst enabled: string[] = [];\n\tif (config.cookies.essential)\n\t\tenabled.push(\"Essential cookies — required for the service to function\");\n\tif (config.cookies.analytics)\n\t\tenabled.push(\n\t\t\t\"Analytics cookies — help us understand how the service is used\",\n\t\t);\n\tif (config.cookies.marketing)\n\t\tenabled.push(\"Marketing cookies — used to deliver relevant advertisements\");\n\n\tif (enabled.length === 0) {\n\t\treturn section(\"cookies\", [\n\t\t\theading(\"Cookies and Tracking\"),\n\t\t\tp([\"We do not use cookies or similar tracking technologies.\"]),\n\t\t]);\n\t}\n\treturn section(\"cookies\", [\n\t\theading(\"Cookies and Tracking\"),\n\t\tp([\"We use the following types of cookies and tracking technologies:\"]),\n\t\tul(enabled.map((e) => li([e]))),\n\t]);\n}\n\nfunction buildThirdParties(config: PrivacyPolicyConfig): DocumentSection {\n\tif (config.thirdParties.length === 0) {\n\t\treturn section(\"third-parties\", [\n\t\t\theading(\"Third-Party Services\"),\n\t\t\tp([\n\t\t\t\t\"We do not share your personal information with third parties except as required by law.\",\n\t\t\t]),\n\t\t]);\n\t}\n\treturn section(\"third-parties\", [\n\t\theading(\"Third-Party Services\"),\n\t\tp([\"We share data with the following third-party services:\"]),\n\t\tul(\n\t\t\tconfig.thirdParties.map((t) =>\n\t\t\t\tli([\n\t\t\t\t\tt.policyUrl ? link(t.policyUrl, t.name) : bold(t.name),\n\t\t\t\t\t\" \\u2014 \",\n\t\t\t\t\tt.purpose,\n\t\t\t\t]),\n\t\t\t),\n\t\t),\n\t]);\n}\n\nfunction buildUserRights(config: PrivacyPolicyConfig): DocumentSection {\n\tconst items = config.userRights.map((right) => {\n\t\tconst label = RIGHTS_LABELS[right] ?? right;\n\t\treturn li([label]);\n\t});\n\treturn section(\"user-rights\", [\n\t\theading(\"Your Rights\"),\n\t\tp([\"You have the following rights regarding your personal data:\"]),\n\t\tul(items),\n\t]);\n}\n\nfunction buildGdprSupplement(\n\tconfig: PrivacyPolicyConfig,\n): DocumentSection | null {\n\tif (!config.jurisdictions.includes(\"eu\")) return null;\n\treturn section(\"gdpr-supplement\", [\n\t\theading(\"GDPR Supplemental Disclosures\", {\n\t\t\treason: \"Required by GDPR Article 13\",\n\t\t}),\n\t\tp([\n\t\t\t\"This section applies to individuals in the European Economic Area (EEA) under the General Data Protection Regulation (GDPR).\",\n\t\t]),\n\t\tp([\n\t\t\t\"Data Controller: \",\n\t\t\tbold(config.company.legalName),\n\t\t\t`, ${config.company.address}`,\n\t\t]),\n\t\tp([\n\t\t\t\"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\t\t]),\n\t\tp([\n\t\t\t\"If we transfer your personal data outside the EEA, we ensure adequate safeguards are in place in accordance with GDPR requirements.\",\n\t\t]),\n\t]);\n}\n\nfunction buildCcpaSupplement(\n\tconfig: PrivacyPolicyConfig,\n): DocumentSection | null {\n\tif (!config.jurisdictions.includes(\"ca\")) return null;\n\treturn section(\"ccpa-supplement\", [\n\t\theading(\"California Privacy Rights (CCPA)\", { reason: \"Required by CCPA\" }),\n\t\tp([\n\t\t\t\"If you are a California resident, you have the following additional rights:\",\n\t\t]),\n\t\tul([\n\t\t\tli([\n\t\t\t\t\"Right to Know — You may request disclosure of the personal information we collect, use, and share about you.\",\n\t\t\t]),\n\t\t\tli([\n\t\t\t\t\"Right to Delete — You may request deletion of personal information we have collected about you.\",\n\t\t\t]),\n\t\t\tli([\n\t\t\t\t\"Right to Opt-Out — You may opt out of the sale of your personal information.\",\n\t\t\t]),\n\t\t\tli([\n\t\t\t\t\"Right to Non-Discrimination — We will not discriminate against you for exercising your CCPA rights.\",\n\t\t\t]),\n\t\t]),\n\t]);\n}\n\nfunction buildContact(config: PrivacyPolicyConfig): DocumentSection {\n\treturn section(\"contact\", [\n\t\theading(\"Contact Us\"),\n\t\tp([\"Contact us:\"]),\n\t\tul([\n\t\t\tli([bold(\"Legal Name:\"), \" \", config.company.legalName]),\n\t\t\tli([bold(\"Address:\"), \" \", config.company.address]),\n\t\t\tli([bold(\"Email:\"), \" \", config.company.contact]),\n\t\t]),\n\t]);\n}\n\nconst SECTION_BUILDERS: ((\n\tconfig: PrivacyPolicyConfig,\n) => DocumentSection | 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 compilePrivacyDocument(\n\tconfig: PrivacyPolicyConfig,\n): DocumentSection[] {\n\treturn SECTION_BUILDERS.map((builder) => builder(config)).filter(\n\t\t(s): s is DocumentSection => s !== null,\n\t);\n}\n","import type { TermsOfServiceConfig } from \"../types\";\nimport { bold, heading, li, p, section, ul } from \"./helpers\";\nimport type { DocumentSection } from \"./types\";\n\nfunction buildIntroduction(config: TermsOfServiceConfig): DocumentSection {\n\treturn section(\"tos-introduction\", [\n\t\theading(\"Terms of Service\"),\n\t\tp([\n\t\t\t`These Terms of Service (\"Terms\") govern your use of services provided by ${config.company.name} (\"we\", \"us\", or \"our\"). By using our services, you agree to these Terms. Effective Date: ${config.effectiveDate}.`,\n\t\t]),\n\t]);\n}\n\nfunction buildAcceptance(config: TermsOfServiceConfig): DocumentSection {\n\treturn section(\"tos-acceptance\", [\n\t\theading(\"Acceptance of Terms\"),\n\t\tp([\"You accept these Terms by:\"]),\n\t\tul(config.acceptance.methods.map((m) => li([m]))),\n\t]);\n}\n\nfunction buildEligibility(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.eligibility) return null;\n\tconst { minimumAge, jurisdictionRestrictions } = config.eligibility;\n\treturn section(\"tos-eligibility\", [\n\t\theading(\"Eligibility\"),\n\t\tp([\n\t\t\t`You must be at least ${minimumAge} years old to use our services. By using the services, you represent that you meet this age requirement.`,\n\t\t]),\n\t\t...(jurisdictionRestrictions && jurisdictionRestrictions.length > 0\n\t\t\t? [\n\t\t\t\t\tp([\"Our services are not available in the following jurisdictions:\"]),\n\t\t\t\t\tul(jurisdictionRestrictions.map((j) => li([j]))),\n\t\t\t\t]\n\t\t\t: []),\n\t]);\n}\n\nfunction buildAccounts(config: TermsOfServiceConfig): DocumentSection | null {\n\tif (!config.accounts) return null;\n\tconst {\n\t\tregistrationRequired,\n\t\tuserResponsibleForCredentials,\n\t\tcompanyCanTerminate,\n\t} = config.accounts;\n\tconst items: string[] = [];\n\tif (registrationRequired)\n\t\titems.push(\n\t\t\t\"Registration is required to access certain features of our services.\",\n\t\t);\n\tif (userResponsibleForCredentials)\n\t\titems.push(\n\t\t\t\"You are responsible for maintaining the confidentiality of your account credentials and for all activity under your account.\",\n\t\t);\n\tif (companyCanTerminate)\n\t\titems.push(\n\t\t\t\"We reserve the right to terminate or suspend accounts at our discretion.\",\n\t\t);\n\treturn section(\"tos-accounts\", [\n\t\theading(\"Accounts\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildProhibitedUses(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.prohibitedUses || config.prohibitedUses.length === 0) return null;\n\treturn section(\"tos-prohibited-uses\", [\n\t\theading(\"Prohibited Uses\"),\n\t\tp([\"You may not use our services for the following purposes:\"]),\n\t\tul(config.prohibitedUses.map((u) => li([u]))),\n\t]);\n}\n\nfunction buildUserContent(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.userContent) return null;\n\tconst {\n\t\tusersOwnContent,\n\t\tlicenseGrantedToCompany,\n\t\tlicenseDescription,\n\t\tcompanyCanRemoveContent,\n\t} = config.userContent;\n\tconst items: string[] = [];\n\tif (usersOwnContent)\n\t\titems.push(\"You retain ownership of content you submit to our services.\");\n\tif (licenseGrantedToCompany)\n\t\titems.push(\n\t\t\tlicenseDescription ??\n\t\t\t\t\"By submitting content, you grant us a license to use, reproduce, and display that content in connection with our services.\",\n\t\t);\n\tif (companyCanRemoveContent)\n\t\titems.push(\n\t\t\t\"We reserve the right to remove content that violates these Terms or that we find objectionable.\",\n\t\t);\n\treturn section(\"tos-user-content\", [\n\t\theading(\"User Content\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildIntellectualProperty(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.intellectualProperty) return null;\n\tconst { companyOwnsService, usersMayNotCopy } = config.intellectualProperty;\n\tconst items: string[] = [];\n\tif (companyOwnsService)\n\t\titems.push(\n\t\t\t`All content, features, and functionality of our services are owned by ${config.company.name} and are protected by intellectual property laws.`,\n\t\t);\n\tif (usersMayNotCopy)\n\t\titems.push(\n\t\t\t\"You may not copy, modify, distribute, sell, or lease any part of our services without our express written permission.\",\n\t\t);\n\treturn section(\"tos-intellectual-property\", [\n\t\theading(\"Intellectual Property\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildPayments(config: TermsOfServiceConfig): DocumentSection | null {\n\tif (!config.payments) return null;\n\tconst { hasPaidFeatures, refundPolicy, priceChangesNotice } = config.payments;\n\tconst items: string[] = [];\n\tif (hasPaidFeatures)\n\t\titems.push(\"Some features of our services require payment.\");\n\tif (refundPolicy) items.push(refundPolicy);\n\tif (priceChangesNotice) items.push(priceChangesNotice);\n\tif (items.length === 0) return null;\n\treturn section(\"tos-payments\", [\n\t\theading(\"Payments\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildAvailability(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.availability) return null;\n\tconst { noUptimeGuarantee, maintenanceWindows } = config.availability;\n\tconst items: string[] = [];\n\tif (noUptimeGuarantee)\n\t\titems.push(\n\t\t\t\"We do not guarantee uninterrupted or error-free access to our services.\",\n\t\t);\n\tif (maintenanceWindows) items.push(maintenanceWindows);\n\treturn section(\"tos-availability\", [\n\t\theading(\"Service Availability\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildTermination(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.termination) return null;\n\tconst { companyCanTerminate, userCanTerminate, effectOfTermination } =\n\t\tconfig.termination;\n\tconst items: string[] = [];\n\tif (companyCanTerminate)\n\t\titems.push(\n\t\t\t\"We may terminate or suspend your access to our services at any time, with or without cause or notice.\",\n\t\t);\n\tif (userCanTerminate)\n\t\titems.push(\"You may terminate your use of our services at any time.\");\n\tif (effectOfTermination) items.push(effectOfTermination);\n\treturn section(\"tos-termination\", [\n\t\theading(\"Termination\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildDisclaimers(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.disclaimers) return null;\n\tconst { serviceProvidedAsIs, noWarranties } = config.disclaimers;\n\tconst items: string[] = [];\n\tif (serviceProvidedAsIs)\n\t\titems.push(\n\t\t\t'Our services are provided on an \"as is\" and \"as available\" basis.',\n\t\t);\n\tif (noWarranties)\n\t\titems.push(\n\t\t\t\"We make no warranties, express or implied, regarding the reliability, accuracy, or fitness for a particular purpose of our services.\",\n\t\t);\n\treturn section(\"tos-disclaimers\", [\n\t\theading(\"Disclaimers\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildLimitationOfLiability(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.limitationOfLiability) return null;\n\tconst { excludesIndirectDamages, liabilityCap } =\n\t\tconfig.limitationOfLiability;\n\tconst items: string[] = [];\n\tif (excludesIndirectDamages)\n\t\titems.push(\n\t\t\t\"To the fullest extent permitted by law, we shall not be liable for any indirect, incidental, special, or consequential damages.\",\n\t\t);\n\tif (liabilityCap) items.push(liabilityCap);\n\treturn section(\"tos-limitation-of-liability\", [\n\t\theading(\"Limitation of Liability\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildIndemnification(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.indemnification) return null;\n\tconst { userIndemnifiesCompany, scope } = config.indemnification;\n\tif (!userIndemnifiesCompany) return null;\n\treturn section(\"tos-indemnification\", [\n\t\theading(\"Indemnification\"),\n\t\tp([\n\t\t\tscope ??\n\t\t\t\t`You agree to indemnify and hold harmless ${config.company.name} and its officers, directors, employees, and agents from any claims arising out of your use of the services or violation of these Terms.`,\n\t\t]),\n\t]);\n}\n\nfunction buildThirdPartyServices(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.thirdPartyServices || config.thirdPartyServices.length === 0)\n\t\treturn null;\n\treturn section(\"tos-third-party-services\", [\n\t\theading(\"Third-Party Services\"),\n\t\tp([\"Our services may integrate with or link to third-party services:\"]),\n\t\tul(\n\t\t\tconfig.thirdPartyServices.map((t) =>\n\t\t\t\tli([bold(t.name), \" \\u2014 \", t.purpose]),\n\t\t\t),\n\t\t),\n\t]);\n}\n\nfunction buildDisputeResolution(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection | null {\n\tif (!config.disputeResolution) return null;\n\tconst { method, venue, classActionWaiver } = config.disputeResolution;\n\tconst items: string[] = [];\n\tconst methodLabel =\n\t\tmethod === \"arbitration\"\n\t\t\t? \"binding arbitration\"\n\t\t\t: method === \"mediation\"\n\t\t\t\t? \"mediation\"\n\t\t\t\t: \"litigation\";\n\titems.push(\n\t\t`Any disputes arising from these Terms or your use of our services shall be resolved through ${methodLabel}.`,\n\t);\n\tif (venue) items.push(`Venue: ${venue}.`);\n\tif (classActionWaiver)\n\t\titems.push(\n\t\t\t\"You waive any right to participate in class action lawsuits or class-wide arbitration.\",\n\t\t);\n\treturn section(\"tos-dispute-resolution\", [\n\t\theading(\"Dispute Resolution\"),\n\t\tul(items.map((i) => li([i]))),\n\t]);\n}\n\nfunction buildGoverningLaw(config: TermsOfServiceConfig): DocumentSection {\n\treturn section(\"tos-governing-law\", [\n\t\theading(\"Governing Law\"),\n\t\tp([\n\t\t\t`These Terms are governed by the laws of ${config.governingLaw.jurisdiction}, without regard to conflict of law principles.`,\n\t\t]),\n\t]);\n}\n\nfunction buildChanges(config: TermsOfServiceConfig): DocumentSection | null {\n\tif (!config.changesPolicy) return null;\n\tconst { noticeMethod, noticePeriodDays } = config.changesPolicy;\n\tconst notice = noticePeriodDays\n\t\t? `at least ${noticePeriodDays} days' notice via ${noticeMethod}`\n\t\t: `notice via ${noticeMethod}`;\n\treturn section(\"tos-changes\", [\n\t\theading(\"Changes to These Terms\"),\n\t\tp([\n\t\t\t`We may update these Terms from time to time. We will provide ${notice} before changes take effect. Continued use of our services after changes constitutes acceptance of the revised Terms.`,\n\t\t]),\n\t]);\n}\n\nfunction buildContact(config: TermsOfServiceConfig): DocumentSection {\n\treturn section(\"tos-contact\", [\n\t\theading(\"Contact Us\"),\n\t\tp([\"If you have questions about these Terms, please contact us:\"]),\n\t\tul([\n\t\t\tli([bold(\"Legal Name:\"), \" \", config.company.legalName]),\n\t\t\tli([bold(\"Address:\"), \" \", config.company.address]),\n\t\t\tli([bold(\"Email:\"), \" \", config.company.contact]),\n\t\t]),\n\t]);\n}\n\nconst SECTION_BUILDERS: ((\n\tconfig: TermsOfServiceConfig,\n) => DocumentSection | null)[] = [\n\tbuildIntroduction,\n\tbuildAcceptance,\n\tbuildEligibility,\n\tbuildAccounts,\n\tbuildProhibitedUses,\n\tbuildUserContent,\n\tbuildIntellectualProperty,\n\tbuildPayments,\n\tbuildAvailability,\n\tbuildTermination,\n\tbuildDisclaimers,\n\tbuildLimitationOfLiability,\n\tbuildIndemnification,\n\tbuildThirdPartyServices,\n\tbuildDisputeResolution,\n\tbuildGoverningLaw,\n\tbuildChanges,\n\tbuildContact,\n];\n\nexport function compileTermsDocument(\n\tconfig: TermsOfServiceConfig,\n): DocumentSection[] {\n\treturn SECTION_BUILDERS.map((builder) => builder(config)).filter(\n\t\t(s): s is DocumentSection => s !== null,\n\t);\n}\n","import type { PolicyInput } from \"../types\";\nimport { compileCookieDocument } from \"./cookie\";\nimport { compilePrivacyDocument } from \"./privacy\";\nimport { compileTermsDocument } from \"./terms\";\nimport type { Document } from \"./types\";\n\nexport function compile(input: PolicyInput): Document {\n\tif (input.type === \"privacy\") {\n\t\tconst { type: _, ...config } = input;\n\t\treturn {\n\t\t\ttype: \"document\",\n\t\t\tpolicyType: \"privacy\",\n\t\t\tsections: compilePrivacyDocument(config),\n\t\t};\n\t}\n\tif (input.type === \"terms\") {\n\t\tconst { type: _, ...config } = input;\n\t\treturn {\n\t\t\ttype: \"document\",\n\t\t\tpolicyType: \"terms\",\n\t\t\tsections: compileTermsDocument(config),\n\t\t};\n\t}\n\tconst { type: _, ...config } = input;\n\treturn {\n\t\ttype: \"document\",\n\t\tpolicyType: \"cookie\",\n\t\tsections: compileCookieDocument(config),\n\t};\n}\n\nexport {\n\tbold,\n\theading,\n\titalic,\n\tli,\n\tlink,\n\tol,\n\tp,\n\tsection,\n\ttext,\n\tul,\n} from \"./helpers\";\nexport type {\n\tBoldNode,\n\tContentNode,\n\tDocument,\n\tDocumentSection,\n\tHeadingNode,\n\tInlineNode,\n\tItalicNode,\n\tLinkNode,\n\tListItemNode,\n\tListNode,\n\tNode,\n\tNodeContext,\n\tParagraphNode,\n\tPolicyType,\n\tTextNode,\n} from \"./types\";\n","export type OutputFormat = \"markdown\" | \"html\" | \"pdf\";\n\nexport type CompileOptions = { formats: OutputFormat[] };\n\nexport type Jurisdiction = \"us\" | \"eu\" | \"ca\" | \"au\" | \"nz\" | \"other\";\n\nexport type UserRight =\n\t| \"access\"\n\t| \"rectification\"\n\t| \"erasure\"\n\t| \"portability\"\n\t| \"restriction\"\n\t| \"objection\"\n\t| \"opt_out_sale\"\n\t| \"non_discrimination\";\n\nexport type LegalBasis =\n\t| \"consent\"\n\t| \"contract\"\n\t| \"legal_obligation\"\n\t| \"vital_interests\"\n\t| \"public_task\"\n\t| \"legitimate_interests\";\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: LegalBasis | LegalBasis[];\n\tretention: Record<string, string>;\n\tcookies: { essential: boolean; analytics: boolean; marketing: boolean };\n\tthirdParties: { name: string; purpose: string; policyUrl?: string }[];\n\tuserRights: UserRight[];\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 CookiePolicyCookies = {\n\tessential: boolean;\n\t[key: string]: boolean;\n};\n\nexport type CookiePolicyConfig = {\n\teffectiveDate: string;\n\tcompany: CompanyConfig;\n\tcookies: CookiePolicyCookies;\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\tconst basisArray = Array.isArray(config.legalBasis)\n\t\t\t? config.legalBasis\n\t\t\t: [config.legalBasis];\n\t\tif (basisArray.length === 0 || (basisArray.length === 1 && !basisArray[0]))\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] as const) {\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] as const) {\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 type { CookieConsent, CookieConsentStatus } from \"./consent\";\nexport { acceptAll, rejectAll } from \"./consent\";\nexport type {\n\tBoldNode,\n\tContentNode,\n\tDocument,\n\tDocumentSection,\n\tHeadingNode,\n\tInlineNode,\n\tItalicNode,\n\tLinkNode,\n\tListItemNode,\n\tListNode,\n\tNode,\n\tNodeContext,\n\tParagraphNode,\n\tPolicyType,\n\tTextNode,\n} from \"./documents\";\nexport {\n\tbold,\n\tcompile,\n\theading,\n\titalic,\n\tli,\n\tlink,\n\tol,\n\tp,\n\tsection,\n\ttext,\n\tul,\n} from \"./documents\";\nexport type {\n\tCompanyConfig,\n\tCompileOptions,\n\tCookiePolicyConfig,\n\tDisputeResolutionMethod,\n\tJurisdiction,\n\tLegalBasis,\n\tOpenPolicyConfig,\n\tOutputFormat,\n\tPolicyInput,\n\tPrivacyPolicyConfig,\n\tTermsOfServiceConfig,\n\tUserRight,\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 type { 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"],"mappings":";AASA,SAAgB,UAAU,QAA2C;CACpE,MAAM,UAAyB,EAAE,WAAW,MAAM;AAClD,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,OAAO,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,QAAO,KAAK;EAAE,OAAO;EAAS,SAAS;EAA4B,CAAC;AACrE,KAAI,CAAC,OAAO,QAAQ,UACnB,QAAO,KAAK;EAAE,OAAO;EAAS,SAAS;EAAiC,CAAC;AAC1E,KAAI,CAAC,OAAO,QAAQ,QACnB,QAAO,KAAK;EAAE,OAAO;EAAS,SAAS;EAA+B,CAAC;AACxE,KAAI,CAAC,OAAO,QAAQ,QACnB,QAAO,KAAK;EAAE,OAAO;EAAS,SAAS;EAA+B,CAAC;AACxE,KAAI,CAAC,OAAO,aAAa,aACxB,QAAO,KAAK;EACX,OAAO;EACP,SAAS;EACT,CAAC;AAGH,KAAI,CAAC,OAAO,YACX,QAAO,KAAK;EACX,OAAO;EACP,SACC;EACD,CAAC;AAEH,KAAI,CAAC,OAAO,sBACX,QAAO,KAAK;EACX,OAAO;EACP,SACC;EACD,CAAC;AAEH,KAAI,OAAO,WAAW,QAAQ,WAAW,EACxC,QAAO,KAAK;EACX,OAAO;EACP,SACC;EACD,CAAC;AAGH,QAAO;;;;ACOR,SAAgB,uBACf,QACgB;CAChB,MAAM,SAAwB,EAAE;AAChC,KAAI,OAAO,QACV,QAAO,KAAK;EACX,MAAM;EACN,SAAS,OAAO;EAChB,GAAG,OAAO;EACV,CAAC;AAEH,KAAI,OAAO,MACV,QAAO,KAAK;EAAE,MAAM;EAAS,SAAS,OAAO;EAAS,GAAG,OAAO;EAAO,CAAC;AAEzE,KAAI,OAAO,OACV,QAAO,KAAK;EAAE,MAAM;EAAU,SAAS,OAAO;EAAS,GAAG,OAAO;EAAQ,CAAC;AAE3E,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpolicy/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core package for OpenPolicy",
|
|
6
6
|
"license": "GPL-3.0-only",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"dev": "rolldown -c
|
|
24
|
+
"dev": "rolldown --watch -c",
|
|
25
25
|
"build": "rolldown -c",
|
|
26
26
|
"check-types": "tsc --noEmit",
|
|
27
27
|
"test": "bun test"
|