@sphereon/ssi-sdk.vc-status-list 0.34.1-feature.SSISDK.17.bitstring.sl.10 → 0.34.1-feature.SSISDK.17.bitstring.sl.13

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.cts CHANGED
@@ -1,11 +1,13 @@
1
1
  import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
2
- import { StatusListIndexingDirection, StatusPurpose2021, StatusListType, IIssuer, CredentialProofFormat, StatusListDriverType, StatusListCredential, StatusListCredentialIdMode, ICredentialStatus, OrPromise, ICredential, IVerifiableCredential } from '@sphereon/ssi-types';
3
- import { IPluginMethodMap, IAgentContext, ICredentialIssuer, ICredentialVerifier, IKeyManager, ICredentialPlugin, CredentialPayload } from '@veramo/core';
2
+ import { StatusListIndexingDirection, StatusPurpose2021, StatusListType, IIssuer, CredentialProofFormat, StatusListDriverType, StatusListCredential, ICredentialStatus, OrPromise, ICredential, IVerifiableCredential } from '@sphereon/ssi-types';
3
+ import { IPluginMethodMap, IAgentContext, ICredentialIssuer, ICredentialVerifier, IKeyManager, CredentialPayload } from '@veramo/core';
4
4
  import { DataSource } from 'typeorm';
5
5
  import { BitsPerStatus } from '@sd-jwt/jwt-status-list';
6
6
  import { SdJwtVcPayload } from '@sd-jwt/sd-jwt-vc';
7
7
  import { StatusListOpts } from '@sphereon/oid4vci-common';
8
8
  import { BitstringStatusPurpose } from '@4sure-tech/vc-bitstring-status-lists';
