@opens/gateways 1.16.8 → 1.16.10

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.
@@ -394,8 +394,8 @@ interface AnnouncementAppearance {
394
394
  */
395
395
  position?: 'top' | 'bottom';
396
396
  }
397
- /** Payload rendered by the announcement widget. */
398
- interface AnnouncementPayload {
397
+ /** Payload rendered by a banner announcement. */
398
+ interface BannerAnnouncementPayload {
399
399
  /** Main announcement message. */
400
400
  message: string;
401
401
  /** Visual style applied to the announcement. */
@@ -405,6 +405,168 @@ interface AnnouncementPayload {
405
405
  /** Optional appearance configuration for DOM anchoring. */
406
406
  appearance?: AnnouncementAppearance;
407
407
  }
408
+ /** A selectable option in a survey question. */
409
+ interface SurveyQuestionOption {
410
+ /** Stable identifier for the option. */
411
+ id: string;
412
+ /** Label displayed to the respondent. */
413
+ label: string;
414
+ /** Value stored in the survey response. */
415
+ value: string;
416
+ }
417
+ /** Configuration for a numeric rating question. */
418
+ interface SurveyRatingQuestionConfig {
419
+ /** Lowest selectable value. */
420
+ min: number;
421
+ /** Highest selectable value. */
422
+ max: number;
423
+ /** Increment between selectable values. */
424
+ step: number;
425
+ /** Optional label displayed near the lowest value. */
426
+ lowLabel?: string;
427
+ /** Optional label displayed near the highest value. */
428
+ highLabel?: string;
429
+ }
430
+ /** Configuration for an emoji reaction question. */
431
+ interface SurveyReactionQuestionConfig {
432
+ /** Optional label displayed near the negative reaction. */
433
+ lowLabel?: string;
434
+ /** Optional label displayed near the positive reaction. */
435
+ highLabel?: string;
436
+ }
437
+ /** Configuration for a free-text question. */
438
+ interface SurveyTextQuestionConfig {
439
+ /** Whether the input is rendered as a multiline field. */
440
+ multiline: boolean;
441
+ /** Optional input placeholder. */
442
+ placeholder?: string;
443
+ /** Optional minimum response length. */
444
+ minLength?: number;
445
+ /** Maximum response length. */
446
+ maxLength: number;
447
+ }
448
+ /** Configuration for a single-choice question. */
449
+ interface SurveySingleChoiceQuestionConfig {
450
+ /** Options presented to the respondent. */
451
+ options: SurveyQuestionOption[];
452
+ }
453
+ /** Configuration for a multiple-choice question. */
454
+ interface SurveyMultipleChoiceQuestionConfig {
455
+ /** Minimum number of options that can be selected. */
456
+ minSelections: number;
457
+ /** Maximum number of options that can be selected. */
458
+ maxSelections: number;
459
+ /** Options presented to the respondent. */
460
+ options: SurveyQuestionOption[];
461
+ }
462
+ /** A numeric rating question. */
463
+ interface SurveyRatingQuestion {
464
+ /** Stable identifier for the question. */
465
+ id: string;
466
+ /** Text displayed to the respondent. */
467
+ text: string;
468
+ /** Optional supporting text. */
469
+ description?: string;
470
+ /** Whether an answer is required. */
471
+ required: boolean;
472
+ /** Question input type. */
473
+ type: 'rating';
474
+ /** Input configuration. */
475
+ config: SurveyRatingQuestionConfig;
476
+ }
477
+ /** An emoji reaction question. */
478
+ interface SurveyReactionQuestion {
479
+ /** Stable identifier for the question. */
480
+ id: string;
481
+ /** Text displayed to the respondent. */
482
+ text: string;
483
+ /** Optional supporting text. */
484
+ description?: string;
485
+ /** Whether an answer is required. */
486
+ required: boolean;
487
+ /** Question input type. */
488
+ type: 'reaction';
489
+ /** Input configuration. */
490
+ config: SurveyReactionQuestionConfig;
491
+ }
492
+ /** A free-text question. */
493
+ interface SurveyTextQuestion {
494
+ /** Stable identifier for the question. */
495
+ id: string;
496
+ /** Text displayed to the respondent. */
497
+ text: string;
498
+ /** Optional supporting text. */
499
+ description?: string;
500
+ /** Whether an answer is required. */
501
+ required: boolean;
502
+ /** Question input type. */
503
+ type: 'text';
504
+ /** Input configuration. */
505
+ config: SurveyTextQuestionConfig;
506
+ }
507
+ /** A question that accepts one option. */
508
+ interface SurveySingleChoiceQuestion {
509
+ /** Stable identifier for the question. */
510
+ id: string;
511
+ /** Text displayed to the respondent. */
512
+ text: string;
513
+ /** Optional supporting text. */
514
+ description?: string;
515
+ /** Whether an answer is required. */
516
+ required: boolean;
517
+ /** Question input type. */
518
+ type: 'single_choice';
519
+ /** Input configuration. */
520
+ config: SurveySingleChoiceQuestionConfig;
521
+ }
522
+ /** A question that accepts multiple options. */
523
+ interface SurveyMultipleChoiceQuestion {
524
+ /** Stable identifier for the question. */
525
+ id: string;
526
+ /** Text displayed to the respondent. */
527
+ text: string;
528
+ /** Optional supporting text. */
529
+ description?: string;
530
+ /** Whether an answer is required. */
531
+ required: boolean;
532
+ /** Question input type. */
533
+ type: 'multiple_choice';
534
+ /** Input configuration. */
535
+ config: SurveyMultipleChoiceQuestionConfig;
536
+ }
537
+ /** A question supported by the generic survey payload. */
538
+ type SurveyQuestion = SurveyRatingQuestion | SurveyReactionQuestion | SurveyTextQuestion | SurveySingleChoiceQuestion | SurveyMultipleChoiceQuestion;
539
+ /** Completion content displayed after submitting a survey. */
540
+ interface SurveyCompletion {
541
+ /** Optional message shown after submission. */
542
+ message?: string;
543
+ }
544
+ /** Supported viewport placements for a survey. */
545
+ type SurveyPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
546
+ /** Rendering options for a survey. */
547
+ interface SurveyAppearance {
548
+ /** Display mode supported by the widget. */
549
+ mode: 'popover';
550
+ /** Viewport corner where the survey is displayed. */
551
+ placement?: SurveyPlacement;
552
+ }
553
+ /** Payload rendered by a survey announcement. */
554
+ interface SurveyAnnouncementPayload {
555
+ /** Schema version used to validate the survey. */
556
+ formatVersion: 1;
557
+ /** Survey title. */
558
+ title: string;
559
+ /** Optional supporting description. */
560
+ description?: string;
561
+ /** Ordered questions displayed to the respondent. */
562
+ questions: SurveyQuestion[];
563
+ /** Optional completion content. */
564
+ completion?: SurveyCompletion;
565
+ /** Survey rendering options. */
566
+ appearance: SurveyAppearance;
567
+ }
568
+ /** Payload rendered by the announcement widget. */
569
+ type AnnouncementPayload = BannerAnnouncementPayload | SurveyAnnouncementPayload;
408
570
  /** URL targeting rule for an announcement. */
409
571
  interface AnnouncementTargetingRuleUrl {
410
572
  /** Matching strategy. */
@@ -455,6 +617,8 @@ interface Announcement {
455
617
  payload: AnnouncementPayload;
456
618
  /** Optional expiration ISO date. */
457
619
  expiresAt?: string | null;
620
+ /** Optional ISO date when the announcement becomes active. */
621
+ startsAt?: string | null;
458
622
  /** Creation ISO date. */
459
623
  createdAt: string;
460
624
  /** Last update ISO date. */
@@ -504,6 +668,8 @@ interface CreateAnnouncementRequest {
504
668
  allCompanies: boolean;
505
669
  /** Optional expiration ISO date. */
506
670
  expiresAt?: string | null;
671
+ /** Optional ISO date when the announcement becomes active. */
672
+ startsAt?: string | null;
507
673
  /** Renderable payload. */
508
674
  payload: AnnouncementPayload;
509
675
  /** Company UUIDs allowed to see the announcement when allCompanies is false. */
@@ -523,6 +689,8 @@ interface UpdateAnnouncementRequest {
523
689
  allCompanies: boolean;
524
690
  /** Optional expiration ISO date. */
525
691
  expiresAt?: string | null;
692
+ /** Optional ISO date when the announcement becomes active. */
693
+ startsAt?: string | null;
526
694
  /** Renderable payload. */
527
695
  payload: AnnouncementPayload;
528
696
  /** Company UUIDs allowed to see the announcement when allCompanies is false. */
@@ -537,19 +705,146 @@ interface UpdateAnnouncementStatusRequest {
537
705
  }
538
706
  /** Query parameters for the active announcements widget endpoint. */
539
707
  interface ActiveAnnouncementQuery {
708
+ /** Stable subject UUID used to return only unanswered surveys. */
709
+ id?: string;
710
+ /** Optional subject name received from identify. */
711
+ name?: string;
712
+ /** Optional subject email received from identify. */
713
+ email?: string;
714
+ /** Optional subject phone received from identify. */
715
+ phone?: string;
540
716
  /** Current page URL used for URL targeting rules. */
541
717
  url?: string;
542
718
  /** User profile slug used for profile targeting rules. */
543
719
  profile?: string;
544
720
  }
545
- /** Slim announcement payload returned by the active endpoint (widget). */
546
- interface ActiveAnnouncement {
721
+ /** Active banner returned by the widget endpoint. */
722
+ interface ActiveBannerAnnouncement {
547
723
  /** Unique identifier. */
548
724
  id: string;
549
- /** Announcement type slug. */
550
- type?: string;
551
- /** Renderable payload. */
552
- payload: AnnouncementPayload;
725
+ /** Banner announcement discriminator. */
726
+ type: 'banner';
727
+ /** Banner payload rendered by the widget. */
728
+ payload: BannerAnnouncementPayload;
729
+ }
730
+ /** Active survey returned by the widget endpoint. */
731
+ interface ActiveSurveyAnnouncement {
732
+ /** Unique identifier. */
733
+ id: string;
734
+ /** Survey announcement discriminator. */
735
+ type: 'survey';
736
+ /** Survey payload rendered by the widget. */
737
+ payload: SurveyAnnouncementPayload;
738
+ }
739
+ /** Announcement returned by the active widget endpoint. */
740
+ type ActiveAnnouncement = ActiveBannerAnnouncement | ActiveSurveyAnnouncement;
741
+
742
+ /** A value submitted for a survey question. */
743
+ type SurveyAnswerValue = number | string | string[];
744
+ /** An answer submitted for one survey question. */
745
+ interface SurveyAnswer {
746
+ /** Identifier of the answered question. */
747
+ questionId: string;
748
+ /** Value submitted for the question. */
749
+ value: SurveyAnswerValue;
750
+ }
751
+ /** Request payload for submitting a survey response. */
752
+ interface CreateSurveyResponseRequest {
753
+ /** Stable identifier of the subject answering the survey. */
754
+ subjectId: string;
755
+ /** Optional subject name captured at submission time. */
756
+ subjectName?: string;
757
+ /** Optional subject profile captured at submission time. */
758
+ subjectProfile?: string;
759
+ /** Answers submitted by the subject. */
760
+ answers: SurveyAnswer[];
761
+ }
762
+ /** A selected choice persisted for a survey response answer. */
763
+ interface SurveyResponseAnswerOption {
764
+ /** Unique selected-option record identifier. */
765
+ id: string;
766
+ /** Identifier of the owning answer record. */
767
+ answerId: string;
768
+ /** Stable identifier of the option from the survey payload. */
769
+ optionId: string;
770
+ /** Machine-readable option value captured at submission time. */
771
+ optionValue: string;
772
+ /** Display label captured at submission time. */
773
+ optionLabel: string;
774
+ /** One-based option position in the survey payload. */
775
+ optionPosition: number;
776
+ /** ISO date when the selected option was created. */
777
+ createdAt: string;
778
+ /** ISO date when the selected option was last updated. */
779
+ updatedAt: string;
780
+ }
781
+ /** Normalized answer persisted for one survey question. */
782
+ interface SurveyResponseAnswer {
783
+ /** Unique answer record identifier. */
784
+ id: string;
785
+ /** Identifier of the owning survey response. */
786
+ responseId: string;
787
+ /** Stable identifier of the question from the survey payload. */
788
+ questionId: string;
789
+ /** Question type captured at submission time. */
790
+ questionType: SurveyQuestion['type'];
791
+ /** One-based question position in the survey payload. */
792
+ questionPosition: number;
793
+ /** Question text captured at submission time. */
794
+ questionText: string;
795
+ /** Whether the question was required at submission time. */
796
+ questionRequired: boolean;
797
+ /** Whether the subject supplied a meaningful answer. */
798
+ answered: boolean;
799
+ /** Original answer value, or null when the question was skipped. */
800
+ rawValue: SurveyAnswerValue | null;
801
+ /** Numeric projection used by rating and reaction reports. */
802
+ numericValue: number | null;
803
+ /** Text projection used by free-text reports. */
804
+ textValue: string | null;
805
+ /** Options selected for single-choice or multiple-choice questions. */
806
+ selectedOptions: SurveyResponseAnswerOption[];
807
+ /** ISO date when the normalized answer was created. */
808
+ createdAt: string;
809
+ /** ISO date when the normalized answer was last updated. */
810
+ updatedAt: string;
811
+ }
812
+ /** A persisted response to a survey announcement. */
813
+ interface SurveyResponse {
814
+ /** Unique response identifier. */
815
+ id: string;
816
+ /** Identifier of the answered survey announcement. */
817
+ announcementId: string;
818
+ /** Identifier of the authenticated company. */
819
+ companyId: string;
820
+ /** Stable identifier of the responding subject. */
821
+ subjectId: string;
822
+ /** Subject name captured at submission time. */
823
+ subjectName: string | null;
824
+ /** Subject profile captured at submission time. */
825
+ subjectProfile: string | null;
826
+ /** Normalized records for every survey question. */
827
+ answers: SurveyResponseAnswer[];
828
+ /** ISO date when the response was submitted. */
829
+ submittedAt: string;
830
+ /** ISO date when the response was created. */
831
+ createdAt: string;
832
+ /** ISO date when the response was last updated. */
833
+ updatedAt: string;
834
+ }
835
+ /** Query parameters for the administrative survey-response list. */
836
+ interface SurveyResponseListFilters {
837
+ /** One-based page number. */
838
+ page?: number;
839
+ /** Maximum number of responses per page. */
840
+ limit?: number;
841
+ }
842
+ /** Paginated responses returned for a survey announcement. */
843
+ interface SurveyResponseListResponse {
844
+ /** Total matching responses. */
845
+ count: number;
846
+ /** Responses for the requested page. */
847
+ rows: SurveyResponse[];
553
848
  }
554
849
 
555
850
  /** Request payload for generating a two-factor OTP secret URL. */
@@ -570,4 +865,4 @@ interface ValidateTwoFactorOtpResponse {
570
865
  validate: boolean;
571
866
  }
572
867
 
573
- export type { ActiveAnnouncement, ActiveAnnouncementQuery, Announcement, AnnouncementAppearance, AnnouncementButton, AnnouncementCompany, AnnouncementListFilters, AnnouncementListResponse, AnnouncementPayload, AnnouncementTargetingRuleUrl, AnnouncementTargetingRules, AnnouncementType, AnnouncementVisualStatus, CompanyBooleanConfigKey, CompanyConfigKey, CompanyConfigResponse, CompanyData, CompanyJsonConfigKey, CompanyQueue, CompanyResponse, CompanyStringConfigKey, CompanyWithConfigsResponse, CreateAnnouncementRequest, GenerateTwoFactorOtpRequest, GenerateTwoFactorOtpResponse, GetAllUsersParams, GetAllUsersResponse, GetManagedUsersResponse, GetSupportWidgetIdResponse, GetUserByIdResponse, ListUsersInclude, ListUsersProfile, ListUsersRequest, ListUsersResponse, ListUsersStatus, ListUsersType, ManagedUser, StrongPasswordOptions, StrongPasswordOptionsResponse, UpdateAnnouncementRequest, UpdateAnnouncementStatusRequest, UpdateCompanyBooleanConfigRequest, UpdateCompanyJsonConfigRequest, UpdateCompanyRequest, UpdateCompanyStringConfigRequest, UpdateCompanyUserAvatarResponse, UpdateCompanyUserRequest, UpdateSupportWidgetIdRequest, UpdateSupportWidgetIdResponse, UpdateUserPasswordRequest, UpdateUserPasswordResponse, User, UserBond, UserProfile, ValidateTwoFactorOtpRequest, ValidateTwoFactorOtpResponse, WorkGroup, WorkGroupListResponse, WorkGroupMember, WorkGroupMembersResponse, WorkGroupResponse };
868
+ export type { ActiveAnnouncement, ActiveAnnouncementQuery, ActiveBannerAnnouncement, ActiveSurveyAnnouncement, Announcement, AnnouncementAppearance, AnnouncementButton, AnnouncementCompany, AnnouncementListFilters, AnnouncementListResponse, AnnouncementPayload, AnnouncementTargetingRuleUrl, AnnouncementTargetingRules, AnnouncementType, AnnouncementVisualStatus, BannerAnnouncementPayload, CompanyBooleanConfigKey, CompanyConfigKey, CompanyConfigResponse, CompanyData, CompanyJsonConfigKey, CompanyQueue, CompanyResponse, CompanyStringConfigKey, CompanyWithConfigsResponse, CreateAnnouncementRequest, CreateSurveyResponseRequest, GenerateTwoFactorOtpRequest, GenerateTwoFactorOtpResponse, GetAllUsersParams, GetAllUsersResponse, GetManagedUsersResponse, GetSupportWidgetIdResponse, GetUserByIdResponse, ListUsersInclude, ListUsersProfile, ListUsersRequest, ListUsersResponse, ListUsersStatus, ListUsersType, ManagedUser, StrongPasswordOptions, StrongPasswordOptionsResponse, SurveyAnnouncementPayload, SurveyAnswer, SurveyAnswerValue, SurveyAppearance, SurveyCompletion, SurveyMultipleChoiceQuestion, SurveyMultipleChoiceQuestionConfig, SurveyPlacement, SurveyQuestion, SurveyQuestionOption, SurveyRatingQuestion, SurveyRatingQuestionConfig, SurveyReactionQuestion, SurveyReactionQuestionConfig, SurveyResponse, SurveyResponseAnswer, SurveyResponseAnswerOption, SurveyResponseListFilters, SurveyResponseListResponse, SurveySingleChoiceQuestion, SurveySingleChoiceQuestionConfig, SurveyTextQuestion, SurveyTextQuestionConfig, UpdateAnnouncementRequest, UpdateAnnouncementStatusRequest, UpdateCompanyBooleanConfigRequest, UpdateCompanyJsonConfigRequest, UpdateCompanyRequest, UpdateCompanyStringConfigRequest, UpdateCompanyUserAvatarResponse, UpdateCompanyUserRequest, UpdateSupportWidgetIdRequest, UpdateSupportWidgetIdResponse, UpdateUserPasswordRequest, UpdateUserPasswordResponse, User, UserBond, UserProfile, ValidateTwoFactorOtpRequest, ValidateTwoFactorOtpResponse, WorkGroup, WorkGroupListResponse, WorkGroupMember, WorkGroupMembersResponse, WorkGroupResponse };