dpdp-kit 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +12 -9
- package/dist/access.d.ts +3 -2
- package/dist/audit.d.ts +7 -2
- package/dist/{chunk-5TVA2TKG.js → chunk-3DOVLBUB.js} +12 -2
- package/dist/chunk-EMNABUCL.js +34 -0
- package/dist/{chunk-HXVP446N.js → chunk-FEGA6SOM.js} +817 -149
- package/dist/chunk-HGN6TO6R.js +294 -0
- package/dist/{chunk-KLMR7S7I.js → chunk-LVT4OKBC.js} +65 -0
- package/dist/chunk-M2PDT6DD.js +88 -0
- package/dist/chunk-NBVJQDDP.js +16 -0
- package/dist/{chunk-2ELTZSW3.js → chunk-VWGKAQCM.js} +18 -3
- package/dist/cli.js +48 -5
- package/dist/config.d.ts +67 -0
- package/dist/data-access.d.ts +8 -0
- package/dist/ddl.d.ts +13 -2
- package/dist/dpdp.d.ts +155 -9
- package/dist/drizzle.d.ts +108 -6
- package/dist/drizzle.js +85 -4
- package/dist/erasure.d.ts +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/evidence.d.ts +91 -0
- package/dist/express.d.ts +30 -0
- package/dist/express.js +70 -3
- package/dist/fastify.js +3 -3
- package/dist/guard.d.ts +23 -2
- package/dist/hono.d.ts +21 -0
- package/dist/hono.js +11 -3
- package/dist/http.d.ts +78 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.js +375 -125
- package/dist/mongodb.d.ts +3 -1
- package/dist/mongodb.js +99 -1
- package/dist/nestjs.js +1 -1
- package/dist/next.d.ts +25 -0
- package/dist/next.js +14 -0
- package/dist/notice.d.ts +139 -0
- package/dist/postgres.d.ts +5 -3
- package/dist/postgres.js +8 -2
- package/dist/prisma.d.ts +4 -2
- package/dist/prisma.js +16 -2
- package/dist/records.d.ts +24 -1
- package/dist/rights.d.ts +35 -2
- package/dist/run-audit.d.ts +8 -0
- package/dist/stats.d.ts +41 -0
- package/dist/store.d.ts +15 -2
- package/package.json +5 -1
package/dist/store.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import type { AccessEntry, AccessLogStore } from "./access.js";
|
|
2
2
|
import type { Breach, BreachNotice, BreachStore } from "./breach.js";
|
|
3
3
|
import type { NoticeLanguage } from "./languages.js";
|
|
4
|
+
import type { NoticeStore, SavedNotice } from "./notice.js";
|
|
5
|
+
import { type StatsStore } from "./stats.js";
|
|
4
6
|
import { type ErasureTask, type RequestStore, type RightsRequest, type TaskStore } from "./records.js";
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* - `grant` / `withdraw`: consent for consent purposes (Section 6).
|
|
9
|
+
* - `object` / `lift-objection`: the person says they don't want their data used for a Section 7(a)
|
|
10
|
+
* legitimate use, or changes their mind.
|
|
11
|
+
*/
|
|
12
|
+
export type ConsentAction = "grant" | "withdraw" | "object" | "lift-objection";
|
|
6
13
|
/** One entry in a person's consent record. Entries are only ever added, never changed. */
|
|
7
14
|
export interface ConsentEvent {
|
|
8
15
|
subjectId: string;
|
|
@@ -40,16 +47,22 @@ export type DpdpStore = ConsentStore & RequestStore & TaskStore;
|
|
|
40
47
|
/** Whether a store can keep rights requests and erasure tasks too (custom stores may not). */
|
|
41
48
|
export declare function isDpdpStore(store: ConsentStore): store is DpdpStore;
|
|
42
49
|
/** Keeps everything in memory. For tests and trying the library out; everything is lost on restart. */
|
|
43
|
-
export declare function memoryStore(): DpdpStore & AccessLogStore & BreachStore & {
|
|
50
|
+
export declare function memoryStore(): DpdpStore & AccessLogStore & BreachStore & NoticeStore & StatsStore & {
|
|
44
51
|
readonly all: Map<string, ConsentEvent[]>;
|
|
45
52
|
readonly requests: Map<string, RightsRequest>;
|
|
46
53
|
readonly tasks: Map<string, ErasureTask>;
|
|
47
54
|
readonly accessLog: AccessEntry[];
|
|
48
55
|
readonly breaches: Map<string, Breach>;
|
|
49
56
|
readonly notices: Map<string, BreachNotice>;
|
|
57
|
+
readonly privacyNotices: Map<string, SavedNotice>;
|
|
50
58
|
};
|
|
51
59
|
/**
|
|
52
60
|
* Purposes whose latest event is a grant: the person's consent state. Pass `until` (ISO 8601) for
|
|
53
61
|
* the state at that moment, counting only events at or before it.
|
|
54
62
|
*/
|
|
55
63
|
export declare function grantedPurposes(events: readonly ConsentEvent[], until?: string): Set<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Section 7(a) purposes the person has objected to and not changed their mind about. Pass `until`
|
|
66
|
+
* (ISO 8601) for the state at that moment.
|
|
67
|
+
*/
|
|
68
|
+
export declare function objectedPurposes(events: readonly ConsentEvent[], until?: string): Set<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dpdp-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Build India's DPDP Act 2023 into your Node.js backend: declared purposes, tamper-evident consent records, erasure plans and an audit you can run in CI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dpdp",
|
|
@@ -57,6 +57,10 @@
|
|
|
57
57
|
"types": "./dist/hono.d.ts",
|
|
58
58
|
"default": "./dist/hono.js"
|
|
59
59
|
},
|
|
60
|
+
"./next": {
|
|
61
|
+
"types": "./dist/next.d.ts",
|
|
62
|
+
"default": "./dist/next.js"
|
|
63
|
+
},
|
|
60
64
|
"./fastify": {
|
|
61
65
|
"types": "./dist/fastify.d.ts",
|
|
62
66
|
"default": "./dist/fastify.js"
|