@openpolicy/sdk 0.0.11 → 0.0.13
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/README.md +34 -30
- package/dist/index.d.ts +1 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -16,33 +16,35 @@ bun add @openpolicy/sdk
|
|
|
16
16
|
### Privacy policy
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
|
-
//
|
|
20
|
-
import {
|
|
19
|
+
// openpolicy.ts
|
|
20
|
+
import { defineConfig } from "@openpolicy/sdk";
|
|
21
21
|
|
|
22
|
-
export default
|
|
23
|
-
effectiveDate: "2026-01-01",
|
|
22
|
+
export default defineConfig({
|
|
24
23
|
company: {
|
|
25
24
|
name: "Acme",
|
|
26
25
|
legalName: "Acme, Inc.",
|
|
27
26
|
address: "123 Main St, San Francisco, CA 94105",
|
|
28
27
|
contact: "privacy@acme.com",
|
|
29
28
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
privacy: {
|
|
30
|
+
effectiveDate: "2026-01-01",
|
|
31
|
+
dataCollected: {
|
|
32
|
+
"Account information": ["Email address", "Display name"],
|
|
33
|
+
"Usage data": ["Pages visited", "Session duration"],
|
|
34
|
+
},
|
|
35
|
+
legalBasis: "Legitimate interests and user consent",
|
|
36
|
+
retention: {
|
|
37
|
+
"Account data": "Until account deletion",
|
|
38
|
+
"Analytics data": "13 months",
|
|
39
|
+
},
|
|
40
|
+
cookies: { essential: true, analytics: true, marketing: false },
|
|
41
|
+
thirdParties: [
|
|
42
|
+
{ name: "Vercel", purpose: "Hosting" },
|
|
43
|
+
{ name: "Plausible", purpose: "Privacy-friendly analytics" },
|
|
44
|
+
],
|
|
45
|
+
userRights: ["access", "erasure", "portability"],
|
|
46
|
+
jurisdictions: ["us", "eu"],
|
|
33
47
|
},
|
|
34
|
-
legalBasis: "Legitimate interests and user consent",
|
|
35
|
-
retention: {
|
|
36
|
-
"Account data": "Until account deletion",
|
|
37
|
-
"Analytics data": "13 months",
|
|
38
|
-
},
|
|
39
|
-
cookies: { essential: true, analytics: true, marketing: false },
|
|
40
|
-
thirdParties: [
|
|
41
|
-
{ name: "Vercel", purpose: "Hosting" },
|
|
42
|
-
{ name: "Plausible", purpose: "Privacy-friendly analytics" },
|
|
43
|
-
],
|
|
44
|
-
userRights: ["access", "erasure", "portability"],
|
|
45
|
-
jurisdictions: ["us", "eu"],
|
|
46
48
|
});
|
|
47
49
|
```
|
|
48
50
|
|
|
@@ -50,24 +52,26 @@ export default definePrivacyPolicy({
|
|
|
50
52
|
|
|
51
53
|
```ts
|
|
52
54
|
// terms.config.ts
|
|
53
|
-
import {
|
|
55
|
+
import { defineConfig } from "@openpolicy/sdk";
|
|
54
56
|
|
|
55
|
-
export default
|
|
56
|
-
effectiveDate: "2026-01-01",
|
|
57
|
+
export default defineConfig({
|
|
57
58
|
company: {
|
|
58
59
|
name: "Acme",
|
|
59
60
|
legalName: "Acme, Inc.",
|
|
60
61
|
address: "123 Main St, San Francisco, CA 94105",
|
|
61
62
|
contact: "legal@acme.com",
|
|
62
63
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
terms: {
|
|
65
|
+
effectiveDate: "2026-01-01",
|
|
66
|
+
acceptance: { methods: ["using the service", "creating an account"] },
|
|
67
|
+
eligibility: { minimumAge: 13 },
|
|
68
|
+
disclaimers: { serviceProvidedAsIs: true, noWarranties: true },
|
|
69
|
+
limitationOfLiability: { excludesIndirectDamages: true },
|
|
70
|
+
governingLaw: { jurisdiction: "Delaware, USA" },
|
|
71
|
+
changesPolicy: {
|
|
72
|
+
noticeMethod: "email or prominent notice on the website",
|
|
73
|
+
noticePeriodDays: 30,
|
|
74
|
+
},
|
|
71
75
|
},
|
|
72
76
|
});
|
|
73
77
|
```
|
package/dist/index.d.ts
CHANGED
|
@@ -130,9 +130,6 @@ type OpenPolicyConfig = {
|
|
|
130
130
|
//#endregion
|
|
131
131
|
//#region src/index.d.ts
|
|
132
132
|
declare function defineConfig(config: OpenPolicyConfig): OpenPolicyConfig;
|
|
133
|
-
declare function definePrivacyPolicy(config: PrivacyPolicyConfig): PrivacyPolicyConfig;
|
|
134
|
-
declare function defineTermsOfService(config: TermsOfServiceConfig): TermsOfServiceConfig;
|
|
135
|
-
declare function defineCookiePolicy(config: CookiePolicyConfig): CookiePolicyConfig;
|
|
136
133
|
//#endregion
|
|
137
|
-
export { type CookiePolicyConfig, type OpenPolicyConfig, type PrivacyPolicyConfig, type TermsOfServiceConfig, defineConfig
|
|
134
|
+
export { type CookiePolicyConfig, type OpenPolicyConfig, type PrivacyPolicyConfig, type TermsOfServiceConfig, defineConfig };
|
|
138
135
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["OutputFormat","CompileOptions","formats","
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["OutputFormat","CompileOptions","formats","Jurisdiction","CompanyConfig","name","legalName","address","contact","PrivacyPolicyConfig","Record","effectiveDate","company","dataCollected","legalBasis","retention","cookies","essential","analytics","marketing","thirdParties","purpose","userRights","jurisdictions","children","underAge","noticeUrl","DisputeResolutionMethod","TermsOfServiceConfig","acceptance","methods","eligibility","minimumAge","jurisdictionRestrictions","accounts","registrationRequired","userResponsibleForCredentials","companyCanTerminate","prohibitedUses","userContent","usersOwnContent","licenseGrantedToCompany","licenseDescription","companyCanRemoveContent","intellectualProperty","companyOwnsService","usersMayNotCopy","payments","hasPaidFeatures","refundPolicy","priceChangesNotice","availability","noUptimeGuarantee","maintenanceWindows","termination","userCanTerminate","effectOfTermination","disclaimers","serviceProvidedAsIs","noWarranties","limitationOfLiability","excludesIndirectDamages","liabilityCap","indemnification","userIndemnifiesCompany","scope","thirdPartyServices","disputeResolution","method","venue","classActionWaiver","governingLaw","jurisdiction","changesPolicy","noticeMethod","noticePeriodDays","privacyPolicyUrl","CookiePolicyConfig","functional","policyUrl","trackingTechnologies","consentMechanism","hasBanner","hasPreferencePanel","canWithdraw","PolicyInput","type","OpenPolicyConfig","Omit","privacy","terms","cookie","isOpenPolicyConfig","value","ValidationIssue","level","message","NodeContext","reason","TextNode","context","BoldNode","ItalicNode","LinkNode","href","InlineNode","HeadingNode","ParagraphNode","ListItemNode","ListNode","ordered","items","ContentNode","DocumentSection","id","content","PolicyType","Document","policyType","sections","Node","heading","levelOrContext","text","bold","italic","link","p","li","ul","ol","section","compile","input","validatePrivacyPolicy","config","validateCookiePolicy","validateTermsOfService","expandOpenPolicyConfig"],"sources":["../../core/dist/index.d.ts","../src/index.ts"],"mappings":";KAKKG,YAAAA;AAAAA,KACAC,aAAAA;EACHC,IAAAA;EACAC,SAAAA;EACAC,OAAAA;EACAC,OAAAA;AAAAA;AAAAA,KAEGC,mBAAAA;EACHE,aAAAA;EACAC,OAAAA,EAASR,aAAAA;EACTS,aAAAA,EAAeH,MAAAA;EACfI,UAAAA;EACAC,SAAAA,EAAWL,MAAAA;EACXM,OAAAA;IACEC,SAAAA;IACAC,SAAAA;IACAC,SAAAA;EAAAA;EAEFC,YAAAA;IACEf,IAAAA;IACAgB,OAAAA;EAAAA;EAEFC,UAAAA;EACAC,aAAAA,EAAepB,YAAAA;EACfqB,QAAAA;IACEC,QAAAA;IACAC,SAAAA;EAAAA;AAAAA;AAAAA,KAGCC,uBAAAA;AAAAA,KACAC,oBAAAA;EACHjB,aAAAA;EACAC,OAAAA,EAASR,aAAAA;EACTyB,UAAAA;IACEC,OAAAA;EAAAA;EAEFC,WAAAA;IACEC,UAAAA;IACAC,wBAAAA;EAAAA;EAEFC,QAAAA;IACEC,oBAAAA;IACAC,6BAA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X,kBAAAA;AAAAA;;;iBCjIA,YAAA,CAAa,MAAA,EAAQ,gBAAA,GAAmB,gBAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,16 +2,7 @@
|
|
|
2
2
|
function defineConfig(config) {
|
|
3
3
|
return config;
|
|
4
4
|
}
|
|
5
|
-
function definePrivacyPolicy(config) {
|
|
6
|
-
return config;
|
|
7
|
-
}
|
|
8
|
-
function defineTermsOfService(config) {
|
|
9
|
-
return config;
|
|
10
|
-
}
|
|
11
|
-
function defineCookiePolicy(config) {
|
|
12
|
-
return config;
|
|
13
|
-
}
|
|
14
5
|
//#endregion
|
|
15
|
-
export { defineConfig
|
|
6
|
+
export { defineConfig };
|
|
16
7
|
|
|
17
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { OpenPolicyConfig } from \"@openpolicy/core\";\n\nexport type {\n\tCookiePolicyConfig,\n\tOpenPolicyConfig,\n\tPrivacyPolicyConfig,\n\tTermsOfServiceConfig,\n} from \"@openpolicy/core\";\n\nexport function defineConfig(config: OpenPolicyConfig): OpenPolicyConfig {\n\treturn config;\n}\n"],"mappings":";AASA,SAAgB,aAAa,QAA4C;AACxE,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpolicy/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Public API for defining privacy policies with OpenPolicy",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "GPL-3.0-only",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/jamiedavenport/openpolicy",
|
package/dist/index.test.d.ts
DELETED
package/dist/index.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|