dpdp-kit 0.1.2 → 0.2.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/README.md +104 -10
- package/dist/audit.d.ts +1 -1
- package/dist/{chunk-MX5FRZQT.js → chunk-KVTUMHXO.js} +36 -0
- package/dist/cli.js +21 -3
- package/dist/config.d.ts +10 -0
- package/dist/data-access.d.ts +19 -0
- package/dist/dpdp.d.ts +60 -3
- package/dist/drizzle.d.ts +494 -4
- package/dist/drizzle.js +254 -3
- package/dist/erasure.d.ts +2 -1
- package/dist/errors.d.ts +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +367 -22
- package/dist/records.d.ts +124 -0
- package/dist/retention.d.ts +47 -0
- package/dist/rights.d.ts +49 -0
- package/dist/run-audit.d.ts +9 -0
- package/dist/store.d.ts +9 -2
- package/package.json +1 -1
package/dist/run-audit.d.ts
CHANGED
|
@@ -6,6 +6,15 @@ export declare function findConfig(cwd: string, explicit?: string): string | und
|
|
|
6
6
|
/** Load a config file (TypeScript or JavaScript). Accepts a default export or `export const config`. */
|
|
7
7
|
export declare function loadConfig(file: string): Promise<DpdpConfig<string>>;
|
|
8
8
|
export declare function formatIssues(issues: readonly Issue[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* GitHub Actions workflow commands, so each problem shows as an annotation on the pull request.
|
|
11
|
+
* Schema issues point at the schema file and the rest at the config file, relative to the
|
|
12
|
+
* repository root (`GITHUB_WORKSPACE`).
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatGithubAnnotations(issues: readonly Issue[], files: {
|
|
15
|
+
config: string;
|
|
16
|
+
schema?: string | undefined;
|
|
17
|
+
}, root: string): string;
|
|
9
18
|
/** Load a Drizzle schema file and read its tables. */
|
|
10
19
|
export declare function loadDrizzleSchema(file: string): Promise<Schema>;
|
|
11
20
|
/** Run `dpdp-kit audit`. Returns the exit code: 1 when there are errors (or `--strict` and warnings). */
|
package/dist/store.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NoticeLanguage } from "./languages.js";
|
|
2
|
+
import { type ErasureTask, type RequestStore, type RightsRequest, type TaskStore } from "./records.js";
|
|
2
3
|
export type ConsentAction = "grant" | "withdraw";
|
|
3
4
|
/** One entry in a person's consent record. Entries are only ever added, never changed. */
|
|
4
5
|
export interface ConsentEvent {
|
|
@@ -32,7 +33,13 @@ export interface ConsentStore {
|
|
|
32
33
|
/** All events for a subject, oldest first. */
|
|
33
34
|
events(subjectId: string): Promise<ConsentEvent[]>;
|
|
34
35
|
}
|
|
35
|
-
/**
|
|
36
|
-
export
|
|
36
|
+
/** A store that also keeps rights requests and erasure tasks. Both built-in stores are one. */
|
|
37
|
+
export type DpdpStore = ConsentStore & RequestStore & TaskStore;
|
|
38
|
+
/** Whether a store can keep rights requests and erasure tasks too (custom stores may not). */
|
|
39
|
+
export declare function isDpdpStore(store: ConsentStore): store is DpdpStore;
|
|
40
|
+
/** Keeps everything in memory. For tests and trying the library out; everything is lost on restart. */
|
|
41
|
+
export declare function memoryStore(): DpdpStore & {
|
|
37
42
|
readonly all: Map<string, ConsentEvent[]>;
|
|
43
|
+
readonly requests: Map<string, RightsRequest>;
|
|
44
|
+
readonly tasks: Map<string, ErasureTask>;
|
|
38
45
|
};
|
package/package.json
CHANGED