@learncard/helpers 1.3.6 → 1.3.8
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/README.md +5 -5
- package/dist/helpers.cjs.development.cjs +8 -9
- package/dist/helpers.cjs.development.cjs.map +2 -2
- package/dist/helpers.cjs.production.min.cjs +3 -3
- package/dist/helpers.cjs.production.min.cjs.map +3 -3
- package/dist/helpers.d.cts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/helpers.esm.js +7 -8
- package/dist/helpers.esm.js.map +2 -2
- package/package.json +68 -66
- package/src/Utilities.ts +71 -0
- package/src/app-install/index.ts +168 -0
- package/src/arrays/index.ts +20 -0
- package/src/bitstring-status-list/index.ts +69 -0
- package/src/credential-format.ts +508 -0
- package/src/images/discord.helpers.ts +103 -0
- package/src/images/filestack.helpers.ts +179 -0
- package/src/images/images.helpers.ts +75 -0
- package/src/images/index.ts +1 -0
- package/src/images/unsplash.helpers.ts +110 -0
- package/src/images/url.helpers.ts +46 -0
- package/src/index.ts +105 -0
- package/src/numbers/index.ts +21 -0
- package/src/state.ts +576 -0
- package/src/strings/index.ts +4 -0
- package/src/types/index.ts +5 -0
package/dist/helpers.d.cts
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
|
|
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
|
|
967
|
+
* App did:webs follow the pattern: `did:web:learncard.app:app:<slug>`
|
|
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
|
|
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
|
|
967
|
+
* App did:webs follow the pattern: `did:web:learncard.app:app:<slug>`
|
|
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.esm.js
CHANGED
|
@@ -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
|
-
|
|
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"].
|
|
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) {
|