@sphereon/ssi-sdk.vc-status-list 0.33.1-feature.vcdm2.tsup.32 → 0.33.1-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/functions.d.ts +69 -0
  2. package/dist/functions.d.ts.map +1 -0
  3. package/dist/functions.js +200 -0
  4. package/dist/functions.js.map +1 -0
  5. package/dist/impl/IStatusList.d.ts +26 -0
  6. package/dist/impl/IStatusList.d.ts.map +1 -0
  7. package/dist/impl/IStatusList.js +3 -0
  8. package/dist/impl/IStatusList.js.map +1 -0
  9. package/dist/impl/OAuthStatusList.d.ts +21 -0
  10. package/dist/impl/OAuthStatusList.d.ts.map +1 -0
  11. package/dist/impl/OAuthStatusList.js +155 -0
  12. package/dist/impl/OAuthStatusList.js.map +1 -0
  13. package/dist/impl/StatusList2021.d.ts +16 -0
  14. package/dist/impl/StatusList2021.d.ts.map +1 -0
  15. package/dist/impl/StatusList2021.js +186 -0
  16. package/dist/impl/StatusList2021.js.map +1 -0
  17. package/dist/impl/StatusListFactory.d.ts +11 -0
  18. package/dist/impl/StatusListFactory.d.ts.map +1 -0
  19. package/dist/impl/StatusListFactory.js +32 -0
  20. package/dist/impl/StatusListFactory.js.map +1 -0
  21. package/dist/impl/encoding/cbor.d.ts +6 -0
  22. package/dist/impl/encoding/cbor.d.ts.map +1 -0
  23. package/dist/impl/encoding/cbor.js +140 -0
  24. package/dist/impl/encoding/cbor.js.map +1 -0
  25. package/dist/impl/encoding/common.d.ts +12 -0
  26. package/dist/impl/encoding/common.d.ts.map +1 -0
  27. package/dist/impl/encoding/common.js +17 -0
  28. package/dist/impl/encoding/common.js.map +1 -0
  29. package/dist/impl/encoding/jwt.d.ts +9 -0
  30. package/dist/impl/encoding/jwt.d.ts.map +1 -0
  31. package/dist/impl/encoding/jwt.js +74 -0
  32. package/dist/impl/encoding/jwt.js.map +1 -0
  33. package/dist/index.d.ts +3 -273
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +19 -944
  36. package/dist/index.js.map +1 -1
  37. package/dist/types/index.d.ts +209 -0
  38. package/dist/types/index.d.ts.map +1 -0
  39. package/dist/types/index.js +15 -0
  40. package/dist/types/index.js.map +1 -0
  41. package/dist/utils.d.ts +17 -0
  42. package/dist/utils.d.ts.map +1 -0
  43. package/dist/utils.js +88 -0
  44. package/dist/utils.js.map +1 -0
  45. package/package.json +16 -27
  46. package/src/functions.ts +0 -2
  47. package/src/impl/encoding/cbor.ts +1 -1
  48. package/src/types/index.ts +1 -1
  49. package/dist/index.cjs +0 -977
  50. package/dist/index.cjs.map +0 -1
  51. package/dist/index.d.cts +0 -275
