@learncard/network-plugin 2.4.38 → 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 +358 -12
- 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 +358 -12
- 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
package/dist/lcn-plugin.esm.js
CHANGED
|
@@ -2044,6 +2044,7 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2044
2044
|
ClaimHookQueryValidator: () => ClaimHookQueryValidator2,
|
|
2045
2045
|
ClaimHookTypeValidator: () => ClaimHookTypeValidator2,
|
|
2046
2046
|
ClaimHookValidator: () => ClaimHookValidator2,
|
|
2047
|
+
ClaimTokenValidator: () => ClaimTokenValidator2,
|
|
2047
2048
|
ConsentFlowContractDataForDidValidator: () => ConsentFlowContractDataForDidValidator2,
|
|
2048
2049
|
ConsentFlowContractDataValidator: () => ConsentFlowContractDataValidator2,
|
|
2049
2050
|
ConsentFlowContractDetailsValidator: () => ConsentFlowContractDetailsValidator2,
|
|
@@ -2058,6 +2059,11 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2058
2059
|
ConsentFlowTransactionActionValidator: () => ConsentFlowTransactionActionValidator2,
|
|
2059
2060
|
ConsentFlowTransactionValidator: () => ConsentFlowTransactionValidator2,
|
|
2060
2061
|
ConsentFlowTransactionsQueryValidator: () => ConsentFlowTransactionsQueryValidator2,
|
|
2062
|
+
ContactMethodCreateValidator: () => ContactMethodCreateValidator2,
|
|
2063
|
+
ContactMethodQueryValidator: () => ContactMethodQueryValidator2,
|
|
2064
|
+
ContactMethodValidator: () => ContactMethodValidator2,
|
|
2065
|
+
ContactMethodVerificationRequestValidator: () => ContactMethodVerificationRequestValidator2,
|
|
2066
|
+
ContactMethodVerificationValidator: () => ContactMethodVerificationValidator2,
|
|
2061
2067
|
ContextValidator: () => ContextValidator2,
|
|
2062
2068
|
ContractCredentialValidator: () => ContractCredentialValidator2,
|
|
2063
2069
|
CredentialInfoValidator: () => CredentialInfoValidator2,
|
|
@@ -2079,6 +2085,11 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2079
2085
|
IdentifierTypeValidator: () => IdentifierTypeValidator2,
|
|
2080
2086
|
IdentityObjectValidator: () => IdentityObjectValidator2,
|
|
2081
2087
|
ImageValidator: () => ImageValidator2,
|
|
2088
|
+
InboxCredentialQueryValidator: () => InboxCredentialQueryValidator2,
|
|
2089
|
+
InboxCredentialValidator: () => InboxCredentialValidator2,
|
|
2090
|
+
IssueInboxCredentialResponseValidator: () => IssueInboxCredentialResponseValidator2,
|
|
2091
|
+
IssueInboxCredentialValidator: () => IssueInboxCredentialValidator2,
|
|
2092
|
+
IssueInboxSigningAuthorityValidator: () => IssueInboxSigningAuthorityValidator2,
|
|
2082
2093
|
JWERecipientHeaderValidator: () => JWERecipientHeaderValidator2,
|
|
2083
2094
|
JWERecipientValidator: () => JWERecipientValidator2,
|
|
2084
2095
|
JWEValidator: () => JWEValidator2,
|
|
@@ -2088,7 +2099,10 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2088
2099
|
LCNBoostClaimLinkOptionsValidator: () => LCNBoostClaimLinkOptionsValidator2,
|
|
2089
2100
|
LCNBoostClaimLinkSigningAuthorityValidator: () => LCNBoostClaimLinkSigningAuthorityValidator2,
|
|
2090
2101
|
LCNBoostStatus: () => LCNBoostStatus2,
|
|
2102
|
+
LCNInboxContactMethodValidator: () => LCNInboxContactMethodValidator2,
|
|
2103
|
+
LCNInboxStatusEnumValidator: () => LCNInboxStatusEnumValidator2,
|
|
2091
2104
|
LCNNotificationDataValidator: () => LCNNotificationDataValidator2,
|
|
2105
|
+
LCNNotificationInboxValidator: () => LCNNotificationInboxValidator2,
|
|
2092
2106
|
LCNNotificationMessageValidator: () => LCNNotificationMessageValidator2,
|
|
2093
2107
|
LCNNotificationTypeEnumValidator: () => LCNNotificationTypeEnumValidator2,
|
|
2094
2108
|
LCNNotificationValidator: () => LCNNotificationValidator2,
|
|
@@ -2111,6 +2125,7 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2111
2125
|
PaginatedContractCredentialsValidator: () => PaginatedContractCredentialsValidator2,
|
|
2112
2126
|
PaginatedEncryptedCredentialRecordsValidator: () => PaginatedEncryptedCredentialRecordsValidator2,
|
|
2113
2127
|
PaginatedEncryptedRecordsValidator: () => PaginatedEncryptedRecordsValidator2,
|
|
2128
|
+
PaginatedInboxCredentialsValidator: () => PaginatedInboxCredentialsValidator2,
|
|
2114
2129
|
PaginatedLCNProfileManagersValidator: () => PaginatedLCNProfileManagersValidator2,
|
|
2115
2130
|
PaginatedLCNProfilesAndManagersValidator: () => PaginatedLCNProfilesAndManagersValidator2,
|
|
2116
2131
|
PaginatedLCNProfilesValidator: () => PaginatedLCNProfilesValidator2,
|
|
@@ -2128,6 +2143,7 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2128
2143
|
RubricCriterionValidator: () => RubricCriterionValidator2,
|
|
2129
2144
|
SentCredentialInfoValidator: () => SentCredentialInfoValidator2,
|
|
2130
2145
|
ServiceValidator: () => ServiceValidator2,
|
|
2146
|
+
SetPrimaryContactMethodValidator: () => SetPrimaryContactMethodValidator2,
|
|
2131
2147
|
StringQuery: () => StringQuery2,
|
|
2132
2148
|
TermsOfUseValidator: () => TermsOfUseValidator2,
|
|
2133
2149
|
UnsignedAchievementCredentialValidator: () => UnsignedAchievementCredentialValidator2,
|
|
@@ -6658,7 +6674,7 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
6658
6674
|
bio: z2.string().default("").describe("Longer bio for the profile."),
|
|
6659
6675
|
did: z2.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
|
|
6660
6676
|
isPrivate: z2.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
|
|
6661
|
-
email: z2.string().optional().describe("Contact email address for the profile."),
|
|
6677
|
+
email: z2.string().optional().describe("Contact email address for the profile. (deprecated)"),
|
|
6662
6678
|
image: z2.string().optional().describe("Profile image URL for the profile."),
|
|
6663
6679
|
heroImage: z2.string().optional().describe("Hero image URL for the profile."),
|
|
6664
6680
|
websiteLink: z2.string().optional().describe("Website link for the profile."),
|
|
@@ -6785,7 +6801,8 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
6785
6801
|
status: LCNBoostStatus2.optional(),
|
|
6786
6802
|
autoConnectRecipients: z2.boolean().optional(),
|
|
6787
6803
|
meta: z2.record(z2.any()).optional(),
|
|
6788
|
-
claimPermissions: BoostPermissionsValidator2.optional()
|
|
6804
|
+
claimPermissions: BoostPermissionsValidator2.optional(),
|
|
6805
|
+
allowAnyoneToCreateChildren: z2.boolean().optional()
|
|
6789
6806
|
});
|
|
6790
6807
|
var BoostQueryValidator2 = z2.object({
|
|
6791
6808
|
uri: StringQuery2,
|
|
@@ -6826,7 +6843,8 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
6826
6843
|
name: z2.string().max(15).regex(/^[a-z0-9-]+$/, {
|
|
6827
6844
|
message: "The input string must contain only lowercase letters, numbers, and hyphens."
|
|
6828
6845
|
}),
|
|
6829
|
-
did: z2.string()
|
|
6846
|
+
did: z2.string(),
|
|
6847
|
+
isPrimary: z2.boolean().optional()
|
|
6830
6848
|
})
|
|
6831
6849
|
});
|
|
6832
6850
|
var AutoBoostConfigValidator2 = z2.object({
|
|
@@ -7007,16 +7025,33 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
7007
7025
|
"BOOST_ACCEPTED",
|
|
7008
7026
|
"PRESENTATION_REQUEST",
|
|
7009
7027
|
"PRESENTATION_RECEIVED",
|
|
7010
|
-
"CONSENT_FLOW_TRANSACTION"
|
|
7028
|
+
"CONSENT_FLOW_TRANSACTION",
|
|
7029
|
+
"ISSUANCE_CLAIMED",
|
|
7030
|
+
"ISSUANCE_DELIVERED"
|
|
7011
7031
|
]);
|
|
7012
7032
|
var LCNNotificationMessageValidator2 = z2.object({
|
|
7013
7033
|
title: z2.string().optional(),
|
|
7014
7034
|
body: z2.string().optional()
|
|
7015
7035
|
});
|
|
7036
|
+
var LCNInboxContactMethodValidator2 = z2.object({
|
|
7037
|
+
type: z2.string(),
|
|
7038
|
+
value: z2.string()
|
|
7039
|
+
});
|
|
7040
|
+
var LCNInboxStatusEnumValidator2 = z2.enum(["PENDING", "DELIVERED", "CLAIMED", "EXPIRED"]);
|
|
7041
|
+
var LCNNotificationInboxValidator2 = z2.object({
|
|
7042
|
+
issuanceId: z2.string(),
|
|
7043
|
+
status: LCNInboxStatusEnumValidator2,
|
|
7044
|
+
recipient: z2.object({
|
|
7045
|
+
contactMethod: LCNInboxContactMethodValidator2.optional(),
|
|
7046
|
+
learnCardId: z2.string().optional()
|
|
7047
|
+
}),
|
|
7048
|
+
timestamp: z2.string().datetime().optional()
|
|
7049
|
+
});
|
|
7016
7050
|
var LCNNotificationDataValidator2 = z2.object({
|
|
7017
7051
|
vcUris: z2.array(z2.string()).optional(),
|
|
7018
7052
|
vpUris: z2.array(z2.string()).optional(),
|
|
7019
|
-
transaction: ConsentFlowTransactionValidator2.optional()
|
|
7053
|
+
transaction: ConsentFlowTransactionValidator2.optional(),
|
|
7054
|
+
inbox: LCNNotificationInboxValidator2.optional()
|
|
7020
7055
|
});
|
|
7021
7056
|
var LCNNotificationValidator2 = z2.object({
|
|
7022
7057
|
type: LCNNotificationTypeEnumValidator2,
|
|
@@ -7024,7 +7059,8 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
7024
7059
|
from: LCNProfileValidator2.partial().and(z2.object({ did: z2.string() })),
|
|
7025
7060
|
message: LCNNotificationMessageValidator2.optional(),
|
|
7026
7061
|
data: LCNNotificationDataValidator2.optional(),
|
|
7027
|
-
sent: z2.string().datetime().optional()
|
|
7062
|
+
sent: z2.string().datetime().optional(),
|
|
7063
|
+
webhookUrl: z2.string().optional()
|
|
7028
7064
|
});
|
|
7029
7065
|
var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX3 = "auth-grant:";
|
|
7030
7066
|
var AuthGrantValidator2 = z2.object({
|
|
@@ -7048,6 +7084,126 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
7048
7084
|
description: StringQuery2,
|
|
7049
7085
|
status: AuthGrantStatusValidator2
|
|
7050
7086
|
}).partial();
|
|
7087
|
+
var contactMethodBase2 = z2.object({
|
|
7088
|
+
id: z2.string(),
|
|
7089
|
+
isVerified: z2.boolean(),
|
|
7090
|
+
verifiedAt: z2.string().optional(),
|
|
7091
|
+
isPrimary: z2.boolean(),
|
|
7092
|
+
createdAt: z2.string()
|
|
7093
|
+
});
|
|
7094
|
+
var ContactMethodValidator2 = z2.discriminatedUnion("type", [
|
|
7095
|
+
z2.object({
|
|
7096
|
+
type: z2.literal("email"),
|
|
7097
|
+
value: z2.string().email()
|
|
7098
|
+
}).merge(contactMethodBase2),
|
|
7099
|
+
z2.object({
|
|
7100
|
+
type: z2.literal("phone"),
|
|
7101
|
+
value: z2.string()
|
|
7102
|
+
}).merge(contactMethodBase2)
|
|
7103
|
+
]);
|
|
7104
|
+
var createContactMethodBase2 = z2.object({
|
|
7105
|
+
isVerified: z2.boolean().optional(),
|
|
7106
|
+
isPrimary: z2.boolean().optional()
|
|
7107
|
+
});
|
|
7108
|
+
var ContactMethodCreateValidator2 = z2.discriminatedUnion("type", [
|
|
7109
|
+
z2.object({
|
|
7110
|
+
type: z2.literal("email"),
|
|
7111
|
+
value: z2.string().email()
|
|
7112
|
+
}).merge(createContactMethodBase2),
|
|
7113
|
+
z2.object({
|
|
7114
|
+
type: z2.literal("phone"),
|
|
7115
|
+
value: z2.string()
|
|
7116
|
+
}).merge(createContactMethodBase2)
|
|
7117
|
+
]);
|
|
7118
|
+
var ContactMethodQueryValidator2 = z2.discriminatedUnion("type", [
|
|
7119
|
+
z2.object({
|
|
7120
|
+
type: z2.literal("email"),
|
|
7121
|
+
value: z2.string().email()
|
|
7122
|
+
}),
|
|
7123
|
+
z2.object({
|
|
7124
|
+
type: z2.literal("phone"),
|
|
7125
|
+
value: z2.string()
|
|
7126
|
+
})
|
|
7127
|
+
]);
|
|
7128
|
+
var ContactMethodVerificationRequestValidator2 = z2.object({
|
|
7129
|
+
value: z2.string(),
|
|
7130
|
+
type: z2.enum(["email", "phone"])
|
|
7131
|
+
});
|
|
7132
|
+
var ContactMethodVerificationValidator2 = z2.object({
|
|
7133
|
+
token: z2.string()
|
|
7134
|
+
});
|
|
7135
|
+
var SetPrimaryContactMethodValidator2 = z2.object({
|
|
7136
|
+
contactMethodId: z2.string()
|
|
7137
|
+
});
|
|
7138
|
+
var InboxCredentialValidator2 = z2.object({
|
|
7139
|
+
id: z2.string(),
|
|
7140
|
+
credential: z2.string(),
|
|
7141
|
+
isSigned: z2.boolean(),
|
|
7142
|
+
currentStatus: LCNInboxStatusEnumValidator2,
|
|
7143
|
+
expiresAt: z2.string(),
|
|
7144
|
+
createdAt: z2.string(),
|
|
7145
|
+
issuerDid: z2.string(),
|
|
7146
|
+
webhookUrl: z2.string().optional(),
|
|
7147
|
+
"signingAuthority.endpoint": z2.string().optional(),
|
|
7148
|
+
"signingAuthority.name": z2.string().optional()
|
|
7149
|
+
});
|
|
7150
|
+
var PaginatedInboxCredentialsValidator2 = z2.object({
|
|
7151
|
+
hasMore: z2.boolean(),
|
|
7152
|
+
records: z2.array(InboxCredentialValidator2),
|
|
7153
|
+
cursor: z2.string().optional()
|
|
7154
|
+
});
|
|
7155
|
+
var InboxCredentialQueryValidator2 = z2.object({
|
|
7156
|
+
currentStatus: LCNInboxStatusEnumValidator2,
|
|
7157
|
+
id: z2.string(),
|
|
7158
|
+
isSigned: z2.boolean(),
|
|
7159
|
+
issuerDid: z2.string()
|
|
7160
|
+
}).partial();
|
|
7161
|
+
var IssueInboxSigningAuthorityValidator2 = z2.object({
|
|
7162
|
+
endpoint: z2.string().url(),
|
|
7163
|
+
name: z2.string()
|
|
7164
|
+
});
|
|
7165
|
+
var IssueInboxCredentialValidator2 = z2.object({
|
|
7166
|
+
recipient: ContactMethodQueryValidator2.describe("The recipient of the credential"),
|
|
7167
|
+
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."),
|
|
7168
|
+
configuration: z2.object({
|
|
7169
|
+
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."),
|
|
7170
|
+
webhookUrl: z2.string().url().optional().describe("The webhook URL to receive credential issuance events."),
|
|
7171
|
+
expiresInDays: z2.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),
|
|
7172
|
+
delivery: z2.object({
|
|
7173
|
+
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."),
|
|
7174
|
+
template: z2.object({
|
|
7175
|
+
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."),
|
|
7176
|
+
model: z2.object({
|
|
7177
|
+
issuer: z2.object({
|
|
7178
|
+
name: z2.string().optional().describe('The name of the organization (e.g., "State University").'),
|
|
7179
|
+
logoUrl: z2.string().url().optional().describe("The URL of the organization's logo.")
|
|
7180
|
+
}).optional(),
|
|
7181
|
+
credential: z2.object({
|
|
7182
|
+
name: z2.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),
|
|
7183
|
+
type: z2.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')
|
|
7184
|
+
}).optional(),
|
|
7185
|
+
recipient: z2.object({
|
|
7186
|
+
name: z2.string().optional().describe('The name of the recipient (e.g., "John Doe").')
|
|
7187
|
+
}).optional()
|
|
7188
|
+
}).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.")
|
|
7189
|
+
}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")
|
|
7190
|
+
}).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.")
|
|
7191
|
+
}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")
|
|
7192
|
+
});
|
|
7193
|
+
var IssueInboxCredentialResponseValidator2 = z2.object({
|
|
7194
|
+
issuanceId: z2.string(),
|
|
7195
|
+
status: LCNInboxStatusEnumValidator2,
|
|
7196
|
+
recipient: ContactMethodQueryValidator2,
|
|
7197
|
+
claimUrl: z2.string().url().optional(),
|
|
7198
|
+
recipientDid: z2.string().optional()
|
|
7199
|
+
});
|
|
7200
|
+
var ClaimTokenValidator2 = z2.object({
|
|
7201
|
+
token: z2.string(),
|
|
7202
|
+
contactMethodId: z2.string(),
|
|
7203
|
+
createdAt: z2.string(),
|
|
7204
|
+
expiresAt: z2.string(),
|
|
7205
|
+
used: z2.boolean()
|
|
7206
|
+
});
|
|
7051
7207
|
}
|
|
7052
7208
|
});
|
|
7053
7209
|
var require_dist2 = __commonJS2({
|
|
@@ -11647,7 +11803,7 @@ var LCNProfileValidator = z.object({
|
|
|
11647
11803
|
bio: z.string().default("").describe("Longer bio for the profile."),
|
|
11648
11804
|
did: z.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
|
|
11649
11805
|
isPrivate: z.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
|
|
11650
|
-
email: z.string().optional().describe("Contact email address for the profile."),
|
|
11806
|
+
email: z.string().optional().describe("Contact email address for the profile. (deprecated)"),
|
|
11651
11807
|
image: z.string().optional().describe("Profile image URL for the profile."),
|
|
11652
11808
|
heroImage: z.string().optional().describe("Hero image URL for the profile."),
|
|
11653
11809
|
websiteLink: z.string().optional().describe("Website link for the profile."),
|
|
@@ -11774,7 +11930,8 @@ var BoostValidator = z.object({
|
|
|
11774
11930
|
status: LCNBoostStatus.optional(),
|
|
11775
11931
|
autoConnectRecipients: z.boolean().optional(),
|
|
11776
11932
|
meta: z.record(z.any()).optional(),
|
|
11777
|
-
claimPermissions: BoostPermissionsValidator.optional()
|
|
11933
|
+
claimPermissions: BoostPermissionsValidator.optional(),
|
|
11934
|
+
allowAnyoneToCreateChildren: z.boolean().optional()
|
|
11778
11935
|
});
|
|
11779
11936
|
var BoostQueryValidator = z.object({
|
|
11780
11937
|
uri: StringQuery,
|
|
@@ -11815,7 +11972,8 @@ var LCNSigningAuthorityForUserValidator = z.object({
|
|
|
11815
11972
|
name: z.string().max(15).regex(/^[a-z0-9-]+$/, {
|
|
11816
11973
|
message: "The input string must contain only lowercase letters, numbers, and hyphens."
|
|
11817
11974
|
}),
|
|
11818
|
-
did: z.string()
|
|
11975
|
+
did: z.string(),
|
|
11976
|
+
isPrimary: z.boolean().optional()
|
|
11819
11977
|
})
|
|
11820
11978
|
});
|
|
11821
11979
|
var AutoBoostConfigValidator = z.object({
|
|
@@ -11996,16 +12154,33 @@ var LCNNotificationTypeEnumValidator = z.enum([
|
|
|
11996
12154
|
"BOOST_ACCEPTED",
|
|
11997
12155
|
"PRESENTATION_REQUEST",
|
|
11998
12156
|
"PRESENTATION_RECEIVED",
|
|
11999
|
-
"CONSENT_FLOW_TRANSACTION"
|
|
12157
|
+
"CONSENT_FLOW_TRANSACTION",
|
|
12158
|
+
"ISSUANCE_CLAIMED",
|
|
12159
|
+
"ISSUANCE_DELIVERED"
|
|
12000
12160
|
]);
|
|
12001
12161
|
var LCNNotificationMessageValidator = z.object({
|
|
12002
12162
|
title: z.string().optional(),
|
|
12003
12163
|
body: z.string().optional()
|
|
12004
12164
|
});
|
|
12165
|
+
var LCNInboxContactMethodValidator = z.object({
|
|
12166
|
+
type: z.string(),
|
|
12167
|
+
value: z.string()
|
|
12168
|
+
});
|
|
12169
|
+
var LCNInboxStatusEnumValidator = z.enum(["PENDING", "DELIVERED", "CLAIMED", "EXPIRED"]);
|
|
12170
|
+
var LCNNotificationInboxValidator = z.object({
|
|
12171
|
+
issuanceId: z.string(),
|
|
12172
|
+
status: LCNInboxStatusEnumValidator,
|
|
12173
|
+
recipient: z.object({
|
|
12174
|
+
contactMethod: LCNInboxContactMethodValidator.optional(),
|
|
12175
|
+
learnCardId: z.string().optional()
|
|
12176
|
+
}),
|
|
12177
|
+
timestamp: z.string().datetime().optional()
|
|
12178
|
+
});
|
|
12005
12179
|
var LCNNotificationDataValidator = z.object({
|
|
12006
12180
|
vcUris: z.array(z.string()).optional(),
|
|
12007
12181
|
vpUris: z.array(z.string()).optional(),
|
|
12008
|
-
transaction: ConsentFlowTransactionValidator.optional()
|
|
12182
|
+
transaction: ConsentFlowTransactionValidator.optional(),
|
|
12183
|
+
inbox: LCNNotificationInboxValidator.optional()
|
|
12009
12184
|
});
|
|
12010
12185
|
var LCNNotificationValidator = z.object({
|
|
12011
12186
|
type: LCNNotificationTypeEnumValidator,
|
|
@@ -12013,7 +12188,8 @@ var LCNNotificationValidator = z.object({
|
|
|
12013
12188
|
from: LCNProfileValidator.partial().and(z.object({ did: z.string() })),
|
|
12014
12189
|
message: LCNNotificationMessageValidator.optional(),
|
|
12015
12190
|
data: LCNNotificationDataValidator.optional(),
|
|
12016
|
-
sent: z.string().datetime().optional()
|
|
12191
|
+
sent: z.string().datetime().optional(),
|
|
12192
|
+
webhookUrl: z.string().optional()
|
|
12017
12193
|
});
|
|
12018
12194
|
var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = "auth-grant:";
|
|
12019
12195
|
var AuthGrantValidator = z.object({
|
|
@@ -12037,6 +12213,126 @@ var AuthGrantQueryValidator = z.object({
|
|
|
12037
12213
|
description: StringQuery,
|
|
12038
12214
|
status: AuthGrantStatusValidator
|
|
12039
12215
|
}).partial();
|
|
12216
|
+
var contactMethodBase = z.object({
|
|
12217
|
+
id: z.string(),
|
|
12218
|
+
isVerified: z.boolean(),
|
|
12219
|
+
verifiedAt: z.string().optional(),
|
|
12220
|
+
isPrimary: z.boolean(),
|
|
12221
|
+
createdAt: z.string()
|
|
12222
|
+
});
|
|
12223
|
+
var ContactMethodValidator = z.discriminatedUnion("type", [
|
|
12224
|
+
z.object({
|
|
12225
|
+
type: z.literal("email"),
|
|
12226
|
+
value: z.string().email()
|
|
12227
|
+
}).merge(contactMethodBase),
|
|
12228
|
+
z.object({
|
|
12229
|
+
type: z.literal("phone"),
|
|
12230
|
+
value: z.string()
|
|
12231
|
+
}).merge(contactMethodBase)
|
|
12232
|
+
]);
|
|
12233
|
+
var createContactMethodBase = z.object({
|
|
12234
|
+
isVerified: z.boolean().optional(),
|
|
12235
|
+
isPrimary: z.boolean().optional()
|
|
12236
|
+
});
|
|
12237
|
+
var ContactMethodCreateValidator = z.discriminatedUnion("type", [
|
|
12238
|
+
z.object({
|
|
12239
|
+
type: z.literal("email"),
|
|
12240
|
+
value: z.string().email()
|
|
12241
|
+
}).merge(createContactMethodBase),
|
|
12242
|
+
z.object({
|
|
12243
|
+
type: z.literal("phone"),
|
|
12244
|
+
value: z.string()
|
|
12245
|
+
}).merge(createContactMethodBase)
|
|
12246
|
+
]);
|
|
12247
|
+
var ContactMethodQueryValidator = z.discriminatedUnion("type", [
|
|
12248
|
+
z.object({
|
|
12249
|
+
type: z.literal("email"),
|
|
12250
|
+
value: z.string().email()
|
|
12251
|
+
}),
|
|
12252
|
+
z.object({
|
|
12253
|
+
type: z.literal("phone"),
|
|
12254
|
+
value: z.string()
|
|
12255
|
+
})
|
|
12256
|
+
]);
|
|
12257
|
+
var ContactMethodVerificationRequestValidator = z.object({
|
|
12258
|
+
value: z.string(),
|
|
12259
|
+
type: z.enum(["email", "phone"])
|
|
12260
|
+
});
|
|
12261
|
+
var ContactMethodVerificationValidator = z.object({
|
|
12262
|
+
token: z.string()
|
|
12263
|
+
});
|
|
12264
|
+
var SetPrimaryContactMethodValidator = z.object({
|
|
12265
|
+
contactMethodId: z.string()
|
|
12266
|
+
});
|
|
12267
|
+
var InboxCredentialValidator = z.object({
|
|
12268
|
+
id: z.string(),
|
|
12269
|
+
credential: z.string(),
|
|
12270
|
+
isSigned: z.boolean(),
|
|
12271
|
+
currentStatus: LCNInboxStatusEnumValidator,
|
|
12272
|
+
expiresAt: z.string(),
|
|
12273
|
+
createdAt: z.string(),
|
|
12274
|
+
issuerDid: z.string(),
|
|
12275
|
+
webhookUrl: z.string().optional(),
|
|
12276
|
+
"signingAuthority.endpoint": z.string().optional(),
|
|
12277
|
+
"signingAuthority.name": z.string().optional()
|
|
12278
|
+
});
|
|
12279
|
+
var PaginatedInboxCredentialsValidator = z.object({
|
|
12280
|
+
hasMore: z.boolean(),
|
|
12281
|
+
records: z.array(InboxCredentialValidator),
|
|
12282
|
+
cursor: z.string().optional()
|
|
12283
|
+
});
|
|
12284
|
+
var InboxCredentialQueryValidator = z.object({
|
|
12285
|
+
currentStatus: LCNInboxStatusEnumValidator,
|
|
12286
|
+
id: z.string(),
|
|
12287
|
+
isSigned: z.boolean(),
|
|
12288
|
+
issuerDid: z.string()
|
|
12289
|
+
}).partial();
|
|
12290
|
+
var IssueInboxSigningAuthorityValidator = z.object({
|
|
12291
|
+
endpoint: z.string().url(),
|
|
12292
|
+
name: z.string()
|
|
12293
|
+
});
|
|
12294
|
+
var IssueInboxCredentialValidator = z.object({
|
|
12295
|
+
recipient: ContactMethodQueryValidator.describe("The recipient of the credential"),
|
|
12296
|
+
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."),
|
|
12297
|
+
configuration: z.object({
|
|
12298
|
+
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."),
|
|
12299
|
+
webhookUrl: z.string().url().optional().describe("The webhook URL to receive credential issuance events."),
|
|
12300
|
+
expiresInDays: z.number().min(1).max(365).optional().describe("The number of days the credential will be valid for."),
|
|
12301
|
+
delivery: z.object({
|
|
12302
|
+
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."),
|
|
12303
|
+
template: z.object({
|
|
12304
|
+
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."),
|
|
12305
|
+
model: z.object({
|
|
12306
|
+
issuer: z.object({
|
|
12307
|
+
name: z.string().optional().describe('The name of the organization (e.g., "State University").'),
|
|
12308
|
+
logoUrl: z.string().url().optional().describe("The URL of the organization's logo.")
|
|
12309
|
+
}).optional(),
|
|
12310
|
+
credential: z.object({
|
|
12311
|
+
name: z.string().optional().describe('The name of the credential (e.g., "Bachelor of Science").'),
|
|
12312
|
+
type: z.string().optional().describe('The type of the credential (e.g., "degree", "certificate").')
|
|
12313
|
+
}).optional(),
|
|
12314
|
+
recipient: z.object({
|
|
12315
|
+
name: z.string().optional().describe('The name of the recipient (e.g., "John Doe").')
|
|
12316
|
+
}).optional()
|
|
12317
|
+
}).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.")
|
|
12318
|
+
}).optional().describe("The template to use for the credential delivery. If not provided, the default template will be used.")
|
|
12319
|
+
}).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.")
|
|
12320
|
+
}).optional().describe("Configuration for the credential issuance. If not provided, the default configuration will be used.")
|
|
12321
|
+
});
|
|
12322
|
+
var IssueInboxCredentialResponseValidator = z.object({
|
|
12323
|
+
issuanceId: z.string(),
|
|
12324
|
+
status: LCNInboxStatusEnumValidator,
|
|
12325
|
+
recipient: ContactMethodQueryValidator,
|
|
12326
|
+
claimUrl: z.string().url().optional(),
|
|
12327
|
+
recipientDid: z.string().optional()
|
|
12328
|
+
});
|
|
12329
|
+
var ClaimTokenValidator = z.object({
|
|
12330
|
+
token: z.string(),
|
|
12331
|
+
contactMethodId: z.string(),
|
|
12332
|
+
createdAt: z.string(),
|
|
12333
|
+
expiresAt: z.string(),
|
|
12334
|
+
used: z.boolean()
|
|
12335
|
+
});
|
|
12040
12336
|
|
|
12041
12337
|
// src/plugin.ts
|
|
12042
12338
|
var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) => {
|
|
@@ -12621,6 +12917,16 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
12621
12917
|
throw new Error("Please make an account first!");
|
|
12622
12918
|
return client.profile.signingAuthority.query({ endpoint, name });
|
|
12623
12919
|
},
|
|
12920
|
+
setPrimaryRegisteredSigningAuthority: async (_learnCard, endpoint, name) => {
|
|
12921
|
+
if (!userData)
|
|
12922
|
+
throw new Error("Please make an account first!");
|
|
12923
|
+
return client.profile.setPrimarySigningAuthority.mutate({ endpoint, name });
|
|
12924
|
+
},
|
|
12925
|
+
getPrimaryRegisteredSigningAuthority: async (_learnCard) => {
|
|
12926
|
+
if (!userData)
|
|
12927
|
+
throw new Error("Please make an account first!");
|
|
12928
|
+
return client.profile.primarySigningAuthority.query();
|
|
12929
|
+
},
|
|
12624
12930
|
generateClaimLink: async (_learnCard, boostUri, claimLinkSA, options, challenge) => {
|
|
12625
12931
|
if (!userData)
|
|
12626
12932
|
throw new Error("Please make an account first!");
|
|
@@ -12849,6 +13155,46 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
12849
13155
|
throw new Error("Failed to get API Token for auth grant");
|
|
12850
13156
|
return apiToken;
|
|
12851
13157
|
},
|
|
13158
|
+
sendCredentialViaInbox: async (_learnCard, issueInboxCredential) => {
|
|
13159
|
+
if (!userData)
|
|
13160
|
+
throw new Error("Please make an account first!");
|
|
13161
|
+
return client.inbox.issue.mutate(issueInboxCredential);
|
|
13162
|
+
},
|
|
13163
|
+
getMySentInboxCredentials: async (_learnCard, options) => {
|
|
13164
|
+
if (!userData)
|
|
13165
|
+
throw new Error("Please make an account first!");
|
|
13166
|
+
return client.inbox.getMyIssuedCredentials.query(options);
|
|
13167
|
+
},
|
|
13168
|
+
getInboxCredential: async (_learnCard, id) => {
|
|
13169
|
+
if (!userData)
|
|
13170
|
+
throw new Error("Please make an account first!");
|
|
13171
|
+
return client.inbox.getInboxCredential.query({ credentialId: id });
|
|
13172
|
+
},
|
|
13173
|
+
addContactMethod: async (_learnCard, contactMethod) => {
|
|
13174
|
+
if (!userData)
|
|
13175
|
+
throw new Error("Please make an account first!");
|
|
13176
|
+
return client.contactMethods.addContactMethod.mutate(contactMethod);
|
|
13177
|
+
},
|
|
13178
|
+
getMyContactMethods: async (_learnCard) => {
|
|
13179
|
+
if (!userData)
|
|
13180
|
+
throw new Error("Please make an account first!");
|
|
13181
|
+
return client.contactMethods.getMyContactMethods.query();
|
|
13182
|
+
},
|
|
13183
|
+
setPrimaryContactMethod: async (_learnCard, contactMethodId) => {
|
|
13184
|
+
if (!userData)
|
|
13185
|
+
throw new Error("Please make an account first!");
|
|
13186
|
+
return client.contactMethods.setPrimaryContactMethod.mutate({ contactMethodId });
|
|
13187
|
+
},
|
|
13188
|
+
verifyContactMethod: async (_learnCard, token) => {
|
|
13189
|
+
if (!userData)
|
|
13190
|
+
throw new Error("Please make an account first!");
|
|
13191
|
+
return client.contactMethods.verifyContactMethod.mutate({ token });
|
|
13192
|
+
},
|
|
13193
|
+
removeContactMethod: async (_learnCard, id) => {
|
|
13194
|
+
if (!userData)
|
|
13195
|
+
throw new Error("Please make an account first!");
|
|
13196
|
+
return client.contactMethods.removeContactMethod.mutate({ id });
|
|
13197
|
+
},
|
|
12852
13198
|
resolveFromLCN: async (_learnCard, uri) => {
|
|
12853
13199
|
const result = await client.storage.resolve.query({ uri });
|
|
12854
13200
|
return UnsignedVCValidator.or(VCValidator).or(VPValidator).or(JWEValidator).or(ConsentFlowContractValidator).or(ConsentFlowTermsValidator).parseAsync(result);
|