@owf/eudi-wrprc 0.0.0 → 0.2.0-alpha-20260422114341
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/LICENSE +201 -0
- package/dist/index.d.mts +144 -144
- package/dist/index.mjs +347 -347
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -16
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/dist/index.d.mts
CHANGED
|
@@ -2,19 +2,70 @@ import { z } from "zod";
|
|
|
2
2
|
import { IdentityException } from "@owf/identity-common";
|
|
3
3
|
import { Signer } from "@owf/crypto";
|
|
4
4
|
|
|
5
|
+
//#region src/entitlements.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* All standard WRP entitlements defined in ETSI TS 119 475
|
|
8
|
+
*/
|
|
9
|
+
declare const WRP_ENTITLEMENTS: {
|
|
10
|
+
readonly SERVICE_PROVIDER: "https://uri.etsi.org/19475/Entitlement/Service_Provider";
|
|
11
|
+
readonly QEAA_PROVIDER: "https://uri.etsi.org/19475/Entitlement/QEAA_Provider";
|
|
12
|
+
readonly NON_Q_EAA_PROVIDER: "https://uri.etsi.org/19475/Entitlement/Non_Q_EAA_Provider";
|
|
13
|
+
readonly PUB_EAA_PROVIDER: "https://uri.etsi.org/19475/Entitlement/PUB_EAA_Provider";
|
|
14
|
+
readonly PID_PROVIDER: "https://uri.etsi.org/19475/Entitlement/PID_Provider";
|
|
15
|
+
readonly QCERT_FOR_ESEAL_PROVIDER: "https://uri.etsi.org/19475/Entitlement/QCert_for_ESeal_Provider";
|
|
16
|
+
readonly QCERT_FOR_ESIG_PROVIDER: "https://uri.etsi.org/19475/Entitlement/QCert_for_ESig_Provider";
|
|
17
|
+
readonly RQSEALCDS_PROVIDER: "https://uri.etsi.org/19475/Entitlement/rQSealCDs_Provider";
|
|
18
|
+
readonly RQSIGCDS_PROVIDER: "https://uri.etsi.org/19475/Entitlement/rQSigCDs_Provider";
|
|
19
|
+
readonly ESIG_ESEAL_CREATION_PROVIDER: "https://uri.etsi.org/19475/Entitlement/ESig_ESeal_Creation_Provider";
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Payment Service Provider Sub-entitlements (A.3.1)
|
|
23
|
+
* As defined in ETSI TS 119 495
|
|
24
|
+
*/
|
|
25
|
+
declare const PSP_SUB_ENTITLEMENTS: {
|
|
26
|
+
/** Account Servicing Payment Service Provider */readonly ACCOUNT_SERVICING: "https://uri.etsi.org/19475/SubEntitlement/psp/psp-as"; /** Payment Initiation Service Provider */
|
|
27
|
+
readonly PAYMENT_INITIATION: "https://uri.etsi.org/19475/SubEntitlement/psp/psp-pi"; /** Account Information Service Provider */
|
|
28
|
+
readonly ACCOUNT_INFORMATION: "https://uri.etsi.org/19475/SubEntitlement/psp/psp-ai"; /** Payment Service Provider issuing card-based payment instruments */
|
|
29
|
+
readonly CARD_BASED: "https://uri.etsi.org/19475/SubEntitlement/psp/psp-ic"; /** Unspecified Payment Service Provider */
|
|
30
|
+
readonly UNSPECIFIED: "https://uri.etsi.org/19475/SubEntitlement/psp/unspecified";
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Identifier type URIs for legal person semantic identifiers
|
|
34
|
+
*/
|
|
35
|
+
declare const IDENTIFIER_TYPES: {
|
|
36
|
+
/** Economic Operator Registration and Identification Number (EORI-No) */readonly EORI: "http://data.europa.eu/eudi/id/EORI-No"; /** Legal Entity Identifier (LEI) */
|
|
37
|
+
readonly LEI: "http://data.europa.eu/eudi/id/LEI"; /** European Unique Identifier (EUID) */
|
|
38
|
+
readonly EUID: "http://data.europa.eu/eudi/id/EUID"; /** Value Added Tax Identification Number (VATIN) */
|
|
39
|
+
readonly VATIN: "http://data.europa.eu/eudi/id/VATIN"; /** Taxpayer Identification Number (TIN) */
|
|
40
|
+
readonly TIN: "http://data.europa.eu/eudi/id/TIN"; /** Excise Number */
|
|
41
|
+
readonly EXCISE: "http://data.europa.eu/eudi/id/Excise";
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Check if a given URI is a valid WRP entitlement
|
|
45
|
+
*/
|
|
46
|
+
declare function isValidEntitlement(uri: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Check if a given URI is a PSP sub-entitlement
|
|
49
|
+
*/
|
|
50
|
+
declare function isPSPSubEntitlement(uri: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Check if entitlements include an attestation provider role
|
|
53
|
+
*/
|
|
54
|
+
declare function hasAttestationProviderEntitlement(entitlements: string[]): boolean;
|
|
55
|
+
//#endregion
|
|
5
56
|
//#region src/schemas.d.ts
|
|
6
57
|
/**
|
|
7
58
|
* Multilingual string schema (B.2.6 Class MultiLangString)
|
|
8
59
|
*/
|
|
9
60
|
declare const MultiLangStringSchema: z.ZodObject<{
|
|
10
61
|
/** Language code per BCP47/RFC 5646 */lang: z.ZodString; /** Localized string value */
|
|
11
|
-
|
|
62
|
+
content: z.ZodString;
|
|
12
63
|
}, "strip", z.ZodTypeAny, {
|
|
13
64
|
lang: string;
|
|
14
|
-
|
|
65
|
+
content: string;
|
|
15
66
|
}, {
|
|
16
67
|
lang: string;
|
|
17
|
-
|
|
68
|
+
content: string;
|
|
18
69
|
}>;
|
|
19
70
|
/**
|
|
20
71
|
* Supervisory Authority schema for Data Protection Authority
|
|
@@ -127,13 +178,13 @@ declare const WRPRCPayloadSchema: z.ZodObject<{
|
|
|
127
178
|
registry_uri: z.ZodString; /** Descriptions of the services provided by the WRP */
|
|
128
179
|
srv_description: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
129
180
|
/** Language code per BCP47/RFC 5646 */lang: z.ZodString; /** Localized string value */
|
|
130
|
-
|
|
181
|
+
content: z.ZodString;
|
|
131
182
|
}, "strip", z.ZodTypeAny, {
|
|
132
183
|
lang: string;
|
|
133
|
-
|
|
184
|
+
content: string;
|
|
134
185
|
}, {
|
|
135
186
|
lang: string;
|
|
136
|
-
|
|
187
|
+
content: string;
|
|
137
188
|
}>, "many">, "many">>; /** List of entitlements assigned to the WRP */
|
|
138
189
|
entitlements: z.ZodArray<z.ZodString, "many">; /** URL to the WRP's privacy policy */
|
|
139
190
|
privacy_policy: z.ZodOptional<z.ZodString>; /** URL general-purpose web address */
|
|
@@ -179,13 +230,13 @@ declare const WRPRCPayloadSchema: z.ZodObject<{
|
|
|
179
230
|
}>>; /** Purpose of the intended data processing */
|
|
180
231
|
purpose: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
181
232
|
/** Language code per BCP47/RFC 5646 */lang: z.ZodString; /** Localized string value */
|
|
182
|
-
|
|
233
|
+
content: z.ZodString;
|
|
183
234
|
}, "strip", z.ZodTypeAny, {
|
|
184
235
|
lang: string;
|
|
185
|
-
|
|
236
|
+
content: string;
|
|
186
237
|
}, {
|
|
187
238
|
lang: string;
|
|
188
|
-
|
|
239
|
+
content: string;
|
|
189
240
|
}>, "many">>; /** Set of credentials intended to be requested by the WRP */
|
|
190
241
|
credentials: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
191
242
|
/** Format of the attestation (e.g., "dc+sd-jwt", "mso_mdoc") */format: z.ZodString; /** Object defining additional properties per Credential Format */
|
|
@@ -271,7 +322,7 @@ declare const WRPRCPayloadSchema: z.ZodObject<{
|
|
|
271
322
|
sub_fn?: string | undefined;
|
|
272
323
|
srv_description?: {
|
|
273
324
|
lang: string;
|
|
274
|
-
|
|
325
|
+
content: string;
|
|
275
326
|
}[][] | undefined;
|
|
276
327
|
privacy_policy?: string | undefined;
|
|
277
328
|
info_uri?: string | undefined;
|
|
@@ -285,7 +336,7 @@ declare const WRPRCPayloadSchema: z.ZodObject<{
|
|
|
285
336
|
certificate_policy?: string | undefined;
|
|
286
337
|
purpose?: {
|
|
287
338
|
lang: string;
|
|
288
|
-
|
|
339
|
+
content: string;
|
|
289
340
|
}[] | undefined;
|
|
290
341
|
credentials?: {
|
|
291
342
|
format: string;
|
|
@@ -325,7 +376,7 @@ declare const WRPRCPayloadSchema: z.ZodObject<{
|
|
|
325
376
|
sub_fn?: string | undefined;
|
|
326
377
|
srv_description?: {
|
|
327
378
|
lang: string;
|
|
328
|
-
|
|
379
|
+
content: string;
|
|
329
380
|
}[][] | undefined;
|
|
330
381
|
privacy_policy?: string | undefined;
|
|
331
382
|
info_uri?: string | undefined;
|
|
@@ -339,7 +390,7 @@ declare const WRPRCPayloadSchema: z.ZodObject<{
|
|
|
339
390
|
certificate_policy?: string | undefined;
|
|
340
391
|
purpose?: {
|
|
341
392
|
lang: string;
|
|
342
|
-
|
|
393
|
+
content: string;
|
|
343
394
|
}[] | undefined;
|
|
344
395
|
credentials?: {
|
|
345
396
|
format: string;
|
|
@@ -409,13 +460,13 @@ declare const LegalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
409
460
|
registry_uri: z.ZodString;
|
|
410
461
|
srv_description: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
411
462
|
/** Language code per BCP47/RFC 5646 */lang: z.ZodString; /** Localized string value */
|
|
412
|
-
|
|
463
|
+
content: z.ZodString;
|
|
413
464
|
}, "strip", z.ZodTypeAny, {
|
|
414
465
|
lang: string;
|
|
415
|
-
|
|
466
|
+
content: string;
|
|
416
467
|
}, {
|
|
417
468
|
lang: string;
|
|
418
|
-
|
|
469
|
+
content: string;
|
|
419
470
|
}>, "many">, "many">>;
|
|
420
471
|
entitlements: z.ZodArray<z.ZodString, "many">;
|
|
421
472
|
privacy_policy: z.ZodOptional<z.ZodString>;
|
|
@@ -461,13 +512,13 @@ declare const LegalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
461
512
|
}>>;
|
|
462
513
|
purpose: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
463
514
|
/** Language code per BCP47/RFC 5646 */lang: z.ZodString; /** Localized string value */
|
|
464
|
-
|
|
515
|
+
content: z.ZodString;
|
|
465
516
|
}, "strip", z.ZodTypeAny, {
|
|
466
517
|
lang: string;
|
|
467
|
-
|
|
518
|
+
content: string;
|
|
468
519
|
}, {
|
|
469
520
|
lang: string;
|
|
470
|
-
|
|
521
|
+
content: string;
|
|
471
522
|
}>, "many">>;
|
|
472
523
|
credentials: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
473
524
|
/** Format of the attestation (e.g., "dc+sd-jwt", "mso_mdoc") */format: z.ZodString; /** Object defining additional properties per Credential Format */
|
|
@@ -553,7 +604,7 @@ declare const LegalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
553
604
|
} | undefined;
|
|
554
605
|
srv_description?: {
|
|
555
606
|
lang: string;
|
|
556
|
-
|
|
607
|
+
content: string;
|
|
557
608
|
}[][] | undefined;
|
|
558
609
|
privacy_policy?: string | undefined;
|
|
559
610
|
info_uri?: string | undefined;
|
|
@@ -567,7 +618,7 @@ declare const LegalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
567
618
|
certificate_policy?: string | undefined;
|
|
568
619
|
purpose?: {
|
|
569
620
|
lang: string;
|
|
570
|
-
|
|
621
|
+
content: string;
|
|
571
622
|
}[] | undefined;
|
|
572
623
|
credentials?: {
|
|
573
624
|
format: string;
|
|
@@ -605,7 +656,7 @@ declare const LegalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
605
656
|
} | undefined;
|
|
606
657
|
srv_description?: {
|
|
607
658
|
lang: string;
|
|
608
|
-
|
|
659
|
+
content: string;
|
|
609
660
|
}[][] | undefined;
|
|
610
661
|
privacy_policy?: string | undefined;
|
|
611
662
|
info_uri?: string | undefined;
|
|
@@ -619,7 +670,7 @@ declare const LegalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
619
670
|
certificate_policy?: string | undefined;
|
|
620
671
|
purpose?: {
|
|
621
672
|
lang: string;
|
|
622
|
-
|
|
673
|
+
content: string;
|
|
623
674
|
}[] | undefined;
|
|
624
675
|
credentials?: {
|
|
625
676
|
format: string;
|
|
@@ -653,13 +704,13 @@ declare const NaturalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
653
704
|
registry_uri: z.ZodString;
|
|
654
705
|
srv_description: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
655
706
|
/** Language code per BCP47/RFC 5646 */lang: z.ZodString; /** Localized string value */
|
|
656
|
-
|
|
707
|
+
content: z.ZodString;
|
|
657
708
|
}, "strip", z.ZodTypeAny, {
|
|
658
709
|
lang: string;
|
|
659
|
-
|
|
710
|
+
content: string;
|
|
660
711
|
}, {
|
|
661
712
|
lang: string;
|
|
662
|
-
|
|
713
|
+
content: string;
|
|
663
714
|
}>, "many">, "many">>;
|
|
664
715
|
entitlements: z.ZodArray<z.ZodString, "many">;
|
|
665
716
|
privacy_policy: z.ZodOptional<z.ZodString>;
|
|
@@ -705,13 +756,13 @@ declare const NaturalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
705
756
|
}>>;
|
|
706
757
|
purpose: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
707
758
|
/** Language code per BCP47/RFC 5646 */lang: z.ZodString; /** Localized string value */
|
|
708
|
-
|
|
759
|
+
content: z.ZodString;
|
|
709
760
|
}, "strip", z.ZodTypeAny, {
|
|
710
761
|
lang: string;
|
|
711
|
-
|
|
762
|
+
content: string;
|
|
712
763
|
}, {
|
|
713
764
|
lang: string;
|
|
714
|
-
|
|
765
|
+
content: string;
|
|
715
766
|
}>, "many">>;
|
|
716
767
|
credentials: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
717
768
|
/** Format of the attestation (e.g., "dc+sd-jwt", "mso_mdoc") */format: z.ZodString; /** Object defining additional properties per Credential Format */
|
|
@@ -799,7 +850,7 @@ declare const NaturalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
799
850
|
} | undefined;
|
|
800
851
|
srv_description?: {
|
|
801
852
|
lang: string;
|
|
802
|
-
|
|
853
|
+
content: string;
|
|
803
854
|
}[][] | undefined;
|
|
804
855
|
privacy_policy?: string | undefined;
|
|
805
856
|
info_uri?: string | undefined;
|
|
@@ -813,7 +864,7 @@ declare const NaturalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
813
864
|
certificate_policy?: string | undefined;
|
|
814
865
|
purpose?: {
|
|
815
866
|
lang: string;
|
|
816
|
-
|
|
867
|
+
content: string;
|
|
817
868
|
}[] | undefined;
|
|
818
869
|
credentials?: {
|
|
819
870
|
format: string;
|
|
@@ -852,7 +903,7 @@ declare const NaturalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
852
903
|
} | undefined;
|
|
853
904
|
srv_description?: {
|
|
854
905
|
lang: string;
|
|
855
|
-
|
|
906
|
+
content: string;
|
|
856
907
|
}[][] | undefined;
|
|
857
908
|
privacy_policy?: string | undefined;
|
|
858
909
|
info_uri?: string | undefined;
|
|
@@ -866,7 +917,7 @@ declare const NaturalPersonSubjectSchema: z.ZodObject<Omit<{
|
|
|
866
917
|
certificate_policy?: string | undefined;
|
|
867
918
|
purpose?: {
|
|
868
919
|
lang: string;
|
|
869
|
-
|
|
920
|
+
content: string;
|
|
870
921
|
}[] | undefined;
|
|
871
922
|
credentials?: {
|
|
872
923
|
format: string;
|
|
@@ -968,117 +1019,6 @@ interface NaturalPersonWRPRCInput {
|
|
|
968
1019
|
entitlements: string[];
|
|
969
1020
|
}
|
|
970
1021
|
//#endregion
|
|
971
|
-
//#region src/entitlements.d.ts
|
|
972
|
-
/**
|
|
973
|
-
* All standard WRP entitlements defined in ETSI TS 119 475
|
|
974
|
-
*/
|
|
975
|
-
declare const WRP_ENTITLEMENTS: {
|
|
976
|
-
readonly SERVICE_PROVIDER: "https://uri.etsi.org/19475/Entitlement/Service_Provider";
|
|
977
|
-
readonly QEAA_PROVIDER: "https://uri.etsi.org/19475/Entitlement/QEAA_Provider";
|
|
978
|
-
readonly NON_Q_EAA_PROVIDER: "https://uri.etsi.org/19475/Entitlement/Non_Q_EAA_Provider";
|
|
979
|
-
readonly PUB_EAA_PROVIDER: "https://uri.etsi.org/19475/Entitlement/PUB_EAA_Provider";
|
|
980
|
-
readonly PID_PROVIDER: "https://uri.etsi.org/19475/Entitlement/PID_Provider";
|
|
981
|
-
readonly QCERT_FOR_ESEAL_PROVIDER: "https://uri.etsi.org/19475/Entitlement/QCert_for_ESeal_Provider";
|
|
982
|
-
readonly QCERT_FOR_ESIG_PROVIDER: "https://uri.etsi.org/19475/Entitlement/QCert_for_ESig_Provider";
|
|
983
|
-
readonly RQSEALCDS_PROVIDER: "https://uri.etsi.org/19475/Entitlement/rQSealCDs_Provider";
|
|
984
|
-
readonly RQSIGCDS_PROVIDER: "https://uri.etsi.org/19475/Entitlement/rQSigCDs_Provider";
|
|
985
|
-
readonly ESIG_ESEAL_CREATION_PROVIDER: "https://uri.etsi.org/19475/Entitlement/ESig_ESeal_Creation_Provider";
|
|
986
|
-
};
|
|
987
|
-
/**
|
|
988
|
-
* Payment Service Provider Sub-entitlements (A.3.1)
|
|
989
|
-
* As defined in ETSI TS 119 495
|
|
990
|
-
*/
|
|
991
|
-
declare const PSP_SUB_ENTITLEMENTS: {
|
|
992
|
-
/** Account Servicing Payment Service Provider */readonly ACCOUNT_SERVICING: "https://uri.etsi.org/19475/SubEntitlement/psp/psp-as"; /** Payment Initiation Service Provider */
|
|
993
|
-
readonly PAYMENT_INITIATION: "https://uri.etsi.org/19475/SubEntitlement/psp/psp-pi"; /** Account Information Service Provider */
|
|
994
|
-
readonly ACCOUNT_INFORMATION: "https://uri.etsi.org/19475/SubEntitlement/psp/psp-ai"; /** Payment Service Provider issuing card-based payment instruments */
|
|
995
|
-
readonly CARD_BASED: "https://uri.etsi.org/19475/SubEntitlement/psp/psp-ic"; /** Unspecified Payment Service Provider */
|
|
996
|
-
readonly UNSPECIFIED: "https://uri.etsi.org/19475/SubEntitlement/psp/unspecified";
|
|
997
|
-
};
|
|
998
|
-
/**
|
|
999
|
-
* Identifier type URIs for legal person semantic identifiers
|
|
1000
|
-
*/
|
|
1001
|
-
declare const IDENTIFIER_TYPES: {
|
|
1002
|
-
/** Economic Operator Registration and Identification Number (EORI-No) */readonly EORI: "http://data.europa.eu/eudi/id/EORI-No"; /** Legal Entity Identifier (LEI) */
|
|
1003
|
-
readonly LEI: "http://data.europa.eu/eudi/id/LEI"; /** European Unique Identifier (EUID) */
|
|
1004
|
-
readonly EUID: "http://data.europa.eu/eudi/id/EUID"; /** Value Added Tax Identification Number (VATIN) */
|
|
1005
|
-
readonly VATIN: "http://data.europa.eu/eudi/id/VATIN"; /** Taxpayer Identification Number (TIN) */
|
|
1006
|
-
readonly TIN: "http://data.europa.eu/eudi/id/TIN"; /** Excise Number */
|
|
1007
|
-
readonly EXCISE: "http://data.europa.eu/eudi/id/Excise";
|
|
1008
|
-
};
|
|
1009
|
-
/**
|
|
1010
|
-
* Check if a given URI is a valid WRP entitlement
|
|
1011
|
-
*/
|
|
1012
|
-
declare function isValidEntitlement(uri: string): boolean;
|
|
1013
|
-
/**
|
|
1014
|
-
* Check if a given URI is a PSP sub-entitlement
|
|
1015
|
-
*/
|
|
1016
|
-
declare function isPSPSubEntitlement(uri: string): boolean;
|
|
1017
|
-
/**
|
|
1018
|
-
* Check if entitlements include an attestation provider role
|
|
1019
|
-
*/
|
|
1020
|
-
declare function hasAttestationProviderEntitlement(entitlements: string[]): boolean;
|
|
1021
|
-
//#endregion
|
|
1022
|
-
//#region src/validator.d.ts
|
|
1023
|
-
/**
|
|
1024
|
-
* A single validation error
|
|
1025
|
-
*/
|
|
1026
|
-
interface ValidationError {
|
|
1027
|
-
/** Path to the invalid field */
|
|
1028
|
-
path: string[];
|
|
1029
|
-
/** Error message */
|
|
1030
|
-
message: string;
|
|
1031
|
-
/** Error code */
|
|
1032
|
-
code: string;
|
|
1033
|
-
}
|
|
1034
|
-
/**
|
|
1035
|
-
* Result of WRPRC validation
|
|
1036
|
-
*/
|
|
1037
|
-
interface ValidationResult {
|
|
1038
|
-
/** Whether the WRPRC is valid */
|
|
1039
|
-
valid: boolean;
|
|
1040
|
-
/** List of validation errors (empty if valid) */
|
|
1041
|
-
errors: ValidationError[];
|
|
1042
|
-
/** Warnings that don't invalidate the certificate but should be noted */
|
|
1043
|
-
warnings: ValidationError[];
|
|
1044
|
-
}
|
|
1045
|
-
/**
|
|
1046
|
-
* Validate a WRPRC payload against the schema
|
|
1047
|
-
*/
|
|
1048
|
-
declare function validateWRPRCPayload(payload: unknown): ValidationResult;
|
|
1049
|
-
/**
|
|
1050
|
-
* Validate a JWT header for WRPRC
|
|
1051
|
-
*/
|
|
1052
|
-
declare function validateWRPRCJWTHeader(header: unknown): ValidationResult;
|
|
1053
|
-
/**
|
|
1054
|
-
* Validate a complete WRPRC (header + payload)
|
|
1055
|
-
*/
|
|
1056
|
-
declare function validateWRPRC(header: unknown, payload: unknown): ValidationResult;
|
|
1057
|
-
/**
|
|
1058
|
-
* Check if payload represents a legal person
|
|
1059
|
-
*/
|
|
1060
|
-
declare function isLegalPersonWRPRC(payload: WRPRCPayload): boolean;
|
|
1061
|
-
/**
|
|
1062
|
-
* Check if payload represents a natural person
|
|
1063
|
-
*/
|
|
1064
|
-
declare function isNaturalPersonWRPRC(payload: WRPRCPayload): boolean;
|
|
1065
|
-
/**
|
|
1066
|
-
* Validate as legal person WRPRC
|
|
1067
|
-
*/
|
|
1068
|
-
declare function validateLegalPersonWRPRC(payload: unknown): ValidationResult;
|
|
1069
|
-
/**
|
|
1070
|
-
* Validate as natural person WRPRC
|
|
1071
|
-
*/
|
|
1072
|
-
declare function validateNaturalPersonWRPRC(payload: unknown): ValidationResult;
|
|
1073
|
-
/**
|
|
1074
|
-
* Assert that a WRPRC payload is valid, throws WRPRCException if not
|
|
1075
|
-
*/
|
|
1076
|
-
declare function assertValidWRPRCPayload(payload: unknown): asserts payload is WRPRCPayload;
|
|
1077
|
-
/**
|
|
1078
|
-
* Assert that a WRPRC is valid (header + payload), throws WRPRCException if not
|
|
1079
|
-
*/
|
|
1080
|
-
declare function assertValidWRPRC(header: unknown, payload: unknown): void;
|
|
1081
|
-
//#endregion
|
|
1082
1022
|
//#region src/builders.d.ts
|
|
1083
1023
|
/**
|
|
1084
1024
|
* Builder for creating WRPRC payloads with a fluent API
|
|
@@ -1290,6 +1230,66 @@ declare function createWRPRCPayload(payload: Omit<WRPRCPayload, 'iat'> & {
|
|
|
1290
1230
|
iat?: number;
|
|
1291
1231
|
}): WRPRCPayload;
|
|
1292
1232
|
//#endregion
|
|
1233
|
+
//#region src/validator.d.ts
|
|
1234
|
+
/**
|
|
1235
|
+
* A single validation error
|
|
1236
|
+
*/
|
|
1237
|
+
interface ValidationError {
|
|
1238
|
+
/** Path to the invalid field */
|
|
1239
|
+
path: string[];
|
|
1240
|
+
/** Error message */
|
|
1241
|
+
message: string;
|
|
1242
|
+
/** Error code */
|
|
1243
|
+
code: string;
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* Result of WRPRC validation
|
|
1247
|
+
*/
|
|
1248
|
+
interface ValidationResult {
|
|
1249
|
+
/** Whether the WRPRC is valid */
|
|
1250
|
+
valid: boolean;
|
|
1251
|
+
/** List of validation errors (empty if valid) */
|
|
1252
|
+
errors: ValidationError[];
|
|
1253
|
+
/** Warnings that don't invalidate the certificate but should be noted */
|
|
1254
|
+
warnings: ValidationError[];
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* Validate a WRPRC payload against the schema
|
|
1258
|
+
*/
|
|
1259
|
+
declare function validateWRPRCPayload(payload: unknown): ValidationResult;
|
|
1260
|
+
/**
|
|
1261
|
+
* Validate a JWT header for WRPRC
|
|
1262
|
+
*/
|
|
1263
|
+
declare function validateWRPRCJWTHeader(header: unknown): ValidationResult;
|
|
1264
|
+
/**
|
|
1265
|
+
* Validate a complete WRPRC (header + payload)
|
|
1266
|
+
*/
|
|
1267
|
+
declare function validateWRPRC(header: unknown, payload: unknown): ValidationResult;
|
|
1268
|
+
/**
|
|
1269
|
+
* Check if payload represents a legal person
|
|
1270
|
+
*/
|
|
1271
|
+
declare function isLegalPersonWRPRC(payload: WRPRCPayload): boolean;
|
|
1272
|
+
/**
|
|
1273
|
+
* Check if payload represents a natural person
|
|
1274
|
+
*/
|
|
1275
|
+
declare function isNaturalPersonWRPRC(payload: WRPRCPayload): boolean;
|
|
1276
|
+
/**
|
|
1277
|
+
* Validate as legal person WRPRC
|
|
1278
|
+
*/
|
|
1279
|
+
declare function validateLegalPersonWRPRC(payload: unknown): ValidationResult;
|
|
1280
|
+
/**
|
|
1281
|
+
* Validate as natural person WRPRC
|
|
1282
|
+
*/
|
|
1283
|
+
declare function validateNaturalPersonWRPRC(payload: unknown): ValidationResult;
|
|
1284
|
+
/**
|
|
1285
|
+
* Assert that a WRPRC payload is valid, throws WRPRCException if not
|
|
1286
|
+
*/
|
|
1287
|
+
declare function assertValidWRPRCPayload(payload: unknown): asserts payload is WRPRCPayload;
|
|
1288
|
+
/**
|
|
1289
|
+
* Assert that a WRPRC is valid (header + payload), throws WRPRCException if not
|
|
1290
|
+
*/
|
|
1291
|
+
declare function assertValidWRPRC(header: unknown, payload: unknown): void;
|
|
1292
|
+
//#endregion
|
|
1293
1293
|
//#region src/wrprc-exception.d.ts
|
|
1294
1294
|
/**
|
|
1295
1295
|
* WRPRCException is a custom error class for WRPRC-related exceptions.
|