package/dist/index.d.ts CHANGED
@@ -1,275 +1,5 @@
1
- import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
2
- import { StatusListIndexingDirection, StatusPurpose2021, StatusListType, IIssuer, ProofFormat, StatusListDriverType, StatusListCredential, StatusListCredentialIdMode, ICredentialStatus, OrPromise, ICredential, IVerifiableCredential } from '@sphereon/ssi-types';
3
- import { IPluginMethodMap, IAgentContext, ICredentialIssuer, ICredentialVerifier, IKeyManager, ICredentialPlugin, CredentialPayload } from '@veramo/core';
4
- import { DataSource } from 'typeorm';
5
- import { BitsPerStatus } from '@sd-jwt/jwt-status-list';
6
- import { SdJwtVcPayload } from '@sd-jwt/sd-jwt-vc';
7
- import { StatusListOpts } from '@sphereon/oid4vci-common';
8
- import { StatusMethod } from 'credential-status';
9
-
10
- declare enum StatusOAuth {
11
- Valid = 0,
12
- Invalid = 1,
13
- Suspended = 2
14
- }
15
- declare enum Status2021 {
16
- Valid = 0,
17
- Invalid = 1
18
- }
19
- type StatusList2021Args = {
20
- indexingDirection: StatusListIndexingDirection;
21
- statusPurpose?: StatusPurpose2021;
22
- };
23
- type OAuthStatusListArgs = {
24
- bitsPerStatus?: BitsPerStatus;
25
- expiresAt?: Date;
26
- };
27
- type BaseCreateNewStatusListArgs = {
28
- type: StatusListType;
29
- id: string;
30
- issuer: string | IIssuer;
31
- correlationId?: string;
32
- length?: number;
33
- proofFormat?: ProofFormat;
34
- keyRef?: string;
35
- statusList2021?: StatusList2021Args;
36
- oauthStatusList?: OAuthStatusListArgs;
37
- driverType?: StatusListDriverType;
38
- };
39
- type UpdateStatusList2021Args = {
40
- statusPurpose: StatusPurpose2021;
41
- };
42
- type UpdateOAuthStatusListArgs = {
43
- bitsPerStatus: BitsPerStatus;
44
- expiresAt?: Date;
45
- };
46
- interface UpdateStatusListFromEncodedListArgs {
47
- type?: StatusListType;
48
- statusListIndex: number | string;
49
- value: boolean;
50
- proofFormat?: ProofFormat;
51
- keyRef?: string;
52
- correlationId?: string;
53
- encodedList: string;
54
- issuer: string | IIssuer;
55
- id: string;
56
- statusList2021?: UpdateStatusList2021Args;
57
- oauthStatusList?: UpdateOAuthStatusListArgs;
58
- }
59
- interface UpdateStatusListFromStatusListCredentialArgs {
60
- statusListCredential: StatusListCredential;
61
- keyRef?: string;
62
- statusListIndex: number | string;
63
- value: number | Status2021 | StatusOAuth;
64
- }
65
- interface StatusListResult {
66
- encodedList: string;
67
- statusListCredential: StatusListCredential;
68
- length: number;
69
- type: StatusListType;
70
- proofFormat: ProofFormat;
71
- id: string;
72
- statuslistContentType: string;
73
- issuer: string | IIssuer;
74
- statusList2021?: StatusList2021Details;
75
- oauthStatusList?: OAuthStatusDetails;
76
- correlationId?: string;
77
- driverType?: StatusListDriverType;
78
- credentialIdMode?: StatusListCredentialIdMode;
79
- }
80
- interface StatusList2021Details {
81
- indexingDirection: StatusListIndexingDirection;
82
- statusPurpose?: StatusPurpose2021;
83
- }
84
- interface OAuthStatusDetails {
85
- bitsPerStatus?: BitsPerStatus;
86
- expiresAt?: Date;
87
- }
88
- interface StatusList2021EntryCredentialStatus extends ICredentialStatus {
89
- type: 'StatusList2021Entry';
90
- statusPurpose: StatusPurpose2021;
91
- statusListIndex: string;
92
- statusListCredential: string;
93
- }
94
- interface StatusListOAuthEntryCredentialStatus extends ICredentialStatus {
95
- type: 'OAuthStatusListEntry';
96
- bitsPerStatus: number;
97
- statusListIndex: string;
98
- statusListCredential: string;
99
- expiresAt?: Date;
100
- }
101
- interface StatusList2021ToVerifiableCredentialArgs {
102
- issuer: string | IIssuer;
103
- id: string;
104
- type?: StatusListType;
105
- proofFormat?: ProofFormat;
106
- keyRef?: string;
107
- encodedList: string;
108
- statusPurpose: StatusPurpose2021;
109
- }
110
- interface CreateStatusListArgs {
111
- issuer: string | IIssuer;
112
- id: string;
113
- proofFormat?: ProofFormat;
114
- keyRef?: string;
115
- correlationId?: string;
116
- length?: number;
117
- statusList2021?: StatusList2021Args;
118
- oauthStatusList?: OAuthStatusListArgs;
119
- }
120
- interface UpdateStatusListIndexArgs {
121
- statusListCredential: StatusListCredential;
122
- statusListIndex: number | string;
123
- value: number | Status2021 | StatusOAuth;
124
- keyRef?: string;
125
- expiresAt?: Date;
126
- }
127
- interface CheckStatusIndexArgs {
128
- statusListCredential: StatusListCredential;
129
- statusListIndex: string | number;
130
- }
131
- interface ToStatusListDetailsArgs {
132
- statusListPayload: StatusListCredential;
133
- correlationId?: string;
134
- driverType?: StatusListDriverType;
135
- }
136
1
  /**
137
- * The interface definition for a plugin that can add statuslist info to a credential
138
- *
139
- * @remarks Please see {@link https://www.w3.org/TR/vc-data-model | W3C Verifiable Credentials data model}
140
- *
141
- * @beta This API is likely to change without a BREAKING CHANGE notice
142
2
  */
