@learncard/helpers 1.3.9 → 1.3.11
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/helpers.cjs.development.cjs +1997 -1831
- package/dist/helpers.cjs.development.cjs.map +3 -3
- package/dist/helpers.cjs.production.min.cjs +25 -25
- package/dist/helpers.cjs.production.min.cjs.map +4 -4
- package/dist/helpers.d.cts +14 -9
- package/dist/helpers.d.ts +14 -9
- package/dist/helpers.esm.js +145 -5
- package/dist/helpers.esm.js.map +3 -3
- package/package.json +2 -2
- package/src/bitstring-status-list/index.ts +5 -1
- package/src/did.ts +12 -0
- package/src/index.ts +1 -0
package/dist/helpers.d.cts
CHANGED
|
@@ -130,11 +130,11 @@ declare const UnsignedVCValidator: z.ZodObject<{
|
|
|
130
130
|
credentialStatus: z.ZodOptional<z.ZodUnion<[
|
|
131
131
|
z.ZodObject<{
|
|
132
132
|
type: z.ZodString;
|
|
133
|
-
id: z.ZodString
|
|
133
|
+
id: z.ZodOptional<z.ZodString>;
|
|
134
134
|
}, z.core.$catchall<z.ZodAny>>,
|
|
135
135
|
z.ZodArray<z.ZodObject<{
|
|
136
136
|
type: z.ZodString;
|
|
137
|
-
id: z.ZodString
|
|
137
|
+
id: z.ZodOptional<z.ZodString>;
|
|
138
138
|
}, z.core.$catchall<z.ZodAny>>>
|
|
139
139
|
]>>;
|
|
140
140
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -144,11 +144,11 @@ declare const UnsignedVCValidator: z.ZodObject<{
|
|
|
144
144
|
status: z.ZodOptional<z.ZodUnion<[
|
|
145
145
|
z.ZodObject<{
|
|
146
146
|
type: z.ZodString;
|
|
147
|
-
id: z.ZodString
|
|
147
|
+
id: z.ZodOptional<z.ZodString>;
|
|
148
148
|
}, z.core.$catchall<z.ZodAny>>,
|
|
149
149
|
z.ZodArray<z.ZodObject<{
|
|
150
150
|
type: z.ZodString;
|
|
151
|
-
id: z.ZodString
|
|
151
|
+
id: z.ZodOptional<z.ZodString>;
|
|
152
152
|
}, z.core.$catchall<z.ZodAny>>>
|
|
153
153
|
]>>;
|
|
154
154
|
termsOfUse: z.ZodOptional<z.ZodUnion<[
|
|
@@ -334,11 +334,11 @@ declare const VCValidator: z.ZodObject<{
|
|
|
334
334
|
credentialStatus: z.ZodOptional<z.ZodUnion<[
|
|
335
335
|
z.ZodObject<{
|
|
336
336
|
type: z.ZodString;
|
|
337
|
-
id: z.ZodString
|
|
337
|
+
id: z.ZodOptional<z.ZodString>;
|
|
338
338
|
}, z.core.$catchall<z.ZodAny>>,
|
|
339
339
|
z.ZodArray<z.ZodObject<{
|
|
340
340
|
type: z.ZodString;
|
|
341
|
-
id: z.ZodString
|
|
341
|
+
id: z.ZodOptional<z.ZodString>;
|
|
342
342
|
}, z.core.$catchall<z.ZodAny>>>
|
|
343
343
|
]>>;
|
|
344
344
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -348,11 +348,11 @@ declare const VCValidator: z.ZodObject<{
|
|
|
348
348
|
status: z.ZodOptional<z.ZodUnion<[
|
|
349
349
|
z.ZodObject<{
|
|
350
350
|
type: z.ZodString;
|
|
351
|
-
id: z.ZodString
|
|
351
|
+
id: z.ZodOptional<z.ZodString>;
|
|
352
352
|
}, z.core.$catchall<z.ZodAny>>,
|
|
353
353
|
z.ZodArray<z.ZodObject<{
|
|
354
354
|
type: z.ZodString;
|
|
355
|
-
id: z.ZodString
|
|
355
|
+
id: z.ZodOptional<z.ZodString>;
|
|
356
356
|
}, z.core.$catchall<z.ZodAny>>>
|
|
357
357
|
]>>;
|
|
358
358
|
termsOfUse: z.ZodOptional<z.ZodUnion<[
|
|
@@ -554,7 +554,10 @@ declare const BitstringStatusListEntryValidator: z.ZodObject<{
|
|
|
554
554
|
revocation: "revocation";
|
|
555
555
|
suspension: "suspension";
|
|
556
556
|
}>;
|
|
557
|
-
statusListIndex: z.
|
|
557
|
+
statusListIndex: z.ZodUnion<[
|
|
558
|
+
z.ZodString,
|
|
559
|
+
z.ZodNumber
|
|
560
|
+
]>;
|
|
558
561
|
statusListCredential: z.ZodString;
|
|
559
562
|
}, z.core.$strip>;
|
|
560
563
|
export type BitstringStatusListEntry = z.infer<typeof BitstringStatusListEntryValidator>;
|
|
@@ -943,6 +946,8 @@ export declare const projectEnvelopeToDisplayVc: (envelope: StoredCredentialEnve
|
|
|
943
946
|
* `read.get` result without branching themselves).
|
|
944
947
|
*/
|
|
945
948
|
export declare const resolveStorageReadResult: (value: VC | StoredCredentialEnvelope | undefined) => VC | StoredCredentialEnvelope | undefined;
|
|
949
|
+
/** Generates a did:web for a user given the app domain and profile ID. */
|
|
950
|
+
export declare const getDidWeb: (domain: string, profileId: string) => string;
|
|
946
951
|
/**
|
|
947
952
|
* Determines whether or not a string is a valid hexadecimal string
|
|
948
953
|
*
|
package/dist/helpers.d.ts
CHANGED
|
@@ -130,11 +130,11 @@ declare const UnsignedVCValidator: z.ZodObject<{
|
|
|
130
130
|
credentialStatus: z.ZodOptional<z.ZodUnion<[
|
|
131
131
|
z.ZodObject<{
|
|
132
132
|
type: z.ZodString;
|
|
133
|
-
id: z.ZodString
|
|
133
|
+
id: z.ZodOptional<z.ZodString>;
|
|
134
134
|
}, z.core.$catchall<z.ZodAny>>,
|
|
135
135
|
z.ZodArray<z.ZodObject<{
|
|
136
136
|
type: z.ZodString;
|
|
137
|
-
id: z.ZodString
|
|
137
|
+
id: z.ZodOptional<z.ZodString>;
|
|
138
138
|
}, z.core.$catchall<z.ZodAny>>>
|
|
139
139
|
]>>;
|
|
140
140
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -144,11 +144,11 @@ declare const UnsignedVCValidator: z.ZodObject<{
|
|
|
144
144
|
status: z.ZodOptional<z.ZodUnion<[
|
|
145
145
|
z.ZodObject<{
|
|
146
146
|
type: z.ZodString;
|
|
147
|
-
id: z.ZodString
|
|
147
|
+
id: z.ZodOptional<z.ZodString>;
|
|
148
148
|
}, z.core.$catchall<z.ZodAny>>,
|
|
149
149
|
z.ZodArray<z.ZodObject<{
|
|
150
150
|
type: z.ZodString;
|
|
151
|
-
id: z.ZodString
|
|
151
|
+
id: z.ZodOptional<z.ZodString>;
|
|
152
152
|
}, z.core.$catchall<z.ZodAny>>>
|
|
153
153
|
]>>;
|
|
154
154
|
termsOfUse: z.ZodOptional<z.ZodUnion<[
|
|
@@ -334,11 +334,11 @@ declare const VCValidator: z.ZodObject<{
|
|
|
334
334
|
credentialStatus: z.ZodOptional<z.ZodUnion<[
|
|
335
335
|
z.ZodObject<{
|
|
336
336
|
type: z.ZodString;
|
|
337
|
-
id: z.ZodString
|
|
337
|
+
id: z.ZodOptional<z.ZodString>;
|
|
338
338
|
}, z.core.$catchall<z.ZodAny>>,
|
|
339
339
|
z.ZodArray<z.ZodObject<{
|
|
340
340
|
type: z.ZodString;
|
|
341
|
-
id: z.ZodString
|
|
341
|
+
id: z.ZodOptional<z.ZodString>;
|
|
342
342
|
}, z.core.$catchall<z.ZodAny>>>
|
|
343
343
|
]>>;
|
|
344
344
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -348,11 +348,11 @@ declare const VCValidator: z.ZodObject<{
|
|
|
348
348
|
status: z.ZodOptional<z.ZodUnion<[
|
|
349
349
|
z.ZodObject<{
|
|
350
350
|
type: z.ZodString;
|
|
351
|
-
id: z.ZodString
|
|
351
|
+
id: z.ZodOptional<z.ZodString>;
|
|
352
352
|
}, z.core.$catchall<z.ZodAny>>,
|
|
353
353
|
z.ZodArray<z.ZodObject<{
|
|
354
354
|
type: z.ZodString;
|
|
355
|
-
id: z.ZodString
|
|
355
|
+
id: z.ZodOptional<z.ZodString>;
|
|
356
356
|
}, z.core.$catchall<z.ZodAny>>>
|
|
357
357
|
]>>;
|
|
358
358
|
termsOfUse: z.ZodOptional<z.ZodUnion<[
|
|
@@ -554,7 +554,10 @@ declare const BitstringStatusListEntryValidator: z.ZodObject<{
|
|
|
554
554
|
revocation: "revocation";
|
|
555
555
|
suspension: "suspension";
|
|
556
556
|
}>;
|
|
557
|
-
statusListIndex: z.
|
|
557
|
+
statusListIndex: z.ZodUnion<[
|
|
558
|
+
z.ZodString,
|
|
559
|
+
z.ZodNumber
|
|
560
|
+
]>;
|
|
558
561
|
statusListCredential: z.ZodString;
|
|
559
562
|
}, z.core.$strip>;
|
|
560
563
|
export type BitstringStatusListEntry = z.infer<typeof BitstringStatusListEntryValidator>;
|
|
@@ -943,6 +946,8 @@ export declare const projectEnvelopeToDisplayVc: (envelope: StoredCredentialEnve
|
|
|
943
946
|
* `read.get` result without branching themselves).
|
|
944
947
|
*/
|
|
945
948
|
export declare const resolveStorageReadResult: (value: VC | StoredCredentialEnvelope | undefined) => VC | StoredCredentialEnvelope | undefined;
|
|
949
|
+
/** Generates a did:web for a user given the app domain and profile ID. */
|
|
950
|
+
export declare const getDidWeb: (domain: string, profileId: string) => string;
|
|
946
951
|
/**
|
|
947
952
|
* Determines whether or not a string is a valid hexadecimal string
|
|
948
953
|
*
|
package/dist/helpers.esm.js
CHANGED
|
@@ -153,6 +153,7 @@ var require_types_cjs_development = __commonJS({
|
|
|
153
153
|
DeleteFrameworkInputValidator: /* @__PURE__ */ __name(() => DeleteFrameworkInputValidator, "DeleteFrameworkInputValidator"),
|
|
154
154
|
DeleteSkillInputValidator: /* @__PURE__ */ __name(() => DeleteSkillInputValidator, "DeleteSkillInputValidator"),
|
|
155
155
|
DidDocumentValidator: /* @__PURE__ */ __name(() => DidDocumentValidator, "DidDocumentValidator"),
|
|
156
|
+
EMPTY_IN_APP_MESSAGES_FLAG: /* @__PURE__ */ __name(() => EMPTY_IN_APP_MESSAGES_FLAG, "EMPTY_IN_APP_MESSAGES_FLAG"),
|
|
156
157
|
EncryptedCredentialRecordValidator: /* @__PURE__ */ __name(() => EncryptedCredentialRecordValidator, "EncryptedCredentialRecordValidator"),
|
|
157
158
|
EncryptedRecordValidator: /* @__PURE__ */ __name(() => EncryptedRecordValidator, "EncryptedRecordValidator"),
|
|
158
159
|
EndorsementCredentialValidator: /* @__PURE__ */ __name(() => EndorsementCredentialValidator, "EndorsementCredentialValidator"),
|
|
@@ -311,7 +312,28 @@ var require_types_cjs_development = __commonJS({
|
|
|
311
312
|
VerificationMethodValidator: /* @__PURE__ */ __name(() => VerificationMethodValidator, "VerificationMethodValidator"),
|
|
312
313
|
VerificationStatusEnum: /* @__PURE__ */ __name(() => VerificationStatusEnum, "VerificationStatusEnum"),
|
|
313
314
|
VerificationStatusValidator: /* @__PURE__ */ __name(() => VerificationStatusValidator, "VerificationStatusValidator"),
|
|
314
|
-
|
|
315
|
+
appStoreActionValidator: /* @__PURE__ */ __name(() => appStoreActionValidator, "appStoreActionValidator"),
|
|
316
|
+
capgoUpdateActionValidator: /* @__PURE__ */ __name(() => capgoUpdateActionValidator, "capgoUpdateActionValidator"),
|
|
317
|
+
dismissActionValidator: /* @__PURE__ */ __name(() => dismissActionValidator, "dismissActionValidator"),
|
|
318
|
+
externalLinkActionValidator: /* @__PURE__ */ __name(() => externalLinkActionValidator, "externalLinkActionValidator"),
|
|
319
|
+
inAppMessageActionStyleValidator: /* @__PURE__ */ __name(() => inAppMessageActionStyleValidator, "inAppMessageActionStyleValidator"),
|
|
320
|
+
inAppMessageActionTargetValidator: /* @__PURE__ */ __name(() => inAppMessageActionTargetValidator, "inAppMessageActionTargetValidator"),
|
|
321
|
+
inAppMessageActionValidator: /* @__PURE__ */ __name(() => inAppMessageActionValidator, "inAppMessageActionValidator"),
|
|
322
|
+
inAppMessageFrequencyValidator: /* @__PURE__ */ __name(() => inAppMessageFrequencyValidator, "inAppMessageFrequencyValidator"),
|
|
323
|
+
inAppMessageMediaValidator: /* @__PURE__ */ __name(() => inAppMessageMediaValidator, "inAppMessageMediaValidator"),
|
|
324
|
+
inAppMessagePlatformValidator: /* @__PURE__ */ __name(() => inAppMessagePlatformValidator, "inAppMessagePlatformValidator"),
|
|
325
|
+
inAppMessagePredicateValidator: /* @__PURE__ */ __name(() => inAppMessagePredicateValidator, "inAppMessagePredicateValidator"),
|
|
326
|
+
inAppMessagePresentationValidator: /* @__PURE__ */ __name(() => inAppMessagePresentationValidator, "inAppMessagePresentationValidator"),
|
|
327
|
+
inAppMessageValidator: /* @__PURE__ */ __name(() => inAppMessageValidator, "inAppMessageValidator"),
|
|
328
|
+
inAppMessageVersionOpValidator: /* @__PURE__ */ __name(() => inAppMessageVersionOpValidator, "inAppMessageVersionOpValidator"),
|
|
329
|
+
inAppMessageVersionSourceValidator: /* @__PURE__ */ __name(() => inAppMessageVersionSourceValidator, "inAppMessageVersionSourceValidator"),
|
|
330
|
+
inAppMessagesFlagValidator: /* @__PURE__ */ __name(() => inAppMessagesFlagValidator, "inAppMessagesFlagValidator"),
|
|
331
|
+
internalLinkActionValidator: /* @__PURE__ */ __name(() => internalLinkActionValidator, "internalLinkActionValidator"),
|
|
332
|
+
isStoredCredentialEnvelope: /* @__PURE__ */ __name(() => isStoredCredentialEnvelope2, "isStoredCredentialEnvelope"),
|
|
333
|
+
parseInAppMessagesFlag: /* @__PURE__ */ __name(() => parseInAppMessagesFlag, "parseInAppMessagesFlag"),
|
|
334
|
+
platformPredicateValidator: /* @__PURE__ */ __name(() => platformPredicateValidator, "platformPredicateValidator"),
|
|
335
|
+
rolePredicateValidator: /* @__PURE__ */ __name(() => rolePredicateValidator, "rolePredicateValidator"),
|
|
336
|
+
versionPredicateValidator: /* @__PURE__ */ __name(() => versionPredicateValidator, "versionPredicateValidator")
|
|
315
337
|
});
|
|
316
338
|
module.exports = __toCommonJS(index_exports);
|
|
317
339
|
var external_exports = {};
|
|
@@ -15653,7 +15675,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15653
15675
|
}).catchall(external_exports.any())
|
|
15654
15676
|
);
|
|
15655
15677
|
var CredentialSubjectValidator = external_exports.object({ id: external_exports.string().optional() }).catchall(external_exports.any());
|
|
15656
|
-
var CredentialStatusValidator = external_exports.object({ type: external_exports.string(), id: external_exports.string() }).catchall(external_exports.any());
|
|
15678
|
+
var CredentialStatusValidator = external_exports.object({ type: external_exports.string(), id: external_exports.string().optional() }).catchall(external_exports.any());
|
|
15657
15679
|
var CredentialSchemaValidator = external_exports.object({ id: external_exports.string(), type: external_exports.string() }).catchall(external_exports.any());
|
|
15658
15680
|
var RefreshServiceValidator = external_exports.object({ id: external_exports.string().optional(), type: external_exports.string() }).catchall(external_exports.any());
|
|
15659
15681
|
var TermsOfUseValidator = external_exports.object({ type: external_exports.string(), id: external_exports.string().optional() }).catchall(external_exports.any());
|
|
@@ -16054,8 +16076,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16054
16076
|
statusListIndex: external_exports.string().optional()
|
|
16055
16077
|
});
|
|
16056
16078
|
var VerificationCheckValidator = external_exports.object({
|
|
16079
|
+
/**
|
|
16080
|
+
* Checks that completed successfully. This does not imply that warnings can be ignored.
|
|
16081
|
+
*/
|
|
16057
16082
|
checks: external_exports.string().array(),
|
|
16083
|
+
/**
|
|
16084
|
+
* Security-relevant conditions that did not prevent the requested cryptographic checks from
|
|
16085
|
+
* completing. In particular, a non-DID issuer warning means the signature is valid but the
|
|
16086
|
+
* named URL issuer's authorization of that signing key was not established.
|
|
16087
|
+
*/
|
|
16058
16088
|
warnings: external_exports.string().array(),
|
|
16089
|
+
/** Verification failures that prevented one or more requested checks from succeeding. */
|
|
16059
16090
|
errors: external_exports.string().array(),
|
|
16060
16091
|
/**
|
|
16061
16092
|
* Per-entry results for the `credentialStatus` check, populated
|
|
@@ -16184,6 +16215,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16184
16215
|
role: external_exports.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),
|
|
16185
16216
|
dob: external_exports.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".'),
|
|
16186
16217
|
country: external_exports.string().optional().describe("Country for the profile."),
|
|
16218
|
+
locale: external_exports.string().optional().describe(
|
|
16219
|
+
"BCP-47 language tag (e.g. 'es', 'fr', 'ar') \u2014 the user's preferred language for server-sent notifications and emails."
|
|
16220
|
+
),
|
|
16187
16221
|
approved: external_exports.boolean().optional().describe("Approval status for the profile.")
|
|
16188
16222
|
});
|
|
16189
16223
|
var LCNPublicProfileValidator = LCNProfileValidator.pick({
|
|
@@ -16729,7 +16763,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16729
16763
|
"GUARDIAN_APPROVAL_PENDING",
|
|
16730
16764
|
"GUARDIAN_APPROVED",
|
|
16731
16765
|
"GUARDIAN_REJECTED",
|
|
16732
|
-
"APP_NOTIFICATION"
|
|
16766
|
+
"APP_NOTIFICATION",
|
|
16767
|
+
"CREDENTIAL_REVOKED",
|
|
16768
|
+
"CREDENTIAL_SUSPENDED",
|
|
16769
|
+
"CREDENTIAL_UNSUSPENDED"
|
|
16733
16770
|
]);
|
|
16734
16771
|
var LCNNotificationMessageValidator = external_exports.object({
|
|
16735
16772
|
title: external_exports.string().optional(),
|
|
@@ -17510,7 +17547,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17510
17547
|
id: external_exports.string().optional(),
|
|
17511
17548
|
type: external_exports.literal("BitstringStatusListEntry"),
|
|
17512
17549
|
statusPurpose: BitstringStatusPurposeValidator,
|
|
17513
|
-
statusListIndex: external_exports.string(),
|
|
17550
|
+
statusListIndex: external_exports.string().or(external_exports.number().int().nonnegative()),
|
|
17514
17551
|
statusListCredential: external_exports.string()
|
|
17515
17552
|
});
|
|
17516
17553
|
var AllocatedBitstringStatusListEntryValidator = BitstringStatusListEntryValidator.extend({
|
|
@@ -17526,6 +17563,97 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17526
17563
|
statusPurposes: external_exports.array(BitstringStatusPurposeValidator).optional(),
|
|
17527
17564
|
listSize: external_exports.number().int().positive().optional()
|
|
17528
17565
|
}).default({});
|
|
17566
|
+
var inAppMessagePlatformValidator = external_exports.enum(["ios", "android", "web"]);
|
|
17567
|
+
var inAppMessageVersionSourceValidator = external_exports.enum(["native", "web", "capgo"]);
|
|
17568
|
+
var inAppMessageVersionOpValidator = external_exports.enum(["lt", "lte", "eq", "gte", "gt"]);
|
|
17569
|
+
var platformPredicateValidator = external_exports.object({ platform: external_exports.array(inAppMessagePlatformValidator).nonempty() }).strict();
|
|
17570
|
+
var rolePredicateValidator = external_exports.object({ role: external_exports.array(external_exports.string()).nonempty() }).strict();
|
|
17571
|
+
var versionPredicateValidator = external_exports.object({
|
|
17572
|
+
version: external_exports.object({
|
|
17573
|
+
source: inAppMessageVersionSourceValidator,
|
|
17574
|
+
op: inAppMessageVersionOpValidator,
|
|
17575
|
+
value: external_exports.string()
|
|
17576
|
+
}).strict()
|
|
17577
|
+
}).strict();
|
|
17578
|
+
var inAppMessagePredicateValidator = external_exports.lazy(
|
|
17579
|
+
() => external_exports.union([
|
|
17580
|
+
platformPredicateValidator,
|
|
17581
|
+
rolePredicateValidator,
|
|
17582
|
+
versionPredicateValidator,
|
|
17583
|
+
external_exports.object({ all: external_exports.array(inAppMessagePredicateValidator) }).strict(),
|
|
17584
|
+
external_exports.object({ any: external_exports.array(inAppMessagePredicateValidator) }).strict(),
|
|
17585
|
+
external_exports.object({ not: inAppMessagePredicateValidator }).strict()
|
|
17586
|
+
])
|
|
17587
|
+
);
|
|
17588
|
+
var inAppMessageActionStyleValidator = external_exports.enum(["primary", "secondary", "positive", "dismiss"]).default("secondary");
|
|
17589
|
+
var internalLinkActionValidator = external_exports.object({ type: external_exports.literal("internalLink"), path: external_exports.string() }).passthrough();
|
|
17590
|
+
var externalLinkActionValidator = external_exports.object({ type: external_exports.literal("externalLink"), url: external_exports.string() }).passthrough();
|
|
17591
|
+
var appStoreActionValidator = external_exports.object({
|
|
17592
|
+
type: external_exports.literal("appStore"),
|
|
17593
|
+
iosUrl: external_exports.string().optional(),
|
|
17594
|
+
androidUrl: external_exports.string().optional(),
|
|
17595
|
+
webUrl: external_exports.string().optional()
|
|
17596
|
+
}).passthrough();
|
|
17597
|
+
var capgoUpdateActionValidator = external_exports.object({ type: external_exports.literal("capgoUpdate") }).passthrough();
|
|
17598
|
+
var dismissActionValidator = external_exports.object({ type: external_exports.literal("dismiss") }).passthrough();
|
|
17599
|
+
var inAppMessageActionTargetValidator = external_exports.union([
|
|
17600
|
+
internalLinkActionValidator,
|
|
17601
|
+
externalLinkActionValidator,
|
|
17602
|
+
appStoreActionValidator,
|
|
17603
|
+
capgoUpdateActionValidator,
|
|
17604
|
+
dismissActionValidator
|
|
17605
|
+
]);
|
|
17606
|
+
var inAppMessageActionValidator = external_exports.object({
|
|
17607
|
+
label: external_exports.string(),
|
|
17608
|
+
style: inAppMessageActionStyleValidator,
|
|
17609
|
+
action: inAppMessageActionTargetValidator,
|
|
17610
|
+
/** When true, the message closes after this action runs (default true). */
|
|
17611
|
+
closeOnComplete: external_exports.boolean().default(true)
|
|
17612
|
+
}).passthrough();
|
|
17613
|
+
var inAppMessageMediaValidator = external_exports.object({
|
|
17614
|
+
type: external_exports.enum(["youtube", "image", "gif"]),
|
|
17615
|
+
url: external_exports.string(),
|
|
17616
|
+
/** Aspect ratio hint, e.g. "16:9" or "1:1". Defaults to 16:9. */
|
|
17617
|
+
aspect: external_exports.string().default("16:9"),
|
|
17618
|
+
/** Alt text for images/gifs (accessibility). */
|
|
17619
|
+
alt: external_exports.string().optional()
|
|
17620
|
+
}).passthrough();
|
|
17621
|
+
var inAppMessageFrequencyValidator = external_exports.union([
|
|
17622
|
+
external_exports.literal("once"),
|
|
17623
|
+
external_exports.literal("session"),
|
|
17624
|
+
external_exports.literal("always"),
|
|
17625
|
+
external_exports.object({ everyDays: external_exports.number().positive() }).strict()
|
|
17626
|
+
]).default("once");
|
|
17627
|
+
var inAppMessagePresentationValidator = external_exports.enum(["modal", "banner", "toast"]).default("modal");
|
|
17628
|
+
var inAppMessageValidator = external_exports.object({
|
|
17629
|
+
/** Stable identifier — used to persist dismissal / frequency state. */
|
|
17630
|
+
id: external_exports.string(),
|
|
17631
|
+
/** Higher priority wins when multiple messages match. Default 0. */
|
|
17632
|
+
priority: external_exports.number().default(0),
|
|
17633
|
+
/** When false, the message is required/blocking (no dismiss affordance). */
|
|
17634
|
+
dismissible: external_exports.boolean().default(true),
|
|
17635
|
+
frequency: inAppMessageFrequencyValidator,
|
|
17636
|
+
presentation: inAppMessagePresentationValidator,
|
|
17637
|
+
media: inAppMessageMediaValidator.optional(),
|
|
17638
|
+
/** Optional emoji hero glyph — rendered only when `media` is not set. */
|
|
17639
|
+
emoji: external_exports.string().optional(),
|
|
17640
|
+
title: external_exports.string(),
|
|
17641
|
+
body: external_exports.string().optional(),
|
|
17642
|
+
actions: external_exports.array(inAppMessageActionValidator).default([]),
|
|
17643
|
+
/** Targeting predicate tree. Omitted → matches everyone. */
|
|
17644
|
+
targeting: inAppMessagePredicateValidator.optional(),
|
|
17645
|
+
/** Allow disabling a message without removing it from the flag. */
|
|
17646
|
+
enabled: external_exports.boolean().default(true)
|
|
17647
|
+
}).passthrough();
|
|
17648
|
+
var inAppMessagesFlagValidator = external_exports.object({
|
|
17649
|
+
version: external_exports.number().default(1),
|
|
17650
|
+
messages: external_exports.array(inAppMessageValidator).default([])
|
|
17651
|
+
}).passthrough();
|
|
17652
|
+
var EMPTY_IN_APP_MESSAGES_FLAG = { version: 1, messages: [] };
|
|
17653
|
+
var parseInAppMessagesFlag = /* @__PURE__ */ __name2((raw) => {
|
|
17654
|
+
const result = inAppMessagesFlagValidator.safeParse(raw);
|
|
17655
|
+
return result.success ? result.data : EMPTY_IN_APP_MESSAGES_FLAG;
|
|
17656
|
+
}, "parseInAppMessagesFlag");
|
|
17529
17657
|
}
|
|
17530
17658
|
});
|
|
17531
17659
|
|
|
@@ -17927,7 +18055,8 @@ var getCredentialStatusArray = /* @__PURE__ */ __name((credential) => {
|
|
|
17927
18055
|
var isBitstringStatusListEntry = /* @__PURE__ */ __name((status) => {
|
|
17928
18056
|
if (!status || typeof status !== "object") return false;
|
|
17929
18057
|
const record = status;
|
|
17930
|
-
|
|
18058
|
+
const statusListIndex = record.statusListIndex;
|
|
18059
|
+
return record.type === "BitstringStatusListEntry" && (record.statusPurpose === "revocation" || record.statusPurpose === "suspension") && (typeof statusListIndex === "string" || typeof statusListIndex === "number" && Number.isInteger(statusListIndex) && statusListIndex >= 0) && typeof record.statusListCredential === "string";
|
|
17931
18060
|
}, "isBitstringStatusListEntry");
|
|
17932
18061
|
var getBitstringStatusListEntries = /* @__PURE__ */ __name((credential) => {
|
|
17933
18062
|
if (!credential || typeof credential !== "object" || Array.isArray(credential)) return [];
|
|
@@ -18353,6 +18482,16 @@ var inferW3cVersionFromContext = /* @__PURE__ */ __name((vc) => {
|
|
|
18353
18482
|
return isV2 ? "w3c-vc-2.0" : "w3c-vc-1.1";
|
|
18354
18483
|
}, "inferW3cVersionFromContext");
|
|
18355
18484
|
|
|
18485
|
+
// src/did.ts
|
|
18486
|
+
var getDidWeb = /* @__PURE__ */ __name((domain, profileId) => {
|
|
18487
|
+
let decodedDomain = domain;
|
|
18488
|
+
try {
|
|
18489
|
+
decodedDomain = decodeURIComponent(domain);
|
|
18490
|
+
} catch {
|
|
18491
|
+
}
|
|
18492
|
+
return `did:web:${encodeURIComponent(decodedDomain)}:users:${profileId}`;
|
|
18493
|
+
}, "getDidWeb");
|
|
18494
|
+
|
|
18356
18495
|
// src/index.ts
|
|
18357
18496
|
var isHex = /* @__PURE__ */ __name((str) => /^[0-9a-f]+$/i.test(str), "isHex");
|
|
18358
18497
|
var isEncrypted = /* @__PURE__ */ __name((item) => {
|
|
@@ -18433,6 +18572,7 @@ export {
|
|
|
18433
18572
|
getBitstringStatusListEntries,
|
|
18434
18573
|
getBitstringStatusListEntryForPurpose,
|
|
18435
18574
|
getCredentialStatusArray,
|
|
18575
|
+
getDidWeb,
|
|
18436
18576
|
getProvider,
|
|
18437
18577
|
getUrlsFromSrcSet,
|
|
18438
18578
|
immerArraySlice,
|