@sphereon/ssi-sdk.credential-validation 0.30.2-unstable.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.
@@ -0,0 +1,50 @@
1
+ import { IAgentContext, IPluginMethodMap } from '@veramo/core';
2
+ import { Hasher, WrappedVerifiableCredential, WrappedVerifiablePresentation } from '@sphereon/ssi-types';
3
+ import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc';
4
+ export interface ICredentialValidation extends IPluginMethodMap {
5
+ cvVerifyCredential(args: VerifyCredentialArgs, context: RequiredContext): Promise<VerificationResult>;
6
+ cvValidateSchema(args: ValidateSchemaArgs): Promise<VerificationResult>;
7
+ cvVerifyMdoc(args: VerifyMdocCredentialArgs, context: RequiredContext): Promise<VerificationResult>;
8
+ cvVerifySDJWTCredential(args: VerifySDJWTCredentialArgs, context: RequiredContext): Promise<VerificationResult>;
9
+ cvVerifyW3CCredential(args: VerifyW3CCredentialArgs, context: RequiredContext): Promise<VerificationResult>;
10
+ }
11
+ export declare enum SchemaValidation {
12
+ ALWAYS = "ALWAYS",
13
+ NEVER = "NEVER",
14
+ WHEN_PRESENT = "WHEN_PRESENT"
15
+ }
16
+ export type VerifyCredentialArgs = {
17
+ credential: string;
18
+ hasher?: Hasher;
19
+ };
20
+ export type ValidateSchemaArgs = {
21
+ credential: string;
22
+ validationPolicy?: SchemaValidation;
23
+ hasher?: Hasher;
24
+ };
25
+ export type VerifyMdocCredentialArgs = {
26
+ credential: string;
27
+ };
28
+ export type VerifySDJWTCredentialArgs = {
29
+ credential: string;
30
+ hasher?: Hasher;
31
+ };
32
+ export type VerifyW3CCredentialArgs = {};
33
+ export type VerificationResult = {
34
+ result: boolean;
35
+ source: WrappedVerifiableCredential | WrappedVerifiablePresentation;
36
+ subResults: Array<VerificationSubResult>;
37
+ error?: string | undefined;
38
+ errorDetails?: string;
39
+ };
40
+ export type VerificationSubResult = {
41
+ result: boolean;
42
+ error?: string;
43
+ errorDetails?: string;
44
+ };
45
+ export type CredentialVerificationError = {
46
+ error?: string;
47
+ errorDetails?: string;
48
+ };
49
+ export type RequiredContext = IAgentContext<ImDLMdoc>;
50
+ //# sourceMappingURL=ICredentialValidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICredentialValidation.d.ts","sourceRoot":"","sources":["../../src/types/ICredentialValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAA;AACxG,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACrG,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACvE,YAAY,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACnG,uBAAuB,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;IAC/G,qBAAqB,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAC5G;AAED,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,YAAY,iBAAiB;CAC9B;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7D,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAExC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,2BAA2B,GAAG,6BAA6B,CAAA;IACnE,UAAU,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAA;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAA"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SchemaValidation = void 0;
4
+ var SchemaValidation;
5
+ (function (SchemaValidation) {
6
+ SchemaValidation["ALWAYS"] = "ALWAYS";
7
+ SchemaValidation["NEVER"] = "NEVER";
8
+ SchemaValidation["WHEN_PRESENT"] = "WHEN_PRESENT";
9
+ })(SchemaValidation || (exports.SchemaValidation = SchemaValidation = {}));
10
+ //# sourceMappingURL=ICredentialValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICredentialValidation.js","sourceRoot":"","sources":["../../src/types/ICredentialValidation.ts"],"names":[],"mappings":";;;AAYA,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,mCAAe,CAAA;IACf,iDAA6B,CAAA;AAC/B,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@sphereon/ssi-sdk.credential-validation",
3
+ "version": "0.30.2-unstable.7+6464facf",
4
+ "source": "src/index.ts",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "veramo": {
8
+ "pluginInterfaces": {
9
+ "ICredentialValidation": "./src/types/ICredentialValidation.ts"
10
+ }
11
+ },
12
+ "scripts": {
13
+ "build": "tsc",
14
+ "build:clean": "tsc --build --clean && tsc --build",
15
+ "generate-plugin-schema": "ts-node ../../packages/dev/bin/sphereon.js dev generate-plugin-schema"
16
+ },
17
+ "dependencies": {
18
+ "@sphereon/kmp-mdl-mdoc": "0.2.0-SNAPSHOT.22",
19
+ "@sphereon/ssi-sdk.agent-config": "0.30.2-unstable.7+6464facf",
20
+ "@sphereon/ssi-sdk.mdl-mdoc": "0.30.2-unstable.7+6464facf",
21
+ "@sphereon/ssi-sdk.sd-jwt": "0.30.2-unstable.7+6464facf",
22
+ "@sphereon/ssi-types": "0.30.2-unstable.7+6464facf",
23
+ "ajv": "^8.17.1",
24
+ "ajv-formats": "^3.0.1",
25
+ "cross-fetch": "^3.1.8",
26
+ "debug": "^4.3.5",
27
+ "typeorm": "^0.3.20"
28
+ },
29
+ "devDependencies": {
30
+ "@veramo/remote-client": "4.2.0",
31
+ "@veramo/remote-server": "4.2.0"
32
+ },
33
+ "files": [
34
+ "dist/**/*",
35
+ "src/**/*",
36
+ "README.md",
37
+ "plugin.schema.json",
38
+ "LICENSE"
39
+ ],
40
+ "private": false,
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "repository": "git@github.com:Sphereon-Opensource/SSI-SDK.git",
45
+ "author": "Sphereon <dev@sphereon.com>",
46
+ "license": "Apache-2.0",
47
+ "keywords": [
48
+ "Sphereon",
49
+ "SSI",
50
+ "Veramo",
51
+ "Credential",
52
+ "VerifiableCredential"
53
+ ],
54
+ "gitHead": "6464facffe47aae80b369e503910f20291d55624"
55
+ }