@learncard/network-plugin 2.5.21 → 2.5.23
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 +28 -12
- package/dist/lcn-plugin.cjs.development.js.map +2 -2
- 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 +28 -12
- 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
|
@@ -2023,7 +2023,7 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
2023
2023
|
var __toCommonJS2 = /* @__PURE__ */ __name22((mod) => __copyProps222(__defProp222({}, "__esModule", { value: true }), mod), "__toCommonJS");
|
|
2024
2024
|
var src_exports2 = {};
|
|
2025
2025
|
__export2(src_exports2, {
|
|
2026
|
-
AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX: () =>
|
|
2026
|
+
AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX: () => AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX2,
|
|
2027
2027
|
AchievementCredentialValidator: () => AchievementCredentialValidator2,
|
|
2028
2028
|
AchievementCriteriaValidator: () => AchievementCriteriaValidator2,
|
|
2029
2029
|
AchievementSubjectValidator: () => AchievementSubjectValidator2,
|
|
@@ -6378,6 +6378,7 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
6378
6378
|
controller: z2.string(),
|
|
6379
6379
|
publicKeyJwk: JWKValidator2.optional(),
|
|
6380
6380
|
publicKeyBase58: z2.string().optional(),
|
|
6381
|
+
publicKeyMultibase: z2.string().optional(),
|
|
6381
6382
|
blockChainAccountId: z2.string().optional()
|
|
6382
6383
|
}).catchall(z2.any())
|
|
6383
6384
|
);
|
|
@@ -6686,7 +6687,8 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
6686
6687
|
display: LCNProfileDisplayValidator2.optional().describe("Display settings for the profile."),
|
|
6687
6688
|
highlightedCredentials: z2.array(z2.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),
|
|
6688
6689
|
role: z2.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),
|
|
6689
|
-
dob: z2.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')
|
|
6690
|
+
dob: z2.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),
|
|
6691
|
+
country: z2.string().optional().describe("Country for the profile.")
|
|
6690
6692
|
});
|
|
6691
6693
|
var LCNProfileQueryValidator2 = z2.object({
|
|
6692
6694
|
profileId: StringQuery2,
|
|
@@ -7080,12 +7082,12 @@ var require_helpers_cjs_development = __commonJS({
|
|
|
7080
7082
|
sent: z2.string().datetime().optional(),
|
|
7081
7083
|
webhookUrl: z2.string().optional()
|
|
7082
7084
|
});
|
|
7083
|
-
var
|
|
7085
|
+
var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX2 = "auth-grant:";
|
|
7084
7086
|
var AuthGrantValidator2 = z2.object({
|
|
7085
7087
|
id: z2.string(),
|
|
7086
7088
|
name: z2.string(),
|
|
7087
7089
|
description: z2.string().optional(),
|
|
7088
|
-
challenge: z2.string().startsWith(
|
|
7090
|
+
challenge: z2.string().startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX2).min(10, { message: "Challenge is too short" }).max(100, { message: "Challenge is too long" }),
|
|
7089
7091
|
status: z2.enum(["revoked", "active"], {
|
|
7090
7092
|
required_error: "Status is required",
|
|
7091
7093
|
invalid_type_error: "Status must be either active or revoked"
|
|
@@ -11533,6 +11535,7 @@ var VerificationMethodValidator = z.string().or(
|
|
|
11533
11535
|
controller: z.string(),
|
|
11534
11536
|
publicKeyJwk: JWKValidator.optional(),
|
|
11535
11537
|
publicKeyBase58: z.string().optional(),
|
|
11538
|
+
publicKeyMultibase: z.string().optional(),
|
|
11536
11539
|
blockChainAccountId: z.string().optional()
|
|
11537
11540
|
}).catchall(z.any())
|
|
11538
11541
|
);
|
|
@@ -11841,7 +11844,8 @@ var LCNProfileValidator = z.object({
|
|
|
11841
11844
|
display: LCNProfileDisplayValidator.optional().describe("Display settings for the profile."),
|
|
11842
11845
|
highlightedCredentials: z.array(z.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),
|
|
11843
11846
|
role: z.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),
|
|
11844
|
-
dob: z.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')
|
|
11847
|
+
dob: z.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),
|
|
11848
|
+
country: z.string().optional().describe("Country for the profile.")
|
|
11845
11849
|
});
|
|
11846
11850
|
var LCNProfileQueryValidator = z.object({
|
|
11847
11851
|
profileId: StringQuery,
|
|
@@ -12427,7 +12431,7 @@ var require_types_cjs_development = __commonJS2({
|
|
|
12427
12431
|
var __toCommonJS = /* @__PURE__ */ __name4((mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod), "__toCommonJS");
|
|
12428
12432
|
var src_exports = {};
|
|
12429
12433
|
__export(src_exports, {
|
|
12430
|
-
AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX: () =>
|
|
12434
|
+
AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX: () => AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX2,
|
|
12431
12435
|
AchievementCredentialValidator: () => AchievementCredentialValidator2,
|
|
12432
12436
|
AchievementCriteriaValidator: () => AchievementCriteriaValidator2,
|
|
12433
12437
|
AchievementSubjectValidator: () => AchievementSubjectValidator2,
|
|
@@ -16759,6 +16763,7 @@ var require_types_cjs_development = __commonJS2({
|
|
|
16759
16763
|
controller: z2.string(),
|
|
16760
16764
|
publicKeyJwk: JWKValidator2.optional(),
|
|
16761
16765
|
publicKeyBase58: z2.string().optional(),
|
|
16766
|
+
publicKeyMultibase: z2.string().optional(),
|
|
16762
16767
|
blockChainAccountId: z2.string().optional()
|
|
16763
16768
|
}).catchall(z2.any())
|
|
16764
16769
|
);
|
|
@@ -17067,7 +17072,8 @@ var require_types_cjs_development = __commonJS2({
|
|
|
17067
17072
|
display: LCNProfileDisplayValidator2.optional().describe("Display settings for the profile."),
|
|
17068
17073
|
highlightedCredentials: z2.array(z2.string()).max(5).optional().describe("Up to 5 unique boost URIs to highlight on the profile."),
|
|
17069
17074
|
role: z2.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),
|
|
17070
|
-
dob: z2.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')
|
|
17075
|
+
dob: z2.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),
|
|
17076
|
+
country: z2.string().optional().describe("Country for the profile.")
|
|
17071
17077
|
});
|
|
17072
17078
|
var LCNProfileQueryValidator2 = z2.object({
|
|
17073
17079
|
profileId: StringQuery2,
|
|
@@ -17461,12 +17467,12 @@ var require_types_cjs_development = __commonJS2({
|
|
|
17461
17467
|
sent: z2.string().datetime().optional(),
|
|
17462
17468
|
webhookUrl: z2.string().optional()
|
|
17463
17469
|
});
|
|
17464
|
-
var
|
|
17470
|
+
var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX2 = "auth-grant:";
|
|
17465
17471
|
var AuthGrantValidator2 = z2.object({
|
|
17466
17472
|
id: z2.string(),
|
|
17467
17473
|
name: z2.string(),
|
|
17468
17474
|
description: z2.string().optional(),
|
|
17469
|
-
challenge: z2.string().startsWith(
|
|
17475
|
+
challenge: z2.string().startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX2).min(10, { message: "Challenge is too short" }).max(100, { message: "Challenge is too long" }),
|
|
17470
17476
|
status: z2.enum(["revoked", "active"], {
|
|
17471
17477
|
required_error: "Status is required",
|
|
17472
17478
|
invalid_type_error: "Status must be either active or revoked"
|
|
@@ -17860,10 +17866,20 @@ var getLearnCardNetworkPlugin = /* @__PURE__ */ __name(async (learnCard, url) =>
|
|
|
17860
17866
|
throw new Error("Please make an account first!");
|
|
17861
17867
|
return client.profile.paginatedConnectionRequests.query(options);
|
|
17862
17868
|
},
|
|
17863
|
-
generateInvite: async (_learnCard, challenge, expiration) => {
|
|
17869
|
+
generateInvite: async (_learnCard, challenge, expiration, maxUses) => {
|
|
17864
17870
|
if (!userData)
|
|
17865
17871
|
throw new Error("Please make an account first!");
|
|
17866
|
-
return client.profile.generateInvite.mutate({ challenge, expiration });
|
|
17872
|
+
return client.profile.generateInvite.mutate({ challenge, expiration, maxUses });
|
|
17873
|
+
},
|
|
17874
|
+
listInvites: async () => {
|
|
17875
|
+
if (!userData)
|
|
17876
|
+
throw new Error("Please make an account first!");
|
|
17877
|
+
return client.profile.listInvites.query();
|
|
17878
|
+
},
|
|
17879
|
+
invalidateInvite: async (_learnCard, challenge) => {
|
|
17880
|
+
if (!userData)
|
|
17881
|
+
throw new Error("Please make an account first!");
|
|
17882
|
+
return client.profile.invalidateInvite.mutate({ challenge });
|
|
17867
17883
|
},
|
|
17868
17884
|
blockProfile: async (_learnCard, profileId) => {
|
|
17869
17885
|
if (!userData)
|
|
@@ -18625,7 +18641,7 @@ var getVerifyBoostPlugin = /* @__PURE__ */ __name(async (learnCard, trustedBoost
|
|
|
18625
18641
|
}
|
|
18626
18642
|
}
|
|
18627
18643
|
}
|
|
18628
|
-
} catch
|
|
18644
|
+
} catch {
|
|
18629
18645
|
verificationCheck.errors.push("Boost authenticity could not be verified.");
|
|
18630
18646
|
}
|
|
18631
18647
|
return verificationCheck;
|