@learncard/helpers 1.3.6 → 1.3.7

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.
@@ -956,7 +956,7 @@ export declare const isEncrypted: (item: Record<string, any>) => item is JWE;
956
956
  */
957
957
  export declare const RegExpTransformer: DataTransformer;
958
958
  /**
959
- * Determines if a credential uses VC 2.0 format by checking the @context array
959
+ * Determines if a credential uses VC 2.0 format by checking the context array
960
960
  */
961
961
  export declare const isVC2Format: (credential: UnsignedVC | VC) => boolean;
962
962
  /** Unwraps a boost credential from a CertifiedBoostCredential, if it is one */
@@ -964,7 +964,7 @@ export declare const unwrapBoostCredential: (vc?: VC | UnsignedVC) => any;
964
964
  /**
965
965
  * Checks if a DID is an app-specific did:web
966
966
  *
967
- * App did:webs follow the pattern: did:web:learncard.app:app:<slug>
967
+ * App did:webs follow the pattern: `did:web:learncard.app:app:&lt;slug&gt;`
968
968
  *
969
969
  * @param did - The DID to check
970
970
  * @returns true if the DID is an app did:web, false otherwise
package/dist/helpers.d.ts CHANGED
@@ -956,7 +956,7 @@ export declare const isEncrypted: (item: Record<string, any>) => item is JWE;
956
956
  */
957
957
  export declare const RegExpTransformer: DataTransformer;
958
958
  /**
959
- * Determines if a credential uses VC 2.0 format by checking the @context array
959
+ * Determines if a credential uses VC 2.0 format by checking the context array
960
960
  */
961
961
  export declare const isVC2Format: (credential: UnsignedVC | VC) => boolean;
962
962
  /** Unwraps a boost credential from a CertifiedBoostCredential, if it is one */
@@ -964,7 +964,7 @@ export declare const unwrapBoostCredential: (vc?: VC | UnsignedVC) => any;
964
964
  /**
965
965
  * Checks if a DID is an app-specific did:web
966
966
  *
967
- * App did:webs follow the pattern: did:web:learncard.app:app:<slug>
967
+ * App did:webs follow the pattern: `did:web:learncard.app:app:&lt;slug&gt;`
968
968
  *
969
969
  * @param did - The DID to check
970
970
  * @returns true if the DID is an app did:web, false otherwise
@@ -6,11 +6,7 @@ var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
8
  var __commonJS = (cb, mod) => function __require() {
9
- try {
10
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
- } catch (e) {
12
- throw mod = 0, e;
13
- }
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
10
  };
15
11
  var __export = (target, all) => {
16
12
  for (var name in all)
@@ -17354,7 +17350,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17354
17350
  includePersonalData: external_exports.boolean().optional().default(false),
17355
17351
  format: external_exports.enum(["prompt", "structured"]).optional().default("prompt"),
17356
17352
  instructions: external_exports.string().optional(),
17357
- detailLevel: external_exports.enum(["compact", "expanded"]).optional().default("compact")
17353
+ detailLevel: external_exports.enum(["compact", "expanded"]).optional().default("compact"),
17354
+ waitForSync: external_exports.boolean().optional().default(false)
17358
17355
  });
17359
17356
  var SummaryCredentialKeywordValidator = external_exports.object({
17360
17357
  occupations: external_exports.array(external_exports.string()).nullable(),
@@ -17571,7 +17568,7 @@ var getFileType = /* @__PURE__ */ __name(async (url) => {
17571
17568
  const handle = getFilestackHandle(url);
17572
17569
  try {
17573
17570
  const data = await (await fetch(`https://www.filestackapi.com/api/file/${handle}/metadata`)).json();
17574
- return data.mimetype;
17571
+ return data.mimetype ?? "";
17575
17572
  } catch (error) {
17576
17573
  console.error(error);
17577
17574
  return "";
@@ -18389,7 +18386,9 @@ var isVC2Format = /* @__PURE__ */ __name((credential) => {
18389
18386
  if (!credential["@context"] || !Array.isArray(credential["@context"])) {
18390
18387
  return false;
18391
18388
  }
18392
- return credential["@context"].includes("https://www.w3.org/ns/credentials/v2");
18389
+ return credential["@context"].some(
18390
+ (context) => context === "https://www.w3.org/ns/credentials/v2"
18391
+ );
18393
18392
  }, "isVC2Format");
18394
18393
  var unwrapBoostCredential = /* @__PURE__ */ __name((vc) => {
18395
18394
  if (vc?.type?.includes("CertifiedBoostCredential") && vc?.boostCredential) {