143
- interface IStatusListPlugin extends IPluginMethodMap {
144
- /**
145
- * Create a new status list
146
- *
147
- * @param args Status list information like type and size
148
- * @param context - This reserved param is automatically added and handled by the framework, *do not override*
149
- *
150
- * @returns - The details of the newly created status list
151
- */
152
- slCreateStatusList(args: CreateNewStatusListArgs, context: IRequiredContext): Promise<StatusListResult>;
153
- /**
154
- * Ensures status list info like index and list id is added to a credential
155
- *
156
- * @param args - Arguments necessary to add the statuslist info.
157
- * @param context - This reserved param is automatically added and handled by the framework, *do not override*
158
- *
159
- * @returns - a promise that resolves to the credential now with status support
160
- *
161
- * @beta This API is likely to change without a BREAKING CHANGE notice
162
- */
163
- slAddStatusToCredential(args: IAddStatusToCredentialArgs, context: IRequiredContext): Promise<CredentialWithStatusSupport>;
164
- slAddStatusToSdJwtCredential(args: IAddStatusToSdJwtCredentialArgs, context: IRequiredContext): Promise<SdJwtVcPayload>;
165
- /**
166
- * Get the status list using the configured driver for the SL. Normally a correlationId or id should suffice. Optionally accepts a dbName/datasource
167
- * @param args
168
- * @param context
169
- */
170
- slGetStatusList(args: GetStatusListArgs, context: IRequiredContext): Promise<StatusListResult>;
171
- /**
172
- * Import status lists when noy yet present
173
- *
174
- * @param imports Array of status list information like type and size
175
- * @param context - This reserved param is automatically added and handled by the framework, *do not override*
176
- */
177
- slImportStatusLists(imports: Array<CreateNewStatusListArgs>, context: IRequiredContext): Promise<boolean>;
178
- }
179
- type CreateNewStatusListFuncArgs = BaseCreateNewStatusListArgs;
180
- type CreateNewStatusListArgs = BaseCreateNewStatusListArgs & {
181
- dbName?: string;
182
- dataSource?: OrPromise<DataSource>;
183
- isDefault?: boolean;
184
- };
185
- type IAddStatusToCredentialArgs = Omit<IIssueCredentialStatusOpts, 'dataSource'> & {
186
- credential: CredentialWithStatusSupport;
187
- };
188
- type IAddStatusToSdJwtCredentialArgs = Omit<IIssueCredentialStatusOpts, 'dataSource'> & {
189
- credential: SdJwtVcPayload;
190
- };
191
- interface IIssueCredentialStatusOpts {
192
- dataSource?: DataSource;
193
- statusLists?: Array<StatusListOpts>;
194
- credentialId?: string;
195
- value?: string;
196
- }
197
- type GetStatusListArgs = {
198
- id?: string;
199
- correlationId?: string;
200
- dataSource?: OrPromise<DataSource>;
201
- dbName?: string;
202
- };
203
- type CredentialWithStatusSupport = ICredential | CredentialPayload | IVerifiableCredential;
204
- type SignedStatusListData = {
205
- statusListCredential: StatusListCredential;
206
- encodedList: string;
207
- };
208
- type IRequiredPlugins = ICredentialPlugin & IIdentifierResolution;
209
- type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & ICredentialPlugin>;
210
-
211
- declare function fetchStatusListCredential(args: {
212
- statusListCredential: string;
213
- }): Promise<StatusListCredential>;
214
- declare function statusPluginStatusFunction(args: {
215
- documentLoader: any;
216
- suite: any;
217
- mandatoryCredentialStatus?: boolean;
218
- verifyStatusListCredential?: boolean;
219
- verifyMatchingIssuers?: boolean;
220
- errorUnknownListType?: boolean;
221
- }): StatusMethod;
222
- /**
223
- * Function that can be used together with @digitalbazar/vc and @digitialcredentials/vc
224
- * @param args
225
- */
226
- declare function vcLibCheckStatusFunction(args: {
227
- mandatoryCredentialStatus?: boolean;
228
- verifyStatusListCredential?: boolean;
229
- verifyMatchingIssuers?: boolean;
230
- errorUnknownListType?: boolean;
231
- }): (args: {
232
- credential: StatusListCredential;
233
- documentLoader: any;
234
- suite: any;
235
- }) => Promise<{
236
- verified: boolean;
237
- error?: any;
238
- }>;
239
- declare function checkStatusForCredential(args: {
240
- credential: StatusListCredential;
241
- documentLoader: any;
242
- suite: any;
243
- mandatoryCredentialStatus?: boolean;
244
- verifyStatusListCredential?: boolean;
245
- verifyMatchingIssuers?: boolean;
246
- errorUnknownListType?: boolean;
247
- }): Promise<{
248
- verified: boolean;
249
- error?: any;
250
- }>;
251
- declare function simpleCheckStatusFromStatusListUrl(args: {
252
- statusListCredential: string;
253
- statusPurpose?: StatusPurpose2021;
254
- type?: StatusListType | 'StatusList2021Entry';
255
- id?: string;
256
- statusListIndex: string;
257
- }): Promise<number | Status2021 | StatusOAuth>;
258
- declare function checkStatusIndexFromStatusListCredential(args: {
259
- statusListCredential: StatusListCredential;
260
- statusPurpose?: StatusPurpose2021;
261
- type?: StatusListType | 'StatusList2021Entry';
262
- id?: string;
263
- statusListIndex: string | number;
264
- }): Promise<number | Status2021 | StatusOAuth>;
265
- declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
266
- declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
267
- declare function statusListCredentialToDetails(args: {
268
- statusListCredential: StatusListCredential;
269
- correlationId?: string;
270
- driverType?: StatusListDriverType;
271
- }): Promise<StatusListResult>;
272
- declare function updateStatusListIndexFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
273
- declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
274
-
275
- export { type BaseCreateNewStatusListArgs, type CheckStatusIndexArgs, type CreateNewStatusListArgs, type CreateNewStatusListFuncArgs, type CreateStatusListArgs, type CredentialWithStatusSupport, type GetStatusListArgs, type IAddStatusToCredentialArgs, type IAddStatusToSdJwtCredentialArgs, type IIssueCredentialStatusOpts, type IRequiredContext, type IRequiredPlugins, type IStatusListPlugin, type OAuthStatusListArgs, type SignedStatusListData, Status2021, type StatusList2021Args, type StatusList2021EntryCredentialStatus, type StatusList2021ToVerifiableCredentialArgs, type StatusListOAuthEntryCredentialStatus, type StatusListResult, StatusOAuth, type ToStatusListDetailsArgs, type UpdateOAuthStatusListArgs, type UpdateStatusList2021Args, type UpdateStatusListFromEncodedListArgs, type UpdateStatusListFromStatusListCredentialArgs, type UpdateStatusListIndexArgs, checkStatusForCredential, checkStatusIndexFromStatusListCredential, createNewStatusList, fetchStatusListCredential, simpleCheckStatusFromStatusListUrl, statusList2021ToVerifiableCredential, statusListCredentialToDetails, statusPluginStatusFunction, updateStatusIndexFromStatusListCredential, updateStatusListIndexFromEncodedList, vcLibCheckStatusFunction };
3
+ export * from './types';
4
+ export * from './functions';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;GACG;AAEH,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA"}