9
+ import { IVcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm';
10
+ import { IAddStatusListArgs, StatusListEntity, IStatusListEntryEntity, IBitstringStatusListEntryEntity } from '@sphereon/ssi-sdk.data-store';
9
11
  import { StatusMethod } from 'credential-status';
10
12
 
11
13
  declare enum StatusOAuth {
@@ -23,7 +25,7 @@ type StatusList2021Args = {
23
25
  statusPurpose?: StatusPurpose2021;
24
26
  };
25
27
  type OAuthStatusListArgs = {
26
- bitsPerStatus?: BitsPerStatus;
28
+ bitsPerStatus: BitsPerStatus;
27
29
  expiresAt?: Date;
28
30
  };
29
31
  type BitstringStatusListArgs = {
@@ -81,35 +83,38 @@ interface UpdateStatusListFromStatusListCredentialArgs {
81
83
  value: number | Status2021 | StatusOAuth | BitstringStatus;
82
84
  }
83
85
  interface StatusListResult {
86
+ id: string;
84
87
  encodedList: string;
85
- statusListCredential: StatusListCredential;
86
- length: number;
88
+ issuer: string | IIssuer;
87
89
  type: StatusListType;
88
90
  proofFormat: CredentialProofFormat;
89
- id: string;
91
+ length: number;
92
+ statusListCredential: StatusListCredential;
90
93
  statuslistContentType: string;
91
- issuer: string | IIssuer;
92
- statusList2021?: StatusList2021Details;
93
- oauthStatusList?: OAuthStatusDetails;
94
- bitstringStatusList?: BitstringStatusDetails;
95
94
  correlationId?: string;
96
95
  driverType?: StatusListDriverType;
97
- credentialIdMode?: StatusListCredentialIdMode;
98
- }
99
- interface StatusList2021Details {
100
- indexingDirection: StatusListIndexingDirection;
101
- statusPurpose?: StatusPurpose2021;
102
- }
103
- interface OAuthStatusDetails {
104
- bitsPerStatus?: BitsPerStatus;
96
+ indexingDirection?: StatusListIndexingDirection;
97
+ statusPurpose?: StatusPurpose2021 | BitstringStatusPurpose | BitstringStatusPurpose[];
98
+ bitsPerStatus?: number;
105
99
  expiresAt?: Date;
106
- }
107
- interface BitstringStatusDetails {
108
- statusPurpose: BitstringStatusPurpose;
109
- bitsPerStatus: number;
110
100
  validFrom?: Date;
111
101
  validUntil?: Date;
112
102
  ttl?: number;
103
+ statusList2021?: {
104
+ indexingDirection: StatusListIndexingDirection;
105
+ statusPurpose: StatusPurpose2021;
106
+ };
107
+ oauthStatusList?: {
108
+ bitsPerStatus: number;
109
+ expiresAt?: Date;
110
+ };
111
+ bitstringStatusList?: {
112
+ statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[];
113
+ bitsPerStatus?: number;
114
+ validFrom?: Date;
115
+ validUntil?: Date;
116
+ ttl?: number;
117
+ };
113
118
  }
114
119
  interface StatusList2021EntryCredentialStatus extends ICredentialStatus {
115
120
  type: 'StatusList2021Entry';
@@ -244,8 +249,8 @@ type SignedStatusListData = {
244
249
  statusListCredential: StatusListCredential;
245
250
  encodedList: string;
246
251
  };
247
- type IRequiredPlugins = ICredentialPlugin & IIdentifierResolution;
248
- type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & ICredentialPlugin>;
252
+ type IRequiredPlugins = IVcdmCredentialPlugin & IIdentifierResolution;
253
+ type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & IVcdmCredentialPlugin>;
249
254
 
250
255
  declare function fetchStatusListCredential(args: {
251
256
  statusListCredential: string;
@@ -296,21 +301,27 @@ declare function simpleCheckStatusFromStatusListUrl(args: {
296
301
  }): Promise<number | Status2021 | StatusOAuth | BitstringStatus>;
297
302
  declare function checkStatusIndexFromStatusListCredential(args: {
298
303
  statusListCredential: StatusListCredential;
299
- statusPurpose?: StatusPurpose2021;
304
+ statusPurpose?: StatusPurpose2021 | string | string[];
300
305
  type?: StatusListType | 'StatusList2021Entry' | 'BitstringStatusListEntry';
301
306
  id?: string;
302
307
  statusListIndex: string | number;
303
308
  bitsPerStatus?: number;
304
309
  }): Promise<number | Status2021 | StatusOAuth | BitstringStatus>;
305
- declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(ICredentialPlugin | any) & IIdentifierResolution>): Promise<StatusListResult>;
306
- declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
307
- declare function statusListCredentialToDetails({ correlationId, driverType, statusListCredential, bitsPerStatus, }: {
310
+ declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(IVcdmCredentialPlugin | any) & IIdentifierResolution>): Promise<StatusListResult>;
311
+ declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
312
+ declare function statusListCredentialToDetails({ statusListType, correlationId, driverType, statusListCredential, bitsPerStatus, }: {
313
+ statusListType: StatusListType;
308
314
  statusListCredential: StatusListCredential;
309
315
  correlationId?: string;
310
316
  driverType?: StatusListDriverType;
311
317
  bitsPerStatus?: number;
312
- }): Promise<StatusListResult>;
313
- declare function updateStatusListIndexFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
314
- declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
318
+ }): Promise<StatusListResult & Partial<IAddStatusListArgs>>;
319
+ declare function createCredentialStatusFromStatusList(args: {
320
+ statusList: StatusListEntity;
321
+ statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
322
+ statusListIndex: number;
323
+ }): Promise<StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus>;
324
+ declare function updateStatusListIndexFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
325
+ declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
315
326
 
316
- export { type BaseCreateNewStatusListArgs, type BitstringStatus, type BitstringStatusListArgs, type BitstringStatusListEntryCredentialStatus, 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 UpdateBitstringStatusListArgs, type UpdateOAuthStatusListArgs, type UpdateStatusList2021Args, type UpdateStatusListFromEncodedListArgs, type UpdateStatusListFromStatusListCredentialArgs, type UpdateStatusListIndexArgs, checkStatusForCredential, checkStatusIndexFromStatusListCredential, createNewStatusList, fetchStatusListCredential, simpleCheckStatusFromStatusListUrl, statusList2021ToVerifiableCredential, statusListCredentialToDetails, statusPluginStatusFunction, updateStatusIndexFromStatusListCredential, updateStatusListIndexFromEncodedList, vcLibCheckStatusFunction };
327
+ export { type BaseCreateNewStatusListArgs, type BitstringStatus, type BitstringStatusListArgs, type BitstringStatusListEntryCredentialStatus, 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 UpdateBitstringStatusListArgs, type UpdateOAuthStatusListArgs, type UpdateStatusList2021Args, type UpdateStatusListFromEncodedListArgs, type UpdateStatusListFromStatusListCredentialArgs, type UpdateStatusListIndexArgs, checkStatusForCredential, checkStatusIndexFromStatusListCredential, createCredentialStatusFromStatusList, createNewStatusList, fetchStatusListCredential, simpleCheckStatusFromStatusListUrl, statusList2021ToVerifiableCredential, statusListCredentialToDetails, statusPluginStatusFunction, updateStatusIndexFromStatusListCredential, updateStatusListIndexFromEncodedList, vcLibCheckStatusFunction };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
2
- import { StatusListIndexingDirection, StatusPurpose2021, StatusListType, IIssuer, CredentialProofFormat, StatusListDriverType, StatusListCredential, StatusListCredentialIdMode, ICredentialStatus, OrPromise, ICredential, IVerifiableCredential } from '@sphereon/ssi-types';
3
- import { IPluginMethodMap, IAgentContext, ICredentialIssuer, ICredentialVerifier, IKeyManager, ICredentialPlugin, CredentialPayload } from '@veramo/core';
2
+ import { StatusListIndexingDirection, StatusPurpose2021, StatusListType, IIssuer, CredentialProofFormat, StatusListDriverType, StatusListCredential, ICredentialStatus, OrPromise, ICredential, IVerifiableCredential } from '@sphereon/ssi-types';
3
+ import { IPluginMethodMap, IAgentContext, ICredentialIssuer, ICredentialVerifier, IKeyManager, CredentialPayload } from '@veramo/core';
4
4
  import { DataSource } from 'typeorm';
5
5
  import { BitsPerStatus } from '@sd-jwt/jwt-status-list';
6
6
  import { SdJwtVcPayload } from '@sd-jwt/sd-jwt-vc';
7
7
  import { StatusListOpts } from '@sphereon/oid4vci-common';
8
8
  import { BitstringStatusPurpose } from '@4sure-tech/vc-bitstring-status-lists';
9
+ import { IVcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm';
10
+ import { IAddStatusListArgs, StatusListEntity, IStatusListEntryEntity, IBitstringStatusListEntryEntity } from '@sphereon/ssi-sdk.data-store';
9
11
  import { StatusMethod } from 'credential-status';
10
12
 
11
13
  declare enum StatusOAuth {
@@ -23,7 +25,7 @@ type StatusList2021Args = {
23
25
  statusPurpose?: StatusPurpose2021;
24
26
  };
25
27
  type OAuthStatusListArgs = {
26
- bitsPerStatus?: BitsPerStatus;
28
+ bitsPerStatus: BitsPerStatus;
27
29
  expiresAt?: Date;
28
30
  };
29
31
  type BitstringStatusListArgs = {
@@ -81,35 +83,38 @@ interface UpdateStatusListFromStatusListCredentialArgs {
81
83
  value: number | Status2021 | StatusOAuth | BitstringStatus;
82
84
  }
83
85
  interface StatusListResult {
86
+ id: string;
84
87
  encodedList: string;
85
- statusListCredential: StatusListCredential;
86
- length: number;
88
+ issuer: string | IIssuer;
87
89
  type: StatusListType;
88
90
  proofFormat: CredentialProofFormat;
89
- id: string;
91
+ length: number;
92
+ statusListCredential: StatusListCredential;
90
93
  statuslistContentType: string;
91
- issuer: string | IIssuer;
92
- statusList2021?: StatusList2021Details;
93
- oauthStatusList?: OAuthStatusDetails;
94
- bitstringStatusList?: BitstringStatusDetails;
95
94
  correlationId?: string;
96
95
  driverType?: StatusListDriverType;
97
- credentialIdMode?: StatusListCredentialIdMode;
98
- }
99
- interface StatusList2021Details {
100
- indexingDirection: StatusListIndexingDirection;
101
- statusPurpose?: StatusPurpose2021;
102
- }
103
- interface OAuthStatusDetails {
104
- bitsPerStatus?: BitsPerStatus;
96
+ indexingDirection?: StatusListIndexingDirection;
97
+ statusPurpose?: StatusPurpose2021 | BitstringStatusPurpose | BitstringStatusPurpose[];
98
+ bitsPerStatus?: number;
105
99
  expiresAt?: Date;
106
- }
107
- interface BitstringStatusDetails {
108
- statusPurpose: BitstringStatusPurpose;
109
- bitsPerStatus: number;
110
100
  validFrom?: Date;
111
101
  validUntil?: Date;
112
102
  ttl?: number;
103
+ statusList2021?: {
104
+ indexingDirection: StatusListIndexingDirection;
105
+ statusPurpose: StatusPurpose2021;
106
+ };
107
+ oauthStatusList?: {
108
+ bitsPerStatus: number;
109
+ expiresAt?: Date;
110
+ };
111
+ bitstringStatusList?: {
112
+ statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[];
113
+ bitsPerStatus?: number;
114
+ validFrom?: Date;
115
+ validUntil?: Date;
116
+ ttl?: number;
117
+ };
113
118
  }
114
119
  interface StatusList2021EntryCredentialStatus extends ICredentialStatus {
115
120
  type: 'StatusList2021Entry';
@@ -244,8 +249,8 @@ type SignedStatusListData = {
244
249
  statusListCredential: StatusListCredential;
245
250
  encodedList: string;
246
251
  };
247
- type IRequiredPlugins = ICredentialPlugin & IIdentifierResolution;
248
- type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & ICredentialPlugin>;
252
+ type IRequiredPlugins = IVcdmCredentialPlugin & IIdentifierResolution;
253
+ type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & IVcdmCredentialPlugin>;
249
254
 
250
255
  declare function fetchStatusListCredential(args: {
251
256
  statusListCredential: string;
@@ -296,21 +301,27 @@ declare function simpleCheckStatusFromStatusListUrl(args: {
296
301
  }): Promise<number | Status2021 | StatusOAuth | BitstringStatus>;
297
302
  declare function checkStatusIndexFromStatusListCredential(args: {
298
303
  statusListCredential: StatusListCredential;
299
- statusPurpose?: StatusPurpose2021;
304
+ statusPurpose?: StatusPurpose2021 | string | string[];
300
305
  type?: StatusListType | 'StatusList2021Entry' | 'BitstringStatusListEntry';
301
306
  id?: string;
302
307
  statusListIndex: string | number;
303
308
  bitsPerStatus?: number;
304
309
  }): Promise<number | Status2021 | StatusOAuth | BitstringStatus>;
305
- declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(ICredentialPlugin | any) & IIdentifierResolution>): Promise<StatusListResult>;
306
- declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
307
- declare function statusListCredentialToDetails({ correlationId, driverType, statusListCredential, bitsPerStatus, }: {
310
+ declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(IVcdmCredentialPlugin | any) & IIdentifierResolution>): Promise<StatusListResult>;
311
+ declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
312
+ declare function statusListCredentialToDetails({ statusListType, correlationId, driverType, statusListCredential, bitsPerStatus, }: {
313
+ statusListType: StatusListType;
308
314
  statusListCredential: StatusListCredential;
309
315
  correlationId?: string;
310
316
  driverType?: StatusListDriverType;
311
317
  bitsPerStatus?: number;
312
- }): Promise<StatusListResult>;
313
- declare function updateStatusListIndexFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
314
- declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
318
+ }): Promise<StatusListResult & Partial<IAddStatusListArgs>>;
319
+ declare function createCredentialStatusFromStatusList(args: {
320
+ statusList: StatusListEntity;
321
+ statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
322
+ statusListIndex: number;
323
+ }): Promise<StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus>;
324
+ declare function updateStatusListIndexFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
325
+ declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
315
326
 
316
- export { type BaseCreateNewStatusListArgs, type BitstringStatus, type BitstringStatusListArgs, type BitstringStatusListEntryCredentialStatus, 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 UpdateBitstringStatusListArgs, type UpdateOAuthStatusListArgs, type UpdateStatusList2021Args, type UpdateStatusListFromEncodedListArgs, type UpdateStatusListFromStatusListCredentialArgs, type UpdateStatusListIndexArgs, checkStatusForCredential, checkStatusIndexFromStatusListCredential, createNewStatusList, fetchStatusListCredential, simpleCheckStatusFromStatusListUrl, statusList2021ToVerifiableCredential, statusListCredentialToDetails, statusPluginStatusFunction, updateStatusIndexFromStatusListCredential, updateStatusListIndexFromEncodedList, vcLibCheckStatusFunction };
327
+ export { type BaseCreateNewStatusListArgs, type BitstringStatus, type BitstringStatusListArgs, type BitstringStatusListEntryCredentialStatus, 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 UpdateBitstringStatusListArgs, type UpdateOAuthStatusListArgs, type UpdateStatusList2021Args, type UpdateStatusListFromEncodedListArgs, type UpdateStatusListFromStatusListCredentialArgs, type UpdateStatusListIndexArgs, checkStatusForCredential, checkStatusIndexFromStatusListCredential, createCredentialStatusFromStatusList, createNewStatusList, fetchStatusListCredential, simpleCheckStatusFromStatusListUrl, statusList2021ToVerifiableCredential, statusListCredentialToDetails, statusPluginStatusFunction, updateStatusIndexFromStatusListCredential, updateStatusListIndexFromEncodedList, vcLibCheckStatusFunction };