dcql 0.2.18 → 0.2.19

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 (109) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +131 -0
  3. package/dist/index.d.mts +2885 -0
  4. package/dist/index.d.ts +2885 -0
  5. package/dist/index.js +1014 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.mjs +951 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/package.json +18 -23
  10. package/dist/src/dcql-error/e-base.d.ts +0 -15
  11. package/dist/src/dcql-error/e-base.d.ts.map +0 -1
  12. package/dist/src/dcql-error/e-base.js +0 -78
  13. package/dist/src/dcql-error/e-base.js.map +0 -1
  14. package/dist/src/dcql-error/e-dcql.d.ts +0 -50
  15. package/dist/src/dcql-error/e-dcql.d.ts.map +0 -1
  16. package/dist/src/dcql-error/e-dcql.js +0 -53
  17. package/dist/src/dcql-error/e-dcql.js.map +0 -1
  18. package/dist/src/dcql-error/index.d.ts +0 -3
  19. package/dist/src/dcql-error/index.d.ts.map +0 -1
  20. package/dist/src/dcql-error/index.js +0 -23
  21. package/dist/src/dcql-error/index.js.map +0 -1
  22. package/dist/src/dcql-parser/claims-path.test.d.ts +0 -2
  23. package/dist/src/dcql-parser/claims-path.test.d.ts.map +0 -1
  24. package/dist/src/dcql-parser/claims-path.test.js +0 -103
  25. package/dist/src/dcql-parser/claims-path.test.js.map +0 -1
  26. package/dist/src/dcql-parser/dcql-claims-query-result.d.ts +0 -25
  27. package/dist/src/dcql-parser/dcql-claims-query-result.d.ts.map +0 -1
  28. package/dist/src/dcql-parser/dcql-claims-query-result.js +0 -179
  29. package/dist/src/dcql-parser/dcql-claims-query-result.js.map +0 -1
  30. package/dist/src/dcql-parser/dcql-credential-query-result.d.ts +0 -8
  31. package/dist/src/dcql-parser/dcql-credential-query-result.d.ts.map +0 -1
  32. package/dist/src/dcql-parser/dcql-credential-query-result.js +0 -65
  33. package/dist/src/dcql-parser/dcql-credential-query-result.js.map +0 -1
  34. package/dist/src/dcql-presentation/index.d.ts +0 -4
  35. package/dist/src/dcql-presentation/index.d.ts.map +0 -1
  36. package/dist/src/dcql-presentation/index.js +0 -13
  37. package/dist/src/dcql-presentation/index.js.map +0 -1
  38. package/dist/src/dcql-presentation/m-dcql-credential-presentation.d.ts +0 -59
  39. package/dist/src/dcql-presentation/m-dcql-credential-presentation.d.ts.map +0 -1
  40. package/dist/src/dcql-presentation/m-dcql-credential-presentation.js +0 -55
  41. package/dist/src/dcql-presentation/m-dcql-credential-presentation.js.map +0 -1
  42. package/dist/src/dcql-presentation/m-dcql-presentation-result.d.ts +0 -660
  43. package/dist/src/dcql-presentation/m-dcql-presentation-result.d.ts.map +0 -1
  44. package/dist/src/dcql-presentation/m-dcql-presentation-result.js +0 -132
  45. package/dist/src/dcql-presentation/m-dcql-presentation-result.js.map +0 -1
  46. package/dist/src/dcql-presentation/m-dcql-presentation.d.ts +0 -14
  47. package/dist/src/dcql-presentation/m-dcql-presentation.d.ts.map +0 -1
  48. package/dist/src/dcql-presentation/m-dcql-presentation.js +0 -42
  49. package/dist/src/dcql-presentation/m-dcql-presentation.js.map +0 -1
  50. package/dist/src/dcql-query/dcql-query-complex.test.d.ts +0 -2
  51. package/dist/src/dcql-query/dcql-query-complex.test.d.ts.map +0 -1
  52. package/dist/src/dcql-query/dcql-query-complex.test.js +0 -3204
  53. package/dist/src/dcql-query/dcql-query-complex.test.js.map +0 -1
  54. package/dist/src/dcql-query/dcql-query-with-json-transform.test.d.ts +0 -2
  55. package/dist/src/dcql-query/dcql-query-with-json-transform.test.d.ts.map +0 -1
  56. package/dist/src/dcql-query/dcql-query-with-json-transform.test.js +0 -188
  57. package/dist/src/dcql-query/dcql-query-with-json-transform.test.js.map +0 -1
  58. package/dist/src/dcql-query/dcql-query.test.d.ts +0 -2
  59. package/dist/src/dcql-query/dcql-query.test.d.ts.map +0 -1
  60. package/dist/src/dcql-query/dcql-query.test.js +0 -378
  61. package/dist/src/dcql-query/dcql-query.test.js.map +0 -1
  62. package/dist/src/dcql-query/index.d.ts +0 -5
  63. package/dist/src/dcql-query/index.d.ts.map +0 -1
  64. package/dist/src/dcql-query/index.js +0 -12
  65. package/dist/src/dcql-query/index.js.map +0 -1
  66. package/dist/src/dcql-query/m-dcql-claims-query.d.ts +0 -35
  67. package/dist/src/dcql-query/m-dcql-claims-query.d.ts.map +0 -1
  68. package/dist/src/dcql-query/m-dcql-claims-query.js +0 -57
  69. package/dist/src/dcql-query/m-dcql-claims-query.js.map +0 -1
  70. package/dist/src/dcql-query/m-dcql-credential-query.d.ts +0 -186
  71. package/dist/src/dcql-query/m-dcql-credential-query.d.ts.map +0 -1
  72. package/dist/src/dcql-query/m-dcql-credential-query.js +0 -85
  73. package/dist/src/dcql-query/m-dcql-credential-query.js.map +0 -1
  74. package/dist/src/dcql-query/m-dcql-credential-set-query.d.ts +0 -18
  75. package/dist/src/dcql-query/m-dcql-credential-set-query.d.ts.map +0 -1
  76. package/dist/src/dcql-query/m-dcql-credential-set-query.js +0 -41
  77. package/dist/src/dcql-query/m-dcql-credential-set-query.js.map +0 -1
  78. package/dist/src/dcql-query/m-dcql-query.d.ts +0 -843
  79. package/dist/src/dcql-query/m-dcql-query.d.ts.map +0 -1
  80. package/dist/src/dcql-query/m-dcql-query.js +0 -89
  81. package/dist/src/dcql-query/m-dcql-query.js.map +0 -1
  82. package/dist/src/dcql-query-result/index.d.ts +0 -3
  83. package/dist/src/dcql-query-result/index.d.ts.map +0 -1
  84. package/dist/src/dcql-query-result/index.js +0 -8
  85. package/dist/src/dcql-query-result/index.js.map +0 -1
  86. package/dist/src/dcql-query-result/m-dcql-query-result.d.ts +0 -883
  87. package/dist/src/dcql-query-result/m-dcql-query-result.d.ts.map +0 -1
  88. package/dist/src/dcql-query-result/m-dcql-query-result.js +0 -69
  89. package/dist/src/dcql-query-result/m-dcql-query-result.js.map +0 -1
  90. package/dist/src/dcql-query-result/run-dcql-query.d.ts +0 -8
  91. package/dist/src/dcql-query-result/run-dcql-query.d.ts.map +0 -1
  92. package/dist/src/dcql-query-result/run-dcql-query.js +0 -56
  93. package/dist/src/dcql-query-result/run-dcql-query.js.map +0 -1
  94. package/dist/src/index.d.ts +0 -6
  95. package/dist/src/index.d.ts.map +0 -1
  96. package/dist/src/index.js +0 -27
  97. package/dist/src/index.js.map +0 -1
  98. package/dist/src/u-dcql-credential.d.ts +0 -104
  99. package/dist/src/u-dcql-credential.d.ts.map +0 -1
  100. package/dist/src/u-dcql-credential.js +0 -84
  101. package/dist/src/u-dcql-credential.js.map +0 -1
  102. package/dist/src/u-dcql.d.ts +0 -17
  103. package/dist/src/u-dcql.d.ts.map +0 -1
  104. package/dist/src/u-dcql.js +0 -98
  105. package/dist/src/u-dcql.js.map +0 -1
  106. package/dist/src/u-model.d.ts +0 -27
  107. package/dist/src/u-model.d.ts.map +0 -1
  108. package/dist/src/u-model.js +0 -65
  109. package/dist/src/u-model.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"m-dcql-query.d.ts","sourceRoot":"","sources":["../../../src/dcql-query/m-dcql-query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAM7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAK9D;;;;;;;GAOG;AACH,yBAAiB,SAAS,CAAC;IAClB,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAcjB,CAAC;IACH,KAAY,KAAK,GAAG,CAAC,CAAC,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;IAChD,KAAY,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,MAAM,CAAC,CAAC;IAC3C,MAAM,QAAQ,cAAe,MAAM,SAIzC,CAAC;IACK,MAAM,KAAK,cAAe,MAAM,eAAe,cAAc,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAErE,CAAC;IAEK,MAAM,KAAK,UAAW,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEjC,CAAC;CACH;AACD,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC"}
