@limboai/verifox-sdk-verifier 0.0.1-rc.4

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.
@@ -0,0 +1,156 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export interface VerifierLedger {
5
+ put(id: string, bytes: Uint8Array): Promise<void>;
6
+ get(id: string): Promise<Uint8Array | null | undefined>;
7
+ forget(id: string): Promise<void>;
8
+ }
9
+
10
+ export type ValidationState = "Invalid" | "Valid" | "Trusted";
11
+ export type ValidationCodeKind = "success" | "informational" | "failure";
12
+
13
+ export interface ValidationCode {
14
+ code: string;
15
+ kind: ValidationCodeKind;
16
+ }
17
+
18
+ export interface SessionKeySummary {
19
+ key_id: number[];
20
+ public_key: number[];
21
+ }
22
+
23
+ export interface SegmentTiming {
24
+ sequence_number: bigint;
25
+ timescale?: number;
26
+ event_duration_secs?: number;
27
+ }
28
+
29
+ export interface InitValidation {
30
+ kind: "init";
31
+ reader: import("@contentauth/c2pa-types").ManifestStore;
32
+ state: ValidationState;
33
+ codes: ValidationCode[];
34
+ session_keys: SessionKeySummary[];
35
+ }
36
+
37
+ export interface MediaValidation {
38
+ kind: "media";
39
+ valid: boolean;
40
+ key_id: number[];
41
+ timing: SegmentTiming;
42
+ manifest_id: string;
43
+ codes: ValidationCode[];
44
+ }
45
+
46
+ export interface UnknownSegment {
47
+ kind: "unknown";
48
+ }
49
+
50
+ export type SegmentValidation = InitValidation | MediaValidation | UnknownSegment;
51
+
52
+
53
+
54
+ export class AssetSdk {
55
+ free(): void;
56
+ [Symbol.dispose](): void;
57
+ constructor(trust_anchors: string[]);
58
+ verify(data: Uint8Array): Promise<any>;
59
+ }
60
+
61
+ export function DEV_CA(): string;
62
+
63
+ export enum ErrorKind {
64
+ Reader = 0,
65
+ TrustConfig = 1,
66
+ Stream = 2,
67
+ }
68
+
69
+ export class StreamSdk {
70
+ free(): void;
71
+ [Symbol.dispose](): void;
72
+ constructor(trust_anchors: string[], ledger: VerifierLedger);
73
+ stop(stream_id: string): Promise<void>;
74
+ /**
75
+ * Validate a segment (init or media). Classifies internally.
76
+ * Returns a tagged object: `{ kind: "init" | "media" | "unknown", ... }`.
77
+ */
78
+ validate(stream_id: string, data: Uint8Array): Promise<SegmentValidation>;
79
+ }
80
+
81
+ export class ValidationError {
82
+ private constructor();
83
+ free(): void;
84
+ [Symbol.dispose](): void;
85
+ readonly kind: ErrorKind;
86
+ readonly message: string;
87
+ }
88
+
89
+ /**
90
+ * Live video validation failure codes (C2PA 2.3 §19).
91
+ */
92
+ export enum ValidationFailureCode {
93
+ InitInvalid = 0,
94
+ ManifestInvalid = 1,
95
+ AssertionInvalid = 2,
96
+ SegmentHashMismatch = 3,
97
+ SegmentSignatureInvalid = 4,
98
+ SegmentStructureInvalid = 5,
99
+ SessionKeyExpired = 6,
100
+ SessionKeyUnknown = 7,
101
+ Unknown = 8,
102
+ }
103
+
104
+ export function init_panic_hook(): void;
105
+
106
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
107
+
108
+ export interface InitOutput {
109
+ readonly memory: WebAssembly.Memory;
110
+ readonly DEV_CA: () => [number, number];
111
+ readonly __wbg_assetsdk_free: (a: number, b: number) => void;
112
+ readonly __wbg_get_validationerror_kind: (a: number) => number;
113
+ readonly __wbg_get_validationerror_message: (a: number) => [number, number];
114
+ readonly __wbg_streamsdk_free: (a: number, b: number) => void;
115
+ readonly __wbg_validationerror_free: (a: number, b: number) => void;
116
+ readonly assetsdk_new: (a: number, b: number) => [number, number, number];
117
+ readonly assetsdk_verify: (a: number, b: number, c: number) => any;
118
+ readonly streamsdk_new: (a: number, b: number, c: any) => [number, number, number];
119
+ readonly streamsdk_stop: (a: number, b: number, c: number) => any;
120
+ readonly streamsdk_validate: (a: number, b: number, c: number, d: number, e: number) => any;
121
+ readonly init_panic_hook: () => void;
122
+ readonly wasm_bindgen__convert__closures_____invoke__h6cc867bb982c9fd9: (a: number, b: number, c: any) => [number, number];
123
+ readonly wasm_bindgen__convert__closures_____invoke__h0ed13202b6e43f55: (a: number, b: number, c: any, d: any) => void;
124
+ readonly wasm_bindgen__convert__closures_____invoke__hf2b216e4830b5376: (a: number, b: number) => void;
125
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
126
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
127
+ readonly __wbindgen_exn_store: (a: number) => void;
128
+ readonly __externref_table_alloc: () => number;
129
+ readonly __wbindgen_externrefs: WebAssembly.Table;
130
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
131
+ readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
132
+ readonly __externref_table_dealloc: (a: number) => void;
133
+ readonly __wbindgen_start: () => void;
134
+ }
135
+
136
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
137
+
138
+ /**
139
+ * Instantiates the given `module`, which can either be bytes or
140
+ * a precompiled `WebAssembly.Module`.
141
+ *
142
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
143
+ *
144
+ * @returns {InitOutput}
145
+ */
146
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
147
+
148
+ /**
149
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
150
+ * for everything else, calls `WebAssembly.instantiate` directly.
151
+ *
152
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
153
+ *
154
+ * @returns {Promise<InitOutput>}
155
+ */
156
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -0,0 +1,27 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const DEV_CA: () => [number, number];
5
+ export const __wbg_assetsdk_free: (a: number, b: number) => void;
6
+ export const __wbg_get_validationerror_kind: (a: number) => number;
7
+ export const __wbg_get_validationerror_message: (a: number) => [number, number];
8
+ export const __wbg_streamsdk_free: (a: number, b: number) => void;
9
+ export const __wbg_validationerror_free: (a: number, b: number) => void;
10
+ export const assetsdk_new: (a: number, b: number) => [number, number, number];
11
+ export const assetsdk_verify: (a: number, b: number, c: number) => any;
12
+ export const streamsdk_new: (a: number, b: number, c: any) => [number, number, number];
13
+ export const streamsdk_stop: (a: number, b: number, c: number) => any;
14
+ export const streamsdk_validate: (a: number, b: number, c: number, d: number, e: number) => any;
15
+ export const init_panic_hook: () => void;
16
+ export const wasm_bindgen__convert__closures_____invoke__h6cc867bb982c9fd9: (a: number, b: number, c: any) => [number, number];
17
+ export const wasm_bindgen__convert__closures_____invoke__h0ed13202b6e43f55: (a: number, b: number, c: any, d: any) => void;
18
+ export const wasm_bindgen__convert__closures_____invoke__hf2b216e4830b5376: (a: number, b: number) => void;
19
+ export const __wbindgen_malloc: (a: number, b: number) => number;
20
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
21
+ export const __wbindgen_exn_store: (a: number) => void;
22
+ export const __externref_table_alloc: () => number;
23
+ export const __wbindgen_externrefs: WebAssembly.Table;
24
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
25
+ export const __wbindgen_destroy_closure: (a: number, b: number) => void;
26
+ export const __externref_table_dealloc: (a: number) => void;
27
+ export const __wbindgen_start: () => void;
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@limboai/verifox-sdk-verifier",
3
+ "version": "0.0.1-rc.4",
4
+ "license": "UNLICENSED",
5
+ "type": "module",
6
+ "main": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs"
12
+ }
13
+ },
14
+ "publishConfig": {
15
+ "main": "./dist/index.mjs",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.mjs"
21
+ }
22
+ }
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "gen/*.d.ts"
27
+ ],
28
+ "scripts": {
29
+ "gen": "bash scripts/gen.sh release",
30
+ "gen:debug": "bash scripts/gen.sh debug",
31
+ "build": "rolldown -c && tsc -p tsconfig.build.json",
32
+ "typecheck": "tsc --noEmit"
33
+ },
34
+ "dependencies": {
35
+ "@contentauth/c2pa-types": "^0.4.4"
36
+ },
37
+ "devDependencies": {
38
+ "rolldown": "^1.0.0-rc.18",
39
+ "typescript": "^6.0.2"
40
+ }
41
+ }