@terros-inc/sdk 1.0.10 → 1.0.11
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/index.d.mts +327 -189
- package/dist/index.mjs +30 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -49,7 +49,6 @@ type TinyTeam = {
|
|
|
49
49
|
};
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/models/shared.d.ts
|
|
52
|
-
type CustomFieldMap = Record<string, string | number | boolean | null>;
|
|
53
52
|
type AuditLog = {
|
|
54
53
|
userId: UserId;
|
|
55
54
|
timestamp: number;
|
|
@@ -88,6 +87,208 @@ type SmallAddress = Pick<Address, 'countrySubd' | 'line1' | 'locality' | 'postal
|
|
|
88
87
|
latlng: LatLng;
|
|
89
88
|
};
|
|
90
89
|
//#endregion
|
|
90
|
+
//#region src/models/calendar/model.d.ts
|
|
91
|
+
type CalendarEventId = `Event:${string}` | `Event.${string}`;
|
|
92
|
+
/** @deprecated */
|
|
93
|
+
type EventOutcomeId = `O.${string}`;
|
|
94
|
+
type InterviewId = `Interview:${string}` | `Interview.${string}`;
|
|
95
|
+
type AttachmentId = `Attachment:${string}` | `Attachment.${string}`;
|
|
96
|
+
type EventType = 'Consultation' | 'Comeback' | 'Interview' | 'GeneralVisit' | 'Shadow' | 'Team';
|
|
97
|
+
type SpecialtyAttachments = {
|
|
98
|
+
utilityBill?: AttachmentId;
|
|
99
|
+
customerVerification?: AttachmentId;
|
|
100
|
+
};
|
|
101
|
+
/** @deprecated */
|
|
102
|
+
type SyncedCalendarEvent = {
|
|
103
|
+
calendarType: string;
|
|
104
|
+
calendarId: string;
|
|
105
|
+
userId: UserId;
|
|
106
|
+
deviceId: string;
|
|
107
|
+
eventId: string;
|
|
108
|
+
};
|
|
109
|
+
type CalendarEventLocation = Pick<Address, 'oneLine'> & LatLng;
|
|
110
|
+
type UnsavedCalendarEventData = {
|
|
111
|
+
importId?: string;
|
|
112
|
+
eventType: EventType;
|
|
113
|
+
title: string;
|
|
114
|
+
sourceId?: string; /** UTC milliseconds. */
|
|
115
|
+
eventDate: number;
|
|
116
|
+
outcomeId?: EventOutcomeId;
|
|
117
|
+
dispositionId?: DispositionId; /** Minutes. */
|
|
118
|
+
duration: number;
|
|
119
|
+
attachments?: AttachmentId[];
|
|
120
|
+
specialtyAttachments?: SpecialtyAttachments;
|
|
121
|
+
accountId?: AccountId;
|
|
122
|
+
locationId?: LocationId;
|
|
123
|
+
location?: CalendarEventLocation;
|
|
124
|
+
ownerId?: UserId;
|
|
125
|
+
attendeeId?: UserId;
|
|
126
|
+
dispatcherId?: UserId;
|
|
127
|
+
occurredOwner?: boolean;
|
|
128
|
+
occurredAttendee?: boolean;
|
|
129
|
+
interviewId?: InterviewId; /** @deprecated */
|
|
130
|
+
notes?: string;
|
|
131
|
+
previousEventId?: CalendarEventId; /** @deprecated */
|
|
132
|
+
syncedCalendarIds?: string[]; /** @deprecated */
|
|
133
|
+
syncedCalendarEvents?: SyncedCalendarEvent[];
|
|
134
|
+
teamId?: TeamId;
|
|
135
|
+
};
|
|
136
|
+
type EventOutcomeHistory = {
|
|
137
|
+
outcomeId: EventOutcomeId;
|
|
138
|
+
userId: UserId;
|
|
139
|
+
timestamp: number;
|
|
140
|
+
};
|
|
141
|
+
type SitOutcomeFault = string;
|
|
142
|
+
type CalendarEventData = UnsavedCalendarEventData & {
|
|
143
|
+
outcomeHistory?: EventOutcomeHistory[];
|
|
144
|
+
createdAt?: number;
|
|
145
|
+
createdBy?: UserId;
|
|
146
|
+
updatedAt?: number;
|
|
147
|
+
updatedBy?: UserId;
|
|
148
|
+
eventId: CalendarEventId;
|
|
149
|
+
ownerId: UserId;
|
|
150
|
+
occurred?: boolean;
|
|
151
|
+
closed?: boolean;
|
|
152
|
+
reasonNotOccurred?: string;
|
|
153
|
+
fault?: SitOutcomeFault;
|
|
154
|
+
allDay?: boolean;
|
|
155
|
+
canDelete?: boolean;
|
|
156
|
+
};
|
|
157
|
+
type CalendarEventDataWithDetails = CalendarEventData & {
|
|
158
|
+
resident?: TinyResidentData;
|
|
159
|
+
owner?: SmallUser;
|
|
160
|
+
attendee?: SmallUser;
|
|
161
|
+
teams?: TinyTeam[];
|
|
162
|
+
account?: TinyWorkflowAccount;
|
|
163
|
+
};
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/models/calendar/api.d.ts
|
|
166
|
+
type CalendarEventRoleFilter = 'owner' | 'attendee';
|
|
167
|
+
type OptionalCalendarEventLocation = UpsertLatLng & {
|
|
168
|
+
locationId?: LocationId;
|
|
169
|
+
oneLine?: string;
|
|
170
|
+
};
|
|
171
|
+
/** A yes/no/unset filter — matches events where the field is true, false, unset, or set to any value. */
|
|
172
|
+
type BooleanFilter = 'true' | 'false' | 'undefined' | 'defined';
|
|
173
|
+
type CalendarAvailabilityInput = {
|
|
174
|
+
/** UTC milliseconds. */startDate: number; /** Minutes. Defaults to 30. */
|
|
175
|
+
duration?: number;
|
|
176
|
+
teamId?: TeamId;
|
|
177
|
+
};
|
|
178
|
+
type CalendarAvailabilitySuccess = ApiSuccess<{
|
|
179
|
+
available: boolean;
|
|
180
|
+
}>;
|
|
181
|
+
type CalendarClosersInput = CalendarAvailabilityInput & {
|
|
182
|
+
latLng?: LatLng;
|
|
183
|
+
};
|
|
184
|
+
type CalendarClosersSuccess = ApiSuccess<{
|
|
185
|
+
closers: AvailableCloser[];
|
|
186
|
+
}>;
|
|
187
|
+
type CalendarTimeslotsInput = {
|
|
188
|
+
targetId?: TeamId | UserId;
|
|
189
|
+
days?: number;
|
|
190
|
+
locationId?: LocationId; /** UTC milliseconds. */
|
|
191
|
+
startTime?: number;
|
|
192
|
+
};
|
|
193
|
+
type CalendarTimeslotsSuccess = ApiSuccess<{
|
|
194
|
+
closers: TinyCloser[];
|
|
195
|
+
}>;
|
|
196
|
+
type CalendarEventAddInput = {
|
|
197
|
+
event: UnsavedCalendarEventData; /** Defaults to true. */
|
|
198
|
+
errorOnCloserUnavailable?: boolean;
|
|
199
|
+
};
|
|
200
|
+
type CalendarEventAddSuccess = ApiSuccess<{
|
|
201
|
+
event: CalendarEventData;
|
|
202
|
+
}>;
|
|
203
|
+
type CalendarEventGetInput = {
|
|
204
|
+
eventId: CalendarEventId;
|
|
205
|
+
};
|
|
206
|
+
type CalendarEventGetSuccess = ApiSuccess<{
|
|
207
|
+
event: CalendarEventDataWithDetails;
|
|
208
|
+
}>;
|
|
209
|
+
type CalendarEventListInput = {
|
|
210
|
+
startTime?: number;
|
|
211
|
+
endTime?: number;
|
|
212
|
+
ownerId?: UserId;
|
|
213
|
+
locationId?: LocationId;
|
|
214
|
+
companyId?: string; /** @deprecated use teamIds */
|
|
215
|
+
teamId?: TeamId;
|
|
216
|
+
teamIds?: TeamId[];
|
|
217
|
+
roleIds?: RoleId[];
|
|
218
|
+
occurred?: BooleanFilter;
|
|
219
|
+
closed?: BooleanFilter;
|
|
220
|
+
eventType?: EventType;
|
|
221
|
+
filterByRoles?: CalendarEventRoleFilter[];
|
|
222
|
+
};
|
|
223
|
+
type CalendarEventListSuccess = ApiSuccess<{
|
|
224
|
+
events: CalendarEventDataWithDetails[];
|
|
225
|
+
}>;
|
|
226
|
+
type CalendarEventUpdateInput = {
|
|
227
|
+
event: Partial<CalendarEventData> & {
|
|
228
|
+
eventId: CalendarEventId;
|
|
229
|
+
attendeeId?: UserId | null;
|
|
230
|
+
};
|
|
231
|
+
errorOnCloserUnavailable?: boolean;
|
|
232
|
+
};
|
|
233
|
+
type CalendarEventUpdateSuccess = ApiSuccess<{
|
|
234
|
+
event: CalendarEventData;
|
|
235
|
+
}>;
|
|
236
|
+
type CalendarEventUpsertInput = {
|
|
237
|
+
event: Partial<{
|
|
238
|
+
eventId: CalendarEventId;
|
|
239
|
+
sourceId: string; /** Defaults to 'Consultation' on create. */
|
|
240
|
+
eventType: string;
|
|
241
|
+
title: string; /** Defaults to now on create. */
|
|
242
|
+
eventDate: string | number; /** An EventOutcomeId, integration mapping string, or case-insensitive name. */
|
|
243
|
+
outcomeId: string; /** Minutes. */
|
|
244
|
+
duration: number;
|
|
245
|
+
accountId: AccountId;
|
|
246
|
+
location: OptionalCalendarEventLocation; /** A UserId or email. Defaults to the authenticated user on create. */
|
|
247
|
+
ownerId: string; /** A UserId or email. Pass null to clear on update. */
|
|
248
|
+
attendeeId: string | null; /** A UserId or email. */
|
|
249
|
+
dispatcherId: string;
|
|
250
|
+
occurredOwner: boolean;
|
|
251
|
+
occurredAttendee: boolean;
|
|
252
|
+
notes: string;
|
|
253
|
+
previousEventId: CalendarEventId;
|
|
254
|
+
}>;
|
|
255
|
+
};
|
|
256
|
+
type CalendarEventUpsertSuccess = ApiSuccess<{
|
|
257
|
+
event: CalendarEventData;
|
|
258
|
+
}>;
|
|
259
|
+
type CalendarEventConfirmInput = {
|
|
260
|
+
eventId: CalendarEventId;
|
|
261
|
+
occurred?: boolean;
|
|
262
|
+
};
|
|
263
|
+
type CalendarEventConfirmSuccess = ApiSuccess<{
|
|
264
|
+
event: CalendarEventData;
|
|
265
|
+
}>;
|
|
266
|
+
type CalendarEventRemoveInput = {
|
|
267
|
+
archive?: boolean;
|
|
268
|
+
eventId: CalendarEventId;
|
|
269
|
+
};
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region src/models/customFields/model.d.ts
|
|
272
|
+
type CustomFieldId = `CF.${string}`;
|
|
273
|
+
/** use null to clear this field */
|
|
274
|
+
type CustomFieldType = string | number | boolean | AttachmentId | null;
|
|
275
|
+
type CustomFieldMap = Record<CustomFieldId, CustomFieldType>;
|
|
276
|
+
type RangeFilter = {
|
|
277
|
+
gte?: number;
|
|
278
|
+
lte?: number;
|
|
279
|
+
};
|
|
280
|
+
type CustomFieldFilter = Record<CustomFieldId, CustomFieldFilterValue>;
|
|
281
|
+
type CustomFieldFilterValue = {
|
|
282
|
+
type: 'range';
|
|
283
|
+
range: RangeFilter;
|
|
284
|
+
} | {
|
|
285
|
+
type: 'multipleChoice';
|
|
286
|
+
values: CustomFieldType[];
|
|
287
|
+
} | {
|
|
288
|
+
type: 'exists';
|
|
289
|
+
exists: boolean;
|
|
290
|
+
};
|
|
291
|
+
//#endregion
|
|
91
292
|
//#region src/models/company/model.d.ts
|
|
92
293
|
type CompanyKind = 'customer' | 'sandbox' | 'demo' | 'template' | 'development';
|
|
93
294
|
type AccessStatus = 'active' | 'suspended';
|
|
@@ -420,10 +621,6 @@ type TagId = `Tag.${string}`;
|
|
|
420
621
|
type LocationId = `Can.${string}` | `LocNew:${string}` | `LocNew.${string}` | `Loc:${string}` | `TLoc:${string}` | `TLoc.${string}` | `FA.${string}` | `PR.${string}`;
|
|
421
622
|
type DispositionId = `Disposition:${string}` | `Disposition.${string}` | 'NotHome' | 'Comeback' | 'NotNow' | 'NotQualified' | 'PartialPitch' | 'NewAccount' | 'Competitor' | 'Custom1' | 'Custom2' | 'Custom3';
|
|
422
623
|
type ContactMethod = 'door' | 'phone';
|
|
423
|
-
type RangeFilter = {
|
|
424
|
-
gte?: number;
|
|
425
|
-
lte?: number;
|
|
426
|
-
};
|
|
427
624
|
/** A cursor for paging through sorted account lists. */
|
|
428
625
|
type SortCursor = number | number[];
|
|
429
626
|
type AccountUserDetails = Omit<SmallUser, 'userId' | 'memberOf'>;
|
|
@@ -539,8 +736,6 @@ type AccountData = Omit<UnsavedAccount, 'contacts' | 'notes'> & {
|
|
|
539
736
|
};
|
|
540
737
|
type AccountSortBy = 'createdDate' | 'lastActionDate' | 'lastUpdatedDate' | `CF.${string}`;
|
|
541
738
|
type AccountSortOrder = 'asc' | 'desc';
|
|
542
|
-
/** Not modeled in detail by this SDK — treat as an opaque record. */
|
|
543
|
-
type CustomFieldFilter = Record<string, unknown>;
|
|
544
739
|
type AccountDataResponse = {
|
|
545
740
|
accounts: AccountData[];
|
|
546
741
|
sortTimestamp?: SortCursor;
|
|
@@ -552,28 +747,13 @@ type BulkModifyAccountsAction = ({
|
|
|
552
747
|
} | {
|
|
553
748
|
actionType: 'updateStage';
|
|
554
749
|
stageId: WorkflowStageId;
|
|
750
|
+
} | {
|
|
751
|
+
actionType: 'updateCustomField';
|
|
752
|
+
fieldId: CustomFieldId;
|
|
753
|
+
value: CustomFieldType;
|
|
555
754
|
} | {
|
|
556
755
|
actionType: 'delete' | 'clearDisposition';
|
|
557
756
|
})[];
|
|
558
|
-
/** Not modeled in detail by this SDK — treat as an opaque record. */
|
|
559
|
-
type ElasticFilter = {
|
|
560
|
-
cities?: string[];
|
|
561
|
-
states?: string[];
|
|
562
|
-
zipCodes?: string[];
|
|
563
|
-
advancedCustomFields?: CustomFieldFilter;
|
|
564
|
-
statusIds?: AccountStatusId[];
|
|
565
|
-
workflowStageIds?: WorkflowStageId[];
|
|
566
|
-
tagIds?: TagId[];
|
|
567
|
-
teamIds?: TeamId[];
|
|
568
|
-
userIds?: UserId[];
|
|
569
|
-
coordinates?: LatLng[];
|
|
570
|
-
boundingBox?: {
|
|
571
|
-
top: LatLng;
|
|
572
|
-
bottom: LatLng;
|
|
573
|
-
};
|
|
574
|
-
workflowActionCount?: RangeFilter;
|
|
575
|
-
contactCount?: RangeFilter;
|
|
576
|
-
};
|
|
577
757
|
type PartialAddress = Partial<Omit<SmallAddress, 'latlng'>> & {
|
|
578
758
|
latlng?: Partial<LatLng>;
|
|
579
759
|
};
|
|
@@ -622,6 +802,24 @@ type AccountStatusData = UnsavedAccountStatus & {
|
|
|
622
802
|
type TinyAccountStatus = Pick<AccountStatusData, 'name' | 'statusId'>;
|
|
623
803
|
//#endregion
|
|
624
804
|
//#region src/models/account/api.d.ts
|
|
805
|
+
type ElasticFilter = {
|
|
806
|
+
cities?: string[];
|
|
807
|
+
states?: string[];
|
|
808
|
+
zipCodes?: string[];
|
|
809
|
+
advancedCustomFields?: CustomFieldFilter;
|
|
810
|
+
statusIds?: AccountStatusId[];
|
|
811
|
+
workflowStageIds?: WorkflowStageId[];
|
|
812
|
+
tagIds?: TagId[];
|
|
813
|
+
teamIds?: TeamId[];
|
|
814
|
+
userIds?: UserId[];
|
|
815
|
+
coordinates?: LatLng[];
|
|
816
|
+
boundingBox?: {
|
|
817
|
+
top: LatLng;
|
|
818
|
+
bottom: LatLng;
|
|
819
|
+
};
|
|
820
|
+
workflowActionCount?: RangeFilter;
|
|
821
|
+
contactCount?: RangeFilter;
|
|
822
|
+
};
|
|
625
823
|
type AccountStatusSearchInput = {
|
|
626
824
|
accountIds?: AccountId[];
|
|
627
825
|
workflowId?: WorkflowId;
|
|
@@ -777,185 +975,112 @@ type AccountStatusRemoveInput = {
|
|
|
777
975
|
statusId: AccountStatusId;
|
|
778
976
|
};
|
|
779
977
|
//#endregion
|
|
780
|
-
//#region src/models/
|
|
781
|
-
type
|
|
782
|
-
|
|
783
|
-
type
|
|
784
|
-
type
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
978
|
+
//#region src/models/area/model.d.ts
|
|
979
|
+
type AreaId = `Area.${string}`;
|
|
980
|
+
type AreaAssignmentType = 'user' | 'team' | 'company' | 'draft';
|
|
981
|
+
type AreaRunType = 'assign' | 'unassign' | 'reassign';
|
|
982
|
+
type AreaFilters = {
|
|
983
|
+
cities?: string[];
|
|
984
|
+
states?: string[];
|
|
985
|
+
zipCodes?: string[];
|
|
986
|
+
statusIds?: AccountStatusId[];
|
|
987
|
+
workflowStageIds?: WorkflowStageId[];
|
|
988
|
+
teamIds?: TeamId[];
|
|
989
|
+
userIds?: UserId[];
|
|
990
|
+
customFields?: {
|
|
991
|
+
id: CustomFieldId;
|
|
992
|
+
value: CustomFieldType;
|
|
993
|
+
}[];
|
|
994
|
+
advancedCustomFields?: CustomFieldFilter;
|
|
790
995
|
};
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
996
|
+
type AreaAssignmentConfig = {
|
|
997
|
+
enabled: false;
|
|
998
|
+
autoRunOnImport?: boolean;
|
|
999
|
+
} | {
|
|
1000
|
+
enabled: true;
|
|
1001
|
+
autoRunOnImport?: boolean;
|
|
1002
|
+
order: number;
|
|
798
1003
|
};
|
|
799
|
-
type
|
|
800
|
-
type
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
eventDate: number;
|
|
806
|
-
outcomeId?: EventOutcomeId;
|
|
807
|
-
dispositionId?: DispositionId; /** Minutes. */
|
|
808
|
-
duration: number;
|
|
809
|
-
attachments?: AttachmentId[];
|
|
810
|
-
specialtyAttachments?: SpecialtyAttachments;
|
|
811
|
-
accountId?: AccountId;
|
|
812
|
-
locationId?: LocationId;
|
|
813
|
-
location?: CalendarEventLocation;
|
|
814
|
-
ownerId?: UserId;
|
|
815
|
-
attendeeId?: UserId;
|
|
816
|
-
dispatcherId?: UserId;
|
|
817
|
-
occurredOwner?: boolean;
|
|
818
|
-
occurredAttendee?: boolean;
|
|
819
|
-
interviewId?: InterviewId; /** @deprecated */
|
|
820
|
-
notes?: string;
|
|
821
|
-
previousEventId?: CalendarEventId; /** @deprecated */
|
|
822
|
-
syncedCalendarIds?: string[]; /** @deprecated */
|
|
823
|
-
syncedCalendarEvents?: SyncedCalendarEvent[];
|
|
1004
|
+
type AreaScheduleEntry = {
|
|
1005
|
+
type: 'assign' | 'unassign';
|
|
1006
|
+
at: number;
|
|
1007
|
+
} | {
|
|
1008
|
+
type: 'reassign';
|
|
1009
|
+
at: number;
|
|
824
1010
|
teamId?: TeamId;
|
|
1011
|
+
userIds?: UserId[];
|
|
825
1012
|
};
|
|
826
|
-
type
|
|
827
|
-
outcomeId: EventOutcomeId;
|
|
828
|
-
userId: UserId;
|
|
1013
|
+
type AreaRunHistoryEntry = {
|
|
829
1014
|
timestamp: number;
|
|
830
|
-
|
|
831
|
-
type
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
createdAt?: number;
|
|
835
|
-
createdBy?: UserId;
|
|
836
|
-
updatedAt?: number;
|
|
837
|
-
updatedBy?: UserId;
|
|
838
|
-
eventId: CalendarEventId;
|
|
839
|
-
ownerId: UserId;
|
|
840
|
-
occurred?: boolean;
|
|
841
|
-
closed?: boolean;
|
|
842
|
-
reasonNotOccurred?: string;
|
|
843
|
-
fault?: SitOutcomeFault;
|
|
844
|
-
allDay?: boolean;
|
|
845
|
-
canDelete?: boolean;
|
|
846
|
-
};
|
|
847
|
-
type CalendarEventDataWithDetails = CalendarEventData & {
|
|
848
|
-
resident?: TinyResidentData;
|
|
849
|
-
owner?: SmallUser;
|
|
850
|
-
attendee?: SmallUser;
|
|
851
|
-
teams?: TinyTeam[];
|
|
852
|
-
account?: TinyWorkflowAccount;
|
|
853
|
-
};
|
|
854
|
-
//#endregion
|
|
855
|
-
//#region src/models/calendar/api.d.ts
|
|
856
|
-
type CalendarEventRoleFilter = 'owner' | 'attendee';
|
|
857
|
-
type OptionalCalendarEventLocation = UpsertLatLng & {
|
|
858
|
-
locationId?: LocationId;
|
|
859
|
-
oneLine?: string;
|
|
860
|
-
};
|
|
861
|
-
/** A yes/no/unset filter — matches events where the field is true, false, unset, or set to any value. */
|
|
862
|
-
type BooleanFilter = 'true' | 'false' | 'undefined' | 'defined';
|
|
863
|
-
type CalendarAvailabilityInput = {
|
|
864
|
-
/** UTC milliseconds. */startDate: number; /** Minutes. Defaults to 30. */
|
|
865
|
-
duration?: number;
|
|
1015
|
+
count: number;
|
|
1016
|
+
type?: AreaRunType;
|
|
1017
|
+
runBy?: UserId;
|
|
1018
|
+
process?: string;
|
|
866
1019
|
teamId?: TeamId;
|
|
1020
|
+
userIds?: UserId[];
|
|
867
1021
|
};
|
|
868
|
-
type
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
1022
|
+
type AreaJobInfo = {
|
|
1023
|
+
total: number;
|
|
1024
|
+
assigned: number;
|
|
1025
|
+
assignedDate: number;
|
|
1026
|
+
isRunning: boolean;
|
|
1027
|
+
status: 'preparing' | 'queued' | 'running' | 'completed';
|
|
1028
|
+
};
|
|
1029
|
+
type UnsavedArea = {
|
|
1030
|
+
name?: string;
|
|
1031
|
+
coordinates: LatLng[];
|
|
1032
|
+
assignmentType: AreaAssignmentType;
|
|
1033
|
+
teamId?: TeamId;
|
|
1034
|
+
userIds?: UserId[];
|
|
1035
|
+
color?: string;
|
|
1036
|
+
note?: string;
|
|
1037
|
+
filters?: AreaFilters;
|
|
1038
|
+
assignmentConfig?: AreaAssignmentConfig;
|
|
1039
|
+
schedule?: AreaScheduleEntry[];
|
|
882
1040
|
};
|
|
883
|
-
type
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
1041
|
+
type AreaData = UnsavedArea & AuditProps & {
|
|
1042
|
+
areaId: AreaId;
|
|
1043
|
+
importId?: string;
|
|
1044
|
+
deleteOnCompletion?: boolean;
|
|
1045
|
+
runHistory?: AreaRunHistoryEntry[];
|
|
1046
|
+
jobInfo?: AreaJobInfo;
|
|
889
1047
|
};
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
type
|
|
894
|
-
|
|
1048
|
+
//#endregion
|
|
1049
|
+
//#region src/models/area/api.d.ts
|
|
1050
|
+
type AreaSortCursor = string | number | boolean | (string | number | boolean)[];
|
|
1051
|
+
type AreaGetInput = {
|
|
1052
|
+
areaId: AreaId;
|
|
895
1053
|
};
|
|
896
|
-
type
|
|
897
|
-
|
|
1054
|
+
type AreaGetSuccess = ApiSuccess<{
|
|
1055
|
+
area: AreaData;
|
|
898
1056
|
}>;
|
|
899
|
-
type
|
|
900
|
-
|
|
901
|
-
endTime?: number;
|
|
902
|
-
ownerId?: UserId;
|
|
903
|
-
locationId?: LocationId;
|
|
904
|
-
companyId?: string; /** @deprecated use teamIds */
|
|
1057
|
+
type AreaListInput = {
|
|
1058
|
+
userId?: UserId;
|
|
905
1059
|
teamId?: TeamId;
|
|
906
1060
|
teamIds?: TeamId[];
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
eventType?: EventType;
|
|
911
|
-
filterByRoles?: CalendarEventRoleFilter[];
|
|
912
|
-
};
|
|
913
|
-
type CalendarEventListSuccess = ApiSuccess<{
|
|
914
|
-
events: CalendarEventDataWithDetails[];
|
|
915
|
-
}>;
|
|
916
|
-
type CalendarEventUpdateInput = {
|
|
917
|
-
event: Partial<CalendarEventData> & {
|
|
918
|
-
eventId: CalendarEventId;
|
|
919
|
-
attendeeId?: UserId | null;
|
|
920
|
-
};
|
|
921
|
-
errorOnCloserUnavailable?: boolean;
|
|
1061
|
+
downlineTeamIds?: TeamId[];
|
|
1062
|
+
cursor?: AreaSortCursor;
|
|
1063
|
+
size?: number;
|
|
922
1064
|
};
|
|
923
|
-
type
|
|
924
|
-
|
|
1065
|
+
type AreaListSuccess = ApiSuccess<{
|
|
1066
|
+
areas: AreaData[];
|
|
1067
|
+
cursor?: AreaSortCursor;
|
|
925
1068
|
}>;
|
|
926
|
-
type
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
sourceId: string; /** Defaults to 'Consultation' on create. */
|
|
930
|
-
eventType: string;
|
|
931
|
-
title: string; /** Defaults to now on create. */
|
|
932
|
-
eventDate: string | number; /** An EventOutcomeId, integration mapping string, or case-insensitive name. */
|
|
933
|
-
outcomeId: string; /** Minutes. */
|
|
934
|
-
duration: number;
|
|
935
|
-
accountId: AccountId;
|
|
936
|
-
location: OptionalCalendarEventLocation; /** A UserId or email. Defaults to the authenticated user on create. */
|
|
937
|
-
ownerId: string; /** A UserId or email. Pass null to clear on update. */
|
|
938
|
-
attendeeId: string | null; /** A UserId or email. */
|
|
939
|
-
dispatcherId: string;
|
|
940
|
-
occurredOwner: boolean;
|
|
941
|
-
occurredAttendee: boolean;
|
|
942
|
-
notes: string;
|
|
943
|
-
previousEventId: CalendarEventId;
|
|
944
|
-
}>;
|
|
945
|
-
};
|
|
946
|
-
type CalendarEventUpsertSuccess = ApiSuccess<{
|
|
947
|
-
event: CalendarEventData;
|
|
1069
|
+
type AreaAddInput = UnsavedArea;
|
|
1070
|
+
type AreaAddSuccess = ApiSuccess<{
|
|
1071
|
+
area: AreaData;
|
|
948
1072
|
}>;
|
|
949
|
-
type
|
|
950
|
-
|
|
951
|
-
occurred?: boolean;
|
|
1073
|
+
type AreaUpdateInput = {
|
|
1074
|
+
area: AreaData;
|
|
952
1075
|
};
|
|
953
|
-
type
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
type CalendarEventRemoveInput = {
|
|
1076
|
+
type AreaUpdateSuccess = AreaAddSuccess;
|
|
1077
|
+
type AreaRemoveInput = {
|
|
1078
|
+
areaId: AreaId;
|
|
957
1079
|
archive?: boolean;
|
|
958
|
-
|
|
1080
|
+
};
|
|
1081
|
+
type AreaAssignInput = {
|
|
1082
|
+
areas: AreaData[];
|
|
1083
|
+
runType: AreaRunType;
|
|
959
1084
|
};
|
|
960
1085
|
//#endregion
|
|
961
1086
|
//#region src/models/connect/app/model.d.ts
|
|
@@ -1087,6 +1212,18 @@ declare class AccountClient {
|
|
|
1087
1212
|
upsert(input: AccountUpsertInput): Promise<AccountUpsertSuccess>;
|
|
1088
1213
|
}
|
|
1089
1214
|
//#endregion
|
|
1215
|
+
//#region src/clients/area.d.ts
|
|
1216
|
+
declare class AreaClient {
|
|
1217
|
+
private readonly api;
|
|
1218
|
+
constructor(api: TerrosApiClient);
|
|
1219
|
+
list(input: AreaListInput): Promise<AreaListSuccess>;
|
|
1220
|
+
get(input: AreaGetInput): Promise<AreaGetSuccess>;
|
|
1221
|
+
add(input: AreaAddInput): Promise<AreaAddSuccess>;
|
|
1222
|
+
update(input: AreaUpdateInput): Promise<AreaUpdateSuccess>;
|
|
1223
|
+
remove(input: AreaRemoveInput): Promise<ApiSuccess>;
|
|
1224
|
+
assign(input: AreaAssignInput): Promise<ApiSuccess>;
|
|
1225
|
+
}
|
|
1226
|
+
//#endregion
|
|
1090
1227
|
//#region src/clients/calendar.d.ts
|
|
1091
1228
|
declare class CalendarEventClient {
|
|
1092
1229
|
private readonly api;
|
|
@@ -1148,6 +1285,7 @@ declare class UserClient {
|
|
|
1148
1285
|
//#region src/client.d.ts
|
|
1149
1286
|
declare class TerrosClient {
|
|
1150
1287
|
readonly account: AccountClient;
|
|
1288
|
+
readonly area: AreaClient;
|
|
1151
1289
|
readonly calendar: CalendarClient;
|
|
1152
1290
|
readonly connect: ConnectClient;
|
|
1153
1291
|
readonly user: UserClient;
|
|
@@ -1155,7 +1293,7 @@ declare class TerrosClient {
|
|
|
1155
1293
|
}
|
|
1156
1294
|
//#endregion
|
|
1157
1295
|
//#region src/connect/handler.d.ts
|
|
1158
|
-
type ConnectHandlerFunction<Input, Result> = (payload: ConnectExecutionInput<Input>, client:
|
|
1296
|
+
type ConnectHandlerFunction<Input, Result> = (payload: ConnectExecutionInput<Input>, client: TerrosClient) => Promise<Result>;
|
|
1159
1297
|
type ConnectExecutionConfig = {
|
|
1160
1298
|
scriptConfig: Record<string, string>;
|
|
1161
1299
|
secrets: Record<string, string>;
|
|
@@ -1172,4 +1310,4 @@ type ConnectExecutionInput<Payload> = {
|
|
|
1172
1310
|
type WrappedHandler<Input, Result> = (input: ConnectExecutionInput<Input>) => Promise<Result>;
|
|
1173
1311
|
declare function wrapConnectHandler<Input, Result = void>(handler: ConnectHandlerFunction<Input, Result>): WrappedHandler<Input, Result>;
|
|
1174
1312
|
//#endregion
|
|
1175
|
-
export { AccessStatus, AccountAddInput, AccountAddSuccess, AccountContact, AccountData, AccountDataResponse, AccountGetInput, AccountGetSuccess, AccountHooksInput, AccountId, AccountListInput, AccountListSuccess, AccountMatchInput, AccountMatchSuccess, AccountNote, AccountPartialUpdateInput, AccountRemoveInput, AccountSortBy, AccountSortOrder, AccountStatusAddInput, AccountStatusAddSuccess, AccountStatusCode, AccountStatusData, AccountStatusId, AccountStatusListInput, AccountStatusListSuccess, AccountStatusRemoveInput, AccountStatusSearchInput, AccountStatusUpdateInput, AccountStatusUpdateSuccess, AccountUpdateBatchInput, AccountUpdateBatchSuccess, AccountUpdateInput, AccountUpdateSuccess, AccountUpsertInput, AccountUpsertSuccess, AccountUserDetails, Address, AppId, AppVersionData, AppVersionId, AttachmentId, AuditLog, AuditProps, AvailableCloser, BillingMethod, BulkModifyAccountsAction, BulkModifyAccountsInput, CalendarAvailabilityInput, CalendarAvailabilitySuccess, CalendarClosersInput, CalendarClosersSuccess, CalendarEventAddInput, CalendarEventAddSuccess, CalendarEventConfirmInput, CalendarEventConfirmSuccess, CalendarEventData, CalendarEventDataWithDetails, CalendarEventGetInput, CalendarEventGetSuccess, CalendarEventId, CalendarEventListInput, CalendarEventListSuccess, CalendarEventLocation, CalendarEventRemoveInput, CalendarEventUpdateInput, CalendarEventUpdateSuccess, CalendarEventUpsertInput, CalendarEventUpsertSuccess, CalendarTimeslotsInput, CalendarTimeslotsSuccess, CloserSettings, CloserStatus, CompanyData, CompanyId, CompanyIndustry, CompanyKind, CompanyWebhook, CompanyWebhookData, ConfigSchemaField, ConnectHandlerFunction, ContactId,
|
|
1313
|
+
export { AccessStatus, AccountAddInput, AccountAddSuccess, AccountContact, AccountData, AccountDataResponse, AccountGetInput, AccountGetSuccess, AccountHooksInput, AccountId, AccountListInput, AccountListSuccess, AccountMatchInput, AccountMatchSuccess, AccountNote, AccountPartialUpdateInput, AccountRemoveInput, AccountSortBy, AccountSortOrder, AccountStatusAddInput, AccountStatusAddSuccess, AccountStatusCode, AccountStatusData, AccountStatusId, AccountStatusListInput, AccountStatusListSuccess, AccountStatusRemoveInput, AccountStatusSearchInput, AccountStatusUpdateInput, AccountStatusUpdateSuccess, AccountUpdateBatchInput, AccountUpdateBatchSuccess, AccountUpdateInput, AccountUpdateSuccess, AccountUpsertInput, AccountUpsertSuccess, AccountUserDetails, Address, AppId, AppVersionData, AppVersionId, AreaAddInput, AreaAddSuccess, AreaAssignInput, AreaAssignmentConfig, AreaAssignmentType, AreaData, AreaFilters, AreaGetInput, AreaGetSuccess, AreaId, AreaJobInfo, AreaListInput, AreaListSuccess, AreaRemoveInput, AreaRunHistoryEntry, AreaRunType, AreaScheduleEntry, AreaSortCursor, AreaUpdateInput, AreaUpdateSuccess, AttachmentId, AuditLog, AuditProps, AvailableCloser, BillingMethod, BulkModifyAccountsAction, BulkModifyAccountsInput, CalendarAvailabilityInput, CalendarAvailabilitySuccess, CalendarClosersInput, CalendarClosersSuccess, CalendarEventAddInput, CalendarEventAddSuccess, CalendarEventConfirmInput, CalendarEventConfirmSuccess, CalendarEventData, CalendarEventDataWithDetails, CalendarEventGetInput, CalendarEventGetSuccess, CalendarEventId, CalendarEventListInput, CalendarEventListSuccess, CalendarEventLocation, CalendarEventRemoveInput, CalendarEventUpdateInput, CalendarEventUpdateSuccess, CalendarEventUpsertInput, CalendarEventUpsertSuccess, CalendarTimeslotsInput, CalendarTimeslotsSuccess, CloserSettings, CloserStatus, CompanyData, CompanyId, CompanyIndustry, CompanyKind, CompanyWebhook, CompanyWebhookData, ConfigSchemaField, ConnectHandlerFunction, ContactId, DispositionId, ElasticFilter, EntityId, EventOutcomeHistory, EventOutcomeId, EventType, IncomingScript, InterviewId, LatLng, LocationId, NoteId, NotificationPreference, OutgoingScript, PartialAddress, PermissionMap, RoleId, ScheduledScript, ScriptAddInput, ScriptAddSuccess, ScriptBase, ScriptData, SmallAddress, SmallCloser, SmallUser, SortCursor, SpecialtyAttachments, StatusHistoryItem, SyncedCalendarEvent, TagId, TeamId, TerrosClient, TinyAccountStatus, TinyCloser, TinyResidentData, TinyRole, TinyTeam, TinyUser, TinyWorkflowAccount, UnsavedAccount, UnsavedAccountContact, UnsavedAccountNote, UnsavedAccountStatus, UnsavedAppVersion, UnsavedArea, UnsavedCalendarEventData, UnsavedScript, UnsavedUser, UpsertLatLng, UpsertTinyResidentData, UserAddInput, UserAddSuccess, UserBulkUpdateInput, UserBulkUpdateSuccess, UserClosersInput, UserClosersSuccess, UserData, UserGetInput, UserGetSuccess, UserHistory, UserId, UserIdentifier, UserListInput, UserListSuccess, UserManagerInput, UserManagerSuccess, UserPreferences, UserProfileData, UserProfileInput, UserProfileSuccess, UserRemoveInput, UserReportInput, UserReportSuccess, UserSearchInput, UserSearchSuccess, UserTeamData, UserTeamsByLevel, UserTimezoneInput, UserUpdateInput, UserUpdateSuccess, UserWebhook, UserWebhookData, VersionAddInput, VersionAddSuccess, VersionUpdateInput, VersionUpdateSuccess, WebhookAddUpdatePayload, WebhookAuditProps, WebhookPayload, WebhookRemovePayload, Weekday, WorkflowActionId, WorkflowHistoryItem, WorkflowId, WorkflowStageId, wrapConnectHandler };
|
package/dist/index.mjs
CHANGED
|
@@ -149,7 +149,7 @@ function readProcessEnv(key) {
|
|
|
149
149
|
}
|
|
150
150
|
//#endregion
|
|
151
151
|
//#region package.json
|
|
152
|
-
var version = "1.0.
|
|
152
|
+
var version = "1.0.11";
|
|
153
153
|
//#endregion
|
|
154
154
|
//#region src/clients/account.ts
|
|
155
155
|
var AccountStatusClient = class {
|
|
@@ -206,6 +206,32 @@ var AccountClient = class {
|
|
|
206
206
|
}
|
|
207
207
|
};
|
|
208
208
|
//#endregion
|
|
209
|
+
//#region src/clients/area.ts
|
|
210
|
+
var AreaClient = class {
|
|
211
|
+
api;
|
|
212
|
+
constructor(api) {
|
|
213
|
+
this.api = api;
|
|
214
|
+
}
|
|
215
|
+
list(input) {
|
|
216
|
+
return this.api.call("area/list", input);
|
|
217
|
+
}
|
|
218
|
+
get(input) {
|
|
219
|
+
return this.api.call("area/get", input);
|
|
220
|
+
}
|
|
221
|
+
add(input) {
|
|
222
|
+
return this.api.call("area/add", input);
|
|
223
|
+
}
|
|
224
|
+
update(input) {
|
|
225
|
+
return this.api.call("area/update", input);
|
|
226
|
+
}
|
|
227
|
+
remove(input) {
|
|
228
|
+
return this.api.call("area/remove", input);
|
|
229
|
+
}
|
|
230
|
+
assign(input) {
|
|
231
|
+
return this.api.call("area/assign", input);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
//#endregion
|
|
209
235
|
//#region src/clients/calendar.ts
|
|
210
236
|
var CalendarEventClient = class {
|
|
211
237
|
api;
|
|
@@ -332,6 +358,7 @@ var UserClient = class {
|
|
|
332
358
|
//#region src/client.ts
|
|
333
359
|
var TerrosClient = class {
|
|
334
360
|
account;
|
|
361
|
+
area;
|
|
335
362
|
calendar;
|
|
336
363
|
connect;
|
|
337
364
|
user;
|
|
@@ -341,6 +368,7 @@ var TerrosClient = class {
|
|
|
341
368
|
analytics: { "Terros-App-Version": version }
|
|
342
369
|
});
|
|
343
370
|
this.account = new AccountClient(api);
|
|
371
|
+
this.area = new AreaClient(api);
|
|
344
372
|
this.calendar = new CalendarClient(api);
|
|
345
373
|
this.connect = new ConnectClient(api);
|
|
346
374
|
this.user = new UserClient(api);
|
|
@@ -352,7 +380,7 @@ function wrapConnectHandler(handler) {
|
|
|
352
380
|
return async (input) => {
|
|
353
381
|
const apiKey = input.context.config.authorization;
|
|
354
382
|
delete input.context.config.authorization;
|
|
355
|
-
return await handler(input, new
|
|
383
|
+
return await handler(input, new TerrosClient({ apiKey: apiKey?.replace(/^ApiKey /, "") }));
|
|
356
384
|
};
|
|
357
385
|
}
|
|
358
386
|
//#endregion
|