@learncard/network-plugin 2.4.39 → 2.5.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/dist/lcn-plugin.cjs.development.js +354 -10
- package/dist/lcn-plugin.cjs.development.js.map +3 -3
- package/dist/lcn-plugin.cjs.production.min.js +2 -2
- package/dist/lcn-plugin.cjs.production.min.js.map +3 -3
- package/dist/lcn-plugin.esm.js +354 -10
- package/dist/lcn-plugin.esm.js.map +3 -3
- package/dist/plugin.d.ts.map +1 -1
- package/dist/types.d.ts +24 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -2069,6 +2069,7 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2069
2069
|
ClaimHookQueryValidator: () => ClaimHookQueryValidator2,
|
|
2070
2070
|
ClaimHookTypeValidator: () => ClaimHookTypeValidator2,
|
|
2071
2071
|
ClaimHookValidator: () => ClaimHookValidator2,
|
|
2072
|
+
ClaimTokenValidator: () => ClaimTokenValidator2,
|
|
2072
2073
|
ConsentFlowContractDataForDidValidator: () => ConsentFlowContractDataForDidValidator2,
|
|
2073
2074
|
ConsentFlowContractDataValidator: () => ConsentFlowContractDataValidator2,
|
|
2074
2075
|
ConsentFlowContractDetailsValidator: () => ConsentFlowContractDetailsValidator2,
|
|
@@ -2083,6 +2084,11 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2083
2084
|
ConsentFlowTransactionActionValidator: () => ConsentFlowTransactionActionValidator2,
|
|
2084
2085
|
ConsentFlowTransactionValidator: () => ConsentFlowTransactionValidator2,
|
|
2085
2086
|
ConsentFlowTransactionsQueryValidator: () => ConsentFlowTransactionsQueryValidator2,
|
|
2087
|
+
ContactMethodCreateValidator: () => ContactMethodCreateValidator2,
|
|
2088
|
+
ContactMethodQueryValidator: () => ContactMethodQueryValidator2,
|
|
2089
|
+
ContactMethodValidator: () => ContactMethodValidator2,
|
|
2090
|
+
ContactMethodVerificationRequestValidator: () => ContactMethodVerificationRequestValidator2,
|
|
2091
|
+
ContactMethodVerificationValidator: () => ContactMethodVerificationValidator2,
|
|
2086
2092
|
ContextValidator: () => ContextValidator2,
|
|
2087
2093
|
ContractCredentialValidator: () => ContractCredentialValidator2,
|
|
2088
2094
|
CredentialInfoValidator: () => CredentialInfoValidator2,
|
|
@@ -2104,6 +2110,11 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2104
2110
|
IdentifierTypeValidator: () => IdentifierTypeValidator2,
|
|
2105
2111
|
IdentityObjectValidator: () => IdentityObjectValidator2,
|
|
2106
2112
|
ImageValidator: () => ImageValidator2,
|
|
2113
|
+
InboxCredentialQueryValidator: () => InboxCredentialQueryValidator2,
|
|
2114
|
+
InboxCredentialValidator: () => InboxCredentialValidator2,
|
|
2115
|
+
IssueInboxCredentialResponseValidator: () => IssueInboxCredentialResponseValidator2,
|
|
2116
|
+
IssueInboxCredentialValidator: () => IssueInboxCredentialValidator2,
|
|
2117
|
+
IssueInboxSigningAuthorityValidator: () => IssueInboxSigningAuthorityValidator2,
|
|
2107
2118
|
JWERecipientHeaderValidator: () => JWERecipientHeaderValidator2,
|
|
2108
2119
|
JWERecipientValidator: () => JWERecipientValidator2,
|
|
2109
2120
|
JWEValidator: () => JWEValidator2,
|
|
@@ -2113,7 +2124,10 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2113
2124
|
LCNBoostClaimLinkOptionsValidator: () => LCNBoostClaimLinkOptionsValidator2,
|
|
2114
2125
|
LCNBoostClaimLinkSigningAuthorityValidator: () => LCNBoostClaimLinkSigningAuthorityValidator2,
|
|
2115
2126
|
LCNBoostStatus: () => LCNBoostStatus2,
|
|
2127
|
+
LCNInboxContactMethodValidator: () => LCNInboxContactMethodValidator2,
|
|
2128
|
+
LCNInboxStatusEnumValidator: () => LCNInboxStatusEnumValidator2,
|
|
2116
2129
|
LCNNotificationDataValidator: () => LCNNotificationDataValidator2,
|
|
2130
|
+
LCNNotificationInboxValidator: () => LCNNotificationInboxValidator2,
|
|
2117
2131
|
LCNNotificationMessageValidator: () => LCNNotificationMessageValidator2,
|
|
2118
2132
|
LCNNotificationTypeEnumValidator: () => LCNNotificationTypeEnumValidator2,
|
|
2119
2133
|
LCNNotificationValidator: () => LCNNotificationValidator2,
|
|
@@ -2136,6 +2150,7 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2136
2150
|
PaginatedContractCredentialsValidator: () => PaginatedContractCredentialsValidator2,
|
|
2137
2151
|
PaginatedEncryptedCredentialRecordsValidator: () => PaginatedEncryptedCredentialRecordsValidator2,
|
|
2138
2152
|
PaginatedEncryptedRecordsValidator: () => PaginatedEncryptedRecordsValidator2,
|
|
2153
|
+
PaginatedInboxCredentialsValidator: () => PaginatedInboxCredentialsValidator2,
|
|
2139
2154
|
PaginatedLCNProfileManagersValidator: () => PaginatedLCNProfileManagersValidator2,
|
|
2140
2155
|
PaginatedLCNProfilesAndManagersValidator: () => PaginatedLCNProfilesAndManagersValidator2,
|
|
2141
2156
|
PaginatedLCNProfilesValidator: () => PaginatedLCNProfilesValidator2,
|
|
@@ -2153,6 +2168,7 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2153
2168
|
RubricCriterionValidator: () => RubricCriterionValidator2,
|
|
2154
2169
|
SentCredentialInfoValidator: () => SentCredentialInfoValidator2,
|
|
2155
2170
|
ServiceValidator: () => ServiceValidator2,
|
|
2171
|
+
SetPrimaryContactMethodValidator: () => SetPrimaryContactMethodValidator2,
|
|
2156
2172
|
StringQuery: () => StringQuery2,
|
|
2157
2173
|
TermsOfUseValidator: () => TermsOfUseValidator2,
|
|
2158
2174
|
UnsignedAchievementCredentialValidator: () => UnsignedAchievementCredentialValidator2,
|
|
@@ -6683,7 +6699,7 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
6683
6699
|
bio: z2.string().default("").describe("Longer bio for the profile."),
|
|
6684
6700
|
did: z2.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
|
|
6685
6701
|
isPrivate: z2.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
|
|
6686
|
-
email: z2.string().optional().describe("Contact email address for the profile."),
|
|
6702
|
+
email: z2.string().optional().describe("Contact email address for the profile. (deprecated)"),
|
|
6687
6703
|
image: z2.string().optional().describe("Profile image URL for the profile."),
|
|
6688
6704
|
heroImage: z2.string().optional().describe("Hero image URL for the profile."),
|
|
6689
6705
|
websiteLink: z2.string().optional().describe("Website link for the profile."),
|
|
@@ -6852,7 +6868,8 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
6852
6868
|
name: z2.string().max(15).regex(/^[a-z0-9-]+$/, {
|
|
6853
6869
|
message: "The input string must contain only lowercase letters, numbers, and hyphens."
|
|
6854
6870
|
}),
|
|
6855
|
-
did: z2.string()
|
|
6871
|
+
did: z2.string(),
|
|
6872
|
+
isPrimary: z2.boolean().optional()
|
|
6856
6873
|
})
|
|
6857
6874
|
});
|
|
6858
6875
|
var AutoBoostConfigValidator2 = z2.object({
|
|
@@ -7033,16 +7050,33 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
7033
7050
|
"BOOST_ACCEPTED",
|
|
7034
7051
|
"PRESENTATION_REQUEST",
|
|
7035
7052
|
"PRESENTATION_RECEIVED",
|
|
7036
|
-
"CONSENT_FLOW_TRANSACTION"
|
|
7053
|
+
"CONSENT_FLOW_TRANSACTION",
|
|
7054
|
+
"ISSUANCE_CLAIMED",
|
|
7055
|
+
"ISSUANCE_DELIVERED"
|
|
7037
7056
|
]);
|
|
7038
7057
|
var LCNNotificationMessageValidator2 = z2.object({
|
|
7039
7058
|
title: z2.string().optional(),
|
|
7040
7059
|
body: z2.string().optional()
|
|
7041
7060
|
});
|
|
7061
|
+
var LCNInboxContactMethodValidator2 = z2.object({
|
|
7062
|
+
type: z2.string(),
|
|
7063
|
+
value: z2.string()
|
|
7064
|
+
});
|
|
7065
|
+
var LCNInboxStatusEnumValidator2 = z2.enum(["PENDING", "DELIVERED", "CLAIMED", "EXPIRED"]);
|
|
7066
|
+
var LCNNotificationInboxValidator2 = z2.object({
|
|
7067
|
+
issuanceId: z2.string(),
|
|
7068
|
+
status: LCNInboxStatusEnumValidator2,
|
|
7069
|
+
recipient: z2.object({
|
|
7070
|
+
contactMethod: LCNInboxContactMethodValidator2.optional(),
|
|
7071
|
+
learnCardId: z2.string().optional()
|
|
7072
|
+
}),
|
|
7073
|
+
timestamp: z2.string().datetime().optional()
|
|
7074
|
+
});
|
|
7042
7075
|
var LCNNotificationDataValidator2 = z2.object({
|
|
7043
7076
|
vcUris: z2.array(z2.string()).optional(),
|
|
7044
7077
|
vpUris: z2.array(z2.string()).optional(),
|
|
7045
|
-
transaction: ConsentFlowTransactionValidator2.optional()
|
|
7078
|
+
transaction: ConsentFlowTransactionValidator2.optional(),
|
|
7079
|
+
inbox: LCNNotificationInboxValidator2.optional()
|
|
7046
7080
|
});
|
|
7047
7081
|
var LCNNotificationValidator2 = z2.object({
|
|
7048
7082
|
type: LCNNotificationTypeEnumValidator2,
|
|
@@ -7050,7 +7084,8 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
7050
7084
|
from: LCNProfileValidator2.partial().and(z2.object({ did: z2.string() })),
|
|
7051
7085
|
message: LCNNotificationMessageValidator2.optional(),
|
|
7052
7086
|
data: LCNNotificationDataValidator2.optional(),
|
|
7053
|
-
sent: z2.string().datetime().optional()
|
|
7087
|
+
sent: z2.string().datetime().optional(),
|
|
7088
|
+
webhookUrl: z2.string().optional()
|
|
7054
7089
|
});
|
|
7055
7090
|
var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX3 = "auth-grant:";
|
|
7056
7091
|
var AuthGrantValidator2 = z2.object({
|
|
@@ -7074,6 +7109,126 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
7074
7109
|
description: StringQuery2,
|
|
7075
7110
|
status: AuthGrantStatusValidator2
|
|
7076
7111
|
}).partial();
|
|
7112
|
+
var contactMethodBase2 = z2.object({
|
|
7113
|
+
id: z2.string(),
|
|
7114
|
+
isVerified: z2.boolean(),
|
|
7115
|
+
verifiedAt: z2.string().optional(),
|
|
7116
|
+
isPrimary: z2.boolean(),
|
|
7117
|
+
createdAt: z2.string()
|
|
7118
|
+
});
|
|
7119
|
+
var ContactMethodValidator2 = z2.discriminatedUnion("type", [
|
|
7120
|
+
z2.object({
|
|
7121
|
+
type: z2.literal("email"),
|
|
7122
|
+
value: z2.string().email()
|
|
7123
|
+
}).merge(contactMethodBase2),
|
|
7124
|
+
z2.object({
|
|
7125
|
+
type: z2.literal("phone"),
|
|
7126
|
+
value: z2.string()
|
|
7127
|
+
}).merge(contactMethodBase2)
|
|
7128
|
+
]);
|
|
7129
|
+
var createContactMethodBase2 = z2.object({
|
|
7130
|
+
isVerified: z2.boolean().optional(),
|
|
7131
|
+
isPrimary: z2.boolean().optional()
|
|
7132
|
+
});
|
|
7133
|
+
var ContactMethodCreateValidator2 = z2.discriminatedUnion("type", [
|
|
7134
|
+
z2.object({
|
|
7135
|
+
type: z2.literal("email"),
|
|
7136
|
+
value: z2.string().email()
|
|
7137
|
+
}).merge(createContactMethodBase2),
|
|
7138
|
+
z2.object({
|
|
7139
|
+
type: z2.literal("phone"),
|
|
7140
|
+
value: z2.string()
|
|
7141
|
+
}).merge(createContactMethodBase2)
|
|
7142
|
+
]);
|
|
7143
|
+
var ContactMethodQueryValidator2 = z2.discriminatedUnion("type", [
|
|
7144
|
+
z2.object({
|
|
7145
|
+
type: z2.literal("email"),
|
|
7146
|
+
value: z2.string().email()
|
|
7147
|
+
}),
|
|
7148
|
+
z2.object({
|
|
7149
|
+
type: z2.literal("phone"),
|
|
7150
|
+
value: z2.string()
|
|
7151
|
+
})
|
|
7152
|
+
]);
|
|
7153
|
+
var ContactMethodVerificationRequestValidator2 = z2.object({
|
|
7154
|
+
value: z2.string(),
|
|
7155
|
+
type: z2.enum(["email", "phone"])
|
|
7156
|
+
});
|
|
7157
|
+
var ContactMethodVerificationValidator2 = z2.object({
|
|
7158
|
+
token: z2.string()
|
|
7159
|
+
});
|
|
7160
|
+
var SetPrimaryContactMethodValidator2 = z2.object({
|
|
7161
|
+
contactMethodId: z2.string()
|
|
7162
|
+
});
|
|
7163
|
+
var InboxCredentialValidator2 = z2.object({
|
|
7164
|
+
id: z2.string(),
|
|
7165
|
+
credential: z2.string(),
|
|
7166
|
+
isSigned: z2.boolean(),
|
|
7167
|
+
currentStatus: LCNInboxStatusEnumValidator2,
|
|
7168
|
+
expiresAt: z2.string(),
|
|
7169
|
+
createdAt: z2.string(),
|
|
7170
|
+
issuerDid: z2.string(),
|
|
7171
|
+
webhookUrl: z2.string().optional(),
|
|
7172
|
+
"signingAuthority.endpoint": z2.string().optional(),
|
|
7173
|
+
"signingAuthority.name": z2.string().optional()
|
|
7174
|
+
});
|
|
7175
|
+
var PaginatedInboxCredentialsValidator2 = z2.object({
|
|
7176
|
+
hasMore: z2.boolean(),
|
|
7177
|
+
records: z2.array(InboxCredentialValidator2),
|
|
7178
|
+
cursor: z2.string().optional()
|
|
7179
|
+
});
|
|
7180
|
+
var InboxCredentialQueryValidator2 = z2.object({
|
|
7181
|
+
currentStatus: LCNInboxStatusEnumValidator2,
|
|
7182
|
+
id: z2.string(),
|
|
7183
|
+
isSigned: z2.boolean(),
|
|
7184
|
+
issuerDid: z2.string()
|
|
7185
|
+
}).partial();
|
|
7186
|
+
var IssueInboxSigningAuthorityValidator2 = z2.object({
|
|
7187
|
+
endpoint: z2.string().url(),
|
|
7188
|
+
name: z2.string()
|
|
7189
|
+
});
|
|
7190
|
+
var IssueInboxCredentialValidator2 = z2.object({
|
|
7191
|
+
recipient: ContactMethodQueryValidator2.describe("The recipient of the credential"),
|
|
7192
|
+
credential: VCValidator2.passthrough().or(VPValidator2.passthrough()).or(UnsignedVCValidator2.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),
|
|
7193
|
+
configuration: z2.object({
|
|
7194
|
+
signingAuthority: IssueInboxSigningAuthorityValidator2.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),
|
|
7195
|
+
webhookUrl: z2.string().url().optional().describe("The webhook URL to receive credential issuance events."),
|
|
7196
|
+
expiresInDays: z2.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),
|
|
7197
|
+
delivery: z2.object({
|
|
7198
|
+
suppress: z2.boolean().optional().default(false).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),
|
|
7199
|
+
template: z2.object({
|
|
7200
|
+
id: z2.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),
|
|
7201
|
+
model: z2.object({
|
|
7202
|
+
issuer: z2.object({
|
|
7203
|
+
name: z2.string().optional().describe('The name of the organization (e.g., "State University").'),
|
|
7204
|
+
logoUrl: z2.string().url().optional().describe("The URL of the organization's logo.")
|
|
7205
|
+
}).optional(),
|
|
7206
|
+
credential: z2.object({
|
|
7207
|
+
name: z2.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),
|
|
7208
|
+
type: z2.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')
|
|
7209
|
+
}).optional(),
|
|
7210
|
+
recipient: z2.object({
|
|
7211
|
+
name: z2.string().optional().describe('The name of the recipient (e.g., "John Doe").')
|
|
7212
|
+
}).optional()
|
|
7213
|
+
}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")
|
|
7214
|
+
}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")
|
|
7215
|
+
}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")
|
|
7216
|
+
}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")
|
|
7217
|
+
});
|
|
7218
|
+
var IssueInboxCredentialResponseValidator2 = z2.object({
|
|
7219
|
+
issuanceId: z2.string(),
|
|
7220
|
+
status: LCNInboxStatusEnumValidator2,
|
|
7221
|
+
recipient: ContactMethodQueryValidator2,
|
|
7222
|
+
claimUrl: z2.string().url().optional(),
|
|
7223
|
+
recipientDid: z2.string().optional()
|
|
7224
|
+
});
|
|
7225
|
+
var ClaimTokenValidator2 = z2.object({
|
|
7226
|
+
token: z2.string(),
|
|
7227
|
+
contactMethodId: z2.string(),
|
|
7228
|
+
createdAt: z2.string(),
|
|
7229
|
+
expiresAt: z2.string(),
|
|
7230
|
+
used: z2.boolean()
|
|
7231
|
+
});
|
|
7077
7232
|
}
|
|
7078
7233
|
});
|
|
7079
7234
|
var require_dist2 = __commonJS2({
|
|
@@ -11673,7 +11828,7 @@ var LCNProfileValidator = z.object({
|
|
|
11673
11828
|
bio: z.string().default("").describe("Longer bio for the profile."),
|
|
11674
11829
|
did: z.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
|
|
11675
11830
|
isPrivate: z.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
|
|
11676
|
-
email: z.string().optional().describe("Contact email address for the profile."),
|
|
11831
|
+
email: z.string().optional().describe("Contact email address for the profile. (deprecated)"),
|
|
11677
11832
|
image: z.string().optional().describe("Profile image URL for the profile."),
|
|
11678
11833
|
heroImage: z.string().optional().describe("Hero image URL for the profile."),
|
|
11679
11834
|
websiteLink: z.string().optional().describe("Website link for the profile."),
|
|
@@ -11842,7 +11997,8 @@ var LCNSigningAuthorityForUserValidator = z.object({
|
|
|
11842
11997
|
name: z.string().max(15).regex(/^[a-z0-9-]+$/, {
|
|
11843
11998
|
message: "The input string must contain only lowercase letters, numbers, and hyphens."
|
|
11844
11999
|
}),
|
|
11845
|
-
did: z.string()
|
|
12000
|
+
did: z.string(),
|
|
12001
|
+
isPrimary: z.boolean().optional()
|
|
11846
12002
|
})
|
|
11847
12003
|
});
|
|
11848
12004
|
var AutoBoostConfigValidator = z.object({
|
|
@@ -12023,16 +12179,33 @@ var LCNNotificationTypeEnumValidator = z.enum([
|
|
|
12023
12179
|
"BOOST_ACCEPTED",
|
|
12024
12180
|
"PRESENTATION_REQUEST",
|
|
12025
12181
|
"PRESENTATION_RECEIVED",
|
|
12026
|
-
"CONSENT_FLOW_TRANSACTION"
|
|
12182
|
+
"CONSENT_FLOW_TRANSACTION",
|
|
12183
|
+
"ISSUANCE_CLAIMED",
|
|
12184
|
+
"ISSUANCE_DELIVERED"
|
|
12027
12185
|
]);
|
|
12028
12186
|
var LCNNotificationMessageValidator = z.object({
|
|
12029
12187
|
title: z.string().optional(),
|
|
12030
12188
|
body: z.string().optional()
|
|
12031
12189
|
});
|
|
12190
|
+
var LCNInboxContactMethodValidator = z.object({
|
|
12191
|
+
type: z.string(),
|
|
12192
|
+
value: z.string()
|
|
12193
|
+
});
|
|
12194
|
+
var LCNInboxStatusEnumValidator = z.enum(["PENDING", "DELIVERED", "CLAIMED", "EXPIRED"]);
|
|
12195
|
+
var LCNNotificationInboxValidator = z.object({
|
|
12196
|
+
issuanceId: z.string(),
|
|
12197
|
+
status: LCNInboxStatusEnumValidator,
|
|
12198
|
+
recipient: z.object({
|
|
12199
|
+
contactMethod: LCNInboxContactMethodValidator.optional(),
|
|
12200
|
+
learnCardId: z.string().optional()
|
|
12201
|
+
}),
|
|
12202
|
+
timestamp: z.string().datetime().optional()
|
|
12203
|
+
});
|
|
12032
12204
|
var LCNNotificationDataValidator = z.object({
|
|
12033
12205
|
vcUris: z.array(z.string()).optional(),
|
|
12034
12206
|
vpUris: z.array(z.string()).optional(),
|
|
12035
|
-
transaction: ConsentFlowTransactionValidator.optional()
|
|
12207
|
+
transaction: ConsentFlowTransactionValidator.optional(),
|
|
12208
|
+
inbox: LCNNotificationInboxValidator.optional()
|
|
12036
12209
|
});
|
|
12037
12210
|
var LCNNotificationValidator = z.object({
|
|
12038
12211
|
type: LCNNotificationTypeEnumValidator,
|
|
@@ -12040,7 +12213,8 @@ var LCNNotificationValidator = z.object({
|
|
|
12040
12213
|
from: LCNProfileValidator.partial().and(z.object({ did: z.string() })),
|
|
12041
12214
|
message: LCNNotificationMessageValidator.optional(),
|
|
12042
12215
|
data: LCNNotificationDataValidator.optional(),
|
|
12043
|
-
sent: z.string().datetime().optional()
|
|
12216
|
+
sent: z.string().datetime().optional(),
|
|
12217
|
+
webhookUrl: z.string().optional()
|
|
12044
12218
|
});
|
|
12045
12219
|
var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = "auth-grant:";
|
|
12046
12220
|
var AuthGrantValidator = z.object({
|
|
@@ -12064,6 +12238,126 @@ var AuthGrantQueryValidator = z.object({
|
|
|
12064
12238
|
description: StringQuery,
|
|
12065
12239
|
status: AuthGrantStatusValidator
|
|
12066
12240
|
}).partial();
|
|
12241
|
+
var contactMethodBase = z.object({
|
|
12242
|
+
id: z.string(),
|
|
12243
|
+
isVerified: z.boolean(),
|
|
12244
|
+
verifiedAt: z.string().optional(),
|
|
12245
|
+
isPrimary: z.boolean(),
|
|
12246
|
+
createdAt: z.string()
|
|
12247
|
+
});
|
|
12248
|
+
var ContactMethodValidator = z.discriminatedUnion("type", [
|
|
12249
|
+
z.object({
|
|
12250
|
+
type: z.literal("email"),
|
|
12251
|
+
value: z.string().email()
|
|
12252
|
+
}).merge(contactMethodBase),
|
|
12253
|
+
z.object({
|
|
12254
|
+
type: z.literal("phone"),
|
|
12255
|
+
value: z.string()
|
|
12256
|
+
}).merge(contactMethodBase)
|
|
12257
|
+
]);
|
|
12258
|
+
var createContactMethodBase = z.object({
|
|
12259
|
+
isVerified: z.boolean().optional(),
|
|
12260
|
+
isPrimary: z.boolean().optional()
|
|
12261
|
+
});
|
|
12262
|
+
var ContactMethodCreateValidator = z.discriminatedUnion("type", [
|
|
12263
|
+
z.object({
|
|
12264
|
+
type: z.literal("email"),
|
|
12265
|
+
value: z.string().email()
|
|
12266
|
+
}).merge(createContactMethodBase),
|
|
12267
|
+
z.object({
|
|
12268
|
+
type: z.literal("phone"),
|
|
12269
|
+
value: z.string()
|
|
12270
|
+
}).merge(createContactMethodBase)
|
|
12271
|
+
]);
|
|
12272
|
+
var ContactMethodQueryValidator = z.discriminatedUnion("type", [
|
|
12273
|
+
z.object({
|
|
12274
|
+
type: z.literal("email"),
|
|
12275
|
+
value: z.string().email()
|
|
12276
|
+
}),
|
|
12277
|
+
z.object({
|
|
12278
|
+
type: z.literal("phone"),
|
|
12279
|
+
value: z.string()
|
|
12280
|
+
})
|
|
12281
|
+
]);
|
|
12282
|
+
var ContactMethodVerificationRequestValidator = z.object({
|
|
12283
|
+
value: z.string(),
|
|
12284
|
+
type: z.enum(["email", "phone"])
|
|
12285
|
+
});
|
|
12286
|
+
var ContactMethodVerificationValidator = z.object({
|
|
12287
|
+
token: z.string()
|
|
12288
|
+
});
|
|
12289
|
+
var SetPrimaryContactMethodValidator = z.object({
|
|
12290
|
+
contactMethodId: z.string()
|
|
12291
|
+
});
|
|
12292
|
+
var InboxCredentialValidator = z.object({
|
|
12293
|
+
id: z.string(),
|
|
12294
|
+
credential: z.string(),
|
|
12295
|
+
isSigned: z.boolean(),
|
|
12296
|
+
currentStatus: LCNInboxStatusEnumValidator,
|
|
12297
|
+
expiresAt: z.string(),
|
|
12298
|
+
createdAt: z.string(),
|
|
12299
|
+
issuerDid: z.string(),
|
|
12300
|
+
webhookUrl: z.string().optional(),
|
|
12301
|
+
"signingAuthority.endpoint": z.string().optional(),
|
|
12302
|
+
"signingAuthority.name": z.string().optional()
|
|
12303
|
+
});
|
|
12304
|
+
var PaginatedInboxCredentialsValidator = z.object({
|
|
12305
|
+
hasMore: z.boolean(),
|
|
12306
|
+
records: z.array(InboxCredentialValidator),
|
|
12307
|
+
cursor: z.string().optional()
|
|
12308
|
+
});
|
|
12309
|
+
var InboxCredentialQueryValidator = z.object({
|
|
12310
|
+
currentStatus: LCNInboxStatusEnumValidator,
|
|
12311
|
+
id: z.string(),
|
|
12312
|
+
isSigned: z.boolean(),
|
|
12313
|
+
issuerDid: z.string()
|
|
12314
|
+
}).partial();
|
|
12315
|
+
var IssueInboxSigningAuthorityValidator = z.object({
|
|
12316
|
+
endpoint: z.string().url(),
|
|
12317
|
+
name: z.string()
|
|
12318
|
+
});
|
|
12319
|
+
var IssueInboxCredentialValidator = z.object({
|
|
12320
|
+
recipient: ContactMethodQueryValidator.describe("The recipient of the credential"),
|
|
12321
|
+
credential: VCValidator.passthrough().or(VPValidator.passthrough()).or(UnsignedVCValidator.passthrough()).describe("The credential to issue. If not signed, the users default signing authority will be used, or the specified signing authority in the configuration."),
|
|
12322
|
+
configuration: z.object({
|
|
12323
|
+
signingAuthority: IssueInboxSigningAuthorityValidator.optional().describe("The signing authority to use for the credential. If not provided, the users default signing authority will be used if the credential is not signed."),
|
|
12324
|
+
webhookUrl: z.string().url().optional().describe("The webhook URL to receive credential issuance events."),
|
|
12325
|
+
expiresInDays: z.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),
|
|
12326
|
+
delivery: z.object({
|
|
12327
|
+
suppress: z.boolean().optional().default(false).describe("Whether to suppress delivery of the credential to the recipient. If true, the email/sms will not be sent to the recipient. Useful if you would like to manually send claim link to your users."),
|
|
12328
|
+
template: z.object({
|
|
12329
|
+
id: z.enum(["universal-inbox-claim"]).optional().describe("The template ID to use for the credential delivery. If not provided, the default template will be used."),
|
|
12330
|
+
model: z.object({
|
|
12331
|
+
issuer: z.object({
|
|
12332
|
+
name: z.string().optional().describe('The name of the organization (e.g., "State University").'),
|
|
12333
|
+
logoUrl: z.string().url().optional().describe("The URL of the organization's logo.")
|
|
12334
|
+
}).optional(),
|
|
12335
|
+
credential: z.object({
|
|
12336
|
+
name: z.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),
|
|
12337
|
+
type: z.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')
|
|
12338
|
+
}).optional(),
|
|
12339
|
+
recipient: z.object({
|
|
12340
|
+
name: z.string().optional().describe('The name of the recipient (e.g., "John Doe").')
|
|
12341
|
+
}).optional()
|
|
12342
|
+
}).describe("The template model to use for the credential delivery. Injects via template variables into email/sms templates. If not provided, the default template will be used.")
|
|
12343
|
+
}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")
|
|
12344
|
+
}).optional().describe("Configuration for the credential delivery i.e. email or SMS. When credentials are sent to a user who has a verified email or phone associated with their account, delivery is skipped, and the credential will be sent using in-app notifications. If not provided, the default configuration will be used.")
|
|
12345
|
+
}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")
|
|
12346
|
+
});
|
|
12347
|
+
var IssueInboxCredentialResponseValidator = z.object({
|
|
12348
|
+
issuanceId: z.string(),
|
|
12349
|
+
status: LCNInboxStatusEnumValidator,
|
|
12350
|
+
recipient: ContactMethodQueryValidator,
|
|
12351
|
+
claimUrl: z.string().url().optional(),
|
|
12352
|
+
recipientDid: z.string().optional()
|
|
12353
|
+
});
|
|
12354
|
+
var ClaimTokenValidator = z.object({
|
|
12355
|
+
token: z.string(),
|
|
12356
|
+
contactMethodId: z.string(),
|
|
12357
|
+
createdAt: z.string(),
|
|
12358
|
+
expiresAt: z.string(),
|
|
12359
|
+
used: z.boolean()
|
|
12360
|
+
});
|
|
12067
12361
|
|
|
12068
12362
|
// src/plugin.ts
|
|
12069
12363
|
var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) => {
|
|
@@ -12648,6 +12942,16 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
12648
12942
|
throw new Error("Please make an account first!");
|
|
12649
12943
|
return client.profile.signingAuthority.query({ endpoint, name });
|
|
12650
12944
|
},
|
|
12945
|
+
setPrimaryRegisteredSigningAuthority: async (_learnCard, endpoint, name) => {
|
|
12946
|
+
if (!userData)
|
|
12947
|
+
throw new Error("Please make an account first!");
|
|
12948
|
+
return client.profile.setPrimarySigningAuthority.mutate({ endpoint, name });
|
|
12949
|
+
},
|
|
12950
|
+
getPrimaryRegisteredSigningAuthority: async (_learnCard) => {
|
|
12951
|
+
if (!userData)
|
|
12952
|
+
throw new Error("Please make an account first!");
|
|
12953
|
+
return client.profile.primarySigningAuthority.query();
|
|
12954
|
+
},
|
|
12651
12955
|
generateClaimLink: async (_learnCard, boostUri, claimLinkSA, options, challenge) => {
|
|
12652
12956
|
if (!userData)
|
|
12653
12957
|
throw new Error("Please make an account first!");
|
|
@@ -12876,6 +13180,46 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
12876
13180
|
throw new Error("Failed to get API Token for auth grant");
|
|
12877
13181
|
return apiToken;
|
|
12878
13182
|
},
|
|
13183
|
+
sendCredentialViaInbox: async (_learnCard, issueInboxCredential) => {
|
|
13184
|
+
if (!userData)
|
|
13185
|
+
throw new Error("Please make an account first!");
|
|
13186
|
+
return client.inbox.issue.mutate(issueInboxCredential);
|
|
13187
|
+
},
|
|
13188
|
+
getMySentInboxCredentials: async (_learnCard, options) => {
|
|
13189
|
+
if (!userData)
|
|
13190
|
+
throw new Error("Please make an account first!");
|
|
13191
|
+
return client.inbox.getMyIssuedCredentials.query(options);
|
|
13192
|
+
},
|
|
13193
|
+
getInboxCredential: async (_learnCard, id) => {
|
|
13194
|
+
if (!userData)
|
|
13195
|
+
throw new Error("Please make an account first!");
|
|
13196
|
+
return client.inbox.getInboxCredential.query({ credentialId: id });
|
|
13197
|
+
},
|
|
13198
|
+
addContactMethod: async (_learnCard, contactMethod) => {
|
|
13199
|
+
if (!userData)
|
|
13200
|
+
throw new Error("Please make an account first!");
|
|
13201
|
+
return client.contactMethods.addContactMethod.mutate(contactMethod);
|
|
13202
|
+
},
|
|
13203
|
+
getMyContactMethods: async (_learnCard) => {
|
|
13204
|
+
if (!userData)
|
|
13205
|
+
throw new Error("Please make an account first!");
|
|
13206
|
+
return client.contactMethods.getMyContactMethods.query();
|
|
13207
|
+
},
|
|
13208
|
+
setPrimaryContactMethod: async (_learnCard, contactMethodId) => {
|
|
13209
|
+
if (!userData)
|
|
13210
|
+
throw new Error("Please make an account first!");
|
|
13211
|
+
return client.contactMethods.setPrimaryContactMethod.mutate({ contactMethodId });
|
|
13212
|
+
},
|
|
13213
|
+
verifyContactMethod: async (_learnCard, token) => {
|
|
13214
|
+
if (!userData)
|
|
13215
|
+
throw new Error("Please make an account first!");
|
|
13216
|
+
return client.contactMethods.verifyContactMethod.mutate({ token });
|
|
13217
|
+
},
|
|
13218
|
+
removeContactMethod: async (_learnCard, id) => {
|
|
13219
|
+
if (!userData)
|
|
13220
|
+
throw new Error("Please make an account first!");
|
|
13221
|
+
return client.contactMethods.removeContactMethod.mutate({ id });
|
|
13222
|
+
},
|
|
12879
13223
|
resolveFromLCN: async (_learnCard, uri) => {
|
|
12880
13224
|
const result = await client.storage.resolve.query({ uri });
|
|
12881
13225
|
return UnsignedVCValidator.or(VCValidator).or(VPValidator).or(JWEValidator).or(ConsentFlowContractValidator).or(ConsentFlowTermsValidator).parseAsync(result);
|