@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
|
@@ -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",
|
|
@@ -4494,41 +4552,13 @@ var CredentialInfoValidator = mod.object({
|
|
|
4494
4552
|
var CredentialRecordValidator = mod.object({ id: mod.string(), uri: mod.string() }).catchall(mod.any());
|
|
4495
4553
|
var PaginationOptionsValidator = mod.object({
|
|
4496
4554
|
limit: mod.number(),
|
|
4497
|
-
cursor: mod.string().optional()
|
|
4555
|
+
cursor: mod.string().optional(),
|
|
4556
|
+
sort: mod.string().optional()
|
|
4498
4557
|
});
|
|
4499
4558
|
var PaginationResponseValidator = mod.object({
|
|
4500
4559
|
cursor: mod.string().optional(),
|
|
4501
4560
|
hasMore: mod.boolean()
|
|
4502
4561
|
});
|
|
4503
|
-
var JWKValidator = mod.object({
|
|
4504
|
-
kty: mod.string(),
|
|
4505
|
-
crv: mod.string(),
|
|
4506
|
-
x: mod.string(),
|
|
4507
|
-
y: mod.string().optional(),
|
|
4508
|
-
n: mod.string().optional(),
|
|
4509
|
-
d: mod.string()
|
|
4510
|
-
});
|
|
4511
|
-
var JWERecipientHeaderValidator = mod.object({
|
|
4512
|
-
alg: mod.string(),
|
|
4513
|
-
iv: mod.string(),
|
|
4514
|
-
tag: mod.string(),
|
|
4515
|
-
epk: JWKValidator.partial().optional(),
|
|
4516
|
-
kid: mod.string().optional(),
|
|
4517
|
-
apv: mod.string().optional(),
|
|
4518
|
-
apu: mod.string().optional()
|
|
4519
|
-
});
|
|
4520
|
-
var JWERecipientValidator = mod.object({
|
|
4521
|
-
header: JWERecipientHeaderValidator,
|
|
4522
|
-
encrypted_key: mod.string()
|
|
4523
|
-
});
|
|
4524
|
-
var JWEValidator = mod.object({
|
|
4525
|
-
protected: mod.string(),
|
|
4526
|
-
iv: mod.string(),
|
|
4527
|
-
ciphertext: mod.string(),
|
|
4528
|
-
tag: mod.string(),
|
|
4529
|
-
aad: mod.string().optional(),
|
|
4530
|
-
recipients: JWERecipientValidator.array().optional()
|
|
4531
|
-
});
|
|
4532
4562
|
var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator, fields: mod.string().array() }).catchall(mod.any());
|
|
4533
4563
|
var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
|
|
4534
4564
|
records: EncryptedRecordValidator.array()
|
|
@@ -4542,11 +4572,15 @@ var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.e
|
|
|
4542
4572
|
var LCNProfileValidator = mod.object({
|
|
4543
4573
|
profileId: mod.string().min(3).max(40),
|
|
4544
4574
|
displayName: mod.string().default(""),
|
|
4575
|
+
shortBio: mod.string().default(""),
|
|
4545
4576
|
bio: mod.string().default(""),
|
|
4546
4577
|
did: mod.string(),
|
|
4547
4578
|
email: mod.string().optional(),
|
|
4548
4579
|
image: mod.string().optional(),
|
|
4580
|
+
heroImage: mod.string().optional(),
|
|
4581
|
+
websiteLink: mod.string().optional(),
|
|
4549
4582
|
isServiceProfile: mod.boolean().default(false).optional(),
|
|
4583
|
+
type: mod.string().optional(),
|
|
4550
4584
|
notificationsWebhook: mod.string().url().startsWith("https://").optional()
|
|
4551
4585
|
});
|
|
4552
4586
|
var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
|
|
@@ -4579,32 +4613,6 @@ var BoostRecipientValidator = mod.object({
|
|
|
4579
4613
|
from: mod.string(),
|
|
4580
4614
|
received: mod.string().optional()
|
|
4581
4615
|
});
|
|
4582
|
-
var LCNNotificationTypeEnumValidator = mod.enum([
|
|
4583
|
-
"CONNECTION_REQUEST",
|
|
4584
|
-
"CONNECTION_ACCEPTED",
|
|
4585
|
-
"CREDENTIAL_RECEIVED",
|
|
4586
|
-
"CREDENTIAL_ACCEPTED",
|
|
4587
|
-
"BOOST_RECEIVED",
|
|
4588
|
-
"BOOST_ACCEPTED",
|
|
4589
|
-
"PRESENTATION_REQUEST",
|
|
4590
|
-
"PRESENTATION_RECEIVED"
|
|
4591
|
-
]);
|
|
4592
|
-
var LCNNotificationMessageValidator = mod.object({
|
|
4593
|
-
title: mod.string().optional(),
|
|
4594
|
-
body: mod.string().optional()
|
|
4595
|
-
});
|
|
4596
|
-
var LCNNotificationDataValidator = mod.object({
|
|
4597
|
-
vcUris: mod.array(mod.string()).optional(),
|
|
4598
|
-
vpUris: mod.array(mod.string()).optional()
|
|
4599
|
-
});
|
|
4600
|
-
var LCNNotificationValidator = mod.object({
|
|
4601
|
-
type: LCNNotificationTypeEnumValidator,
|
|
4602
|
-
to: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4603
|
-
from: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
|
|
4604
|
-
message: LCNNotificationMessageValidator.optional(),
|
|
4605
|
-
data: LCNNotificationDataValidator.optional(),
|
|
4606
|
-
sent: mod.string().datetime().optional()
|
|
4607
|
-
});
|
|
4608
4616
|
var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
|
|
4609
4617
|
endpoint: mod.string(),
|
|
4610
4618
|
name: mod.string(),
|
|
@@ -4662,17 +4670,19 @@ var ConsentFlowContractDataValidator = mod.object({
|
|
|
4662
4670
|
var PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({
|
|
4663
4671
|
records: ConsentFlowContractDataValidator.array()
|
|
4664
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
|
+
});
|
|
4665
4679
|
var ConsentFlowTermsValidator = mod.object({
|
|
4666
4680
|
read: mod.object({
|
|
4667
4681
|
anonymize: mod.boolean().optional(),
|
|
4668
4682
|
credentials: mod.object({
|
|
4669
4683
|
shareAll: mod.boolean().optional(),
|
|
4670
4684
|
sharing: mod.boolean().optional(),
|
|
4671
|
-
categories: mod.record(
|
|
4672
|
-
sharing: mod.boolean().optional(),
|
|
4673
|
-
shared: mod.string().array().optional(),
|
|
4674
|
-
shareAll: mod.boolean().optional()
|
|
4675
|
-
})).default({})
|
|
4685
|
+
categories: mod.record(ConsentFlowTermValidator).default({})
|
|
4676
4686
|
}).default({}),
|
|
4677
4687
|
personal: mod.record(mod.string()).default({})
|
|
4678
4688
|
}).default({}),
|
|
@@ -4707,17 +4717,18 @@ var ConsentFlowContractQueryValidator = mod.object({
|
|
|
4707
4717
|
personal: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
|
|
4708
4718
|
}).optional()
|
|
4709
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
|
+
});
|
|
4710
4725
|
var ConsentFlowTermsQueryValidator = mod.object({
|
|
4711
4726
|
read: mod.object({
|
|
4712
4727
|
anonymize: mod.boolean().optional(),
|
|
4713
4728
|
credentials: mod.object({
|
|
4714
4729
|
shareAll: mod.boolean().optional(),
|
|
4715
4730
|
sharing: mod.boolean().optional(),
|
|
4716
|
-
categories: mod.record(
|
|
4717
|
-
sharing: mod.boolean().optional(),
|
|
4718
|
-
shared: mod.string().array().optional(),
|
|
4719
|
-
shareAll: mod.boolean().optional()
|
|
4720
|
-
}).optional()).optional()
|
|
4731
|
+
categories: mod.record(ConsentFlowTermValidator.optional()).optional()
|
|
4721
4732
|
}).optional(),
|
|
4722
4733
|
personal: mod.record(mod.string()).optional()
|
|
4723
4734
|
}).optional(),
|
|
@@ -4750,6 +4761,34 @@ var ConsentFlowTransactionValidator = mod.object({
|
|
|
4750
4761
|
var PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({
|
|
4751
4762
|
records: ConsentFlowTransactionValidator.array()
|
|
4752
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
|
+
});
|
|
4753
4792
|
|
|
4754
4793
|
// src/plugin.ts
|
|
4755
4794
|
var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) => {
|
|
@@ -4831,6 +4870,17 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
4831
4870
|
did = newDid;
|
|
4832
4871
|
return newDid;
|
|
4833
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
|
+
},
|
|
4834
4884
|
updateProfile: async (_learnCard, profile) => {
|
|
4835
4885
|
if (!userData)
|
|
4836
4886
|
throw new Error("Please make an account first!");
|
|
@@ -5148,11 +5198,16 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
5148
5198
|
throw new Error("Please make an account first!");
|
|
5149
5199
|
return client.contracts.deleteConsentFlowContract.mutate({ uri });
|
|
5150
5200
|
},
|
|
5151
|
-
getConsentFlowData: async (_learnCard, uri, options) => {
|
|
5201
|
+
getConsentFlowData: async (_learnCard, uri, options = {}) => {
|
|
5152
5202
|
if (!userData)
|
|
5153
5203
|
throw new Error("Please make an account first!");
|
|
5154
5204
|
return client.contracts.getConsentedDataForContract.query({ uri, ...options });
|
|
5155
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
|
+
},
|
|
5156
5211
|
consentToContract: async (_learnCard, contractUri, { terms, expiresAt, oneTime }) => {
|
|
5157
5212
|
if (!userData)
|
|
5158
5213
|
throw new Error("Please make an account first!");
|