@thirtified/eudi-dev 0.1.1 → 0.1.2

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 CHANGED
@@ -19,6 +19,8 @@ pnpm add -D @thirtified/eudi-dev
19
19
  # or: npm install --save-dev @thirtified/eudi-dev
20
20
  ```
21
21
 
22
+ With TypeScript, also install the Node types: `pnpm add -D @types/node`. The package's type definitions use them and load them for you, so you don't need `"types": ["node"]` in your tsconfig, which TypeScript 6 and later would otherwise require.
23
+
22
24
  The eudi-dev binary comes in one npm package per platform, listed as `optionalDependencies` with exact versions. The package manager installs only the one that matches your OS and CPU. Nothing is downloaded at install time or at runtime, and there is no install script.
23
25
 
24
26
  | Platform | Package | Upstream asset |
@@ -91,7 +93,16 @@ File-valued options (`key`, `trustedList`, `cert`, `csr`, `dcql`, `claims`, `ca`
91
93
 
92
94
  These commands work on the wallet in the instance's `EUDI_DEV_HOME`, which is created on first use. Pass `home` to keep state between instances.
93
95
 
96
+ The example continues the one above: it uses `eudi` and `query` from there. The access-certificate calls need a PEM certificate signing request for your verifier's key, here `verifier.csr` in the working directory:
97
+
98
+ ```bash
99
+ openssl ecparam -name prime256v1 -genkey -noout -out verifier.key
100
+ openssl req -new -key verifier.key -subj "/CN=shop.example" -out verifier.csr
101
+ ```
102
+
94
103
  ```ts
104
+ import { readFile } from 'node:fs/promises';
105
+
95
106
  const issued = await eudi.issue.sdjwt({ pid: true, wallet: true }); // issued.id
96
107
  const trustedList = await eudi.trust.show({ vct: 'urn:eudi:pid:1' }); // signed JWT
97
108
  await eudi.validate(issued.credential, { trustedList, statusList: false });
@@ -99,13 +110,18 @@ await eudi.validate(issued.credential, { trustedList, statusList: false });
99
110
  const caPem = await eudi.trust.caCert();
100
111
  const caJwks = await eudi.trust.caJwks();
101
112
 
113
+ // Register a verifier, then get its registration and access certificates
102
114
  const rp = await eudi.registrar.verifiers.add({ name: 'Shop', purpose: 'Age check', dcql: query });
103
115
  const id = rp.identifier[0]!.identifier;
104
116
  const { registrationCertificate, verifierInfo } = await eudi.registrar.registrationCert({ identifier: id });
117
+ const { certificate, chain } = await eudi.registrar.accessCert({ identifier: id, csr: { path: 'verifier.csr' } });
105
118
  await eudi.registrar.revoke({ identifier: id });
119
+
106
120
  await eudi.registrar.issuers.add({ name: 'Diplomas Inc', attestations: ['dc+sd-jwt:urn:example:diploma:1'] });
107
- await eudi.registrar.accessCert({ identifier: id, csr: { path: 'verifier.csr' } });
108
- await eudi.registrar.enrol({ relyingParty: { tradeName: 'X' }, access: { csr: csrPem } });
121
+
122
+ // Register and get an access certificate in one step. The CSR can also be passed as content.
123
+ const csrPem = await readFile('verifier.csr', 'utf8');
124
+ await eudi.registrar.enrol({ relyingParty: { tradeName: 'Shop' }, access: { csr: csrPem } });
109
125
  ```
110
126
 
111
127
  A wallet-issued credential points to the wallet's own status list, which only `wallet serve` serves. Without a running server, validate it with `statusList: false`.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" preserve="true" />
1
2
  export { PLATFORM_PACKAGES, type PlatformPackage, platformPackage, type ResolveBinaryOptions, resolveBinary, } from './binary.js';
2
3
  export { type CallOptions, type CredentialCategory, type DecodeFormat, type DecodeOptions, type IssueCommonOptions, type IssueDisplayOptions, type IssueJwtOptions, type IssueMdocOptions, type IssueRegistrationOptions, type IssueResult, type IssueSdJwtOptions, isDecodedCredential, type ValidateOptions, type ValidateResult, } from './commands/credentials.js';
3
4
  export type { AccessCertOptions, AddIssuerOptions, AddVerifierOptions, AttestationOptions, ExtendIssuerOptions, ExtendVerifierOptions, IntendedUseOptions, PartyCommands, PartyOptions, RegistrarCommands, RegistrationCertOptions, RegistrationScopeOptions, } from './commands/registrar.js';
package/dist/index.js CHANGED
@@ -1,3 +1,8 @@
1
+ // The public types use Node's (NodeJS.Platform, NodeJS.Signals, ...). Load them
2
+ // for every program that imports this package, also under TypeScript 6+, where
3
+ // "types" no longer defaults to all of node_modules/@types. preserve="true"
4
+ // keeps the directive in the emitted index.d.ts.
5
+ /// <reference types="node" preserve="true" />
1
6
  export { PLATFORM_PACKAGES, platformPackage, resolveBinary, } from './binary.js';
2
7
  export { isDecodedCredential, } from './commands/credentials.js';
3
8
  export { EudiDevBinaryError, EudiDevError } from './errors.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAEjB,eAAe,EAEf,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAYL,mBAAmB,GAGpB,MAAM,2BAA2B,CAAC;AAgBnC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAA4B,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,OAAO,EAAuB,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAsD,MAAM,aAAa,CAAC;AACzF,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,iDAAiD;AACjD,8CAA8C;AAE9C,OAAO,EACL,iBAAiB,EAEjB,eAAe,EAEf,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAYL,mBAAmB,GAGpB,MAAM,2BAA2B,CAAC;AAgBnC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAA4B,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,OAAO,EAAuB,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAsD,MAAM,aAAa,CAAC;AACzF,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thirtified/eudi-dev",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Typed Node.js wrapper for the eudi-dev CLI (decode, validate, dcql, issue, trust, registrar)",
5
5
  "keywords": [
6
6
  "eudi",
package/src/index.ts CHANGED
@@ -1,3 +1,9 @@
1
+ // The public types use Node's (NodeJS.Platform, NodeJS.Signals, ...). Load them
2
+ // for every program that imports this package, also under TypeScript 6+, where
3
+ // "types" no longer defaults to all of node_modules/@types. preserve="true"
4
+ // keeps the directive in the emitted index.d.ts.
5
+ /// <reference types="node" preserve="true" />
6
+
1
7
  export {
2
8
  PLATFORM_PACKAGES,
3
9
  type PlatformPackage,