@learncard/network-plugin 1.7.4 → 1.7.5
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 +120 -66
- package/dist/lcn-plugin.cjs.development.js.map +2 -2
- package/dist/lcn-plugin.cjs.production.min.js +1 -1
- package/dist/lcn-plugin.cjs.production.min.js.map +2 -2
- package/dist/lcn-plugin.esm.js +120 -66
- package/dist/lcn-plugin.esm.js.map +2 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/types.d.ts +9 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -4287,6 +4287,64 @@ var UnsignedVPValidator = mod.object({
|
|
|
4287
4287
|
var VPValidator = UnsignedVPValidator.extend({
|
|
4288
4288
|
proof: ProofValidator.or(ProofValidator.array())
|
|
4289
4289
|
});
|
|
4290
|
+
var JWKValidator = mod.object({
|
|
4291
|
+
kty: mod.string(),
|
|
4292
|
+
crv: mod.string(),
|
|
4293
|
+
x: mod.string(),
|
|
4294
|
+
y: mod.string().optional(),
|
|
4295
|
+
n: mod.string().optional(),
|
|
4296
|
+
d: mod.string()
|
|
4297
|
+
});
|
|
4298
|
+
var JWERecipientHeaderValidator = mod.object({
|
|
4299
|
+
alg: mod.string(),
|
|
4300
|
+
iv: mod.string(),
|
|
4301
|
+
tag: mod.string(),
|
|
4302
|
+
epk: JWKValidator.partial().optional(),
|
|
4303
|
+
kid: mod.string().optional(),
|
|
4304
|
+
apv: mod.string().optional(),
|
|
4305
|
+
apu: mod.string().optional()
|
|
4306
|
+
});
|
|
4307
|
+
var JWERecipientValidator = mod.object({
|
|
4308
|
+
header: JWERecipientHeaderValidator,
|
|
4309
|
+
encrypted_key: mod.string()
|
|
4310
|
+
});
|
|
4311
|
+
var JWEValidator = mod.object({
|
|
4312
|
+
protected: mod.string(),
|
|
4313
|
+
iv: mod.string(),
|
|
4314
|
+
ciphertext: mod.string(),
|
|
4315
|
+
tag: mod.string(),
|
|
4316
|
+
aad: mod.string().optional(),
|
|
4317
|
+
recipients: JWERecipientValidator.array().optional()
|
|
4318
|
+
});
|
|
4319
|
+
var VerificationMethodValidator = mod.string().or(mod.object({
|
|
4320
|
+
"@context": ContextValidator.optional(),
|
|
4321
|
+
id: mod.string(),
|
|
4322
|
+
type: mod.string(),
|
|
4323
|
+
controller: mod.string(),
|
|
4324
|
+
publicKeyJwk: JWKValidator.optional(),
|
|
4325
|
+
publicKeyBase58: mod.string().optional(),
|
|
4326
|
+
blockChainAccountId: mod.string().optional()
|
|
4327
|
+
}).catchall(mod.any()));
|
|
4328
|
+
var ServiceValidator = mod.object({
|
|
4329
|
+
id: mod.string(),
|
|
4330
|
+
type: mod.string().or(mod.string().array().nonempty()),
|
|
4331
|
+
serviceEndpoint: mod.any().or(mod.any().array().nonempty())
|
|
4332
|
+
}).catchall(mod.any());
|
|
4333
|
+
var DidDocumentValidator = mod.object({
|
|
4334
|
+
"@context": ContextValidator,
|
|
4335
|
+
id: mod.string(),
|
|
4336
|
+
alsoKnownAs: mod.string().optional(),
|
|
4337
|
+
controller: mod.string().or(mod.string().array().nonempty()).optional(),
|
|
4338
|
+
verificationMethod: VerificationMethodValidator.array().optional(),
|
|
4339
|
+
authentication: VerificationMethodValidator.array().optional(),
|
|
4340
|
+
assertionMethod: VerificationMethodValidator.array().optional(),
|
|
4341
|
+
keyAgreement: VerificationMethodValidator.array().optional(),
|
|
4342
|
+
capabilityInvocation: VerificationMethodValidator.array().optional(),
|
|
4343
|
+
capabilityDelegation: VerificationMethodValidator.array().optional(),
|
|
4344
|
+
publicKey: VerificationMethodValidator.array().optional(),
|
|
4345
|
+
service: ServiceValidator.array().optional(),
|
|
4346
|
+
proof: ProofValidator.or(ProofValidator.array()).optional()
|
|
4347
|
+
}).catchall(mod.any());
|
|
4290
4348
|
var AlignmentTargetTypeValidator = mod.enum([
|
|
4291
4349
|
"ceasn:Competency",
|
|
4292
4350
|
"ceterms:Credential",
|
|
@@ -4501,35 +4559,6 @@ var PaginationResponseValidator = mod.object({
|
|
|
4501
4559
|
cursor: mod.string().optional(),
|
|
4502
4560
|
hasMore: mod.boolean()
|
|
4503
4561
|
});
|
|
4504
|
-
var JWKValidator = mod.object({
|
|
4505
|
-
kty: mod.string(),
|
|
4506
|
-
crv: mod.string(),
|
|
4507
|
-
x: mod.string(),
|
|
4508
|
-
y: mod.string().optional(),
|
|
4509
|
-
n: mod.string().optional(),
|
|
4510
|
-
d: mod.string()
|
|
4511
|
-
});
|
|
4512
|
-
var JWERecipientHeaderValidator = mod.object({
|
|
4513
|
-
alg: mod.string(),
|
|
4514
|
-
iv: mod.string(),
|
|
4515
|
-
tag: mod.string(),
|
|
4516
|
-
epk: JWKValidator.partial().optional(),
|
|
4517
|
-
kid: mod.string().optional(),
|
|
4518
|
-
apv: mod.string().optional(),
|
|
4519
|
-
apu: mod.string().optional()
|
|
4520
|
-
});
|
|
4521
|
-
var JWERecipientValidator = mod.object({
|
|
4522
|
-
header: JWERecipientHeaderValidator,
|
|
4523
|
-
encrypted_key: mod.string()
|
|
4524
|
-
});
|
|
4525
|
-
var JWEValidator = mod.object({
|
|
4526
|
-
protected: mod.string(),
|
|
4527
|
-
iv: mod.string(),
|
|
4528
|
-
ciphertext: mod.string(),
|
|
4529
|
-
tag: mod.string(),
|
|
4530
|
-
aad: mod.string().optional(),
|
|
4531
|
-
recipients: JWERecipientValidator.array().optional()
|
|
4532
|
-
});
|
|
4533
4562
|
var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator, fields: mod.string().array() }).catchall(mod.any());
|
|
4534
4563
|
var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
|
|
4535
4564
|
records: EncryptedRecordValidator.array()
|
|
@@ -4543,11 +4572,15 @@ var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.e
|
|
|
4543
4572
|
var LCNProfileValidator = mod.object({
|
|
4544
4573
|
profileId: mod.string().min(3).max(40),
|
|
4545
4574
|
displayName: mod.string().default(""),
|
|
4575
|
+
shortBio: mod.string().default(""),
|
|
4546
4576
|
bio: mod.string().default(""),
|
|
4547
4577
|
did: mod.string(),
|
|
4548
4578
|
email: mod.string().optional(),
|
|
4549
4579
|
image: mod.string().optional(),
|
|
4580
|
+
heroImage: mod.string().optional(),
|
|
4581
|
+
websiteLink: mod.string().optional(),
|
|
4550
4582
|
isServiceProfile: mod.boolean().default(false).optional(),
|
|
4583
|
+
type: mod.string().optional(),
|
|
4551
4584
|
notificationsWebhook: mod.string().url().startsWith("https://").optional()
|
|
4552
4585
|
});
|
|
4553
4586
|
var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
|
|
@@ -4580,32 +4613,6 @@ var BoostRecipientValidator = mod.object({
|
|
|
4580
4613
|
from: mod.string(),
|
|
4581
4614
|
received: mod.string().optional()
|
|
4582
4615
|
});
|
|
4583
|
-
var LCNNotificationTypeEnumValidator = mod.enum([
|
|
4584
|
-
"CONNECTION_REQUEST",
|
|
4585
|
-
"CONNECTION_ACCEPTED",
|
|
4586
|
-
"CREDENTIAL_RECEIVED",
|
|
4587
|
-
"CREDENTIAL_ACCEPTED",
|
|
4588
|
-
"BOOST_RECEIVED",
|
|
4589
|
-
"BOOST_ACCEPTED",
|
|
4590
|
-
"PRESENTATION_REQUEST",
|
|
4591
|
-
"PRESENTATION_RECEIVED"
|
|
4592
|
-
]);
|
|
4593
|
-
var LCNNotificationMessageValidator = mod.object({
|
|
4594
|
-
title: mod.string().optional(),
|
|
4595
|
-
body: mod.string().optional()
|
|
4596
|
-
});
|
|
4597
|
-
var LCNNotificationDataValidator = mod.object({
|
|
4598
|
-
vcUris: mod.array(mod.string()).optional(),
|
|
4599
|
-
vpUris: mod.array(mod.string()).optional()
|
|
4600
|
-
});
|
|
4601
|
-
var LCNNotificationValidator = mod.object({
|
|
4602
|
-
type: LCNNotificationTypeEnumValidator,
|
|
4603
|
-
to: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4604
|
-
from: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4605
|
-
message: LCNNotificationMessageValidator.optional(),
|
|
4606
|
-
data: LCNNotificationDataValidator.optional(),
|
|
4607
|
-
sent: mod.string().datetime().optional()
|
|
4608
|
-
});
|
|
4609
4616
|
var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
|
|
4610
4617
|
endpoint: mod.string(),
|
|
4611
4618
|
name: mod.string(),
|
|
@@ -4663,17 +4670,19 @@ var ConsentFlowContractDataValidator = mod.object({
|
|
|
4663
4670
|
var PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({
|
|
4664
4671
|
records: ConsentFlowContractDataValidator.array()
|
|
4665
4672
|
});
|
|
4673
|
+
var ConsentFlowTermValidator = mod.object({
|
|
4674
|
+
sharing: mod.boolean().optional(),
|
|
4675
|
+
shared: mod.string().array().optional(),
|
|
4676
|
+
shareAll: mod.boolean().optional(),
|
|
4677
|
+
shareUntil: mod.string().optional()
|
|
4678
|
+
});
|
|
4666
4679
|
var ConsentFlowTermsValidator = mod.object({
|
|
4667
4680
|
read: mod.object({
|
|
4668
4681
|
anonymize: mod.boolean().optional(),
|
|
4669
4682
|
credentials: mod.object({
|
|
4670
4683
|
shareAll: mod.boolean().optional(),
|
|
4671
4684
|
sharing: mod.boolean().optional(),
|
|
4672
|
-
categories: mod.record(
|
|
4673
|
-
sharing: mod.boolean().optional(),
|
|
4674
|
-
shared: mod.string().array().optional(),
|
|
4675
|
-
shareAll: mod.boolean().optional()
|
|
4676
|
-
})).default({})
|
|
4685
|
+
categories: mod.record(ConsentFlowTermValidator).default({})
|
|
4677
4686
|
}).default({}),
|
|
4678
4687
|
personal: mod.record(mod.string()).default({})
|
|
4679
4688
|
}).default({}),
|
|
@@ -4708,17 +4717,18 @@ var ConsentFlowContractQueryValidator = mod.object({
|
|
|
4708
4717
|
personal: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
|
|
4709
4718
|
}).optional()
|
|
4710
4719
|
});
|
|
4720
|
+
var ConsentFlowDataQueryValidator = mod.object({
|
|
4721
|
+
anonymize: mod.boolean().optional(),
|
|
4722
|
+
credentials: mod.object({ categories: mod.record(mod.boolean()).optional() }).optional(),
|
|
4723
|
+
personal: mod.record(mod.boolean()).optional()
|
|
4724
|
+
});
|
|
4711
4725
|
var ConsentFlowTermsQueryValidator = mod.object({
|
|
4712
4726
|
read: mod.object({
|
|
4713
4727
|
anonymize: mod.boolean().optional(),
|
|
4714
4728
|
credentials: mod.object({
|
|
4715
4729
|
shareAll: mod.boolean().optional(),
|
|
4716
4730
|
sharing: mod.boolean().optional(),
|
|
4717
|
-
categories: mod.record(
|
|
4718
|
-
sharing: mod.boolean().optional(),
|
|
4719
|
-
shared: mod.string().array().optional(),
|
|
4720
|
-
shareAll: mod.boolean().optional()
|
|
4721
|
-
}).optional()).optional()
|
|
4731
|
+
categories: mod.record(ConsentFlowTermValidator.optional()).optional()
|
|
4722
4732
|
}).optional(),
|
|
4723
4733
|
personal: mod.record(mod.string()).optional()
|
|
4724
4734
|
}).optional(),
|
|
@@ -4751,6 +4761,34 @@ var ConsentFlowTransactionValidator = mod.object({
|
|
|
4751
4761
|
var PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({
|
|
4752
4762
|
records: ConsentFlowTransactionValidator.array()
|
|
4753
4763
|
});
|
|
4764
|
+
var LCNNotificationTypeEnumValidator = mod.enum([
|
|
4765
|
+
"CONNECTION_REQUEST",
|
|
4766
|
+
"CONNECTION_ACCEPTED",
|
|
4767
|
+
"CREDENTIAL_RECEIVED",
|
|
4768
|
+
"CREDENTIAL_ACCEPTED",
|
|
4769
|
+
"BOOST_RECEIVED",
|
|
4770
|
+
"BOOST_ACCEPTED",
|
|
4771
|
+
"PRESENTATION_REQUEST",
|
|
4772
|
+
"PRESENTATION_RECEIVED",
|
|
4773
|
+
"CONSENT_FLOW_TRANSACTION"
|
|
4774
|
+
]);
|
|
4775
|
+
var LCNNotificationMessageValidator = mod.object({
|
|
4776
|
+
title: mod.string().optional(),
|
|
4777
|
+
body: mod.string().optional()
|
|
4778
|
+
});
|
|
4779
|
+
var LCNNotificationDataValidator = mod.object({
|
|
4780
|
+
vcUris: mod.array(mod.string()).optional(),
|
|
4781
|
+
vpUris: mod.array(mod.string()).optional(),
|
|
4782
|
+
transaction: ConsentFlowTransactionValidator.optional()
|
|
4783
|
+
});
|
|
4784
|
+
var LCNNotificationValidator = mod.object({
|
|
4785
|
+
type: LCNNotificationTypeEnumValidator,
|
|
4786
|
+
to: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4787
|
+
from: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4788
|
+
message: LCNNotificationMessageValidator.optional(),
|
|
4789
|
+
data: LCNNotificationDataValidator.optional(),
|
|
4790
|
+
sent: mod.string().datetime().optional()
|
|
4791
|
+
});
|
|
4754
4792
|
|
|
4755
4793
|
// src/plugin.ts
|
|
4756
4794
|
var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) => {
|
|
@@ -4832,6 +4870,17 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
4832
4870
|
did = newDid;
|
|
4833
4871
|
return newDid;
|
|
4834
4872
|
},
|
|
4873
|
+
createManagedServiceProfile: async (_learnCard, profile) => {
|
|
4874
|
+
if (!userData)
|
|
4875
|
+
throw new Error("Please make an account first!");
|
|
4876
|
+
const newDid = await client.profile.createManagedServiceProfile.mutate(profile);
|
|
4877
|
+
return newDid;
|
|
4878
|
+
},
|
|
4879
|
+
getManagedServiceProfiles: async (_learnCard, options = {}) => {
|
|
4880
|
+
if (!userData)
|
|
4881
|
+
throw new Error("Please make an account first!");
|
|
4882
|
+
return client.profile.getManagedServiceProfiles.query(options);
|
|
4883
|
+
},
|
|
4835
4884
|
updateProfile: async (_learnCard, profile) => {
|
|
4836
4885
|
if (!userData)
|
|
4837
4886
|
throw new Error("Please make an account first!");
|
|
@@ -5149,11 +5198,16 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5149
5198
|
throw new Error("Please make an account first!");
|
|
5150
5199
|
return client.contracts.deleteConsentFlowContract.mutate({ uri });
|
|
5151
5200
|
},
|
|
5152
|
-
getConsentFlowData: async (_learnCard, uri, options) => {
|
|
5201
|
+
getConsentFlowData: async (_learnCard, uri, options = {}) => {
|
|
5153
5202
|
if (!userData)
|
|
5154
5203
|
throw new Error("Please make an account first!");
|
|
5155
5204
|
return client.contracts.getConsentedDataForContract.query({ uri, ...options });
|
|
5156
5205
|
},
|
|
5206
|
+
getAllConsentFlowData: async (_learnCard, query = {}, options = {}) => {
|
|
5207
|
+
if (!userData)
|
|
5208
|
+
throw new Error("Please make an account first!");
|
|
5209
|
+
return client.contracts.getConsentedData.query({ query, ...options });
|
|
5210
|
+
},
|
|
5157
5211
|
consentToContract: async (_learnCard, contractUri, { terms, expiresAt, oneTime }) => {
|
|
5158
5212
|
if (!userData)
|
|
5159
5213
|
throw new Error("Please make an account first!");
|