@@ -1,89 +0,0 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.DcqlQuery = void 0;
27
- const v = __importStar(require("valibot"));
28
- const e_dcql_js_1 = require("../dcql-error/e-dcql.js");
29
- const run_dcql_query_js_1 = require("../dcql-query-result/run-dcql-query.js");
30
- const u_dcql_js_1 = require("../u-dcql.js");
31
- const m_dcql_credential_query_js_1 = require("./m-dcql-credential-query.js");
32
- const m_dcql_credential_set_query_js_1 = require("./m-dcql-credential-set-query.js");
33
- /**
34
- * The Digital Credentials Query Language (DCQL, pronounced [ˈdakl̩]) is a
35
- * JSON-encoded query language that allows the Verifier to request Verifiable
36
- * Presentations that match the query. The Verifier MAY encode constraints on the
37
- * combinations of credentials and claims that are requested. The Wallet evaluates
38
- * the query against the Verifiable Credentials it holds and returns Verifiable
39
- * Presentations matching the query.
40
- */
41
- var DcqlQuery;
42
- (function (DcqlQuery) {
43
- DcqlQuery.vModel = v.object({
44
- credentials: v.pipe(v.array(m_dcql_credential_query_js_1.DcqlCredentialQuery.vModel), (0, u_dcql_js_1.vNonEmptyArray)(), v.description(`REQUIRED. A non-empty array of Credential Queries that specify the requested Verifiable Credentials.`)),
45
- credential_sets: v.pipe(v.optional(v.pipe(v.array(m_dcql_credential_set_query_js_1.CredentialSetQuery.vModel), (0, u_dcql_js_1.vNonEmptyArray)())), v.description(`OPTIONAL. A non-empty array of credential set queries that specifies additional constraints on which of the requested Verifiable Credentials to return.`)),
46
- });
47
- DcqlQuery.validate = (dcqlQuery) => {
48
- validateUniqueCredentialQueryIds(dcqlQuery);
49
- validateCredentialSets(dcqlQuery);
50
- dcqlQuery.credentials.forEach(m_dcql_credential_query_js_1.DcqlCredentialQuery.validate);
51
- };
52
- DcqlQuery.query = (dcqlQuery, credentials) => {
53
- return (0, run_dcql_query_js_1.runDcqlQuery)(dcqlQuery, { credentials, presentation: false });
54
- };
55
- DcqlQuery.parse = (input) => {
56
- return v.parse(DcqlQuery.vModel, input);
57
- };
58
- })(DcqlQuery || (exports.DcqlQuery = DcqlQuery = {}));
59
- // --- validations --- //
60
- const validateUniqueCredentialQueryIds = (query) => {
61
- const ids = query.credentials.map(c => c.id);
62
- const duplicates = ids.filter((id, index) => ids.indexOf(id) !== index);
63
- if (duplicates.length > 0) {
64
- throw new e_dcql_js_1.DcqlNonUniqueCredentialQueryIdsError({
65
- message: `Duplicate credential query ids found: ${duplicates.join(', ')}`,
66
- });
67
- }
68
- };
69
- const validateCredentialSets = (query) => {
70
- if (!query.credential_sets)
71
- return;
72
- const credentialQueryIds = new Set(query.credentials.map(c => c.id));
73
- const undefinedCredentialQueryIds = [];
74
- for (const credential_set of query.credential_sets) {
75
- for (const credentialSetOption of credential_set.options) {
76
- for (const credentialQueryId of credentialSetOption) {
77
- if (!credentialQueryIds.has(credentialQueryId)) {
78
- undefinedCredentialQueryIds.push(credentialQueryId);
79
- }
80
- }
81
- }
82
- }
83
- if (undefinedCredentialQueryIds.length > 0) {
84
- throw new e_dcql_js_1.DcqlCredentialSetError({
85
- message: `Credential set contains undefined credential id${undefinedCredentialQueryIds.length === 1 ? '' : '`s'} '${undefinedCredentialQueryIds.join(', ')}'`,
86
- });
87
- }
88
- };
89
- //# sourceMappingURL=m-dcql-query.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"m-dcql-query.js","sourceRoot":"","sources":["../../../src/dcql-query/m-dcql-query.ts"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IAAI,kCAAsB,CAAC;YAC/B,OAAO,EAAE,kDAAkD,2BAA2B,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;SAC9J,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export { DcqlQueryResult } from './m-dcql-query-result.js';
2
- export { runDcqlQuery } from './run-dcql-query.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dcql-query-result/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runDcqlQuery = exports.DcqlQueryResult = void 0;
4
- var m_dcql_query_result_js_1 = require("./m-dcql-query-result.js");
5
- Object.defineProperty(exports, "DcqlQueryResult", { enumerable: true, get: function () { return m_dcql_query_result_js_1.DcqlQueryResult; } });
6
- var run_dcql_query_js_1 = require("./run-dcql-query.js");
7
- Object.defineProperty(exports, "runDcqlQuery", { enumerable: true, get: function () { return run_dcql_query_js_1.runDcqlQuery; } });
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dcql-query-result/index.ts"],"names":[],"mappings":";;;AAAA,mEAA2D;AAAlD,yHAAA,eAAe,OAAA;AACxB,yDAAmD;AAA1C,iHAAA,YAAY,OAAA"}