@learncard/types 5.17.6 → 5.18.1
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/bitstring-status-list.d.ts +2 -2
- package/dist/clr.d.ts +20 -20
- package/dist/inAppMessages.d.ts +312 -0
- package/dist/inAppMessages.d.ts.map +1 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/lcn.d.ts +86 -56
- package/dist/lcn.d.ts.map +1 -1
- package/dist/learncard.d.ts.map +1 -1
- package/dist/obv3.d.ts +28 -28
- package/dist/types.cjs.development.cjs +134 -4
- package/dist/types.cjs.development.cjs.map +3 -3
- package/dist/types.cjs.production.min.cjs +31 -31
- package/dist/types.cjs.production.min.cjs.map +4 -4
- package/dist/types.esm.js +135 -4
- package/dist/types.esm.js.map +4 -4
- package/dist/vc.d.ts +25 -25
- package/package.json +1 -1
- package/src/bitstring-status-list.ts +1 -1
- package/src/inAppMessages.ts +216 -0
- package/src/index.ts +1 -0
- package/src/lcn.ts +9 -0
- package/src/learncard.ts +9 -0
- package/src/vc.ts +1 -1
|
@@ -13,7 +13,7 @@ export declare const BitstringStatusListEntryValidator: z.ZodObject<{
|
|
|
13
13
|
revocation: "revocation";
|
|
14
14
|
suspension: "suspension";
|
|
15
15
|
}>;
|
|
16
|
-
statusListIndex: z.ZodString
|
|
16
|
+
statusListIndex: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
17
17
|
statusListCredential: z.ZodString;
|
|
18
18
|
}, z.core.$strip>;
|
|
19
19
|
export type BitstringStatusListEntry = z.infer<typeof BitstringStatusListEntryValidator>;
|
|
@@ -23,7 +23,7 @@ export declare const AllocatedBitstringStatusListEntryValidator: z.ZodObject<{
|
|
|
23
23
|
revocation: "revocation";
|
|
24
24
|
suspension: "suspension";
|
|
25
25
|
}>;
|
|
26
|
-
statusListIndex: z.ZodString
|
|
26
|
+
statusListIndex: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
27
27
|
statusListCredential: z.ZodString;
|
|
28
28
|
id: z.ZodString;
|
|
29
29
|
}, z.core.$strip>;
|
package/dist/clr.d.ts
CHANGED
|
@@ -241,10 +241,10 @@ export declare const ClrSubjectValidator: z.ZodObject<{
|
|
|
241
241
|
expirationDate: z.ZodOptional<z.ZodString>;
|
|
242
242
|
credentialStatus: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
243
243
|
type: z.ZodString;
|
|
244
|
-
id: z.ZodString
|
|
244
|
+
id: z.ZodOptional<z.ZodString>;
|
|
245
245
|
}, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
|
|
246
246
|
type: z.ZodString;
|
|
247
|
-
id: z.ZodString
|
|
247
|
+
id: z.ZodOptional<z.ZodString>;
|
|
248
248
|
}, z.core.$catchall<z.ZodAny>>>]>>;
|
|
249
249
|
name: z.ZodOptional<z.ZodString>;
|
|
250
250
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -252,10 +252,10 @@ export declare const ClrSubjectValidator: z.ZodObject<{
|
|
|
252
252
|
validUntil: z.ZodOptional<z.ZodString>;
|
|
253
253
|
status: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
254
254
|
type: z.ZodString;
|
|
255
|
-
id: z.ZodString
|
|
255
|
+
id: z.ZodOptional<z.ZodString>;
|
|
256
256
|
}, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
|
|
257
257
|
type: z.ZodString;
|
|
258
|
-
id: z.ZodString
|
|
258
|
+
id: z.ZodOptional<z.ZodString>;
|
|
259
259
|
}, z.core.$catchall<z.ZodAny>>>]>>;
|
|
260
260
|
termsOfUse: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
261
261
|
type: z.ZodString;
|
|
@@ -536,19 +536,19 @@ export declare const UnsignedClrCredentialValidator: z.ZodObject<{
|
|
|
536
536
|
expirationDate: z.ZodOptional<z.ZodString>;
|
|
537
537
|
credentialStatus: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
538
538
|
type: z.ZodString;
|
|
539
|
-
id: z.ZodString
|
|
539
|
+
id: z.ZodOptional<z.ZodString>;
|
|
540
540
|
}, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
|
|
541
541
|
type: z.ZodString;
|
|
542
|
-
id: z.ZodString
|
|
542
|
+
id: z.ZodOptional<z.ZodString>;
|
|
543
543
|
}, z.core.$catchall<z.ZodAny>>>]>>;
|
|
544
544
|
validFrom: z.ZodOptional<z.ZodString>;
|
|
545
545
|
validUntil: z.ZodOptional<z.ZodString>;
|
|
546
546
|
status: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
547
547
|
type: z.ZodString;
|
|
548
|
-
id: z.ZodString
|
|
548
|
+
id: z.ZodOptional<z.ZodString>;
|
|
549
549
|
}, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
|
|
550
550
|
type: z.ZodString;
|
|
551
|
-
id: z.ZodString
|
|
551
|
+
id: z.ZodOptional<z.ZodString>;
|
|
552
552
|
}, z.core.$catchall<z.ZodAny>>>]>>;
|
|
553
553
|
termsOfUse: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
554
554
|
type: z.ZodString;
|
|
@@ -685,10 +685,10 @@ export declare const UnsignedClrCredentialValidator: z.ZodObject<{
|
|
|
685
685
|
expirationDate: z.ZodOptional<z.ZodString>;
|
|
686
686
|
credentialStatus: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
687
687
|
type: z.ZodString;
|
|
688
|
-
id: z.ZodString
|
|
688
|
+
id: z.ZodOptional<z.ZodString>;
|
|
689
689
|
}, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
|
|
690
690
|
type: z.ZodString;
|
|
691
|
-
id: z.ZodString
|
|
691
|
+
id: z.ZodOptional<z.ZodString>;
|
|
692
692
|
}, z.core.$catchall<z.ZodAny>>>]>>;
|
|
693
693
|
name: z.ZodOptional<z.ZodString>;
|
|
694
694
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -696,10 +696,10 @@ export declare const UnsignedClrCredentialValidator: z.ZodObject<{
|
|
|
696
696
|
validUntil: z.ZodOptional<z.ZodString>;
|
|
697
697
|
status: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
698
698
|
type: z.ZodString;
|
|
699
|
-
id: z.ZodString
|
|
699
|
+
id: z.ZodOptional<z.ZodString>;
|
|
700
700
|
}, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
|
|
701
701
|
type: z.ZodString;
|
|
702
|
-
id: z.ZodString
|
|
702
|
+
id: z.ZodOptional<z.ZodString>;
|
|
703
703
|
}, z.core.$catchall<z.ZodAny>>>]>>;
|
|
704
704
|
termsOfUse: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
705
705
|
type: z.ZodString;
|
|
@@ -856,19 +856,19 @@ export declare const ClrCredentialValidator: z.ZodObject<{
|
|
|
856
856
|
expirationDate: z.ZodOptional<z.ZodString>;
|
|
857
857
|
credentialStatus: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
858
858
|
type: z.ZodString;
|
|
859
|
-
id: z.ZodString
|
|
859
|
+
id: z.ZodOptional<z.ZodString>;
|
|
860
860
|
}, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
|
|
861
861
|
type: z.ZodString;
|
|
862
|
-
id: z.ZodString
|
|
862
|
+
id: z.ZodOptional<z.ZodString>;
|
|
863
863
|
}, z.core.$catchall<z.ZodAny>>>]>>;
|
|
864
864
|
validFrom: z.ZodOptional<z.ZodString>;
|
|
865
865
|
validUntil: z.ZodOptional<z.ZodString>;
|
|
866
866
|
status: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
867
867
|
type: z.ZodString;
|
|
868
|
-
id: z.ZodString
|
|
868
|
+
id: z.ZodOptional<z.ZodString>;
|
|
869
869
|
}, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
|
|
870
870
|
type: z.ZodString;
|
|
871
|
-
id: z.ZodString
|
|
871
|
+
id: z.ZodOptional<z.ZodString>;
|
|
872
872
|
}, z.core.$catchall<z.ZodAny>>>]>>;
|
|
873
873
|
termsOfUse: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
874
874
|
type: z.ZodString;
|
|
@@ -1005,10 +1005,10 @@ export declare const ClrCredentialValidator: z.ZodObject<{
|
|
|
1005
1005
|
expirationDate: z.ZodOptional<z.ZodString>;
|
|
1006
1006
|
credentialStatus: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
1007
1007
|
type: z.ZodString;
|
|
1008
|
-
id: z.ZodString
|
|
1008
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1009
1009
|
}, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
|
|
1010
1010
|
type: z.ZodString;
|
|
1011
|
-
id: z.ZodString
|
|
1011
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1012
1012
|
}, z.core.$catchall<z.ZodAny>>>]>>;
|
|
1013
1013
|
name: z.ZodOptional<z.ZodString>;
|
|
1014
1014
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1016,10 +1016,10 @@ export declare const ClrCredentialValidator: z.ZodObject<{
|
|
|
1016
1016
|
validUntil: z.ZodOptional<z.ZodString>;
|
|
1017
1017
|
status: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
1018
1018
|
type: z.ZodString;
|
|
1019
|
-
id: z.ZodString
|
|
1019
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1020
1020
|
}, z.core.$catchall<z.ZodAny>>, z.ZodArray<z.ZodObject<{
|
|
1021
1021
|
type: z.ZodString;
|
|
1022
|
-
id: z.ZodString
|
|
1022
|
+
id: z.ZodOptional<z.ZodString>;
|
|
1023
1023
|
}, z.core.$catchall<z.ZodAny>>>]>>;
|
|
1024
1024
|
termsOfUse: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
1025
1025
|
type: z.ZodString;
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* In-App Messages — schema for the LaunchDarkly JSON flag that drives
|
|
4
|
+
* conditional, targeted user prompts across LearnCard apps.
|
|
5
|
+
*
|
|
6
|
+
* The flag value is a versioned list of messages. Each message carries its own
|
|
7
|
+
* targeting predicate tree that is evaluated ON DEVICE, because the client
|
|
8
|
+
* knows things LaunchDarkly's own targeting rules cannot reliably see — the
|
|
9
|
+
* Capacitor platform, the native binary version, and (crucially) the live
|
|
10
|
+
* Capgo/OTA bundle version. Keeping targeting in the JSON also makes the whole
|
|
11
|
+
* system unit-testable without a live LaunchDarkly connection.
|
|
12
|
+
*
|
|
13
|
+
* Consumed by `useInAppMessages()` in `learn-card-base`.
|
|
14
|
+
*/
|
|
15
|
+
/** Runtime platform, as reported by `Capacitor.getPlatform()`. */
|
|
16
|
+
export declare const inAppMessagePlatformValidator: z.ZodEnum<{
|
|
17
|
+
ios: "ios";
|
|
18
|
+
android: "android";
|
|
19
|
+
web: "web";
|
|
20
|
+
}>;
|
|
21
|
+
export type InAppMessagePlatform = z.infer<typeof inAppMessagePlatformValidator>;
|
|
22
|
+
/**
|
|
23
|
+
* Which version number a `version` predicate compares against:
|
|
24
|
+
* - `native` — the installed native binary version (`App.getInfo().version`)
|
|
25
|
+
* - `web` — the web build's package.json version (`__APP_VERSION__`)
|
|
26
|
+
* - `capgo` — the live Capgo/OTA bundle version (`CapacitorUpdater.current()`)
|
|
27
|
+
*/
|
|
28
|
+
export declare const inAppMessageVersionSourceValidator: z.ZodEnum<{
|
|
29
|
+
web: "web";
|
|
30
|
+
native: "native";
|
|
31
|
+
capgo: "capgo";
|
|
32
|
+
}>;
|
|
33
|
+
export type InAppMessageVersionSource = z.infer<typeof inAppMessageVersionSourceValidator>;
|
|
34
|
+
/** Semantic-version comparison operator (less-than, ..., greater-than). */
|
|
35
|
+
export declare const inAppMessageVersionOpValidator: z.ZodEnum<{
|
|
36
|
+
lt: "lt";
|
|
37
|
+
lte: "lte";
|
|
38
|
+
eq: "eq";
|
|
39
|
+
gte: "gte";
|
|
40
|
+
gt: "gt";
|
|
41
|
+
}>;
|
|
42
|
+
export type InAppMessageVersionOp = z.infer<typeof inAppMessageVersionOpValidator>;
|
|
43
|
+
/** Match when the runtime platform is one of the listed platforms. */
|
|
44
|
+
export declare const platformPredicateValidator: z.ZodObject<{
|
|
45
|
+
platform: z.ZodArray<z.ZodEnum<{
|
|
46
|
+
ios: "ios";
|
|
47
|
+
android: "android";
|
|
48
|
+
web: "web";
|
|
49
|
+
}>>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
/** Match when the current user's profile role is one of the listed roles. */
|
|
52
|
+
export declare const rolePredicateValidator: z.ZodObject<{
|
|
53
|
+
role: z.ZodArray<z.ZodString>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
/** Match when a chosen version source satisfies a semver comparison. */
|
|
56
|
+
export declare const versionPredicateValidator: z.ZodObject<{
|
|
57
|
+
version: z.ZodObject<{
|
|
58
|
+
source: z.ZodEnum<{
|
|
59
|
+
web: "web";
|
|
60
|
+
native: "native";
|
|
61
|
+
capgo: "capgo";
|
|
62
|
+
}>;
|
|
63
|
+
op: z.ZodEnum<{
|
|
64
|
+
lt: "lt";
|
|
65
|
+
lte: "lte";
|
|
66
|
+
eq: "eq";
|
|
67
|
+
gte: "gte";
|
|
68
|
+
gt: "gt";
|
|
69
|
+
}>;
|
|
70
|
+
value: z.ZodString;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
export type InAppMessagePredicate = z.infer<typeof platformPredicateValidator> | z.infer<typeof rolePredicateValidator> | z.infer<typeof versionPredicateValidator> | {
|
|
74
|
+
all: InAppMessagePredicate[];
|
|
75
|
+
} | {
|
|
76
|
+
any: InAppMessagePredicate[];
|
|
77
|
+
} | {
|
|
78
|
+
not: InAppMessagePredicate;
|
|
79
|
+
};
|
|
80
|
+
export declare const inAppMessagePredicateValidator: z.ZodType<InAppMessagePredicate>;
|
|
81
|
+
/** Visual weight of an action button — maps to the app's button styles. */
|
|
82
|
+
export declare const inAppMessageActionStyleValidator: z.ZodDefault<z.ZodEnum<{
|
|
83
|
+
primary: "primary";
|
|
84
|
+
secondary: "secondary";
|
|
85
|
+
positive: "positive";
|
|
86
|
+
dismiss: "dismiss";
|
|
87
|
+
}>>;
|
|
88
|
+
export type InAppMessageActionStyle = z.infer<typeof inAppMessageActionStyleValidator>;
|
|
89
|
+
/** Navigate to an in-app route (react-router path). */
|
|
90
|
+
export declare const internalLinkActionValidator: z.ZodObject<{
|
|
91
|
+
type: z.ZodLiteral<"internalLink">;
|
|
92
|
+
path: z.ZodString;
|
|
93
|
+
}, z.core.$loose>;
|
|
94
|
+
/** Open an external URL (native: Capacitor Browser; web: new tab). */
|
|
95
|
+
export declare const externalLinkActionValidator: z.ZodObject<{
|
|
96
|
+
type: z.ZodLiteral<"externalLink">;
|
|
97
|
+
url: z.ZodString;
|
|
98
|
+
}, z.core.$loose>;
|
|
99
|
+
/**
|
|
100
|
+
* Open this app's store page, resolved per-platform at runtime:
|
|
101
|
+
* iOS → App Store, Android → Google Play, web → configured fallback URL.
|
|
102
|
+
* Optional overrides win over tenant-config-derived links.
|
|
103
|
+
*/
|
|
104
|
+
export declare const appStoreActionValidator: z.ZodObject<{
|
|
105
|
+
type: z.ZodLiteral<"appStore">;
|
|
106
|
+
iosUrl: z.ZodOptional<z.ZodString>;
|
|
107
|
+
androidUrl: z.ZodOptional<z.ZodString>;
|
|
108
|
+
webUrl: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, z.core.$loose>;
|
|
110
|
+
/** Trigger a Capgo OTA bundle check + download (with progress) + reload. */
|
|
111
|
+
export type AppStoreAction = z.infer<typeof appStoreActionValidator>;
|
|
112
|
+
export declare const capgoUpdateActionValidator: z.ZodObject<{
|
|
113
|
+
type: z.ZodLiteral<"capgoUpdate">;
|
|
114
|
+
}, z.core.$loose>;
|
|
115
|
+
/** Dismiss/close the message without any side effect. */
|
|
116
|
+
export declare const dismissActionValidator: z.ZodObject<{
|
|
117
|
+
type: z.ZodLiteral<"dismiss">;
|
|
118
|
+
}, z.core.$loose>;
|
|
119
|
+
export declare const inAppMessageActionTargetValidator: z.ZodUnion<readonly [z.ZodObject<{
|
|
120
|
+
type: z.ZodLiteral<"internalLink">;
|
|
121
|
+
path: z.ZodString;
|
|
122
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
123
|
+
type: z.ZodLiteral<"externalLink">;
|
|
124
|
+
url: z.ZodString;
|
|
125
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
126
|
+
type: z.ZodLiteral<"appStore">;
|
|
127
|
+
iosUrl: z.ZodOptional<z.ZodString>;
|
|
128
|
+
androidUrl: z.ZodOptional<z.ZodString>;
|
|
129
|
+
webUrl: z.ZodOptional<z.ZodString>;
|
|
130
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
131
|
+
type: z.ZodLiteral<"capgoUpdate">;
|
|
132
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
133
|
+
type: z.ZodLiteral<"dismiss">;
|
|
134
|
+
}, z.core.$loose>]>;
|
|
135
|
+
export type InAppMessageActionTarget = z.infer<typeof inAppMessageActionTargetValidator>;
|
|
136
|
+
export declare const inAppMessageActionValidator: z.ZodObject<{
|
|
137
|
+
label: z.ZodString;
|
|
138
|
+
style: z.ZodDefault<z.ZodEnum<{
|
|
139
|
+
primary: "primary";
|
|
140
|
+
secondary: "secondary";
|
|
141
|
+
positive: "positive";
|
|
142
|
+
dismiss: "dismiss";
|
|
143
|
+
}>>;
|
|
144
|
+
action: z.ZodUnion<readonly [z.ZodObject<{
|
|
145
|
+
type: z.ZodLiteral<"internalLink">;
|
|
146
|
+
path: z.ZodString;
|
|
147
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
148
|
+
type: z.ZodLiteral<"externalLink">;
|
|
149
|
+
url: z.ZodString;
|
|
150
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
151
|
+
type: z.ZodLiteral<"appStore">;
|
|
152
|
+
iosUrl: z.ZodOptional<z.ZodString>;
|
|
153
|
+
androidUrl: z.ZodOptional<z.ZodString>;
|
|
154
|
+
webUrl: z.ZodOptional<z.ZodString>;
|
|
155
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
156
|
+
type: z.ZodLiteral<"capgoUpdate">;
|
|
157
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
158
|
+
type: z.ZodLiteral<"dismiss">;
|
|
159
|
+
}, z.core.$loose>]>;
|
|
160
|
+
closeOnComplete: z.ZodDefault<z.ZodBoolean>;
|
|
161
|
+
}, z.core.$loose>;
|
|
162
|
+
export type InAppMessageAction = z.infer<typeof inAppMessageActionValidator>;
|
|
163
|
+
export declare const inAppMessageMediaValidator: z.ZodObject<{
|
|
164
|
+
type: z.ZodEnum<{
|
|
165
|
+
image: "image";
|
|
166
|
+
youtube: "youtube";
|
|
167
|
+
gif: "gif";
|
|
168
|
+
}>;
|
|
169
|
+
url: z.ZodString;
|
|
170
|
+
aspect: z.ZodDefault<z.ZodString>;
|
|
171
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$loose>;
|
|
173
|
+
export type InAppMessageMedia = z.infer<typeof inAppMessageMediaValidator>;
|
|
174
|
+
/**
|
|
175
|
+
* How often a message may re-appear after being seen/dismissed:
|
|
176
|
+
* - `once` — show a single time, ever (persisted forever)
|
|
177
|
+
* - `session` — at most once per app session (in-memory)
|
|
178
|
+
* - `always` — every eligible render (no suppression)
|
|
179
|
+
* - `{ everyDays: n }` — again only after n days have elapsed
|
|
180
|
+
*/
|
|
181
|
+
export declare const inAppMessageFrequencyValidator: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"once">, z.ZodLiteral<"session">, z.ZodLiteral<"always">, z.ZodObject<{
|
|
182
|
+
everyDays: z.ZodNumber;
|
|
183
|
+
}, z.core.$strict>]>>;
|
|
184
|
+
export type InAppMessageFrequency = z.infer<typeof inAppMessageFrequencyValidator>;
|
|
185
|
+
export declare const inAppMessagePresentationValidator: z.ZodDefault<z.ZodEnum<{
|
|
186
|
+
modal: "modal";
|
|
187
|
+
banner: "banner";
|
|
188
|
+
toast: "toast";
|
|
189
|
+
}>>;
|
|
190
|
+
export type InAppMessagePresentation = z.infer<typeof inAppMessagePresentationValidator>;
|
|
191
|
+
export declare const inAppMessageValidator: z.ZodObject<{
|
|
192
|
+
id: z.ZodString;
|
|
193
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
194
|
+
dismissible: z.ZodDefault<z.ZodBoolean>;
|
|
195
|
+
frequency: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"once">, z.ZodLiteral<"session">, z.ZodLiteral<"always">, z.ZodObject<{
|
|
196
|
+
everyDays: z.ZodNumber;
|
|
197
|
+
}, z.core.$strict>]>>;
|
|
198
|
+
presentation: z.ZodDefault<z.ZodEnum<{
|
|
199
|
+
modal: "modal";
|
|
200
|
+
banner: "banner";
|
|
201
|
+
toast: "toast";
|
|
202
|
+
}>>;
|
|
203
|
+
media: z.ZodOptional<z.ZodObject<{
|
|
204
|
+
type: z.ZodEnum<{
|
|
205
|
+
image: "image";
|
|
206
|
+
youtube: "youtube";
|
|
207
|
+
gif: "gif";
|
|
208
|
+
}>;
|
|
209
|
+
url: z.ZodString;
|
|
210
|
+
aspect: z.ZodDefault<z.ZodString>;
|
|
211
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
212
|
+
}, z.core.$loose>>;
|
|
213
|
+
emoji: z.ZodOptional<z.ZodString>;
|
|
214
|
+
title: z.ZodString;
|
|
215
|
+
body: z.ZodOptional<z.ZodString>;
|
|
216
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
217
|
+
label: z.ZodString;
|
|
218
|
+
style: z.ZodDefault<z.ZodEnum<{
|
|
219
|
+
primary: "primary";
|
|
220
|
+
secondary: "secondary";
|
|
221
|
+
positive: "positive";
|
|
222
|
+
dismiss: "dismiss";
|
|
223
|
+
}>>;
|
|
224
|
+
action: z.ZodUnion<readonly [z.ZodObject<{
|
|
225
|
+
type: z.ZodLiteral<"internalLink">;
|
|
226
|
+
path: z.ZodString;
|
|
227
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
228
|
+
type: z.ZodLiteral<"externalLink">;
|
|
229
|
+
url: z.ZodString;
|
|
230
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
231
|
+
type: z.ZodLiteral<"appStore">;
|
|
232
|
+
iosUrl: z.ZodOptional<z.ZodString>;
|
|
233
|
+
androidUrl: z.ZodOptional<z.ZodString>;
|
|
234
|
+
webUrl: z.ZodOptional<z.ZodString>;
|
|
235
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
236
|
+
type: z.ZodLiteral<"capgoUpdate">;
|
|
237
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
238
|
+
type: z.ZodLiteral<"dismiss">;
|
|
239
|
+
}, z.core.$loose>]>;
|
|
240
|
+
closeOnComplete: z.ZodDefault<z.ZodBoolean>;
|
|
241
|
+
}, z.core.$loose>>>;
|
|
242
|
+
targeting: z.ZodOptional<z.ZodType<InAppMessagePredicate, unknown, z.core.$ZodTypeInternals<InAppMessagePredicate, unknown>>>;
|
|
243
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
244
|
+
}, z.core.$loose>;
|
|
245
|
+
export type InAppMessage = z.infer<typeof inAppMessageValidator>;
|
|
246
|
+
export declare const inAppMessagesFlagValidator: z.ZodObject<{
|
|
247
|
+
version: z.ZodDefault<z.ZodNumber>;
|
|
248
|
+
messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
249
|
+
id: z.ZodString;
|
|
250
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
251
|
+
dismissible: z.ZodDefault<z.ZodBoolean>;
|
|
252
|
+
frequency: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"once">, z.ZodLiteral<"session">, z.ZodLiteral<"always">, z.ZodObject<{
|
|
253
|
+
everyDays: z.ZodNumber;
|
|
254
|
+
}, z.core.$strict>]>>;
|
|
255
|
+
presentation: z.ZodDefault<z.ZodEnum<{
|
|
256
|
+
modal: "modal";
|
|
257
|
+
banner: "banner";
|
|
258
|
+
toast: "toast";
|
|
259
|
+
}>>;
|
|
260
|
+
media: z.ZodOptional<z.ZodObject<{
|
|
261
|
+
type: z.ZodEnum<{
|
|
262
|
+
image: "image";
|
|
263
|
+
youtube: "youtube";
|
|
264
|
+
gif: "gif";
|
|
265
|
+
}>;
|
|
266
|
+
url: z.ZodString;
|
|
267
|
+
aspect: z.ZodDefault<z.ZodString>;
|
|
268
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
269
|
+
}, z.core.$loose>>;
|
|
270
|
+
emoji: z.ZodOptional<z.ZodString>;
|
|
271
|
+
title: z.ZodString;
|
|
272
|
+
body: z.ZodOptional<z.ZodString>;
|
|
273
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
274
|
+
label: z.ZodString;
|
|
275
|
+
style: z.ZodDefault<z.ZodEnum<{
|
|
276
|
+
primary: "primary";
|
|
277
|
+
secondary: "secondary";
|
|
278
|
+
positive: "positive";
|
|
279
|
+
dismiss: "dismiss";
|
|
280
|
+
}>>;
|
|
281
|
+
action: z.ZodUnion<readonly [z.ZodObject<{
|
|
282
|
+
type: z.ZodLiteral<"internalLink">;
|
|
283
|
+
path: z.ZodString;
|
|
284
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
285
|
+
type: z.ZodLiteral<"externalLink">;
|
|
286
|
+
url: z.ZodString;
|
|
287
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
288
|
+
type: z.ZodLiteral<"appStore">;
|
|
289
|
+
iosUrl: z.ZodOptional<z.ZodString>;
|
|
290
|
+
androidUrl: z.ZodOptional<z.ZodString>;
|
|
291
|
+
webUrl: z.ZodOptional<z.ZodString>;
|
|
292
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
293
|
+
type: z.ZodLiteral<"capgoUpdate">;
|
|
294
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
295
|
+
type: z.ZodLiteral<"dismiss">;
|
|
296
|
+
}, z.core.$loose>]>;
|
|
297
|
+
closeOnComplete: z.ZodDefault<z.ZodBoolean>;
|
|
298
|
+
}, z.core.$loose>>>;
|
|
299
|
+
targeting: z.ZodOptional<z.ZodType<InAppMessagePredicate, unknown, z.core.$ZodTypeInternals<InAppMessagePredicate, unknown>>>;
|
|
300
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
301
|
+
}, z.core.$loose>>>;
|
|
302
|
+
}, z.core.$loose>;
|
|
303
|
+
export type InAppMessagesFlag = z.infer<typeof inAppMessagesFlagValidator>;
|
|
304
|
+
/** Empty, safe default used when the flag is absent or malformed. */
|
|
305
|
+
export declare const EMPTY_IN_APP_MESSAGES_FLAG: InAppMessagesFlag;
|
|
306
|
+
/**
|
|
307
|
+
* Parse an unknown flag value into a validated `InAppMessagesFlag`.
|
|
308
|
+
* Returns the empty flag (never throws) so a malformed flag can never crash
|
|
309
|
+
* the host app.
|
|
310
|
+
*/
|
|
311
|
+
export declare const parseInAppMessagesFlag: (raw: unknown) => InAppMessagesFlag;
|
|
312
|
+
//# sourceMappingURL=inAppMessages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inAppMessages.d.ts","sourceRoot":"","sources":["../src/inAppMessages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;GAYG;AAEH,kEAAkE;AAClE,eAAO,MAAM,6BAA6B;;;;EAAoC,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEjF;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC;;;;EAAqC,CAAC;AACrF,MAAM,MAAM,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gD,CAAC;AAE1F;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAS,OAAO,KAAG,iBAIrD,CAAC"}
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,MAAM,CAAC;AACrB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,MAAM,CAAC;AACrB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC"}
|