@owf/eudi-sca 0.0.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/dist/index.d.mts +129 -0
- package/dist/index.mjs +100 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +44 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { CredentialIssuerMetadata } from "@openid4vc/openid4vci";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/crypto.d.ts
|
|
5
|
+
type JwtSignatureVerifier = (x5c: Array<string>, toBeVerified: string, signature: Uint8Array) => Promise<void>;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/issuerMetadata.d.ts
|
|
8
|
+
declare const zCredentialIssuerMetadataWithMetadataUri: z.ZodObject<{
|
|
9
|
+
credential_issuer: z.ZodURL;
|
|
10
|
+
authorization_servers: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
11
|
+
credential_endpoint: z.ZodURL;
|
|
12
|
+
deferred_credential_endpoint: z.ZodOptional<z.ZodURL>;
|
|
13
|
+
notification_endpoint: z.ZodOptional<z.ZodURL>;
|
|
14
|
+
nonce_endpoint: z.ZodOptional<z.ZodURL>;
|
|
15
|
+
credential_response_encryption: z.ZodOptional<z.ZodObject<{
|
|
16
|
+
alg_values_supported: z.ZodArray<z.ZodString>;
|
|
17
|
+
enc_values_supported: z.ZodArray<z.ZodString>;
|
|
18
|
+
encryption_required: z.ZodBoolean;
|
|
19
|
+
}, z.core.$loose>>;
|
|
20
|
+
batch_credential_issuance: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
batch_size: z.ZodNumber;
|
|
22
|
+
}, z.core.$loose>>;
|
|
23
|
+
display: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
|
+
name: z.ZodOptional<z.ZodString>;
|
|
25
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
26
|
+
logo: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
uri: z.ZodOptional<z.ZodUnion<[z.ZodURL, z.ZodString]>>;
|
|
28
|
+
alt_text: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$loose>>;
|
|
30
|
+
}, z.core.$loose>>>;
|
|
31
|
+
credential_configurations_supported: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
32
|
+
format: z.ZodString;
|
|
33
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
34
|
+
cryptographic_binding_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
credential_signing_alg_values_supported: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString>, z.ZodArray<z.ZodNumber>]>>;
|
|
36
|
+
proof_types_supported: z.ZodOptional<z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"jwt">, z.ZodLiteral<"attestation">, z.ZodString]>, z.ZodObject<{
|
|
37
|
+
proof_signing_alg_values_supported: z.ZodArray<z.ZodString>;
|
|
38
|
+
key_attestations_required: z.ZodOptional<z.ZodObject<{
|
|
39
|
+
key_storage: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
40
|
+
iso_18045_high: "iso_18045_high";
|
|
41
|
+
iso_18045_moderate: "iso_18045_moderate";
|
|
42
|
+
"iso_18045_enhanced-basic": "iso_18045_enhanced-basic";
|
|
43
|
+
iso_18045_basic: "iso_18045_basic";
|
|
44
|
+
}>, z.ZodString]>>>;
|
|
45
|
+
user_authentication: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
|
|
46
|
+
iso_18045_high: "iso_18045_high";
|
|
47
|
+
iso_18045_moderate: "iso_18045_moderate";
|
|
48
|
+
"iso_18045_enhanced-basic": "iso_18045_enhanced-basic";
|
|
49
|
+
iso_18045_basic: "iso_18045_basic";
|
|
50
|
+
}>, z.ZodString]>>>;
|
|
51
|
+
}, z.core.$loose>>;
|
|
52
|
+
}, z.core.$strip>>>;
|
|
53
|
+
credential_metadata: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
display: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
57
|
+
logo: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
uri: z.ZodOptional<z.ZodUnion<[z.ZodURL, z.ZodString]>>;
|
|
59
|
+
alt_text: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$loose>>;
|
|
61
|
+
description: z.ZodOptional<z.ZodString>;
|
|
62
|
+
background_color: z.ZodOptional<z.ZodString>;
|
|
63
|
+
background_image: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
uri: z.ZodOptional<z.ZodUnion<[z.ZodURL, z.ZodString]>>;
|
|
65
|
+
}, z.core.$loose>>;
|
|
66
|
+
text_color: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$loose>>>;
|
|
68
|
+
}, z.core.$loose>>;
|
|
69
|
+
}, z.core.$loose>>;
|
|
70
|
+
credential_metadata_uri: z.ZodOptional<z.ZodURL>;
|
|
71
|
+
}, z.core.$loose>;
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* Additional check for the Credential Issuer Metadata to see if there is a `credential_metadata_uri` available
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
77
|
+
declare const parseCredentialMetadataUri: (cim: CredentialIssuerMetadata | Record<string, unknown>) => z.infer<typeof zCredentialIssuerMetadataWithMetadataUri> & CredentialIssuerMetadata;
|
|
78
|
+
type IssuerMetadataWithCredentialMetadataUri = ReturnType<typeof parseCredentialMetadataUri>;
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/credentialMetadata.d.ts
|
|
81
|
+
declare enum ValueType {
|
|
82
|
+
Boolean = "boolean",
|
|
83
|
+
Frequency = "frequency",
|
|
84
|
+
Image = "image",
|
|
85
|
+
IsoDate = "iso_date",
|
|
86
|
+
IsoTime = "iso_time",
|
|
87
|
+
IsoDateTime = "iso_date_time",
|
|
88
|
+
IsoCurrency = "iso_currency",
|
|
89
|
+
IsoCurrencyAmount = "iso_currency_amount",
|
|
90
|
+
LabelOnly = "label_only",
|
|
91
|
+
MiniMarkdown = "mini_markdown",
|
|
92
|
+
Url = "url"
|
|
93
|
+
}
|
|
94
|
+
declare const CredentialMetadataSchema: z.ZodObject<{
|
|
95
|
+
transaction_data_types: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
96
|
+
claims: z.ZodArray<z.ZodObject<{
|
|
97
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
98
|
+
mandatory: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
+
display: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
100
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
101
|
+
name: z.ZodString;
|
|
102
|
+
display_type: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof ValueType>, z.ZodString]>>;
|
|
103
|
+
}, z.core.$strip>>>;
|
|
104
|
+
value_type: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof ValueType>, z.ZodString]>>;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
ui_labels: z.ZodUnknown;
|
|
107
|
+
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
type CredentialMetadata = z.infer<typeof CredentialMetadataSchema>;
|
|
110
|
+
declare const parseCredentialMetadata: (credentialMetadata: Record<string, unknown>) => {
|
|
111
|
+
transaction_data_types: Record<string, {
|
|
112
|
+
[x: string]: unknown;
|
|
113
|
+
claims: {
|
|
114
|
+
path: (string | null)[];
|
|
115
|
+
mandatory?: boolean | undefined;
|
|
116
|
+
display?: {
|
|
117
|
+
name: string;
|
|
118
|
+
locale?: string | undefined;
|
|
119
|
+
display_type?: string | undefined;
|
|
120
|
+
}[] | undefined;
|
|
121
|
+
value_type?: string | undefined;
|
|
122
|
+
}[];
|
|
123
|
+
ui_labels: unknown;
|
|
124
|
+
}>;
|
|
125
|
+
};
|
|
126
|
+
declare function fetchCredentialMetadata(verifier: JwtSignatureVerifier, credentialMetadataSource: string | IssuerMetadataWithCredentialMetadataUri, customFetcher?: typeof fetch, langCode?: string): Promise<CredentialMetadata & CredentialIssuerMetadata>;
|
|
127
|
+
//#endregion
|
|
128
|
+
export { type CredentialMetadata, ValueType, fetchCredentialMetadata, parseCredentialMetadata, parseCredentialMetadataUri };
|
|
129
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { zCredentialIssuerMetadataSchema } from "@openid4vc/openid4vci";
|
|
2
|
+
import { base64url, decodeJwt } from "@owf/identity-common";
|
|
3
|
+
import z from "zod";
|
|
4
|
+
//#region src/credentialMetadata.ts
|
|
5
|
+
let ValueType = /* @__PURE__ */ function(ValueType) {
|
|
6
|
+
ValueType["Boolean"] = "boolean";
|
|
7
|
+
ValueType["Frequency"] = "frequency";
|
|
8
|
+
ValueType["Image"] = "image";
|
|
9
|
+
ValueType["IsoDate"] = "iso_date";
|
|
10
|
+
ValueType["IsoTime"] = "iso_time";
|
|
11
|
+
ValueType["IsoDateTime"] = "iso_date_time";
|
|
12
|
+
ValueType["IsoCurrency"] = "iso_currency";
|
|
13
|
+
ValueType["IsoCurrencyAmount"] = "iso_currency_amount";
|
|
14
|
+
ValueType["LabelOnly"] = "label_only";
|
|
15
|
+
ValueType["MiniMarkdown"] = "mini_markdown";
|
|
16
|
+
ValueType["Url"] = "url";
|
|
17
|
+
return ValueType;
|
|
18
|
+
}({});
|
|
19
|
+
const valueTypeValues = Object.values(ValueType).join("|");
|
|
20
|
+
const valueTypeRegex = new RegExp(`^template:(${valueTypeValues})$`);
|
|
21
|
+
const CredentialMetadataSchema = z.object({ transaction_data_types: z.record(z.string().regex(/^urn:eudi:sca:[^:]+:[^:]+(:[^:]+)*:[^:]+$/), z.object({
|
|
22
|
+
claims: z.array(z.object({
|
|
23
|
+
path: z.array(z.union([z.string(), z.null()])),
|
|
24
|
+
mandatory: z.boolean().optional(),
|
|
25
|
+
display: z.array(z.object({
|
|
26
|
+
locale: z.string().optional(),
|
|
27
|
+
name: z.string(),
|
|
28
|
+
display_type: z.union([z.enum(ValueType), z.string().regex(valueTypeRegex)]).optional()
|
|
29
|
+
})).min(1).optional(),
|
|
30
|
+
value_type: z.union([z.enum(ValueType), z.string().regex(valueTypeRegex)]).optional()
|
|
31
|
+
}).superRefine((val, ctx) => {
|
|
32
|
+
if (!val.display && val.value_type !== void 0) ctx.addIssue({
|
|
33
|
+
code: "custom",
|
|
34
|
+
message: "value_type must not be used on claims without a display array",
|
|
35
|
+
path: ["value_type"]
|
|
36
|
+
});
|
|
37
|
+
})),
|
|
38
|
+
ui_labels: z.unknown()
|
|
39
|
+
}).catchall(z.unknown())) });
|
|
40
|
+
const parseCredentialMetadata = (credentialMetadata) => {
|
|
41
|
+
return CredentialMetadataSchema.parse(credentialMetadata);
|
|
42
|
+
};
|
|
43
|
+
async function fetchCredentialMetadata(verifier, credentialMetadataSource, customFetcher = fetch, langCode) {
|
|
44
|
+
const uri = typeof credentialMetadataSource === "string" ? credentialMetadataSource : credentialMetadataSource.credential_metadata_uri;
|
|
45
|
+
if (!uri) throw Error("credential_metadata_uri is not defined on the issuer metadata");
|
|
46
|
+
const payload = await validateJwt(await (await customFetcher(uri, { headers: {
|
|
47
|
+
Accept: "application/jwt",
|
|
48
|
+
...langCode ? { "Accept-Language": langCode } : {}
|
|
49
|
+
} })).text(), uri, verifier);
|
|
50
|
+
return CredentialMetadataSchema.extend(zCredentialIssuerMetadataSchema.shape).parse(payload.credential_metadata);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @todo validate the sub, iss, x5c chain
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
const validateJwt = async (jwt, credentialMetadataUri, verifier) => {
|
|
58
|
+
const { header: h, payload: p, signature } = decodeJwt(jwt);
|
|
59
|
+
const [headerString, payloadString] = jwt.split(".");
|
|
60
|
+
const header = z.object({
|
|
61
|
+
x5c: z.array(z.string()),
|
|
62
|
+
typ: z.literal("credential-metadata+jwt")
|
|
63
|
+
}).parse(h);
|
|
64
|
+
const payload = z.object({
|
|
65
|
+
iss: z.string(),
|
|
66
|
+
sub: z.string().min(1, { message: "sub must be a non-empty credential type identifier" }),
|
|
67
|
+
format: z.enum(["dc+sd-jwt", "mso_mdoc"], { message: "format must be a valid OID4VCI credential format identifier" }),
|
|
68
|
+
iat: z.number().int().positive({ message: "iat must be a positive Unix timestamp" }),
|
|
69
|
+
exp: z.number().int().positive({ message: "exp must be a positive Unix timestamp" }),
|
|
70
|
+
credential_metadata_uri: z.url({ message: "credential_metadata_uri must be a valid URL" }),
|
|
71
|
+
credential_metadata: zCredentialIssuerMetadataSchema
|
|
72
|
+
}).refine((data) => data.exp > data.iat, {
|
|
73
|
+
message: "exp must be after iat",
|
|
74
|
+
path: ["exp"]
|
|
75
|
+
}).refine((data) => new Date(data.exp) < /* @__PURE__ */ new Date(), {
|
|
76
|
+
message: "exp must be after iat",
|
|
77
|
+
path: ["exp"]
|
|
78
|
+
}).refine((data) => {
|
|
79
|
+
return data.credential_metadata_uri === credentialMetadataUri;
|
|
80
|
+
}, {
|
|
81
|
+
message: `credential_metadata_uri must match source '${credentialMetadataUri}'`,
|
|
82
|
+
path: ["credential_metadata_uri"]
|
|
83
|
+
}).parse(p);
|
|
84
|
+
const toBeVerified = `${headerString}.${payloadString}`;
|
|
85
|
+
await verifier(header.x5c, toBeVerified, base64url.decode(signature));
|
|
86
|
+
return payload;
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/issuerMetadata.ts
|
|
90
|
+
const zCredentialIssuerMetadataWithMetadataUri = zCredentialIssuerMetadataSchema.extend({ credential_metadata_uri: z.url().optional() });
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
* Additional check for the Credential Issuer Metadata to see if there is a `credential_metadata_uri` available
|
|
94
|
+
*
|
|
95
|
+
*/
|
|
96
|
+
const parseCredentialMetadataUri = (cim) => zCredentialIssuerMetadataWithMetadataUri.parse(cim);
|
|
97
|
+
//#endregion
|
|
98
|
+
export { ValueType, fetchCredentialMetadata, parseCredentialMetadata, parseCredentialMetadataUri };
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/credentialMetadata.ts","../src/issuerMetadata.ts"],"sourcesContent":["import { type CredentialIssuerMetadata, zCredentialIssuerMetadataSchema } from '@openid4vc/openid4vci'\nimport { base64url, decodeJwt } from '@owf/identity-common'\nimport z from 'zod'\nimport type { JwtSignatureVerifier } from './crypto'\nimport type { IssuerMetadataWithCredentialMetadataUri } from './issuerMetadata'\n\nexport enum ValueType {\n Boolean = 'boolean',\n Frequency = 'frequency',\n Image = 'image',\n IsoDate = 'iso_date',\n IsoTime = 'iso_time',\n IsoDateTime = 'iso_date_time',\n IsoCurrency = 'iso_currency',\n IsoCurrencyAmount = 'iso_currency_amount',\n LabelOnly = 'label_only',\n MiniMarkdown = 'mini_markdown',\n Url = 'url',\n}\n\nconst valueTypeValues = Object.values(ValueType).join('|')\nconst valueTypeRegex = new RegExp(`^template:(${valueTypeValues})$`)\nconst urnRegex = /^urn:eudi:sca:[^:]+:[^:]+(:[^:]+)*:[^:]+$/\n\nconst CredentialMetadataSchema = z.object({\n transaction_data_types: z.record(\n z.string().regex(urnRegex),\n z\n .object({\n claims: z.array(\n z\n .object({\n path: z.array(z.union([z.string(), z.null()])),\n mandatory: z.boolean().optional(),\n display: z\n .array(\n z.object({\n locale: z.string().optional(),\n name: z.string(),\n display_type: z.union([z.enum(ValueType), z.string().regex(valueTypeRegex)]).optional(),\n })\n )\n .min(1)\n .optional(),\n value_type: z.union([z.enum(ValueType), z.string().regex(valueTypeRegex)]).optional(),\n })\n .superRefine((val, ctx) => {\n if (!val.display && val.value_type !== undefined) {\n ctx.addIssue({\n code: 'custom',\n message: 'value_type must not be used on claims without a display array',\n path: ['value_type'],\n })\n }\n })\n ),\n ui_labels: z.unknown(),\n })\n .catchall(z.unknown())\n ),\n})\n\nexport type CredentialMetadata = z.infer<typeof CredentialMetadataSchema>\n\nexport const parseCredentialMetadata = (credentialMetadata: Record<string, unknown>) => {\n const cm = CredentialMetadataSchema.parse(credentialMetadata)\n return cm\n}\n\nexport async function fetchCredentialMetadata(\n verifier: JwtSignatureVerifier,\n credentialMetadataSource: string | IssuerMetadataWithCredentialMetadataUri,\n customFetcher = fetch,\n langCode?: string\n): Promise<CredentialMetadata & CredentialIssuerMetadata> {\n const uri =\n typeof credentialMetadataSource === 'string'\n ? credentialMetadataSource\n : credentialMetadataSource.credential_metadata_uri\n if (!uri) {\n throw Error('credential_metadata_uri is not defined on the issuer metadata')\n }\n\n const response = await customFetcher(uri, {\n headers: {\n Accept: 'application/jwt',\n ...(langCode ? { 'Accept-Language': langCode } : {}),\n },\n })\n\n const payload = await validateJwt(await response.text(), uri, verifier)\n\n return CredentialMetadataSchema.extend(zCredentialIssuerMetadataSchema.shape).parse(payload.credential_metadata)\n}\n\n/**\n *\n * @todo validate the sub, iss, x5c chain\n *\n */\nconst validateJwt = async (jwt: string, credentialMetadataUri: string, verifier: JwtSignatureVerifier) => {\n const { header: h, payload: p, signature } = decodeJwt(jwt)\n const [headerString, payloadString] = jwt.split('.')\n\n const header = z.object({ x5c: z.array(z.string()), typ: z.literal('credential-metadata+jwt') }).parse(h)\n const payload = z\n .object({\n iss: z.string(),\n sub: z.string().min(1, { message: 'sub must be a non-empty credential type identifier' }),\n format: z.enum(['dc+sd-jwt', 'mso_mdoc'], {\n message: 'format must be a valid OID4VCI credential format identifier',\n }),\n iat: z.number().int().positive({ message: 'iat must be a positive Unix timestamp' }),\n exp: z.number().int().positive({ message: 'exp must be a positive Unix timestamp' }),\n credential_metadata_uri: z.url({ message: 'credential_metadata_uri must be a valid URL' }),\n credential_metadata: zCredentialIssuerMetadataSchema,\n })\n .refine((data) => data.exp > data.iat, { message: 'exp must be after iat', path: ['exp'] })\n .refine((data) => new Date(data.exp) < new Date(), { message: 'exp must be after iat', path: ['exp'] })\n .refine(\n (data) => {\n return data.credential_metadata_uri === credentialMetadataUri\n },\n {\n message: `credential_metadata_uri must match source '${credentialMetadataUri}'`,\n path: ['credential_metadata_uri'],\n }\n )\n .parse(p)\n\n const toBeVerified = `${headerString}.${payloadString}`\n\n await verifier(header.x5c, toBeVerified, base64url.decode(signature))\n\n return payload\n}\n","import { type CredentialIssuerMetadata, zCredentialIssuerMetadataSchema } from '@openid4vc/openid4vci'\nimport z from 'zod'\n\nconst zCredentialIssuerMetadataWithMetadataUri = zCredentialIssuerMetadataSchema.extend({\n credential_metadata_uri: z.url().optional(),\n})\n\n/**\n *\n * Additional check for the Credential Issuer Metadata to see if there is a `credential_metadata_uri` available\n *\n */\nexport const parseCredentialMetadataUri = (cim: CredentialIssuerMetadata | Record<string, unknown>) =>\n zCredentialIssuerMetadataWithMetadataUri.parse(cim) as z.infer<typeof zCredentialIssuerMetadataWithMetadataUri> &\n CredentialIssuerMetadata\n\nexport type IssuerMetadataWithCredentialMetadataUri = ReturnType<typeof parseCredentialMetadataUri>\n"],"mappings":";;;;AAMA,IAAY,YAAL,yBAAA,WAAA;AACL,WAAA,aAAA;AACA,WAAA,eAAA;AACA,WAAA,WAAA;AACA,WAAA,aAAA;AACA,WAAA,aAAA;AACA,WAAA,iBAAA;AACA,WAAA,iBAAA;AACA,WAAA,uBAAA;AACA,WAAA,eAAA;AACA,WAAA,kBAAA;AACA,WAAA,SAAA;;KACD;AAED,MAAM,kBAAkB,OAAO,OAAO,UAAU,CAAC,KAAK,IAAI;AAC1D,MAAM,iBAAiB,IAAI,OAAO,cAAc,gBAAgB,IAAI;AAGpE,MAAM,2BAA2B,EAAE,OAAO,EACxC,wBAAwB,EAAE,OACxB,EAAE,QAAQ,CA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MAAM,2CAA2C,gCAAgC,OAAO,EACtF,yBAAyB,EAAE,KAAK,CAAC,UAAU,EAC5C,CAAC;;;;;;AAOF,MAAa,8BAA8B,QACzC,yCAAyC,MAAM,IAAI"}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@owf/eudi-sca",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Tools and utilities for EUDI Strong Customer Authentication per TS12",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"exports": "./src/index.ts",
|
|
10
|
+
"homepage": "https://github.com/openwallet-foundation-labs/identity-common-ts/tree/main/packages/eudi-sca",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/openwallet-foundation-labs/identity-common-ts",
|
|
14
|
+
"directory": "packages/eudi-sca"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"module": "./dist/index.mjs",
|
|
18
|
+
"types": "./dist/index.d.mts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": "./dist/index.mjs",
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"sca",
|
|
26
|
+
"eudi",
|
|
27
|
+
"TS12",
|
|
28
|
+
"wallet"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsdown src/index.ts --format esm --dts --sourcemap"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@openid4vc/openid4vci": "0.5.0-alpha-20260415063740",
|
|
35
|
+
"@owf/crypto": "workspace:",
|
|
36
|
+
"@owf/identity-common": "workspace:",
|
|
37
|
+
"@owf/mdoc": "^0.6.0",
|
|
38
|
+
"@sd-jwt/core": "^0.19.0",
|
|
39
|
+
"zod": "^4.3.6"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"nock": "^14.0.13"
|
|
43
|
+
}
|
|
44
|
+
}
|