@@ -257,10 +257,12 @@ export type MultiSelectCollector = MultiValueCollectorWithValue<'MultiSelectColl
257257export type ObjectValueCollectorTypes =
258258 | 'DeviceAuthenticationCollector'
259259 | 'DeviceRegistrationCollector'
260+ | 'PhoneNumberCollector'
261+ | 'ObjectOptionsCollector'
260262 | 'ObjectValueCollector'
261263 | 'ObjectSelectCollector' ;
262264
263- interface ObjectOptionWithValue {
265+ interface DeviceOptionWithDefault {
264266 type : string ;
265267 label : string ;
266268 content : string ;
@@ -269,55 +271,96 @@ interface ObjectOptionWithValue {
269271 key : string ;
270272}
271273
272- interface ObjectOptionNoValue {
274+ interface DeviceOptionNoDefault {
273275 type : string ;
274276 label : string ;
275277 content : string ;
276278 value : string ;
277279 key : string ;
278280}
279281
280- interface ObjectValue {
282+ export interface DeviceValue {
281283 type : string ;
282284 id : string ;
283285 value : string ;
284286}
285287
286- export interface ObjectValueCollectorNoValue < T extends ObjectValueCollectorTypes > {
288+ export interface PhoneNumberInputValue {
289+ countryCode : string ;
290+ phoneNumber : string ;
291+ }
292+
293+ interface PhoneNumberOutputValue {
294+ countryCode ?: string ;
295+ phoneNumber ?: string ;
296+ }
297+
298+ export interface ObjectOptionsCollectorWithStringValue <
299+ T extends ObjectValueCollectorTypes ,
300+ V = string ,
301+ > {
302+ category : 'ObjectValueCollector' ;
303+ error : string | null ;
304+ type : T ;
305+ id : string ;
306+ name : string ;
307+ input : {
308+ key : string ;
309+ value : V ;
310+ type : string ;
311+ } ;
312+ output : {
313+ key : string ;
314+ label : string ;
315+ type : string ;
316+ options : DeviceOptionNoDefault [ ] ;
317+ } ;
318+ }
319+
320+ export interface ObjectOptionsCollectorWithObjectValue <
321+ T extends ObjectValueCollectorTypes ,
322+ V = Record < string , string > ,
323+ D = Record < string , string > ,
324+ > {
287325 category : 'ObjectValueCollector' ;
288326 error : string | null ;
289327 type : T ;
290328 id : string ;
291329 name : string ;
292330 input : {
293331 key : string ;
294- value : string | null ;
332+ value : V ;
295333 type : string ;
296334 } ;
297335 output : {
298336 key : string ;
299337 label : string ;
300338 type : string ;
301- options : ObjectOptionNoValue [ ] ;
339+ options : DeviceOptionWithDefault [ ] ;
340+ value ?: D | null ;
302341 } ;
303342}
304343
305- export interface ObjectValueCollectorWithValue < T extends ObjectValueCollectorTypes > {
344+ export interface ObjectValueCollectorWithObjectValue <
345+ T extends ObjectValueCollectorTypes ,
346+ IV = Record < string , string > ,
347+ OV = Record < string , string > ,
348+ > {
306349 category : 'ObjectValueCollector' ;
307350 error : string | null ;
308351 type : T ;
309352 id : string ;
310353 name : string ;
311354 input : {
312355 key : string ;
313- value : ObjectValue | null ;
356+ value : IV ;
314357 type : string ;
315358 } ;
316359 output : {
317360 key : string ;
318361 label : string ;
319362 type : string ;
320- options : ObjectOptionWithValue [ ] ;
363+ value ?: OV | null ;
321364 } ;
322365}
323366
@@ -326,24 +369,37 @@ export type InferValueObjectCollectorType<T extends ObjectValueCollectorTypes> =
326369 ? DeviceAuthenticationCollector
327370 : T extends 'DeviceRegistrationCollector'
328371 ? DeviceRegistrationCollector
329- :
330- | ObjectValueCollectorWithValue < 'ObjectValueCollector' >
331- | ObjectValueCollectorNoValue < 'ObjectValueCollector' > ;
372+ : T extends 'PhoneNumberCollector'
373+ ? PhoneNumberCollector
374+ :
375+ | ObjectOptionsCollectorWithObjectValue < 'ObjectValueCollector' >
376+ | ObjectOptionsCollectorWithStringValue < 'ObjectValueCollector' > ;
332377
333378export type ObjectValueCollectors =
334- | ObjectValueCollectorWithValue < 'DeviceAuthenticationCollector' >
335- | ObjectValueCollectorNoValue < 'DeviceRegistrationCollector' >
336- | ObjectValueCollectorWithValue < 'ObjectSelectCollector' >
337- | ObjectValueCollectorNoValue < 'ObjectSelectCollector' > ;
379+ | DeviceAuthenticationCollector
380+ | DeviceRegistrationCollector
381+ | PhoneNumberCollector
382+ | ObjectOptionsCollectorWithObjectValue < 'ObjectSelectCollector' >
383+ | ObjectOptionsCollectorWithStringValue < 'ObjectSelectCollector' > ;
338384
339385export type ObjectValueCollector < T extends ObjectValueCollectorTypes > =
340- | ObjectValueCollectorWithValue < T >
341- | ObjectValueCollectorNoValue < T > ;
342-
343- export type DeviceRegistrationCollector =
344- ObjectValueCollectorNoValue < 'DeviceRegistrationCollector' > ;
345- export type DeviceAuthenticationCollector =
346- ObjectValueCollectorWithValue < 'DeviceAuthenticationCollector' > ;
386+ | ObjectOptionsCollectorWithObjectValue < T >
387+ | ObjectOptionsCollectorWithStringValue < T >
388+ | ObjectValueCollectorWithObjectValue < T > ;
389+
390+ export type DeviceRegistrationCollector = ObjectOptionsCollectorWithStringValue <
391+ 'DeviceRegistrationCollector' ,
392+ string
393+ > ;
394+ export type DeviceAuthenticationCollector = ObjectOptionsCollectorWithObjectValue <
395+ 'DeviceAuthenticationCollector' ,
396+ DeviceValue
397+ > ;
398+ export type PhoneNumberCollector = ObjectValueCollectorWithObjectValue <
399+ 'PhoneNumberCollector' ,
400+ PhoneNumberInputValue ,
401+ PhoneNumberOutputValue
402+ > ;
347403
348404/** *********************************************************************
349405 * ACTION COLLECTORS
@@ -448,3 +504,16 @@ export type NoValueCollectors =
448504export type NoValueCollector < T extends NoValueCollectorTypes > = NoValueCollectorBase < T > ;
449505
450506export type ReadOnlyCollector = NoValueCollectorBase < 'ReadOnlyCollector' > ;
507+
508+ export type UnknownCollector = {
509+ category : 'UnknownCollector' ;
510+ error : string | null ;
511+ type : 'UnknownCollector' ;
512+ id : string ;
513+ name : string ;
514+ output : {
515+ key : string ;
516+ label : string ;
517+ type : string ;
518+ } ;
519+ } ;
0 commit comments