@tellescope/types-models 0.0.91 → 0.0.94
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/lib/cjs/index.d.ts +74 -32
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.d.ts +74 -32
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +2 -2
- package/lib/esm/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/index.ts +82 -41
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface SearchOptions {
|
|
|
4
4
|
query: string,
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export type AccessType = "All" | "Assigned" | null
|
|
7
|
+
export type AccessType = "All" | "Default" | "Assigned" | null
|
|
8
8
|
export type AccessAction = "create" | "read" | "update" | "delete"
|
|
9
9
|
export type AccessResources = ModelName
|
|
10
10
|
| 'apiKeys'
|
|
@@ -58,7 +58,6 @@ export type OrganizationLimits = {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export interface OrganizationInfo {
|
|
61
|
-
_id: string;
|
|
62
61
|
creator: string;
|
|
63
62
|
name: string;
|
|
64
63
|
subscriptionExpiresAt: Date;
|
|
@@ -152,7 +151,7 @@ export interface Enduser extends Enduser_readonly, Enduser_required, Enduser_upd
|
|
|
152
151
|
tags? : string[];
|
|
153
152
|
fields? : CustomFields;
|
|
154
153
|
preference? : Preference;
|
|
155
|
-
assignedTo? : string;
|
|
154
|
+
assignedTo? : string[];
|
|
156
155
|
avatar?: string,
|
|
157
156
|
unread?: boolean,
|
|
158
157
|
}
|
|
@@ -216,7 +215,6 @@ export interface Task extends Task_required, Task_readonly, Task_updatesDisabled
|
|
|
216
215
|
export type EmailEncoding = '' | 'base64'
|
|
217
216
|
|
|
218
217
|
export interface Email_readonly extends ClientRecord {
|
|
219
|
-
userId: string;
|
|
220
218
|
delivered: boolean;
|
|
221
219
|
threadId: string;
|
|
222
220
|
source: string; // email address of sender
|
|
@@ -236,6 +234,7 @@ export interface Email_updatesDisabled {
|
|
|
236
234
|
messageId?: string;
|
|
237
235
|
inbound?: boolean;
|
|
238
236
|
logOnly?: boolean,
|
|
237
|
+
userId: string; // not actually required on create
|
|
239
238
|
}
|
|
240
239
|
export interface Email extends Email_required, Email_readonly, Email_updatesDisabled {
|
|
241
240
|
replyTo?: string | null;
|
|
@@ -442,6 +441,7 @@ export interface FormResponse_required {
|
|
|
442
441
|
}
|
|
443
442
|
export interface FormResponse_updatesDisabled {
|
|
444
443
|
submissionExpiresAt?: number,
|
|
444
|
+
automationStepId?: string,
|
|
445
445
|
}
|
|
446
446
|
export interface FormResponse extends FormResponse_readonly, FormResponse_required, FormResponse_updatesDisabled {}
|
|
447
447
|
|
|
@@ -503,18 +503,25 @@ export interface WebhookCall {
|
|
|
503
503
|
integrity: string,
|
|
504
504
|
}
|
|
505
505
|
|
|
506
|
-
export type AutomationEventType = "enterState" | "leaveState"
|
|
506
|
+
export type AutomationEventType = "enterState" | "leaveState" // deprecated
|
|
507
|
+
| 'onJourneyStart'
|
|
508
|
+
| 'afterAction'
|
|
509
|
+
| "formResponse"
|
|
510
|
+
| "formUnsubmitted"
|
|
507
511
|
interface AutomationEventBuilder <T extends AutomationEventType, V extends object> {
|
|
508
512
|
type: T,
|
|
509
513
|
info: V,
|
|
510
514
|
}
|
|
511
515
|
|
|
512
516
|
export interface AutomationForJourney { journeyId: string }
|
|
517
|
+
export interface WithJourneyId { journeyId: string }
|
|
513
518
|
export interface AutomationForJourneyState { state: string }
|
|
514
519
|
export interface AutomationForJourneyAndState extends AutomationForJourney, AutomationForJourneyState {}
|
|
515
520
|
export interface AutomationForAutomation { automationId: string }
|
|
516
521
|
|
|
517
522
|
export interface AutomationForForm { formId: string }
|
|
523
|
+
export interface WithFormId { formId: string }
|
|
524
|
+
export interface WithAutomationStepId { automationStepId: string }
|
|
518
525
|
export interface AutomationForTemplate { templateId: string }
|
|
519
526
|
export interface AutomationForSender { senderId: string }
|
|
520
527
|
export interface AutomationForFormRequest extends AutomationForForm, AutomationForSender {}
|
|
@@ -524,10 +531,44 @@ export interface AutomationForNotification extends AutomationForTemplate { desti
|
|
|
524
531
|
|
|
525
532
|
export type EnterStateAutomationEvent = AutomationEventBuilder<'enterState', AutomationForJourneyAndState>
|
|
526
533
|
export type LeaveStateAutomationEvent = AutomationEventBuilder<'leaveState', AutomationForJourneyAndState>
|
|
527
|
-
export type FormResponseAutomationEvent = AutomationEventBuilder<'formResponse',
|
|
528
|
-
|
|
529
|
-
|
|
534
|
+
export type FormResponseAutomationEvent = AutomationEventBuilder<'formResponse', {
|
|
535
|
+
formId: string,
|
|
536
|
+
automationStepId?: string, // todo: make this required
|
|
537
|
+
}>
|
|
538
|
+
export type UnitOfTime = "Seconds" | "Minutes" | "Hours" | "Days"
|
|
539
|
+
|
|
540
|
+
export type FormSubmitCancellationConditionInfo = { formId: string, automationStepId: string }
|
|
541
|
+
export type CancelCondition = { type: 'formResponse', info: FormSubmitCancellationConditionInfo }
|
|
542
|
+
|
|
543
|
+
export type AfterActionEventInfo = {
|
|
544
|
+
automationStepId: string,
|
|
545
|
+
delayInMS: number, // the real delay (much easier for DB queries)
|
|
546
|
+
delay: number, // for displaying in editor
|
|
547
|
+
unit: UnitOfTime, // for displaying in editor
|
|
548
|
+
cancelConditions?: CancelCondition[]
|
|
549
|
+
}
|
|
550
|
+
export interface FormUnsubmittedEventInfo extends AfterActionEventInfo {
|
|
551
|
+
formId: string,
|
|
552
|
+
}
|
|
553
|
+
export type AfterActionAutomationEvent = AutomationEventBuilder<'afterAction', AfterActionEventInfo>
|
|
554
|
+
export type FormUnsubmittedEvent = AutomationEventBuilder<'formUnsubmitted', FormUnsubmittedEventInfo>
|
|
555
|
+
export type OnJourneyStartAutomationEvent = AutomationEventBuilder<'onJourneyStart', {}>
|
|
556
|
+
|
|
557
|
+
export type AutomationEvent = EnterStateAutomationEvent // deprecated
|
|
558
|
+
| LeaveStateAutomationEvent // depreacted
|
|
530
559
|
| FormResponseAutomationEvent
|
|
560
|
+
| AfterActionAutomationEvent
|
|
561
|
+
| OnJourneyStartAutomationEvent
|
|
562
|
+
| FormUnsubmittedEvent
|
|
563
|
+
|
|
564
|
+
export type AutomationEventForType = {
|
|
565
|
+
"enterState": EnterStateAutomationEvent // depreacted
|
|
566
|
+
"leaveState": LeaveStateAutomationEvent // deprecated
|
|
567
|
+
'onJourneyStart': OnJourneyStartAutomationEvent
|
|
568
|
+
'afterAction': AfterActionAutomationEvent
|
|
569
|
+
"formResponse": FormResponseAutomationEvent
|
|
570
|
+
'formUnsubmitted': FormUnsubmittedEvent
|
|
571
|
+
}
|
|
531
572
|
|
|
532
573
|
interface AutomationActionBuilder <T extends AutomationActionType, V extends object> {
|
|
533
574
|
type: T,
|
|
@@ -538,12 +579,12 @@ export type SendEmailAutomationAction = AutomationActionBuilder<'sendEmail', Aut
|
|
|
538
579
|
export type SendSMSAutomationAction = AutomationActionBuilder<'sendSMS', AutomationForMessage>
|
|
539
580
|
export type SendFormAutomationAction = AutomationActionBuilder<'sendForm', AutomationForFormRequest>
|
|
540
581
|
export type UpdateStateForJourneyAutomationAction = AutomationActionBuilder<'updateStateForJourney', AutomationForJourneyAndState>
|
|
541
|
-
export type
|
|
542
|
-
export type AddToSequenceAutomationAction = AutomationActionBuilder<'addToSequence', AutomationForAutomation>
|
|
543
|
-
export type RemoveFromSequenceAutomationAction = AutomationActionBuilder<'removeFromSequence', AutomationForAutomation>
|
|
582
|
+
export type CreateTicketAutomationAction = AutomationActionBuilder<'createTicket', AutomationForTemplate>
|
|
583
|
+
export type AddToSequenceAutomationAction = AutomationActionBuilder<'addToSequence', AutomationForAutomation> // depreacted
|
|
584
|
+
export type RemoveFromSequenceAutomationAction = AutomationActionBuilder<'removeFromSequence', AutomationForAutomation> // deprecated
|
|
544
585
|
export type SendWebhookAutomationAction = AutomationActionBuilder<'sendWebhook', AutomationForWebhook>
|
|
545
586
|
|
|
546
|
-
export type AutomationConditionType = 'atJourneyState'
|
|
587
|
+
export type AutomationConditionType = 'atJourneyState' // deprecated
|
|
547
588
|
export type AutomationConditionBuilder <T extends AutomationConditionType, V extends object> = {
|
|
548
589
|
type: T,
|
|
549
590
|
info: V,
|
|
@@ -557,24 +598,23 @@ export type AutomationActionForType = {
|
|
|
557
598
|
"sendSMS": SendSMSAutomationAction,
|
|
558
599
|
"sendForm": SendFormAutomationAction,
|
|
559
600
|
"updateStateForJourney": UpdateStateForJourneyAutomationAction,
|
|
560
|
-
"
|
|
561
|
-
'addToSequence': AddToSequenceAutomationAction,
|
|
562
|
-
'removeFromSequence': RemoveFromSequenceAutomationAction,
|
|
601
|
+
"createTicket": CreateTicketAutomationAction,
|
|
602
|
+
'addToSequence': AddToSequenceAutomationAction, // deprecated
|
|
603
|
+
'removeFromSequence': RemoveFromSequenceAutomationAction, // deprecated
|
|
563
604
|
'sendWebhook': SendWebhookAutomationAction
|
|
564
605
|
}
|
|
565
606
|
export type AutomationActionType = keyof AutomationActionForType
|
|
566
607
|
export type AutomationAction = AutomationActionForType[AutomationActionType]
|
|
567
608
|
|
|
568
|
-
export interface
|
|
569
|
-
export interface
|
|
609
|
+
export interface AutomationStep_readonly extends ClientRecord {}
|
|
610
|
+
export interface AutomationStep_required {
|
|
570
611
|
event: AutomationEvent
|
|
571
612
|
conditions?: AutomationCondition[],
|
|
572
613
|
action: AutomationAction,
|
|
573
614
|
}
|
|
574
|
-
export interface
|
|
575
|
-
export interface
|
|
576
|
-
journeyId
|
|
577
|
-
formId?: string,
|
|
615
|
+
export interface AutomationStep_updatesDisabled {}
|
|
616
|
+
export interface AutomationStep extends AutomationStep_readonly, AutomationStep_required, AutomationStep_updatesDisabled {
|
|
617
|
+
journeyId: string,
|
|
578
618
|
}
|
|
579
619
|
|
|
580
620
|
export type RelatedRecord = { type: string, id: string }
|
|
@@ -590,19 +630,20 @@ export interface UserNotification extends UserNotification_readonly, UserNotific
|
|
|
590
630
|
relatedRecords?: RelatedRecord[],
|
|
591
631
|
}
|
|
592
632
|
|
|
593
|
-
export type
|
|
594
|
-
export interface
|
|
595
|
-
export interface
|
|
633
|
+
export type AutomatedActionStatus = 'active' | 'finished' | 'cancelled' | 'error'
|
|
634
|
+
export interface AutomatedAction_readonly extends ClientRecord {}
|
|
635
|
+
export interface AutomatedAction_required {
|
|
596
636
|
enduserId: string,
|
|
597
|
-
|
|
637
|
+
automationStepId: string,
|
|
598
638
|
event: AutomationEvent,
|
|
599
639
|
action: AutomationAction,
|
|
600
|
-
status:
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
640
|
+
status: AutomatedActionStatus,
|
|
641
|
+
cancelConditions: CancelCondition[]
|
|
642
|
+
processAfter: number,
|
|
643
|
+
errorMessage?: string,
|
|
604
644
|
}
|
|
605
|
-
export interface
|
|
645
|
+
export interface AutomatedAction_updatesDisabled {}
|
|
646
|
+
export interface AutomatedAction extends AutomatedAction_readonly, AutomatedAction_required, AutomatedAction_updatesDisabled {
|
|
606
647
|
|
|
607
648
|
}
|
|
608
649
|
|
|
@@ -646,8 +687,8 @@ export type ModelForName_required = {
|
|
|
646
687
|
forms: Form_required,
|
|
647
688
|
form_responses: FormResponse_required,
|
|
648
689
|
calendar_events: CalendarEvent_required,
|
|
649
|
-
|
|
650
|
-
|
|
690
|
+
automation_steps: AutomationStep_required,
|
|
691
|
+
automated_actions: AutomatedAction_required,
|
|
651
692
|
sequence_automations: SequenceAutomation_required,
|
|
652
693
|
webhooks: WebHook_required;
|
|
653
694
|
user_logs: UserLog_required;
|
|
@@ -674,8 +715,8 @@ export interface ModelForName_readonly {
|
|
|
674
715
|
forms: Form_readonly;
|
|
675
716
|
form_responses: FormResponse_readonly;
|
|
676
717
|
calendar_events: CalendarEvent_readonly,
|
|
677
|
-
|
|
678
|
-
|
|
718
|
+
automation_steps: AutomationStep_readonly,
|
|
719
|
+
automated_actions: AutomatedAction_readonly,
|
|
679
720
|
sequence_automations: SequenceAutomation_readonly,
|
|
680
721
|
webhooks: WebHook_readonly;
|
|
681
722
|
user_logs: UserLog_readonly;
|
|
@@ -702,8 +743,8 @@ export interface ModelForName_updatesDisabled {
|
|
|
702
743
|
forms: Form_updatesDisabled;
|
|
703
744
|
form_responses: FormResponse_updatesDisabled;
|
|
704
745
|
calendar_events: CalendarEvent_updatesDisabled,
|
|
705
|
-
|
|
706
|
-
|
|
746
|
+
automation_steps: AutomationStep_updatesDisabled,
|
|
747
|
+
automated_actions: AutomatedAction_updatesDisabled,
|
|
707
748
|
sequence_automations: SequenceAutomation_updatesDisabled,
|
|
708
749
|
webhooks: WebHook_updatesDisabled;
|
|
709
750
|
user_logs: UserLog_updatesDisabled;
|
|
@@ -730,8 +771,8 @@ export interface ModelForName extends ModelForName_required, ModelForName_readon
|
|
|
730
771
|
forms: Form;
|
|
731
772
|
form_responses: FormResponse;
|
|
732
773
|
calendar_events: CalendarEvent,
|
|
733
|
-
|
|
734
|
-
|
|
774
|
+
automation_steps: AutomationStep,
|
|
775
|
+
automated_actions: AutomatedAction,
|
|
735
776
|
sequence_automations: SequenceAutomation,
|
|
736
777
|
webhooks: WebHook;
|
|
737
778
|
user_logs: UserLog;
|
|
@@ -740,7 +781,7 @@ export interface ModelForName extends ModelForName_required, ModelForName_readon
|
|
|
740
781
|
export type ModelName = keyof ModelForName
|
|
741
782
|
export type Model = ModelForName[keyof ModelForName]
|
|
742
783
|
|
|
743
|
-
export type ConfiguredSessionInfo = { username: string, orgEmail: string,
|
|
784
|
+
export type ConfiguredSessionInfo = { username: string, orgEmail: string, fname: string, lname: string }
|
|
744
785
|
export type ConfiguredSession = UserSession & ConfiguredSessionInfo
|
|
745
786
|
|
|
746
787
|
export interface UserActivityInfo {
|
|
@@ -768,8 +809,8 @@ export const modelNameChecker: { [K in ModelName] : true } = {
|
|
|
768
809
|
forms: true,
|
|
769
810
|
form_responses: true,
|
|
770
811
|
calendar_events: true,
|
|
771
|
-
|
|
772
|
-
|
|
812
|
+
automation_steps: true,
|
|
813
|
+
automated_actions: true,
|
|
773
814
|
sequence_automations: true,
|
|
774
815
|
webhooks: true,
|
|
775
816
|
user_logs: true,
|