@learncard/network-brain-client 2.5.62 → 2.5.63
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/brain-client.cjs.development.cjs +1418 -1315
- package/dist/brain-client.cjs.development.cjs.map +2 -2
- package/dist/brain-client.cjs.production.min.cjs +14 -14
- package/dist/brain-client.cjs.production.min.cjs.map +3 -3
- package/dist/brain-client.esm.js +59 -5
- package/dist/brain-client.esm.js.map +3 -3
- package/dist/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +13 -5
package/dist/brain-client.esm.js
CHANGED
|
@@ -16104,6 +16104,7 @@ var require_types_cjs_development = __commonJS({
|
|
|
16104
16104
|
FlatAuthGrantValidator: /* @__PURE__ */ __name2(() => FlatAuthGrantValidator, "FlatAuthGrantValidator"),
|
|
16105
16105
|
FrameworkWithSkillsValidator: /* @__PURE__ */ __name2(() => FrameworkWithSkillsValidator, "FrameworkWithSkillsValidator"),
|
|
16106
16106
|
FullClaimHookValidator: /* @__PURE__ */ __name2(() => FullClaimHookValidator, "FullClaimHookValidator"),
|
|
16107
|
+
GenerateSkillIconsInputValidator: /* @__PURE__ */ __name2(() => GenerateSkillIconsInputValidator, "GenerateSkillIconsInputValidator"),
|
|
16107
16108
|
GeoCoordinatesValidator: /* @__PURE__ */ __name2(() => GeoCoordinatesValidator, "GeoCoordinatesValidator"),
|
|
16108
16109
|
GetCounterEventValidator: /* @__PURE__ */ __name2(() => GetCounterEventValidator, "GetCounterEventValidator"),
|
|
16109
16110
|
GetCountersEventValidator: /* @__PURE__ */ __name2(() => GetCountersEventValidator, "GetCountersEventValidator"),
|
|
@@ -16264,6 +16265,8 @@ var require_types_cjs_development = __commonJS({
|
|
|
16264
16265
|
SHARE_RECOVERY_PROTOCOL: /* @__PURE__ */ __name2(() => SHARE_RECOVERY_PROTOCOL, "SHARE_RECOVERY_PROTOCOL"),
|
|
16265
16266
|
SHARE_TAG_BYTES: /* @__PURE__ */ __name2(() => SHARE_TAG_BYTES, "SHARE_TAG_BYTES"),
|
|
16266
16267
|
SHARE_VIEW_RECEIPT_TTL_SECONDS: /* @__PURE__ */ __name2(() => SHARE_VIEW_RECEIPT_TTL_SECONDS, "SHARE_VIEW_RECEIPT_TTL_SECONDS"),
|
|
16268
|
+
SKILL_ICON_MAX_CHARACTERS_PER_REQUEST: /* @__PURE__ */ __name2(() => SKILL_ICON_MAX_CHARACTERS_PER_REQUEST, "SKILL_ICON_MAX_CHARACTERS_PER_REQUEST"),
|
|
16269
|
+
SKILL_ICON_MAX_NAMES_PER_REQUEST: /* @__PURE__ */ __name2(() => SKILL_ICON_MAX_NAMES_PER_REQUEST, "SKILL_ICON_MAX_NAMES_PER_REQUEST"),
|
|
16267
16270
|
SendAiSessionCredentialEventValidator: /* @__PURE__ */ __name2(() => SendAiSessionCredentialEventValidator, "SendAiSessionCredentialEventValidator"),
|
|
16268
16271
|
SendBoostInputValidator: /* @__PURE__ */ __name2(() => SendBoostInputValidator, "SendBoostInputValidator"),
|
|
16269
16272
|
SendBoostResponseValidator: /* @__PURE__ */ __name2(() => SendBoostResponseValidator, "SendBoostResponseValidator"),
|
|
@@ -16316,6 +16319,7 @@ var require_types_cjs_development = __commonJS({
|
|
|
16316
16319
|
SkillFrameworkQueryValidator: /* @__PURE__ */ __name2(() => SkillFrameworkQueryValidator, "SkillFrameworkQueryValidator"),
|
|
16317
16320
|
SkillFrameworkStatusEnum: /* @__PURE__ */ __name2(() => SkillFrameworkStatusEnum, "SkillFrameworkStatusEnum"),
|
|
16318
16321
|
SkillFrameworkValidator: /* @__PURE__ */ __name2(() => SkillFrameworkValidator, "SkillFrameworkValidator"),
|
|
16322
|
+
SkillIconNamesValidator: /* @__PURE__ */ __name2(() => SkillIconNamesValidator, "SkillIconNamesValidator"),
|
|
16319
16323
|
SkillQueryValidator: /* @__PURE__ */ __name2(() => SkillQueryValidator, "SkillQueryValidator"),
|
|
16320
16324
|
SkillSemanticSearchInputValidator: /* @__PURE__ */ __name2(() => SkillSemanticSearchInputValidator, "SkillSemanticSearchInputValidator"),
|
|
16321
16325
|
SkillSemanticSearchResultItemValidator: /* @__PURE__ */ __name2(() => SkillSemanticSearchResultItemValidator, "SkillSemanticSearchResultItemValidator"),
|
|
@@ -30831,7 +30835,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
30831
30835
|
};
|
|
30832
30836
|
return new ZodObject2(def);
|
|
30833
30837
|
}
|
|
30834
|
-
__name(object2, "
|
|
30838
|
+
__name(object2, "object2");
|
|
30835
30839
|
__name2(object2, "object");
|
|
30836
30840
|
__name22(object2, "object");
|
|
30837
30841
|
function strictObject2(shape, params) {
|
|
@@ -32505,6 +32509,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
32505
32509
|
term: external_exports2.string().optional()
|
|
32506
32510
|
}).catchall(external_exports2.any());
|
|
32507
32511
|
var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
|
|
32512
|
+
awardedDate: external_exports2.string().optional(),
|
|
32508
32513
|
name: external_exports2.string().optional(),
|
|
32509
32514
|
description: external_exports2.string().optional(),
|
|
32510
32515
|
image: ImageValidator.optional(),
|
|
@@ -35367,6 +35372,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
35367
35372
|
contentUrl: external_exports2.string(),
|
|
35368
35373
|
receipt: external_exports2.string().min(22).max(128).regex(/^[A-Za-z0-9_-]+$/)
|
|
35369
35374
|
}).strict();
|
|
35375
|
+
var SKILL_ICON_MAX_NAMES_PER_REQUEST = 100;
|
|
35376
|
+
var SKILL_ICON_MAX_CHARACTERS_PER_REQUEST = 2500;
|
|
35377
|
+
var SkillIconNamesValidator = external_exports2.array(external_exports2.string().nonempty()).min(1).max(SKILL_ICON_MAX_NAMES_PER_REQUEST, {
|
|
35378
|
+
message: `A maximum of ${SKILL_ICON_MAX_NAMES_PER_REQUEST} skill names can be sent per request`
|
|
35379
|
+
}).refine(
|
|
35380
|
+
(names) => names.reduce((total, name) => total + name.length, 0) <= SKILL_ICON_MAX_CHARACTERS_PER_REQUEST,
|
|
35381
|
+
{
|
|
35382
|
+
message: `Skill names may total at most ${SKILL_ICON_MAX_CHARACTERS_PER_REQUEST} characters per request`
|
|
35383
|
+
}
|
|
35384
|
+
);
|
|
35385
|
+
var GenerateSkillIconsInputValidator = external_exports2.object({ names: SkillIconNamesValidator });
|
|
35370
35386
|
}
|
|
35371
35387
|
});
|
|
35372
35388
|
var require_dist = __commonJS({
|
|
@@ -35719,6 +35735,19 @@ var ShareContentCanonicalizationError = class extends Error {
|
|
|
35719
35735
|
__name2(this, "ShareContentCanonicalizationError");
|
|
35720
35736
|
}
|
|
35721
35737
|
};
|
|
35738
|
+
var CredentialFieldError = class extends Error {
|
|
35739
|
+
static {
|
|
35740
|
+
__name(this, "CredentialFieldError");
|
|
35741
|
+
}
|
|
35742
|
+
constructor(field) {
|
|
35743
|
+
super(`Invalid standard credential field: ${field}`);
|
|
35744
|
+
this.field = field;
|
|
35745
|
+
this.name = "CredentialFieldError";
|
|
35746
|
+
}
|
|
35747
|
+
static {
|
|
35748
|
+
__name2(this, "CredentialFieldError");
|
|
35749
|
+
}
|
|
35750
|
+
};
|
|
35722
35751
|
var RegExpTransformer = {
|
|
35723
35752
|
serialize(object2) {
|
|
35724
35753
|
return JSON.stringify(object2, (_key, value) => {
|
|
@@ -36032,6 +36061,26 @@ function createChain(opts) {
|
|
|
36032
36061
|
});
|
|
36033
36062
|
}
|
|
36034
36063
|
__name(createChain, "createChain");
|
|
36064
|
+
function asArray(value) {
|
|
36065
|
+
return Array.isArray(value) ? value : [value];
|
|
36066
|
+
}
|
|
36067
|
+
__name(asArray, "asArray");
|
|
36068
|
+
function splitLink(opts) {
|
|
36069
|
+
return (runtime) => {
|
|
36070
|
+
const yes = asArray(opts.true).map((link) => link(runtime));
|
|
36071
|
+
const no = asArray(opts.false).map((link) => link(runtime));
|
|
36072
|
+
return (props) => {
|
|
36073
|
+
return observable((observer) => {
|
|
36074
|
+
const links = opts.condition(props.op) ? yes : no;
|
|
36075
|
+
return createChain({
|
|
36076
|
+
op: props.op,
|
|
36077
|
+
links
|
|
36078
|
+
}).subscribe(observer);
|
|
36079
|
+
});
|
|
36080
|
+
};
|
|
36081
|
+
};
|
|
36082
|
+
}
|
|
36083
|
+
__name(splitLink, "splitLink");
|
|
36035
36084
|
|
|
36036
36085
|
// ../../../node_modules/@trpc/server/dist/utils-CLZnJdb_.mjs
|
|
36037
36086
|
var TRPC_ERROR_CODES_BY_KEY = {
|
|
@@ -37174,11 +37223,16 @@ var callbackLink = /* @__PURE__ */ __name((callback) => {
|
|
|
37174
37223
|
}, "callbackLink");
|
|
37175
37224
|
|
|
37176
37225
|
// src/index.ts
|
|
37226
|
+
var isolatedInboxBatchLink = /* @__PURE__ */ __name((options) => splitLink({
|
|
37227
|
+
condition: /* @__PURE__ */ __name((operation) => operation.path === "inbox.issueBatch", "condition"),
|
|
37228
|
+
true: httpBatchLink({ ...options, maxItems: 1 }),
|
|
37229
|
+
false: httpBatchLink(options)
|
|
37230
|
+
}), "isolatedInboxBatchLink");
|
|
37177
37231
|
var getClient = /* @__PURE__ */ __name(async (url2, didAuthFunction, guardianApprovalGetter, extraHeaders) => {
|
|
37178
37232
|
let challenges = [];
|
|
37179
37233
|
const challengeRequester = createTRPCClient({
|
|
37180
37234
|
links: [
|
|
37181
|
-
|
|
37235
|
+
isolatedInboxBatchLink({
|
|
37182
37236
|
methodOverride: "POST",
|
|
37183
37237
|
url: url2,
|
|
37184
37238
|
maxURLLength: 3072,
|
|
@@ -37215,7 +37269,7 @@ var getClient = /* @__PURE__ */ __name(async (url2, didAuthFunction, guardianApp
|
|
|
37215
37269
|
callbackLink(async () => {
|
|
37216
37270
|
challenges = await getChallenges();
|
|
37217
37271
|
}),
|
|
37218
|
-
|
|
37272
|
+
isolatedInboxBatchLink({
|
|
37219
37273
|
methodOverride: "POST",
|
|
37220
37274
|
maxURLLength: 3072,
|
|
37221
37275
|
url: url2,
|
|
@@ -37240,7 +37294,7 @@ var getClient = /* @__PURE__ */ __name(async (url2, didAuthFunction, guardianApp
|
|
|
37240
37294
|
var getApiTokenClient = /* @__PURE__ */ __name(async (url2, apiToken, guardianApprovalGetter, extraHeaders) => {
|
|
37241
37295
|
const trpc = createTRPCClient({
|
|
37242
37296
|
links: [
|
|
37243
|
-
|
|
37297
|
+
isolatedInboxBatchLink({
|
|
37244
37298
|
methodOverride: "POST",
|
|
37245
37299
|
url: url2,
|
|
37246
37300
|
maxURLLength: 3072,
|
|
@@ -37263,7 +37317,7 @@ var getApiTokenClient = /* @__PURE__ */ __name(async (url2, apiToken, guardianAp
|
|
|
37263
37317
|
}, "getApiTokenClient");
|
|
37264
37318
|
var getAnonymousClient = /* @__PURE__ */ __name((url2) => createTRPCClient({
|
|
37265
37319
|
links: [
|
|
37266
|
-
|
|
37320
|
+
isolatedInboxBatchLink({
|
|
37267
37321
|
methodOverride: "POST",
|
|
37268
37322
|
url: url2,
|
|
37269
37323
|
maxURLLength: 3072,
|