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

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
@@ -131,13 +131,6 @@ interface StatusListResult {
131
131
  statuslistContentType: string;
132
132
  correlationId?: string;
133
133
  driverType?: StatusListDriverType;
134
- indexingDirection?: StatusListIndexingDirection;
135
- statusPurpose?: StatusPurpose2021 | BitstringStatusPurpose | BitstringStatusPurpose[];
136
- bitsPerStatus?: number;
137
- expiresAt?: Date;
138
- validFrom?: Date;
139
- validUntil?: Date;
140
- ttl?: number;
141
134
  statusList2021?: {
142
135
  indexingDirection: StatusListIndexingDirection;
143
136
  statusPurpose: StatusPurpose2021;
@@ -286,9 +279,19 @@ type SignedStatusListData = {
286
279
  type IRequiredPlugins = IVcdmCredentialPlugin & IIdentifierResolution;
287
280
  type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & IVcdmCredentialPlugin>;
288
281
 
282
+ /**
283
+ * Fetches a status list credential from a URL
284
+ * @param args - Object containing the status list credential URL
285
+ * @returns Promise resolving to the fetched StatusListCredential
286
+ */
289
287
  declare function fetchStatusListCredential(args: {
290
288
  statusListCredential: string;
291
289
  }): Promise<StatusListCredential>;
290
+ /**
291
+ * Creates a status checking function for credential-status plugin
292
+ * @param args - Configuration options for status verification
293
+ * @returns StatusMethod function for checking credential status
294
+ */
292
295
  declare function statusPluginStatusFunction(args: {
293
296
  documentLoader: any;
294
297
  suite: any;
@@ -299,7 +302,8 @@ declare function statusPluginStatusFunction(args: {
299
302
  }): StatusMethod;
300
303
  /**
301
304
  * Function that can be used together with @digitalbazar/vc and @digitialcredentials/vc
302
- * @param args
305
+ * @param args - Configuration options for status verification
306
+ * @returns Function for checking credential status
303
307
  */
304
308
  declare function vcLibCheckStatusFunction(args: {
305
309
  mandatoryCredentialStatus?: boolean;
@@ -314,6 +318,11 @@ declare function vcLibCheckStatusFunction(args: {
314
318
  verified: boolean;
315
319
  error?: any;
316
320
  }>;
321
+ /**
322
+ * Checks the status of a credential using its credential status information
323
+ * @param args - Parameters for credential status verification
324
+ * @returns Promise resolving to verification result with error details if any
325
+ */
317
326
  declare function checkStatusForCredential(args: {
318
327
  credential: StatusListCredential;
319
328
  documentLoader: any;
@@ -333,6 +342,11 @@ declare function simpleCheckStatusFromStatusListUrl(args: {
333
342
  id?: string;
334
343
  statusListIndex: string;
335
344
  }): Promise<number | Status2021 | StatusOAuth>;
345
+ /**
346
+ * Checks the status at a specific index in a status list credential
347
+ * @param args - Parameters including credential and index to check
348
+ * @returns Promise resolving to status value at the specified index
349
+ */
336
350
  declare function checkStatusIndexFromStatusListCredential(args: {
337
351
  statusListCredential: StatusListCredential;
338
352
  statusPurpose?: StatusPurpose2021 | string | string[];
@@ -342,16 +356,44 @@ declare function checkStatusIndexFromStatusListCredential(args: {
342
356
  bitsPerStatus?: number;
343
357
  }): Promise<number | Status2021 | StatusOAuth>;
344
358
  declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(IVcdmCredentialPlugin | any) & IIdentifierResolution>): Promise<StatusListResult>;
359
+ /**
360
+ * Updates a status index in a status list credential
361
+ * @param args - Parameters for status update including credential and new value
362
+ * @param context - Agent context with required plugins
363
+ * @returns Promise resolving to updated status list details
364
+ */
345
365
  declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
366
+ /**
367
+ * Extracts credential details from a status list credential
368
+ * @param statusListCredential - The status list credential to extract from
369
+ * @returns Promise resolving to extracted credential details
370
+ */
346
371
  declare function extractCredentialDetails(statusListCredential: StatusListCredential): Promise<IExtractedCredentialDetails>;
347
372
  declare function toStatusListDetails(args: IToDetailsFromCredentialArgs): Promise<StatusListResult & (IStatusList2021ImplementationResult | IOAuthStatusListImplementationResult | IBitstringStatusListImplementationResult)>;
348
373
  declare function toStatusListDetails(args: IMergeDetailsWithEntityArgs): Promise<StatusListResult & (IStatusList2021ImplementationResult | IOAuthStatusListImplementationResult | IBitstringStatusListImplementationResult)>;
374
+ /**
375
+ * Creates a credential status object from status list and entry information
376
+ * @param args - Parameters including status list, entry, and index
377
+ * @returns Promise resolving to appropriate credential status type
378
+ */
349
379
  declare function createCredentialStatusFromStatusList(args: {
350
380
  statusList: StatusListEntity;
351
381
  statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
352
382
  statusListIndex: number;
353
383
  }): Promise<StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus>;
384
+ /**
385
+ * Updates a status list using a base64 encoded list of statuses
386
+ * @param args - Parameters including encoded list and update details
387
+ * @param context - Agent context with required plugins
388
+ * @returns Promise resolving to updated status list details
389
+ */
354
390
  declare function updateStatusListIndexFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
391
+ /**
392
+ * Converts a StatusList2021 to a verifiable credential
393
+ * @param args - Parameters for credential creation including issuer and encoded list
394
+ * @param context - Agent context with required plugins
395
+ * @returns Promise resolving to signed status list credential
396
+ */
355
397
  declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
356
398
 
357
399
  declare function determineStatusListType(credential: StatusListCredential): StatusListType;
package/dist/index.d.ts CHANGED
@@ -131,13 +131,6 @@ interface StatusListResult {
131
131
  statuslistContentType: string;
132
132
  correlationId?: string;
133
133
  driverType?: StatusListDriverType;
134
- indexingDirection?: StatusListIndexingDirection;
135
- statusPurpose?: StatusPurpose2021 | BitstringStatusPurpose | BitstringStatusPurpose[];
136
- bitsPerStatus?: number;
137
- expiresAt?: Date;
138
- validFrom?: Date;
139
- validUntil?: Date;
140
- ttl?: number;
141
134
  statusList2021?: {
142
135
  indexingDirection: StatusListIndexingDirection;
143
136
  statusPurpose: StatusPurpose2021;
@@ -286,9 +279,19 @@ type SignedStatusListData = {
286
279
  type IRequiredPlugins = IVcdmCredentialPlugin & IIdentifierResolution;
287
280
  type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & IVcdmCredentialPlugin>;
288
281
 
282
+ /**
283
+ * Fetches a status list credential from a URL
284
+ * @param args - Object containing the status list credential URL
285
+ * @returns Promise resolving to the fetched StatusListCredential
286
+ */
289
287
  declare function fetchStatusListCredential(args: {
290
288
  statusListCredential: string;
291
289
  }): Promise<StatusListCredential>;
290
+ /**
291
+ * Creates a status checking function for credential-status plugin
292
+ * @param args - Configuration options for status verification
293
+ * @returns StatusMethod function for checking credential status
294
+ */
292
295
  declare function statusPluginStatusFunction(args: {
293
296
  documentLoader: any;
294
297
  suite: any;
@@ -299,7 +302,8 @@ declare function statusPluginStatusFunction(args: {
299
302
  }): StatusMethod;
300
303
  /**
301
304
  * Function that can be used together with @digitalbazar/vc and @digitialcredentials/vc
302
- * @param args
305
+ * @param args - Configuration options for status verification
306
+ * @returns Function for checking credential status
303
307
  */
304
308
  declare function vcLibCheckStatusFunction(args: {
305
309
  mandatoryCredentialStatus?: boolean;
@@ -314,6 +318,11 @@ declare function vcLibCheckStatusFunction(args: {
314
318
  verified: boolean;
315
319
  error?: any;
316
320
  }>;
321
+ /**
322
+ * Checks the status of a credential using its credential status information
323
+ * @param args - Parameters for credential status verification
324
+ * @returns Promise resolving to verification result with error details if any
325
+ */
317
326
  declare function checkStatusForCredential(args: {
318
327
  credential: StatusListCredential;
319
328
  documentLoader: any;
@@ -333,6 +342,11 @@ declare function simpleCheckStatusFromStatusListUrl(args: {
333
342
  id?: string;
334
343
  statusListIndex: string;
335
344
  }): Promise<number | Status2021 | StatusOAuth>;
345
+ /**
346
+ * Checks the status at a specific index in a status list credential
347
+ * @param args - Parameters including credential and index to check
348
+ * @returns Promise resolving to status value at the specified index
349
+ */
336
350
  declare function checkStatusIndexFromStatusListCredential(args: {
337
351
  statusListCredential: StatusListCredential;
338
352
  statusPurpose?: StatusPurpose2021 | string | string[];
@@ -342,16 +356,44 @@ declare function checkStatusIndexFromStatusListCredential(args: {
342
356
  bitsPerStatus?: number;
343
357
  }): Promise<number | Status2021 | StatusOAuth>;
344
358
  declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(IVcdmCredentialPlugin | any) & IIdentifierResolution>): Promise<StatusListResult>;
359
+ /**
360
+ * Updates a status index in a status list credential
361
+ * @param args - Parameters for status update including credential and new value
362
+ * @param context - Agent context with required plugins
363
+ * @returns Promise resolving to updated status list details
364
+ */
345
365
  declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
366
+ /**
367
+ * Extracts credential details from a status list credential
368
+ * @param statusListCredential - The status list credential to extract from
369
+ * @returns Promise resolving to extracted credential details
370
+ */
346
371
  declare function extractCredentialDetails(statusListCredential: StatusListCredential): Promise<IExtractedCredentialDetails>;
347
372
  declare function toStatusListDetails(args: IToDetailsFromCredentialArgs): Promise<StatusListResult & (IStatusList2021ImplementationResult | IOAuthStatusListImplementationResult | IBitstringStatusListImplementationResult)>;
348
373
  declare function toStatusListDetails(args: IMergeDetailsWithEntityArgs): Promise<StatusListResult & (IStatusList2021ImplementationResult | IOAuthStatusListImplementationResult | IBitstringStatusListImplementationResult)>;
374
+ /**
375
+ * Creates a credential status object from status list and entry information
376
+ * @param args - Parameters including status list, entry, and index
377
+ * @returns Promise resolving to appropriate credential status type
378
+ */
349
379
  declare function createCredentialStatusFromStatusList(args: {
350
380
  statusList: StatusListEntity;
351
381
  statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
352
382
  statusListIndex: number;
353
383
  }): Promise<StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus>;
384
+ /**
385
+ * Updates a status list using a base64 encoded list of statuses
386
+ * @param args - Parameters including encoded list and update details
387
+ * @param context - Agent context with required plugins
388
+ * @returns Promise resolving to updated status list details
389
+ */
354
390
  declare function updateStatusListIndexFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
391
+ /**
392
+ * Converts a StatusList2021 to a verifiable credential
393
+ * @param args - Parameters for credential creation including issuer and encoded list
394
+ * @param context - Agent context with required plugins
395
+ * @returns Promise resolving to signed status list credential
396
+ */
355
397
  declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
356
398
 
357
399
  declare function determineStatusListType(credential: StatusListCredential): StatusListType;
package/dist/index.js CHANGED
@@ -297,6 +297,11 @@ var StatusList2021Implementation = class {
297
297
  const status = statusList.getStatus(typeof args.statusListIndex === "number" ? args.statusListIndex : parseInt(args.statusListIndex));
298
298
  return status ? Status2021.Invalid : Status2021.Valid;
299
299
  }
300
+ /**
301
+ * Performs the initial parsing of a StatusListCredential.
302
+ * This method handles expensive operations like JWT/CWT decoding once.
303
+ * It extracts all details available from the credential payload itself.
304
+ */
300
305
  async extractCredentialDetails(credential) {
301
306
  const uniform = CredentialMapper2.toUniformCredential(credential);
302
307
  const { issuer, credentialSubject } = uniform;
@@ -765,6 +770,11 @@ var OAuthStatusListImplementation = class {
765
770
  }
766
771
  return statusList.getStatus(index);
767
772
  }
773
+ /**
774
+ * Performs the initial parsing of a StatusListCredential.
775
+ * This method handles expensive operations like JWT/CWT decoding once.
776
+ * It extracts all details available from the credential payload itself.
777
+ */
768
778
  async extractCredentialDetails(credential) {
769
779
  if (typeof credential !== "string") {
770
780
  return Promise.reject("statusListCredential must be a JWT or CWT string");
@@ -1089,6 +1099,11 @@ var BitstringStatusListImplementation = class {
1089
1099
  }
1090
1100
  return statusList.getStatus(numIndex);
1091
1101
  }
1102
+ /**
1103
+ * Performs the initial parsing of a StatusListCredential.
1104
+ * This method handles expensive operations like JWT/CWT decoding once.
1105
+ * It extracts all details available from the credential payload itself.
1106
+ */
1092
1107
  async extractCredentialDetails(credential) {
1093
1108
  const uniform = CredentialMapper3.toUniformCredential(credential);
1094
1109
  const { issuer, credentialSubject } = uniform;