@learncard/network-plugin 1.7.3 → 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 +122 -67
- 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 +122 -67
- 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",
|
|
@@ -4470,41 +4528,13 @@ var CredentialInfoValidator = mod.object({
|
|
|
4470
4528
|
var CredentialRecordValidator = mod.object({ id: mod.string(), uri: mod.string() }).catchall(mod.any());
|
|
4471
4529
|
var PaginationOptionsValidator = mod.object({
|
|
4472
4530
|
limit: mod.number(),
|
|
4473
|
-
cursor: mod.string().optional()
|
|
4531
|
+
cursor: mod.string().optional(),
|
|
4532
|
+
sort: mod.string().optional()
|
|
4474
4533
|
});
|
|
4475
4534
|
var PaginationResponseValidator = mod.object({
|
|
4476
4535
|
cursor: mod.string().optional(),
|
|
4477
4536
|
hasMore: mod.boolean()
|
|
4478
4537
|
});
|
|
4479
|
-
var JWKValidator = mod.object({
|
|
4480
|
-
kty: mod.string(),
|
|
4481
|
-
crv: mod.string(),
|
|
4482
|
-
x: mod.string(),
|
|
4483
|
-
y: mod.string().optional(),
|
|
4484
|
-
n: mod.string().optional(),
|
|
4485
|
-
d: mod.string()
|
|
4486
|
-
});
|
|
4487
|
-
var JWERecipientHeaderValidator = mod.object({
|
|
4488
|
-
alg: mod.string(),
|
|
4489
|
-
iv: mod.string(),
|
|
4490
|
-
tag: mod.string(),
|
|
4491
|
-
epk: JWKValidator.partial().optional(),
|
|
4492
|
-
kid: mod.string().optional(),
|
|
4493
|
-
apv: mod.string().optional(),
|
|
4494
|
-
apu: mod.string().optional()
|
|
4495
|
-
});
|
|
4496
|
-
var JWERecipientValidator = mod.object({
|
|
4497
|
-
header: JWERecipientHeaderValidator,
|
|
4498
|
-
encrypted_key: mod.string()
|
|
4499
|
-
});
|
|
4500
|
-
var JWEValidator = mod.object({
|
|
4501
|
-
protected: mod.string(),
|
|
4502
|
-
iv: mod.string(),
|
|
4503
|
-
ciphertext: mod.string(),
|
|
4504
|
-
tag: mod.string(),
|
|
4505
|
-
aad: mod.string().optional(),
|
|
4506
|
-
recipients: JWERecipientValidator.array().optional()
|
|
4507
|
-
});
|
|
4508
4538
|
var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator, fields: mod.string().array() }).catchall(mod.any());
|
|
4509
4539
|
var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
|
|
4510
4540
|
records: EncryptedRecordValidator.array()
|
|
@@ -4518,11 +4548,15 @@ var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.e
|
|
|
4518
4548
|
var LCNProfileValidator = mod.object({
|
|
4519
4549
|
profileId: mod.string().min(3).max(40),
|
|
4520
4550
|
displayName: mod.string().default(""),
|
|
4551
|
+
shortBio: mod.string().default(""),
|
|
4521
4552
|
bio: mod.string().default(""),
|
|
4522
4553
|
did: mod.string(),
|
|
4523
4554
|
email: mod.string().optional(),
|
|
4524
4555
|
image: mod.string().optional(),
|
|
4556
|
+
heroImage: mod.string().optional(),
|
|
4557
|
+
websiteLink: mod.string().optional(),
|
|
4525
4558
|
isServiceProfile: mod.boolean().default(false).optional(),
|
|
4559
|
+
type: mod.string().optional(),
|
|
4526
4560
|
notificationsWebhook: mod.string().url().startsWith("https://").optional()
|
|
4527
4561
|
});
|
|
4528
4562
|
var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
|
|
@@ -4555,32 +4589,6 @@ var BoostRecipientValidator = mod.object({
|
|
|
4555
4589
|
from: mod.string(),
|
|
4556
4590
|
received: mod.string().optional()
|
|
4557
4591
|
});
|
|
4558
|
-
var LCNNotificationTypeEnumValidator = mod.enum([
|
|
4559
|
-
"CONNECTION_REQUEST",
|
|
4560
|
-
"CONNECTION_ACCEPTED",
|
|
4561
|
-
"CREDENTIAL_RECEIVED",
|
|
4562
|
-
"CREDENTIAL_ACCEPTED",
|
|
4563
|
-
"BOOST_RECEIVED",
|
|
4564
|
-
"BOOST_ACCEPTED",
|
|
4565
|
-
"PRESENTATION_REQUEST",
|
|
4566
|
-
"PRESENTATION_RECEIVED"
|
|
4567
|
-
]);
|
|
4568
|
-
var LCNNotificationMessageValidator = mod.object({
|
|
4569
|
-
title: mod.string().optional(),
|
|
4570
|
-
body: mod.string().optional()
|
|
4571
|
-
});
|
|
4572
|
-
var LCNNotificationDataValidator = mod.object({
|
|
4573
|
-
vcUris: mod.array(mod.string()).optional(),
|
|
4574
|
-
vpUris: mod.array(mod.string()).optional()
|
|
4575
|
-
});
|
|
4576
|
-
var LCNNotificationValidator = mod.object({
|
|
4577
|
-
type: LCNNotificationTypeEnumValidator,
|
|
4578
|
-
to: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4579
|
-
from: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4580
|
-
message: LCNNotificationMessageValidator.optional(),
|
|
4581
|
-
data: LCNNotificationDataValidator.optional(),
|
|
4582
|
-
sent: mod.string().datetime().optional()
|
|
4583
|
-
});
|
|
4584
4592
|
var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
|
|
4585
4593
|
endpoint: mod.string(),
|
|
4586
4594
|
name: mod.string(),
|
|
@@ -4638,17 +4646,19 @@ var ConsentFlowContractDataValidator = mod.object({
|
|
|
4638
4646
|
var PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({
|
|
4639
4647
|
records: ConsentFlowContractDataValidator.array()
|
|
4640
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
|
+
});
|
|
4641
4655
|
var ConsentFlowTermsValidator = mod.object({
|
|
4642
4656
|
read: mod.object({
|
|
4643
4657
|
anonymize: mod.boolean().optional(),
|
|
4644
4658
|
credentials: mod.object({
|
|
4645
4659
|
shareAll: mod.boolean().optional(),
|
|
4646
4660
|
sharing: mod.boolean().optional(),
|
|
4647
|
-
categories: mod.record(
|
|
4648
|
-
sharing: mod.boolean().optional(),
|
|
4649
|
-
shared: mod.string().array().optional(),
|
|
4650
|
-
shareAll: mod.boolean().optional()
|
|
4651
|
-
})).default({})
|
|
4661
|
+
categories: mod.record(ConsentFlowTermValidator).default({})
|
|
4652
4662
|
}).default({}),
|
|
4653
4663
|
personal: mod.record(mod.string()).default({})
|
|
4654
4664
|
}).default({}),
|
|
@@ -4683,17 +4693,18 @@ var ConsentFlowContractQueryValidator = mod.object({
|
|
|
4683
4693
|
personal: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
|
|
4684
4694
|
}).optional()
|
|
4685
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
|
+
});
|
|
4686
4701
|
var ConsentFlowTermsQueryValidator = mod.object({
|
|
4687
4702
|
read: mod.object({
|
|
4688
4703
|
anonymize: mod.boolean().optional(),
|
|
4689
4704
|
credentials: mod.object({
|
|
4690
4705
|
shareAll: mod.boolean().optional(),
|
|
4691
4706
|
sharing: mod.boolean().optional(),
|
|
4692
|
-
categories: mod.record(
|
|
4693
|
-
sharing: mod.boolean().optional(),
|
|
4694
|
-
shared: mod.string().array().optional(),
|
|
4695
|
-
shareAll: mod.boolean().optional()
|
|
4696
|
-
}).optional()).optional()
|
|
4707
|
+
categories: mod.record(ConsentFlowTermValidator.optional()).optional()
|
|
4697
4708
|
}).optional(),
|
|
4698
4709
|
personal: mod.record(mod.string()).optional()
|
|
4699
4710
|
}).optional(),
|
|
@@ -4726,6 +4737,34 @@ var ConsentFlowTransactionValidator = mod.object({
|
|
|
4726
4737
|
var PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({
|
|
4727
4738
|
records: ConsentFlowTransactionValidator.array()
|
|
4728
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
|
+
});
|
|
4729
4768
|
|
|
4730
4769
|
// src/plugin.ts
|
|
4731
4770
|
var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) => {
|
|
@@ -4807,6 +4846,17 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
4807
4846
|
did = newDid;
|
|
4808
4847
|
return newDid;
|
|
4809
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
|
+
},
|
|
4810
4860
|
updateProfile: async (_learnCard, profile) => {
|
|
4811
4861
|
if (!userData)
|
|
4812
4862
|
throw new Error("Please make an account first!");
|
|
@@ -5124,11 +5174,16 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5124
5174
|
throw new Error("Please make an account first!");
|
|
5125
5175
|
return client.contracts.deleteConsentFlowContract.mutate({ uri });
|
|
5126
5176
|
},
|
|
5127
|
-
getConsentFlowData: async (_learnCard, uri, options) => {
|
|
5177
|
+
getConsentFlowData: async (_learnCard, uri, options = {}) => {
|
|
5128
5178
|
if (!userData)
|
|
5129
5179
|
throw new Error("Please make an account first!");
|
|
5130
5180
|
return client.contracts.getConsentedDataForContract.query({ uri, ...options });
|
|
5131
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
|
+
},
|
|
5132
5187
|
consentToContract: async (_learnCard, contractUri, { terms, expiresAt, oneTime }) => {
|
|
5133
5188
|
if (!userData)
|
|
5134
5189
|
throw new Error("Please make an account first!");
|