@learncard/types 5.18.1 → 5.18.2
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/lcn.d.ts +90 -2
- package/dist/lcn.d.ts.map +1 -1
- package/dist/types.cjs.development.cjs +36 -1
- package/dist/types.cjs.development.cjs.map +2 -2
- package/dist/types.cjs.production.min.cjs +5 -5
- package/dist/types.cjs.production.min.cjs.map +3 -3
- package/dist/types.esm.js +36 -1
- package/dist/types.esm.js.map +2 -2
- package/package.json +1 -1
- package/src/lcn.ts +49 -1
package/package.json
CHANGED
package/src/lcn.ts
CHANGED
|
@@ -102,6 +102,47 @@ export const LCNPublicProfileValidator = LCNProfileValidator.pick({
|
|
|
102
102
|
});
|
|
103
103
|
export type LCNPublicProfile = z.infer<typeof LCNPublicProfileValidator>;
|
|
104
104
|
|
|
105
|
+
export const LCNConnectionPromptStatusValidator = z.enum(['PENDING', 'SKIPPED', 'CONNECTED']);
|
|
106
|
+
export type LCNConnectionPromptStatus = z.infer<typeof LCNConnectionPromptStatusValidator>;
|
|
107
|
+
|
|
108
|
+
export const LCNConnectionPromptSurfaceValidator = z.enum(['POST_CLAIM', 'NOTIFICATION']);
|
|
109
|
+
export type LCNConnectionPromptSurface = z.infer<typeof LCNConnectionPromptSurfaceValidator>;
|
|
110
|
+
|
|
111
|
+
export const LCNConnectionPromptActionStatusValidator = z.enum([
|
|
112
|
+
'PENDING',
|
|
113
|
+
'SKIPPED',
|
|
114
|
+
'CONNECTED',
|
|
115
|
+
'STALE',
|
|
116
|
+
]);
|
|
117
|
+
export type LCNConnectionPromptActionStatus = z.infer<
|
|
118
|
+
typeof LCNConnectionPromptActionStatusValidator
|
|
119
|
+
>;
|
|
120
|
+
|
|
121
|
+
export const LCNConnectionPromptValidator = z.object({
|
|
122
|
+
promptId: z.string().uuid(),
|
|
123
|
+
status: LCNConnectionPromptStatusValidator,
|
|
124
|
+
surface: LCNConnectionPromptSurfaceValidator,
|
|
125
|
+
triggerId: z.string(),
|
|
126
|
+
triggeredAt: z.iso.datetime(),
|
|
127
|
+
updatedAt: z.iso.datetime(),
|
|
128
|
+
counterpart: LCNPublicProfileValidator,
|
|
129
|
+
});
|
|
130
|
+
export type LCNConnectionPrompt = z.infer<typeof LCNConnectionPromptValidator>;
|
|
131
|
+
|
|
132
|
+
export const LCNConnectionPromptActionResultValidator = z.object({
|
|
133
|
+
promptId: z.string().uuid(),
|
|
134
|
+
status: LCNConnectionPromptActionStatusValidator,
|
|
135
|
+
});
|
|
136
|
+
export type LCNConnectionPromptActionResult = z.infer<
|
|
137
|
+
typeof LCNConnectionPromptActionResultValidator
|
|
138
|
+
>;
|
|
139
|
+
|
|
140
|
+
export const LCNConnectionPromptMetadataValidator = z.object({
|
|
141
|
+
promptId: z.string().uuid(),
|
|
142
|
+
counterpartProfileId: z.string(),
|
|
143
|
+
});
|
|
144
|
+
export type LCNConnectionPromptMetadata = z.infer<typeof LCNConnectionPromptMetadataValidator>;
|
|
145
|
+
|
|
105
146
|
export const LCNAuthedProfileValidator = LCNPublicProfileValidator.extend({
|
|
106
147
|
bio: LCNProfileValidator.shape.bio,
|
|
107
148
|
websiteLink: LCNProfileValidator.shape.websiteLink,
|
|
@@ -966,13 +1007,20 @@ export const LCNNotificationInboxValidator = z.object({
|
|
|
966
1007
|
|
|
967
1008
|
export type LCNNotificationInbox = z.infer<typeof LCNNotificationInboxValidator>;
|
|
968
1009
|
|
|
1010
|
+
export const LCNNotificationMetadataValidator = z
|
|
1011
|
+
.object({
|
|
1012
|
+
connectionPrompt: LCNConnectionPromptMetadataValidator.optional(),
|
|
1013
|
+
})
|
|
1014
|
+
.catchall(z.unknown());
|
|
1015
|
+
export type LCNNotificationMetadata = z.infer<typeof LCNNotificationMetadataValidator>;
|
|
1016
|
+
|
|
969
1017
|
export const LCNNotificationDataValidator = z
|
|
970
1018
|
.object({
|
|
971
1019
|
vcUris: z.array(z.string()).optional(),
|
|
972
1020
|
vpUris: z.array(z.string()).optional(),
|
|
973
1021
|
transaction: ConsentFlowTransactionValidator.optional(),
|
|
974
1022
|
inbox: LCNNotificationInboxValidator.optional(),
|
|
975
|
-
metadata:
|
|
1023
|
+
metadata: LCNNotificationMetadataValidator.optional(),
|
|
976
1024
|
})
|
|
977
1025
|
.loose();
|
|
978
1026
|
export type LCNNotificationData = z.infer<typeof LCNNotificationDataValidator>;
|