@pagopa/io-react-native-wallet 2.2.0 → 2.4.0
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/README.md +4 -3
- package/lib/commonjs/credential/index.js +3 -1
- package/lib/commonjs/credential/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js +24 -6
- package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +26 -2
- package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/README.md +155 -18
- package/lib/commonjs/credential/issuance/index.js +9 -1
- package/lib/commonjs/credential/issuance/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/mrtd-pop/01-verify-and-parse-challenge-info.js +57 -0
- package/lib/commonjs/credential/issuance/mrtd-pop/01-verify-and-parse-challenge-info.js.map +1 -0
- package/lib/commonjs/credential/issuance/mrtd-pop/02-init-challenge.js +61 -0
- package/lib/commonjs/credential/issuance/mrtd-pop/02-init-challenge.js.map +1 -0
- package/lib/commonjs/credential/issuance/mrtd-pop/03-validate-challenge.js +95 -0
- package/lib/commonjs/credential/issuance/mrtd-pop/03-validate-challenge.js.map +1 -0
- package/lib/commonjs/credential/issuance/mrtd-pop/README.md +92 -0
- package/lib/commonjs/credential/issuance/mrtd-pop/index.js +33 -0
- package/lib/commonjs/credential/issuance/mrtd-pop/index.js.map +1 -0
- package/lib/commonjs/credential/issuance/mrtd-pop/types.js +57 -0
- package/lib/commonjs/credential/issuance/mrtd-pop/types.js.map +1 -0
- package/lib/commonjs/credential/offer/01-start-flow.js +75 -0
- package/lib/commonjs/credential/offer/01-start-flow.js.map +1 -0
- package/lib/commonjs/credential/offer/02-fetch-credential-offer.js +45 -0
- package/lib/commonjs/credential/offer/02-fetch-credential-offer.js.map +1 -0
- package/lib/commonjs/credential/offer/README.md +174 -0
- package/lib/commonjs/credential/offer/errors.js +22 -0
- package/lib/commonjs/credential/offer/errors.js.map +1 -0
- package/lib/commonjs/credential/offer/index.js +25 -0
- package/lib/commonjs/credential/offer/index.js.map +1 -0
- package/lib/commonjs/credential/offer/types.js +51 -0
- package/lib/commonjs/credential/offer/types.js.map +1 -0
- package/lib/commonjs/credential/presentation/01-start-flow.js +1 -1
- package/lib/commonjs/credentials-catalogue/README.md +15 -0
- package/lib/commonjs/credentials-catalogue/fetch-and-parse-catalogue.js +42 -0
- package/lib/commonjs/credentials-catalogue/fetch-and-parse-catalogue.js.map +1 -0
- package/lib/commonjs/credentials-catalogue/index.js +13 -0
- package/lib/commonjs/credentials-catalogue/index.js.map +1 -0
- package/lib/commonjs/credentials-catalogue/types.js +99 -0
- package/lib/commonjs/credentials-catalogue/types.js.map +1 -0
- package/lib/commonjs/index.js +3 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/auth.js +9 -1
- package/lib/commonjs/utils/auth.js.map +1 -1
- package/lib/commonjs/utils/par.js +7 -2
- package/lib/commonjs/utils/par.js.map +1 -1
- package/lib/commonjs/utils/zod.js +28 -0
- package/lib/commonjs/utils/zod.js.map +1 -0
- package/lib/module/credential/index.js +2 -1
- package/lib/module/credential/index.js.map +1 -1
- package/lib/module/credential/issuance/03-start-user-authorization.js +24 -6
- package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/04-complete-user-authorization.js +25 -2
- package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/README.md +155 -18
- package/lib/module/credential/issuance/index.js +3 -2
- package/lib/module/credential/issuance/index.js.map +1 -1
- package/lib/module/credential/issuance/mrtd-pop/01-verify-and-parse-challenge-info.js +50 -0
- package/lib/module/credential/issuance/mrtd-pop/01-verify-and-parse-challenge-info.js.map +1 -0
- package/lib/module/credential/issuance/mrtd-pop/02-init-challenge.js +52 -0
- package/lib/module/credential/issuance/mrtd-pop/02-init-challenge.js.map +1 -0
- package/lib/module/credential/issuance/mrtd-pop/03-validate-challenge.js +85 -0
- package/lib/module/credential/issuance/mrtd-pop/03-validate-challenge.js.map +1 -0
- package/lib/module/credential/issuance/mrtd-pop/README.md +92 -0
- package/lib/module/credential/issuance/mrtd-pop/index.js +5 -0
- package/lib/module/credential/issuance/mrtd-pop/index.js.map +1 -0
- package/lib/module/credential/issuance/mrtd-pop/types.js +46 -0
- package/lib/module/credential/issuance/mrtd-pop/types.js.map +1 -0
- package/lib/module/credential/offer/01-start-flow.js +66 -0
- package/lib/module/credential/offer/01-start-flow.js.map +1 -0
- package/lib/module/credential/offer/02-fetch-credential-offer.js +38 -0
- package/lib/module/credential/offer/02-fetch-credential-offer.js.map +1 -0
- package/lib/module/credential/offer/README.md +174 -0
- package/lib/module/credential/offer/errors.js +14 -0
- package/lib/module/credential/offer/errors.js.map +1 -0
- package/lib/module/credential/offer/index.js +5 -0
- package/lib/module/credential/offer/index.js.map +1 -0
- package/lib/module/credential/offer/types.js +41 -0
- package/lib/module/credential/offer/types.js.map +1 -0
- package/lib/module/credential/presentation/01-start-flow.js +1 -1
- package/lib/module/credentials-catalogue/README.md +15 -0
- package/lib/module/credentials-catalogue/fetch-and-parse-catalogue.js +35 -0
- package/lib/module/credentials-catalogue/fetch-and-parse-catalogue.js.map +1 -0
- package/lib/module/credentials-catalogue/index.js +2 -0
- package/lib/module/credentials-catalogue/index.js.map +1 -0
- package/lib/module/credentials-catalogue/types.js +89 -0
- package/lib/module/credentials-catalogue/types.js.map +1 -0
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/auth.js +8 -0
- package/lib/module/utils/auth.js.map +1 -1
- package/lib/module/utils/par.js +7 -2
- package/lib/module/utils/par.js.map +1 -1
- package/lib/module/utils/zod.js +20 -0
- package/lib/module/utils/zod.js.map +1 -0
- package/lib/typescript/credential/index.d.ts +2 -1
- package/lib/typescript/credential/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/01-start-flow.d.ts +1 -1
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +14 -4
- package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +9 -1
- package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/index.d.ts +4 -3
- package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/mrtd-pop/01-verify-and-parse-challenge-info.d.ts +25 -0
- package/lib/typescript/credential/issuance/mrtd-pop/01-verify-and-parse-challenge-info.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/mrtd-pop/02-init-challenge.d.ts +23 -0
- package/lib/typescript/credential/issuance/mrtd-pop/02-init-challenge.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/mrtd-pop/03-validate-challenge.d.ts +39 -0
- package/lib/typescript/credential/issuance/mrtd-pop/03-validate-challenge.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/mrtd-pop/index.d.ts +7 -0
- package/lib/typescript/credential/issuance/mrtd-pop/index.d.ts.map +1 -0
- package/lib/typescript/credential/issuance/mrtd-pop/types.d.ts +201 -0
- package/lib/typescript/credential/issuance/mrtd-pop/types.d.ts.map +1 -0
- package/lib/typescript/credential/offer/01-start-flow.d.ts +172 -0
- package/lib/typescript/credential/offer/01-start-flow.d.ts.map +1 -0
- package/lib/typescript/credential/offer/02-fetch-credential-offer.d.ts +20 -0
- package/lib/typescript/credential/offer/02-fetch-credential-offer.d.ts.map +1 -0
- package/lib/typescript/credential/offer/errors.d.ts +10 -0
- package/lib/typescript/credential/offer/errors.d.ts.map +1 -0
- package/lib/typescript/credential/offer/index.d.ts +7 -0
- package/lib/typescript/credential/offer/index.d.ts.map +1 -0
- package/lib/typescript/credential/offer/types.d.ts +264 -0
- package/lib/typescript/credential/offer/types.d.ts.map +1 -0
- package/lib/typescript/credential/presentation/01-start-flow.d.ts +1 -1
- package/lib/typescript/credentials-catalogue/fetch-and-parse-catalogue.d.ts +15 -0
- package/lib/typescript/credentials-catalogue/fetch-and-parse-catalogue.d.ts.map +1 -0
- package/lib/typescript/credentials-catalogue/index.d.ts +3 -0
- package/lib/typescript/credentials-catalogue/index.d.ts.map +1 -0
- package/lib/typescript/credentials-catalogue/types.d.ts +844 -0
- package/lib/typescript/credentials-catalogue/types.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils/auth.d.ts +11 -0
- package/lib/typescript/utils/auth.d.ts.map +1 -1
- package/lib/typescript/utils/par.d.ts +34 -4
- package/lib/typescript/utils/par.d.ts.map +1 -1
- package/lib/typescript/utils/zod.d.ts +15 -0
- package/lib/typescript/utils/zod.d.ts.map +1 -0
- package/package.json +21 -2
- package/src/credential/index.ts +2 -1
- package/src/credential/issuance/01-start-flow.ts +1 -1
- package/src/credential/issuance/03-start-user-authorization.ts +30 -7
- package/src/credential/issuance/04-complete-user-authorization.ts +43 -1
- package/src/credential/issuance/README.md +155 -18
- package/src/credential/issuance/index.ts +7 -1
- package/src/credential/issuance/mrtd-pop/01-verify-and-parse-challenge-info.ts +70 -0
- package/src/credential/issuance/mrtd-pop/02-init-challenge.ts +82 -0
- package/src/credential/issuance/mrtd-pop/03-validate-challenge.ts +140 -0
- package/src/credential/issuance/mrtd-pop/README.md +92 -0
- package/src/credential/issuance/mrtd-pop/index.ts +27 -0
- package/src/credential/issuance/mrtd-pop/types.ts +65 -0
- package/src/credential/offer/01-start-flow.ts +89 -0
- package/src/credential/offer/02-fetch-credential-offer.ts +54 -0
- package/src/credential/offer/README.md +174 -0
- package/src/credential/offer/errors.ts +17 -0
- package/src/credential/offer/index.ts +16 -0
- package/src/credential/offer/types.ts +59 -0
- package/src/credential/presentation/01-start-flow.ts +1 -1
- package/src/credentials-catalogue/README.md +15 -0
- package/src/credentials-catalogue/fetch-and-parse-catalogue.ts +54 -0
- package/src/credentials-catalogue/index.ts +2 -0
- package/src/credentials-catalogue/types.ts +97 -0
- package/src/index.ts +2 -0
- package/src/utils/auth.ts +12 -0
- package/src/utils/par.ts +12 -4
- package/src/utils/zod.ts +28 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export type MrtdProofChallengeInfo = z.infer<typeof MrtdProofChallengeInfo>;
|
|
3
|
+
export declare const MrtdProofChallengeInfo: z.ZodObject<{
|
|
4
|
+
protectedHeader: z.ZodObject<{
|
|
5
|
+
typ: z.ZodLiteral<"mrtd-ias+jwt">;
|
|
6
|
+
alg: z.ZodString;
|
|
7
|
+
kid: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
alg: string;
|
|
10
|
+
kid: string;
|
|
11
|
+
typ: "mrtd-ias+jwt";
|
|
12
|
+
}, {
|
|
13
|
+
alg: string;
|
|
14
|
+
kid: string;
|
|
15
|
+
typ: "mrtd-ias+jwt";
|
|
16
|
+
}>;
|
|
17
|
+
payload: z.ZodObject<{
|
|
18
|
+
iss: z.ZodString;
|
|
19
|
+
aud: z.ZodString;
|
|
20
|
+
iat: z.ZodNumber;
|
|
21
|
+
exp: z.ZodNumber;
|
|
22
|
+
status: z.ZodLiteral<"require_interaction">;
|
|
23
|
+
type: z.ZodLiteral<"mrtd+ias">;
|
|
24
|
+
mrtd_auth_session: z.ZodString;
|
|
25
|
+
state: z.ZodString;
|
|
26
|
+
mrtd_pop_jwt_nonce: z.ZodString;
|
|
27
|
+
htu: z.ZodString;
|
|
28
|
+
htm: z.ZodLiteral<"POST">;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
state: string;
|
|
31
|
+
iss: string;
|
|
32
|
+
type: "mrtd+ias";
|
|
33
|
+
status: "require_interaction";
|
|
34
|
+
iat: number;
|
|
35
|
+
exp: number;
|
|
36
|
+
aud: string;
|
|
37
|
+
htm: "POST";
|
|
38
|
+
htu: string;
|
|
39
|
+
mrtd_auth_session: string;
|
|
40
|
+
mrtd_pop_jwt_nonce: string;
|
|
41
|
+
}, {
|
|
42
|
+
state: string;
|
|
43
|
+
iss: string;
|
|
44
|
+
type: "mrtd+ias";
|
|
45
|
+
status: "require_interaction";
|
|
46
|
+
iat: number;
|
|
47
|
+
exp: number;
|
|
48
|
+
aud: string;
|
|
49
|
+
htm: "POST";
|
|
50
|
+
htu: string;
|
|
51
|
+
mrtd_auth_session: string;
|
|
52
|
+
mrtd_pop_jwt_nonce: string;
|
|
53
|
+
}>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
payload: {
|
|
56
|
+
state: string;
|
|
57
|
+
iss: string;
|
|
58
|
+
type: "mrtd+ias";
|
|
59
|
+
status: "require_interaction";
|
|
60
|
+
iat: number;
|
|
61
|
+
exp: number;
|
|
62
|
+
aud: string;
|
|
63
|
+
htm: "POST";
|
|
64
|
+
htu: string;
|
|
65
|
+
mrtd_auth_session: string;
|
|
66
|
+
mrtd_pop_jwt_nonce: string;
|
|
67
|
+
};
|
|
68
|
+
protectedHeader: {
|
|
69
|
+
alg: string;
|
|
70
|
+
kid: string;
|
|
71
|
+
typ: "mrtd-ias+jwt";
|
|
72
|
+
};
|
|
73
|
+
}, {
|
|
74
|
+
payload: {
|
|
75
|
+
state: string;
|
|
76
|
+
iss: string;
|
|
77
|
+
type: "mrtd+ias";
|
|
78
|
+
status: "require_interaction";
|
|
79
|
+
iat: number;
|
|
80
|
+
exp: number;
|
|
81
|
+
aud: string;
|
|
82
|
+
htm: "POST";
|
|
83
|
+
htu: string;
|
|
84
|
+
mrtd_auth_session: string;
|
|
85
|
+
mrtd_pop_jwt_nonce: string;
|
|
86
|
+
};
|
|
87
|
+
protectedHeader: {
|
|
88
|
+
alg: string;
|
|
89
|
+
kid: string;
|
|
90
|
+
typ: "mrtd-ias+jwt";
|
|
91
|
+
};
|
|
92
|
+
}>;
|
|
93
|
+
export type MrtdPoPChallenge = z.infer<typeof MrtdPoPChallenge>;
|
|
94
|
+
export declare const MrtdPoPChallenge: z.ZodObject<{
|
|
95
|
+
protectedHeader: z.ZodObject<{
|
|
96
|
+
typ: z.ZodLiteral<"mrtd-ias-pop+jwt">;
|
|
97
|
+
alg: z.ZodString;
|
|
98
|
+
kid: z.ZodString;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
alg: string;
|
|
101
|
+
kid: string;
|
|
102
|
+
typ: "mrtd-ias-pop+jwt";
|
|
103
|
+
}, {
|
|
104
|
+
alg: string;
|
|
105
|
+
kid: string;
|
|
106
|
+
typ: "mrtd-ias-pop+jwt";
|
|
107
|
+
}>;
|
|
108
|
+
payload: z.ZodObject<{
|
|
109
|
+
iss: z.ZodString;
|
|
110
|
+
aud: z.ZodString;
|
|
111
|
+
iat: z.ZodNumber;
|
|
112
|
+
exp: z.ZodNumber;
|
|
113
|
+
challenge: z.ZodString;
|
|
114
|
+
mrtd_pop_nonce: z.ZodString;
|
|
115
|
+
mrz: z.ZodOptional<z.ZodString>;
|
|
116
|
+
htu: z.ZodString;
|
|
117
|
+
htm: z.ZodLiteral<"POST">;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
iss: string;
|
|
120
|
+
iat: number;
|
|
121
|
+
exp: number;
|
|
122
|
+
challenge: string;
|
|
123
|
+
aud: string;
|
|
124
|
+
htm: "POST";
|
|
125
|
+
htu: string;
|
|
126
|
+
mrtd_pop_nonce: string;
|
|
127
|
+
mrz?: string | undefined;
|
|
128
|
+
}, {
|
|
129
|
+
iss: string;
|
|
130
|
+
iat: number;
|
|
131
|
+
exp: number;
|
|
132
|
+
challenge: string;
|
|
133
|
+
aud: string;
|
|
134
|
+
htm: "POST";
|
|
135
|
+
htu: string;
|
|
136
|
+
mrtd_pop_nonce: string;
|
|
137
|
+
mrz?: string | undefined;
|
|
138
|
+
}>;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
payload: {
|
|
141
|
+
iss: string;
|
|
142
|
+
iat: number;
|
|
143
|
+
exp: number;
|
|
144
|
+
challenge: string;
|
|
145
|
+
aud: string;
|
|
146
|
+
htm: "POST";
|
|
147
|
+
htu: string;
|
|
148
|
+
mrtd_pop_nonce: string;
|
|
149
|
+
mrz?: string | undefined;
|
|
150
|
+
};
|
|
151
|
+
protectedHeader: {
|
|
152
|
+
alg: string;
|
|
153
|
+
kid: string;
|
|
154
|
+
typ: "mrtd-ias-pop+jwt";
|
|
155
|
+
};
|
|
156
|
+
}, {
|
|
157
|
+
payload: {
|
|
158
|
+
iss: string;
|
|
159
|
+
iat: number;
|
|
160
|
+
exp: number;
|
|
161
|
+
challenge: string;
|
|
162
|
+
aud: string;
|
|
163
|
+
htm: "POST";
|
|
164
|
+
htu: string;
|
|
165
|
+
mrtd_pop_nonce: string;
|
|
166
|
+
mrz?: string | undefined;
|
|
167
|
+
};
|
|
168
|
+
protectedHeader: {
|
|
169
|
+
alg: string;
|
|
170
|
+
kid: string;
|
|
171
|
+
typ: "mrtd-ias-pop+jwt";
|
|
172
|
+
};
|
|
173
|
+
}>;
|
|
174
|
+
export type MrtdPayload = {
|
|
175
|
+
dg1: string;
|
|
176
|
+
dg11: string;
|
|
177
|
+
sod_mrtd: string;
|
|
178
|
+
};
|
|
179
|
+
export type IasPayload = {
|
|
180
|
+
ias_pk: string;
|
|
181
|
+
sod_ias: string;
|
|
182
|
+
challenge_signed: string;
|
|
183
|
+
};
|
|
184
|
+
export type MrtdPopVerificationResult = z.infer<typeof MrtdPopVerificationResult>;
|
|
185
|
+
export declare const MrtdPopVerificationResult: z.ZodObject<{
|
|
186
|
+
status: z.ZodLiteral<"require_interaction">;
|
|
187
|
+
type: z.ZodLiteral<"redirect_to_web">;
|
|
188
|
+
mrtd_val_pop_nonce: z.ZodString;
|
|
189
|
+
redirect_uri: z.ZodString;
|
|
190
|
+
}, "strip", z.ZodTypeAny, {
|
|
191
|
+
type: "redirect_to_web";
|
|
192
|
+
status: "require_interaction";
|
|
193
|
+
redirect_uri: string;
|
|
194
|
+
mrtd_val_pop_nonce: string;
|
|
195
|
+
}, {
|
|
196
|
+
type: "redirect_to_web";
|
|
197
|
+
status: "require_interaction";
|
|
198
|
+
redirect_uri: string;
|
|
199
|
+
mrtd_val_pop_nonce: string;
|
|
200
|
+
}>;
|
|
201
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/credential/issuance/mrtd-pop/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC5E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAChE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB3B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,yBAAyB,CACjC,CAAC;AACF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAKpC,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
declare const CredentialOfferParams: z.ZodUnion<[z.ZodObject<{
|
|
3
|
+
credential_offer: z.ZodPipeline<z.ZodEffects<z.ZodString, string | number | boolean | {
|
|
4
|
+
[key: string]: string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null;
|
|
5
|
+
} | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | (string | number | boolean | any | any | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null)[] | null, string>, z.ZodObject<{
|
|
6
|
+
credential_issuer: z.ZodString;
|
|
7
|
+
credential_configuration_ids: z.ZodArray<z.ZodString, "many">;
|
|
8
|
+
grants: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
authorization_code: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
issuer_state: z.ZodOptional<z.ZodString>;
|
|
11
|
+
authorization_server: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
issuer_state?: string | undefined;
|
|
14
|
+
authorization_server?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
issuer_state?: string | undefined;
|
|
17
|
+
authorization_server?: string | undefined;
|
|
18
|
+
}>>;
|
|
19
|
+
"urn:ietf:params:oauth:grant-type:pre-authorized_code": z.ZodOptional<z.ZodObject<{
|
|
20
|
+
"pre-authorized_code": z.ZodString;
|
|
21
|
+
tx_code: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
input_mode: z.ZodOptional<z.ZodEnum<["numeric", "text"]>>;
|
|
23
|
+
length: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
description: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
input_mode?: "numeric" | "text" | undefined;
|
|
27
|
+
length?: number | undefined;
|
|
28
|
+
description?: string | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
input_mode?: "numeric" | "text" | undefined;
|
|
31
|
+
length?: number | undefined;
|
|
32
|
+
description?: string | undefined;
|
|
33
|
+
}>>;
|
|
34
|
+
authorization_server: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
"pre-authorized_code": string;
|
|
37
|
+
tx_code?: {
|
|
38
|
+
input_mode?: "numeric" | "text" | undefined;
|
|
39
|
+
length?: number | undefined;
|
|
40
|
+
description?: string | undefined;
|
|
41
|
+
} | undefined;
|
|
42
|
+
authorization_server?: string | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
"pre-authorized_code": string;
|
|
45
|
+
tx_code?: {
|
|
46
|
+
input_mode?: "numeric" | "text" | undefined;
|
|
47
|
+
length?: number | undefined;
|
|
48
|
+
description?: string | undefined;
|
|
49
|
+
} | undefined;
|
|
50
|
+
authorization_server?: string | undefined;
|
|
51
|
+
}>>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
authorization_code?: {
|
|
54
|
+
issuer_state?: string | undefined;
|
|
55
|
+
authorization_server?: string | undefined;
|
|
56
|
+
} | undefined;
|
|
57
|
+
"urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
|
|
58
|
+
"pre-authorized_code": string;
|
|
59
|
+
tx_code?: {
|
|
60
|
+
input_mode?: "numeric" | "text" | undefined;
|
|
61
|
+
length?: number | undefined;
|
|
62
|
+
description?: string | undefined;
|
|
63
|
+
} | undefined;
|
|
64
|
+
authorization_server?: string | undefined;
|
|
65
|
+
} | undefined;
|
|
66
|
+
}, {
|
|
67
|
+
authorization_code?: {
|
|
68
|
+
issuer_state?: string | undefined;
|
|
69
|
+
authorization_server?: string | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
"urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
|
|
72
|
+
"pre-authorized_code": string;
|
|
73
|
+
tx_code?: {
|
|
74
|
+
input_mode?: "numeric" | "text" | undefined;
|
|
75
|
+
length?: number | undefined;
|
|
76
|
+
description?: string | undefined;
|
|
77
|
+
} | undefined;
|
|
78
|
+
authorization_server?: string | undefined;
|
|
79
|
+
} | undefined;
|
|
80
|
+
}>>;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
credential_issuer: string;
|
|
83
|
+
credential_configuration_ids: string[];
|
|
84
|
+
grants?: {
|
|
85
|
+
authorization_code?: {
|
|
86
|
+
issuer_state?: string | undefined;
|
|
87
|
+
authorization_server?: string | undefined;
|
|
88
|
+
} | undefined;
|
|
89
|
+
"urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
|
|
90
|
+
"pre-authorized_code": string;
|
|
91
|
+
tx_code?: {
|
|
92
|
+
input_mode?: "numeric" | "text" | undefined;
|
|
93
|
+
length?: number | undefined;
|
|
94
|
+
description?: string | undefined;
|
|
95
|
+
} | undefined;
|
|
96
|
+
authorization_server?: string | undefined;
|
|
97
|
+
} | undefined;
|
|
98
|
+
} | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
credential_issuer: string;
|
|
101
|
+
credential_configuration_ids: string[];
|
|
102
|
+
grants?: {
|
|
103
|
+
authorization_code?: {
|
|
104
|
+
issuer_state?: string | undefined;
|
|
105
|
+
authorization_server?: string | undefined;
|
|
106
|
+
} | undefined;
|
|
107
|
+
"urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
|
|
108
|
+
"pre-authorized_code": string;
|
|
109
|
+
tx_code?: {
|
|
110
|
+
input_mode?: "numeric" | "text" | undefined;
|
|
111
|
+
length?: number | undefined;
|
|
112
|
+
description?: string | undefined;
|
|
113
|
+
} | undefined;
|
|
114
|
+
authorization_server?: string | undefined;
|
|
115
|
+
} | undefined;
|
|
116
|
+
} | undefined;
|
|
117
|
+
}>>;
|
|
118
|
+
credential_offer_uri: z.ZodUndefined;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
credential_offer: {
|
|
121
|
+
credential_issuer: string;
|
|
122
|
+
credential_configuration_ids: string[];
|
|
123
|
+
grants?: {
|
|
124
|
+
authorization_code?: {
|
|
125
|
+
issuer_state?: string | undefined;
|
|
126
|
+
authorization_server?: string | undefined;
|
|
127
|
+
} | undefined;
|
|
128
|
+
"urn:ietf:params:oauth:grant-type:pre-authorized_code"?: {
|
|
129
|
+
"pre-authorized_code": string;
|
|
130
|
+
tx_code?: {
|
|
131
|
+
input_mode?: "numeric" | "text" | undefined;
|
|
132
|
+
length?: number | undefined;
|
|
133
|
+
description?: string | undefined;
|
|
134
|
+
} | undefined;
|
|
135
|
+
authorization_server?: string | undefined;
|
|
136
|
+
} | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
};
|
|
139
|
+
credential_offer_uri?: undefined;
|
|
140
|
+
}, {
|
|
141
|
+
credential_offer: string;
|
|
142
|
+
credential_offer_uri?: undefined;
|
|
143
|
+
}>, z.ZodObject<{
|
|
144
|
+
credential_offer: z.ZodUndefined;
|
|
145
|
+
credential_offer_uri: z.ZodString;
|
|
146
|
+
}, "strip", z.ZodTypeAny, {
|
|
147
|
+
credential_offer_uri: string;
|
|
148
|
+
credential_offer?: undefined;
|
|
149
|
+
}, {
|
|
150
|
+
credential_offer_uri: string;
|
|
151
|
+
credential_offer?: undefined;
|
|
152
|
+
}>]>;
|
|
153
|
+
type CredentialOfferParams = z.infer<typeof CredentialOfferParams>;
|
|
154
|
+
/**
|
|
155
|
+
* The beginning of the credential offer flow.
|
|
156
|
+
* To be implemented according to the user touchpoint
|
|
157
|
+
*
|
|
158
|
+
* @param params Credential offer encoded url
|
|
159
|
+
* @returns Object containing the credential offer by reference or by value
|
|
160
|
+
*/
|
|
161
|
+
export type StartFlow = (encodedUrl: string) => CredentialOfferParams;
|
|
162
|
+
/**
|
|
163
|
+
* Start a credential offer flow by validating and parse an encoded url
|
|
164
|
+
* extracted from a QR code or a deep link.
|
|
165
|
+
*
|
|
166
|
+
* @param params The encoded url to be validated and parsed
|
|
167
|
+
* @returns Object containing the credential offer by reference or by value
|
|
168
|
+
* @throws If the provided encoded url is not valid
|
|
169
|
+
*/
|
|
170
|
+
export declare const startFlowFromQR: StartFlow;
|
|
171
|
+
export {};
|
|
172
|
+
//# sourceMappingURL=01-start-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"01-start-flow.d.ts","sourceRoot":"","sources":["../../../../src/credential/offer/01-start-flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAUzB,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASzB,CAAC;AACH,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,qBAAqB,CAAC;AAEtE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,SAiD7B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CredentialOffer } from "./types";
|
|
2
|
+
export type GetCredentialOffer = (credentialOfferUri: string, context: {
|
|
3
|
+
appFetch?: GlobalFetch["fetch"];
|
|
4
|
+
}) => Promise<CredentialOffer>;
|
|
5
|
+
/**
|
|
6
|
+
* Fetches and validates a credential offer from a given URI.
|
|
7
|
+
*
|
|
8
|
+
* This function performs an HTTP GET request to the specified `credentialOfferUri`,
|
|
9
|
+
* expecting a JSON response that matches the `CredentialOfferSchema`. If the response
|
|
10
|
+
* is invalid or does not conform to the schema, an error is logged and an
|
|
11
|
+
* `InvalidCredentialOfferError` is thrown.
|
|
12
|
+
*
|
|
13
|
+
* @param credentialOfferUri - The URI from which to fetch the credential offer.
|
|
14
|
+
* @param context - Optional context object that may provide a custom `appFetch` implementation.
|
|
15
|
+
* @returns The validated credential offer data.
|
|
16
|
+
* @throws {IssuerResponseError} If the HTTP response status is not 200.
|
|
17
|
+
* @throws {InvalidCredentialOfferError} If the response does not match the expected schema.
|
|
18
|
+
*/
|
|
19
|
+
export declare const fetchCredentialOffer: GetCredentialOffer;
|
|
20
|
+
//# sourceMappingURL=02-fetch-credential-offer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"02-fetch-credential-offer.d.ts","sourceRoot":"","sources":["../../../../src/credential/offer/02-fetch-credential-offer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C,MAAM,MAAM,kBAAkB,GAAG,CAC/B,kBAAkB,EAAE,MAAM,EAC1B,OAAO,EAAE;IACP,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,eAAe,CAAC,CAAC;AAE9B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAyBlC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IoWalletError } from "../../utils/errors";
|
|
2
|
+
export declare class InvalidCredentialOfferError extends IoWalletError {
|
|
3
|
+
code: string;
|
|
4
|
+
constructor(message?: string);
|
|
5
|
+
}
|
|
6
|
+
export declare class InvalidQRCodeError extends IoWalletError {
|
|
7
|
+
code: string;
|
|
8
|
+
constructor(message?: string);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/credential/offer/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,qBAAa,2BAA4B,SAAQ,aAAa;IAC5D,IAAI,SAAkC;gBAE1B,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,IAAI,SAAyB;gBAEjB,OAAO,CAAC,EAAE,MAAM;CAG7B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { startFlowFromQR, type StartFlow } from "./01-start-flow";
|
|
2
|
+
import { fetchCredentialOffer, type GetCredentialOffer } from "./02-fetch-credential-offer";
|
|
3
|
+
import * as Errors from "./errors";
|
|
4
|
+
export type { CredentialOffer, Grants, AuthorizationCodeGrant, PreAuthorizedCodeGrant, TransactionCode, } from "./types";
|
|
5
|
+
export { Errors, fetchCredentialOffer, startFlowFromQR };
|
|
6
|
+
export type { GetCredentialOffer, StartFlow };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/credential/offer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EACL,oBAAoB,EACpB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,YAAY,EACV,eAAe,EACf,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,eAAe,EAAE,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,SAAS,EAAE,CAAC"}
|