pyrus-api 1.0.2 → 1.1.0
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/build/types/index.d.ts +1403 -51
- package/package.json +3 -2
- package/build/types/src/api/announcementsApi.d.ts +0 -14
- package/build/types/src/api/baseApi.d.ts +0 -21
- package/build/types/src/api/botApi.d.ts +0 -17
- package/build/types/src/api/calendarApi.d.ts +0 -8
- package/build/types/src/api/callApi.d.ts +0 -11
- package/build/types/src/api/catalogsApi.d.ts +0 -22
- package/build/types/src/api/contactsApi.d.ts +0 -8
- package/build/types/src/api/filesApi.d.ts +0 -8
- package/build/types/src/api/formsApi.d.ts +0 -17
- package/build/types/src/api/index.d.ts +0 -1
- package/build/types/src/api/listsApi.d.ts +0 -20
- package/build/types/src/api/logsApi.d.ts +0 -13
- package/build/types/src/api/membersApi.d.ts +0 -21
- package/build/types/src/api/profileApi.d.ts +0 -8
- package/build/types/src/api/pyrusApiClient.d.ts +0 -57
- package/build/types/src/api/roleApi.d.ts +0 -15
- package/build/types/src/api/tasksApi.d.ts +0 -18
- package/build/types/src/entities/TaskWithComments.d.ts +0 -7
- package/build/types/src/entities/announcementComment.d.ts +0 -12
- package/build/types/src/entities/announcementWithComments.d.ts +0 -13
- package/build/types/src/entities/approval.d.ts +0 -7
- package/build/types/src/entities/attachedFile.d.ts +0 -9
- package/build/types/src/entities/bot.d.ts +0 -15
- package/build/types/src/entities/catalogHeader.d.ts +0 -9
- package/build/types/src/entities/catalogInfo.d.ts +0 -19
- package/build/types/src/entities/catalogItem.d.ts +0 -12
- package/build/types/src/entities/channel.d.ts +0 -8
- package/build/types/src/entities/channelUser.d.ts +0 -4
- package/build/types/src/entities/columnSettings.d.ts +0 -6
- package/build/types/src/entities/commentDescription.d.ts +0 -6
- package/build/types/src/entities/department.d.ts +0 -7
- package/build/types/src/entities/dueFilter.d.ts +0 -3
- package/build/types/src/entities/formFieldInfo.d.ts +0 -21
- package/build/types/src/entities/formFields/formField.d.ts +0 -26
- package/build/types/src/entities/formFields/formFieldAuthor.d.ts +0 -7
- package/build/types/src/entities/formFields/formFieldBase.d.ts +0 -12
- package/build/types/src/entities/formFields/formFieldCatalog.d.ts +0 -15
- package/build/types/src/entities/formFields/formFieldCheckmark.d.ts +0 -7
- package/build/types/src/entities/formFields/formFieldCreateDate.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldDate.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldDueDate.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldDueDateTime.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldEmail.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldFile.d.ts +0 -7
- package/build/types/src/entities/formFields/formFieldFlag.d.ts +0 -7
- package/build/types/src/entities/formFields/formFieldFormLink.d.ts +0 -7
- package/build/types/src/entities/formFields/formFieldMoney.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldMultipleChoice.d.ts +0 -14
- package/build/types/src/entities/formFields/formFieldNewFile.d.ts +0 -5
- package/build/types/src/entities/formFields/formFieldNote.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldNumber.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldPerson.d.ts +0 -7
- package/build/types/src/entities/formFields/formFieldPhone.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldProject.d.ts +0 -15
- package/build/types/src/entities/formFields/formFieldStatus.d.ts +0 -7
- package/build/types/src/entities/formFields/formFieldStep.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldTable.d.ts +0 -14
- package/build/types/src/entities/formFields/formFieldText.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldTime.d.ts +0 -6
- package/build/types/src/entities/formFields/formFieldTitle.d.ts +0 -13
- package/build/types/src/entities/formLink.d.ts +0 -5
- package/build/types/src/entities/formMapping.d.ts +0 -16
- package/build/types/src/entities/newFile.d.ts +0 -7
- package/build/types/src/entities/organization.d.ts +0 -9
- package/build/types/src/entities/person.d.ts +0 -19
- package/build/types/src/entities/plainTaskList.d.ts +0 -15
- package/build/types/src/entities/printForm.d.ts +0 -4
- package/build/types/src/entities/role.d.ts +0 -10
- package/build/types/src/entities/sessionLifespan.d.ts +0 -4
- package/build/types/src/entities/sessionRestriction.d.ts +0 -9
- package/build/types/src/entities/settings.d.ts +0 -5
- package/build/types/src/entities/smsInfo.d.ts +0 -8
- package/build/types/src/entities/step.d.ts +0 -5
- package/build/types/src/entities/subscriber.d.ts +0 -6
- package/build/types/src/entities/task.d.ts +0 -26
- package/build/types/src/entities/taskComment.d.ts +0 -50
- package/build/types/src/entities/taskHeader.d.ts +0 -11
- package/build/types/src/entities/taskList.d.ts +0 -4
- package/build/types/src/enums/activityAction.d.ts +0 -4
- package/build/types/src/enums/approvalChoice.d.ts +0 -7
- package/build/types/src/enums/callEventType.d.ts +0 -3
- package/build/types/src/enums/callStatus.d.ts +0 -7
- package/build/types/src/enums/channelType.d.ts +0 -23
- package/build/types/src/enums/checkmark.d.ts +0 -4
- package/build/types/src/enums/disconnectParty.d.ts +0 -6
- package/build/types/src/enums/errorCodeType.d.ts +0 -123
- package/build/types/src/enums/filterMask.d.ts +0 -20
- package/build/types/src/enums/flag.d.ts +0 -5
- package/build/types/src/enums/formFieldType.d.ts +0 -27
- package/build/types/src/enums/listType.d.ts +0 -4
- package/build/types/src/enums/operatorId.d.ts +0 -9
- package/build/types/src/enums/permissionLevel.d.ts +0 -6
- package/build/types/src/enums/personRights.d.ts +0 -24
- package/build/types/src/enums/personType.d.ts +0 -5
- package/build/types/src/enums/sendSmsError.d.ts +0 -11
- package/build/types/src/enums/sendSmsStatus.d.ts +0 -6
- package/build/types/src/enums/sourceType.d.ts +0 -4
- package/build/types/src/enums/status.d.ts +0 -4
- package/build/types/src/helpers/constants.d.ts +0 -8
- package/build/types/src/helpers/functions.d.ts +0 -13
- package/build/types/src/helpers/types.d.ts +0 -4
- package/build/types/src/requests/announcementCommentRequest.d.ts +0 -6
- package/build/types/src/requests/announcementRequest.d.ts +0 -6
- package/build/types/src/requests/attachCallRecordRequest.d.ts +0 -37
- package/build/types/src/requests/authRequest.d.ts +0 -11
- package/build/types/src/requests/calendarTasksRequest.d.ts +0 -24
- package/build/types/src/requests/callRequest.d.ts +0 -27
- package/build/types/src/requests/catalogRequestBase.d.ts +0 -15
- package/build/types/src/requests/changePermissionsRequest.d.ts +0 -4
- package/build/types/src/requests/contactsRequest.d.ts +0 -3
- package/build/types/src/requests/createBotRequest.d.ts +0 -5
- package/build/types/src/requests/createCallRequest.d.ts +0 -6
- package/build/types/src/requests/createCatalogRequest.d.ts +0 -6
- package/build/types/src/requests/createDepartmentRequest.d.ts +0 -6
- package/build/types/src/requests/createListRequest.d.ts +0 -12
- package/build/types/src/requests/createMemberRequest.d.ts +0 -12
- package/build/types/src/requests/createRoleRequest.d.ts +0 -5
- package/build/types/src/requests/deleteBotRequest.d.ts +0 -4
- package/build/types/src/requests/deleteRoleRequest.d.ts +0 -4
- package/build/types/src/requests/formFilter.d.ts +0 -6
- package/build/types/src/requests/formRegisterRequest.d.ts +0 -26
- package/build/types/src/requests/getAllRequest.d.ts +0 -3
- package/build/types/src/requests/getMessageRequest.d.ts +0 -10
- package/build/types/src/requests/inboxRequest.d.ts +0 -8
- package/build/types/src/requests/personIdentity.d.ts +0 -4
- package/build/types/src/requests/profileRequest.d.ts +0 -3
- package/build/types/src/requests/setAvatarRequest.d.ts +0 -4
- package/build/types/src/requests/syncCatalogRequest.d.ts +0 -6
- package/build/types/src/requests/taskCommentRequest.d.ts +0 -39
- package/build/types/src/requests/taskListRequest.d.ts +0 -10
- package/build/types/src/requests/taskRequest.d.ts +0 -24
- package/build/types/src/requests/updateBotRequest.d.ts +0 -13
- package/build/types/src/requests/updateDepartmentRequest.d.ts +0 -8
- package/build/types/src/requests/updateListRequest.d.ts +0 -14
- package/build/types/src/requests/updateMemberRequest.d.ts +0 -15
- package/build/types/src/requests/updateRoleRequest.d.ts +0 -8
- package/build/types/src/responses/announcementResponse.d.ts +0 -5
- package/build/types/src/responses/announcementsResponse.d.ts +0 -5
- package/build/types/src/responses/authResponse.d.ts +0 -6
- package/build/types/src/responses/botResponse.d.ts +0 -3
- package/build/types/src/responses/botsResponse.d.ts +0 -5
- package/build/types/src/responses/calendarResponse.d.ts +0 -6
- package/build/types/src/responses/callResponse.d.ts +0 -4
- package/build/types/src/responses/catalogItemResponse.d.ts +0 -4
- package/build/types/src/responses/catalogResponse.d.ts +0 -18
- package/build/types/src/responses/contactsResponse.d.ts +0 -5
- package/build/types/src/responses/departmentResponse.d.ts +0 -3
- package/build/types/src/responses/departmentsResponse.d.ts +0 -5
- package/build/types/src/responses/formRegisterResponse.d.ts +0 -5
- package/build/types/src/responses/formResponse.d.ts +0 -17
- package/build/types/src/responses/formsResponse.d.ts +0 -4
- package/build/types/src/responses/listsResponse.d.ts +0 -5
- package/build/types/src/responses/memberResponse.d.ts +0 -3
- package/build/types/src/responses/membersResponse.d.ts +0 -5
- package/build/types/src/responses/permissionsDict.d.ts +0 -4
- package/build/types/src/responses/permissionsResponse.d.ts +0 -5
- package/build/types/src/responses/plainListResponse.d.ts +0 -3
- package/build/types/src/responses/profileIdentityResponse.d.ts +0 -5
- package/build/types/src/responses/profileResponse.d.ts +0 -12
- package/build/types/src/responses/responseBase.d.ts +0 -6
- package/build/types/src/responses/roleResponse.d.ts +0 -3
- package/build/types/src/responses/rolesResponse.d.ts +0 -5
- package/build/types/src/responses/syncCatalogResponse.d.ts +0 -10
- package/build/types/src/responses/taskListResponse.d.ts +0 -6
- package/build/types/src/responses/taskResponse.d.ts +0 -5
- package/build/types/src/responses/uploadResponse.d.ts +0 -5
- package/build/types/src/responses//321/201atalogsResponse.d.ts +0 -5
- package/build/types/src/settings/defaults.d.ts +0 -2
- package/build/types/src/settings/endpoints.d.ts +0 -32
package/build/types/index.d.ts
CHANGED
|
@@ -1,51 +1,1403 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export
|
|
51
|
-
|
|
1
|
+
declare module "pyrus-api" {
|
|
2
|
+
export enum OperatorId {
|
|
3
|
+
Equals = 1,
|
|
4
|
+
LessThan = 2,
|
|
5
|
+
GreaterThan = 3,
|
|
6
|
+
IsIn = 4,
|
|
7
|
+
Range = 5,
|
|
8
|
+
MatchPrefix = 6,
|
|
9
|
+
IsEmpty = 7
|
|
10
|
+
}
|
|
11
|
+
export type FormFilter = {
|
|
12
|
+
field_id: number;
|
|
13
|
+
operator_id: OperatorId;
|
|
14
|
+
values: string[];
|
|
15
|
+
};
|
|
16
|
+
export function toDateTimeString(date: Date | string): string;
|
|
17
|
+
export function toDateString(date: Date | string): string;
|
|
18
|
+
export function toTimeString(date: Date | string): string;
|
|
19
|
+
export enum FilterMask {
|
|
20
|
+
/**
|
|
21
|
+
* Events whose deadline is indicated in UTC+0
|
|
22
|
+
*/
|
|
23
|
+
Due = 1,
|
|
24
|
+
/**
|
|
25
|
+
* Tasks whose deadline is indicated by date
|
|
26
|
+
* (without reference to timezone)
|
|
27
|
+
*/
|
|
28
|
+
DueDate = 2,
|
|
29
|
+
/**
|
|
30
|
+
* Tasks whose deadline at the current step is
|
|
31
|
+
* within the selected time period in UTC+0
|
|
32
|
+
*/
|
|
33
|
+
DueForCurrentStep = 4,
|
|
34
|
+
/**
|
|
35
|
+
* Tasks with a programmed reminder
|
|
36
|
+
*/
|
|
37
|
+
Reminded = 8
|
|
38
|
+
}
|
|
39
|
+
export enum CallEventType {
|
|
40
|
+
Show = "show"
|
|
41
|
+
}
|
|
42
|
+
export enum SourceType {
|
|
43
|
+
Default = "default",
|
|
44
|
+
FillTable = "fill_table"
|
|
45
|
+
}
|
|
46
|
+
export enum ActivityAction {
|
|
47
|
+
Finished = "finished",
|
|
48
|
+
Reopened = "reopened"
|
|
49
|
+
}
|
|
50
|
+
export enum ApprovalChoice {
|
|
51
|
+
Waiting = "waiting",
|
|
52
|
+
Approved = "approved",
|
|
53
|
+
Rejected = "rejected",
|
|
54
|
+
Revoked = "revoked",
|
|
55
|
+
Acknowledged = "acknowledged"
|
|
56
|
+
}
|
|
57
|
+
export enum PersonRights {
|
|
58
|
+
None = 0,
|
|
59
|
+
ManageRoles = 1,
|
|
60
|
+
CanSeeAllTasks = 2,
|
|
61
|
+
ManagePersonsInOrganization = 4,
|
|
62
|
+
EditOrganizationProjects = 8,
|
|
63
|
+
EditOrganizationSettings = 16,
|
|
64
|
+
DeleteMyTasksAndProjects = 32,
|
|
65
|
+
CloseDeleteAnnouncements = 64,
|
|
66
|
+
BillsPayment = 128,
|
|
67
|
+
InvitePersonsToOrganization = 256,
|
|
68
|
+
DeleteOtherMembersTasks = 512,
|
|
69
|
+
ManageIntegrationsAndCatalogs = 1024,
|
|
70
|
+
CreateAnnouncement = 2048,
|
|
71
|
+
CanDeleteTaskFlagEquivalent = 544,
|
|
72
|
+
SupervisorRights = 221,
|
|
73
|
+
MaxAdditionalRights = 2047,
|
|
74
|
+
NewOrganizationDefaultRights = 2080,
|
|
75
|
+
UIOrganizationManager = 277,
|
|
76
|
+
UIAccountant = 128,
|
|
77
|
+
UISupervisor = 10,
|
|
78
|
+
UIConfigurationManager = 1600,
|
|
79
|
+
UIAdministrator = 2015
|
|
80
|
+
}
|
|
81
|
+
export enum ListType {
|
|
82
|
+
Private = "private",
|
|
83
|
+
OrganizationWide = "org_wide"
|
|
84
|
+
}
|
|
85
|
+
export enum ErrorCodeType {
|
|
86
|
+
ServerError = "server_error",
|
|
87
|
+
AuthorizationError = "authorization_error",
|
|
88
|
+
TokenNotSpecified = "token_not_specified",
|
|
89
|
+
RevokedToken = "revoked_token",
|
|
90
|
+
ExpiredToken = "expired_token",
|
|
91
|
+
InvalidToken = "invalid_token",
|
|
92
|
+
AccountBlocked = "account_blocked",
|
|
93
|
+
InvalidCredentials = "invalid_credentials",
|
|
94
|
+
InvalidApplicationId = "invalid_application_id",
|
|
95
|
+
InvalidFieldId = "invalid_field_id",
|
|
96
|
+
InvalidFieldName = "invalid_field_name",
|
|
97
|
+
InvalidFieldIdName = "invalid_field_id_name",
|
|
98
|
+
NonUniqueName = "non_unique_name",
|
|
99
|
+
FieldIdentityMissing = "field_identity_missing",
|
|
100
|
+
DuplicateField = "duplicate_field",
|
|
101
|
+
InvalidCatalogId = "invalid_catalog_id",
|
|
102
|
+
InvalidCatalogItemName = "invalid_catalog_item_name",
|
|
103
|
+
NonUniqueCatalogItemName = "non_unique_catalog_item_name",
|
|
104
|
+
InvalidCatalogItemId = "invalid_catalog_item_id",
|
|
105
|
+
InvalidCatalogItemIdName = "catalog_item_id_name_mismatch",
|
|
106
|
+
InvalidEmail = "invalid_email",
|
|
107
|
+
NonUniqueEmail = "non_unique_email",
|
|
108
|
+
InvalidPersonIdEmail = "invalid_person_id_email",
|
|
109
|
+
UnrecognizedAttachmentId = "unrecognized_attachment_id",
|
|
110
|
+
RequiredFieldMissing = "required_field_missing",
|
|
111
|
+
FieldTypeIsNotSupported = "type_is_not_supported",
|
|
112
|
+
IncorrectParametersCount = "incorrect_parameters_count",
|
|
113
|
+
FilterTypeIsNotSupported = "filter_type_is_not_supported",
|
|
114
|
+
StepFieldDoesNotExists = "step_field_does_not_exists",
|
|
115
|
+
NoFileInRequest = "no_file_in_request",
|
|
116
|
+
TooLargeRequestLength = "too_large_request_length",
|
|
117
|
+
TaskHasNoForm = "task_has_no_form",
|
|
118
|
+
RequiredParameterMissing = "required_parameter_missing",
|
|
119
|
+
InvalidValueFormat = "invalid_value_format",
|
|
120
|
+
InvalidJson = "invalid_json",
|
|
121
|
+
EmptyBody = "empty_body",
|
|
122
|
+
TextMissing = "text_missing",
|
|
123
|
+
FormIdMissing = "form_id_missing",
|
|
124
|
+
InvalidPersonId = "invalid_person_id",
|
|
125
|
+
DeletedField = "deleted_field",
|
|
126
|
+
PersonIdentityMissing = "person_identity_missing",
|
|
127
|
+
CatalogItemIdMissing = "catalog_identity_missing",
|
|
128
|
+
FormHasNoTask = "form_has_no_task",
|
|
129
|
+
EitherDueDateOrDueCanBeSet = "either_due_date_or_due_can_be_set",
|
|
130
|
+
NegativeDuration = "negative_duration",
|
|
131
|
+
DurationIsTooLong = "duration_is_too_long",
|
|
132
|
+
DueMissing = "due_missing",
|
|
133
|
+
ScheduledDateInPast = "scheduled_date_in_past",
|
|
134
|
+
CannotAddFormProject = "cannot_add_form_project",
|
|
135
|
+
FormTemplateCantBeRemovedFromTask = "form_template_cant_be_removed_from_task",
|
|
136
|
+
TooManyTaskSteps = "too_many_task_steps",
|
|
137
|
+
TooManyComments = "too_many_comments",
|
|
138
|
+
InvalidStepNumber = "invalid_step_number",
|
|
139
|
+
TaskLimitExceeded = "task_limit_exceeded",
|
|
140
|
+
FieldIsInTable = "field_is_in_table",
|
|
141
|
+
RequiredTableFieldMissing = "required_table_field_missing",
|
|
142
|
+
DepartmentCatalogCanNotBeModified = "department_catalog_can_not_be_modified",
|
|
143
|
+
CatalogDuplicateItems = "catalog_duplicate_rows",
|
|
144
|
+
EmptyCatalogHeaders = "empty_catalog_headers",
|
|
145
|
+
CanNotModifyDeletedCatalog = "can_not_modify_deleted_catalog",
|
|
146
|
+
CatalogDuplicateHeaders = "catalog_duplicate_headers",
|
|
147
|
+
CanNotModifyFirstColumn = "can_not_modify_first_column",
|
|
148
|
+
CatalogHeadersItemsMismatch = "catalog_headers_items_mismatch",
|
|
149
|
+
TooManyCatalogItems = "too_many_catalog_items",
|
|
150
|
+
CatalogItemMaxLengthExceeded = "catalog_item_max_length_exceeded",
|
|
151
|
+
SingleValueIsNotSupported = "single_value_is_not_supported",
|
|
152
|
+
ParticipantLimitExceeded = "participant_limit_exceeded",
|
|
153
|
+
TableRowsLimitExceeded = "table_rows_limit_exceeded",
|
|
154
|
+
TextFieldValueLimitExceeded = "text_field_value_limit_exceeded",
|
|
155
|
+
UnableToEditField = "unable_to_edit_field",
|
|
156
|
+
EmptyFile = "empty_file",
|
|
157
|
+
BadMultipartContent = "bad_multipart_content",
|
|
158
|
+
TooManyDecimalPlaces = "too_many_decimal_places",
|
|
159
|
+
ExternalCommentEmptyText = "external_comment_empty_text",
|
|
160
|
+
SenderAddressFieldMissing = "sender_address_field_missing",
|
|
161
|
+
ExternalCommentRecipientNotFound = "external_comment_recipient_not_found",
|
|
162
|
+
DefaultMailboxNotFound = "default_mailbox_not_found",
|
|
163
|
+
CatalogNullValue = "catalog_null_value",
|
|
164
|
+
MaxTextLengthExceeded = "max_text_length_exceeded",
|
|
165
|
+
DueOutsideOfBounds = "due_outside_of_bounds",
|
|
166
|
+
AttachmentsForbidden = "attachments_forbidden",
|
|
167
|
+
UnrecognizedCallGuid = "unrecognized_call_guid",
|
|
168
|
+
UnsupportedAttachmentFormat = "unsupported_attachment_format",
|
|
169
|
+
ValidationError = "validation_error",
|
|
170
|
+
UnrecognizedAccountId = "unrecognized_account_id",
|
|
171
|
+
WebhookIsDisabled = "webhook_is_disabled",
|
|
172
|
+
TooLargeMessageText = "too_large_message_text",
|
|
173
|
+
UnrecognizedMessageType = "unrecognized_message_type",
|
|
174
|
+
InvalidFieldMappingCode = "invalid_field_mapping_code",
|
|
175
|
+
TooManyAttachments = "too_many_attachments",
|
|
176
|
+
UnrecognizedCallId = "unrecognized_call_id",
|
|
177
|
+
UnsupportedRecordFileFormat = "unsupported_record_file_format",
|
|
178
|
+
UnrecognizedIntegrationGuid = "unrecognized_integration_guid",
|
|
179
|
+
LimitExceeded = "limit_exceeded",
|
|
180
|
+
MaxSmsTextLengthExceeded = "max_sms_text_length_exceeded",
|
|
181
|
+
SmsIntegrationNotConfigured = "sms_integration_not_configured",
|
|
182
|
+
AttachmentTooBig = "attachment_too_big",
|
|
183
|
+
UncreatedOrDeletedTableRows = "invalid_table_row",
|
|
184
|
+
PrivateChannelAccessDenied = "private_channel_access_denied",
|
|
185
|
+
PrivateCommentHasForbiddenChanges = "private_comment_has_forbidden_changes",
|
|
186
|
+
ItemsCountOutOfRange = "items_count_out_of_range",
|
|
187
|
+
CannotAddExternalUser = "cannot_add_external_user",
|
|
188
|
+
UnrecognizedTaskId = "unrecognized_task_id",
|
|
189
|
+
TooManyDeletedCatalogItems = "too_many_deleted_catalog_items",
|
|
190
|
+
FieldCannotHaveMultipleValues = "field_cannot_have_multiple_values",
|
|
191
|
+
FieldEditingIsNotAllowed = "field_editing_is_not_allowed",
|
|
192
|
+
NonUniqueCode = "non_unique_code",
|
|
193
|
+
InvalidFieldCode = "invalid_field_code",
|
|
194
|
+
AccessDeniedProject = "access_denied_project",
|
|
195
|
+
AccessDeniedTask = "access_denied_task",
|
|
196
|
+
AccessDeniedCatalog = "access_denied_catalog",
|
|
197
|
+
AccessDeniedForm = "access_denied_form",
|
|
198
|
+
AccessDeniedPerson = "access_denied_person",
|
|
199
|
+
AccessDeniedCloseTask = "access_denied_close_task",
|
|
200
|
+
AccessDeniedReopenTask = "access_denied_reopen_task",
|
|
201
|
+
AccessDeniedFileAccessHistory = "access_denied_file_access_history",
|
|
202
|
+
AccessDeniedFile = "access_denied_file",
|
|
203
|
+
AccessDeniedReport = "access_denied_report",
|
|
204
|
+
AccessDenied = "access_denied",
|
|
205
|
+
FileIsMissing = "file_is_missing",
|
|
206
|
+
TooManyRequests = "too_many_requests"
|
|
207
|
+
}
|
|
208
|
+
export enum Flag {
|
|
209
|
+
None = "none",
|
|
210
|
+
Checked = "checked",
|
|
211
|
+
Unchecked = "unchecked"
|
|
212
|
+
}
|
|
213
|
+
export enum FormFieldType {
|
|
214
|
+
Unknown = "unknown",
|
|
215
|
+
Text = "text",
|
|
216
|
+
Money = "money",
|
|
217
|
+
Number = "number",
|
|
218
|
+
Date = "date",
|
|
219
|
+
Time = "time",
|
|
220
|
+
Checkmark = "checkmark",
|
|
221
|
+
MultipleChoice = "multiple_choice",
|
|
222
|
+
DueDate = "due_date",
|
|
223
|
+
Email = "email",
|
|
224
|
+
Phone = "phone",
|
|
225
|
+
Flag = "flag",
|
|
226
|
+
Step = "step",
|
|
227
|
+
Status = "status",
|
|
228
|
+
CreationDate = "creation_date",
|
|
229
|
+
Note = "note",
|
|
230
|
+
Catalog = "catalog",
|
|
231
|
+
File = "file",
|
|
232
|
+
Person = "person",
|
|
233
|
+
Author = "author",
|
|
234
|
+
Table = "table",
|
|
235
|
+
Title = "title",
|
|
236
|
+
Project = "project",
|
|
237
|
+
FormLink = "form_link",
|
|
238
|
+
DueDateTime = "due_date_time"
|
|
239
|
+
}
|
|
240
|
+
export enum PermissionLevel {
|
|
241
|
+
None = "none",
|
|
242
|
+
Manager = "manager",
|
|
243
|
+
Member = "member",
|
|
244
|
+
Administrator = "administrator"
|
|
245
|
+
}
|
|
246
|
+
export enum PersonType {
|
|
247
|
+
User = "user",
|
|
248
|
+
Bot = "bot",
|
|
249
|
+
Role = "role"
|
|
250
|
+
}
|
|
251
|
+
export enum SendSmsError {
|
|
252
|
+
None = "none",
|
|
253
|
+
Unknown = "unknown",
|
|
254
|
+
Expired = "expired",
|
|
255
|
+
Forbidden = "forbidden",
|
|
256
|
+
Unreachable = "unreachable",
|
|
257
|
+
UnknownStatus = "unknown_status",
|
|
258
|
+
UnableToDeliver = "unable_to_deliver",
|
|
259
|
+
InvalidPhoneNumber = "invalid_phone_number",
|
|
260
|
+
Rejected = "rejected"
|
|
261
|
+
}
|
|
262
|
+
export enum SendSmsStatus {
|
|
263
|
+
Sent = "sent",
|
|
264
|
+
Delivered = "delivered",
|
|
265
|
+
DeliveryFailed = "delivery_failed",
|
|
266
|
+
SendFailed = "send_failed"
|
|
267
|
+
}
|
|
268
|
+
export type NewFile = {
|
|
269
|
+
guid?: string;
|
|
270
|
+
root_id?: number;
|
|
271
|
+
attachment_id?: number;
|
|
272
|
+
url?: string;
|
|
273
|
+
name?: string;
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Data for autofilling form fields
|
|
277
|
+
*/
|
|
278
|
+
export type FormMapping = {
|
|
279
|
+
/**
|
|
280
|
+
* Pyrus form field symbol code
|
|
281
|
+
*/
|
|
282
|
+
code: string;
|
|
283
|
+
/**
|
|
284
|
+
* Pyrus field value
|
|
285
|
+
*
|
|
286
|
+
* @remarks
|
|
287
|
+
* 300 symbols max
|
|
288
|
+
*/
|
|
289
|
+
value: string;
|
|
290
|
+
};
|
|
291
|
+
export type CatalogItem = {
|
|
292
|
+
item_id?: number;
|
|
293
|
+
external_id?: number;
|
|
294
|
+
values: string[];
|
|
295
|
+
deleted?: boolean;
|
|
296
|
+
links?: CatalogItemLink[];
|
|
297
|
+
};
|
|
298
|
+
export type CatalogItemLink = {
|
|
299
|
+
item_id: number;
|
|
300
|
+
catalog_id: number;
|
|
301
|
+
};
|
|
302
|
+
export type ColumnSettings = {
|
|
303
|
+
original_position?: number;
|
|
304
|
+
sort_order?: number;
|
|
305
|
+
visible?: boolean;
|
|
306
|
+
group_by?: boolean;
|
|
307
|
+
};
|
|
308
|
+
export type DueFilter = {
|
|
309
|
+
overdue_steps: number[];
|
|
310
|
+
};
|
|
311
|
+
export type FormFieldInfo = {
|
|
312
|
+
required_step?: number;
|
|
313
|
+
immutable_step?: number;
|
|
314
|
+
options?: ChoiceOption[];
|
|
315
|
+
catalog_id?: number;
|
|
316
|
+
columns?: FormField[];
|
|
317
|
+
fields?: FormField[];
|
|
318
|
+
form_id?: number;
|
|
319
|
+
code?: string;
|
|
320
|
+
decimal_places?: number;
|
|
321
|
+
multiple_choice?: boolean;
|
|
322
|
+
multiline?: boolean;
|
|
323
|
+
};
|
|
324
|
+
export type ChoiceOption = {
|
|
325
|
+
choice_id: number;
|
|
326
|
+
choice_value: string;
|
|
327
|
+
deleted: boolean;
|
|
328
|
+
fields: FormField[];
|
|
329
|
+
};
|
|
330
|
+
export type FormFieldBase = {
|
|
331
|
+
id: number;
|
|
332
|
+
type: FormFieldType;
|
|
333
|
+
name?: string;
|
|
334
|
+
info?: FormFieldInfo;
|
|
335
|
+
parent_id?: number;
|
|
336
|
+
row_id?: number;
|
|
337
|
+
code?: string;
|
|
338
|
+
value?: any;
|
|
339
|
+
};
|
|
340
|
+
export type Person = {
|
|
341
|
+
id: number;
|
|
342
|
+
first_name: string;
|
|
343
|
+
last_name: string;
|
|
344
|
+
native_first_name?: string;
|
|
345
|
+
native_last_name?: string;
|
|
346
|
+
email: string;
|
|
347
|
+
status?: string;
|
|
348
|
+
type: PersonType;
|
|
349
|
+
department_id?: string;
|
|
350
|
+
department_name?: string;
|
|
351
|
+
banned: boolean;
|
|
352
|
+
fired?: boolean;
|
|
353
|
+
task_receiver?: number;
|
|
354
|
+
position: string;
|
|
355
|
+
skype: string;
|
|
356
|
+
phone: string;
|
|
357
|
+
};
|
|
358
|
+
export type FormFieldAuthor = FormFieldBase & {
|
|
359
|
+
type?: FormFieldType.Author;
|
|
360
|
+
value?: Person;
|
|
361
|
+
};
|
|
362
|
+
export type FormFieldCatalog = FormFieldBase & {
|
|
363
|
+
type?: FormFieldType.Catalog;
|
|
364
|
+
value?: Catalog;
|
|
365
|
+
};
|
|
366
|
+
export type Catalog = {
|
|
367
|
+
item_id: number;
|
|
368
|
+
item_ids?: number[];
|
|
369
|
+
item_names?: string[];
|
|
370
|
+
headers?: string[];
|
|
371
|
+
values?: string[];
|
|
372
|
+
rows?: string[][];
|
|
373
|
+
};
|
|
374
|
+
enum Checkmark {
|
|
375
|
+
Checked = "checked",
|
|
376
|
+
Unchecked = "unchecked"
|
|
377
|
+
}
|
|
378
|
+
export type FormFieldCheckmark = FormFieldBase & {
|
|
379
|
+
type?: FormFieldType.Checkmark;
|
|
380
|
+
value?: Checkmark;
|
|
381
|
+
};
|
|
382
|
+
export type FormFieldCreateDate = FormFieldBase & {
|
|
383
|
+
type?: FormFieldType.CreationDate;
|
|
384
|
+
value?: Date;
|
|
385
|
+
};
|
|
386
|
+
export type FormFieldDate = FormFieldBase & {
|
|
387
|
+
type?: FormFieldType.Date;
|
|
388
|
+
value?: Date;
|
|
389
|
+
};
|
|
390
|
+
export type FormFieldDueDate = FormFieldBase & {
|
|
391
|
+
type?: FormFieldType.DueDate;
|
|
392
|
+
value?: Date;
|
|
393
|
+
};
|
|
394
|
+
export type FormFieldDueDateTime = FormFieldBase & {
|
|
395
|
+
type?: FormFieldType.DueDateTime;
|
|
396
|
+
value?: Date;
|
|
397
|
+
};
|
|
398
|
+
export type FormFieldEmail = FormFieldBase & {
|
|
399
|
+
type?: FormFieldType.Email;
|
|
400
|
+
value?: string;
|
|
401
|
+
};
|
|
402
|
+
export type AttachedFile = {
|
|
403
|
+
id: number;
|
|
404
|
+
name: string;
|
|
405
|
+
size: number;
|
|
406
|
+
md5: string;
|
|
407
|
+
url: string;
|
|
408
|
+
version: number;
|
|
409
|
+
root_id?: number;
|
|
410
|
+
};
|
|
411
|
+
export type FormFieldFile = FormFieldBase & {
|
|
412
|
+
type?: FormFieldType.File;
|
|
413
|
+
value?: AttachedFile[];
|
|
414
|
+
};
|
|
415
|
+
export type FormFieldFlag = FormFieldBase & {
|
|
416
|
+
type?: FormFieldType.Flag;
|
|
417
|
+
value?: Flag;
|
|
418
|
+
};
|
|
419
|
+
export type FormLink = {
|
|
420
|
+
task_id?: number;
|
|
421
|
+
task_ids?: number[];
|
|
422
|
+
subject?: string;
|
|
423
|
+
};
|
|
424
|
+
export type FormFieldFormLink = FormFieldBase & {
|
|
425
|
+
type?: FormFieldType.FormLink;
|
|
426
|
+
value?: FormLink;
|
|
427
|
+
};
|
|
428
|
+
export type FormFieldMoney = FormFieldBase & {
|
|
429
|
+
type?: FormFieldType.Money;
|
|
430
|
+
value?: number;
|
|
431
|
+
};
|
|
432
|
+
export type FormFieldMultipleChoice = FormFieldBase & {
|
|
433
|
+
type?: FormFieldType.MultipleChoice;
|
|
434
|
+
value?: MultipleChoice;
|
|
435
|
+
};
|
|
436
|
+
export type MultipleChoice = {
|
|
437
|
+
choice_id?: number;
|
|
438
|
+
choice_ids?: number[];
|
|
439
|
+
choice_names?: string[];
|
|
440
|
+
fields?: FormField[];
|
|
441
|
+
};
|
|
442
|
+
export type FormFieldNewFile = FormFieldFile & {
|
|
443
|
+
value?: NewFile[];
|
|
444
|
+
};
|
|
445
|
+
export type FormFieldNote = FormFieldBase & {
|
|
446
|
+
type?: FormFieldType.Note;
|
|
447
|
+
value?: string;
|
|
448
|
+
};
|
|
449
|
+
export type FormFieldNumber = FormFieldBase & {
|
|
450
|
+
type?: FormFieldType.Number;
|
|
451
|
+
value?: number;
|
|
452
|
+
};
|
|
453
|
+
export type FormFieldPerson = FormFieldBase & {
|
|
454
|
+
type?: FormFieldType.Person;
|
|
455
|
+
value?: Person;
|
|
456
|
+
};
|
|
457
|
+
export type FormFieldPhone = FormFieldBase & {
|
|
458
|
+
type?: FormFieldType.Phone;
|
|
459
|
+
value?: string;
|
|
460
|
+
};
|
|
461
|
+
export type FormFieldProject = FormFieldBase & {
|
|
462
|
+
type?: FormFieldType.Project;
|
|
463
|
+
value?: ProjectArray;
|
|
464
|
+
};
|
|
465
|
+
export type ProjectArray = {
|
|
466
|
+
projects: Project[];
|
|
467
|
+
};
|
|
468
|
+
export type Project = {
|
|
469
|
+
id: number;
|
|
470
|
+
name?: string;
|
|
471
|
+
parent?: Project;
|
|
472
|
+
};
|
|
473
|
+
enum Status {
|
|
474
|
+
Open = "open",
|
|
475
|
+
Closed = "closed"
|
|
476
|
+
}
|
|
477
|
+
export type FormFieldStatus = FormFieldBase & {
|
|
478
|
+
type?: FormFieldType.Status;
|
|
479
|
+
value?: Status;
|
|
480
|
+
};
|
|
481
|
+
export type FormFieldStep = FormFieldBase & {
|
|
482
|
+
type?: FormFieldType.Step;
|
|
483
|
+
value?: number;
|
|
484
|
+
};
|
|
485
|
+
export type FormFieldTable = FormFieldBase & {
|
|
486
|
+
type?: FormFieldType.Table;
|
|
487
|
+
value?: TableRow[];
|
|
488
|
+
};
|
|
489
|
+
export type TableRow = {
|
|
490
|
+
row_id: number;
|
|
491
|
+
cells?: FormField[];
|
|
492
|
+
delete?: boolean;
|
|
493
|
+
deleted?: boolean;
|
|
494
|
+
};
|
|
495
|
+
export type FormFieldText = FormFieldBase & {
|
|
496
|
+
type?: FormFieldType.Text;
|
|
497
|
+
value?: string;
|
|
498
|
+
};
|
|
499
|
+
export type FormFieldTime = FormFieldBase & {
|
|
500
|
+
type?: FormFieldType.Time;
|
|
501
|
+
value?: Date;
|
|
502
|
+
};
|
|
503
|
+
export type FormFieldTitle = FormFieldBase & {
|
|
504
|
+
type?: FormFieldType.Title;
|
|
505
|
+
value?: Title;
|
|
506
|
+
};
|
|
507
|
+
export type Title = {
|
|
508
|
+
checkmark?: Checkmark;
|
|
509
|
+
fields?: FormField[];
|
|
510
|
+
};
|
|
511
|
+
export type FormField = FormFieldAuthor | FormFieldCatalog | FormFieldCheckmark | FormFieldCreateDate | FormFieldDate | FormFieldDueDate | FormFieldDueDateTime | FormFieldEmail | FormFieldFile | FormFieldFlag | FormFieldFormLink | FormFieldMoney | FormFieldMultipleChoice | FormFieldNewFile | FormFieldNote | FormFieldNumber | FormFieldPerson | FormFieldPhone | FormFieldProject | FormFieldStatus | FormFieldStep | FormFieldTable | FormFieldText | FormFieldTime | FormFieldTitle;
|
|
512
|
+
enum ChannelType {
|
|
513
|
+
Email = "email",
|
|
514
|
+
Telegram = "telegram",
|
|
515
|
+
Web = "web",
|
|
516
|
+
Facebook = "facebook",
|
|
517
|
+
Vk = "vk",
|
|
518
|
+
Viber = "viber",
|
|
519
|
+
MobileApp = "mobile_app",
|
|
520
|
+
WebWidget = "web_widget",
|
|
521
|
+
MoySklad = "moy_sklad",
|
|
522
|
+
Zadarma = "zadarma",
|
|
523
|
+
AmoCrm = "amo_crm",
|
|
524
|
+
Instagram = "instagram",
|
|
525
|
+
PrivateChannel = "private_channel",
|
|
526
|
+
Jira = "jira",
|
|
527
|
+
Beeline = "beeline",
|
|
528
|
+
ApiTelephony = "api_telephony",
|
|
529
|
+
Zoom = "zoom",
|
|
530
|
+
WebForm = "web_form",
|
|
531
|
+
WhatsApp = "whats_app",
|
|
532
|
+
Custom = "custom",
|
|
533
|
+
Sms = "sms"
|
|
534
|
+
}
|
|
535
|
+
export type ChannelUser = {
|
|
536
|
+
email?: string;
|
|
537
|
+
name?: string;
|
|
538
|
+
};
|
|
539
|
+
export type Channel = {
|
|
540
|
+
type: ChannelType;
|
|
541
|
+
phone?: string;
|
|
542
|
+
to?: ChannelUser;
|
|
543
|
+
from?: ChannelUser;
|
|
544
|
+
};
|
|
545
|
+
export type PersonIdentity = {
|
|
546
|
+
id: number;
|
|
547
|
+
} | {
|
|
548
|
+
email: string;
|
|
549
|
+
};
|
|
550
|
+
export type TaskCommentRequest = {
|
|
551
|
+
text?: string;
|
|
552
|
+
formatted_text?: string;
|
|
553
|
+
subject?: string;
|
|
554
|
+
approval_choice?: ApprovalChoice;
|
|
555
|
+
reassign_to?: PersonIdentity;
|
|
556
|
+
approval_steps?: number[];
|
|
557
|
+
action?: ActivityAction;
|
|
558
|
+
attachments?: NewFile[];
|
|
559
|
+
field_updates?: FormField[];
|
|
560
|
+
approvals_added?: PersonIdentity[][];
|
|
561
|
+
approvals_removed?: PersonIdentity[][];
|
|
562
|
+
approvals_rerequested?: PersonIdentity[][];
|
|
563
|
+
subscribers_added?: PersonIdentity[];
|
|
564
|
+
subscribers_removed?: PersonIdentity[];
|
|
565
|
+
subscribers_rerequested?: PersonIdentity[];
|
|
566
|
+
participants_added?: PersonIdentity[];
|
|
567
|
+
participants_removed?: PersonIdentity[];
|
|
568
|
+
due_date?: Date;
|
|
569
|
+
due?: Date;
|
|
570
|
+
duration?: number;
|
|
571
|
+
cancel_due?: boolean;
|
|
572
|
+
scheduled_date?: Date;
|
|
573
|
+
scheduled_datetime_utc?: Date;
|
|
574
|
+
cancel_schedule?: boolean;
|
|
575
|
+
added_list_ids?: number[];
|
|
576
|
+
removed_list_ids?: number[];
|
|
577
|
+
channel?: Channel;
|
|
578
|
+
spent_minutes?: number;
|
|
579
|
+
skip_satisfaction?: boolean;
|
|
580
|
+
edit_comment_id?: number;
|
|
581
|
+
skip_notification?: boolean;
|
|
582
|
+
};
|
|
583
|
+
export type CommentDescription = {
|
|
584
|
+
task_id: number;
|
|
585
|
+
previous_note_id: number;
|
|
586
|
+
comment: TaskCommentRequest;
|
|
587
|
+
};
|
|
588
|
+
export type ResponseBase = {
|
|
589
|
+
error?: string;
|
|
590
|
+
error_code?: ErrorCodeType;
|
|
591
|
+
error_message?: string;
|
|
592
|
+
};
|
|
593
|
+
export type Approval = {
|
|
594
|
+
person: Person;
|
|
595
|
+
approval_choice?: ApprovalChoice;
|
|
596
|
+
step?: number;
|
|
597
|
+
};
|
|
598
|
+
export type Subscriber = {
|
|
599
|
+
person: Person;
|
|
600
|
+
approval_choice?: ApprovalChoice;
|
|
601
|
+
};
|
|
602
|
+
export type TaskHeader = {
|
|
603
|
+
id: number;
|
|
604
|
+
text: string;
|
|
605
|
+
create_date: Date;
|
|
606
|
+
last_modified_date: Date;
|
|
607
|
+
author: Person;
|
|
608
|
+
close_date?: Date;
|
|
609
|
+
responsible?: Person;
|
|
610
|
+
due_date?: Date;
|
|
611
|
+
};
|
|
612
|
+
export type Task = TaskHeader & {
|
|
613
|
+
due_date?: Date;
|
|
614
|
+
due?: Date;
|
|
615
|
+
scheduled_date?: Date;
|
|
616
|
+
scheduled_datetime_utc?: Date;
|
|
617
|
+
cancel_schedule?: boolean;
|
|
618
|
+
duration?: number;
|
|
619
|
+
form_id?: number;
|
|
620
|
+
attachments?: AttachedFile[];
|
|
621
|
+
fields?: FormField[];
|
|
622
|
+
approvals?: Approval[][];
|
|
623
|
+
subscribers?: Subscriber[];
|
|
624
|
+
participants?: Person[];
|
|
625
|
+
list_ids?: number[];
|
|
626
|
+
linked_task_ids?: number[];
|
|
627
|
+
parent_task_id?: number;
|
|
628
|
+
last_note_id?: number;
|
|
629
|
+
subject?: string;
|
|
630
|
+
is_closed: boolean;
|
|
631
|
+
};
|
|
632
|
+
export type Role = {
|
|
633
|
+
id: number;
|
|
634
|
+
name: string;
|
|
635
|
+
external_id?: string;
|
|
636
|
+
avatar_id?: number;
|
|
637
|
+
external_avatar_id?: number;
|
|
638
|
+
banned: boolean;
|
|
639
|
+
fired?: boolean;
|
|
640
|
+
member_ids: number[];
|
|
641
|
+
};
|
|
642
|
+
export type SmsInfo = {
|
|
643
|
+
error_code?: SendSmsError;
|
|
644
|
+
status: SendSmsStatus;
|
|
645
|
+
error_message?: string;
|
|
646
|
+
sent_comment_id: number;
|
|
647
|
+
};
|
|
648
|
+
export type TaskComment = {
|
|
649
|
+
id: number;
|
|
650
|
+
text: string;
|
|
651
|
+
formatted_text?: string;
|
|
652
|
+
mentions?: number[];
|
|
653
|
+
subject?: string;
|
|
654
|
+
create_date: Date;
|
|
655
|
+
author: Person;
|
|
656
|
+
reassigned_to?: Person;
|
|
657
|
+
field_updates?: FormField[];
|
|
658
|
+
approval_choice?: ApprovalChoice;
|
|
659
|
+
reset_to_step?: number;
|
|
660
|
+
reply_note_id?: number;
|
|
661
|
+
approvals_added?: Approval[][];
|
|
662
|
+
approvals_removed?: Approval[][];
|
|
663
|
+
approvals_rerequested?: Approval[][];
|
|
664
|
+
subscribers_added?: Person[];
|
|
665
|
+
subscribers_removed?: Person[];
|
|
666
|
+
participants_added?: Person[];
|
|
667
|
+
participants_removed?: Person[];
|
|
668
|
+
due_date?: Date;
|
|
669
|
+
due?: Date;
|
|
670
|
+
scheduled_date?: Date;
|
|
671
|
+
scheduled_datetime_utc?: Date;
|
|
672
|
+
cancel_schedule?: boolean;
|
|
673
|
+
duration?: number;
|
|
674
|
+
attachments?: AttachedFile[];
|
|
675
|
+
action?: ActivityAction;
|
|
676
|
+
added_list_ids?: number[];
|
|
677
|
+
removed_list_ids?: number[];
|
|
678
|
+
approval_step?: number;
|
|
679
|
+
comment_as_roles?: Role[];
|
|
680
|
+
changed_step?: number;
|
|
681
|
+
channel?: Channel;
|
|
682
|
+
edit_comment_id?: number;
|
|
683
|
+
removed_attachment_ids?: number[];
|
|
684
|
+
delete_comment_id?: number;
|
|
685
|
+
spent_minutes?: number;
|
|
686
|
+
skip_satisfaction?: boolean;
|
|
687
|
+
sms_info?: SmsInfo;
|
|
688
|
+
};
|
|
689
|
+
export type Step = {
|
|
690
|
+
step: number;
|
|
691
|
+
elapsed_time: number;
|
|
692
|
+
name?: string;
|
|
693
|
+
};
|
|
694
|
+
export type TaskWithComments = Task & {
|
|
695
|
+
comments: TaskComment[];
|
|
696
|
+
steps?: Step[];
|
|
697
|
+
};
|
|
698
|
+
export type TaskResponse = ResponseBase & {
|
|
699
|
+
task: TaskWithComments;
|
|
700
|
+
};
|
|
701
|
+
export type BotHookRequest = {
|
|
702
|
+
event: "Comment" | "Close";
|
|
703
|
+
access_token: string;
|
|
704
|
+
user_id: number;
|
|
705
|
+
bot_settings: string;
|
|
706
|
+
task_id: number;
|
|
707
|
+
task: TaskResponse;
|
|
708
|
+
};
|
|
709
|
+
export type BotHookResponse = TaskCommentRequest | void;
|
|
710
|
+
export type AuthRequest = {
|
|
711
|
+
login: string;
|
|
712
|
+
security_key: string;
|
|
713
|
+
/**
|
|
714
|
+
* Employee ID
|
|
715
|
+
* @remarks
|
|
716
|
+
* if you have more than one account registered to the same email,
|
|
717
|
+
* then to receive a token you need to add the person_id parameter
|
|
718
|
+
*/
|
|
719
|
+
person_id?: string;
|
|
720
|
+
};
|
|
721
|
+
export type Settings = {
|
|
722
|
+
apiUrl?: string;
|
|
723
|
+
authUrl: string;
|
|
724
|
+
filesUrl?: string;
|
|
725
|
+
};
|
|
726
|
+
export type AuthResponse = ResponseBase & {
|
|
727
|
+
access_token: string;
|
|
728
|
+
api_url?: string;
|
|
729
|
+
files_url?: string;
|
|
730
|
+
};
|
|
731
|
+
export type HTTPMethod = "GET" | "POST" | "PUT" | "DELETE";
|
|
732
|
+
export type ById = {
|
|
733
|
+
id: number;
|
|
734
|
+
};
|
|
735
|
+
export interface BaseApiParams {
|
|
736
|
+
token?: string;
|
|
737
|
+
settings?: Settings;
|
|
738
|
+
authRequest?: Promise<AuthResponse>;
|
|
739
|
+
}
|
|
740
|
+
abstract class BaseApi {
|
|
741
|
+
protected _token: string;
|
|
742
|
+
protected _settings: Settings;
|
|
743
|
+
protected _authRequest: Promise<AuthResponse>;
|
|
744
|
+
protected _moduleSubPath: string;
|
|
745
|
+
protected constructor({ token, authRequest, settings }: BaseApiParams);
|
|
746
|
+
protected loginDone(): Promise<void>;
|
|
747
|
+
protected fetchApi<T>(url: string, method: HTTPMethod, body?: BodyInit, headersOverride?: HeadersInit): Promise<T>;
|
|
748
|
+
protected _checkResponse(resp: Response): Promise<any>;
|
|
749
|
+
protected getModulePath(): Promise<string>;
|
|
750
|
+
protected authorisationHeader(): Promise<Record<string, string>>;
|
|
751
|
+
private defaultHeaders;
|
|
752
|
+
}
|
|
753
|
+
export type CreateRoleRequest = {
|
|
754
|
+
name: string;
|
|
755
|
+
external_id?: string;
|
|
756
|
+
member_add?: number[];
|
|
757
|
+
};
|
|
758
|
+
enum Endpoints {
|
|
759
|
+
Auth = "/auth",
|
|
760
|
+
Roles = "/roles",
|
|
761
|
+
Profile = "/profile",
|
|
762
|
+
Contacts = "/contacts",
|
|
763
|
+
Files = "/files",
|
|
764
|
+
V4 = "/v4",
|
|
765
|
+
Upload = "/upload",
|
|
766
|
+
Download = "/download",
|
|
767
|
+
Lists = "/lists",
|
|
768
|
+
Inbox = "/inbox",
|
|
769
|
+
ListTasks = "/tasks",
|
|
770
|
+
Calendar = "/calendar",
|
|
771
|
+
Announcements = "/announcements",
|
|
772
|
+
AnnouncementComments = "/comments",
|
|
773
|
+
Catalogs = "/catalogs",
|
|
774
|
+
Members = "/members",
|
|
775
|
+
Tasks = "/tasks",
|
|
776
|
+
TasksComments = "/comments",
|
|
777
|
+
Forms = "/forms",
|
|
778
|
+
FormsRegister = "/register",
|
|
779
|
+
FormsPermissions = "/permissions",
|
|
780
|
+
EventHistory = "/eventhistory",
|
|
781
|
+
FileAccessHistory = "/fileaccesshistory",
|
|
782
|
+
TaskAccessHistory = "/taskaccesshistory",
|
|
783
|
+
TaskExportHistory = "/taskexporthistory",
|
|
784
|
+
RegistryDownloadHistory = "/registrydownloadhistory",
|
|
785
|
+
Integrations = "/integrations",
|
|
786
|
+
Call = "/call",
|
|
787
|
+
AttachCallRecord = "/attachcallrecord",
|
|
788
|
+
Bots = "/bots"
|
|
789
|
+
}
|
|
790
|
+
export type RoleResponse = ResponseBase & Role;
|
|
791
|
+
export type RolesResponse = ResponseBase & {
|
|
792
|
+
roles: Role[];
|
|
793
|
+
};
|
|
794
|
+
export type UpdateRoleRequest = {
|
|
795
|
+
id: number;
|
|
796
|
+
name?: string;
|
|
797
|
+
external_id?: string;
|
|
798
|
+
banned?: boolean;
|
|
799
|
+
member_add?: number[];
|
|
800
|
+
member_remove?: number[];
|
|
801
|
+
};
|
|
802
|
+
export type GetAllRequest = {
|
|
803
|
+
include_fired: boolean;
|
|
804
|
+
};
|
|
805
|
+
class RoleApi extends BaseApi {
|
|
806
|
+
protected _moduleSubPath: Endpoints;
|
|
807
|
+
create(request: CreateRoleRequest): Promise<RoleResponse>;
|
|
808
|
+
get({ id }: ById): Promise<RoleResponse>;
|
|
809
|
+
getAll(request?: GetAllRequest): Promise<RolesResponse>;
|
|
810
|
+
update(request: UpdateRoleRequest): Promise<RoleResponse>;
|
|
811
|
+
}
|
|
812
|
+
export type Organization = {
|
|
813
|
+
organization_id: number;
|
|
814
|
+
name: string;
|
|
815
|
+
persons: Person[];
|
|
816
|
+
roles: Role[];
|
|
817
|
+
department_catalog_id?: number;
|
|
818
|
+
};
|
|
819
|
+
export type ProfileResponse = ResponseBase & {
|
|
820
|
+
person_id: number;
|
|
821
|
+
first_name?: string;
|
|
822
|
+
last_name?: string;
|
|
823
|
+
email: string;
|
|
824
|
+
locale?: string;
|
|
825
|
+
organization_id: number;
|
|
826
|
+
organization: Organization;
|
|
827
|
+
timezone_offset?: number;
|
|
828
|
+
};
|
|
829
|
+
export type ProfileRequest = {
|
|
830
|
+
include_inactive: boolean;
|
|
831
|
+
};
|
|
832
|
+
class ProfileApi extends BaseApi {
|
|
833
|
+
protected _moduleSubPath: Endpoints;
|
|
834
|
+
get(request?: ProfileRequest): Promise<ProfileResponse>;
|
|
835
|
+
}
|
|
836
|
+
export type ContactsRequest = {
|
|
837
|
+
include_inactive?: boolean;
|
|
838
|
+
};
|
|
839
|
+
export type ContactsResponse = ResponseBase & {
|
|
840
|
+
organizations: Organization[];
|
|
841
|
+
};
|
|
842
|
+
class ContactsApi extends BaseApi {
|
|
843
|
+
protected _moduleSubPath: Endpoints;
|
|
844
|
+
getAll(request?: ContactsRequest): Promise<ContactsResponse>;
|
|
845
|
+
}
|
|
846
|
+
export type UploadResponse = ResponseBase & {
|
|
847
|
+
guid: string;
|
|
848
|
+
md5_hash: string;
|
|
849
|
+
};
|
|
850
|
+
class FilesApi extends BaseApi {
|
|
851
|
+
upload(file: Blob, filename: string): Promise<UploadResponse>;
|
|
852
|
+
download({ id }: ById): Promise<Blob>;
|
|
853
|
+
private _filePath;
|
|
854
|
+
}
|
|
855
|
+
export type PlainTaskList = {
|
|
856
|
+
id: number;
|
|
857
|
+
parent_id?: number;
|
|
858
|
+
name: string;
|
|
859
|
+
color?: string;
|
|
860
|
+
deleted: boolean;
|
|
861
|
+
list_type: ListType;
|
|
862
|
+
has_form?: boolean;
|
|
863
|
+
manager_ids: number[];
|
|
864
|
+
member_ids?: number[];
|
|
865
|
+
version: number;
|
|
866
|
+
external_version?: number;
|
|
867
|
+
external_id?: number;
|
|
868
|
+
};
|
|
869
|
+
export type TaskList = PlainTaskList & {
|
|
870
|
+
children?: TaskList[];
|
|
871
|
+
};
|
|
872
|
+
export type ListsResponse = ResponseBase & {
|
|
873
|
+
lists: TaskList[];
|
|
874
|
+
};
|
|
875
|
+
export type TaskListRequest = {
|
|
876
|
+
include_archived?: "y";
|
|
877
|
+
modified_before?: Date;
|
|
878
|
+
modified_after?: Date;
|
|
879
|
+
/**
|
|
880
|
+
* @remarks
|
|
881
|
+
* Default: 200
|
|
882
|
+
*/
|
|
883
|
+
item_count?: number;
|
|
884
|
+
};
|
|
885
|
+
export type TaskListResponse = ResponseBase & {
|
|
886
|
+
tasks: TaskHeader[];
|
|
887
|
+
has_more: boolean;
|
|
888
|
+
};
|
|
889
|
+
export type InboxRequest = {
|
|
890
|
+
/**
|
|
891
|
+
* The maximum number of tasks in the response
|
|
892
|
+
* @remarks
|
|
893
|
+
* default: 50
|
|
894
|
+
*/
|
|
895
|
+
item_count: number;
|
|
896
|
+
};
|
|
897
|
+
export type CreateListRequest = {
|
|
898
|
+
parent_id?: number;
|
|
899
|
+
name: string;
|
|
900
|
+
color?: string;
|
|
901
|
+
list_type?: ListType;
|
|
902
|
+
added_managers?: number[];
|
|
903
|
+
added_members?: number[];
|
|
904
|
+
external_version?: number;
|
|
905
|
+
external_id?: number;
|
|
906
|
+
is_private?: boolean;
|
|
907
|
+
};
|
|
908
|
+
export type PlainListResponse = ResponseBase & PlainTaskList;
|
|
909
|
+
export type UpdateListRequest = {
|
|
910
|
+
id: number;
|
|
911
|
+
name?: string;
|
|
912
|
+
color?: string;
|
|
913
|
+
list_type?: ListType;
|
|
914
|
+
added_managers?: number[];
|
|
915
|
+
removed_managers?: number[];
|
|
916
|
+
added_members?: number[];
|
|
917
|
+
removed_members?: number[];
|
|
918
|
+
external_version?: number;
|
|
919
|
+
external_id?: number;
|
|
920
|
+
is_private?: boolean;
|
|
921
|
+
};
|
|
922
|
+
class ListsApi extends BaseApi {
|
|
923
|
+
protected _moduleSubPath: Endpoints;
|
|
924
|
+
getAll(): Promise<ListsResponse>;
|
|
925
|
+
getTasksInList(listId: number, request?: TaskListRequest): Promise<TaskListResponse>;
|
|
926
|
+
getInbox(request?: InboxRequest): Promise<TaskListResponse>;
|
|
927
|
+
create(request: CreateListRequest): Promise<PlainListResponse>;
|
|
928
|
+
delete(request: ById): Promise<ResponseBase>;
|
|
929
|
+
update(request: UpdateListRequest): Promise<PlainListResponse>;
|
|
930
|
+
}
|
|
931
|
+
export type CalendarTasksRequest = {
|
|
932
|
+
start_date_utc?: Date;
|
|
933
|
+
end_date_utc: Date;
|
|
934
|
+
/**
|
|
935
|
+
* Maximum number of tasks that will be returned in reply
|
|
936
|
+
* @remarks
|
|
937
|
+
* 50 default, 100 max
|
|
938
|
+
*/
|
|
939
|
+
item_count?: number;
|
|
940
|
+
/**
|
|
941
|
+
* @remarks
|
|
942
|
+
* Whether all tasks accessible to user must be returned,
|
|
943
|
+
* including all roles of user and all tasks from forms
|
|
944
|
+
* accessible to user. Otherwise, only tasks where the user
|
|
945
|
+
* is an assignee or approver, that have not yet been approved,
|
|
946
|
+
* will be returned.
|
|
947
|
+
*/
|
|
948
|
+
all_accessed_tasks?: boolean;
|
|
949
|
+
/**
|
|
950
|
+
* Bit mask that determines filter combination
|
|
951
|
+
*/
|
|
952
|
+
filter_mask?: FilterMask;
|
|
953
|
+
};
|
|
954
|
+
export type CalendarResponse = ResponseBase & {
|
|
955
|
+
tasks: TaskWithComments[];
|
|
956
|
+
has_more: boolean;
|
|
957
|
+
};
|
|
958
|
+
class CalendarApi extends BaseApi {
|
|
959
|
+
protected _moduleSubPath: Endpoints;
|
|
960
|
+
getTasks(request: CalendarTasksRequest): Promise<CalendarResponse>;
|
|
961
|
+
}
|
|
962
|
+
export type AnnouncementComment = {
|
|
963
|
+
id: number;
|
|
964
|
+
text?: string;
|
|
965
|
+
formatted_text?: string;
|
|
966
|
+
create_date: Date;
|
|
967
|
+
author: Person;
|
|
968
|
+
attachments?: AttachedFile[];
|
|
969
|
+
comments?: TaskComment[];
|
|
970
|
+
};
|
|
971
|
+
export type AnnouncementWithComments = {
|
|
972
|
+
id: number;
|
|
973
|
+
text: string;
|
|
974
|
+
formatted_text: string;
|
|
975
|
+
create_date: Date;
|
|
976
|
+
last_modified_date: Date;
|
|
977
|
+
author: Person;
|
|
978
|
+
attachments?: AttachedFile[];
|
|
979
|
+
comments?: AnnouncementComment[];
|
|
980
|
+
};
|
|
981
|
+
export type AnnouncementsResponse = ResponseBase & {
|
|
982
|
+
announcements: AnnouncementWithComments[];
|
|
983
|
+
};
|
|
984
|
+
export type AnnouncementResponse = ResponseBase & {
|
|
985
|
+
announcement: AnnouncementWithComments;
|
|
986
|
+
};
|
|
987
|
+
export type AnnouncementRequest = {
|
|
988
|
+
text: string;
|
|
989
|
+
formatted_text?: string;
|
|
990
|
+
attachments?: NewFile[];
|
|
991
|
+
};
|
|
992
|
+
export type AnnouncementCommentRequest = {
|
|
993
|
+
text?: string;
|
|
994
|
+
formatted_text?: string;
|
|
995
|
+
attachments?: NewFile[];
|
|
996
|
+
};
|
|
997
|
+
class AnnouncementsApi extends BaseApi {
|
|
998
|
+
protected _moduleSubPath: Endpoints;
|
|
999
|
+
getAll(): Promise<AnnouncementsResponse>;
|
|
1000
|
+
get({ id }: ById): Promise<AnnouncementResponse>;
|
|
1001
|
+
create(request: AnnouncementRequest): Promise<AnnouncementResponse>;
|
|
1002
|
+
addComment(id: number, request: AnnouncementCommentRequest): Promise<AnnouncementResponse>;
|
|
1003
|
+
}
|
|
1004
|
+
export type CatalogInfo = {
|
|
1005
|
+
catalog_id: number;
|
|
1006
|
+
name: number;
|
|
1007
|
+
source_type: SourceType;
|
|
1008
|
+
external_id?: string;
|
|
1009
|
+
version: number;
|
|
1010
|
+
external_version?: number;
|
|
1011
|
+
deleted: boolean;
|
|
1012
|
+
supervisors?: number[];
|
|
1013
|
+
column_settings?: ColumnSettings[];
|
|
1014
|
+
links?: CatalogLink[];
|
|
1015
|
+
};
|
|
1016
|
+
export type CatalogLink = {
|
|
1017
|
+
catalog_id: number;
|
|
1018
|
+
column_name: string;
|
|
1019
|
+
};
|
|
1020
|
+
export type CatalogsResponse = ResponseBase & {
|
|
1021
|
+
catalogs: CatalogInfo[];
|
|
1022
|
+
};
|
|
1023
|
+
export type CatalogHeader = {
|
|
1024
|
+
name: string;
|
|
1025
|
+
type: CatalogHeaderType;
|
|
1026
|
+
};
|
|
1027
|
+
enum CatalogHeaderType {
|
|
1028
|
+
Text = "text",
|
|
1029
|
+
Workflow = "workflow"
|
|
1030
|
+
}
|
|
1031
|
+
export type CatalogItemResponse = CatalogItem & {
|
|
1032
|
+
item_id: number;
|
|
1033
|
+
};
|
|
1034
|
+
export type CatalogResponse = ResponseBase & {
|
|
1035
|
+
catalog_id: number;
|
|
1036
|
+
name: string;
|
|
1037
|
+
external_id?: string;
|
|
1038
|
+
version: number;
|
|
1039
|
+
external_version?: number;
|
|
1040
|
+
deleted: boolean;
|
|
1041
|
+
supervisors?: number[];
|
|
1042
|
+
catalog_headers: CatalogHeader[];
|
|
1043
|
+
column_settings?: ColumnSettings[];
|
|
1044
|
+
items?: CatalogItemResponse[];
|
|
1045
|
+
source_type: SourceType;
|
|
1046
|
+
};
|
|
1047
|
+
export type CatalogRequestBase = {
|
|
1048
|
+
id?: number;
|
|
1049
|
+
external_id?: string;
|
|
1050
|
+
name?: string;
|
|
1051
|
+
external_version?: number;
|
|
1052
|
+
catalog_headers: string[];
|
|
1053
|
+
items?: CatalogItem[];
|
|
1054
|
+
add_supervisors?: number[];
|
|
1055
|
+
remove_supervisors?: number[];
|
|
1056
|
+
add_workflow_headers?: string[];
|
|
1057
|
+
delete_workflow_headers?: string[];
|
|
1058
|
+
column_settings?: ColumnSettings[];
|
|
1059
|
+
};
|
|
1060
|
+
export type CreateCatalogRequest = CatalogRequestBase & {
|
|
1061
|
+
name: string;
|
|
1062
|
+
source_type?: SourceType;
|
|
1063
|
+
};
|
|
1064
|
+
export type SyncCatalogRequest = CatalogRequestBase & {
|
|
1065
|
+
id: number;
|
|
1066
|
+
apply: boolean;
|
|
1067
|
+
force_update_first_column?: boolean;
|
|
1068
|
+
};
|
|
1069
|
+
export type SyncCatalogResponse = ResponseBase & {
|
|
1070
|
+
apply: boolean;
|
|
1071
|
+
added?: CatalogItemResponse[];
|
|
1072
|
+
deleted?: CatalogItemResponse[];
|
|
1073
|
+
updated?: CatalogItemResponse[];
|
|
1074
|
+
catalog_headers: CatalogHeader[];
|
|
1075
|
+
};
|
|
1076
|
+
class CatalogsApi extends BaseApi {
|
|
1077
|
+
protected _moduleSubPath: Endpoints;
|
|
1078
|
+
getAll(): Promise<CatalogsResponse>;
|
|
1079
|
+
get({ id }: ById): Promise<CatalogResponse>;
|
|
1080
|
+
create(request: CreateCatalogRequest): Promise<CatalogResponse>;
|
|
1081
|
+
/**
|
|
1082
|
+
* This method updates catalog headers and items.
|
|
1083
|
+
* You must define all the values and text columns that need to remain in the catalog.
|
|
1084
|
+
*
|
|
1085
|
+
* All unspecified items and text columns will be deleted
|
|
1086
|
+
* @param request
|
|
1087
|
+
*/
|
|
1088
|
+
sync(request: SyncCatalogRequest): Promise<SyncCatalogResponse>;
|
|
1089
|
+
}
|
|
1090
|
+
export type MembersResponse = ResponseBase & {
|
|
1091
|
+
members: Person[];
|
|
1092
|
+
};
|
|
1093
|
+
export type MemberResponse = ResponseBase & Person;
|
|
1094
|
+
export type CreateMemberRequest = {
|
|
1095
|
+
first_name?: string;
|
|
1096
|
+
last_name?: string;
|
|
1097
|
+
email: string;
|
|
1098
|
+
status?: string;
|
|
1099
|
+
position?: string;
|
|
1100
|
+
department_id?: number;
|
|
1101
|
+
skype?: string;
|
|
1102
|
+
phone?: string;
|
|
1103
|
+
external_id?: string;
|
|
1104
|
+
login_phone?: string;
|
|
1105
|
+
};
|
|
1106
|
+
export type UpdateMemberRequest = {
|
|
1107
|
+
id: number;
|
|
1108
|
+
first_name?: string;
|
|
1109
|
+
last_name?: string;
|
|
1110
|
+
native_first_name?: string;
|
|
1111
|
+
native_last_name?: string;
|
|
1112
|
+
email?: string;
|
|
1113
|
+
status?: string;
|
|
1114
|
+
banned?: boolean;
|
|
1115
|
+
position?: string;
|
|
1116
|
+
department_id?: number;
|
|
1117
|
+
drop_department?: boolean;
|
|
1118
|
+
skype?: string;
|
|
1119
|
+
phone?: string;
|
|
1120
|
+
};
|
|
1121
|
+
class MembersApi extends BaseApi {
|
|
1122
|
+
protected _moduleSubPath: Endpoints;
|
|
1123
|
+
/**
|
|
1124
|
+
*
|
|
1125
|
+
* @param request
|
|
1126
|
+
* "email" and one of "first_name" or "last_name" are required
|
|
1127
|
+
*/
|
|
1128
|
+
create(request: CreateMemberRequest): Promise<MemberResponse>;
|
|
1129
|
+
get({ id }: ById): Promise<MemberResponse>;
|
|
1130
|
+
getAll(request?: GetAllRequest): Promise<MembersResponse>;
|
|
1131
|
+
update(request: UpdateMemberRequest): Promise<MemberResponse>;
|
|
1132
|
+
delete({ id }: ById): Promise<MemberResponse>;
|
|
1133
|
+
}
|
|
1134
|
+
export type TaskRequest = {
|
|
1135
|
+
text?: string;
|
|
1136
|
+
formatted_text?: string;
|
|
1137
|
+
subject?: string;
|
|
1138
|
+
parent_task_id?: number;
|
|
1139
|
+
due_date?: Date;
|
|
1140
|
+
due?: Date;
|
|
1141
|
+
scheduled_date?: Date;
|
|
1142
|
+
scheduled_datetime_utc?: Date;
|
|
1143
|
+
cancel_schedule?: boolean;
|
|
1144
|
+
duration?: number;
|
|
1145
|
+
form_id?: number;
|
|
1146
|
+
attachments?: NewFile[];
|
|
1147
|
+
responsible?: PersonIdentity;
|
|
1148
|
+
fields?: FormField[];
|
|
1149
|
+
approvals?: PersonIdentity[][];
|
|
1150
|
+
subscribers?: PersonIdentity[];
|
|
1151
|
+
participants?: PersonIdentity[];
|
|
1152
|
+
list_ids?: number[];
|
|
1153
|
+
fill_defaults?: boolean;
|
|
1154
|
+
};
|
|
1155
|
+
class TasksApi extends BaseApi {
|
|
1156
|
+
protected _moduleSubPath: Endpoints;
|
|
1157
|
+
get({ id }: ById): Promise<TaskResponse>;
|
|
1158
|
+
/**
|
|
1159
|
+
*
|
|
1160
|
+
* @param request
|
|
1161
|
+
* If "form_id" specified it will be Form task,
|
|
1162
|
+
* else - Simple task.
|
|
1163
|
+
*/
|
|
1164
|
+
create(request: TaskRequest): Promise<TaskResponse>;
|
|
1165
|
+
addComment(id: number, request: TaskCommentRequest): Promise<TaskResponse>;
|
|
1166
|
+
}
|
|
1167
|
+
export type PrintForm = {
|
|
1168
|
+
print_form_id: number;
|
|
1169
|
+
print_form_name?: string;
|
|
1170
|
+
};
|
|
1171
|
+
export type FormResponse = ResponseBase & {
|
|
1172
|
+
id: number;
|
|
1173
|
+
name: string;
|
|
1174
|
+
steps?: TaskSteps;
|
|
1175
|
+
fields: FormField[];
|
|
1176
|
+
print_forms?: PrintForm[];
|
|
1177
|
+
deleted_or_closed: boolean;
|
|
1178
|
+
business_owners?: number[];
|
|
1179
|
+
folder?: string[];
|
|
1180
|
+
};
|
|
1181
|
+
export type TaskSteps = {
|
|
1182
|
+
[index: number]: string;
|
|
1183
|
+
};
|
|
1184
|
+
export type FormsResponse = {
|
|
1185
|
+
forms: FormResponse[];
|
|
1186
|
+
};
|
|
1187
|
+
export type FormRegisterRequest = {
|
|
1188
|
+
steps?: number[];
|
|
1189
|
+
include_archived?: "y";
|
|
1190
|
+
modified_before?: Date;
|
|
1191
|
+
modified_after?: Date;
|
|
1192
|
+
created_before?: Date;
|
|
1193
|
+
created_after?: Date;
|
|
1194
|
+
closed_before?: Date;
|
|
1195
|
+
closed_after?: Date;
|
|
1196
|
+
filters?: FormFilter[];
|
|
1197
|
+
format?: "csv";
|
|
1198
|
+
delimiter?: string;
|
|
1199
|
+
simple_format?: boolean;
|
|
1200
|
+
encoding?: string;
|
|
1201
|
+
field_ids?: number[];
|
|
1202
|
+
task_ids?: number[];
|
|
1203
|
+
due_filter?: DueFilter;
|
|
1204
|
+
/**
|
|
1205
|
+
* Max. number of tasks in request
|
|
1206
|
+
* @remarks
|
|
1207
|
+
* More than 0, and less than or equal to 20000
|
|
1208
|
+
*/
|
|
1209
|
+
item_count?: number;
|
|
1210
|
+
};
|
|
1211
|
+
export type FormRegisterResponse = ResponseBase & {
|
|
1212
|
+
tasks: Task[];
|
|
1213
|
+
};
|
|
1214
|
+
export type PermissionsDict = {
|
|
1215
|
+
[index: string | number]: PermissionLevel;
|
|
1216
|
+
};
|
|
1217
|
+
export type PermissionsResponse = ResponseBase & {
|
|
1218
|
+
permissions: PermissionsDict;
|
|
1219
|
+
};
|
|
1220
|
+
export type ChangePermissionsRequest = {
|
|
1221
|
+
permissions: PermissionsDict;
|
|
1222
|
+
};
|
|
1223
|
+
class FormsApi extends BaseApi {
|
|
1224
|
+
protected _moduleSubPath: Endpoints;
|
|
1225
|
+
get({ id }: ById): Promise<FormResponse>;
|
|
1226
|
+
getAll(): Promise<FormsResponse>;
|
|
1227
|
+
getTasks(id: number, request: FormRegisterRequest): Promise<FormRegisterResponse>;
|
|
1228
|
+
getPermissions({ id }: ById): Promise<PermissionsResponse>;
|
|
1229
|
+
setPermissions(id: number, request: ChangePermissionsRequest): Promise<PermissionsResponse>;
|
|
1230
|
+
}
|
|
1231
|
+
export type LogsParameters = {
|
|
1232
|
+
after?: number;
|
|
1233
|
+
count?: number;
|
|
1234
|
+
};
|
|
1235
|
+
class LogsApi extends BaseApi {
|
|
1236
|
+
getEvents(request?: LogsParameters): Promise<Blob>;
|
|
1237
|
+
getFileAccess(request?: LogsParameters): Promise<Blob>;
|
|
1238
|
+
getTaskAccess(request?: LogsParameters): Promise<Blob>;
|
|
1239
|
+
getTaskExport(request?: LogsParameters): Promise<Blob>;
|
|
1240
|
+
getRegistryDownload(request?: LogsParameters): Promise<Blob>;
|
|
1241
|
+
}
|
|
1242
|
+
export type CallRequest = {
|
|
1243
|
+
/**
|
|
1244
|
+
* Unique ID of the extension's account in the external system
|
|
1245
|
+
*/
|
|
1246
|
+
account_id: string;
|
|
1247
|
+
/**
|
|
1248
|
+
* Sender phone number
|
|
1249
|
+
*/
|
|
1250
|
+
from_number: string;
|
|
1251
|
+
/**
|
|
1252
|
+
* Recipient phone number
|
|
1253
|
+
*/
|
|
1254
|
+
to_number: string;
|
|
1255
|
+
/**
|
|
1256
|
+
* Internal operator number
|
|
1257
|
+
*/
|
|
1258
|
+
internal_number?: string;
|
|
1259
|
+
/**
|
|
1260
|
+
* Call ID in external system
|
|
1261
|
+
*/
|
|
1262
|
+
external_id?: string;
|
|
1263
|
+
/**
|
|
1264
|
+
* Data for autofill form fields
|
|
1265
|
+
*/
|
|
1266
|
+
mappings?: FormMapping[];
|
|
1267
|
+
};
|
|
1268
|
+
export type CallResponse = ResponseBase & {
|
|
1269
|
+
task_id: number;
|
|
1270
|
+
};
|
|
1271
|
+
/**
|
|
1272
|
+
* Adding information about the call
|
|
1273
|
+
*
|
|
1274
|
+
* @remarks
|
|
1275
|
+
*
|
|
1276
|
+
* To successfully process the request, one of the following parameters
|
|
1277
|
+
* must be indicated: external_id, task_id or from_number and to_number
|
|
1278
|
+
*/
|
|
1279
|
+
export type AttachCallRecordRequest = {
|
|
1280
|
+
/**
|
|
1281
|
+
* Unique ID of the file uploaded with a /files/upload request
|
|
1282
|
+
*/
|
|
1283
|
+
record_file?: string;
|
|
1284
|
+
/**
|
|
1285
|
+
* Sender phone number
|
|
1286
|
+
*/
|
|
1287
|
+
from_number?: string;
|
|
1288
|
+
/**
|
|
1289
|
+
* Recipient phone number
|
|
1290
|
+
*/
|
|
1291
|
+
to_number?: string;
|
|
1292
|
+
/**
|
|
1293
|
+
* Call ID in external system
|
|
1294
|
+
*/
|
|
1295
|
+
external_id?: string;
|
|
1296
|
+
/**
|
|
1297
|
+
* ID of the created task
|
|
1298
|
+
* @remarks
|
|
1299
|
+
* Returns to integrations/call.
|
|
1300
|
+
*/
|
|
1301
|
+
task_id?: number;
|
|
1302
|
+
/**
|
|
1303
|
+
* Data for autofill form fields
|
|
1304
|
+
*/
|
|
1305
|
+
mappings?: FormMapping[];
|
|
1306
|
+
};
|
|
1307
|
+
class CallApi extends BaseApi {
|
|
1308
|
+
protected _moduleSubPath: Endpoints;
|
|
1309
|
+
registerCall(request: CallRequest): Promise<CallResponse>;
|
|
1310
|
+
attachCallRecord(request: AttachCallRecordRequest): Promise<ResponseBase>;
|
|
1311
|
+
}
|
|
1312
|
+
export type CreateBotRequest = {
|
|
1313
|
+
name: string;
|
|
1314
|
+
hook_url?: string;
|
|
1315
|
+
external_id?: string;
|
|
1316
|
+
};
|
|
1317
|
+
export type Bot = {
|
|
1318
|
+
id: number;
|
|
1319
|
+
name: string;
|
|
1320
|
+
external_id?: string;
|
|
1321
|
+
is_enabled: boolean;
|
|
1322
|
+
fired?: boolean;
|
|
1323
|
+
hook_url: string;
|
|
1324
|
+
description: string;
|
|
1325
|
+
bot_settings: string;
|
|
1326
|
+
version: string;
|
|
1327
|
+
login: string;
|
|
1328
|
+
send_only_last_comment: boolean;
|
|
1329
|
+
locale?: string;
|
|
1330
|
+
time_zone_offset?: number;
|
|
1331
|
+
};
|
|
1332
|
+
export type BotResponse = ResponseBase & Bot;
|
|
1333
|
+
export type BotsResponse = ResponseBase & {
|
|
1334
|
+
bots: Bot[];
|
|
1335
|
+
};
|
|
1336
|
+
export type UpdateBotRequest = {
|
|
1337
|
+
id: number;
|
|
1338
|
+
name?: string;
|
|
1339
|
+
hook_url?: string;
|
|
1340
|
+
is_enabled?: boolean;
|
|
1341
|
+
bot_settings?: string;
|
|
1342
|
+
description?: string;
|
|
1343
|
+
rights?: PersonRights;
|
|
1344
|
+
send_only_last_comment?: boolean;
|
|
1345
|
+
locale?: string;
|
|
1346
|
+
time_zone_offset?: number;
|
|
1347
|
+
};
|
|
1348
|
+
export type DeleteBotRequest = {
|
|
1349
|
+
id: number;
|
|
1350
|
+
task_receiver_id: number;
|
|
1351
|
+
};
|
|
1352
|
+
class BotApi extends BaseApi {
|
|
1353
|
+
protected _moduleSubPath: Endpoints;
|
|
1354
|
+
create(request: CreateBotRequest): Promise<BotResponse>;
|
|
1355
|
+
get({ id }: ById): Promise<BotResponse>;
|
|
1356
|
+
getAll(request?: GetAllRequest): Promise<BotsResponse>;
|
|
1357
|
+
update(request: UpdateBotRequest): Promise<BotResponse>;
|
|
1358
|
+
delete(request: DeleteBotRequest): Promise<BotResponse>;
|
|
1359
|
+
}
|
|
1360
|
+
export class PyrusApiClient extends BaseApi {
|
|
1361
|
+
private _role;
|
|
1362
|
+
private _profile;
|
|
1363
|
+
private _contacts;
|
|
1364
|
+
private _files;
|
|
1365
|
+
private _lists;
|
|
1366
|
+
private _calendar;
|
|
1367
|
+
private _announcements;
|
|
1368
|
+
private _catalogs;
|
|
1369
|
+
private _members;
|
|
1370
|
+
private _tasks;
|
|
1371
|
+
private _forms;
|
|
1372
|
+
private _logs;
|
|
1373
|
+
private _call;
|
|
1374
|
+
private _bot;
|
|
1375
|
+
/**
|
|
1376
|
+
*
|
|
1377
|
+
* @param auth
|
|
1378
|
+
* can be AuthRequest type or token
|
|
1379
|
+
* @param settings
|
|
1380
|
+
* connection settings
|
|
1381
|
+
*/
|
|
1382
|
+
constructor(auth: AuthRequest | string, settings?: Settings);
|
|
1383
|
+
private _authenticateClient;
|
|
1384
|
+
private get initParams();
|
|
1385
|
+
get role(): RoleApi;
|
|
1386
|
+
get profile(): ProfileApi;
|
|
1387
|
+
get contacts(): ContactsApi;
|
|
1388
|
+
get files(): FilesApi;
|
|
1389
|
+
get lists(): ListsApi;
|
|
1390
|
+
get calendar(): CalendarApi;
|
|
1391
|
+
get announcements(): AnnouncementsApi;
|
|
1392
|
+
get catalogs(): CatalogsApi;
|
|
1393
|
+
get members(): MembersApi;
|
|
1394
|
+
get tasks(): TasksApi;
|
|
1395
|
+
get forms(): FormsApi;
|
|
1396
|
+
get logs(): LogsApi;
|
|
1397
|
+
get call(): CallApi;
|
|
1398
|
+
get bot(): BotApi;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
export {};
|
|
1402
|
+
|
|
1403
|
+
}
|