@veridid/openbadges 0.0.0-stage → 1.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/LICENSE +202 -0
- package/README.md +43 -2
- package/build/OpenBadgesModule.d.mts +15 -0
- package/build/OpenBadgesModule.d.mts.map +1 -0
- package/build/OpenBadgesModule.mjs +71 -0
- package/build/OpenBadgesModule.mjs.map +1 -0
- package/build/OpenBadgesModuleConfig.d.mts +101 -0
- package/build/OpenBadgesModuleConfig.d.mts.map +1 -0
- package/build/OpenBadgesModuleConfig.mjs +51 -0
- package/build/OpenBadgesModuleConfig.mjs.map +1 -0
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs +14 -0
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs +11 -0
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateParam.mjs +13 -0
- package/build/_virtual/_rolldown/runtime.mjs +41 -0
- package/build/api/OpenBadgesApi.d.mts +77 -0
- package/build/api/OpenBadgesApi.d.mts.map +1 -0
- package/build/api/OpenBadgesApi.mjs +124 -0
- package/build/api/OpenBadgesApi.mjs.map +1 -0
- package/build/constants.d.mts +17 -0
- package/build/constants.d.mts.map +1 -0
- package/build/constants.mjs +19 -0
- package/build/constants.mjs.map +1 -0
- package/build/cryptosuites/EcdsaSd2023.d.mts +129 -0
- package/build/cryptosuites/EcdsaSd2023.d.mts.map +1 -0
- package/build/cryptosuites/EcdsaSd2023.mjs +408 -0
- package/build/cryptosuites/EcdsaSd2023.mjs.map +1 -0
- package/build/cryptosuites/EddsaRdfc2022.d.mts +118 -0
- package/build/cryptosuites/EddsaRdfc2022.d.mts.map +1 -0
- package/build/cryptosuites/EddsaRdfc2022.mjs +301 -0
- package/build/cryptosuites/EddsaRdfc2022.mjs.map +1 -0
- package/build/cryptosuites/constants.d.mts +18 -0
- package/build/cryptosuites/constants.d.mts.map +1 -0
- package/build/cryptosuites/constants.mjs +19 -0
- package/build/cryptosuites/constants.mjs.map +1 -0
- package/build/cryptosuites/contextPreprocessor.mjs +76 -0
- package/build/cryptosuites/contextPreprocessor.mjs.map +1 -0
- package/build/cryptosuites/dataIntegrityV2Context.d.mts +147 -0
- package/build/cryptosuites/dataIntegrityV2Context.d.mts.map +1 -0
- package/build/cryptosuites/dataIntegrityV2Context.mjs +82 -0
- package/build/cryptosuites/dataIntegrityV2Context.mjs.map +1 -0
- package/build/cryptosuites/index.mjs +4 -0
- package/build/formats/OpenBadgesCredentialFormat.d.mts +41 -0
- package/build/formats/OpenBadgesCredentialFormat.d.mts.map +1 -0
- package/build/formats/OpenBadgesCredentialFormat.mjs +7 -0
- package/build/formats/OpenBadgesCredentialFormat.mjs.map +1 -0
- package/build/formats/OpenBadgesCredentialFormatService.d.mts +79 -0
- package/build/formats/OpenBadgesCredentialFormatService.d.mts.map +1 -0
- package/build/formats/OpenBadgesCredentialFormatService.mjs +208 -0
- package/build/formats/OpenBadgesCredentialFormatService.mjs.map +1 -0
- package/build/formats/OpenBadgesProofFormat.d.mts +41 -0
- package/build/formats/OpenBadgesProofFormat.d.mts.map +1 -0
- package/build/formats/OpenBadgesProofFormat.mjs +7 -0
- package/build/formats/OpenBadgesProofFormat.mjs.map +1 -0
- package/build/formats/OpenBadgesProofFormatService.d.mts +56 -0
- package/build/formats/OpenBadgesProofFormatService.d.mts.map +1 -0
- package/build/formats/OpenBadgesProofFormatService.mjs +138 -0
- package/build/formats/OpenBadgesProofFormatService.mjs.map +1 -0
- package/build/formats/index.d.mts +4 -0
- package/build/formats/index.mjs +4 -0
- package/build/http/OpenBadgesHttpModule.d.mts +14 -0
- package/build/http/OpenBadgesHttpModule.d.mts.map +1 -0
- package/build/http/OpenBadgesHttpModule.mjs +85 -0
- package/build/http/OpenBadgesHttpModule.mjs.map +1 -0
- package/build/http/OpenBadgesHttpModuleConfig.d.mts +60 -0
- package/build/http/OpenBadgesHttpModuleConfig.d.mts.map +1 -0
- package/build/http/OpenBadgesHttpModuleConfig.mjs +80 -0
- package/build/http/OpenBadgesHttpModuleConfig.mjs.map +1 -0
- package/build/http/endpoints/authorize.mjs +69 -0
- package/build/http/endpoints/authorize.mjs.map +1 -0
- package/build/http/endpoints/consent.mjs +34 -0
- package/build/http/endpoints/consent.mjs.map +1 -0
- package/build/http/endpoints/credentials.mjs +77 -0
- package/build/http/endpoints/credentials.mjs.map +1 -0
- package/build/http/endpoints/did.mjs +44 -0
- package/build/http/endpoints/did.mjs.map +1 -0
- package/build/http/endpoints/introspect.mjs +34 -0
- package/build/http/endpoints/introspect.mjs.map +1 -0
- package/build/http/endpoints/jwks.mjs +40 -0
- package/build/http/endpoints/jwks.mjs.map +1 -0
- package/build/http/endpoints/profile.mjs +56 -0
- package/build/http/endpoints/profile.mjs.map +1 -0
- package/build/http/endpoints/refresh.mjs +99 -0
- package/build/http/endpoints/refresh.mjs.map +1 -0
- package/build/http/endpoints/registration.mjs +42 -0
- package/build/http/endpoints/registration.mjs.map +1 -0
- package/build/http/endpoints/revoke.mjs +31 -0
- package/build/http/endpoints/revoke.mjs.map +1 -0
- package/build/http/endpoints/serviceDescription.mjs +48 -0
- package/build/http/endpoints/serviceDescription.mjs.map +1 -0
- package/build/http/endpoints/statusList.mjs +91 -0
- package/build/http/endpoints/statusList.mjs.map +1 -0
- package/build/http/endpoints/token.mjs +123 -0
- package/build/http/endpoints/token.mjs.map +1 -0
- package/build/http/middleware/auth.mjs +38 -0
- package/build/http/middleware/auth.mjs.map +1 -0
- package/build/http/router.d.mts +19 -0
- package/build/http/router.d.mts.map +1 -0
- package/build/http/router.mjs +36 -0
- package/build/http/router.mjs.map +1 -0
- package/build/http/tenants.mjs +16 -0
- package/build/http/tenants.mjs.map +1 -0
- package/build/http/util/auth.mjs +38 -0
- package/build/http/util/auth.mjs.map +1 -0
- package/build/index.d.mts +57 -0
- package/build/index.mjs +68 -0
- package/build/index.mjs.map +1 -0
- package/build/models/ClrCredential.d.mts +116 -0
- package/build/models/ClrCredential.d.mts.map +1 -0
- package/build/models/ClrCredential.mjs +38 -0
- package/build/models/ClrCredential.mjs.map +1 -0
- package/build/models/EndorsementCredential.d.mts +93 -0
- package/build/models/EndorsementCredential.d.mts.map +1 -0
- package/build/models/StatusListCredential.d.mts +85 -0
- package/build/models/StatusListCredential.d.mts.map +1 -0
- package/build/models/StatusListCredential.mjs +29 -0
- package/build/models/StatusListCredential.mjs.map +1 -0
- package/build/models/index.mjs +2 -0
- package/build/repository/OpenBadgeCredentialRecord.d.mts +48 -0
- package/build/repository/OpenBadgeCredentialRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgeCredentialRecord.mjs +44 -0
- package/build/repository/OpenBadgeCredentialRecord.mjs.map +1 -0
- package/build/repository/OpenBadgeCredentialRepository.d.mts +13 -0
- package/build/repository/OpenBadgeCredentialRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgeCredentialRepository.mjs +34 -0
- package/build/repository/OpenBadgeCredentialRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesAuthCodeRecord.d.mts +39 -0
- package/build/repository/OpenBadgesAuthCodeRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesAuthCodeRecord.mjs +40 -0
- package/build/repository/OpenBadgesAuthCodeRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesAuthCodeRepository.d.mts +11 -0
- package/build/repository/OpenBadgesAuthCodeRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesAuthCodeRepository.mjs +29 -0
- package/build/repository/OpenBadgesAuthCodeRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesConsentRecord.d.mts +28 -0
- package/build/repository/OpenBadgesConsentRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesConsentRecord.mjs +33 -0
- package/build/repository/OpenBadgesConsentRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesConsentRepository.d.mts +11 -0
- package/build/repository/OpenBadgesConsentRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesConsentRepository.mjs +37 -0
- package/build/repository/OpenBadgesConsentRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesKeyBindingRecord.d.mts +32 -0
- package/build/repository/OpenBadgesKeyBindingRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesKeyBindingRecord.mjs +37 -0
- package/build/repository/OpenBadgesKeyBindingRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesKeyBindingRepository.d.mts +12 -0
- package/build/repository/OpenBadgesKeyBindingRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesKeyBindingRepository.mjs +31 -0
- package/build/repository/OpenBadgesKeyBindingRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesOAuthRecord.d.mts +39 -0
- package/build/repository/OpenBadgesOAuthRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesOAuthRecord.mjs +37 -0
- package/build/repository/OpenBadgesOAuthRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesOAuthRepository.d.mts +13 -0
- package/build/repository/OpenBadgesOAuthRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesOAuthRepository.mjs +35 -0
- package/build/repository/OpenBadgesOAuthRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesProfileRecord.d.mts +25 -0
- package/build/repository/OpenBadgesProfileRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesProfileRecord.mjs +26 -0
- package/build/repository/OpenBadgesProfileRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesProfileRepository.d.mts +11 -0
- package/build/repository/OpenBadgesProfileRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesProfileRepository.mjs +28 -0
- package/build/repository/OpenBadgesProfileRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesRevocationCacheRecord.d.mts +27 -0
- package/build/repository/OpenBadgesRevocationCacheRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesRevocationCacheRecord.mjs +27 -0
- package/build/repository/OpenBadgesRevocationCacheRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesRevocationCacheRepository.d.mts +11 -0
- package/build/repository/OpenBadgesRevocationCacheRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesRevocationCacheRepository.mjs +28 -0
- package/build/repository/OpenBadgesRevocationCacheRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesServiceDescriptionRecord.d.mts +25 -0
- package/build/repository/OpenBadgesServiceDescriptionRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesServiceDescriptionRecord.mjs +26 -0
- package/build/repository/OpenBadgesServiceDescriptionRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesServiceDescriptionRepository.d.mts +11 -0
- package/build/repository/OpenBadgesServiceDescriptionRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesServiceDescriptionRepository.mjs +28 -0
- package/build/repository/OpenBadgesServiceDescriptionRepository.mjs.map +1 -0
- package/build/repository/OpenBadgesTokenRecord.d.mts +43 -0
- package/build/repository/OpenBadgesTokenRecord.d.mts.map +1 -0
- package/build/repository/OpenBadgesTokenRecord.mjs +37 -0
- package/build/repository/OpenBadgesTokenRecord.mjs.map +1 -0
- package/build/repository/OpenBadgesTokenRepository.d.mts +14 -0
- package/build/repository/OpenBadgesTokenRepository.d.mts.map +1 -0
- package/build/repository/OpenBadgesTokenRepository.mjs +46 -0
- package/build/repository/OpenBadgesTokenRepository.mjs.map +1 -0
- package/build/repository/StatusListRecord.d.mts +40 -0
- package/build/repository/StatusListRecord.d.mts.map +1 -0
- package/build/repository/StatusListRecord.mjs +42 -0
- package/build/repository/StatusListRecord.mjs.map +1 -0
- package/build/repository/StatusListRepository.d.mts +23 -0
- package/build/repository/StatusListRepository.d.mts.map +1 -0
- package/build/repository/StatusListRepository.mjs +46 -0
- package/build/repository/StatusListRepository.mjs.map +1 -0
- package/build/services/AchievementValidator.d.mts +162 -0
- package/build/services/AchievementValidator.d.mts.map +1 -0
- package/build/services/AchievementValidator.mjs +173 -0
- package/build/services/AchievementValidator.mjs.map +1 -0
- package/build/services/ConsumerService.d.mts +29 -0
- package/build/services/ConsumerService.d.mts.map +1 -0
- package/build/services/ConsumerService.mjs +114 -0
- package/build/services/ConsumerService.mjs.map +1 -0
- package/build/services/ContextService.d.mts +17 -0
- package/build/services/ContextService.d.mts.map +1 -0
- package/build/services/ContextService.mjs +48 -0
- package/build/services/ContextService.mjs.map +1 -0
- package/build/services/DataIntegrityService.d.mts +58 -0
- package/build/services/DataIntegrityService.d.mts.map +1 -0
- package/build/services/DataIntegrityService.mjs +130 -0
- package/build/services/DataIntegrityService.mjs.map +1 -0
- package/build/services/DidCommLinkService.d.mts +12 -0
- package/build/services/DidCommLinkService.d.mts.map +1 -0
- package/build/services/DidCommLinkService.mjs +15 -0
- package/build/services/DidCommLinkService.mjs.map +1 -0
- package/build/services/DisplayMapper.d.mts +13 -0
- package/build/services/DisplayMapper.d.mts.map +1 -0
- package/build/services/DisplayMapper.mjs +23 -0
- package/build/services/DisplayMapper.mjs.map +1 -0
- package/build/services/IssuerService.d.mts +43 -0
- package/build/services/IssuerService.d.mts.map +1 -0
- package/build/services/IssuerService.mjs +230 -0
- package/build/services/IssuerService.mjs.map +1 -0
- package/build/services/JwtService.d.mts +22 -0
- package/build/services/JwtService.d.mts.map +1 -0
- package/build/services/JwtService.mjs +190 -0
- package/build/services/JwtService.mjs.map +1 -0
- package/build/services/KeyService.d.mts +122 -0
- package/build/services/KeyService.d.mts.map +1 -0
- package/build/services/KeyService.mjs +448 -0
- package/build/services/KeyService.mjs.map +1 -0
- package/build/services/OAuthClient.d.mts +31 -0
- package/build/services/OAuthClient.d.mts.map +1 -0
- package/build/services/OAuthClient.mjs +131 -0
- package/build/services/OAuthClient.mjs.map +1 -0
- package/build/services/ProofService.d.mts +20 -0
- package/build/services/ProofService.d.mts.map +1 -0
- package/build/services/ProofService.mjs +39 -0
- package/build/services/ProofService.mjs.map +1 -0
- package/build/services/RevocationService.d.mts +64 -0
- package/build/services/RevocationService.d.mts.map +1 -0
- package/build/services/RevocationService.mjs +253 -0
- package/build/services/RevocationService.mjs.map +1 -0
- package/build/services/VerifyService.d.mts +24 -0
- package/build/services/VerifyService.d.mts.map +1 -0
- package/build/services/VerifyService.mjs +59 -0
- package/build/services/VerifyService.mjs.map +1 -0
- package/build/services/crypto/CryptoDriver.d.mts +14 -0
- package/build/services/crypto/CryptoDriver.d.mts.map +1 -0
- package/build/services/crypto/CryptoDriver.mjs +6 -0
- package/build/services/crypto/CryptoDriver.mjs.map +1 -0
- package/build/services/crypto/JsonLdCryptoDriver.d.mts +22 -0
- package/build/services/crypto/JsonLdCryptoDriver.d.mts.map +1 -0
- package/build/services/crypto/JsonLdCryptoDriver.mjs +43 -0
- package/build/services/crypto/JsonLdCryptoDriver.mjs.map +1 -0
- package/build/services/crypto/JwtCryptoDriver.d.mts +18 -0
- package/build/services/crypto/JwtCryptoDriver.d.mts.map +1 -0
- package/build/services/crypto/JwtCryptoDriver.mjs +46 -0
- package/build/services/crypto/JwtCryptoDriver.mjs.map +1 -0
- package/build/services/index.d.mts +12 -0
- package/build/services/index.mjs +12 -0
- package/build/utils/validate.d.mts +21 -0
- package/build/utils/validate.d.mts.map +1 -0
- package/build/utils/validate.mjs +111 -0
- package/build/utils/validate.mjs.map +1 -0
- package/package.json +63 -3
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
//#region src/models/ClrCredential.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* CLR 2.0 (Comprehensive Learner Record) Credential Types
|
|
4
|
+
*
|
|
5
|
+
* A ClrCredential bundles multiple OpenBadgeCredentials into a single
|
|
6
|
+
* verifiable credential representing a learner's complete achievement record.
|
|
7
|
+
*
|
|
8
|
+
* Spec: https://www.imsglobal.org/spec/clr/v2p0
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The subject of a CLR credential - represents the learner
|
|
12
|
+
*/
|
|
13
|
+
interface ClrSubject {
|
|
14
|
+
id: string;
|
|
15
|
+
type: 'ClrSubject';
|
|
16
|
+
verifiableCredential: VerifiableCredentialReference[];
|
|
17
|
+
achievement?: AchievementReference[];
|
|
18
|
+
association?: Association[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A reference to or embedded verifiable credential
|
|
22
|
+
*/
|
|
23
|
+
interface VerifiableCredentialReference {
|
|
24
|
+
'@context'?: string | string[];
|
|
25
|
+
type: string[];
|
|
26
|
+
id?: string;
|
|
27
|
+
issuer: string | {
|
|
28
|
+
id: string;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
validFrom?: string;
|
|
32
|
+
validUntil?: string;
|
|
33
|
+
credentialSubject: Record<string, unknown>;
|
|
34
|
+
proof?: Record<string, unknown>;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Summary reference to an achievement
|
|
39
|
+
*/
|
|
40
|
+
interface AchievementReference {
|
|
41
|
+
id: string;
|
|
42
|
+
type: 'Achievement';
|
|
43
|
+
name: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
achievementType?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Association between credentials in a CLR
|
|
49
|
+
*/
|
|
50
|
+
interface Association {
|
|
51
|
+
type: 'Association';
|
|
52
|
+
associationType: AssociationType;
|
|
53
|
+
sourceCredentialId: string;
|
|
54
|
+
targetCredentialId: string;
|
|
55
|
+
}
|
|
56
|
+
type AssociationType = 'isChildOf' | 'isParentOf' | 'isRelatedTo' | 'replacedBy' | 'precedes' | 'isEqualTo';
|
|
57
|
+
/**
|
|
58
|
+
* Input for creating a CLR credential
|
|
59
|
+
*/
|
|
60
|
+
interface ClrCredentialInput {
|
|
61
|
+
/** Optional credential ID (auto-generated if not provided) */
|
|
62
|
+
id?: string;
|
|
63
|
+
/** The learner's identifier (DID or URL) */
|
|
64
|
+
learnerId: string;
|
|
65
|
+
/** The issuer's profile (DID or profile object) */
|
|
66
|
+
issuerProfile: string | {
|
|
67
|
+
id: string;
|
|
68
|
+
type?: 'Profile';
|
|
69
|
+
name?: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
url?: string;
|
|
72
|
+
image?: string;
|
|
73
|
+
};
|
|
74
|
+
/** Array of OpenBadgeCredentials to include */
|
|
75
|
+
verifiableCredentials: VerifiableCredentialReference[];
|
|
76
|
+
/** Optional associations between credentials */
|
|
77
|
+
associations?: Association[];
|
|
78
|
+
/** Verification method for signing */
|
|
79
|
+
verificationMethod: string;
|
|
80
|
+
/** Optional validity dates */
|
|
81
|
+
validFrom?: string;
|
|
82
|
+
validUntil?: string;
|
|
83
|
+
/** Optional name for the CLR */
|
|
84
|
+
name?: string;
|
|
85
|
+
/** Optional description */
|
|
86
|
+
description?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The full CLR credential structure
|
|
90
|
+
*/
|
|
91
|
+
interface ClrCredential {
|
|
92
|
+
'@context': string[];
|
|
93
|
+
type: ['VerifiableCredential', 'ClrCredential'];
|
|
94
|
+
id: string;
|
|
95
|
+
issuer: string | {
|
|
96
|
+
id: string;
|
|
97
|
+
[key: string]: unknown;
|
|
98
|
+
};
|
|
99
|
+
validFrom: string;
|
|
100
|
+
validUntil?: string;
|
|
101
|
+
name?: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
credentialSubject: ClrSubject;
|
|
104
|
+
proof?: Record<string, unknown>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Build the @context array for a CLR credential
|
|
108
|
+
*/
|
|
109
|
+
declare function buildClrContexts(): string[];
|
|
110
|
+
/**
|
|
111
|
+
* Validate a CLR credential structure
|
|
112
|
+
*/
|
|
113
|
+
declare function validateClrCredential(credential: Partial<ClrCredential>): string[];
|
|
114
|
+
//#endregion
|
|
115
|
+
export { AchievementReference, Association, AssociationType, ClrCredential, ClrCredentialInput, ClrSubject, VerifiableCredentialReference, buildClrContexts, validateClrCredential };
|
|
116
|
+
//# sourceMappingURL=ClrCredential.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClrCredential.d.mts","names":[],"sources":["../../src/models/ClrCredential.ts"],"mappings":";;AAcA;;;;;;;;;;UAAiB,UAAA;EACf,EAAA;EACA,IAAA;EACA,oBAAA,EAAsB,6BAAA;EACtB,WAAA,GAAc,oBAAA;EACd,WAAA,GAAc,WAAA;AAAA;;AAMhB;;UAAiB,6BAAA;EACf,UAAA;EACA,IAAA;EACA,EAAA;EACA,MAAA;IAAmB,EAAA;IAAA,CAAa,GAAA;EAAA;EAChC,SAAA;EACA,UAAA;EACA,iBAAA,EAAmB,MAAA;EACnB,KAAA,GAAQ,MAAA;EAAA,CACP,GAAA;AAAA;;;;UAMc,oBAAA;EACf,EAAA;EACA,IAAA;EACA,IAAA;EACA,WAAA;EACA,eAAA;AAAA;;;;UAMe,WAAA;EACf,IAAA;EACA,eAAA,EAAiB,eAAA;EACjB,kBAAA;EACA,kBAAA;AAAA;AAAA,KAGU,eAAA;;;;UAWK,kBAAA;EAdG;EAgBlB,EAAA;EAbyB;EAezB,SAAA;EAfyB;EAiBzB,aAAA;IACE,EAAA;IACA,IAAA;IACA,IAAA;IACA,WAAA;IACA,GAAA;IACA,KAAA;EAAA;EALA;EAQF,qBAAA,EAAuB,6BAAA;EANrB;EAQF,YAAA,GAAe,WAAA;EANb;EAQF,kBAAA;EAJA;EAMA,SAAA;EACA,UAAA;EALe;EAOf,IAAA;EAHA;EAKA,WAAA;AAAA;;;;UAMe,aAAA;EACf,UAAA;EACA,IAAA;EACA,EAAA;EACA,MAAA;IAAmB,EAAA;IAAA,CAAa,GAAA;EAAA;EAChC,SAAA;EACA,UAAA;EACA,IAAA;EACA,WAAA;EACA,iBAAA,EAAmB,UAAA;EACnB,KAAA,GAAQ,MAAA;AAAA;;;;iBAMM,gBAAA,CAAA;;AAAhB;;iBAOgB,qBAAA,CAAsB,UAAA,EAAY,OAAA,CAAQ,aAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CLR_V2_CONTEXT, VC_V2_CONTEXT } from "../constants.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/models/ClrCredential.ts
|
|
4
|
+
/**
|
|
5
|
+
* CLR 2.0 (Comprehensive Learner Record) Credential Types
|
|
6
|
+
*
|
|
7
|
+
* A ClrCredential bundles multiple OpenBadgeCredentials into a single
|
|
8
|
+
* verifiable credential representing a learner's complete achievement record.
|
|
9
|
+
*
|
|
10
|
+
* Spec: https://www.imsglobal.org/spec/clr/v2p0
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Build the @context array for a CLR credential
|
|
14
|
+
*/
|
|
15
|
+
function buildClrContexts() {
|
|
16
|
+
return [VC_V2_CONTEXT, CLR_V2_CONTEXT];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Validate a CLR credential structure
|
|
20
|
+
*/
|
|
21
|
+
function validateClrCredential(credential) {
|
|
22
|
+
const errors = [];
|
|
23
|
+
if (!credential["@context"]) errors.push("Missing @context");
|
|
24
|
+
if (!credential.type?.includes("ClrCredential")) errors.push("type must include ClrCredential");
|
|
25
|
+
if (!credential.issuer) errors.push("Missing issuer");
|
|
26
|
+
if (!credential.credentialSubject) errors.push("Missing credentialSubject");
|
|
27
|
+
else {
|
|
28
|
+
const subject = credential.credentialSubject;
|
|
29
|
+
if (!subject.id) errors.push("credentialSubject.id is required");
|
|
30
|
+
if (subject.type !== "ClrSubject") errors.push("credentialSubject.type must be ClrSubject");
|
|
31
|
+
if (!Array.isArray(subject.verifiableCredential) || subject.verifiableCredential.length === 0) errors.push("credentialSubject.verifiableCredential must be a non-empty array");
|
|
32
|
+
}
|
|
33
|
+
return errors;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { buildClrContexts, validateClrCredential };
|
|
38
|
+
//# sourceMappingURL=ClrCredential.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClrCredential.mjs","names":[],"sources":["../../src/models/ClrCredential.ts"],"sourcesContent":["/**\n * CLR 2.0 (Comprehensive Learner Record) Credential Types\n *\n * A ClrCredential bundles multiple OpenBadgeCredentials into a single\n * verifiable credential representing a learner's complete achievement record.\n *\n * Spec: https://www.imsglobal.org/spec/clr/v2p0\n */\n\nimport { CLR_V2_CONTEXT, VC_V2_CONTEXT } from '../constants'\n\n/**\n * The subject of a CLR credential - represents the learner\n */\nexport interface ClrSubject {\n id: string // DID or URL identifying the learner\n type: 'ClrSubject'\n verifiableCredential: VerifiableCredentialReference[] // Array of embedded credentials\n achievement?: AchievementReference[] // Optional achievement summaries\n association?: Association[] // Optional associations between credentials\n}\n\n/**\n * A reference to or embedded verifiable credential\n */\nexport interface VerifiableCredentialReference {\n '@context'?: string | string[]\n type: string[]\n id?: string\n issuer: string | { id: string; [key: string]: unknown }\n validFrom?: string\n validUntil?: string\n credentialSubject: Record<string, unknown>\n proof?: Record<string, unknown>\n [key: string]: unknown\n}\n\n/**\n * Summary reference to an achievement\n */\nexport interface AchievementReference {\n id: string\n type: 'Achievement'\n name: string\n description?: string\n achievementType?: string\n}\n\n/**\n * Association between credentials in a CLR\n */\nexport interface Association {\n type: 'Association'\n associationType: AssociationType\n sourceCredentialId: string\n targetCredentialId: string\n}\n\nexport type AssociationType =\n | 'isChildOf'\n | 'isParentOf'\n | 'isRelatedTo'\n | 'replacedBy'\n | 'precedes'\n | 'isEqualTo'\n\n/**\n * Input for creating a CLR credential\n */\nexport interface ClrCredentialInput {\n /** Optional credential ID (auto-generated if not provided) */\n id?: string\n /** The learner's identifier (DID or URL) */\n learnerId: string\n /** The issuer's profile (DID or profile object) */\n issuerProfile: string | {\n id: string\n type?: 'Profile'\n name?: string\n description?: string\n url?: string\n image?: string\n }\n /** Array of OpenBadgeCredentials to include */\n verifiableCredentials: VerifiableCredentialReference[]\n /** Optional associations between credentials */\n associations?: Association[]\n /** Verification method for signing */\n verificationMethod: string\n /** Optional validity dates */\n validFrom?: string\n validUntil?: string\n /** Optional name for the CLR */\n name?: string\n /** Optional description */\n description?: string\n}\n\n/**\n * The full CLR credential structure\n */\nexport interface ClrCredential {\n '@context': string[]\n type: ['VerifiableCredential', 'ClrCredential']\n id: string\n issuer: string | { id: string; [key: string]: unknown }\n validFrom: string\n validUntil?: string\n name?: string\n description?: string\n credentialSubject: ClrSubject\n proof?: Record<string, unknown>\n}\n\n/**\n * Build the @context array for a CLR credential\n */\nexport function buildClrContexts(): string[] {\n return [VC_V2_CONTEXT, CLR_V2_CONTEXT]\n}\n\n/**\n * Validate a CLR credential structure\n */\nexport function validateClrCredential(credential: Partial<ClrCredential>): string[] {\n const errors: string[] = []\n\n // Check required fields\n if (!credential['@context']) {\n errors.push('Missing @context')\n }\n\n if (!credential.type?.includes('ClrCredential')) {\n errors.push('type must include ClrCredential')\n }\n\n if (!credential.issuer) {\n errors.push('Missing issuer')\n }\n\n if (!credential.credentialSubject) {\n errors.push('Missing credentialSubject')\n } else {\n const subject = credential.credentialSubject as Partial<ClrSubject>\n\n if (!subject.id) {\n errors.push('credentialSubject.id is required')\n }\n\n if (subject.type !== 'ClrSubject') {\n errors.push('credentialSubject.type must be ClrSubject')\n }\n\n if (!Array.isArray(subject.verifiableCredential) || subject.verifiableCredential.length === 0) {\n errors.push('credentialSubject.verifiableCredential must be a non-empty array')\n }\n }\n\n return errors\n}\n"],"mappings":";;;;;;;;;;;;;;AAqHA,SAAgB,mBAA6B;AAC3C,QAAO,CAAC,eAAe,eAAe;;;;;AAMxC,SAAgB,sBAAsB,YAA8C;CAClF,MAAM,SAAmB,EAAE;AAG3B,KAAI,CAAC,WAAW,YACd,QAAO,KAAK,mBAAmB;AAGjC,KAAI,CAAC,WAAW,MAAM,SAAS,gBAAgB,CAC7C,QAAO,KAAK,kCAAkC;AAGhD,KAAI,CAAC,WAAW,OACd,QAAO,KAAK,iBAAiB;AAG/B,KAAI,CAAC,WAAW,kBACd,QAAO,KAAK,4BAA4B;MACnC;EACL,MAAM,UAAU,WAAW;AAE3B,MAAI,CAAC,QAAQ,GACX,QAAO,KAAK,mCAAmC;AAGjD,MAAI,QAAQ,SAAS,aACnB,QAAO,KAAK,4CAA4C;AAG1D,MAAI,CAAC,MAAM,QAAQ,QAAQ,qBAAqB,IAAI,QAAQ,qBAAqB,WAAW,EAC1F,QAAO,KAAK,mEAAmE;;AAInF,QAAO"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
//#region src/models/EndorsementCredential.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* EndorsementCredential Types
|
|
4
|
+
*
|
|
5
|
+
* EndorsementCredentials are third-party validation credentials used in OpenBadges 3.0
|
|
6
|
+
* to provide external endorsement of achievements, profiles, or other credentials.
|
|
7
|
+
*
|
|
8
|
+
* @see https://www.imsglobal.org/spec/ob/v3p0/#endorsementcredential
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The subject of an endorsement - what is being endorsed
|
|
12
|
+
*/
|
|
13
|
+
interface EndorsementSubject {
|
|
14
|
+
/** The ID of the entity being endorsed (DID or URL) */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Must be 'EndorsementSubject' */
|
|
17
|
+
type: 'EndorsementSubject';
|
|
18
|
+
/** Optional comment explaining the endorsement */
|
|
19
|
+
endorsementComment?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Profile information for the endorser (issuer of the endorsement)
|
|
23
|
+
*/
|
|
24
|
+
interface EndorserProfile {
|
|
25
|
+
/** DID or URL identifying the endorser */
|
|
26
|
+
id: string;
|
|
27
|
+
/** Must include 'Profile' */
|
|
28
|
+
type?: 'Profile' | ['Profile', ...string[]];
|
|
29
|
+
/** Name of the endorsing organization/individual */
|
|
30
|
+
name?: string;
|
|
31
|
+
/** Description of the endorser */
|
|
32
|
+
description?: string;
|
|
33
|
+
/** URL to the endorser's website */
|
|
34
|
+
url?: string;
|
|
35
|
+
/** Image representing the endorser */
|
|
36
|
+
image?: string | {
|
|
37
|
+
id: string;
|
|
38
|
+
type?: 'Image';
|
|
39
|
+
};
|
|
40
|
+
/** Email of the endorser */
|
|
41
|
+
email?: string;
|
|
42
|
+
/** Phone number of the endorser */
|
|
43
|
+
phone?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Input for creating an EndorsementCredential
|
|
47
|
+
*/
|
|
48
|
+
interface EndorsementCredentialInput {
|
|
49
|
+
/** The entity being endorsed (DID or URL) - becomes credentialSubject.id */
|
|
50
|
+
endorsedEntity: string;
|
|
51
|
+
/** Optional comment explaining the endorsement */
|
|
52
|
+
endorsementComment?: string;
|
|
53
|
+
/** Profile information for the endorser (becomes the issuer) */
|
|
54
|
+
issuerProfile: EndorserProfile;
|
|
55
|
+
/** Verification method ID for signing */
|
|
56
|
+
verificationMethod: string;
|
|
57
|
+
/** ISO 8601 date string when the endorsement becomes valid */
|
|
58
|
+
validFrom?: string;
|
|
59
|
+
/** ISO 8601 date string when the endorsement expires */
|
|
60
|
+
validUntil?: string;
|
|
61
|
+
/** Optional credential ID (auto-generated if not provided) */
|
|
62
|
+
id?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Full EndorsementCredential structure (unsigned)
|
|
66
|
+
*/
|
|
67
|
+
interface EndorsementCredential {
|
|
68
|
+
'@context': string[];
|
|
69
|
+
type: ['VerifiableCredential', 'EndorsementCredential'];
|
|
70
|
+
id: string;
|
|
71
|
+
issuer: EndorserProfile;
|
|
72
|
+
validFrom: string;
|
|
73
|
+
validUntil?: string;
|
|
74
|
+
credentialSubject: EndorsementSubject;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Signed EndorsementCredential with proof
|
|
78
|
+
*/
|
|
79
|
+
interface SignedEndorsementCredential extends EndorsementCredential {
|
|
80
|
+
proof: {
|
|
81
|
+
type: string;
|
|
82
|
+
cryptosuite?: string;
|
|
83
|
+
created: string;
|
|
84
|
+
verificationMethod: string;
|
|
85
|
+
proofPurpose: string;
|
|
86
|
+
proofValue: string;
|
|
87
|
+
challenge?: string;
|
|
88
|
+
domain?: string;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { EndorsementCredential, EndorsementCredentialInput, EndorsementSubject, EndorserProfile, SignedEndorsementCredential };
|
|
93
|
+
//# sourceMappingURL=EndorsementCredential.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EndorsementCredential.d.mts","names":[],"sources":["../../src/models/EndorsementCredential.ts"],"mappings":";;AAYA;;;;;;;;;AAYA;UAZiB,kBAAA;;EAEf,EAAA;EAYA;EAVA,IAAA;EAcA;EAZA,kBAAA;AAAA;;;;UAMe,eAAA;EAgBf;EAdA,EAAA;EAcK;EAZL,IAAA;EAkByC;EAhBzC,IAAA;EAsB8B;EApB9B,WAAA;EAkBA;EAhBA,GAAA;EAkBe;EAhBf,KAAA;IAAmB,EAAA;IAAY,IAAA;EAAA;EAwB7B;EAtBF,KAAA;EA4Be;EA1Bf,KAAA;AAAA;;;;UAMe,0BAAA;EAwBf;EAtBA,cAAA;EAuBA;EArBA,kBAAA;EAuBA;EArBA,aAAA,EAAe,eAAA;EAqBsB;EAnBrC,kBAAA;EAyBe;EAvBf,SAAA;;EAEA,UAAA;EAqBmD;EAnBnD,EAAA;AAAA;;;;UAMe,qBAAA;EACf,UAAA;EACA,IAAA;EACA,EAAA;EACA,MAAA,EAAQ,eAAA;EACR,SAAA;EACA,UAAA;EACA,iBAAA,EAAmB,kBAAA;AAAA;;;;UAMJ,2BAAA,SAAoC,qBAAA;EACnD,KAAA;IACE,IAAA;IACA,WAAA;IACA,OAAA;IACA,kBAAA;IACA,YAAA;IACA,UAAA;IACA,SAAA;IACA,MAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
//#region src/models/StatusListCredential.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* StatusList2021 Credential Types
|
|
4
|
+
*
|
|
5
|
+
* Types for managing credential status using StatusList2021 specification.
|
|
6
|
+
* Supports both revocation and suspension purposes.
|
|
7
|
+
*
|
|
8
|
+
* @see https://www.w3.org/TR/vc-status-list/
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Status purposes supported by StatusList2021
|
|
12
|
+
*/
|
|
13
|
+
type StatusPurpose = 'revocation' | 'suspension';
|
|
14
|
+
/**
|
|
15
|
+
* StatusList2021 credential subject
|
|
16
|
+
*/
|
|
17
|
+
interface StatusListCredentialSubject {
|
|
18
|
+
/** URI identifying this status list */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Must be 'StatusList2021' */
|
|
21
|
+
type: 'StatusList2021';
|
|
22
|
+
/** Purpose of the status list */
|
|
23
|
+
statusPurpose: StatusPurpose;
|
|
24
|
+
/** GZIP-compressed, base64url-encoded bitstring */
|
|
25
|
+
encodedList: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* StatusList2021Entry - added to credentials to indicate their status
|
|
29
|
+
*/
|
|
30
|
+
interface StatusListEntry {
|
|
31
|
+
/** URI for this status entry */
|
|
32
|
+
id: string;
|
|
33
|
+
/** Must be 'StatusList2021Entry' */
|
|
34
|
+
type: 'StatusList2021Entry';
|
|
35
|
+
/** Purpose (revocation or suspension) */
|
|
36
|
+
statusPurpose: StatusPurpose;
|
|
37
|
+
/** Index in the status list bitstring */
|
|
38
|
+
statusListIndex: string;
|
|
39
|
+
/** URL to the status list credential */
|
|
40
|
+
statusListCredential: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Full StatusList2021Credential structure (unsigned)
|
|
44
|
+
*/
|
|
45
|
+
interface StatusListCredential {
|
|
46
|
+
'@context': string[];
|
|
47
|
+
type: ['VerifiableCredential', 'StatusList2021Credential'];
|
|
48
|
+
id: string;
|
|
49
|
+
issuer: string | {
|
|
50
|
+
id: string;
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
};
|
|
53
|
+
validFrom: string;
|
|
54
|
+
credentialSubject: StatusListCredentialSubject;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Input for creating a new status list
|
|
58
|
+
*/
|
|
59
|
+
interface CreateStatusListInput {
|
|
60
|
+
/** Unique identifier for this status list */
|
|
61
|
+
listId: string;
|
|
62
|
+
/** Purpose of the status list */
|
|
63
|
+
purpose: StatusPurpose;
|
|
64
|
+
/** Capacity in bits (default: 131072 = 16KB bitstring) */
|
|
65
|
+
capacity?: number;
|
|
66
|
+
/** DID of the issuer */
|
|
67
|
+
issuerDid: string;
|
|
68
|
+
/** Base URL where the status list will be hosted */
|
|
69
|
+
baseUrl: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Default capacity for status lists (16KB = 131072 bits)
|
|
73
|
+
*/
|
|
74
|
+
declare const DEFAULT_STATUS_LIST_CAPACITY = 131072;
|
|
75
|
+
/**
|
|
76
|
+
* StatusList2021 context URL
|
|
77
|
+
*/
|
|
78
|
+
declare const STATUS_LIST_2021_CONTEXT = "https://w3id.org/vc/status-list/2021/v1";
|
|
79
|
+
/**
|
|
80
|
+
* Build the contexts array for a StatusList2021Credential
|
|
81
|
+
*/
|
|
82
|
+
declare function buildStatusListContexts(): string[];
|
|
83
|
+
//#endregion
|
|
84
|
+
export { CreateStatusListInput, DEFAULT_STATUS_LIST_CAPACITY, STATUS_LIST_2021_CONTEXT, StatusListCredential, StatusListCredentialSubject, StatusListEntry, StatusPurpose, buildStatusListContexts };
|
|
85
|
+
//# sourceMappingURL=StatusListCredential.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusListCredential.d.mts","names":[],"sources":["../../src/models/StatusListCredential.ts"],"mappings":";;AAcA;;;;;AAKA;;;;;KALY,aAAA;;;;UAKK,2BAAA;EAQJ;EANX,EAAA;EAY8B;EAV9B,IAAA;EAgB4B;EAd5B,aAAA,EAAe,aAAA;EAYf;EAVA,WAAA;AAAA;;;;UAMe,eAAA;EAgBA;EAdf,EAAA;;EAEA,IAAA;EAaA;EAXA,aAAA,EAAe,aAAA;EAaf;EAXA,eAAA;EAYmB;EAVnB,oBAAA;AAAA;;;;UAMe,oBAAA;EACf,UAAA;EACA,IAAA;EACA,EAAA;EACA,MAAA;IAAmB,EAAA;IAAA,CAAa,GAAA;EAAA;EAChC,SAAA;EACA,iBAAA,EAAmB,2BAAA;AAAA;;;AAsBrB;UAhBiB,qBAAA;;EAEf,MAAA;EAcuC;EAZvC,OAAA,EAAS,aAAA;EAiB0B;EAfnC,QAAA;EAemC;EAbnC,SAAA;EAkBc;EAhBd,OAAA;AAAA;;;;cAMW,4BAAA;;;;cAKA,wBAAA;;;;iBAKG,uBAAA,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { VC_V2_CONTEXT } from "../constants.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/models/StatusListCredential.ts
|
|
4
|
+
/**
|
|
5
|
+
* StatusList2021 Credential Types
|
|
6
|
+
*
|
|
7
|
+
* Types for managing credential status using StatusList2021 specification.
|
|
8
|
+
* Supports both revocation and suspension purposes.
|
|
9
|
+
*
|
|
10
|
+
* @see https://www.w3.org/TR/vc-status-list/
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Default capacity for status lists (16KB = 131072 bits)
|
|
14
|
+
*/
|
|
15
|
+
const DEFAULT_STATUS_LIST_CAPACITY = 131072;
|
|
16
|
+
/**
|
|
17
|
+
* StatusList2021 context URL
|
|
18
|
+
*/
|
|
19
|
+
const STATUS_LIST_2021_CONTEXT = "https://w3id.org/vc/status-list/2021/v1";
|
|
20
|
+
/**
|
|
21
|
+
* Build the contexts array for a StatusList2021Credential
|
|
22
|
+
*/
|
|
23
|
+
function buildStatusListContexts() {
|
|
24
|
+
return [VC_V2_CONTEXT, STATUS_LIST_2021_CONTEXT];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { DEFAULT_STATUS_LIST_CAPACITY, STATUS_LIST_2021_CONTEXT, buildStatusListContexts };
|
|
29
|
+
//# sourceMappingURL=StatusListCredential.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusListCredential.mjs","names":[],"sources":["../../src/models/StatusListCredential.ts"],"sourcesContent":["/**\n * StatusList2021 Credential Types\n *\n * Types for managing credential status using StatusList2021 specification.\n * Supports both revocation and suspension purposes.\n *\n * @see https://www.w3.org/TR/vc-status-list/\n */\n\nimport { VC_V2_CONTEXT } from '../constants'\n\n/**\n * Status purposes supported by StatusList2021\n */\nexport type StatusPurpose = 'revocation' | 'suspension'\n\n/**\n * StatusList2021 credential subject\n */\nexport interface StatusListCredentialSubject {\n /** URI identifying this status list */\n id: string\n /** Must be 'StatusList2021' */\n type: 'StatusList2021'\n /** Purpose of the status list */\n statusPurpose: StatusPurpose\n /** GZIP-compressed, base64url-encoded bitstring */\n encodedList: string\n}\n\n/**\n * StatusList2021Entry - added to credentials to indicate their status\n */\nexport interface StatusListEntry {\n /** URI for this status entry */\n id: string\n /** Must be 'StatusList2021Entry' */\n type: 'StatusList2021Entry'\n /** Purpose (revocation or suspension) */\n statusPurpose: StatusPurpose\n /** Index in the status list bitstring */\n statusListIndex: string\n /** URL to the status list credential */\n statusListCredential: string\n}\n\n/**\n * Full StatusList2021Credential structure (unsigned)\n */\nexport interface StatusListCredential {\n '@context': string[]\n type: ['VerifiableCredential', 'StatusList2021Credential']\n id: string\n issuer: string | { id: string; [key: string]: unknown }\n validFrom: string\n credentialSubject: StatusListCredentialSubject\n}\n\n/**\n * Input for creating a new status list\n */\nexport interface CreateStatusListInput {\n /** Unique identifier for this status list */\n listId: string\n /** Purpose of the status list */\n purpose: StatusPurpose\n /** Capacity in bits (default: 131072 = 16KB bitstring) */\n capacity?: number\n /** DID of the issuer */\n issuerDid: string\n /** Base URL where the status list will be hosted */\n baseUrl: string\n}\n\n/**\n * Default capacity for status lists (16KB = 131072 bits)\n */\nexport const DEFAULT_STATUS_LIST_CAPACITY = 131072\n\n/**\n * StatusList2021 context URL\n */\nexport const STATUS_LIST_2021_CONTEXT = 'https://w3id.org/vc/status-list/2021/v1'\n\n/**\n * Build the contexts array for a StatusList2021Credential\n */\nexport function buildStatusListContexts(): string[] {\n return [VC_V2_CONTEXT, STATUS_LIST_2021_CONTEXT]\n}\n"],"mappings":";;;;;;;;;;;;;;AA6EA,MAAa,+BAA+B;;;;AAK5C,MAAa,2BAA2B;;;;AAKxC,SAAgB,0BAAoC;AAClD,QAAO,CAAC,eAAe,yBAAyB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BaseRecord, TagsBase } from "@credo-ts/core";
|
|
2
|
+
|
|
3
|
+
//#region src/repository/OpenBadgeCredentialRecord.d.ts
|
|
4
|
+
type DefaultOpenBadgeCredentialTags = {
|
|
5
|
+
credentialId?: string;
|
|
6
|
+
issuerId?: string;
|
|
7
|
+
subjectId?: string;
|
|
8
|
+
status?: 'valid' | 'revoked' | 'expired' | 'unknown';
|
|
9
|
+
sourceUrl?: string;
|
|
10
|
+
};
|
|
11
|
+
type CustomOpenBadgeCredentialTags = TagsBase;
|
|
12
|
+
type OpenBadgeCredentialRecordProps = {
|
|
13
|
+
id?: string;
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
updatedAt?: Date;
|
|
16
|
+
credential?: unknown;
|
|
17
|
+
jwt?: string;
|
|
18
|
+
derived?: {
|
|
19
|
+
title?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
issuerName?: string;
|
|
22
|
+
issuedOn?: string;
|
|
23
|
+
image?: string;
|
|
24
|
+
};
|
|
25
|
+
status?: 'valid' | 'revoked' | 'expired' | 'unknown';
|
|
26
|
+
sourceUrl?: string;
|
|
27
|
+
tags?: CustomOpenBadgeCredentialTags;
|
|
28
|
+
};
|
|
29
|
+
declare class OpenBadgeCredentialRecord extends BaseRecord<DefaultOpenBadgeCredentialTags, CustomOpenBadgeCredentialTags> implements OpenBadgeCredentialRecordProps {
|
|
30
|
+
credential?: unknown;
|
|
31
|
+
jwt?: string;
|
|
32
|
+
derived?: {
|
|
33
|
+
title?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
issuerName?: string;
|
|
36
|
+
issuedOn?: string;
|
|
37
|
+
image?: string;
|
|
38
|
+
};
|
|
39
|
+
status?: 'valid' | 'revoked' | 'expired' | 'unknown';
|
|
40
|
+
sourceUrl?: string;
|
|
41
|
+
static readonly type = "OpenBadgeCredentialRecord";
|
|
42
|
+
readonly type = "OpenBadgeCredentialRecord";
|
|
43
|
+
constructor(props?: OpenBadgeCredentialRecordProps);
|
|
44
|
+
getTags(): DefaultOpenBadgeCredentialTags;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { CustomOpenBadgeCredentialTags, DefaultOpenBadgeCredentialTags, OpenBadgeCredentialRecord, OpenBadgeCredentialRecordProps };
|
|
48
|
+
//# sourceMappingURL=OpenBadgeCredentialRecord.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenBadgeCredentialRecord.d.mts","names":[],"sources":["../../src/repository/OpenBadgeCredentialRecord.ts"],"mappings":";;;KAGY,8BAAA;EACV,YAAA;EACA,QAAA;EACA,SAAA;EACA,MAAA;EACA,SAAA;AAAA;AAAA,KAGU,6BAAA,GAAgC,QAAA;AAAA,KAEhC,8BAAA;EACV,EAAA;EACA,SAAA,GAAY,IAAA;EACZ,SAAA,GAAY,IAAA;EACZ,UAAA;EACA,GAAA;EACA,OAAA;IACE,KAAA;IACA,WAAA;IACA,UAAA;IACA,QAAA;IACA,KAAA;EAAA;EAEF,MAAA;EACA,SAAA;EACA,IAAA,GAAO,6BAAA;AAAA;AAAA,cAGI,yBAAA,SACH,UAAA,CAAW,8BAAA,EAAgC,6BAAA,aACxC,8BAAA;EAEJ,UAAA;EACA,GAAA;EACA,OAAA;IAAY,KAAA;IAAgB,WAAA;IAAsB,UAAA;IAAqB,QAAA;IAAmB,KAAA;EAAA;EAC1F,MAAA;EACA,SAAA;EAAA,gBAEgB,IAAA;EAAA,SACP,IAAA;cAEG,KAAA,GAAQ,8BAAA;EAoBpB,OAAA,CAAA,GAAW,8BAAA;AAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BaseRecord, utils } from "@credo-ts/core";
|
|
2
|
+
|
|
3
|
+
//#region src/repository/OpenBadgeCredentialRecord.ts
|
|
4
|
+
var OpenBadgeCredentialRecord = class OpenBadgeCredentialRecord extends BaseRecord {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super();
|
|
7
|
+
this.type = OpenBadgeCredentialRecord.type;
|
|
8
|
+
if (props) {
|
|
9
|
+
this.id = props.id ?? utils.uuid();
|
|
10
|
+
this.createdAt = props.createdAt ?? /* @__PURE__ */ new Date();
|
|
11
|
+
this.updatedAt = props.updatedAt ?? /* @__PURE__ */ new Date();
|
|
12
|
+
this.credential = props.credential;
|
|
13
|
+
this.jwt = props.jwt;
|
|
14
|
+
this.derived = props.derived;
|
|
15
|
+
this.status = props.status;
|
|
16
|
+
this.sourceUrl = props.sourceUrl;
|
|
17
|
+
this._tags = props.tags ?? {};
|
|
18
|
+
} else {
|
|
19
|
+
this.id = utils.uuid();
|
|
20
|
+
this.createdAt = /* @__PURE__ */ new Date();
|
|
21
|
+
this.updatedAt = /* @__PURE__ */ new Date();
|
|
22
|
+
this._tags = {};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
getTags() {
|
|
26
|
+
const cred = this.credential;
|
|
27
|
+
const credentialId = cred?.id;
|
|
28
|
+
const issuerId = cred?.issuer?.id ?? cred?.issuer;
|
|
29
|
+
const subjectId = cred?.credentialSubject?.id;
|
|
30
|
+
return {
|
|
31
|
+
...this._tags,
|
|
32
|
+
credentialId,
|
|
33
|
+
issuerId,
|
|
34
|
+
subjectId,
|
|
35
|
+
status: this.status,
|
|
36
|
+
sourceUrl: this.sourceUrl
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
OpenBadgeCredentialRecord.type = "OpenBadgeCredentialRecord";
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { OpenBadgeCredentialRecord };
|
|
44
|
+
//# sourceMappingURL=OpenBadgeCredentialRecord.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenBadgeCredentialRecord.mjs","names":[],"sources":["../../src/repository/OpenBadgeCredentialRecord.ts"],"sourcesContent":["import type { TagsBase } from '@credo-ts/core'\nimport { BaseRecord, utils } from '@credo-ts/core'\n\nexport type DefaultOpenBadgeCredentialTags = {\n credentialId?: string\n issuerId?: string\n subjectId?: string\n status?: 'valid' | 'revoked' | 'expired' | 'unknown'\n sourceUrl?: string\n}\n\nexport type CustomOpenBadgeCredentialTags = TagsBase\n\nexport type OpenBadgeCredentialRecordProps = {\n id?: string\n createdAt?: Date\n updatedAt?: Date\n credential?: unknown // raw JSON-LD credential\n jwt?: string // optional VC-JWT\n derived?: {\n title?: string\n description?: string\n issuerName?: string\n issuedOn?: string\n image?: string\n }\n status?: 'valid' | 'revoked' | 'expired' | 'unknown'\n sourceUrl?: string\n tags?: CustomOpenBadgeCredentialTags\n}\n\nexport class OpenBadgeCredentialRecord\n extends BaseRecord<DefaultOpenBadgeCredentialTags, CustomOpenBadgeCredentialTags>\n implements OpenBadgeCredentialRecordProps\n{\n public credential?: unknown\n public jwt?: string\n public derived?: { title?: string; description?: string; issuerName?: string; issuedOn?: string; image?: string }\n public status?: 'valid' | 'revoked' | 'expired' | 'unknown'\n public sourceUrl?: string\n\n public static readonly type = 'OpenBadgeCredentialRecord'\n public readonly type = OpenBadgeCredentialRecord.type\n\n public constructor(props?: OpenBadgeCredentialRecordProps) {\n super()\n if (props) {\n this.id = props.id ?? utils.uuid()\n this.createdAt = props.createdAt ?? new Date()\n this.updatedAt = props.updatedAt ?? new Date()\n this.credential = props.credential\n this.jwt = props.jwt\n this.derived = props.derived\n this.status = props.status\n this.sourceUrl = props.sourceUrl\n this._tags = props.tags ?? {}\n } else {\n this.id = utils.uuid()\n this.createdAt = new Date()\n this.updatedAt = new Date()\n this._tags = {}\n }\n }\n\n public getTags(): DefaultOpenBadgeCredentialTags {\n // Extract minimal tags from credential if present\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const cred = this.credential as any\n const credentialId: string | undefined = cred?.id\n const issuerId: string | undefined = cred?.issuer?.id ?? cred?.issuer\n const subjectId: string | undefined = cred?.credentialSubject?.id\n\n return {\n ...this._tags,\n credentialId,\n issuerId,\n subjectId,\n status: this.status,\n sourceUrl: this.sourceUrl,\n }\n }\n}\n\n\n"],"mappings":";;;AA+BA,IAAa,4BAAb,MAAa,kCACH,WAEV;CAUE,AAAO,YAAY,OAAwC;AACzD,SAAO;OAHO,OAAO,0BAA0B;AAI/C,MAAI,OAAO;AACT,QAAK,KAAK,MAAM,MAAM,MAAM,MAAM;AAClC,QAAK,YAAY,MAAM,6BAAa,IAAI,MAAM;AAC9C,QAAK,YAAY,MAAM,6BAAa,IAAI,MAAM;AAC9C,QAAK,aAAa,MAAM;AACxB,QAAK,MAAM,MAAM;AACjB,QAAK,UAAU,MAAM;AACrB,QAAK,SAAS,MAAM;AACpB,QAAK,YAAY,MAAM;AACvB,QAAK,QAAQ,MAAM,QAAQ,EAAE;SACxB;AACL,QAAK,KAAK,MAAM,MAAM;AACtB,QAAK,4BAAY,IAAI,MAAM;AAC3B,QAAK,4BAAY,IAAI,MAAM;AAC3B,QAAK,QAAQ,EAAE;;;CAInB,AAAO,UAA0C;EAG/C,MAAM,OAAO,KAAK;EAClB,MAAM,eAAmC,MAAM;EAC/C,MAAM,WAA+B,MAAM,QAAQ,MAAM,MAAM;EAC/D,MAAM,YAAgC,MAAM,mBAAmB;AAE/D,SAAO;GACL,GAAG,KAAK;GACR;GACA;GACA;GACA,QAAQ,KAAK;GACb,WAAW,KAAK;GACjB;;;0BAtCoB,OAAO"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OpenBadgeCredentialRecord } from "./OpenBadgeCredentialRecord.mjs";
|
|
2
|
+
import { EventEmitter, Repository, StorageService } from "@credo-ts/core";
|
|
3
|
+
|
|
4
|
+
//#region src/repository/OpenBadgeCredentialRepository.d.ts
|
|
5
|
+
declare class OpenBadgeCredentialRepository extends Repository<OpenBadgeCredentialRecord> {
|
|
6
|
+
constructor(storageService: StorageService<OpenBadgeCredentialRecord>, eventEmitter: EventEmitter);
|
|
7
|
+
findByCredentialId(agentContext: any, credentialId: string): Promise<OpenBadgeCredentialRecord | null>;
|
|
8
|
+
findByIssuer(agentContext: any, issuerId: string): Promise<OpenBadgeCredentialRecord[]>;
|
|
9
|
+
findBySource(agentContext: any, sourceUrl: string): Promise<OpenBadgeCredentialRecord[]>;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { OpenBadgeCredentialRepository };
|
|
13
|
+
//# sourceMappingURL=OpenBadgeCredentialRepository.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenBadgeCredentialRepository.d.mts","names":[],"sources":["../../src/repository/OpenBadgeCredentialRepository.ts"],"mappings":";;;;cAKa,6BAAA,SAAsC,UAAA,CAAW,yBAAA;cAEjB,cAAA,EAAgB,cAAA,CAAe,yBAAA,GACxE,YAAA,EAAc,YAAA;EAKH,kBAAA,CAAmB,YAAA,OAAmB,YAAA,WAAoB,OAAA,CAAA,yBAAA;EAI1D,YAAA,CAAa,YAAA,OAAmB,QAAA,WAAgB,OAAA,CAAA,yBAAA;EAIhD,YAAA,CAAa,YAAA,OAAmB,SAAA,WAAiB,OAAA,CAAA,yBAAA;AAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { OpenBadgeCredentialRecord } from "./OpenBadgeCredentialRecord.mjs";
|
|
2
|
+
import { __decorateMetadata, init_decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs";
|
|
3
|
+
import { __decorateParam, init_decorateParam } from "../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateParam.mjs";
|
|
4
|
+
import { __decorate, init_decorate } from "../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
|
|
5
|
+
import { EventEmitter, InjectionSymbols, Repository, inject, injectable } from "@credo-ts/core";
|
|
6
|
+
|
|
7
|
+
//#region src/repository/OpenBadgeCredentialRepository.ts
|
|
8
|
+
init_decorateMetadata();
|
|
9
|
+
init_decorateParam();
|
|
10
|
+
init_decorate();
|
|
11
|
+
var _ref;
|
|
12
|
+
let OpenBadgeCredentialRepository = class OpenBadgeCredentialRepository extends Repository {
|
|
13
|
+
constructor(storageService, eventEmitter) {
|
|
14
|
+
super(OpenBadgeCredentialRecord, storageService, eventEmitter);
|
|
15
|
+
}
|
|
16
|
+
async findByCredentialId(agentContext, credentialId) {
|
|
17
|
+
return this.findSingleByQuery(agentContext, { credentialId });
|
|
18
|
+
}
|
|
19
|
+
async findByIssuer(agentContext, issuerId) {
|
|
20
|
+
return this.findByQuery(agentContext, { issuerId });
|
|
21
|
+
}
|
|
22
|
+
async findBySource(agentContext, sourceUrl) {
|
|
23
|
+
return this.findByQuery(agentContext, { sourceUrl });
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
OpenBadgeCredentialRepository = __decorate([
|
|
27
|
+
injectable(),
|
|
28
|
+
__decorateParam(0, inject(InjectionSymbols.StorageService)),
|
|
29
|
+
__decorateMetadata("design:paramtypes", [Object, EventEmitter])
|
|
30
|
+
], OpenBadgeCredentialRepository);
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { OpenBadgeCredentialRepository };
|
|
34
|
+
//# sourceMappingURL=OpenBadgeCredentialRepository.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenBadgeCredentialRepository.mjs","names":[],"sources":["../../src/repository/OpenBadgeCredentialRepository.ts"],"sourcesContent":["import type { StorageService } from '@credo-ts/core'\nimport { injectable, inject, InjectionSymbols, EventEmitter, Repository } from '@credo-ts/core'\nimport { OpenBadgeCredentialRecord } from './OpenBadgeCredentialRecord'\n\n@injectable()\nexport class OpenBadgeCredentialRepository extends Repository<OpenBadgeCredentialRecord> {\n public constructor(\n @inject(InjectionSymbols.StorageService) storageService: StorageService<OpenBadgeCredentialRecord>,\n eventEmitter: EventEmitter\n ) {\n super(OpenBadgeCredentialRecord, storageService, eventEmitter)\n }\n\n public async findByCredentialId(agentContext: any, credentialId: string) {\n return this.findSingleByQuery(agentContext, { credentialId })\n }\n\n public async findByIssuer(agentContext: any, issuerId: string) {\n return this.findByQuery(agentContext, { issuerId })\n }\n\n public async findBySource(agentContext: any, sourceUrl: string) {\n return this.findByQuery(agentContext, { sourceUrl })\n }\n}\n\n\n"],"mappings":";;;;;;;;;;;AAKO,0CAAM,sCAAsC,WAAsC;CACvF,AAAO,YACL,AAAyC,gBACzC,cACA;AACA,QAAM,2BAA2B,gBAAgB,aAAa;;CAGhE,MAAa,mBAAmB,cAAmB,cAAsB;AACvE,SAAO,KAAK,kBAAkB,cAAc,EAAE,cAAc,CAAC;;CAG/D,MAAa,aAAa,cAAmB,UAAkB;AAC7D,SAAO,KAAK,YAAY,cAAc,EAAE,UAAU,CAAC;;CAGrD,MAAa,aAAa,cAAmB,WAAmB;AAC9D,SAAO,KAAK,YAAY,cAAc,EAAE,WAAW,CAAC;;;;CAlBvD,YAAY;oBAGR,OAAO,iBAAiB,eAAe"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BaseRecord, TagsBase } from "@credo-ts/core";
|
|
2
|
+
|
|
3
|
+
//#region src/repository/OpenBadgesAuthCodeRecord.d.ts
|
|
4
|
+
type DefaultOpenBadgesAuthCodeTags = {
|
|
5
|
+
code: string;
|
|
6
|
+
clientId?: string;
|
|
7
|
+
subject?: string;
|
|
8
|
+
};
|
|
9
|
+
type OpenBadgesAuthCodeRecordProps = {
|
|
10
|
+
id?: string;
|
|
11
|
+
createdAt?: Date;
|
|
12
|
+
updatedAt?: Date;
|
|
13
|
+
code: string;
|
|
14
|
+
clientId: string;
|
|
15
|
+
redirectUri: string;
|
|
16
|
+
scope?: string;
|
|
17
|
+
subject: string;
|
|
18
|
+
expiresAt: Date;
|
|
19
|
+
codeChallenge?: string;
|
|
20
|
+
codeChallengeMethod?: string;
|
|
21
|
+
tags?: TagsBase;
|
|
22
|
+
};
|
|
23
|
+
declare class OpenBadgesAuthCodeRecord extends BaseRecord<DefaultOpenBadgesAuthCodeTags, TagsBase> implements OpenBadgesAuthCodeRecordProps {
|
|
24
|
+
code: string;
|
|
25
|
+
clientId: string;
|
|
26
|
+
redirectUri: string;
|
|
27
|
+
scope?: string;
|
|
28
|
+
subject: string;
|
|
29
|
+
expiresAt: Date;
|
|
30
|
+
codeChallenge?: string;
|
|
31
|
+
codeChallengeMethod?: string;
|
|
32
|
+
static readonly type = "OpenBadgesAuthCodeRecord";
|
|
33
|
+
readonly type = "OpenBadgesAuthCodeRecord";
|
|
34
|
+
constructor(props: OpenBadgesAuthCodeRecordProps);
|
|
35
|
+
getTags(): DefaultOpenBadgesAuthCodeTags;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { DefaultOpenBadgesAuthCodeTags, OpenBadgesAuthCodeRecord, OpenBadgesAuthCodeRecordProps };
|
|
39
|
+
//# sourceMappingURL=OpenBadgesAuthCodeRecord.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenBadgesAuthCodeRecord.d.mts","names":[],"sources":["../../src/repository/OpenBadgesAuthCodeRecord.ts"],"mappings":";;;KAGY,6BAAA;EACV,IAAA;EACA,QAAA;EACA,OAAA;AAAA;AAAA,KAGU,6BAAA;EACV,EAAA;EACA,SAAA,GAAY,IAAA;EACZ,SAAA,GAAY,IAAA;EACZ,IAAA;EACA,QAAA;EACA,WAAA;EACA,KAAA;EACA,OAAA;EACA,SAAA,EAAW,IAAA;EACX,aAAA;EACA,mBAAA;EACA,IAAA,GAAO,QAAA;AAAA;AAAA,cAGI,wBAAA,SACH,UAAA,CAAW,6BAAA,EAA+B,QAAA,aACvC,6BAAA;EAEJ,IAAA;EACA,QAAA;EACA,WAAA;EACA,KAAA;EACA,OAAA;EACA,SAAA,EAAY,IAAA;EACZ,aAAA;EACA,mBAAA;EAAA,gBAEgB,IAAA;EAAA,SACP,IAAA;cAEG,KAAA,EAAO,6BAAA;EAgBnB,OAAA,CAAA,GAAW,6BAAA;AAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { __esmMin, __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { BaseRecord, utils } from "@credo-ts/core";
|
|
3
|
+
|
|
4
|
+
//#region src/repository/OpenBadgesAuthCodeRecord.ts
|
|
5
|
+
var OpenBadgesAuthCodeRecord_exports = /* @__PURE__ */ __exportAll({ OpenBadgesAuthCodeRecord: () => OpenBadgesAuthCodeRecord });
|
|
6
|
+
var OpenBadgesAuthCodeRecord;
|
|
7
|
+
var init_OpenBadgesAuthCodeRecord = __esmMin(() => {
|
|
8
|
+
OpenBadgesAuthCodeRecord = class OpenBadgesAuthCodeRecord extends BaseRecord {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super();
|
|
11
|
+
this.type = OpenBadgesAuthCodeRecord.type;
|
|
12
|
+
this.id = props.id ?? utils.uuid();
|
|
13
|
+
this.createdAt = props.createdAt ?? /* @__PURE__ */ new Date();
|
|
14
|
+
this.updatedAt = props.updatedAt ?? /* @__PURE__ */ new Date();
|
|
15
|
+
this.code = props.code;
|
|
16
|
+
this.clientId = props.clientId;
|
|
17
|
+
this.redirectUri = props.redirectUri;
|
|
18
|
+
this.scope = props.scope;
|
|
19
|
+
this.subject = props.subject;
|
|
20
|
+
this.expiresAt = props.expiresAt;
|
|
21
|
+
this.codeChallenge = props.codeChallenge;
|
|
22
|
+
this.codeChallengeMethod = props.codeChallengeMethod;
|
|
23
|
+
this._tags = props.tags ?? {};
|
|
24
|
+
}
|
|
25
|
+
getTags() {
|
|
26
|
+
return {
|
|
27
|
+
...this._tags,
|
|
28
|
+
code: this.code,
|
|
29
|
+
clientId: this.clientId,
|
|
30
|
+
subject: this.subject
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
OpenBadgesAuthCodeRecord.type = "OpenBadgesAuthCodeRecord";
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
init_OpenBadgesAuthCodeRecord();
|
|
39
|
+
export { OpenBadgesAuthCodeRecord, OpenBadgesAuthCodeRecord_exports, init_OpenBadgesAuthCodeRecord };
|
|
40
|
+
//# sourceMappingURL=OpenBadgesAuthCodeRecord.mjs.map
|