@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
package/dist/lcn-plugin.esm.js
CHANGED
|
@@ -4263,6 +4263,64 @@ var UnsignedVPValidator = mod.object({
|
|
|
4263
4263
|
var VPValidator = UnsignedVPValidator.extend({
|
|
4264
4264
|
proof: ProofValidator.or(ProofValidator.array())
|
|
4265
4265
|
});
|
|
4266
|
+
var JWKValidator = mod.object({
|
|
4267
|
+
kty: mod.string(),
|
|
4268
|
+
crv: mod.string(),
|
|
4269
|
+
x: mod.string(),
|
|
4270
|
+
y: mod.string().optional(),
|
|
4271
|
+
n: mod.string().optional(),
|
|
4272
|
+
d: mod.string()
|
|
4273
|
+
});
|
|
4274
|
+
var JWERecipientHeaderValidator = mod.object({
|
|
4275
|
+
alg: mod.string(),
|
|
4276
|
+
iv: mod.string(),
|
|
4277
|
+
tag: mod.string(),
|
|
4278
|
+
epk: JWKValidator.partial().optional(),
|
|
4279
|
+
kid: mod.string().optional(),
|
|
4280
|
+
apv: mod.string().optional(),
|
|
4281
|
+
apu: mod.string().optional()
|
|
4282
|
+
});
|
|
4283
|
+
var JWERecipientValidator = mod.object({
|
|
4284
|
+
header: JWERecipientHeaderValidator,
|
|
4285
|
+
encrypted_key: mod.string()
|
|
4286
|
+
});
|
|
4287
|
+
var JWEValidator = mod.object({
|
|
4288
|
+
protected: mod.string(),
|
|
4289
|
+
iv: mod.string(),
|
|
4290
|
+
ciphertext: mod.string(),
|
|
4291
|
+
tag: mod.string(),
|
|
4292
|
+
aad: mod.string().optional(),
|
|
4293
|
+
recipients: JWERecipientValidator.array().optional()
|
|
4294
|
+
});
|
|
4295
|
+
var VerificationMethodValidator = mod.string().or(mod.object({
|
|
4296
|
+
"@context": ContextValidator.optional(),
|
|
4297
|
+
id: mod.string(),
|
|
4298
|
+
type: mod.string(),
|
|
4299
|
+
controller: mod.string(),
|
|
4300
|
+
publicKeyJwk: JWKValidator.optional(),
|
|
4301
|
+
publicKeyBase58: mod.string().optional(),
|
|
4302
|
+
blockChainAccountId: mod.string().optional()
|
|
4303
|
+
}).catchall(mod.any()));
|
|
4304
|
+
var ServiceValidator = mod.object({
|
|
4305
|
+
id: mod.string(),
|
|
4306
|
+
type: mod.string().or(mod.string().array().nonempty()),
|
|
4307
|
+
serviceEndpoint: mod.any().or(mod.any().array().nonempty())
|
|
4308
|
+
}).catchall(mod.any());
|
|
4309
|
+
var DidDocumentValidator = mod.object({
|
|
4310
|
+
"@context": ContextValidator,
|
|
4311
|
+
id: mod.string(),
|
|
4312
|
+
alsoKnownAs: mod.string().optional(),
|
|
4313
|
+
controller: mod.string().or(mod.string().array().nonempty()).optional(),
|
|
4314
|
+
verificationMethod: VerificationMethodValidator.array().optional(),
|
|
4315
|
+
authentication: VerificationMethodValidator.array().optional(),
|
|
4316
|
+
assertionMethod: VerificationMethodValidator.array().optional(),
|
|
4317
|
+
keyAgreement: VerificationMethodValidator.array().optional(),
|
|
4318
|
+
capabilityInvocation: VerificationMethodValidator.array().optional(),
|
|
4319
|
+
capabilityDelegation: VerificationMethodValidator.array().optional(),
|
|
4320
|
+
publicKey: VerificationMethodValidator.array().optional(),
|
|
4321
|
+
service: ServiceValidator.array().optional(),
|
|
4322
|
+
proof: ProofValidator.or(ProofValidator.array()).optional()
|
|
4323
|
+
}).catchall(mod.any());
|
|
4266
4324
|
var AlignmentTargetTypeValidator = mod.enum([
|
|
4267
4325
|
"ceasn:Competency",
|
|
4268
4326
|
"ceterms:Credential",
|
|
@@ -4477,35 +4535,6 @@ var PaginationResponseValidator = mod.object({
|
|
|
4477
4535
|
cursor: mod.string().optional(),
|
|
4478
4536
|
hasMore: mod.boolean()
|
|
4479
4537
|
});
|
|
4480
|
-
var JWKValidator = mod.object({
|
|
4481
|
-
kty: mod.string(),
|
|
4482
|
-
crv: mod.string(),
|
|
4483
|
-
x: mod.string(),
|
|
4484
|
-
y: mod.string().optional(),
|
|
4485
|
-
n: mod.string().optional(),
|
|
4486
|
-
d: mod.string()
|
|
4487
|
-
});
|
|
4488
|
-
var JWERecipientHeaderValidator = mod.object({
|
|
4489
|
-
alg: mod.string(),
|
|
4490
|
-
iv: mod.string(),
|
|
4491
|
-
tag: mod.string(),
|
|
4492
|
-
epk: JWKValidator.partial().optional(),
|
|
4493
|
-
kid: mod.string().optional(),
|
|
4494
|
-
apv: mod.string().optional(),
|
|
4495
|
-
apu: mod.string().optional()
|
|
4496
|
-
});
|
|
4497
|
-
var JWERecipientValidator = mod.object({
|
|
4498
|
-
header: JWERecipientHeaderValidator,
|
|
4499
|
-
encrypted_key: mod.string()
|
|
4500
|
-
});
|
|
4501
|
-
var JWEValidator = mod.object({
|
|
4502
|
-
protected: mod.string(),
|
|
4503
|
-
iv: mod.string(),
|
|
4504
|
-
ciphertext: mod.string(),
|
|
4505
|
-
tag: mod.string(),
|
|
4506
|
-
aad: mod.string().optional(),
|
|
4507
|
-
recipients: JWERecipientValidator.array().optional()
|
|
4508
|
-
});
|
|
4509
4538
|
var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator, fields: mod.string().array() }).catchall(mod.any());
|
|
4510
4539
|
var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
|
|
4511
4540
|
records: EncryptedRecordValidator.array()
|
|
@@ -4519,11 +4548,15 @@ var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.e
|
|
|
4519
4548
|
var LCNProfileValidator = mod.object({
|
|
4520
4549
|
profileId: mod.string().min(3).max(40),
|
|
4521
4550
|
displayName: mod.string().default(""),
|
|
4551
|
+
shortBio: mod.string().default(""),
|
|
4522
4552
|
bio: mod.string().default(""),
|
|
4523
4553
|
did: mod.string(),
|
|
4524
4554
|
email: mod.string().optional(),
|
|
4525
4555
|
image: mod.string().optional(),
|
|
4556
|
+
heroImage: mod.string().optional(),
|
|
4557
|
+
websiteLink: mod.string().optional(),
|
|
4526
4558
|
isServiceProfile: mod.boolean().default(false).optional(),
|
|
4559
|
+
type: mod.string().optional(),
|
|
4527
4560
|
notificationsWebhook: mod.string().url().startsWith("https://").optional()
|
|
4528
4561
|
});
|
|
4529
4562
|
var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
|
|
@@ -4556,32 +4589,6 @@ var BoostRecipientValidator = mod.object({
|
|
|
4556
4589
|
from: mod.string(),
|
|
4557
4590
|
received: mod.string().optional()
|
|
4558
4591
|
});
|
|
4559
|
-
var LCNNotificationTypeEnumValidator = mod.enum([
|
|
4560
|
-
"CONNECTION_REQUEST",
|
|
4561
|
-
"CONNECTION_ACCEPTED",
|
|
4562
|
-
"CREDENTIAL_RECEIVED",
|
|
4563
|
-
"CREDENTIAL_ACCEPTED",
|
|
4564
|
-
"BOOST_RECEIVED",
|
|
4565
|
-
"BOOST_ACCEPTED",
|
|
4566
|
-
"PRESENTATION_REQUEST",
|
|
4567
|
-
"PRESENTATION_RECEIVED"
|
|
4568
|
-
]);
|
|
4569
|
-
var LCNNotificationMessageValidator = mod.object({
|
|
4570
|
-
title: mod.string().optional(),
|
|
4571
|
-
body: mod.string().optional()
|
|
4572
|
-
});
|
|
4573
|
-
var LCNNotificationDataValidator = mod.object({
|
|
4574
|
-
vcUris: mod.array(mod.string()).optional(),
|
|
4575
|
-
vpUris: mod.array(mod.string()).optional()
|
|
4576
|
-
});
|
|
4577
|
-
var LCNNotificationValidator = mod.object({
|
|
4578
|
-
type: LCNNotificationTypeEnumValidator,
|
|
4579
|
-
to: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4580
|
-
from: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4581
|
-
message: LCNNotificationMessageValidator.optional(),
|
|
4582
|
-
data: LCNNotificationDataValidator.optional(),
|
|
4583
|
-
sent: mod.string().datetime().optional()
|
|
4584
|
-
});
|
|
4585
4592
|
var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
|
|
4586
4593
|
endpoint: mod.string(),
|
|
4587
4594
|
name: mod.string(),
|
|
@@ -4639,17 +4646,19 @@ var ConsentFlowContractDataValidator = mod.object({
|
|
|
4639
4646
|
var PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({
|
|
4640
4647
|
records: ConsentFlowContractDataValidator.array()
|
|
4641
4648
|
});
|
|
4649
|
+
var ConsentFlowTermValidator = mod.object({
|
|
4650
|
+
sharing: mod.boolean().optional(),
|
|
4651
|
+
shared: mod.string().array().optional(),
|
|
4652
|
+
shareAll: mod.boolean().optional(),
|
|
4653
|
+
shareUntil: mod.string().optional()
|
|
4654
|
+
});
|
|
4642
4655
|
var ConsentFlowTermsValidator = mod.object({
|
|
4643
4656
|
read: mod.object({
|
|
4644
4657
|
anonymize: mod.boolean().optional(),
|
|
4645
4658
|
credentials: mod.object({
|
|
4646
4659
|
shareAll: mod.boolean().optional(),
|
|
4647
4660
|
sharing: mod.boolean().optional(),
|
|
4648
|
-
categories: mod.record(
|
|
4649
|
-
sharing: mod.boolean().optional(),
|
|
4650
|
-
shared: mod.string().array().optional(),
|
|
4651
|
-
shareAll: mod.boolean().optional()
|
|
4652
|
-
})).default({})
|
|
4661
|
+
categories: mod.record(ConsentFlowTermValidator).default({})
|
|
4653
4662
|
}).default({}),
|
|
4654
4663
|
personal: mod.record(mod.string()).default({})
|
|
4655
4664
|
}).default({}),
|
|
@@ -4684,17 +4693,18 @@ var ConsentFlowContractQueryValidator = mod.object({
|
|
|
4684
4693
|
personal: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
|
|
4685
4694
|
}).optional()
|
|
4686
4695
|
});
|
|
4696
|
+
var ConsentFlowDataQueryValidator = mod.object({
|
|
4697
|
+
anonymize: mod.boolean().optional(),
|
|
4698
|
+
credentials: mod.object({ categories: mod.record(mod.boolean()).optional() }).optional(),
|
|
4699
|
+
personal: mod.record(mod.boolean()).optional()
|
|
4700
|
+
});
|
|
4687
4701
|
var ConsentFlowTermsQueryValidator = mod.object({
|
|
4688
4702
|
read: mod.object({
|
|
4689
4703
|
anonymize: mod.boolean().optional(),
|
|
4690
4704
|
credentials: mod.object({
|
|
4691
4705
|
shareAll: mod.boolean().optional(),
|
|
4692
4706
|
sharing: mod.boolean().optional(),
|
|
4693
|
-
categories: mod.record(
|
|
4694
|
-
sharing: mod.boolean().optional(),
|
|
4695
|
-
shared: mod.string().array().optional(),
|
|
4696
|
-
shareAll: mod.boolean().optional()
|
|
4697
|
-
}).optional()).optional()
|
|
4707
|
+
categories: mod.record(ConsentFlowTermValidator.optional()).optional()
|
|
4698
4708
|
}).optional(),
|
|
4699
4709
|
personal: mod.record(mod.string()).optional()
|
|
4700
4710
|
}).optional(),
|
|
@@ -4727,6 +4737,34 @@ var ConsentFlowTransactionValidator = mod.object({
|
|
|
4727
4737
|
var PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({
|
|
4728
4738
|
records: ConsentFlowTransactionValidator.array()
|
|
4729
4739
|
});
|
|
4740
|
+
var LCNNotificationTypeEnumValidator = mod.enum([
|
|
4741
|
+
"CONNECTION_REQUEST",
|
|
4742
|
+
"CONNECTION_ACCEPTED",
|
|
4743
|
+
"CREDENTIAL_RECEIVED",
|
|
4744
|
+
"CREDENTIAL_ACCEPTED",
|
|
4745
|
+
"BOOST_RECEIVED",
|
|
4746
|
+
"BOOST_ACCEPTED",
|
|
4747
|
+
"PRESENTATION_REQUEST",
|
|
4748
|
+
"PRESENTATION_RECEIVED",
|
|
4749
|
+
"CONSENT_FLOW_TRANSACTION"
|
|
4750
|
+
]);
|
|
4751
|
+
var LCNNotificationMessageValidator = mod.object({
|
|
4752
|
+
title: mod.string().optional(),
|
|
4753
|
+
body: mod.string().optional()
|
|
4754
|
+
});
|
|
4755
|
+
var LCNNotificationDataValidator = mod.object({
|
|
4756
|
+
vcUris: mod.array(mod.string()).optional(),
|
|
4757
|
+
vpUris: mod.array(mod.string()).optional(),
|
|
4758
|
+
transaction: ConsentFlowTransactionValidator.optional()
|
|
4759
|
+
});
|
|
4760
|
+
var LCNNotificationValidator = mod.object({
|
|
4761
|
+
type: LCNNotificationTypeEnumValidator,
|
|
4762
|
+
to: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4763
|
+
from: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4764
|
+
message: LCNNotificationMessageValidator.optional(),
|
|
4765
|
+
data: LCNNotificationDataValidator.optional(),
|
|
4766
|
+
sent: mod.string().datetime().optional()
|
|
4767
|
+
});
|
|
4730
4768
|
|
|
4731
4769
|
// src/plugin.ts
|
|
4732
4770
|
var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) => {
|
|
@@ -4808,6 +4846,17 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
4808
4846
|
did = newDid;
|
|
4809
4847
|
return newDid;
|
|
4810
4848
|
},
|
|
4849
|
+
createManagedServiceProfile: async (_learnCard, profile) => {
|
|
4850
|
+
if (!userData)
|
|
4851
|
+
throw new Error("Please make an account first!");
|
|
4852
|
+
const newDid = await client.profile.createManagedServiceProfile.mutate(profile);
|
|
4853
|
+
return newDid;
|
|
4854
|
+
},
|
|
4855
|
+
getManagedServiceProfiles: async (_learnCard, options = {}) => {
|
|
4856
|
+
if (!userData)
|
|
4857
|
+
throw new Error("Please make an account first!");
|
|
4858
|
+
return client.profile.getManagedServiceProfiles.query(options);
|
|
4859
|
+
},
|
|
4811
4860
|
updateProfile: async (_learnCard, profile) => {
|
|
4812
4861
|
if (!userData)
|
|
4813
4862
|
throw new Error("Please make an account first!");
|
|
@@ -5125,11 +5174,16 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5125
5174
|
throw new Error("Please make an account first!");
|
|
5126
5175
|
return client.contracts.deleteConsentFlowContract.mutate({ uri });
|
|
5127
5176
|
},
|
|
5128
|
-
getConsentFlowData: async (_learnCard, uri, options) => {
|
|
5177
|
+
getConsentFlowData: async (_learnCard, uri, options = {}) => {
|
|
5129
5178
|
if (!userData)
|
|
5130
5179
|
throw new Error("Please make an account first!");
|
|
5131
5180
|
return client.contracts.getConsentedDataForContract.query({ uri, ...options });
|
|
5132
5181
|
},
|
|
5182
|
+
getAllConsentFlowData: async (_learnCard, query = {}, options = {}) => {
|
|
5183
|
+
if (!userData)
|
|
5184
|
+
throw new Error("Please make an account first!");
|
|
5185
|
+
return client.contracts.getConsentedData.query({ query, ...options });
|
|
5186
|
+
},
|
|
5133
5187
|
consentToContract: async (_learnCard, contractUri, { terms, expiresAt, oneTime }) => {
|
|
5134
5188
|
if (!userData)
|
|
5135
5189
|
throw new Error("Please make an account first!");
|