@credo-ts/core 0.6.0-pr-2102-20241122200537 → 0.6.0-pr-2100-20241124131043

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.
Files changed (70) hide show
  1. package/build/agent/AgentModules.d.ts +2 -0
  2. package/build/agent/AgentModules.js +2 -0
  3. package/build/agent/AgentModules.js.map +1 -1
  4. package/build/index.d.ts +1 -0
  5. package/build/index.js +1 -0
  6. package/build/index.js.map +1 -1
  7. package/build/modules/dcql/DcqlError.d.ts +8 -0
  8. package/build/modules/dcql/DcqlError.js +12 -0
  9. package/build/modules/dcql/DcqlError.js.map +1 -0
  10. package/build/modules/dcql/DcqlModule.d.ts +10 -0
  11. package/build/modules/dcql/DcqlModule.js +23 -0
  12. package/build/modules/dcql/DcqlModule.js.map +1 -0
  13. package/build/modules/dcql/DcqlService.d.ts +140 -0
  14. package/build/modules/dcql/DcqlService.js +253 -0
  15. package/build/modules/dcql/DcqlService.js.map +1 -0
  16. package/build/modules/dcql/index.d.ts +5 -0
  17. package/build/modules/dcql/index.js +22 -0
  18. package/build/modules/dcql/index.js.map +1 -0
  19. package/build/modules/dcql/models/DcqlCredentialsForRequest.d.ts +20 -0
  20. package/build/modules/dcql/models/DcqlCredentialsForRequest.js +3 -0
  21. package/build/modules/dcql/models/DcqlCredentialsForRequest.js.map +1 -0
  22. package/build/modules/dcql/models/index.d.ts +20 -0
  23. package/build/modules/dcql/models/index.js +18 -0
  24. package/build/modules/dcql/models/index.js.map +1 -0
  25. package/build/modules/dcql/utils/DcqlPresentationsToCreate.d.ts +31 -0
  26. package/build/modules/dcql/utils/DcqlPresentationsToCreate.js +36 -0
  27. package/build/modules/dcql/utils/DcqlPresentationsToCreate.js.map +1 -0
  28. package/build/modules/dcql/utils/index.d.ts +1 -0
  29. package/build/modules/dcql/utils/index.js +18 -0
  30. package/build/modules/dcql/utils/index.js.map +1 -0
  31. package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.d.ts +1 -1
  32. package/build/modules/dif-presentation-exchange/DifPresentationExchangeService.js +1 -1
  33. package/build/modules/dif-presentation-exchange/models/DifPexCredentialsForRequest.d.ts +2 -2
  34. package/build/modules/dif-presentation-exchange/models/index.d.ts +1 -1
  35. package/build/modules/dif-presentation-exchange/models/index.js +1 -1
  36. package/build/modules/dif-presentation-exchange/utils/credentialSelection.d.ts +1 -1
  37. package/build/modules/dif-presentation-exchange/utils/credentialSelection.js +84 -96
  38. package/build/modules/dif-presentation-exchange/utils/credentialSelection.js.map +1 -1
  39. package/build/modules/dif-presentation-exchange/utils/presentationSelection.js +3 -6
  40. package/build/modules/dif-presentation-exchange/utils/presentationSelection.js.map +1 -1
  41. package/build/modules/dif-presentation-exchange/utils/transform.d.ts +4 -2
  42. package/build/modules/dif-presentation-exchange/utils/transform.js +2 -16
  43. package/build/modules/dif-presentation-exchange/utils/transform.js.map +1 -1
  44. package/build/modules/mdoc/Mdoc.d.ts +12 -3
  45. package/build/modules/mdoc/Mdoc.js +13 -0
  46. package/build/modules/mdoc/Mdoc.js.map +1 -1
  47. package/build/modules/mdoc/MdocDeviceResponse.d.ts +14 -1
  48. package/build/modules/mdoc/MdocDeviceResponse.js +31 -4
  49. package/build/modules/mdoc/MdocDeviceResponse.js.map +1 -1
  50. package/build/modules/mdoc/MdocOptions.d.ts +15 -3
  51. package/build/modules/mdoc/mdocUtil.d.ts +1 -0
  52. package/build/modules/mdoc/mdocUtil.js +7 -0
  53. package/build/modules/mdoc/mdocUtil.js.map +1 -0
  54. package/build/modules/mdoc/repository/MdocRecord.d.ts +8 -0
  55. package/build/modules/mdoc/repository/MdocRecord.js +12 -0
  56. package/build/modules/mdoc/repository/MdocRecord.js.map +1 -1
  57. package/build/modules/sd-jwt-vc/SdJwtVcApi.d.ts +2 -0
  58. package/build/modules/sd-jwt-vc/SdJwtVcService.d.ts +11 -0
  59. package/build/modules/sd-jwt-vc/SdJwtVcService.js +5 -0
  60. package/build/modules/sd-jwt-vc/SdJwtVcService.js.map +1 -1
  61. package/build/modules/sd-jwt-vc/decodeSdJwtVc.d.ts +2 -7
  62. package/build/modules/sd-jwt-vc/decodeSdJwtVc.js +3 -0
  63. package/build/modules/sd-jwt-vc/decodeSdJwtVc.js.map +1 -1
  64. package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.d.ts +8 -1
  65. package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.js +10 -1
  66. package/build/modules/sd-jwt-vc/repository/SdJwtVcRecord.js.map +1 -1
  67. package/build/modules/vc/repository/W3cCredentialRecord.d.ts +4 -0
  68. package/build/modules/vc/repository/W3cCredentialRecord.js +6 -0
  69. package/build/modules/vc/repository/W3cCredentialRecord.js.map +1 -1
  70. package/package.json +4 -4
