@learncard/network-plugin 2.10.9 → 2.10.12
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 +231 -148
- package/dist/lcn-plugin.cjs.development.js.map +3 -3
- package/dist/lcn-plugin.cjs.production.min.js +16 -16
- package/dist/lcn-plugin.cjs.production.min.js.map +3 -3
- package/dist/lcn-plugin.esm.js +231 -148
- package/dist/lcn-plugin.esm.js.map +3 -3
- package/dist/plugin.d.ts +7 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/types.d.ts +23 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -572,10 +572,10 @@ function $constructor(name, initializer3, params) {
|
|
|
572
572
|
let Definition = _Definition;
|
|
573
573
|
Object.defineProperty(Definition, "name", { value: name });
|
|
574
574
|
function _(def) {
|
|
575
|
-
var
|
|
575
|
+
var _a3;
|
|
576
576
|
const inst = params?.Parent ? new Definition() : this;
|
|
577
577
|
init(inst, def);
|
|
578
|
-
(
|
|
578
|
+
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
579
579
|
for (const fn of inst._zod.deferred) {
|
|
580
580
|
fn();
|
|
581
581
|
}
|
|
@@ -1201,8 +1201,8 @@ function aborted(x, startIndex = 0) {
|
|
|
1201
1201
|
__name(aborted, "aborted");
|
|
1202
1202
|
function prefixIssues(path, issues) {
|
|
1203
1203
|
return issues.map((iss) => {
|
|
1204
|
-
var
|
|
1205
|
-
(
|
|
1204
|
+
var _a3;
|
|
1205
|
+
(_a3 = iss).path ?? (_a3.path = []);
|
|
1206
1206
|
iss.path.unshift(path);
|
|
1207
1207
|
return iss;
|
|
1208
1208
|
});
|
|
@@ -1383,7 +1383,7 @@ __name(formatError, "formatError");
|
|
|
1383
1383
|
function treeifyError(error46, mapper = (issue2) => issue2.message) {
|
|
1384
1384
|
const result = { errors: [] };
|
|
1385
1385
|
const processError = /* @__PURE__ */ __name((error47, path = []) => {
|
|
1386
|
-
var
|
|
1386
|
+
var _a3, _b;
|
|
1387
1387
|
for (const issue2 of error47.issues) {
|
|
1388
1388
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1389
1389
|
issue2.errors.map((issues) => processError({ issues }, issue2.path));
|
|
@@ -1404,7 +1404,7 @@ function treeifyError(error46, mapper = (issue2) => issue2.message) {
|
|
|
1404
1404
|
const terminal = i === fullpath.length - 1;
|
|
1405
1405
|
if (typeof el === "string") {
|
|
1406
1406
|
curr.properties ?? (curr.properties = {});
|
|
1407
|
-
(
|
|
1407
|
+
(_a3 = curr.properties)[el] ?? (_a3[el] = { errors: [] });
|
|
1408
1408
|
curr = curr.properties[el];
|
|
1409
1409
|
} else {
|
|
1410
1410
|
curr.items ?? (curr.items = []);
|
|
@@ -1707,10 +1707,10 @@ var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
|
|
|
1707
1707
|
|
|
1708
1708
|
// ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/checks.js
|
|
1709
1709
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
1710
|
-
var
|
|
1710
|
+
var _a3;
|
|
1711
1711
|
inst._zod ?? (inst._zod = {});
|
|
1712
1712
|
inst._zod.def = def;
|
|
1713
|
-
(
|
|
1713
|
+
(_a3 = inst._zod).onattach ?? (_a3.onattach = []);
|
|
1714
1714
|
});
|
|
1715
1715
|
var numericOriginMap = {
|
|
1716
1716
|
number: "number",
|
|
@@ -1776,8 +1776,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
|
|
|
1776
1776
|
var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
1777
1777
|
$ZodCheck.init(inst, def);
|
|
1778
1778
|
inst._zod.onattach.push((inst2) => {
|
|
1779
|
-
var
|
|
1780
|
-
(
|
|
1779
|
+
var _a3;
|
|
1780
|
+
(_a3 = inst2._zod.bag).multipleOf ?? (_a3.multipleOf = def.value);
|
|
1781
1781
|
});
|
|
1782
1782
|
inst._zod.check = (payload) => {
|
|
1783
1783
|
if (typeof payload.value !== typeof def.value)
|
|
@@ -1904,9 +1904,9 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
1904
1904
|
};
|
|
1905
1905
|
});
|
|
1906
1906
|
var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
|
|
1907
|
-
var
|
|
1907
|
+
var _a3;
|
|
1908
1908
|
$ZodCheck.init(inst, def);
|
|
1909
|
-
(
|
|
1909
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
1910
1910
|
const val = payload.value;
|
|
1911
1911
|
return !nullish(val) && val.size !== void 0;
|
|
1912
1912
|
});
|
|
@@ -1932,9 +1932,9 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
1932
1932
|
};
|
|
1933
1933
|
});
|
|
1934
1934
|
var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
|
|
1935
|
-
var
|
|
1935
|
+
var _a3;
|
|
1936
1936
|
$ZodCheck.init(inst, def);
|
|
1937
|
-
(
|
|
1937
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
1938
1938
|
const val = payload.value;
|
|
1939
1939
|
return !nullish(val) && val.size !== void 0;
|
|
1940
1940
|
});
|
|
@@ -1960,9 +1960,9 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
1960
1960
|
};
|
|
1961
1961
|
});
|
|
1962
1962
|
var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
|
|
1963
|
-
var
|
|
1963
|
+
var _a3;
|
|
1964
1964
|
$ZodCheck.init(inst, def);
|
|
1965
|
-
(
|
|
1965
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
1966
1966
|
const val = payload.value;
|
|
1967
1967
|
return !nullish(val) && val.size !== void 0;
|
|
1968
1968
|
});
|
|
@@ -1990,9 +1990,9 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
1990
1990
|
};
|
|
1991
1991
|
});
|
|
1992
1992
|
var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
1993
|
-
var
|
|
1993
|
+
var _a3;
|
|
1994
1994
|
$ZodCheck.init(inst, def);
|
|
1995
|
-
(
|
|
1995
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
1996
1996
|
const val = payload.value;
|
|
1997
1997
|
return !nullish(val) && val.length !== void 0;
|
|
1998
1998
|
});
|
|
@@ -2019,9 +2019,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
2019
2019
|
};
|
|
2020
2020
|
});
|
|
2021
2021
|
var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
|
|
2022
|
-
var
|
|
2022
|
+
var _a3;
|
|
2023
2023
|
$ZodCheck.init(inst, def);
|
|
2024
|
-
(
|
|
2024
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
2025
2025
|
const val = payload.value;
|
|
2026
2026
|
return !nullish(val) && val.length !== void 0;
|
|
2027
2027
|
});
|
|
@@ -2048,9 +2048,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
2048
2048
|
};
|
|
2049
2049
|
});
|
|
2050
2050
|
var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
2051
|
-
var
|
|
2051
|
+
var _a3;
|
|
2052
2052
|
$ZodCheck.init(inst, def);
|
|
2053
|
-
(
|
|
2053
|
+
(_a3 = inst._zod.def).when ?? (_a3.when = (payload) => {
|
|
2054
2054
|
const val = payload.value;
|
|
2055
2055
|
return !nullish(val) && val.length !== void 0;
|
|
2056
2056
|
});
|
|
@@ -2079,7 +2079,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
2079
2079
|
};
|
|
2080
2080
|
});
|
|
2081
2081
|
var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
2082
|
-
var
|
|
2082
|
+
var _a3, _b;
|
|
2083
2083
|
$ZodCheck.init(inst, def);
|
|
2084
2084
|
inst._zod.onattach.push((inst2) => {
|
|
2085
2085
|
const bag = inst2._zod.bag;
|
|
@@ -2090,7 +2090,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
|
|
|
2090
2090
|
}
|
|
2091
2091
|
});
|
|
2092
2092
|
if (def.pattern)
|
|
2093
|
-
(
|
|
2093
|
+
(_a3 = inst._zod).check ?? (_a3.check = (payload) => {
|
|
2094
2094
|
def.pattern.lastIndex = 0;
|
|
2095
2095
|
if (def.pattern.test(payload.value))
|
|
2096
2096
|
return;
|
|
@@ -2295,7 +2295,7 @@ var version = {
|
|
|
2295
2295
|
|
|
2296
2296
|
// ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/schemas.js
|
|
2297
2297
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
2298
|
-
var
|
|
2298
|
+
var _a3;
|
|
2299
2299
|
inst ?? (inst = {});
|
|
2300
2300
|
inst._zod.def = def;
|
|
2301
2301
|
inst._zod.bag = inst._zod.bag || {};
|
|
@@ -2310,7 +2310,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
2310
2310
|
}
|
|
2311
2311
|
}
|
|
2312
2312
|
if (checks.length === 0) {
|
|
2313
|
-
(
|
|
2313
|
+
(_a3 = inst._zod).deferred ?? (_a3.deferred = []);
|
|
2314
2314
|
inst._zod.deferred?.push(() => {
|
|
2315
2315
|
inst._zod.run = inst._zod.parse;
|
|
2316
2316
|
});
|
|
@@ -11112,7 +11112,7 @@ var _JSONSchemaGenerator = class _JSONSchemaGenerator {
|
|
|
11112
11112
|
this.seen = /* @__PURE__ */ new Map();
|
|
11113
11113
|
}
|
|
11114
11114
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
11115
|
-
var
|
|
11115
|
+
var _a3;
|
|
11116
11116
|
const def = schema._zod.def;
|
|
11117
11117
|
const formatMap = {
|
|
11118
11118
|
guid: "uuid",
|
|
@@ -11626,7 +11626,7 @@ var _JSONSchemaGenerator = class _JSONSchemaGenerator {
|
|
|
11626
11626
|
delete result.schema.default;
|
|
11627
11627
|
}
|
|
11628
11628
|
if (this.io === "input" && result.schema._prefault)
|
|
11629
|
-
(
|
|
11629
|
+
(_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
|
|
11630
11630
|
delete result.schema._prefault;
|
|
11631
11631
|
const _result = this.seen.get(schema);
|
|
11632
11632
|
return _result.schema;
|
|
@@ -13906,6 +13906,16 @@ var ConsentFlowContractDetailsValidator = external_exports.object({
|
|
|
13906
13906
|
autoBoosts: external_exports.string().array().optional(),
|
|
13907
13907
|
writers: external_exports.array(LCNProfileValidator).optional()
|
|
13908
13908
|
});
|
|
13909
|
+
var ConsentFlowContractRequestStatusValidator = external_exports.enum(["pending", "accepted", "denied"]).nullable();
|
|
13910
|
+
var ConsentFlowContractRequestReadStatusValidator = external_exports.enum(["unseen", "seen"]).nullable();
|
|
13911
|
+
var ConsentFlowContractRequestForProfileValidator = external_exports.object({
|
|
13912
|
+
profile: LCNProfileValidator,
|
|
13913
|
+
status: ConsentFlowContractRequestStatusValidator,
|
|
13914
|
+
readStatus: ConsentFlowContractRequestReadStatusValidator.optional()
|
|
13915
|
+
});
|
|
13916
|
+
var ConsentFlowContractRequestForProfileListValidator = external_exports.array(
|
|
13917
|
+
ConsentFlowContractRequestForProfileValidator
|
|
13918
|
+
);
|
|
13909
13919
|
var PaginatedConsentFlowContractsValidator = PaginationResponseValidator.extend({
|
|
13910
13920
|
records: ConsentFlowContractDetailsValidator.omit({ owner: true }).array()
|
|
13911
13921
|
});
|
|
@@ -14066,7 +14076,9 @@ var LCNNotificationTypeEnumValidator = external_exports.enum([
|
|
|
14066
14076
|
"PROFILE_PARENT_APPROVED",
|
|
14067
14077
|
"APP_LISTING_SUBMITTED",
|
|
14068
14078
|
"APP_LISTING_APPROVED",
|
|
14069
|
-
"APP_LISTING_REJECTED"
|
|
14079
|
+
"APP_LISTING_REJECTED",
|
|
14080
|
+
"APP_LISTING_WITHDRAWN",
|
|
14081
|
+
"DEVICE_LINK_REQUEST"
|
|
14070
14082
|
]);
|
|
14071
14083
|
var LCNNotificationMessageValidator = external_exports.object({
|
|
14072
14084
|
title: external_exports.string().optional(),
|
|
@@ -14205,6 +14217,7 @@ var InboxCredentialValidator = external_exports.object({
|
|
|
14205
14217
|
webhookUrl: external_exports.string().optional(),
|
|
14206
14218
|
boostUri: external_exports.string().optional(),
|
|
14207
14219
|
activityId: external_exports.string().optional(),
|
|
14220
|
+
integrationId: external_exports.string().optional(),
|
|
14208
14221
|
signingAuthority: external_exports.object({
|
|
14209
14222
|
endpoint: external_exports.string().optional(),
|
|
14210
14223
|
name: external_exports.string().optional()
|
|
@@ -14306,8 +14319,9 @@ var IssueInboxCredentialResponseValidator = external_exports.object({
|
|
|
14306
14319
|
claimUrl: external_exports.string().url().optional(),
|
|
14307
14320
|
recipientDid: external_exports.string().optional()
|
|
14308
14321
|
});
|
|
14322
|
+
var CredentialNameRefValidator = external_exports.object({ name: external_exports.string() }).passthrough();
|
|
14309
14323
|
var ClaimInboxCredentialValidator = external_exports.object({
|
|
14310
|
-
credential: VCValidator.or(VPValidator).or(UnsignedVCValidator).describe("The credential to issue."),
|
|
14324
|
+
credential: VCValidator.or(VPValidator).or(UnsignedVCValidator).or(CredentialNameRefValidator).describe("The credential to issue, or a { name } reference to resolve a boost template."),
|
|
14311
14325
|
configuration: external_exports.object({
|
|
14312
14326
|
publishableKey: external_exports.string(),
|
|
14313
14327
|
signingAuthorityName: external_exports.string().optional(),
|
|
@@ -14591,6 +14605,11 @@ var PromotionLevelValidator = external_exports.enum([
|
|
|
14591
14605
|
"DEMOTED"
|
|
14592
14606
|
]);
|
|
14593
14607
|
var AgeRatingValidator = external_exports.enum(["4+", "9+", "12+", "17+"]);
|
|
14608
|
+
var AppStoreListingSubmitterValidator = external_exports.object({
|
|
14609
|
+
profileId: external_exports.string(),
|
|
14610
|
+
displayName: external_exports.string(),
|
|
14611
|
+
email: external_exports.string().optional()
|
|
14612
|
+
});
|
|
14594
14613
|
var AppStoreListingValidator = external_exports.object({
|
|
14595
14614
|
listing_id: external_exports.string(),
|
|
14596
14615
|
slug: external_exports.string().optional(),
|
|
@@ -14612,7 +14631,10 @@ var AppStoreListingValidator = external_exports.object({
|
|
|
14612
14631
|
screenshots: external_exports.array(external_exports.string()).optional(),
|
|
14613
14632
|
hero_background_color: external_exports.string().optional(),
|
|
14614
14633
|
min_age: external_exports.number().int().min(0).max(18).optional(),
|
|
14615
|
-
age_rating: AgeRatingValidator.optional()
|
|
14634
|
+
age_rating: AgeRatingValidator.optional(),
|
|
14635
|
+
submitted_at: external_exports.string().optional(),
|
|
14636
|
+
submitter: AppStoreListingSubmitterValidator.optional(),
|
|
14637
|
+
contact_email: external_exports.string().email().optional()
|
|
14616
14638
|
});
|
|
14617
14639
|
var AppStoreListingCreateValidator = AppStoreListingValidator.omit({
|
|
14618
14640
|
listing_id: true,
|
|
@@ -14640,9 +14662,39 @@ var AppBoostValidator = external_exports.object({
|
|
|
14640
14662
|
var SendCredentialEventValidator = external_exports.object({
|
|
14641
14663
|
type: external_exports.literal("send-credential"),
|
|
14642
14664
|
templateAlias: external_exports.string(),
|
|
14643
|
-
templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
14665
|
+
templateData: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
14666
|
+
preventDuplicateClaim: external_exports.boolean().optional()
|
|
14667
|
+
});
|
|
14668
|
+
var CheckCredentialEventValidator = external_exports.object({
|
|
14669
|
+
type: external_exports.literal("check-credential"),
|
|
14670
|
+
templateAlias: external_exports.string().optional(),
|
|
14671
|
+
boostUri: external_exports.string().optional()
|
|
14672
|
+
}).refine((input) => Boolean(input.templateAlias) !== Boolean(input.boostUri), {
|
|
14673
|
+
message: "Exactly one of templateAlias or boostUri is required"
|
|
14674
|
+
});
|
|
14675
|
+
var CheckIssuanceStatusEventValidator = external_exports.object({
|
|
14676
|
+
type: external_exports.literal("check-issuance-status"),
|
|
14677
|
+
templateAlias: external_exports.string().optional(),
|
|
14678
|
+
boostUri: external_exports.string().optional(),
|
|
14679
|
+
recipient: external_exports.string()
|
|
14680
|
+
}).refine((input) => Boolean(input.templateAlias) !== Boolean(input.boostUri), {
|
|
14681
|
+
message: "Exactly one of templateAlias or boostUri is required"
|
|
14644
14682
|
});
|
|
14645
|
-
var
|
|
14683
|
+
var GetTemplateRecipientsEventValidator = external_exports.object({
|
|
14684
|
+
type: external_exports.literal("get-template-recipients"),
|
|
14685
|
+
templateAlias: external_exports.string().optional(),
|
|
14686
|
+
boostUri: external_exports.string().optional(),
|
|
14687
|
+
limit: external_exports.number().optional(),
|
|
14688
|
+
cursor: external_exports.string().optional()
|
|
14689
|
+
}).refine((input) => Boolean(input.templateAlias) !== Boolean(input.boostUri), {
|
|
14690
|
+
message: "Exactly one of templateAlias or boostUri is required"
|
|
14691
|
+
});
|
|
14692
|
+
var AppEventValidator = external_exports.discriminatedUnion("type", [
|
|
14693
|
+
SendCredentialEventValidator,
|
|
14694
|
+
CheckCredentialEventValidator,
|
|
14695
|
+
CheckIssuanceStatusEventValidator,
|
|
14696
|
+
GetTemplateRecipientsEventValidator
|
|
14697
|
+
]);
|
|
14646
14698
|
var AppEventInputValidator = external_exports.object({
|
|
14647
14699
|
listingId: external_exports.string(),
|
|
14648
14700
|
event: AppEventValidator
|
|
@@ -14705,6 +14757,14 @@ var CredentialActivityStatsValidator = external_exports.object({
|
|
|
14705
14757
|
failed: external_exports.number(),
|
|
14706
14758
|
claimRate: external_exports.number()
|
|
14707
14759
|
});
|
|
14760
|
+
var _a2;
|
|
14761
|
+
var AuthSessionError = (_a2 = class extends Error {
|
|
14762
|
+
constructor(message, reason) {
|
|
14763
|
+
super(message);
|
|
14764
|
+
this.reason = reason;
|
|
14765
|
+
this.name = "AuthSessionError";
|
|
14766
|
+
}
|
|
14767
|
+
}, __name(_a2, "AuthSessionError"), __name2(_a2, "AuthSessionError"), _a2);
|
|
14708
14768
|
|
|
14709
14769
|
// src/plugin.ts
|
|
14710
14770
|
var import_helpers = require("@learncard/helpers");
|
|
@@ -15197,7 +15257,9 @@ var renderTemplateJson = /* @__PURE__ */ __name((jsonString, templateData) => {
|
|
|
15197
15257
|
const unescapedTemplate = jsonString.replace(/\{\{([^{}]+)\}\}/g, "{{{$1}}}");
|
|
15198
15258
|
return mustache_default.render(unescapedTemplate, preparedData);
|
|
15199
15259
|
}, "renderTemplateJson");
|
|
15200
|
-
async function getLearnCardNetworkPlugin(learnCard, url2,
|
|
15260
|
+
async function getLearnCardNetworkPlugin(learnCard, url2, apiTokenOrOptions, options) {
|
|
15261
|
+
const apiToken = typeof apiTokenOrOptions === "string" ? apiTokenOrOptions : void 0;
|
|
15262
|
+
const guardianApprovalGetter = (typeof apiTokenOrOptions === "object" ? apiTokenOrOptions?.guardianApprovalGetter : void 0) ?? options?.guardianApprovalGetter;
|
|
15201
15263
|
let did = "";
|
|
15202
15264
|
try {
|
|
15203
15265
|
const idPlane = learnCard?.id;
|
|
@@ -15208,11 +15270,18 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15208
15270
|
learnCard?.debug?.("LCN: no local DID available at init; will fetch from profile");
|
|
15209
15271
|
}
|
|
15210
15272
|
learnCard?.debug?.("Adding LearnCardNetwork Plugin");
|
|
15211
|
-
const client = apiToken ? await (0, import_network_brain_client.getApiTokenClient)(url2, apiToken) : await (0, import_network_brain_client.getClient)(
|
|
15212
|
-
|
|
15213
|
-
|
|
15214
|
-
|
|
15215
|
-
|
|
15273
|
+
const client = apiToken ? await (0, import_network_brain_client.getApiTokenClient)(url2, apiToken, guardianApprovalGetter) : await (0, import_network_brain_client.getClient)(
|
|
15274
|
+
url2,
|
|
15275
|
+
async (challenge) => {
|
|
15276
|
+
const jwt2 = await learnCard.invoke.getDidAuthVp({
|
|
15277
|
+
proofFormat: "jwt",
|
|
15278
|
+
challenge
|
|
15279
|
+
});
|
|
15280
|
+
if (typeof jwt2 !== "string") throw new Error("Error getting DID-Auth-JWT!");
|
|
15281
|
+
return jwt2;
|
|
15282
|
+
},
|
|
15283
|
+
guardianApprovalGetter
|
|
15284
|
+
);
|
|
15216
15285
|
let userData;
|
|
15217
15286
|
learnCard?.debug?.("LCN: initial getProfile query starting", { apiToken: !!apiToken });
|
|
15218
15287
|
const initialQuery = client.profile.getProfile.query().then((result) => {
|
|
@@ -15358,16 +15427,16 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15358
15427
|
const newDid = await client.profile.createManagedServiceProfile.mutate(profile);
|
|
15359
15428
|
return newDid;
|
|
15360
15429
|
}, "createManagedServiceProfile"),
|
|
15361
|
-
getAvailableProfiles: /* @__PURE__ */ __name(async (_learnCard,
|
|
15430
|
+
getAvailableProfiles: /* @__PURE__ */ __name(async (_learnCard, options2 = {}) => {
|
|
15362
15431
|
await ensureUser();
|
|
15363
|
-
return client.profile.getAvailableProfiles.query(
|
|
15432
|
+
return client.profile.getAvailableProfiles.query(options2);
|
|
15364
15433
|
}, "getAvailableProfiles"),
|
|
15365
|
-
getManagedProfiles: /* @__PURE__ */ __name(async (_learnCard,
|
|
15366
|
-
return client.profileManager.getManagedProfiles.query(
|
|
15434
|
+
getManagedProfiles: /* @__PURE__ */ __name(async (_learnCard, options2 = {}) => {
|
|
15435
|
+
return client.profileManager.getManagedProfiles.query(options2);
|
|
15367
15436
|
}, "getManagedProfiles"),
|
|
15368
|
-
getManagedServiceProfiles: /* @__PURE__ */ __name(async (_learnCard,
|
|
15437
|
+
getManagedServiceProfiles: /* @__PURE__ */ __name(async (_learnCard, options2 = {}) => {
|
|
15369
15438
|
await ensureUser();
|
|
15370
|
-
return client.profile.getManagedServiceProfiles.query(
|
|
15439
|
+
return client.profile.getManagedServiceProfiles.query(options2);
|
|
15371
15440
|
}, "getManagedServiceProfiles"),
|
|
15372
15441
|
updateProfile: /* @__PURE__ */ __name(async (_learnCard, profile) => {
|
|
15373
15442
|
await ensureUser();
|
|
@@ -15447,9 +15516,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15447
15516
|
await ensureUser();
|
|
15448
15517
|
return client.profile.connections.query();
|
|
15449
15518
|
}, "getConnections"),
|
|
15450
|
-
getPaginatedConnections: /* @__PURE__ */ __name(async (_learnCard,
|
|
15519
|
+
getPaginatedConnections: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
15451
15520
|
await ensureUser();
|
|
15452
|
-
return client.profile.paginatedConnections.query(
|
|
15521
|
+
return client.profile.paginatedConnections.query(options2);
|
|
15453
15522
|
}, "getPaginatedConnections"),
|
|
15454
15523
|
getPendingConnections: /* @__PURE__ */ __name(async (_learnCard) => {
|
|
15455
15524
|
console.warn(
|
|
@@ -15458,9 +15527,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15458
15527
|
await ensureUser();
|
|
15459
15528
|
return client.profile.pendingConnections.query();
|
|
15460
15529
|
}, "getPendingConnections"),
|
|
15461
|
-
getPaginatedPendingConnections: /* @__PURE__ */ __name(async (_learnCard,
|
|
15530
|
+
getPaginatedPendingConnections: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
15462
15531
|
await ensureUser();
|
|
15463
|
-
return client.profile.paginatedPendingConnections.query(
|
|
15532
|
+
return client.profile.paginatedPendingConnections.query(options2);
|
|
15464
15533
|
}, "getPaginatedPendingConnections"),
|
|
15465
15534
|
getConnectionRequests: /* @__PURE__ */ __name(async (_learnCard) => {
|
|
15466
15535
|
console.warn(
|
|
@@ -15469,9 +15538,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15469
15538
|
await ensureUser();
|
|
15470
15539
|
return client.profile.connectionRequests.query();
|
|
15471
15540
|
}, "getConnectionRequests"),
|
|
15472
|
-
getPaginatedConnectionRequests: /* @__PURE__ */ __name(async (_learnCard,
|
|
15541
|
+
getPaginatedConnectionRequests: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
15473
15542
|
await ensureUser();
|
|
15474
|
-
return client.profile.paginatedConnectionRequests.query(
|
|
15543
|
+
return client.profile.paginatedConnectionRequests.query(options2);
|
|
15475
15544
|
}, "getPaginatedConnectionRequests"),
|
|
15476
15545
|
generateInvite: /* @__PURE__ */ __name(async (_learnCard, challenge, expiration, maxUses) => {
|
|
15477
15546
|
await ensureUser();
|
|
@@ -15528,9 +15597,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15528
15597
|
metadata
|
|
15529
15598
|
});
|
|
15530
15599
|
}, "sendCredential"),
|
|
15531
|
-
acceptCredential: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15600
|
+
acceptCredential: /* @__PURE__ */ __name(async (_learnCard, uri, options2) => {
|
|
15532
15601
|
await ensureUser();
|
|
15533
|
-
return client.credential.acceptCredential.mutate({ uri, options });
|
|
15602
|
+
return client.credential.acceptCredential.mutate({ uri, options: options2 });
|
|
15534
15603
|
}, "acceptCredential"),
|
|
15535
15604
|
getReceivedCredentials: /* @__PURE__ */ __name(async (_learnCard, from) => {
|
|
15536
15605
|
await ensureUser();
|
|
@@ -15610,18 +15679,18 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15610
15679
|
await ensureUser();
|
|
15611
15680
|
return client.boost.getBoostSkills.query({ uri });
|
|
15612
15681
|
}, "getBoostSkills"),
|
|
15613
|
-
getBoostFrameworks: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15682
|
+
getBoostFrameworks: /* @__PURE__ */ __name(async (_learnCard, uri, options2 = {}) => {
|
|
15614
15683
|
if (!userData) throw new Error("Please make an account first!");
|
|
15615
|
-
const { limit, cursor, query } =
|
|
15684
|
+
const { limit, cursor, query } = options2 ?? {};
|
|
15616
15685
|
return client.boost.getBoostFrameworks.query({ uri, limit, cursor, query });
|
|
15617
15686
|
}, "getBoostFrameworks"),
|
|
15618
15687
|
getSkillsAvailableForBoost: /* @__PURE__ */ __name(async (_learnCard, uri) => {
|
|
15619
15688
|
if (!userData) throw new Error("Please make an account first!");
|
|
15620
15689
|
return client.boost.getSkillsAvailableForBoost.query({ uri });
|
|
15621
15690
|
}, "getSkillsAvailableForBoost"),
|
|
15622
|
-
searchSkillsAvailableForBoost: /* @__PURE__ */ __name(async (_learnCard, uri, query,
|
|
15691
|
+
searchSkillsAvailableForBoost: /* @__PURE__ */ __name(async (_learnCard, uri, query, options2 = {}) => {
|
|
15623
15692
|
if (!userData) throw new Error("Please make an account first!");
|
|
15624
|
-
return client.boost.searchSkillsAvailableForBoost.query({ uri, query, ...
|
|
15693
|
+
return client.boost.searchSkillsAvailableForBoost.query({ uri, query, ...options2 });
|
|
15625
15694
|
}, "searchSkillsAvailableForBoost"),
|
|
15626
15695
|
getBoosts: /* @__PURE__ */ __name(async (_learnCard, query) => {
|
|
15627
15696
|
console.warn(
|
|
@@ -15634,41 +15703,41 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15634
15703
|
await ensureUser();
|
|
15635
15704
|
return client.boost.countBoosts.query({ query });
|
|
15636
15705
|
}, "countBoosts"),
|
|
15637
|
-
getPaginatedBoosts: /* @__PURE__ */ __name(async (_learnCard,
|
|
15706
|
+
getPaginatedBoosts: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
15638
15707
|
await ensureUser();
|
|
15639
|
-
return client.boost.getPaginatedBoosts.query(
|
|
15708
|
+
return client.boost.getPaginatedBoosts.query(options2);
|
|
15640
15709
|
}, "getPaginatedBoosts"),
|
|
15641
|
-
getBoostChildren: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15710
|
+
getBoostChildren: /* @__PURE__ */ __name(async (_learnCard, uri, options2) => {
|
|
15642
15711
|
await ensureUser();
|
|
15643
|
-
return client.boost.getBoostChildren.query({ uri, ...
|
|
15712
|
+
return client.boost.getBoostChildren.query({ uri, ...options2 });
|
|
15644
15713
|
}, "getBoostChildren"),
|
|
15645
|
-
countBoostChildren: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15714
|
+
countBoostChildren: /* @__PURE__ */ __name(async (_learnCard, uri, options2) => {
|
|
15646
15715
|
await ensureUser();
|
|
15647
|
-
return client.boost.countBoostChildren.query({ uri, ...
|
|
15716
|
+
return client.boost.countBoostChildren.query({ uri, ...options2 });
|
|
15648
15717
|
}, "countBoostChildren"),
|
|
15649
|
-
getBoostSiblings: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15718
|
+
getBoostSiblings: /* @__PURE__ */ __name(async (_learnCard, uri, options2) => {
|
|
15650
15719
|
await ensureUser();
|
|
15651
|
-
return client.boost.getBoostSiblings.query({ uri, ...
|
|
15720
|
+
return client.boost.getBoostSiblings.query({ uri, ...options2 });
|
|
15652
15721
|
}, "getBoostSiblings"),
|
|
15653
|
-
countBoostSiblings: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15722
|
+
countBoostSiblings: /* @__PURE__ */ __name(async (_learnCard, uri, options2) => {
|
|
15654
15723
|
await ensureUser();
|
|
15655
|
-
return client.boost.countBoostSiblings.query({ uri, ...
|
|
15724
|
+
return client.boost.countBoostSiblings.query({ uri, ...options2 });
|
|
15656
15725
|
}, "countBoostSiblings"),
|
|
15657
|
-
getFamilialBoosts: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15726
|
+
getFamilialBoosts: /* @__PURE__ */ __name(async (_learnCard, uri, options2) => {
|
|
15658
15727
|
await ensureUser();
|
|
15659
|
-
return client.boost.getFamilialBoosts.query({ uri, ...
|
|
15728
|
+
return client.boost.getFamilialBoosts.query({ uri, ...options2 });
|
|
15660
15729
|
}, "getFamilialBoosts"),
|
|
15661
|
-
countFamilialBoosts: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15730
|
+
countFamilialBoosts: /* @__PURE__ */ __name(async (_learnCard, uri, options2) => {
|
|
15662
15731
|
await ensureUser();
|
|
15663
|
-
return client.boost.countFamilialBoosts.query({ uri, ...
|
|
15732
|
+
return client.boost.countFamilialBoosts.query({ uri, ...options2 });
|
|
15664
15733
|
}, "countFamilialBoosts"),
|
|
15665
|
-
getBoostParents: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15734
|
+
getBoostParents: /* @__PURE__ */ __name(async (_learnCard, uri, options2) => {
|
|
15666
15735
|
await ensureUser();
|
|
15667
|
-
return client.boost.getBoostParents.query({ uri, ...
|
|
15736
|
+
return client.boost.getBoostParents.query({ uri, ...options2 });
|
|
15668
15737
|
}, "getBoostParents"),
|
|
15669
|
-
countBoostParents: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15738
|
+
countBoostParents: /* @__PURE__ */ __name(async (_learnCard, uri, options2) => {
|
|
15670
15739
|
await ensureUser();
|
|
15671
|
-
return client.boost.countBoostParents.query({ uri, ...
|
|
15740
|
+
return client.boost.countBoostParents.query({ uri, ...options2 });
|
|
15672
15741
|
}, "countBoostParents"),
|
|
15673
15742
|
makeBoostParent: /* @__PURE__ */ __name(async (_learnCard, uris) => {
|
|
15674
15743
|
await ensureUser();
|
|
@@ -15743,9 +15812,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15743
15812
|
includeUnacceptedBoosts
|
|
15744
15813
|
});
|
|
15745
15814
|
}, "countConnectedBoostRecipients"),
|
|
15746
|
-
getBoostChildrenProfileManagers: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15815
|
+
getBoostChildrenProfileManagers: /* @__PURE__ */ __name(async (_learnCard, uri, options2) => {
|
|
15747
15816
|
await ensureUser();
|
|
15748
|
-
return client.boost.getChildrenProfileManagers.query({ uri, ...
|
|
15817
|
+
return client.boost.getChildrenProfileManagers.query({ uri, ...options2 });
|
|
15749
15818
|
}, "getBoostChildrenProfileManagers"),
|
|
15750
15819
|
updateBoost: /* @__PURE__ */ __name(async (_learnCard, uri, updates, credential) => {
|
|
15751
15820
|
await ensureUser();
|
|
@@ -15754,7 +15823,7 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15754
15823
|
uri,
|
|
15755
15824
|
updates: { ...credential && { credential }, ...restUpdates }
|
|
15756
15825
|
};
|
|
15757
|
-
if (Array.isArray(skills)
|
|
15826
|
+
if (Array.isArray(skills)) payload.skills = skills;
|
|
15758
15827
|
return client.boost.updateBoost.mutate(payload);
|
|
15759
15828
|
}, "updateBoost"),
|
|
15760
15829
|
attachFrameworkToBoost: /* @__PURE__ */ __name(async (_learnCard, boostUri, frameworkId) => {
|
|
@@ -15769,9 +15838,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15769
15838
|
if (!userData) throw new Error("Please make an account first!");
|
|
15770
15839
|
return client.boost.alignBoostSkills.mutate({ boostUri, skills });
|
|
15771
15840
|
}, "alignBoostSkills"),
|
|
15772
|
-
getBoostAdmins: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
15841
|
+
getBoostAdmins: /* @__PURE__ */ __name(async (_learnCard, uri, options2 = {}) => {
|
|
15773
15842
|
await ensureUser();
|
|
15774
|
-
return client.boost.getBoostAdmins.query({ uri, ...
|
|
15843
|
+
return client.boost.getBoostAdmins.query({ uri, ...options2 });
|
|
15775
15844
|
}, "getBoostAdmins"),
|
|
15776
15845
|
getBoostPermissions: /* @__PURE__ */ __name(async (_learnCard, uri, profileId) => {
|
|
15777
15846
|
await ensureUser();
|
|
@@ -15809,7 +15878,7 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15809
15878
|
await ensureUser();
|
|
15810
15879
|
return client.boost.deleteBoost.mutate({ uri });
|
|
15811
15880
|
}, "deleteBoost"),
|
|
15812
|
-
sendBoost: /* @__PURE__ */ __name(async (_learnCard, profileId, boostUri,
|
|
15881
|
+
sendBoost: /* @__PURE__ */ __name(async (_learnCard, profileId, boostUri, options2 = { encrypt: true, skipNotification: false, templateData: {} }) => {
|
|
15813
15882
|
await ensureUser();
|
|
15814
15883
|
const result = await getBoostTemplateForIssuance(_learnCard, boostUri);
|
|
15815
15884
|
const data = await UnsignedVCValidator.spa(result);
|
|
@@ -15832,10 +15901,10 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15832
15901
|
boost.credentialSubject.id = targetProfile.did;
|
|
15833
15902
|
}
|
|
15834
15903
|
if (boost?.type?.includes("BoostCredential")) boost.boostId = boostUri;
|
|
15835
|
-
if (typeof
|
|
15904
|
+
if (typeof options2 === "object" && options2.templateData && Object.keys(options2.templateData).length > 0) {
|
|
15836
15905
|
try {
|
|
15837
15906
|
const boostString = JSON.stringify(boost);
|
|
15838
|
-
const rendered = renderTemplateJson(boostString,
|
|
15907
|
+
const rendered = renderTemplateJson(boostString, options2.templateData);
|
|
15839
15908
|
boost = JSON.parse(rendered);
|
|
15840
15909
|
} catch (error46) {
|
|
15841
15910
|
throw new Error(
|
|
@@ -15843,17 +15912,17 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15843
15912
|
);
|
|
15844
15913
|
}
|
|
15845
15914
|
}
|
|
15846
|
-
if (typeof
|
|
15847
|
-
boost =
|
|
15915
|
+
if (typeof options2 === "object" && options2.overideFn) {
|
|
15916
|
+
boost = options2.overideFn(boost);
|
|
15848
15917
|
}
|
|
15849
15918
|
const vc = await _learnCard.invoke.issueCredential(boost);
|
|
15850
|
-
if (typeof
|
|
15919
|
+
if (typeof options2 === "object" && !options2.encrypt || !options2) {
|
|
15851
15920
|
return client.boost.sendBoost.mutate({
|
|
15852
15921
|
profileId,
|
|
15853
15922
|
uri: boostUri,
|
|
15854
15923
|
credential: vc,
|
|
15855
15924
|
options: {
|
|
15856
|
-
skipNotification: typeof
|
|
15925
|
+
skipNotification: typeof options2 === "object" && options2.skipNotification
|
|
15857
15926
|
}
|
|
15858
15927
|
});
|
|
15859
15928
|
}
|
|
@@ -15868,7 +15937,7 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15868
15937
|
uri: boostUri,
|
|
15869
15938
|
credential,
|
|
15870
15939
|
options: {
|
|
15871
|
-
skipNotification: typeof
|
|
15940
|
+
skipNotification: typeof options2 === "object" && options2.skipNotification
|
|
15872
15941
|
}
|
|
15873
15942
|
});
|
|
15874
15943
|
}, "sendBoost"),
|
|
@@ -15896,12 +15965,12 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15896
15965
|
await ensureUser();
|
|
15897
15966
|
return client.profile.primarySigningAuthority.query();
|
|
15898
15967
|
}, "getPrimaryRegisteredSigningAuthority"),
|
|
15899
|
-
generateClaimLink: /* @__PURE__ */ __name(async (_learnCard, boostUri, claimLinkSA,
|
|
15968
|
+
generateClaimLink: /* @__PURE__ */ __name(async (_learnCard, boostUri, claimLinkSA, options2, challenge) => {
|
|
15900
15969
|
await ensureUser();
|
|
15901
15970
|
return client.boost.generateClaimLink.mutate({
|
|
15902
15971
|
boostUri,
|
|
15903
15972
|
claimLinkSA,
|
|
15904
|
-
options,
|
|
15973
|
+
options: options2,
|
|
15905
15974
|
challenge
|
|
15906
15975
|
});
|
|
15907
15976
|
}, "generateClaimLink"),
|
|
@@ -15995,25 +16064,25 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
15995
16064
|
getContract: /* @__PURE__ */ __name(async (_learnCard, uri) => {
|
|
15996
16065
|
return client.contracts.getConsentFlowContract.query({ uri });
|
|
15997
16066
|
}, "getContract"),
|
|
15998
|
-
getContracts: /* @__PURE__ */ __name(async (_learnCard,
|
|
16067
|
+
getContracts: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
15999
16068
|
await ensureUser();
|
|
16000
|
-
return client.contracts.getConsentFlowContracts.query(
|
|
16069
|
+
return client.contracts.getConsentFlowContracts.query(options2);
|
|
16001
16070
|
}, "getContracts"),
|
|
16002
16071
|
deleteContract: /* @__PURE__ */ __name(async (_learnCard, uri) => {
|
|
16003
16072
|
await ensureUser();
|
|
16004
16073
|
return client.contracts.deleteConsentFlowContract.mutate({ uri });
|
|
16005
16074
|
}, "deleteContract"),
|
|
16006
|
-
getConsentFlowData: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
16075
|
+
getConsentFlowData: /* @__PURE__ */ __name(async (_learnCard, uri, options2 = {}) => {
|
|
16007
16076
|
await ensureUser();
|
|
16008
|
-
return client.contracts.getConsentedDataForContract.query({ uri, ...
|
|
16077
|
+
return client.contracts.getConsentedDataForContract.query({ uri, ...options2 });
|
|
16009
16078
|
}, "getConsentFlowData"),
|
|
16010
|
-
getConsentFlowDataForDid: /* @__PURE__ */ __name(async (_learnCard, did2,
|
|
16079
|
+
getConsentFlowDataForDid: /* @__PURE__ */ __name(async (_learnCard, did2, options2 = {}) => {
|
|
16011
16080
|
await ensureUser();
|
|
16012
|
-
return client.contracts.getConsentedDataForDid.query({ did: did2, ...
|
|
16081
|
+
return client.contracts.getConsentedDataForDid.query({ did: did2, ...options2 });
|
|
16013
16082
|
}, "getConsentFlowDataForDid"),
|
|
16014
|
-
getAllConsentFlowData: /* @__PURE__ */ __name(async (_learnCard, query = {},
|
|
16083
|
+
getAllConsentFlowData: /* @__PURE__ */ __name(async (_learnCard, query = {}, options2 = {}) => {
|
|
16015
16084
|
await ensureUser();
|
|
16016
|
-
return client.contracts.getConsentedData.query({ query, ...
|
|
16085
|
+
return client.contracts.getConsentedData.query({ query, ...options2 });
|
|
16017
16086
|
}, "getAllConsentFlowData"),
|
|
16018
16087
|
writeCredentialToContract: /* @__PURE__ */ __name(async (_learnCard, did2, contractUri, credential, boostUri) => {
|
|
16019
16088
|
await ensureUser();
|
|
@@ -16035,9 +16104,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16035
16104
|
// for SmartResume
|
|
16036
16105
|
});
|
|
16037
16106
|
}, "consentToContract"),
|
|
16038
|
-
getConsentedContracts: /* @__PURE__ */ __name(async (_learnCard,
|
|
16107
|
+
getConsentedContracts: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
16039
16108
|
await ensureUser();
|
|
16040
|
-
return client.contracts.getConsentedContracts.query(
|
|
16109
|
+
return client.contracts.getConsentedContracts.query(options2);
|
|
16041
16110
|
}, "getConsentedContracts"),
|
|
16042
16111
|
updateContractTerms: /* @__PURE__ */ __name(async (_learnCard, uri, { terms, expiresAt, oneTime }) => {
|
|
16043
16112
|
await ensureUser();
|
|
@@ -16052,17 +16121,17 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16052
16121
|
await ensureUser();
|
|
16053
16122
|
return client.contracts.withdrawConsent.mutate({ uri });
|
|
16054
16123
|
}, "withdrawConsent"),
|
|
16055
|
-
getConsentFlowTransactions: /* @__PURE__ */ __name(async (_learnCard, uri,
|
|
16124
|
+
getConsentFlowTransactions: /* @__PURE__ */ __name(async (_learnCard, uri, options2) => {
|
|
16056
16125
|
await ensureUser();
|
|
16057
|
-
return client.contracts.getTermsTransactionHistory.query({ uri, ...
|
|
16126
|
+
return client.contracts.getTermsTransactionHistory.query({ uri, ...options2 });
|
|
16058
16127
|
}, "getConsentFlowTransactions"),
|
|
16059
|
-
getCredentialsForContract: /* @__PURE__ */ __name(async (_learnCard, termsUri,
|
|
16128
|
+
getCredentialsForContract: /* @__PURE__ */ __name(async (_learnCard, termsUri, options2 = {}) => {
|
|
16060
16129
|
await ensureUser();
|
|
16061
|
-
return client.contracts.getCredentialsForContract.query({ termsUri, ...
|
|
16130
|
+
return client.contracts.getCredentialsForContract.query({ termsUri, ...options2 });
|
|
16062
16131
|
}, "getCredentialsForContract"),
|
|
16063
|
-
getConsentFlowCredentials: /* @__PURE__ */ __name(async (_learnCard,
|
|
16132
|
+
getConsentFlowCredentials: /* @__PURE__ */ __name(async (_learnCard, options2 = {}) => {
|
|
16064
16133
|
await ensureUser();
|
|
16065
|
-
return client.contracts.getAllCredentialsForTerms.query(
|
|
16134
|
+
return client.contracts.getAllCredentialsForTerms.query(options2);
|
|
16066
16135
|
}, "getConsentFlowCredentials"),
|
|
16067
16136
|
verifyConsent: /* @__PURE__ */ __name(async (_learnCard, uri, profileId) => {
|
|
16068
16137
|
await ensureUser();
|
|
@@ -16111,6 +16180,12 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16111
16180
|
targetProfileId
|
|
16112
16181
|
});
|
|
16113
16182
|
}, "getAllContractRequestsForProfile"),
|
|
16183
|
+
getSharedInsightsRequestsForProfile: /* @__PURE__ */ __name(async (_learnCard, targetProfileId) => {
|
|
16184
|
+
await ensureUser();
|
|
16185
|
+
return client.contracts.getSharedInsightsRequestsForProfile.query({
|
|
16186
|
+
targetProfileId
|
|
16187
|
+
});
|
|
16188
|
+
}, "getSharedInsightsRequestsForProfile"),
|
|
16114
16189
|
forwardContractRequestToProfile: /* @__PURE__ */ __name(async (_learnCard, parentProfileId, targetProfileId, contractUri) => {
|
|
16115
16190
|
await ensureUser();
|
|
16116
16191
|
return client.contracts.forwardContractRequestToProfile.mutate({
|
|
@@ -16163,9 +16238,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16163
16238
|
await ensureUser();
|
|
16164
16239
|
return client.claimHook.createClaimHook.mutate({ hook });
|
|
16165
16240
|
}, "createClaimHook"),
|
|
16166
|
-
getClaimHooksForBoost: /* @__PURE__ */ __name(async (_learnCard,
|
|
16241
|
+
getClaimHooksForBoost: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
16167
16242
|
await ensureUser();
|
|
16168
|
-
return client.claimHook.getClaimHooksForBoost.query(
|
|
16243
|
+
return client.claimHook.getClaimHooksForBoost.query(options2);
|
|
16169
16244
|
}, "getClaimHooksForBoost"),
|
|
16170
16245
|
deleteClaimHook: /* @__PURE__ */ __name(async (_learnCard, id) => {
|
|
16171
16246
|
await ensureUser();
|
|
@@ -16191,9 +16266,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16191
16266
|
await ensureUser();
|
|
16192
16267
|
return client.authGrants.getAuthGrant.query({ id });
|
|
16193
16268
|
}, "getAuthGrant"),
|
|
16194
|
-
getAuthGrants: /* @__PURE__ */ __name(async (_learnCard,
|
|
16269
|
+
getAuthGrants: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
16195
16270
|
await ensureUser();
|
|
16196
|
-
return client.authGrants.getAuthGrants.query(
|
|
16271
|
+
return client.authGrants.getAuthGrants.query(options2);
|
|
16197
16272
|
}, "getAuthGrants"),
|
|
16198
16273
|
getAPITokenForAuthGrant: /* @__PURE__ */ __name(async (_learnCard, id) => {
|
|
16199
16274
|
await ensureUser();
|
|
@@ -16215,9 +16290,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16215
16290
|
await ensureUser();
|
|
16216
16291
|
return client.inbox.issue.mutate(issueInboxCredential);
|
|
16217
16292
|
}, "sendCredentialViaInbox"),
|
|
16218
|
-
getMySentInboxCredentials: /* @__PURE__ */ __name(async (_learnCard,
|
|
16293
|
+
getMySentInboxCredentials: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
16219
16294
|
await ensureUser();
|
|
16220
|
-
return client.inbox.getMyIssuedCredentials.query(
|
|
16295
|
+
return client.inbox.getMyIssuedCredentials.query(options2);
|
|
16221
16296
|
}, "getMySentInboxCredentials"),
|
|
16222
16297
|
getInboxCredential: /* @__PURE__ */ __name(async (_learnCard, id) => {
|
|
16223
16298
|
await ensureUser();
|
|
@@ -16227,9 +16302,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16227
16302
|
await ensureUser();
|
|
16228
16303
|
return client.inbox.finalize.mutate();
|
|
16229
16304
|
}, "finalizeInboxCredentials"),
|
|
16230
|
-
sendGuardianApprovalEmail: /* @__PURE__ */ __name(async (_learnCard,
|
|
16305
|
+
sendGuardianApprovalEmail: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
16231
16306
|
await ensureUser();
|
|
16232
|
-
return client.inbox.sendGuardianApprovalEmail.mutate(
|
|
16307
|
+
return client.inbox.sendGuardianApprovalEmail.mutate(options2);
|
|
16233
16308
|
}, "sendGuardianApprovalEmail"),
|
|
16234
16309
|
approveGuardianRequest: /* @__PURE__ */ __name(async (_learnCard, token) => {
|
|
16235
16310
|
return client.inbox.approveGuardianRequest.mutate({ token });
|
|
@@ -16298,46 +16373,46 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16298
16373
|
if (!userData) throw new Error("Please make an account first!");
|
|
16299
16374
|
return client.skillFrameworks.listMine.query();
|
|
16300
16375
|
}, "listMySkillFrameworks"),
|
|
16301
|
-
getAllAvailableFrameworks: /* @__PURE__ */ __name(async (_learnCard,
|
|
16376
|
+
getAllAvailableFrameworks: /* @__PURE__ */ __name(async (_learnCard, options2 = {}) => {
|
|
16302
16377
|
if (!userData) throw new Error("Please make an account first!");
|
|
16303
|
-
return client.skillFrameworks.getAllAvailableFrameworks.query(
|
|
16378
|
+
return client.skillFrameworks.getAllAvailableFrameworks.query(options2);
|
|
16304
16379
|
}, "getAllAvailableFrameworks"),
|
|
16305
|
-
getSkillFrameworkById: /* @__PURE__ */ __name(async (_learnCard, id,
|
|
16380
|
+
getSkillFrameworkById: /* @__PURE__ */ __name(async (_learnCard, id, options2 = {}) => {
|
|
16306
16381
|
if (!userData) throw new Error("Please make an account first!");
|
|
16307
|
-
return client.skillFrameworks.getById.query({ id, ...
|
|
16382
|
+
return client.skillFrameworks.getById.query({ id, ...options2 });
|
|
16308
16383
|
}, "getSkillFrameworkById"),
|
|
16309
|
-
getBoostsThatUseFramework: /* @__PURE__ */ __name(async (_learnCard, frameworkId,
|
|
16384
|
+
getBoostsThatUseFramework: /* @__PURE__ */ __name(async (_learnCard, frameworkId, options2 = {}) => {
|
|
16310
16385
|
if (!userData) throw new Error("Please make an account first!");
|
|
16311
16386
|
return client.skillFrameworks.getBoostsThatUseFramework.query({
|
|
16312
16387
|
id: frameworkId,
|
|
16313
|
-
...
|
|
16388
|
+
...options2
|
|
16314
16389
|
});
|
|
16315
16390
|
}, "getBoostsThatUseFramework"),
|
|
16316
|
-
countBoostsThatUseFramework: /* @__PURE__ */ __name(async (_learnCard, frameworkId,
|
|
16391
|
+
countBoostsThatUseFramework: /* @__PURE__ */ __name(async (_learnCard, frameworkId, options2 = {}) => {
|
|
16317
16392
|
if (!userData) throw new Error("Please make an account first!");
|
|
16318
16393
|
return client.skillFrameworks.countBoostsThatUseFramework.query({
|
|
16319
16394
|
id: frameworkId,
|
|
16320
|
-
...
|
|
16395
|
+
...options2
|
|
16321
16396
|
});
|
|
16322
16397
|
}, "countBoostsThatUseFramework"),
|
|
16323
|
-
getFrameworkSkillTree: /* @__PURE__ */ __name(async (_learnCard, frameworkId,
|
|
16398
|
+
getFrameworkSkillTree: /* @__PURE__ */ __name(async (_learnCard, frameworkId, options2 = {}) => {
|
|
16324
16399
|
if (!userData) throw new Error("Please make an account first!");
|
|
16325
|
-
return client.skills.getFrameworkSkillTree.query({ id: frameworkId, ...
|
|
16400
|
+
return client.skills.getFrameworkSkillTree.query({ id: frameworkId, ...options2 });
|
|
16326
16401
|
}, "getFrameworkSkillTree"),
|
|
16327
|
-
getSkillChildren: /* @__PURE__ */ __name(async (_learnCard, frameworkId, skillId,
|
|
16402
|
+
getSkillChildren: /* @__PURE__ */ __name(async (_learnCard, frameworkId, skillId, options2 = {}) => {
|
|
16328
16403
|
if (!userData) throw new Error("Please make an account first!");
|
|
16329
16404
|
return client.skills.getSkillChildrenTree.query({
|
|
16330
16405
|
frameworkId,
|
|
16331
16406
|
id: skillId,
|
|
16332
|
-
...
|
|
16407
|
+
...options2
|
|
16333
16408
|
});
|
|
16334
16409
|
}, "getSkillChildren"),
|
|
16335
|
-
searchFrameworkSkills: /* @__PURE__ */ __name(async (_learnCard, frameworkId, query,
|
|
16410
|
+
searchFrameworkSkills: /* @__PURE__ */ __name(async (_learnCard, frameworkId, query, options2 = {}) => {
|
|
16336
16411
|
if (!userData) throw new Error("Please make an account first!");
|
|
16337
16412
|
return client.skills.searchFrameworkSkills.query({
|
|
16338
16413
|
id: frameworkId,
|
|
16339
16414
|
query,
|
|
16340
|
-
...
|
|
16415
|
+
...options2
|
|
16341
16416
|
});
|
|
16342
16417
|
}, "searchFrameworkSkills"),
|
|
16343
16418
|
semanticSearchSkills: /* @__PURE__ */ __name(async (_learnCard, input) => {
|
|
@@ -16412,13 +16487,13 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16412
16487
|
await ensureUser();
|
|
16413
16488
|
return client.integrations.getIntegration.query({ id });
|
|
16414
16489
|
}, "getIntegration"),
|
|
16415
|
-
getIntegrations: /* @__PURE__ */ __name(async (_learnCard,
|
|
16490
|
+
getIntegrations: /* @__PURE__ */ __name(async (_learnCard, options2 = {}) => {
|
|
16416
16491
|
await ensureUser();
|
|
16417
|
-
return client.integrations.getIntegrations.query(
|
|
16492
|
+
return client.integrations.getIntegrations.query(options2);
|
|
16418
16493
|
}, "getIntegrations"),
|
|
16419
|
-
countIntegrations: /* @__PURE__ */ __name(async (_learnCard,
|
|
16494
|
+
countIntegrations: /* @__PURE__ */ __name(async (_learnCard, options2 = {}) => {
|
|
16420
16495
|
await ensureUser();
|
|
16421
|
-
return client.integrations.countIntegrations.query(
|
|
16496
|
+
return client.integrations.countIntegrations.query(options2);
|
|
16422
16497
|
}, "countIntegrations"),
|
|
16423
16498
|
updateIntegration: /* @__PURE__ */ __name(async (_learnCard, id, updates) => {
|
|
16424
16499
|
await ensureUser();
|
|
@@ -16463,19 +16538,23 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16463
16538
|
await ensureUser();
|
|
16464
16539
|
return client.appStore.submitForReview.mutate({ listingId });
|
|
16465
16540
|
}, "submitAppStoreListingForReview"),
|
|
16466
|
-
|
|
16541
|
+
unsubmitAppStoreListing: /* @__PURE__ */ __name(async (_learnCard, listingId) => {
|
|
16542
|
+
await ensureUser();
|
|
16543
|
+
return client.appStore.unsubmitForReview.mutate({ listingId });
|
|
16544
|
+
}, "unsubmitAppStoreListing"),
|
|
16545
|
+
getListingsForIntegration: /* @__PURE__ */ __name(async (_learnCard, integrationId, options2 = {}) => {
|
|
16467
16546
|
await ensureUser();
|
|
16468
16547
|
return client.appStore.getListingsForIntegration.query({
|
|
16469
16548
|
integrationId,
|
|
16470
|
-
...
|
|
16549
|
+
...options2
|
|
16471
16550
|
});
|
|
16472
16551
|
}, "getListingsForIntegration"),
|
|
16473
16552
|
countListingsForIntegration: /* @__PURE__ */ __name(async (_learnCard, integrationId) => {
|
|
16474
16553
|
await ensureUser();
|
|
16475
16554
|
return client.appStore.countListingsForIntegration.query({ integrationId });
|
|
16476
16555
|
}, "countListingsForIntegration"),
|
|
16477
|
-
browseAppStore: /* @__PURE__ */ __name(async (_learnCard,
|
|
16478
|
-
return client.appStore.browseListedApps.query(
|
|
16556
|
+
browseAppStore: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
16557
|
+
return client.appStore.browseListedApps.query(options2);
|
|
16479
16558
|
}, "browseAppStore"),
|
|
16480
16559
|
getPublicAppStoreListing: /* @__PURE__ */ __name(async (_learnCard, listingId) => {
|
|
16481
16560
|
return client.appStore.getPublicListing.query({ listingId });
|
|
@@ -16494,9 +16573,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16494
16573
|
await ensureUser();
|
|
16495
16574
|
return client.appStore.uninstallApp.mutate({ listingId });
|
|
16496
16575
|
}, "uninstallApp"),
|
|
16497
|
-
getInstalledApps: /* @__PURE__ */ __name(async (_learnCard,
|
|
16576
|
+
getInstalledApps: /* @__PURE__ */ __name(async (_learnCard, options2 = {}) => {
|
|
16498
16577
|
await ensureUser();
|
|
16499
|
-
return client.appStore.getInstalledApps.query(
|
|
16578
|
+
return client.appStore.getInstalledApps.query(options2);
|
|
16500
16579
|
}, "getInstalledApps"),
|
|
16501
16580
|
countInstalledApps: /* @__PURE__ */ __name(async (_learnCard) => {
|
|
16502
16581
|
await ensureUser();
|
|
@@ -16506,6 +16585,10 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16506
16585
|
await ensureUser();
|
|
16507
16586
|
return client.appStore.isAppInstalled.query({ listingId });
|
|
16508
16587
|
}, "isAppInstalled"),
|
|
16588
|
+
getMyCredentialsFromApp: /* @__PURE__ */ __name(async (_learnCard, listingId, options2 = {}) => {
|
|
16589
|
+
await ensureUser();
|
|
16590
|
+
return client.appStore.getMyCredentialsFromApp.query({ listingId, ...options2 });
|
|
16591
|
+
}, "getMyCredentialsFromApp"),
|
|
16509
16592
|
isAppStoreAdmin: /* @__PURE__ */ __name(async (_learnCard) => {
|
|
16510
16593
|
await ensureUser();
|
|
16511
16594
|
return client.appStore.isAdmin.query();
|
|
@@ -16521,9 +16604,9 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16521
16604
|
promotionLevel
|
|
16522
16605
|
});
|
|
16523
16606
|
}, "adminUpdatePromotionLevel"),
|
|
16524
|
-
adminGetAllListings: /* @__PURE__ */ __name(async (_learnCard,
|
|
16607
|
+
adminGetAllListings: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
16525
16608
|
await ensureUser();
|
|
16526
|
-
return client.appStore.adminGetAllListings.query(
|
|
16609
|
+
return client.appStore.adminGetAllListings.query(options2);
|
|
16527
16610
|
}, "adminGetAllListings"),
|
|
16528
16611
|
// App Store Boost Management
|
|
16529
16612
|
addBoostToApp: /* @__PURE__ */ __name(async (_learnCard, listingId, boostUri, templateAlias) => {
|
|
@@ -16553,21 +16636,21 @@ async function getLearnCardNetworkPlugin(learnCard, url2, apiToken) {
|
|
|
16553
16636
|
}, "resolveFromLCN"),
|
|
16554
16637
|
getLCNClient: /* @__PURE__ */ __name(() => client, "getLCNClient"),
|
|
16555
16638
|
// Activity
|
|
16556
|
-
getMyActivities: /* @__PURE__ */ __name(async (_learnCard,
|
|
16639
|
+
getMyActivities: /* @__PURE__ */ __name(async (_learnCard, options2 = {}) => {
|
|
16557
16640
|
await ensureUser();
|
|
16558
|
-
return client.activity.getMyActivities.query(
|
|
16641
|
+
return client.activity.getMyActivities.query(options2);
|
|
16559
16642
|
}, "getMyActivities"),
|
|
16560
|
-
getActivityStats: /* @__PURE__ */ __name(async (_learnCard,
|
|
16643
|
+
getActivityStats: /* @__PURE__ */ __name(async (_learnCard, options2 = {}) => {
|
|
16561
16644
|
await ensureUser();
|
|
16562
|
-
return client.activity.getActivityStats.query(
|
|
16645
|
+
return client.activity.getActivityStats.query(options2);
|
|
16563
16646
|
}, "getActivityStats"),
|
|
16564
|
-
getActivity: /* @__PURE__ */ __name(async (_learnCard,
|
|
16647
|
+
getActivity: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
16565
16648
|
await ensureUser();
|
|
16566
|
-
return client.activity.getActivity.query(
|
|
16649
|
+
return client.activity.getActivity.query(options2);
|
|
16567
16650
|
}, "getActivity"),
|
|
16568
|
-
getActivityChain: /* @__PURE__ */ __name(async (_learnCard,
|
|
16651
|
+
getActivityChain: /* @__PURE__ */ __name(async (_learnCard, options2) => {
|
|
16569
16652
|
await ensureUser();
|
|
16570
|
-
return client.activity.getActivityChain.query(
|
|
16653
|
+
return client.activity.getActivityChain.query(options2);
|
|
16571
16654
|
}, "getActivityChain")
|
|
16572
16655
|
}
|
|
16573
16656
|
};
|