@learncard/network-brain-client 2.5.33 → 2.5.35

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @learncard/network-brain-client
2
2
 
3
+ ## 2.5.35
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`fca17b1105b01812db1bce659970a3d9bdb4b56e`](https://github.com/learningeconomy/LearnCard/commit/fca17b1105b01812db1bce659970a3d9bdb4b56e)]:
8
+ - @learncard/network-brain-service@3.15.1
9
+
10
+ ## 2.5.34
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`773bbd425d2e87796d5d713450397723e3c21c71`](https://github.com/learningeconomy/LearnCard/commit/773bbd425d2e87796d5d713450397723e3c21c71), [`b61cfb80e80f382b22d673e7e826fc60528161e7`](https://github.com/learningeconomy/LearnCard/commit/b61cfb80e80f382b22d673e7e826fc60528161e7), [`5d402748c33bbe4f23aa38f45953d03274f38b65`](https://github.com/learningeconomy/LearnCard/commit/5d402748c33bbe4f23aa38f45953d03274f38b65)]:
15
+ - @learncard/network-brain-service@3.15.0
16
+
3
17
  ## 2.5.33
4
18
 
5
19
  ### Patch Changes
@@ -100,6 +100,8 @@ var require_helpers_cjs_development = __commonJS({
100
100
  AgeRatingValidator: /* @__PURE__ */ __name2(() => AgeRatingValidator, "AgeRatingValidator"),
101
101
  AlignmentTargetTypeValidator: /* @__PURE__ */ __name2(() => AlignmentTargetTypeValidator, "AlignmentTargetTypeValidator"),
102
102
  AlignmentValidator: /* @__PURE__ */ __name2(() => AlignmentValidator, "AlignmentValidator"),
103
+ AllocateCredentialStatusInputValidator: /* @__PURE__ */ __name2(() => AllocateCredentialStatusInputValidator, "AllocateCredentialStatusInputValidator"),
104
+ AllocatedBitstringStatusListEntryValidator: /* @__PURE__ */ __name2(() => AllocatedBitstringStatusListEntryValidator, "AllocatedBitstringStatusListEntryValidator"),
103
105
  AllowConnectionRequestsEnum: /* @__PURE__ */ __name2(() => AllowConnectionRequestsEnum, "AllowConnectionRequestsEnum"),
104
106
  AppBoostValidator: /* @__PURE__ */ __name2(() => AppBoostValidator, "AppBoostValidator"),
105
107
  AppEventInputValidator: /* @__PURE__ */ __name2(() => AppEventInputValidator, "AppEventInputValidator"),
@@ -117,6 +119,10 @@ var require_helpers_cjs_development = __commonJS({
117
119
  AuthGrantValidator: /* @__PURE__ */ __name2(() => AuthGrantValidator, "AuthGrantValidator"),
118
120
  AuthSessionError: /* @__PURE__ */ __name2(() => AuthSessionError, "AuthSessionError"),
119
121
  AutoBoostConfigValidator: /* @__PURE__ */ __name2(() => AutoBoostConfigValidator, "AutoBoostConfigValidator"),
122
+ BITSTRING_STATUS_PURPOSES: /* @__PURE__ */ __name2(() => BITSTRING_STATUS_PURPOSES, "BITSTRING_STATUS_PURPOSES"),
123
+ BitstringStatusListCredentialSubjectValidator: /* @__PURE__ */ __name2(() => BitstringStatusListCredentialSubjectValidator, "BitstringStatusListCredentialSubjectValidator"),
124
+ BitstringStatusListEntryValidator: /* @__PURE__ */ __name2(() => BitstringStatusListEntryValidator, "BitstringStatusListEntryValidator"),
125
+ BitstringStatusPurposeValidator: /* @__PURE__ */ __name2(() => BitstringStatusPurposeValidator, "BitstringStatusPurposeValidator"),
120
126
  BoostPermissionsQueryValidator: /* @__PURE__ */ __name2(() => BoostPermissionsQueryValidator, "BoostPermissionsQueryValidator"),
121
127
  BoostPermissionsValidator: /* @__PURE__ */ __name2(() => BoostPermissionsValidator, "BoostPermissionsValidator"),
122
128
  BoostQueryValidator: /* @__PURE__ */ __name2(() => BoostQueryValidator, "BoostQueryValidator"),
@@ -178,6 +184,7 @@ var require_helpers_cjs_development = __commonJS({
178
184
  CredentialStatusValidator: /* @__PURE__ */ __name2(() => CredentialStatusValidator, "CredentialStatusValidator"),
179
185
  CredentialSubjectValidator: /* @__PURE__ */ __name2(() => CredentialSubjectValidator, "CredentialSubjectValidator"),
180
186
  CriteriaValidator: /* @__PURE__ */ __name2(() => CriteriaValidator, "CriteriaValidator"),
187
+ DEFAULT_BITSTRING_STATUS_LIST_SIZE: /* @__PURE__ */ __name2(() => DEFAULT_BITSTRING_STATUS_LIST_SIZE, "DEFAULT_BITSTRING_STATUS_LIST_SIZE"),
181
188
  DeleteFrameworkInputValidator: /* @__PURE__ */ __name2(() => DeleteFrameworkInputValidator, "DeleteFrameworkInputValidator"),
182
189
  DeleteSkillInputValidator: /* @__PURE__ */ __name2(() => DeleteSkillInputValidator, "DeleteSkillInputValidator"),
183
190
  DidDocumentValidator: /* @__PURE__ */ __name2(() => DidDocumentValidator, "DidDocumentValidator"),
@@ -277,6 +284,7 @@ var require_helpers_cjs_development = __commonJS({
277
284
  RefreshServiceValidator: /* @__PURE__ */ __name2(() => RefreshServiceValidator, "RefreshServiceValidator"),
278
285
  RegExpValidator: /* @__PURE__ */ __name2(() => RegExpValidator, "RegExpValidator"),
279
286
  RelatedValidator: /* @__PURE__ */ __name2(() => RelatedValidator, "RelatedValidator"),
287
+ RenderMethodValidator: /* @__PURE__ */ __name2(() => RenderMethodValidator, "RenderMethodValidator"),
280
288
  ReplaceSkillFrameworkSkillsInputValidator: /* @__PURE__ */ __name2(() => ReplaceSkillFrameworkSkillsInputValidator, "ReplaceSkillFrameworkSkillsInputValidator"),
281
289
  ReplaceSkillFrameworkSkillsResultValidator: /* @__PURE__ */ __name2(() => ReplaceSkillFrameworkSkillsResultValidator, "ReplaceSkillFrameworkSkillsResultValidator"),
282
290
  RequestLearnerContextEventValidator: /* @__PURE__ */ __name2(() => RequestLearnerContextEventValidator, "RequestLearnerContextEventValidator"),
@@ -313,11 +321,13 @@ var require_helpers_cjs_development = __commonJS({
313
321
  SkillTreeNodeInputValidator: /* @__PURE__ */ __name2(() => SkillTreeNodeInputValidator, "SkillTreeNodeInputValidator"),
314
322
  SkillTreeNodeValidator: /* @__PURE__ */ __name2(() => SkillTreeNodeValidator, "SkillTreeNodeValidator"),
315
323
  SkillValidator: /* @__PURE__ */ __name2(() => SkillValidator, "SkillValidator"),
324
+ StatusCheckEntryValidator: /* @__PURE__ */ __name2(() => StatusCheckEntryValidator, "StatusCheckEntryValidator"),
316
325
  StringQuery: /* @__PURE__ */ __name2(() => StringQuery, "StringQuery"),
317
326
  SummaryCredentialDataValidator: /* @__PURE__ */ __name2(() => SummaryCredentialDataValidator, "SummaryCredentialDataValidator"),
318
327
  SummaryCredentialKeywordValidator: /* @__PURE__ */ __name2(() => SummaryCredentialKeywordValidator, "SummaryCredentialKeywordValidator"),
319
328
  SyncFrameworkInputValidator: /* @__PURE__ */ __name2(() => SyncFrameworkInputValidator, "SyncFrameworkInputValidator"),
320
329
  TagValidator: /* @__PURE__ */ __name2(() => TagValidator, "TagValidator"),
330
+ TemplateRenderMethodValidator: /* @__PURE__ */ __name2(() => TemplateRenderMethodValidator, "TemplateRenderMethodValidator"),
321
331
  TermsOfUseValidator: /* @__PURE__ */ __name2(() => TermsOfUseValidator, "TermsOfUseValidator"),
322
332
  UnsignedAchievementCredentialValidator: /* @__PURE__ */ __name2(() => UnsignedAchievementCredentialValidator, "UnsignedAchievementCredentialValidator"),
323
333
  UnsignedClrCredentialValidator: /* @__PURE__ */ __name2(() => UnsignedClrCredentialValidator, "UnsignedClrCredentialValidator"),
@@ -14219,6 +14229,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14219
14229
  genre: external_exports.string().optional(),
14220
14230
  audience: external_exports.string().optional()
14221
14231
  }).catchall(external_exports.any());
14232
+ var TemplateRenderMethodValidator = external_exports.object({
14233
+ type: external_exports.literal("TemplateRenderMethod"),
14234
+ renderSuite: external_exports.string(),
14235
+ template: external_exports.string(),
14236
+ renderProperty: external_exports.array(external_exports.string()).optional(),
14237
+ outputPreference: external_exports.object({
14238
+ mediaType: external_exports.string()
14239
+ }).optional()
14240
+ });
14241
+ var RenderMethodValidator = external_exports.union([
14242
+ TemplateRenderMethodValidator,
14243
+ external_exports.record(external_exports.string(), external_exports.any())
14244
+ ]);
14222
14245
  var UnsignedVCValidator = external_exports.object({
14223
14246
  "@context": ContextValidator,
14224
14247
  id: external_exports.string().optional(),
@@ -14242,7 +14265,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14242
14265
  validUntil: external_exports.string().optional(),
14243
14266
  status: CredentialStatusValidator.or(CredentialStatusValidator.array()).optional(),
14244
14267
  termsOfUse: TermsOfUseValidator.or(TermsOfUseValidator.array()).optional(),
14245
- evidence: external_exports.union([VC2EvidenceValidator, external_exports.array(VC2EvidenceValidator)]).optional()
14268
+ evidence: external_exports.union([VC2EvidenceValidator, external_exports.array(VC2EvidenceValidator)]).optional(),
14269
+ renderMethod: external_exports.union([RenderMethodValidator, external_exports.array(RenderMethodValidator)]).optional()
14246
14270
  }).catchall(external_exports.any());
14247
14271
  var ProofValidator = external_exports.object({
14248
14272
  type: external_exports.string(),
@@ -14550,10 +14574,45 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14550
14574
  var ClrCredentialValidator = UnsignedClrCredentialValidator.extend({
14551
14575
  proof: ProofValidator.or(ProofValidator.array())
14552
14576
  });
14577
+ var StatusCheckEntryValidator = external_exports.object({
14578
+ /**
14579
+ * The `credentialStatus.type` as it appeared on the credential.
14580
+ * One of `BitstringStatusListEntry`, `StatusList2021Entry`,
14581
+ * `RevocationList2020Status`, or any future custom status type.
14582
+ */
14583
+ entryType: external_exports.string(),
14584
+ /**
14585
+ * The claimed purpose of the entry. Standard values are
14586
+ * `"revocation"` and `"suspension"`; the spec allows arbitrary
14587
+ * strings.
14588
+ */
14589
+ statusPurpose: external_exports.string(),
14590
+ /**
14591
+ * Whether the bit at the credential's index in the status list
14592
+ * bitstring was set.
14593
+ */
14594
+ isSet: external_exports.boolean(),
14595
+ /** URL of the status list credential, when known. */
14596
+ statusListCredential: external_exports.string().optional(),
14597
+ /** Original (string) index within the status list. */
14598
+ statusListIndex: external_exports.string().optional()
14599
+ });
14553
14600
  var VerificationCheckValidator = external_exports.object({
14554
14601
  checks: external_exports.string().array(),
14555
14602
  warnings: external_exports.string().array(),
14556
- errors: external_exports.string().array()
14603
+ errors: external_exports.string().array(),
14604
+ /**
14605
+ * Per-entry results for the `credentialStatus` check, populated
14606
+ * by `@learncard/didkit-plugin` when the verified credential
14607
+ * carries one or more `credentialStatus` entries. Empty / absent
14608
+ * for credentials without a status entry.
14609
+ *
14610
+ * Marked `.optional()` because the underlying `ssi-ldp`
14611
+ * serializer omits the field when empty (`skip_serializing_if`),
14612
+ * so older WASM builds that pre-date the structured-status
14613
+ * change still validate against this schema.
14614
+ */
14615
+ status: StatusCheckEntryValidator.array().optional()
14557
14616
  });
14558
14617
  var VerificationStatusValidator = external_exports.enum(["Success", "Failed", "Error"]);
14559
14618
  var VerificationStatusEnum = VerificationStatusValidator.enum;
@@ -15964,6 +16023,29 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15964
16023
  __name22(this, "AuthSessionError");
15965
16024
  }
15966
16025
  };
16026
+ var BITSTRING_STATUS_PURPOSES = ["revocation", "suspension"];
16027
+ var DEFAULT_BITSTRING_STATUS_LIST_SIZE = 131072;
16028
+ var BitstringStatusPurposeValidator = external_exports.enum(BITSTRING_STATUS_PURPOSES);
16029
+ var BitstringStatusListEntryValidator = external_exports.object({
16030
+ id: external_exports.string().optional(),
16031
+ type: external_exports.literal("BitstringStatusListEntry"),
16032
+ statusPurpose: BitstringStatusPurposeValidator,
16033
+ statusListIndex: external_exports.string(),
16034
+ statusListCredential: external_exports.string()
16035
+ });
16036
+ var AllocatedBitstringStatusListEntryValidator = BitstringStatusListEntryValidator.extend({
16037
+ id: external_exports.string()
16038
+ });
16039
+ var BitstringStatusListCredentialSubjectValidator = external_exports.object({
16040
+ id: external_exports.string().optional(),
16041
+ type: external_exports.literal("BitstringStatusList"),
16042
+ statusPurpose: BitstringStatusPurposeValidator,
16043
+ encodedList: external_exports.string()
16044
+ });
16045
+ var AllocateCredentialStatusInputValidator = external_exports.object({
16046
+ statusPurposes: external_exports.array(BitstringStatusPurposeValidator).optional(),
16047
+ listSize: external_exports.number().int().positive().optional()
16048
+ }).default({});
15967
16049
  }
15968
16050
  });
15969
16051
  var require_dist2 = __commonJS2({
@@ -15999,6 +16081,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15999
16081
  fixUrl: /* @__PURE__ */ __name(() => fixUrl4, "fixUrl"),
16000
16082
  formatNumber: /* @__PURE__ */ __name(() => formatNumber, "formatNumber"),
16001
16083
  generateSrcSet: /* @__PURE__ */ __name(() => generateSrcSet4, "generateSrcSet"),
16084
+ getBitstringStatusListBit: /* @__PURE__ */ __name(() => getBitstringStatusListBit, "getBitstringStatusListBit"),
16085
+ getBitstringStatusListEntries: /* @__PURE__ */ __name(() => getBitstringStatusListEntries, "getBitstringStatusListEntries"),
16086
+ getBitstringStatusListEntryForPurpose: /* @__PURE__ */ __name(() => getBitstringStatusListEntryForPurpose, "getBitstringStatusListEntryForPurpose"),
16087
+ getCredentialStatusArray: /* @__PURE__ */ __name(() => getCredentialStatusArray, "getCredentialStatusArray"),
16002
16088
  getProvider: /* @__PURE__ */ __name(() => getProvider, "getProvider"),
16003
16089
  getUrlsFromSrcSet: /* @__PURE__ */ __name(() => getUrlsFromSrcSet, "getUrlsFromSrcSet"),
16004
16090
  immerArraySlice: /* @__PURE__ */ __name(() => immerArraySlice, "immerArraySlice"),
@@ -16007,6 +16093,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16007
16093
  innerReactOuterImmer: /* @__PURE__ */ __name(() => innerReactOuterImmer, "innerReactOuterImmer"),
16008
16094
  innerReactOuterReact: /* @__PURE__ */ __name(() => innerReactOuterReact, "innerReactOuterReact"),
16009
16095
  isAppDidWeb: /* @__PURE__ */ __name(() => isAppDidWeb, "isAppDidWeb"),
16096
+ isBitstringStatusListEntry: /* @__PURE__ */ __name(() => isBitstringStatusListEntry, "isBitstringStatusListEntry"),
16010
16097
  isEncrypted: /* @__PURE__ */ __name(() => isEncrypted, "isEncrypted"),
16011
16098
  isHex: /* @__PURE__ */ __name(() => isHex, "isHex"),
16012
16099
  isNotMaybe: /* @__PURE__ */ __name(() => isNotMaybe, "isNotMaybe"),
@@ -16014,6 +16101,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16014
16101
  isVC2Format: /* @__PURE__ */ __name(() => isVC2Format, "isVC2Format"),
16015
16102
  quantizeValue: /* @__PURE__ */ __name(() => quantizeValue, "quantizeValue"),
16016
16103
  resizeAndChangeQuality: /* @__PURE__ */ __name(() => resizeAndChangeQuality4, "resizeAndChangeQuality"),
16104
+ setBitstringStatusListBit: /* @__PURE__ */ __name(() => setBitstringStatusListBit, "setBitstringStatusListBit"),
16017
16105
  unwrapBoostCredential: /* @__PURE__ */ __name(() => unwrapBoostCredential, "unwrapBoostCredential")
16018
16106
  });
16019
16107
  module2.exports = __toCommonJS2(index_exports2);
@@ -16811,6 +16899,43 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16811
16899
  if (!value) return updateSlice(index);
16812
16900
  return updateSlice(index, value);
16813
16901
  }), "immerArraySlice");
16902
+ var getCredentialStatusArray = /* @__PURE__ */ __name2((credential) => {
16903
+ if (!credential || typeof credential !== "object" || Array.isArray(credential)) return [];
16904
+ const status = credential.credentialStatus;
16905
+ if (!status) return [];
16906
+ return Array.isArray(status) ? status : [status];
16907
+ }, "getCredentialStatusArray");
16908
+ var isBitstringStatusListEntry = /* @__PURE__ */ __name2((status) => {
16909
+ if (!status || typeof status !== "object") return false;
16910
+ const record = status;
16911
+ return record.type === "BitstringStatusListEntry" && (record.statusPurpose === "revocation" || record.statusPurpose === "suspension") && typeof record.statusListIndex === "string" && typeof record.statusListCredential === "string";
16912
+ }, "isBitstringStatusListEntry");
16913
+ var getBitstringStatusListEntries = /* @__PURE__ */ __name2((credential) => {
16914
+ if (!credential || typeof credential !== "object" || Array.isArray(credential)) return [];
16915
+ const record = credential;
16916
+ const statuses = getCredentialStatusArray(record);
16917
+ return [
16918
+ ...statuses.filter(isBitstringStatusListEntry),
16919
+ ...getBitstringStatusListEntries(record.boostCredential)
16920
+ ];
16921
+ }, "getBitstringStatusListEntries");
16922
+ var getBitstringStatusListEntryForPurpose = /* @__PURE__ */ __name2((credential, statusPurpose) => getBitstringStatusListEntries(credential).find((entry) => entry.statusPurpose === statusPurpose), "getBitstringStatusListEntryForPurpose");
16923
+ var getBitstringStatusListBit = /* @__PURE__ */ __name2((bitstring, index) => {
16924
+ if (!Number.isInteger(index) || index < 0) {
16925
+ throw new Error("Bitstring status list index is out of range");
16926
+ }
16927
+ const byte = bitstring[Math.floor(index / 8)] ?? 0;
16928
+ return (byte & 1 << index % 8) !== 0;
16929
+ }, "getBitstringStatusListBit");
16930
+ var setBitstringStatusListBit = /* @__PURE__ */ __name2((bitstring, index, value) => {
16931
+ if (!Number.isInteger(index) || index < 0 || index >= bitstring.length * 8) {
16932
+ throw new Error("Bitstring status list index is out of range");
16933
+ }
16934
+ const byteIndex = Math.floor(index / 8);
16935
+ const mask = 1 << index % 8;
16936
+ const current = bitstring[byteIndex] ?? 0;
16937
+ bitstring[byteIndex] = value ? current | mask : current & ~mask;
16938
+ }, "setBitstringStatusListBit");
16814
16939
  var import_zod = require("zod");
16815
16940
  var ImageResizingValidator = import_zod.z.object({ type: import_zod.z.literal("resizing") });
16816
16941
  var ImageUploadingValidator = import_zod.z.object({