@@ -5,6 +5,7 @@ import { BasicMessagesModule } from '../modules/basic-messages';
5
5
  import { CacheModule } from '../modules/cache';
6
6
  import { ConnectionsModule } from '../modules/connections';
7
7
  import { CredentialsModule } from '../modules/credentials';
8
+ import { DcqlModule } from '../modules/dcql';
8
9
  import { DidsModule } from '../modules/dids';
9
10
  import { DifPresentationExchangeModule } from '../modules/dif-presentation-exchange';
10
11
  import { DiscoverFeaturesModule } from '../modules/discover-features';
@@ -111,6 +112,7 @@ declare function getDefaultAgentModules(): {
111
112
  readonly w3cCredentials: () => W3cCredentialsModule;
112
113
  readonly cache: () => CacheModule;
113
114
  readonly pex: () => DifPresentationExchangeModule;
115
+ readonly dcql: () => DcqlModule;
114
116
  readonly sdJwtVc: () => SdJwtVcModule;
115
117
  readonly x509: () => X509Module;
116
118
  readonly mdoc: () => MdocModule;
@@ -6,6 +6,7 @@ const basic_messages_1 = require("../modules/basic-messages");
6
6
  const cache_1 = require("../modules/cache");
7
7
  const connections_1 = require("../modules/connections");
8
8
  const credentials_1 = require("../modules/credentials");
9
+ const dcql_1 = require("../modules/dcql");
9
10
  const dids_1 = require("../modules/dids");
10
11
  const dif_presentation_exchange_1 = require("../modules/dif-presentation-exchange");
11
12
  const discover_features_1 = require("../modules/discover-features");
@@ -40,6 +41,7 @@ function getDefaultAgentModules() {
40
41
  w3cCredentials: () => new vc_1.W3cCredentialsModule(),
41
42
  cache: () => new cache_1.CacheModule(),
42
43
  pex: () => new dif_presentation_exchange_1.DifPresentationExchangeModule(),
44
+ dcql: () => new dcql_1.DcqlModule(),
43
45
  sdJwtVc: () => new sd_jwt_vc_1.SdJwtVcModule(),
44
46
  x509: () => new x509_1.X509Module(),
45
47
  mdoc: () => new MdocModule_1.MdocModule(),
@@ -1 +1 @@
1
- {"version":3,"file":"AgentModules.js","sourceRoot":"","sources":["../../src/agent/AgentModules.ts"],"names":[],"mappings":";;AAsJA,0EAeC;AAoCD,kCAkBC;AAvND,8DAA+D;AAC/D,4CAA8C;AAC9C,wDAA0D;AAC1D,wDAA0D;AAC1D,0CAA4C;AAC5C,oFAAoF;AACpF,oEAAqE;AACrE,gEAAiE;AACjE,2DAAuD;AACvD,8DAA+D;AAC/D,wCAAgD;AAChD,8CAAgD;AAChD,gDAA6E;AAC7E,oDAAoD;AACpD,sCAAoD;AACpD,0CAA4C;AAC5C,sCAAwC;AAiGxC;;;GAGG;AACH,SAAS,sBAAsB;IAC7B,OAAO;QACL,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,+BAAiB,EAAE;QAC1C,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,+BAAiB,EAAE;QAC1C,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,qBAAY,EAAE;QAChC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,wBAAc,EAAE;QACpC,kBAAkB,EAAE,GAAG,EAAE,CAAC,IAAI,kCAAwB,EAAE;QACxD,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,oCAAmB,EAAE;QAC9C,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,oCAAmB,EAAE;QAC9C,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI,sCAAoB,EAAE;QAChD,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,0CAAsB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AgB,WAAW,CACzB,iBAAoC,EACpC,eAA0B,EAAE;IAE5B,yFAAyF;IACzF,oCAAoC;IACpC,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE;QAClG,oBAAoB;QACpB,IAAI,CAAC,MAAM,CAAC,GAAG;YAAE,OAAO,GAAG,CAAA;QAE3B,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEzD,kBAAkB;QAClB,IAAI,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC;YAAE,OAAO,GAAG,CAAA;QAClD,uCAAY,GAAG,KAAE,CAAC,SAAS,CAAC,EAAE,WAAW,IAAE;IAC7C,CAAC,EAAE,EAAE,CAA2B,CAAA;IAEhC,OAAO,GAAG,CAAA;AACZ,CAAC"}
package/build/index.d.ts CHANGED
@@ -51,6 +51,7 @@ export * from './modules/cache';
51
51
  export * from './modules/dif-presentation-exchange';
52
52
  export * from './modules/sd-jwt-vc';
53
53
  export * from './modules/mdoc';
54
+ export * from './modules/dcql';
54
55
  export { JsonEncoder, JsonTransformer, isJsonObject, isValidJweStructure, TypedArrayEncoder, Buffer, deepEquality, isDid, asArray, equalsIgnoreOrder, DateTransformer, } from './utils';
55
56
  export * from './logger';
56
57
  export * from './error';
package/build/index.js CHANGED
@@ -87,6 +87,7 @@ __exportStar(require("./modules/cache"), exports);
87
87
  __exportStar(require("./modules/dif-presentation-exchange"), exports);
88
88
  __exportStar(require("./modules/sd-jwt-vc"), exports);
89
89
  __exportStar(require("./modules/mdoc"), exports);
90
+ __exportStar(require("./modules/dcql"), exports);
90
91
  var utils_1 = require("./utils");
91
92
  Object.defineProperty(exports, "JsonEncoder", { enumerable: true, get: function () { return utils_1.JsonEncoder; } });
92
93
  Object.defineProperty(exports, "JsonTransformer", { enumerable: true, get: function () { return utils_1.JsonTransformer; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gEAAgE;AAChE,4BAAyB;AAEzB,2DAAyD;AAAhD,kHAAA,eAAe,OAAA;AACxB,uCAAqC;AAA5B,8FAAA,KAAK,OAAA;AACd,+CAA6C;AAApC,sGAAA,SAAS,OAAA;AAClB,0CAAuB;AAEvB,qDAAmD;AAA1C,4GAAA,YAAY,OAAA;AACrB,2DAAyD;AAAhD,kHAAA,eAAe,OAAA;AAExB,yEAAuE;AAA9D,gIAAA,sBAAsB,OAAA;AAC/B,iDAA8B;AAC9B,mDAAiD;AAAxC,0GAAA,WAAW,OAAA;AACpB,qDAAmD;AAA1C,4GAAA,YAAY,OAAA;AACrB,iDAA+C;AAAtC,wGAAA,UAAU,OAAA;AACnB,uDAAqD;AAA5C,8GAAA,aAAa,OAAA;AAEtB,+EAA6E;AAApE,sIAAA,yBAAyB,OAAA;AAalC,iCAA8D;AAArD,wGAAA,eAAe,OAAA;AAAE,4GAAA,mBAAmB,OAAA;AAE7C,uDAAoC;AACpC,6CAAsG;AAA7F,+GAAA,oBAAoB,OAAA;AAAE,6GAAA,kBAAkB,OAAA;AAAE,mHAAA,wBAAwB,OAAA;AAC3E,mDAAiD;AAAxC,wGAAA,UAAU,OAAA;AACnB,6DAA0C;AAE1C,sDAAmC;AACnC,qCAA+D;AAAtD,0GAAA,kBAAkB,OAAA;AAAE,oGAAA,YAAY,OAAA;AACzC,yCAA8C;AAArC,6GAAA,gBAAgB,OAAA;AACzB,2CAAwB;AAExB,6DAA2D;AAAlD,oHAAA,gBAAgB,OAAA;AACzB,iEAA+E;AAAtE,wGAAA,UAAU,OAAA;AAAE,4GAAA,cAAc,OAAA;AACnC,0EAAiG;AAAxF,oHAAA,gBAAgB,OAAA;AACzB,gFAA4E;AAAnE,sHAAA,gBAAgB,OAAA;AAEzB,4CAAyB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AAiC;AACjC,gDAA6B;AAC7B,iDAA8B;AAC9B,+CAA4B;AAC5B,kDAA+B;AAC/B,sEAAmD;AACnD,sDAAmC;AACnC,iDAA8B;AAC9B,iDAA8B;AAC9B,iCAYgB;AAXd,oGAAA,WAAW,OAAA;AACX,wGAAA,eAAe,OAAA;AACf,qGAAA,YAAY,OAAA;AACZ,4GAAA,mBAAmB,OAAA;AACnB,0GAAA,iBAAiB,OAAA;AACjB,+FAAA,MAAM,OAAA;AACN,qGAAA,YAAY,OAAA;AACZ,8FAAA,KAAK,OAAA;AACL,gGAAA,OAAO,OAAA;AACP,0GAAA,iBAAiB,OAAA;AACjB,wGAAA,eAAe,OAAA;AAEjB,2CAAwB;AACxB,0CAAuB;AACvB,iDAA8B;AAE9B,mDAK4B;AAH1B,+GAAA,gBAAgB,OAAA;AAChB,iHAAA,kBAAkB,OAAA;AAClB,wHAAA,yBAAyB,OAAA;AAG3B,iDAA8B;AAC9B,2CAAwB;AAExB,8BAA8B;AAC9B,iDAAyE;AAAhE,8GAAA,gBAAgB,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AAE7C,6DAA2D;AAAlD,oHAAA,gBAAgB,OAAA;AACzB,6DAAoF;AAA3E,oHAAA,gBAAgB,OAAA;AACzB,yCAAiD;AAAxC,0GAAA,gBAAgB,OAAA;AACzB,6DAA4D;AAC5D,uCAAgD;AAEhD,MAAM,KAAK,GAAG;IACZ,IAAI,EAAJ,WAAI;IACJ,WAAW,EAAX,kBAAW;IACX,kBAAkB,EAAlB,oCAAkB;CACnB,CAAA;AAEQ,sBAAK"}
@@ -0,0 +1,8 @@
1
+ import { CredoError } from '../../error';
2
+ export declare class DcqlError extends CredoError {
3
+ additionalMessages?: Array<string>;
4
+ constructor(message: string, { cause, additionalMessages }?: {
5
+ cause?: Error;
6
+ additionalMessages?: Array<string>;
7
+ });
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DcqlError = void 0;
4
+ const error_1 = require("../../error");
5
+ class DcqlError extends error_1.CredoError {
6
+ constructor(message, { cause, additionalMessages } = {}) {
7
+ super(message, { cause });
8
+ this.additionalMessages = additionalMessages;
9
+ }
10
+ }
11
+ exports.DcqlError = DcqlError;
12
+ //# sourceMappingURL=DcqlError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DcqlError.js","sourceRoot":"","sources":["../../../src/modules/dcql/DcqlError.ts"],"names":[],"mappings":";;;AAAA,uCAAwC;AAExC,MAAa,SAAU,SAAQ,kBAAU;IAGvC,YACE,OAAe,EACf,EAAE,KAAK,EAAE,kBAAkB,KAA4D,EAAE;QAEzF,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;QACzB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;IAC9C,CAAC;CACF;AAVD,8BAUC"}
@@ -0,0 +1,10 @@
1
+ import type { DependencyManager, Module } from '../../plugins';
2
+ /**
3
+ * @public
4
+ */
5
+ export declare class DcqlModule implements Module {
6
+ /**
7
+ * Registers the dependencies of the presentation-exchange module on the dependency manager.
8
+ */
9
+ register(dependencyManager: DependencyManager): void;
10
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DcqlModule = void 0;
4
+ const AgentConfig_1 = require("../../agent/AgentConfig");
5
+ const DcqlService_1 = require("./DcqlService");
6
+ /**
7
+ * @public
8
+ */
9
+ class DcqlModule {
10
+ /**
11
+ * Registers the dependencies of the presentation-exchange module on the dependency manager.
12
+ */
13
+ register(dependencyManager) {
14
+ // Warn about experimental module
15
+ dependencyManager
16
+ .resolve(AgentConfig_1.AgentConfig)
17
+ .logger.warn("The 'DcqlModule' module is experimental and could have unexpected breaking changes. When using this module, make sure to use strict versions for all @credo-ts packages.");
18
+ // service
19
+ dependencyManager.registerSingleton(DcqlService_1.DcqlService);
20
+ }
21
+ }
22
+ exports.DcqlModule = DcqlModule;
23
+ //# sourceMappingURL=DcqlModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DcqlModule.js","sourceRoot":"","sources":["../../../src/modules/dcql/DcqlModule.ts"],"names":[],"mappings":";;;AAEA,yDAAqD;AAErD,+CAA2C;AAE3C;;GAEG;AACH,MAAa,UAAU;IACrB;;OAEG;IACI,QAAQ,CAAC,iBAAoC;QAClD,iCAAiC;QACjC,iBAAiB;aACd,OAAO,CAAC,yBAAW,CAAC;aACpB,MAAM,CAAC,IAAI,CACV,0KAA0K,CAC3K,CAAA;QAEH,UAAU;QACV,iBAAiB,CAAC,iBAAiB,CAAC,yBAAW,CAAC,CAAA;IAClD,CAAC;CACF;AAfD,gCAeC"}
@@ -0,0 +1,140 @@
1
+ import type { AgentContext } from '../../agent';
2
+ import { DcqlQuery } from 'dcql';
3
+ import { MdocOpenId4VpSessionTranscriptOptions } from '../mdoc';
4
+ import { DcqlQueryResult, DcqlCredentialsForRequest, DcqlPresentation as DcqlPresentation, DcqlEncodedPresentations } from './models';
5
+ /**
6
+ * @todo create a public api for using dif presentation exchange
7
+ */
8
+ export declare class DcqlService {
9
+ /**
10
+ * Queries the wallet for credentials that match the given presentation definition. This only does an initial query based on the
11
+ * schema of the input descriptors. It does not do any further filtering based on the constraints in the input descriptors.
12
+ */
13
+ private queryCredentialsForDcqlQuery;
14
+ getCredentialsForRequest(agentContext: AgentContext, dcqlQuery: DcqlQuery.Input): Promise<DcqlQueryResult>;
15
+ /**
16
+ * Selects the credentials to use based on the output from `getCredentialsForRequest`
17
+ * Use this method if you don't want to manually select the credentials yourself.
18
+ */
19
+ selectCredentialsForRequest(dcqlQueryResult: DcqlQueryResult): DcqlCredentialsForRequest;
20
+ validateDcqlQuery(dcqlQuery: DcqlQuery.Input | DcqlQuery): {
21
+ credentials: [{
22
+ id: string;
23
+ format: "mso_mdoc";
24
+ claims?: [{
25
+ namespace: string;
26
+ claim_name: string;
27
+ values?: (string | number | boolean)[] | undefined;
28
+ id?: string | undefined;
29
+ }, ...{
30
+ namespace: string;
31
+ claim_name: string;
32
+ values?: (string | number | boolean)[] | undefined;
33
+ id?: string | undefined;
34
+ }[]] | undefined;
35
+ claim_sets?: [string[], ...string[][]] | undefined;
36
+ meta?: {
37
+ doctype_value?: string | undefined;
38
+ } | undefined;
39
+ } | {
40
+ id: string;
41
+ format: "vc+sd-jwt";
42
+ claims?: [{
43
+ path: (string | number | null)[];
44
+ values?: (string | number | boolean)[] | undefined;
45
+ id?: string | undefined;
46
+ }, ...{
47
+ path: (string | number | null)[];
48
+ values?: (string | number | boolean)[] | undefined;
49
+ id?: string | undefined;
50
+ }[]] | undefined;
51
+ claim_sets?: [string[], ...string[][]] | undefined;
52
+ meta?: {
53
+ vct_values?: string[] | undefined;
54
+ } | undefined;
55
+ } | {
56
+ id: string;
57
+ format: "jwt_vc_json" | "jwt_vc_json-ld";
58
+ claims?: [{
59
+ path: (string | number | null)[];
60
+ values?: (string | number | boolean)[] | undefined;
61
+ id?: string | undefined;
62
+ }, ...{
63
+ path: (string | number | null)[];
64
+ values?: (string | number | boolean)[] | undefined;
65
+ id?: string | undefined;
66
+ }[]] | undefined;
67
+ claim_sets?: [string[], ...string[][]] | undefined;
68
+ }, ...({
69
+ id: string;
70
+ format: "mso_mdoc";
71
+ claims?: [{
72
+ namespace: string;
73
+ claim_name: string;
74
+ values?: (string | number | boolean)[] | undefined;
75
+ id?: string | undefined;
76
+ }, ...{
77
+ namespace: string;
78
+ claim_name: string;
79
+ values?: (string | number | boolean)[] | undefined;
80
+ id?: string | undefined;
81
+ }[]] | undefined;
82
+ claim_sets?: [string[], ...string[][]] | undefined;
83
+ meta?: {
84
+ doctype_value?: string | undefined;
85
+ } | undefined;
86
+ } | {
87
+ id: string;
88
+ format: "vc+sd-jwt";
89
+ claims?: [{
90
+ path: (string | number | null)[];
91
+ values?: (string | number | boolean)[] | undefined;
92
+ id?: string | undefined;
93
+ }, ...{
94
+ path: (string | number | null)[];
95
+ values?: (string | number | boolean)[] | undefined;
96
+ id?: string | undefined;
97
+ }[]] | undefined;
98
+ claim_sets?: [string[], ...string[][]] | undefined;
99
+ meta?: {
100
+ vct_values?: string[] | undefined;
101
+ } | undefined;
102
+ } | {
103
+ id: string;
104
+ format: "jwt_vc_json" | "jwt_vc_json-ld";
105
+ claims?: [{
106
+ path: (string | number | null)[];
107
+ values?: (string | number | boolean)[] | undefined;
108
+ id?: string | undefined;
109
+ }, ...{
110
+ path: (string | number | null)[];
111
+ values?: (string | number | boolean)[] | undefined;
112
+ id?: string | undefined;
113
+ }[]] | undefined;
114
+ claim_sets?: [string[], ...string[][]] | undefined;
115
+ })[]];
116
+ credential_sets?: [{
117
+ options: [string[], ...string[][]];
118
+ required: boolean;
119
+ purpose?: string | number | {
120
+ [x: string]: unknown;
121
+ } | undefined;
122
+ }, ...{
123
+ options: [string[], ...string[][]];
124
+ required: boolean;
125
+ purpose?: string | number | {
126
+ [x: string]: unknown;
127
+ } | undefined;
128
+ }[]] | undefined;
129
+ };
130
+ private createPresentationFrame;
131
+ createPresentation(agentContext: AgentContext, options: {
132
+ credentialQueryToCredential: DcqlCredentialsForRequest;
133
+ challenge: string;
134
+ domain?: string;
135
+ openid4vp?: Omit<MdocOpenId4VpSessionTranscriptOptions, 'verifierGeneratedNonce' | 'clientId'>;
136
+ }): Promise<DcqlPresentation>;
137
+ getEncodedPresentations(dcqlPresentation: DcqlPresentation): DcqlEncodedPresentations;
138
+ private getSdJwtVcApi;
139
+ private getMdocApi;
140
+ }
@@ -0,0 +1,253 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.DcqlService = void 0;
10
+ const dcql_1 = require("dcql");
11
+ const tsyringe_1 = require("tsyringe");
12
+ const mdoc_1 = require("../mdoc");
13
+ const sd_jwt_vc_1 = require("../sd-jwt-vc");
14
+ const vc_1 = require("../vc");
15
+ const DcqlError_1 = require("./DcqlError");
16
+ const utils_1 = require("./utils");
17
+ /**
18
+ * @todo create a public api for using dif presentation exchange
19
+ */
20
+ let DcqlService = class DcqlService {
21
+ /**
22
+ * Queries the wallet for credentials that match the given presentation definition. This only does an initial query based on the
23
+ * schema of the input descriptors. It does not do any further filtering based on the constraints in the input descriptors.
24
+ */
25
+ async queryCredentialsForDcqlQuery(agentContext, dcqlQuery) {
26
+ const w3cCredentialRepository = agentContext.dependencyManager.resolve(vc_1.W3cCredentialRepository);
27
+ const formats = new Set(dcqlQuery.credentials.map((c) => c.format));
28
+ for (const format of formats) {
29
+ if (format !== 'vc+sd-jwt' && format !== 'jwt_vc_json' && format !== 'jwt_vc_json-ld' && format !== 'mso_mdoc') {
30
+ throw new DcqlError_1.DcqlError(`Unsupported credential format ${format}.`);
31
+ }
32
+ }
33
+ const allRecords = [];
34
+ const w3cCredentialRecords = formats.has('jwt_vc_json') || formats.has('jwt_vc_json-ld')
35
+ ? await w3cCredentialRepository.getAll(agentContext)
36
+ : [];
37
+ allRecords.push(...w3cCredentialRecords);
38
+ // query the wallet ourselves first to avoid the need to query the pex library for all
39
+ // credentials for every proof request
40
+ const mdocDoctypes = dcqlQuery.credentials
41
+ .filter((credentialQuery) => credentialQuery.format === 'mso_mdoc')
42
+ .map((c) => { var _a; return (_a = c.meta) === null || _a === void 0 ? void 0 : _a.doctype_value; });
43
+ const allMdocCredentialQueriesSpecifyDoctype = mdocDoctypes.every((doctype) => doctype);
44
+ const mdocApi = this.getMdocApi(agentContext);
45
+ if (allMdocCredentialQueriesSpecifyDoctype) {
46
+ const mdocRecords = await mdocApi.findAllByQuery({
47
+ $or: mdocDoctypes.map((docType) => ({
48
+ docType: docType,
49
+ })),
50
+ });
51
+ allRecords.push(...mdocRecords);
52
+ }
53
+ else {
54
+ const mdocRecords = await mdocApi.getAll();
55
+ allRecords.push(...mdocRecords);
56
+ }
57
+ // query the wallet ourselves first to avoid the need to query the pex library for all
58
+ // credentials for every proof request
59
+ const sdJwtVctValues = dcqlQuery.credentials
60
+ .filter((credentialQuery) => credentialQuery.format === 'vc+sd-jwt')
61
+ .flatMap((c) => { var _a; return (_a = c.meta) === null || _a === void 0 ? void 0 : _a.vct_values; });
62
+ const allSdJwtVcQueriesSpecifyDoctype = sdJwtVctValues.every((vct) => vct);
63
+ const sdJwtVcApi = this.getSdJwtVcApi(agentContext);
64
+ if (allSdJwtVcQueriesSpecifyDoctype) {
65
+ const sdjwtVcRecords = await sdJwtVcApi.findAllByQuery({
66
+ $or: sdJwtVctValues.map((vct) => ({
67
+ vct: vct,
68
+ })),
69
+ });
70
+ allRecords.push(...sdjwtVcRecords);
71
+ }
72
+ else {
73
+ const sdJwtVcRecords = await sdJwtVcApi.getAll();
74
+ allRecords.push(...sdJwtVcRecords);
75
+ }
76
+ return allRecords;
77
+ }
78
+ async getCredentialsForRequest(agentContext, dcqlQuery) {
79
+ const credentialRecords = await this.queryCredentialsForDcqlQuery(agentContext, dcqlQuery);
80
+ const dcqlCredentials = credentialRecords.map((record) => {
81
+ if (record.type === 'MdocRecord') {
82
+ return {
83
+ credentialFormat: 'mso_mdoc',
84
+ doctype: record.getTags().docType,
85
+ namespaces: mdoc_1.Mdoc.fromBase64Url(record.base64Url).issuerSignedNamespaces,
86
+ };
87
+ }
88
+ else if (record.type === 'SdJwtVcRecord') {
89
+ return {
90
+ credentialFormat: 'vc+sd-jwt',
91
+ vct: record.getTags().vct,
92
+ claims: this.getSdJwtVcApi(agentContext).fromCompact(record.compactSdJwtVc)
93
+ .prettyClaims,
94
+ };
95
+ }
96
+ else {
97
+ // TODO:
98
+ throw new DcqlError_1.DcqlError('W3C credentials are not supported yet');
99
+ }
100
+ });
101
+ const queryResult = dcql_1.DcqlQuery.query(dcql_1.DcqlQuery.parse(dcqlQuery), dcqlCredentials);
102
+ const matchesWithRecord = Object.fromEntries(Object.entries(queryResult.credential_matches).map(([credential_query_id, result]) => {
103
+ return [credential_query_id, Object.assign(Object.assign({}, result), { record: credentialRecords[result.credential_index] })];
104
+ }));
105
+ return Object.assign(Object.assign({}, queryResult), { credential_matches: matchesWithRecord });
106
+ }
107
+ /**
108
+ * Selects the credentials to use based on the output from `getCredentialsForRequest`
109
+ * Use this method if you don't want to manually select the credentials yourself.
110
+ */
111
+ selectCredentialsForRequest(dcqlQueryResult) {
112
+ if (!dcqlQueryResult.canBeSatisfied) {
113
+ throw new DcqlError_1.DcqlError('Cannot select the credentials for the dcql query presentation if the request cannot be satisfied');
114
+ }
115
+ const credentials = {};
116
+ if (dcqlQueryResult.credential_sets) {
117
+ for (const credentialSet of dcqlQueryResult.credential_sets) {
118
+ // undefined defaults to true
119
+ if (credentialSet.required === false)
120
+ continue;
121
+ const firstFullFillableOption = credentialSet.options.find((option) => option.every((credential_id) => dcqlQueryResult.credential_matches[credential_id].success));
122
+ if (!firstFullFillableOption) {
123
+ throw new DcqlError_1.DcqlError('Invalid dcql query result. No option is fullfillable');
124
+ }
125
+ for (const credentialQueryId of firstFullFillableOption) {
126
+ const credential = dcqlQueryResult.credential_matches[credentialQueryId];
127
+ if (credential.success && credential.record.type === 'MdocRecord' && 'namespaces' in credential.output) {
128
+ credentials[credentialQueryId] = {
129
+ claimFormat: vc_1.ClaimFormat.MsoMdoc,
130
+ credentialRecord: credential.record,
131
+ disclosedPayload: credential.output.namespaces,
132
+ };
133
+ }
134
+ else if (credential.success &&
135
+ credential.record.type === 'SdJwtVcRecord' &&
136
+ 'claims' in credential.output) {
137
+ credentials[credentialQueryId] = {
138
+ claimFormat: vc_1.ClaimFormat.SdJwtVc,
139
+ credentialRecord: credential.record,
140
+ disclosedPayload: credential.output.claims,
141
+ };
142
+ }
143
+ else {
144
+ throw new DcqlError_1.DcqlError('Invalid dcql query result. Cannot auto-select credentials');
145
+ }
146
+ }
147
+ }
148
+ }
149
+ else {
150
+ for (const credentialQuery of dcqlQueryResult.credentials) {
151
+ const credential = dcqlQueryResult.credential_matches[credentialQuery.id];
152
+ if (credential.success && credential.record.type === 'MdocRecord' && 'namespaces' in credential.output) {
153
+ credentials[credentialQuery.id] = {
154
+ claimFormat: vc_1.ClaimFormat.MsoMdoc,
155
+ credentialRecord: credential.record,
156
+ disclosedPayload: credential.output.namespaces,
157
+ };
158
+ }
159
+ else if (credential.success && credential.record.type === 'SdJwtVcRecord' && 'claims' in credential.output) {
160
+ credentials[credentialQuery.id] = {
161
+ claimFormat: vc_1.ClaimFormat.SdJwtVc,
162
+ credentialRecord: credential.record,
163
+ disclosedPayload: credential.output.claims,
164
+ };
165
+ }
166
+ else {
167
+ throw new DcqlError_1.DcqlError('Invalid dcql query result. Cannot auto-select credentials');
168
+ }
169
+ }
170
+ }
171
+ return credentials;
172
+ }
173
+ validateDcqlQuery(dcqlQuery) {
174
+ return dcql_1.DcqlQuery.parse(dcqlQuery);
175
+ }
176
+ // TODO: this IS WRONG
177
+ createPresentationFrame(obj) {
178
+ const frame = {};
179
+ for (const [key, value] of Object.entries(obj)) {
180
+ if (typeof value === 'object' && value !== null) {
181
+ frame[key] = true;
182
+ }
183
+ else {
184
+ frame[key] = !!value;
185
+ }
186
+ }
187
+ return frame;
188
+ }
189
+ async createPresentation(agentContext, options) {
190
+ const { domain, challenge, openid4vp } = options;
191
+ const dcqlPresentation = {};
192
+ const vcPresentationsToCreate = (0, utils_1.dcqlGetPresentationsToCreate)(options.credentialQueryToCredential);
193
+ for (const [credentialQueryId, presentationToCreate] of Object.entries(vcPresentationsToCreate)) {
194
+ if (presentationToCreate.claimFormat === vc_1.ClaimFormat.MsoMdoc) {
195
+ const mdocRecord = presentationToCreate.credentialRecord;
196
+ if (!openid4vp) {
197
+ throw new DcqlError_1.DcqlError('Missing openid4vp options for creating MDOC presentation.');
198
+ }
199
+ if (!domain) {
200
+ throw new DcqlError_1.DcqlError('Missing domain property for creating MDOC presentation.');
201
+ }
202
+ const { deviceResponseBase64Url } = await mdoc_1.MdocDeviceResponse.createOpenId4VpDcqlDeviceResponse(agentContext, {
203
+ mdoc: mdoc_1.Mdoc.fromBase64Url(mdocRecord.base64Url),
204
+ docRequest: {
205
+ itemsRequestData: {
206
+ docType: mdocRecord.getTags().docType,
207
+ nameSpaces: Object.fromEntries(Object.entries(presentationToCreate.disclosedPayload).map(([key, value]) => {
208
+ return [key, Object.fromEntries(Object.entries(value).map(([key]) => [key, true]))];
209
+ })),
210
+ },
211
+ },
212
+ sessionTranscriptOptions: Object.assign(Object.assign({}, openid4vp), { clientId: domain, verifierGeneratedNonce: challenge }),
213
+ });
214
+ dcqlPresentation[credentialQueryId] = mdoc_1.MdocDeviceResponse.fromBase64Url(deviceResponseBase64Url);
215
+ }
216
+ else if (presentationToCreate.claimFormat === vc_1.ClaimFormat.SdJwtVc) {
217
+ const presentationFrame = this.createPresentationFrame(presentationToCreate.disclosedPayload);
218
+ if (!domain) {
219
+ throw new DcqlError_1.DcqlError('Missing domain property for creating SdJwtVc presentation.');
220
+ }
221
+ const sdJwtVcApi = this.getSdJwtVcApi(agentContext);
222
+ const presentation = await sdJwtVcApi.present({
223
+ compactSdJwtVc: presentationToCreate.credentialRecord.compactSdJwtVc,
224
+ presentationFrame,
225
+ verifierMetadata: {
226
+ audience: domain,
227
+ nonce: challenge,
228
+ issuedAt: Math.floor(Date.now() / 1000),
229
+ },
230
+ });
231
+ dcqlPresentation[credentialQueryId] = sdJwtVcApi.fromCompact(presentation);
232
+ }
233
+ else {
234
+ throw new DcqlError_1.DcqlError('W3c Presentation are not yet supported in combination with DCQL.');
235
+ }
236
+ }
237
+ return dcqlPresentation;
238
+ }
239
+ getEncodedPresentations(dcqlPresentation) {
240
+ return Object.fromEntries(Object.entries(dcqlPresentation).map(([key, value]) => [key, value.encoded]));
241
+ }
242
+ getSdJwtVcApi(agentContext) {
243
+ return agentContext.dependencyManager.resolve(sd_jwt_vc_1.SdJwtVcApi);
244
+ }
245
+ getMdocApi(agentContext) {
246
+ return agentContext.dependencyManager.resolve(mdoc_1.MdocApi);
247
+ }
248
+ };
249
+ exports.DcqlService = DcqlService;
250
+ exports.DcqlService = DcqlService = __decorate([
251
+ (0, tsyringe_1.injectable)()
252
+ ], DcqlService);
253
+ //# sourceMappingURL=DcqlService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DcqlService.js","sourceRoot":"","sources":["../../../src/modules/dcql/DcqlService.ts"],"names":[],"mappings":";;;;;;;;;AAEA,+BAA2F;AAC3F,uCAAqC;AAGrC,kCAA8G;AAC9G,4CAA4E;AAC5E,8BAAiF;AAEjF,2CAAuC;AAOvC,mCAAwF;AAExF;;GAEG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB;;;OAGG;IACK,KAAK,CAAC,4BAA4B,CACxC,YAA0B,EAC1B,SAA0B;QAE1B,MAAM,uBAAuB,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,4BAAuB,CAAC,CAAA;QAE/F,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;QACnE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,MAAM,KAAK,WAAW,IAAI,MAAM,KAAK,aAAa,IAAI,MAAM,KAAK,gBAAgB,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;gBAC/G,MAAM,IAAI,qBAAS,CAAC,iCAAiC,MAAM,GAAG,CAAC,CAAA;YACjE,CAAC;QACH,CAAC;QAED,MAAM,UAAU,GAA4D,EAAE,CAAA;QAE9E,MAAM,oBAAoB,GACxB,OAAO,CA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CAAC,CAAA;gBAEF,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;YAC5E,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,qBAAS,CAAC,kEAAkE,CAAC,CAAA;YACzF,CAAC;QACH,CAAC;QAED,OAAO,gBAAgB,CAAA;IACzB,CAAC;IAEM,uBAAuB,CAAC,gBAAkC;QAC/D,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACzG,CAAC;IAEO,aAAa,CAAC,YAA0B;QAC9C,OAAO,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,sBAAU,CAAC,CAAA;IAC3D,CAAC;IAEO,UAAU,CAAC,YAA0B;QAC3C,OAAO,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,cAAO,CAAC,CAAA;IACxD,CAAC;CACF,CAAA;AA5RY,kCAAW;sBAAX,WAAW;IADvB,IAAA,qBAAU,GAAE;GACA,WAAW,CA4RvB"}
@@ -0,0 +1,5 @@
1
+ export * from './DcqlError';
2
+ export * from './DcqlModule';
3
+ export * from './DcqlService';
4
+ export * from './utils';
5
+ export * from './models';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./DcqlError"), exports);
18
+ __exportStar(require("./DcqlModule"), exports);
19
+ __exportStar(require("./DcqlService"), exports);
20
+ __exportStar(require("./utils"), exports);
21
+ __exportStar(require("./models"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/dcql/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,+CAA4B;AAC5B,gDAA6B;AAC7B,0CAAuB;AACvB,2CAAwB"}
@@ -0,0 +1,20 @@
1
+ import type { JsonObject } from '../../../types';
2
+ import type { MdocNameSpaces, MdocRecord } from '../../mdoc';
3
+ import type { SdJwtVcRecord } from '../../sd-jwt-vc';
4
+ import type { ClaimFormat, W3cCredentialRecord } from '../../vc';
5
+ /**
6
+ * Mapping of credential query IDs to the selected credential record and the disclosed payload.
7
+ */
8
+ export type DcqlCredentialsForRequest = Record<string, {
9
+ claimFormat: ClaimFormat.MsoMdoc;
10
+ credentialRecord: MdocRecord;
11
+ disclosedPayload: MdocNameSpaces;
12
+ } | {
13
+ claimFormat: ClaimFormat.SdJwtVc;
14
+ credentialRecord: SdJwtVcRecord;
15
+ disclosedPayload: JsonObject;
16
+ } | {
17
+ claimFormat: ClaimFormat.JwtVc | ClaimFormat.LdpVc;
18
+ credentialRecord: W3cCredentialRecord;
19
+ disclosedPayload: JsonObject;
20
+ }>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DcqlCredentialsForRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DcqlCredentialsForRequest.js","sourceRoot":"","sources":["../../../../src/modules/dcql/models/DcqlCredentialsForRequest.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ export * from './DcqlCredentialsForRequest';
2
+ import type { VerifiablePresentation } from '../../dif-presentation-exchange';
3
+ import type { MdocRecord } from '../../mdoc';
4
+ import type { SdJwtVcRecord } from '../../sd-jwt-vc';
5
+ import type { W3cCredentialRecord } from '../../vc';
6
+ import type { DcqlQueryResult as _DcqlQueryResult, DcqlQuery as _DcqlQuery, DcqlCredential as _DcqlCredential, DcqlMdocCredential as _DcqlMdocCredential, DcqlW3cVcCredential as _DcqlW3cVcCredential, DcqlSdJwtVcCredential as _DcqlSdJwtVcCredential, DcqlPresentation as _DcqlPresentation, DcqlPresentationResult as _DcqlPresentationResult } from 'dcql';
7
+ export type DcqlQuery = _DcqlQuery.Input;
8
+ export type DcqlCredential = _DcqlCredential.Model['Input'];
9
+ export type DcqlMdocCredential = _DcqlMdocCredential.Model['Input'];
10
+ export type DcqlSdJwtVcCredential = _DcqlSdJwtVcCredential.Model['Input'];
11
+ export type DcqlW3cVcCredential = _DcqlW3cVcCredential.Model['Input'];
12
+ export type DcqlMatchWithRecord = {
13
+ record: W3cCredentialRecord | SdJwtVcRecord | MdocRecord;
14
+ } & _DcqlQueryResult['credential_matches'][number];
15
+ export type DcqlQueryResult = Omit<_DcqlQueryResult.Input, 'credential_matches'> & {
16
+ credential_matches: Record<string, DcqlMatchWithRecord>;
17
+ };
18
+ export type DcqlEncodedPresentations = _DcqlPresentation.Input;
19
+ export type DcqlPresentation = Record<string, VerifiablePresentation>;
20
+ export type DcqlPresentationResult = _DcqlPresentationResult.Input;