@openpolicy/cli 0.0.5 → 0.0.7
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/_cli-BVVbyDQ9.js +49 -0
- package/dist/_cli-BjVuFgXe.js +33 -0
- package/dist/_cli-C-Vx-Nop.js +58 -0
- package/dist/_cli-DrypJgn2.js +247 -0
- package/dist/_lib-9AbI1LBo.js +35 -0
- package/dist/_lib-9AbI1LBo.js.map +1 -0
- package/dist/_lib-D2I-M4OU.js +51 -0
- package/dist/_lib-D2I-M4OU.js.map +1 -0
- package/dist/_lib-D2LkleUQ.js +60 -0
- package/dist/_lib-D2LkleUQ.js.map +1 -0
- package/dist/_lib-MI0GKJMR.js +249 -0
- package/dist/_lib-MI0GKJMR.js.map +1 -0
- package/dist/cli +0 -0
- package/dist/cli.js +381 -2759
- package/dist/generate-ItFTJ-jj.js +60 -0
- package/dist/generate-ItFTJ-jj.js.map +1 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -961
- package/dist/index.js.map +1 -0
- package/dist/init-37NxG-6N.js +249 -0
- package/dist/init-37NxG-6N.js.map +1 -0
- package/dist/load-config-Bw8yiDkb.js +35 -0
- package/dist/load-config-Bw8yiDkb.js.map +1 -0
- package/dist/validate-DPge58Uv.js +51 -0
- package/dist/validate-DPge58Uv.js.map +1 -0
- package/package.json +4 -19
- package/src/cli.ts +0 -5
- package/src/commands/generate.test.ts +0 -19
- package/src/commands/generate.ts +0 -58
- package/src/commands/init.test.ts +0 -15
- package/src/commands/init.ts +0 -197
- package/src/commands/validate.test.ts +0 -15
- package/src/commands/validate.ts +0 -53
- package/src/index.test.ts +0 -29
- package/src/index.ts +0 -21
- package/src/utils/load-config.ts +0 -32
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import consola from "consola";
|
|
4
|
+
//#region src/commands/init.ts
|
|
5
|
+
const DATA_CATEGORY_MAP = {
|
|
6
|
+
name: {
|
|
7
|
+
group: "Personal Information",
|
|
8
|
+
label: "Full name"
|
|
9
|
+
},
|
|
10
|
+
email: {
|
|
11
|
+
group: "Personal Information",
|
|
12
|
+
label: "Email address"
|
|
13
|
+
},
|
|
14
|
+
ip_address: {
|
|
15
|
+
group: "Technical Data",
|
|
16
|
+
label: "IP address"
|
|
17
|
+
},
|
|
18
|
+
device_info: {
|
|
19
|
+
group: "Technical Data",
|
|
20
|
+
label: "Device type and browser"
|
|
21
|
+
},
|
|
22
|
+
location: {
|
|
23
|
+
group: "Location Data",
|
|
24
|
+
label: "Approximate location"
|
|
25
|
+
},
|
|
26
|
+
payment_info: {
|
|
27
|
+
group: "Financial Data",
|
|
28
|
+
label: "Payment card details"
|
|
29
|
+
},
|
|
30
|
+
usage_data: {
|
|
31
|
+
group: "Usage Data",
|
|
32
|
+
label: "Pages visited and features used"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
function toJurisdictions(choice) {
|
|
36
|
+
if (choice === "gdpr") return ["eu"];
|
|
37
|
+
if (choice === "ccpa") return ["ca"];
|
|
38
|
+
if (choice === "both") return ["eu", "ca"];
|
|
39
|
+
return ["us"];
|
|
40
|
+
}
|
|
41
|
+
function toDataCollected(categories) {
|
|
42
|
+
const groups = {};
|
|
43
|
+
for (const cat of categories) {
|
|
44
|
+
const mapping = DATA_CATEGORY_MAP[cat];
|
|
45
|
+
if (!mapping) continue;
|
|
46
|
+
groups[mapping.group] = [...groups[mapping.group] ?? [], mapping.label];
|
|
47
|
+
}
|
|
48
|
+
return Object.keys(groups).length > 0 ? groups : { "Personal Information": ["Email address"] };
|
|
49
|
+
}
|
|
50
|
+
function toUserRights(jurisdictions) {
|
|
51
|
+
const rights = new Set(["access", "erasure"]);
|
|
52
|
+
if (jurisdictions.includes("eu")) for (const r of [
|
|
53
|
+
"rectification",
|
|
54
|
+
"portability",
|
|
55
|
+
"restriction",
|
|
56
|
+
"objection"
|
|
57
|
+
]) rights.add(r);
|
|
58
|
+
if (jurisdictions.includes("ca")) for (const r of ["opt_out_sale", "non_discrimination"]) rights.add(r);
|
|
59
|
+
return Array.from(rights);
|
|
60
|
+
}
|
|
61
|
+
function renderPrivacyConfig(values) {
|
|
62
|
+
const dataLines = Object.entries(values.dataCollected).map(([k, v]) => ` ${JSON.stringify(k)}: ${JSON.stringify(v)},`).join("\n");
|
|
63
|
+
return `import { definePrivacyPolicy } from "@openpolicy/sdk";
|
|
64
|
+
|
|
65
|
+
export default definePrivacyPolicy({
|
|
66
|
+
effectiveDate: "${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}",
|
|
67
|
+
company: {
|
|
68
|
+
name: ${JSON.stringify(values.companyName)},
|
|
69
|
+
legalName: ${JSON.stringify(values.legalName)},
|
|
70
|
+
address: ${JSON.stringify(values.address)},
|
|
71
|
+
contact: ${JSON.stringify(values.contact)},
|
|
72
|
+
},
|
|
73
|
+
dataCollected: {
|
|
74
|
+
${dataLines}
|
|
75
|
+
},
|
|
76
|
+
legalBasis: ${JSON.stringify(values.legalBasis)},
|
|
77
|
+
retention: {
|
|
78
|
+
"All personal data": "As long as necessary for the purposes described in this policy",
|
|
79
|
+
},
|
|
80
|
+
cookies: {
|
|
81
|
+
essential: true,
|
|
82
|
+
analytics: ${values.hasCookies},
|
|
83
|
+
marketing: false,
|
|
84
|
+
},
|
|
85
|
+
thirdParties: [],
|
|
86
|
+
userRights: ${JSON.stringify(values.userRights)},
|
|
87
|
+
jurisdictions: ${JSON.stringify(values.jurisdictions)},
|
|
88
|
+
});
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
function renderTermsConfig(values) {
|
|
92
|
+
return `import { defineTermsOfService } from "@openpolicy/sdk";
|
|
93
|
+
|
|
94
|
+
export default defineTermsOfService({
|
|
95
|
+
effectiveDate: "${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}",
|
|
96
|
+
company: {
|
|
97
|
+
name: ${JSON.stringify(values.companyName)},
|
|
98
|
+
legalName: ${JSON.stringify(values.legalName)},
|
|
99
|
+
address: ${JSON.stringify(values.address)},
|
|
100
|
+
contact: ${JSON.stringify(values.contact)},
|
|
101
|
+
},
|
|
102
|
+
acceptance: {
|
|
103
|
+
methods: ["using the service", "creating an account"],
|
|
104
|
+
},
|
|
105
|
+
eligibility: {
|
|
106
|
+
minimumAge: 13,
|
|
107
|
+
},
|
|
108
|
+
accounts: {
|
|
109
|
+
registrationRequired: false,
|
|
110
|
+
userResponsibleForCredentials: true,
|
|
111
|
+
companyCanTerminate: true,
|
|
112
|
+
},
|
|
113
|
+
prohibitedUses: [
|
|
114
|
+
"Violating any applicable laws or regulations",
|
|
115
|
+
"Infringing on intellectual property rights",
|
|
116
|
+
"Transmitting harmful or malicious content",
|
|
117
|
+
],
|
|
118
|
+
intellectualProperty: {
|
|
119
|
+
companyOwnsService: true,
|
|
120
|
+
usersMayNotCopy: true,
|
|
121
|
+
},
|
|
122
|
+
termination: {
|
|
123
|
+
companyCanTerminate: true,
|
|
124
|
+
userCanTerminate: true,
|
|
125
|
+
},
|
|
126
|
+
disclaimers: {
|
|
127
|
+
serviceProvidedAsIs: true,
|
|
128
|
+
noWarranties: true,
|
|
129
|
+
},
|
|
130
|
+
limitationOfLiability: {
|
|
131
|
+
excludesIndirectDamages: true,
|
|
132
|
+
},
|
|
133
|
+
governingLaw: {
|
|
134
|
+
jurisdiction: ${JSON.stringify(values.jurisdiction)},
|
|
135
|
+
},
|
|
136
|
+
changesPolicy: {
|
|
137
|
+
noticeMethod: "email or prominent notice on our website",
|
|
138
|
+
noticePeriodDays: 30,
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
`;
|
|
142
|
+
}
|
|
143
|
+
const initCommand = defineCommand({
|
|
144
|
+
meta: {
|
|
145
|
+
name: "init",
|
|
146
|
+
description: "Interactively create a policy config file"
|
|
147
|
+
},
|
|
148
|
+
args: {
|
|
149
|
+
out: {
|
|
150
|
+
type: "string",
|
|
151
|
+
description: "Output path for generated config",
|
|
152
|
+
default: ""
|
|
153
|
+
},
|
|
154
|
+
yes: {
|
|
155
|
+
type: "boolean",
|
|
156
|
+
description: "Skip prompts and use defaults (CI mode)",
|
|
157
|
+
default: false
|
|
158
|
+
},
|
|
159
|
+
type: {
|
|
160
|
+
type: "string",
|
|
161
|
+
description: "Policy type: \"privacy\" or \"terms\"",
|
|
162
|
+
default: "privacy"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
async run({ args }) {
|
|
166
|
+
const policyType = args.type === "terms" ? "terms" : "privacy";
|
|
167
|
+
const defaultOut = policyType === "terms" ? "./terms.config.ts" : "./privacy.config.ts";
|
|
168
|
+
consola.start(`OpenPolicy init wizard (${policyType})`);
|
|
169
|
+
const companyName = String(await consola.prompt("Company name?", {
|
|
170
|
+
type: "text",
|
|
171
|
+
cancel: "reject"
|
|
172
|
+
}));
|
|
173
|
+
const legalName = String(await consola.prompt("Legal entity name?", {
|
|
174
|
+
type: "text",
|
|
175
|
+
cancel: "reject",
|
|
176
|
+
initial: companyName
|
|
177
|
+
}));
|
|
178
|
+
const address = String(await consola.prompt("Company address?", {
|
|
179
|
+
type: "text",
|
|
180
|
+
cancel: "reject"
|
|
181
|
+
}));
|
|
182
|
+
const contact = String(await consola.prompt(policyType === "terms" ? "Legal contact email?" : "Privacy contact email?", {
|
|
183
|
+
type: "text",
|
|
184
|
+
cancel: "reject"
|
|
185
|
+
}));
|
|
186
|
+
let source;
|
|
187
|
+
if (policyType === "terms") source = renderTermsConfig({
|
|
188
|
+
companyName,
|
|
189
|
+
legalName,
|
|
190
|
+
address,
|
|
191
|
+
contact,
|
|
192
|
+
jurisdiction: String(await consola.prompt("Governing law jurisdiction? (e.g. Delaware, USA)", {
|
|
193
|
+
type: "text",
|
|
194
|
+
cancel: "reject",
|
|
195
|
+
initial: "Delaware, USA"
|
|
196
|
+
}))
|
|
197
|
+
});
|
|
198
|
+
else {
|
|
199
|
+
const jurisdictionChoice = String(await consola.prompt("Jurisdiction?", {
|
|
200
|
+
type: "select",
|
|
201
|
+
cancel: "reject",
|
|
202
|
+
options: [
|
|
203
|
+
"gdpr",
|
|
204
|
+
"ccpa",
|
|
205
|
+
"both"
|
|
206
|
+
]
|
|
207
|
+
}));
|
|
208
|
+
const dataCategories = await consola.prompt("Data categories collected?", {
|
|
209
|
+
type: "multiselect",
|
|
210
|
+
cancel: "reject",
|
|
211
|
+
options: [
|
|
212
|
+
"name",
|
|
213
|
+
"email",
|
|
214
|
+
"ip_address",
|
|
215
|
+
"device_info",
|
|
216
|
+
"location",
|
|
217
|
+
"payment_info",
|
|
218
|
+
"usage_data"
|
|
219
|
+
]
|
|
220
|
+
});
|
|
221
|
+
const hasCookies = Boolean(await consola.prompt("Does your app use cookies?", {
|
|
222
|
+
type: "confirm",
|
|
223
|
+
cancel: "reject",
|
|
224
|
+
initial: true
|
|
225
|
+
}));
|
|
226
|
+
const jurisdictions = toJurisdictions(jurisdictionChoice);
|
|
227
|
+
const dataCollected = toDataCollected(dataCategories);
|
|
228
|
+
const userRights = toUserRights(jurisdictions);
|
|
229
|
+
source = renderPrivacyConfig({
|
|
230
|
+
companyName,
|
|
231
|
+
legalName,
|
|
232
|
+
address,
|
|
233
|
+
contact,
|
|
234
|
+
jurisdictions,
|
|
235
|
+
dataCollected,
|
|
236
|
+
legalBasis: jurisdictions.includes("eu") ? "Legitimate interests and consent" : "",
|
|
237
|
+
hasCookies,
|
|
238
|
+
userRights
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
const outPath = resolve(args.out || defaultOut);
|
|
242
|
+
await Bun.write(outPath, source);
|
|
243
|
+
consola.success(`Config written to ${outPath}`);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
//#endregion
|
|
247
|
+
export { initCommand };
|
|
248
|
+
|
|
249
|
+
//# sourceMappingURL=_lib-MI0GKJMR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_lib-MI0GKJMR.js","names":[],"sources":["../src/commands/init.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport type { Jurisdiction } from \"@openpolicy/core\";\nimport { defineCommand } from \"citty\";\nimport consola from \"consola\";\n\nconst DATA_CATEGORY_MAP: Record<string, { group: string; label: string }> = {\n\tname: { group: \"Personal Information\", label: \"Full name\" },\n\temail: { group: \"Personal Information\", label: \"Email address\" },\n\tip_address: { group: \"Technical Data\", label: \"IP address\" },\n\tdevice_info: { group: \"Technical Data\", label: \"Device type and browser\" },\n\tlocation: { group: \"Location Data\", label: \"Approximate location\" },\n\tpayment_info: { group: \"Financial Data\", label: \"Payment card details\" },\n\tusage_data: { group: \"Usage Data\", label: \"Pages visited and features used\" },\n};\n\nfunction toJurisdictions(choice: string): Jurisdiction[] {\n\tif (choice === \"gdpr\") return [\"eu\"];\n\tif (choice === \"ccpa\") return [\"ca\"];\n\tif (choice === \"both\") return [\"eu\", \"ca\"];\n\treturn [\"us\"];\n}\n\nfunction toDataCollected(categories: string[]): Record<string, string[]> {\n\tconst groups: Record<string, string[]> = {};\n\tfor (const cat of categories) {\n\t\tconst mapping = DATA_CATEGORY_MAP[cat];\n\t\tif (!mapping) continue;\n\t\tgroups[mapping.group] = [...(groups[mapping.group] ?? []), mapping.label];\n\t}\n\treturn Object.keys(groups).length > 0\n\t\t? groups\n\t\t: { \"Personal Information\": [\"Email address\"] };\n}\n\nfunction toUserRights(jurisdictions: Jurisdiction[]): string[] {\n\tconst rights = new Set<string>([\"access\", \"erasure\"]);\n\tif (jurisdictions.includes(\"eu\")) {\n\t\tfor (const r of [\n\t\t\t\"rectification\",\n\t\t\t\"portability\",\n\t\t\t\"restriction\",\n\t\t\t\"objection\",\n\t\t])\n\t\t\trights.add(r);\n\t}\n\tif (jurisdictions.includes(\"ca\")) {\n\t\tfor (const r of [\"opt_out_sale\", \"non_discrimination\"]) rights.add(r);\n\t}\n\treturn Array.from(rights);\n}\n\nfunction renderPrivacyConfig(values: {\n\tcompanyName: string;\n\tlegalName: string;\n\taddress: string;\n\tcontact: string;\n\tjurisdictions: Jurisdiction[];\n\tdataCollected: Record<string, string[]>;\n\tlegalBasis: string;\n\thasCookies: boolean;\n\tuserRights: string[];\n}): string {\n\tconst dataLines = Object.entries(values.dataCollected)\n\t\t.map(([k, v]) => ` ${JSON.stringify(k)}: ${JSON.stringify(v)},`)\n\t\t.join(\"\\n\");\n\n\tconst today = new Date().toISOString().slice(0, 10);\n\n\treturn `import { definePrivacyPolicy } from \"@openpolicy/sdk\";\n\nexport default definePrivacyPolicy({\n effectiveDate: \"${today}\",\n company: {\n name: ${JSON.stringify(values.companyName)},\n legalName: ${JSON.stringify(values.legalName)},\n address: ${JSON.stringify(values.address)},\n contact: ${JSON.stringify(values.contact)},\n },\n dataCollected: {\n${dataLines}\n },\n legalBasis: ${JSON.stringify(values.legalBasis)},\n retention: {\n \"All personal data\": \"As long as necessary for the purposes described in this policy\",\n },\n cookies: {\n essential: true,\n analytics: ${values.hasCookies},\n marketing: false,\n },\n thirdParties: [],\n userRights: ${JSON.stringify(values.userRights)},\n jurisdictions: ${JSON.stringify(values.jurisdictions)},\n});\n`;\n}\n\nfunction renderTermsConfig(values: {\n\tcompanyName: string;\n\tlegalName: string;\n\taddress: string;\n\tcontact: string;\n\tjurisdiction: string;\n}): string {\n\tconst today = new Date().toISOString().slice(0, 10);\n\n\treturn `import { defineTermsOfService } from \"@openpolicy/sdk\";\n\nexport default defineTermsOfService({\n effectiveDate: \"${today}\",\n company: {\n name: ${JSON.stringify(values.companyName)},\n legalName: ${JSON.stringify(values.legalName)},\n address: ${JSON.stringify(values.address)},\n contact: ${JSON.stringify(values.contact)},\n },\n acceptance: {\n methods: [\"using the service\", \"creating an account\"],\n },\n eligibility: {\n minimumAge: 13,\n },\n accounts: {\n registrationRequired: false,\n userResponsibleForCredentials: true,\n companyCanTerminate: true,\n },\n prohibitedUses: [\n \"Violating any applicable laws or regulations\",\n \"Infringing on intellectual property rights\",\n \"Transmitting harmful or malicious content\",\n ],\n intellectualProperty: {\n companyOwnsService: true,\n usersMayNotCopy: true,\n },\n termination: {\n companyCanTerminate: true,\n userCanTerminate: true,\n },\n disclaimers: {\n serviceProvidedAsIs: true,\n noWarranties: true,\n },\n limitationOfLiability: {\n excludesIndirectDamages: true,\n },\n governingLaw: {\n jurisdiction: ${JSON.stringify(values.jurisdiction)},\n },\n changesPolicy: {\n noticeMethod: \"email or prominent notice on our website\",\n noticePeriodDays: 30,\n },\n});\n`;\n}\n\nexport const initCommand = defineCommand({\n\tmeta: {\n\t\tname: \"init\",\n\t\tdescription: \"Interactively create a policy config file\",\n\t},\n\targs: {\n\t\tout: {\n\t\t\ttype: \"string\",\n\t\t\tdescription: \"Output path for generated config\",\n\t\t\tdefault: \"\",\n\t\t},\n\t\tyes: {\n\t\t\ttype: \"boolean\",\n\t\t\tdescription: \"Skip prompts and use defaults (CI mode)\",\n\t\t\tdefault: false,\n\t\t},\n\t\ttype: {\n\t\t\ttype: \"string\",\n\t\t\tdescription: 'Policy type: \"privacy\" or \"terms\"',\n\t\t\tdefault: \"privacy\",\n\t\t},\n\t},\n\tasync run({ args }) {\n\t\tconst policyType = args.type === \"terms\" ? \"terms\" : \"privacy\";\n\t\tconst defaultOut =\n\t\t\tpolicyType === \"terms\" ? \"./terms.config.ts\" : \"./privacy.config.ts\";\n\n\t\tconsola.start(`OpenPolicy init wizard (${policyType})`);\n\n\t\tconst companyName = String(\n\t\t\tawait consola.prompt(\"Company name?\", { type: \"text\", cancel: \"reject\" }),\n\t\t);\n\n\t\tconst legalName = String(\n\t\t\tawait consola.prompt(\"Legal entity name?\", {\n\t\t\t\ttype: \"text\",\n\t\t\t\tcancel: \"reject\",\n\t\t\t\tinitial: companyName,\n\t\t\t}),\n\t\t);\n\n\t\tconst address = String(\n\t\t\tawait consola.prompt(\"Company address?\", {\n\t\t\t\ttype: \"text\",\n\t\t\t\tcancel: \"reject\",\n\t\t\t}),\n\t\t);\n\n\t\tconst contact = String(\n\t\t\tawait consola.prompt(\n\t\t\t\tpolicyType === \"terms\"\n\t\t\t\t\t? \"Legal contact email?\"\n\t\t\t\t\t: \"Privacy contact email?\",\n\t\t\t\t{\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\tcancel: \"reject\",\n\t\t\t\t},\n\t\t\t),\n\t\t);\n\n\t\tlet source: string;\n\n\t\tif (policyType === \"terms\") {\n\t\t\tconst jurisdiction = String(\n\t\t\t\tawait consola.prompt(\n\t\t\t\t\t\"Governing law jurisdiction? (e.g. Delaware, USA)\",\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tcancel: \"reject\",\n\t\t\t\t\t\tinitial: \"Delaware, USA\",\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tsource = renderTermsConfig({\n\t\t\t\tcompanyName,\n\t\t\t\tlegalName,\n\t\t\t\taddress,\n\t\t\t\tcontact,\n\t\t\t\tjurisdiction,\n\t\t\t});\n\t\t} else {\n\t\t\tconst jurisdictionChoice = String(\n\t\t\t\tawait consola.prompt(\"Jurisdiction?\", {\n\t\t\t\t\ttype: \"select\",\n\t\t\t\t\tcancel: \"reject\",\n\t\t\t\t\toptions: [\"gdpr\", \"ccpa\", \"both\"],\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tconst dataCategories = (await consola.prompt(\n\t\t\t\t\"Data categories collected?\",\n\t\t\t\t{\n\t\t\t\t\ttype: \"multiselect\",\n\t\t\t\t\tcancel: \"reject\",\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t\"name\",\n\t\t\t\t\t\t\"email\",\n\t\t\t\t\t\t\"ip_address\",\n\t\t\t\t\t\t\"device_info\",\n\t\t\t\t\t\t\"location\",\n\t\t\t\t\t\t\"payment_info\",\n\t\t\t\t\t\t\"usage_data\",\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t)) as string[];\n\n\t\t\tconst hasCookies = Boolean(\n\t\t\t\tawait consola.prompt(\"Does your app use cookies?\", {\n\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\tcancel: \"reject\",\n\t\t\t\t\tinitial: true,\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tconst jurisdictions = toJurisdictions(jurisdictionChoice);\n\t\t\tconst dataCollected = toDataCollected(dataCategories);\n\t\t\tconst userRights = toUserRights(jurisdictions);\n\t\t\tconst legalBasis = jurisdictions.includes(\"eu\")\n\t\t\t\t? \"Legitimate interests and consent\"\n\t\t\t\t: \"\";\n\n\t\t\tsource = renderPrivacyConfig({\n\t\t\t\tcompanyName,\n\t\t\t\tlegalName,\n\t\t\t\taddress,\n\t\t\t\tcontact,\n\t\t\t\tjurisdictions,\n\t\t\t\tdataCollected,\n\t\t\t\tlegalBasis,\n\t\t\t\thasCookies,\n\t\t\t\tuserRights,\n\t\t\t});\n\t\t}\n\n\t\tconst outPath = resolve(args.out || defaultOut);\n\t\tawait Bun.write(outPath, source);\n\t\tconsola.success(`Config written to ${outPath}`);\n\t},\n});\n"],"mappings":";;;;AAKA,MAAM,oBAAsE;CAC3E,MAAM;EAAE,OAAO;EAAwB,OAAO;EAAa;CAC3D,OAAO;EAAE,OAAO;EAAwB,OAAO;EAAiB;CAChE,YAAY;EAAE,OAAO;EAAkB,OAAO;EAAc;CAC5D,aAAa;EAAE,OAAO;EAAkB,OAAO;EAA2B;CAC1E,UAAU;EAAE,OAAO;EAAiB,OAAO;EAAwB;CACnE,cAAc;EAAE,OAAO;EAAkB,OAAO;EAAwB;CACxE,YAAY;EAAE,OAAO;EAAc,OAAO;EAAmC;CAC7E;AAED,SAAS,gBAAgB,QAAgC;AACxD,KAAI,WAAW,OAAQ,QAAO,CAAC,KAAK;AACpC,KAAI,WAAW,OAAQ,QAAO,CAAC,KAAK;AACpC,KAAI,WAAW,OAAQ,QAAO,CAAC,MAAM,KAAK;AAC1C,QAAO,CAAC,KAAK;;AAGd,SAAS,gBAAgB,YAAgD;CACxE,MAAM,SAAmC,EAAE;AAC3C,MAAK,MAAM,OAAO,YA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