pyrus-api 1.0.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/LICENSE.txt +21 -0
- package/README.md +289 -0
- package/build/cjs/index.js +1015 -0
- package/build/esm/index.js +1010 -0
- package/build/types/index.d.ts +51 -0
- package/build/types/src/api/announcementsApi.d.ts +14 -0
- package/build/types/src/api/baseApi.d.ts +21 -0
- package/build/types/src/api/botApi.d.ts +17 -0
- package/build/types/src/api/calendarApi.d.ts +8 -0
- package/build/types/src/api/callApi.d.ts +11 -0
- package/build/types/src/api/catalogsApi.d.ts +22 -0
- package/build/types/src/api/contactsApi.d.ts +8 -0
- package/build/types/src/api/filesApi.d.ts +8 -0
- package/build/types/src/api/formsApi.d.ts +17 -0
- package/build/types/src/api/index.d.ts +1 -0
- package/build/types/src/api/listsApi.d.ts +20 -0
- package/build/types/src/api/logsApi.d.ts +13 -0
- package/build/types/src/api/membersApi.d.ts +21 -0
- package/build/types/src/api/profileApi.d.ts +8 -0
- package/build/types/src/api/pyrusApiClient.d.ts +57 -0
- package/build/types/src/api/roleApi.d.ts +15 -0
- package/build/types/src/api/tasksApi.d.ts +18 -0
- package/build/types/src/entities/TaskWithComments.d.ts +7 -0
- package/build/types/src/entities/announcementComment.d.ts +12 -0
- package/build/types/src/entities/announcementWithComments.d.ts +13 -0
- package/build/types/src/entities/approval.d.ts +7 -0
- package/build/types/src/entities/attachedFile.d.ts +9 -0
- package/build/types/src/entities/bot.d.ts +15 -0
- package/build/types/src/entities/catalogHeader.d.ts +9 -0
- package/build/types/src/entities/catalogInfo.d.ts +19 -0
- package/build/types/src/entities/catalogItem.d.ts +12 -0
- package/build/types/src/entities/channel.d.ts +8 -0
- package/build/types/src/entities/channelUser.d.ts +4 -0
- package/build/types/src/entities/columnSettings.d.ts +6 -0
- package/build/types/src/entities/commentDescription.d.ts +6 -0
- package/build/types/src/entities/department.d.ts +7 -0
- package/build/types/src/entities/dueFilter.d.ts +3 -0
- package/build/types/src/entities/formFieldInfo.d.ts +21 -0
- package/build/types/src/entities/formFields/formField.d.ts +26 -0
- package/build/types/src/entities/formFields/formFieldAuthor.d.ts +7 -0
- package/build/types/src/entities/formFields/formFieldBase.d.ts +12 -0
- package/build/types/src/entities/formFields/formFieldCatalog.d.ts +15 -0
- package/build/types/src/entities/formFields/formFieldCheckmark.d.ts +7 -0
- package/build/types/src/entities/formFields/formFieldCreateDate.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldDate.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldDueDate.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldDueDateTime.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldEmail.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldFile.d.ts +7 -0
- package/build/types/src/entities/formFields/formFieldFlag.d.ts +7 -0
- package/build/types/src/entities/formFields/formFieldFormLink.d.ts +7 -0
- package/build/types/src/entities/formFields/formFieldMoney.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldMultipleChoice.d.ts +14 -0
- package/build/types/src/entities/formFields/formFieldNewFile.d.ts +5 -0
- package/build/types/src/entities/formFields/formFieldNote.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldNumber.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldPerson.d.ts +7 -0
- package/build/types/src/entities/formFields/formFieldPhone.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldProject.d.ts +15 -0
- package/build/types/src/entities/formFields/formFieldStatus.d.ts +7 -0
- package/build/types/src/entities/formFields/formFieldStep.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldTable.d.ts +14 -0
- package/build/types/src/entities/formFields/formFieldText.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldTime.d.ts +6 -0
- package/build/types/src/entities/formFields/formFieldTitle.d.ts +13 -0
- package/build/types/src/entities/formLink.d.ts +5 -0
- package/build/types/src/entities/formMapping.d.ts +16 -0
- package/build/types/src/entities/newFile.d.ts +7 -0
- package/build/types/src/entities/organization.d.ts +9 -0
- package/build/types/src/entities/person.d.ts +19 -0
- package/build/types/src/entities/plainTaskList.d.ts +15 -0
- package/build/types/src/entities/printForm.d.ts +4 -0
- package/build/types/src/entities/role.d.ts +10 -0
- package/build/types/src/entities/sessionLifespan.d.ts +4 -0
- package/build/types/src/entities/sessionRestriction.d.ts +9 -0
- package/build/types/src/entities/settings.d.ts +5 -0
- package/build/types/src/entities/smsInfo.d.ts +8 -0
- package/build/types/src/entities/step.d.ts +5 -0
- package/build/types/src/entities/subscriber.d.ts +6 -0
- package/build/types/src/entities/task.d.ts +26 -0
- package/build/types/src/entities/taskComment.d.ts +50 -0
- package/build/types/src/entities/taskHeader.d.ts +11 -0
- package/build/types/src/entities/taskList.d.ts +4 -0
- package/build/types/src/enums/activityAction.d.ts +4 -0
- package/build/types/src/enums/approvalChoice.d.ts +7 -0
- package/build/types/src/enums/callEventType.d.ts +3 -0
- package/build/types/src/enums/callStatus.d.ts +7 -0
- package/build/types/src/enums/channelType.d.ts +23 -0
- package/build/types/src/enums/checkmark.d.ts +4 -0
- package/build/types/src/enums/disconnectParty.d.ts +6 -0
- package/build/types/src/enums/errorCodeType.d.ts +123 -0
- package/build/types/src/enums/filterMask.d.ts +20 -0
- package/build/types/src/enums/flag.d.ts +5 -0
- package/build/types/src/enums/formFieldType.d.ts +27 -0
- package/build/types/src/enums/listType.d.ts +4 -0
- package/build/types/src/enums/operatorId.d.ts +9 -0
- package/build/types/src/enums/permissionLevel.d.ts +6 -0
- package/build/types/src/enums/personRights.d.ts +24 -0
- package/build/types/src/enums/personType.d.ts +5 -0
- package/build/types/src/enums/sendSmsError.d.ts +11 -0
- package/build/types/src/enums/sendSmsStatus.d.ts +6 -0
- package/build/types/src/enums/sourceType.d.ts +4 -0
- package/build/types/src/enums/status.d.ts +4 -0
- package/build/types/src/helpers/constants.d.ts +8 -0
- package/build/types/src/helpers/functions.d.ts +13 -0
- package/build/types/src/helpers/types.d.ts +4 -0
- package/build/types/src/requests/announcementCommentRequest.d.ts +6 -0
- package/build/types/src/requests/announcementRequest.d.ts +6 -0
- package/build/types/src/requests/attachCallRecordRequest.d.ts +37 -0
- package/build/types/src/requests/authRequest.d.ts +11 -0
- package/build/types/src/requests/calendarTasksRequest.d.ts +24 -0
- package/build/types/src/requests/callRequest.d.ts +27 -0
- package/build/types/src/requests/catalogRequestBase.d.ts +15 -0
- package/build/types/src/requests/changePermissionsRequest.d.ts +4 -0
- package/build/types/src/requests/contactsRequest.d.ts +3 -0
- package/build/types/src/requests/createBotRequest.d.ts +5 -0
- package/build/types/src/requests/createCallRequest.d.ts +6 -0
- package/build/types/src/requests/createCatalogRequest.d.ts +6 -0
- package/build/types/src/requests/createDepartmentRequest.d.ts +6 -0
- package/build/types/src/requests/createListRequest.d.ts +12 -0
- package/build/types/src/requests/createMemberRequest.d.ts +12 -0
- package/build/types/src/requests/createRoleRequest.d.ts +5 -0
- package/build/types/src/requests/deleteBotRequest.d.ts +4 -0
- package/build/types/src/requests/deleteRoleRequest.d.ts +4 -0
- package/build/types/src/requests/formFilter.d.ts +6 -0
- package/build/types/src/requests/formRegisterRequest.d.ts +26 -0
- package/build/types/src/requests/getAllRequest.d.ts +3 -0
- package/build/types/src/requests/getMessageRequest.d.ts +10 -0
- package/build/types/src/requests/inboxRequest.d.ts +8 -0
- package/build/types/src/requests/personIdentity.d.ts +4 -0
- package/build/types/src/requests/profileRequest.d.ts +3 -0
- package/build/types/src/requests/setAvatarRequest.d.ts +4 -0
- package/build/types/src/requests/syncCatalogRequest.d.ts +6 -0
- package/build/types/src/requests/taskCommentRequest.d.ts +39 -0
- package/build/types/src/requests/taskListRequest.d.ts +10 -0
- package/build/types/src/requests/taskRequest.d.ts +24 -0
- package/build/types/src/requests/updateBotRequest.d.ts +13 -0
- package/build/types/src/requests/updateDepartmentRequest.d.ts +8 -0
- package/build/types/src/requests/updateListRequest.d.ts +14 -0
- package/build/types/src/requests/updateMemberRequest.d.ts +15 -0
- package/build/types/src/requests/updateRoleRequest.d.ts +8 -0
- package/build/types/src/responses/announcementResponse.d.ts +5 -0
- package/build/types/src/responses/announcementsResponse.d.ts +5 -0
- package/build/types/src/responses/authResponse.d.ts +6 -0
- package/build/types/src/responses/botResponse.d.ts +3 -0
- package/build/types/src/responses/botsResponse.d.ts +5 -0
- package/build/types/src/responses/calendarResponse.d.ts +6 -0
- package/build/types/src/responses/callResponse.d.ts +4 -0
- package/build/types/src/responses/catalogItemResponse.d.ts +4 -0
- package/build/types/src/responses/catalogResponse.d.ts +18 -0
- package/build/types/src/responses/contactsResponse.d.ts +5 -0
- package/build/types/src/responses/departmentResponse.d.ts +3 -0
- package/build/types/src/responses/departmentsResponse.d.ts +5 -0
- package/build/types/src/responses/formRegisterResponse.d.ts +5 -0
- package/build/types/src/responses/formResponse.d.ts +17 -0
- package/build/types/src/responses/formsResponse.d.ts +4 -0
- package/build/types/src/responses/listsResponse.d.ts +5 -0
- package/build/types/src/responses/memberResponse.d.ts +3 -0
- package/build/types/src/responses/membersResponse.d.ts +5 -0
- package/build/types/src/responses/permissionsDict.d.ts +4 -0
- package/build/types/src/responses/permissionsResponse.d.ts +5 -0
- package/build/types/src/responses/plainListResponse.d.ts +3 -0
- package/build/types/src/responses/profileIdentityResponse.d.ts +5 -0
- package/build/types/src/responses/profileResponse.d.ts +12 -0
- package/build/types/src/responses/responseBase.d.ts +6 -0
- package/build/types/src/responses/roleResponse.d.ts +3 -0
- package/build/types/src/responses/rolesResponse.d.ts +5 -0
- package/build/types/src/responses/syncCatalogResponse.d.ts +10 -0
- package/build/types/src/responses/taskListResponse.d.ts +6 -0
- package/build/types/src/responses/taskResponse.d.ts +5 -0
- package/build/types/src/responses/uploadResponse.d.ts +5 -0
- package/build/types/src/responses//321/201atalogsResponse.d.ts +5 -0
- package/build/types/src/settings/defaults.d.ts +2 -0
- package/build/types/src/settings/endpoints.d.ts +32 -0
- package/package.json +35 -0
|
@@ -0,0 +1,1015 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.FormFieldType = void 0;
|
|
4
|
+
(function (FormFieldType) {
|
|
5
|
+
FormFieldType["Unknown"] = "unknown";
|
|
6
|
+
FormFieldType["Text"] = "text";
|
|
7
|
+
FormFieldType["Money"] = "money";
|
|
8
|
+
FormFieldType["Number"] = "number";
|
|
9
|
+
FormFieldType["Date"] = "date";
|
|
10
|
+
FormFieldType["Time"] = "time";
|
|
11
|
+
FormFieldType["Checkmark"] = "checkmark";
|
|
12
|
+
FormFieldType["MultipleChoice"] = "multiple_choice";
|
|
13
|
+
FormFieldType["DueDate"] = "due_date";
|
|
14
|
+
FormFieldType["Email"] = "email";
|
|
15
|
+
FormFieldType["Phone"] = "phone";
|
|
16
|
+
FormFieldType["Flag"] = "flag";
|
|
17
|
+
FormFieldType["Step"] = "step";
|
|
18
|
+
FormFieldType["Status"] = "status";
|
|
19
|
+
FormFieldType["CreationDate"] = "creation_date";
|
|
20
|
+
FormFieldType["Note"] = "note";
|
|
21
|
+
FormFieldType["Catalog"] = "catalog";
|
|
22
|
+
FormFieldType["File"] = "file";
|
|
23
|
+
FormFieldType["Person"] = "person";
|
|
24
|
+
FormFieldType["Author"] = "author";
|
|
25
|
+
FormFieldType["Table"] = "table";
|
|
26
|
+
FormFieldType["Title"] = "title";
|
|
27
|
+
FormFieldType["Project"] = "project";
|
|
28
|
+
FormFieldType["FormLink"] = "form_link";
|
|
29
|
+
FormFieldType["DueDateTime"] = "due_date_time";
|
|
30
|
+
})(exports.FormFieldType || (exports.FormFieldType = {}));
|
|
31
|
+
|
|
32
|
+
const dateTimeFieldTypes = [exports.FormFieldType.DueDateTime, exports.FormFieldType.CreationDate];
|
|
33
|
+
const dateFieldTypes = [exports.FormFieldType.Date, exports.FormFieldType.DueDate];
|
|
34
|
+
const timeFieldTypes = [exports.FormFieldType.Time];
|
|
35
|
+
const allDateAndTimeFieldTypes = [...dateFieldTypes, ...dateTimeFieldTypes, ...timeFieldTypes];
|
|
36
|
+
const allDateAndTimeResponseKeys = [
|
|
37
|
+
"create_date",
|
|
38
|
+
"last_modified_date",
|
|
39
|
+
"due_date",
|
|
40
|
+
"due",
|
|
41
|
+
"scheduled_date",
|
|
42
|
+
"scheduled_datetime_utc",
|
|
43
|
+
"close_date",
|
|
44
|
+
];
|
|
45
|
+
const dateRequestKeys = [
|
|
46
|
+
"due_date",
|
|
47
|
+
"scheduled_date",
|
|
48
|
+
];
|
|
49
|
+
const dateTimeRequestKeys = [
|
|
50
|
+
"start_date_utc",
|
|
51
|
+
"end_date_utc",
|
|
52
|
+
"modified_before",
|
|
53
|
+
"modified_after",
|
|
54
|
+
"created_before",
|
|
55
|
+
"created_after",
|
|
56
|
+
"closed_before",
|
|
57
|
+
"closed_after",
|
|
58
|
+
"due",
|
|
59
|
+
"scheduled_datetime_utc",
|
|
60
|
+
"start_time",
|
|
61
|
+
"end_time"
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
exports.OperatorId = void 0;
|
|
65
|
+
(function (OperatorId) {
|
|
66
|
+
OperatorId[OperatorId["Equals"] = 1] = "Equals";
|
|
67
|
+
OperatorId[OperatorId["LessThan"] = 2] = "LessThan";
|
|
68
|
+
OperatorId[OperatorId["GreaterThan"] = 3] = "GreaterThan";
|
|
69
|
+
OperatorId[OperatorId["IsIn"] = 4] = "IsIn";
|
|
70
|
+
OperatorId[OperatorId["Range"] = 5] = "Range";
|
|
71
|
+
OperatorId[OperatorId["MatchPrefix"] = 6] = "MatchPrefix";
|
|
72
|
+
OperatorId[OperatorId["IsEmpty"] = 7] = "IsEmpty";
|
|
73
|
+
})(exports.OperatorId || (exports.OperatorId = {}));
|
|
74
|
+
|
|
75
|
+
function toSearchParams(request) {
|
|
76
|
+
return "?" + new URLSearchParams(Object.entries(request)
|
|
77
|
+
.map(([key, value]) => {
|
|
78
|
+
if (value instanceof Date) {
|
|
79
|
+
if (dateTimeRequestKeys.includes(key))
|
|
80
|
+
return [key, toDateTimeString(value)];
|
|
81
|
+
if (dateRequestKeys.includes(key))
|
|
82
|
+
return [key, toDateString(value)];
|
|
83
|
+
}
|
|
84
|
+
return [key, value];
|
|
85
|
+
}))
|
|
86
|
+
.toString();
|
|
87
|
+
}
|
|
88
|
+
function extractDates(key, value) {
|
|
89
|
+
if (value instanceof Object
|
|
90
|
+
&& value.type
|
|
91
|
+
&& value.value) {
|
|
92
|
+
if (allDateAndTimeFieldTypes.includes(value.type)) {
|
|
93
|
+
value.value = new Date(value.value);
|
|
94
|
+
}
|
|
95
|
+
return value;
|
|
96
|
+
}
|
|
97
|
+
if (allDateAndTimeResponseKeys.includes(key)) {
|
|
98
|
+
value = value && new Date(value);
|
|
99
|
+
}
|
|
100
|
+
return value;
|
|
101
|
+
}
|
|
102
|
+
function packDates(key, value) {
|
|
103
|
+
if (dateRequestKeys.includes(key)) {
|
|
104
|
+
return value && toDateString(value);
|
|
105
|
+
}
|
|
106
|
+
if (dateTimeRequestKeys.includes(key)) {
|
|
107
|
+
return value && toDateTimeString(value);
|
|
108
|
+
}
|
|
109
|
+
if (value instanceof Object
|
|
110
|
+
&& value.type
|
|
111
|
+
&& value.value) {
|
|
112
|
+
if (dateTimeFieldTypes.includes(value.type)) {
|
|
113
|
+
value.value = toDateTimeString(value.value);
|
|
114
|
+
return value;
|
|
115
|
+
}
|
|
116
|
+
if (dateFieldTypes.includes(value.type)) {
|
|
117
|
+
value.value = toDateString(value.value);
|
|
118
|
+
return value;
|
|
119
|
+
}
|
|
120
|
+
if (timeFieldTypes.includes(value.type)) {
|
|
121
|
+
value.value = toTimeString(value.value);
|
|
122
|
+
return value;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return value;
|
|
126
|
+
}
|
|
127
|
+
function trimTailingSlash(url) {
|
|
128
|
+
return url.endsWith('/')
|
|
129
|
+
? url.slice(0, -1)
|
|
130
|
+
: url;
|
|
131
|
+
}
|
|
132
|
+
function toDateTimeString(date) {
|
|
133
|
+
if (typeof date !== "string")
|
|
134
|
+
date = date.toISOString();
|
|
135
|
+
return date.split(".")[0] + "Z";
|
|
136
|
+
}
|
|
137
|
+
function toDateString(date) {
|
|
138
|
+
if (typeof date !== "string")
|
|
139
|
+
date = date.toISOString();
|
|
140
|
+
return date.split("T")[0];
|
|
141
|
+
}
|
|
142
|
+
function toTimeString(date) {
|
|
143
|
+
if (typeof date !== "string")
|
|
144
|
+
date = date.toISOString();
|
|
145
|
+
return date.split("T")[1].slice(0, 5);
|
|
146
|
+
}
|
|
147
|
+
function processFilters(filters) {
|
|
148
|
+
if (!filters)
|
|
149
|
+
return {};
|
|
150
|
+
return filters
|
|
151
|
+
.reduce((prev, { operator_id, values, field_id }) => {
|
|
152
|
+
switch (operator_id) {
|
|
153
|
+
case exports.OperatorId.Equals:
|
|
154
|
+
case exports.OperatorId.MatchPrefix:
|
|
155
|
+
prev[`fld${field_id}`] = values[0];
|
|
156
|
+
break;
|
|
157
|
+
case exports.OperatorId.LessThan:
|
|
158
|
+
prev[`fld${field_id}`] = `lt${values[0]}`;
|
|
159
|
+
break;
|
|
160
|
+
case exports.OperatorId.GreaterThan:
|
|
161
|
+
prev[`fld${field_id}`] = `gt${values[0]}`;
|
|
162
|
+
break;
|
|
163
|
+
case exports.OperatorId.IsIn:
|
|
164
|
+
prev[`fld${field_id}`] = values.join(",");
|
|
165
|
+
break;
|
|
166
|
+
case exports.OperatorId.Range:
|
|
167
|
+
prev[`fld${field_id}`] = `gt${values[0]},lt${values[1]}`;
|
|
168
|
+
break;
|
|
169
|
+
case exports.OperatorId.IsEmpty:
|
|
170
|
+
prev[`fld${field_id}`] = "empty";
|
|
171
|
+
break;
|
|
172
|
+
default:
|
|
173
|
+
return prev;
|
|
174
|
+
}
|
|
175
|
+
return prev;
|
|
176
|
+
}, {});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
exports.FilterMask = void 0;
|
|
180
|
+
(function (FilterMask) {
|
|
181
|
+
FilterMask[FilterMask["Due"] = 1] = "Due";
|
|
182
|
+
FilterMask[FilterMask["DueDate"] = 2] = "DueDate";
|
|
183
|
+
FilterMask[FilterMask["DueForCurrentStep"] = 4] = "DueForCurrentStep";
|
|
184
|
+
FilterMask[FilterMask["Reminded"] = 8] = "Reminded";
|
|
185
|
+
})(exports.FilterMask || (exports.FilterMask = {}));
|
|
186
|
+
|
|
187
|
+
exports.CallEventType = void 0;
|
|
188
|
+
(function (CallEventType) {
|
|
189
|
+
CallEventType["Show"] = "show";
|
|
190
|
+
})(exports.CallEventType || (exports.CallEventType = {}));
|
|
191
|
+
|
|
192
|
+
exports.SourceType = void 0;
|
|
193
|
+
(function (SourceType) {
|
|
194
|
+
SourceType["Default"] = "default";
|
|
195
|
+
SourceType["FillTable"] = "fill_table";
|
|
196
|
+
})(exports.SourceType || (exports.SourceType = {}));
|
|
197
|
+
|
|
198
|
+
exports.ActivityAction = void 0;
|
|
199
|
+
(function (ActivityAction) {
|
|
200
|
+
ActivityAction["Finished"] = "finished";
|
|
201
|
+
ActivityAction["Reopened"] = "reopened";
|
|
202
|
+
})(exports.ActivityAction || (exports.ActivityAction = {}));
|
|
203
|
+
|
|
204
|
+
exports.ApprovalChoice = void 0;
|
|
205
|
+
(function (ApprovalChoice) {
|
|
206
|
+
ApprovalChoice["Waiting"] = "waiting";
|
|
207
|
+
ApprovalChoice["Approved"] = "approved";
|
|
208
|
+
ApprovalChoice["Rejected"] = "rejected";
|
|
209
|
+
ApprovalChoice["Revoked"] = "revoked";
|
|
210
|
+
ApprovalChoice["Acknowledged"] = "acknowledged";
|
|
211
|
+
})(exports.ApprovalChoice || (exports.ApprovalChoice = {}));
|
|
212
|
+
|
|
213
|
+
exports.PersonRights = void 0;
|
|
214
|
+
(function (PersonRights) {
|
|
215
|
+
PersonRights[PersonRights["None"] = 0] = "None";
|
|
216
|
+
PersonRights[PersonRights["ManageRoles"] = 1] = "ManageRoles";
|
|
217
|
+
PersonRights[PersonRights["CanSeeAllTasks"] = 2] = "CanSeeAllTasks";
|
|
218
|
+
PersonRights[PersonRights["ManagePersonsInOrganization"] = 4] = "ManagePersonsInOrganization";
|
|
219
|
+
PersonRights[PersonRights["EditOrganizationProjects"] = 8] = "EditOrganizationProjects";
|
|
220
|
+
PersonRights[PersonRights["EditOrganizationSettings"] = 16] = "EditOrganizationSettings";
|
|
221
|
+
PersonRights[PersonRights["DeleteMyTasksAndProjects"] = 32] = "DeleteMyTasksAndProjects";
|
|
222
|
+
PersonRights[PersonRights["CloseDeleteAnnouncements"] = 64] = "CloseDeleteAnnouncements";
|
|
223
|
+
PersonRights[PersonRights["BillsPayment"] = 128] = "BillsPayment";
|
|
224
|
+
PersonRights[PersonRights["InvitePersonsToOrganization"] = 256] = "InvitePersonsToOrganization";
|
|
225
|
+
PersonRights[PersonRights["DeleteOtherMembersTasks"] = 512] = "DeleteOtherMembersTasks";
|
|
226
|
+
PersonRights[PersonRights["ManageIntegrationsAndCatalogs"] = 1024] = "ManageIntegrationsAndCatalogs";
|
|
227
|
+
PersonRights[PersonRights["CreateAnnouncement"] = 2048] = "CreateAnnouncement";
|
|
228
|
+
PersonRights[PersonRights["CanDeleteTaskFlagEquivalent"] = 544] = "CanDeleteTaskFlagEquivalent";
|
|
229
|
+
PersonRights[PersonRights["SupervisorRights"] = 221] = "SupervisorRights";
|
|
230
|
+
PersonRights[PersonRights["MaxAdditionalRights"] = 2047] = "MaxAdditionalRights";
|
|
231
|
+
PersonRights[PersonRights["NewOrganizationDefaultRights"] = 2080] = "NewOrganizationDefaultRights";
|
|
232
|
+
PersonRights[PersonRights["UIOrganizationManager"] = 277] = "UIOrganizationManager";
|
|
233
|
+
PersonRights[PersonRights["UIAccountant"] = 128] = "UIAccountant";
|
|
234
|
+
PersonRights[PersonRights["UISupervisor"] = 10] = "UISupervisor";
|
|
235
|
+
PersonRights[PersonRights["UIConfigurationManager"] = 1600] = "UIConfigurationManager";
|
|
236
|
+
PersonRights[PersonRights["UIAdministrator"] = 2015] = "UIAdministrator";
|
|
237
|
+
})(exports.PersonRights || (exports.PersonRights = {}));
|
|
238
|
+
|
|
239
|
+
exports.ListType = void 0;
|
|
240
|
+
(function (ListType) {
|
|
241
|
+
ListType["Private"] = "private";
|
|
242
|
+
ListType["OrganizationWide"] = "org_wide";
|
|
243
|
+
})(exports.ListType || (exports.ListType = {}));
|
|
244
|
+
|
|
245
|
+
exports.ErrorCodeType = void 0;
|
|
246
|
+
(function (ErrorCodeType) {
|
|
247
|
+
ErrorCodeType["ServerError"] = "server_error";
|
|
248
|
+
ErrorCodeType["AuthorizationError"] = "authorization_error";
|
|
249
|
+
ErrorCodeType["TokenNotSpecified"] = "token_not_specified";
|
|
250
|
+
ErrorCodeType["RevokedToken"] = "revoked_token";
|
|
251
|
+
ErrorCodeType["ExpiredToken"] = "expired_token";
|
|
252
|
+
ErrorCodeType["InvalidToken"] = "invalid_token";
|
|
253
|
+
ErrorCodeType["AccountBlocked"] = "account_blocked";
|
|
254
|
+
ErrorCodeType["InvalidCredentials"] = "invalid_credentials";
|
|
255
|
+
ErrorCodeType["InvalidApplicationId"] = "invalid_application_id";
|
|
256
|
+
ErrorCodeType["InvalidFieldId"] = "invalid_field_id";
|
|
257
|
+
ErrorCodeType["InvalidFieldName"] = "invalid_field_name";
|
|
258
|
+
ErrorCodeType["InvalidFieldIdName"] = "invalid_field_id_name";
|
|
259
|
+
ErrorCodeType["NonUniqueName"] = "non_unique_name";
|
|
260
|
+
ErrorCodeType["FieldIdentityMissing"] = "field_identity_missing";
|
|
261
|
+
ErrorCodeType["DuplicateField"] = "duplicate_field";
|
|
262
|
+
ErrorCodeType["InvalidCatalogId"] = "invalid_catalog_id";
|
|
263
|
+
ErrorCodeType["InvalidCatalogItemName"] = "invalid_catalog_item_name";
|
|
264
|
+
ErrorCodeType["NonUniqueCatalogItemName"] = "non_unique_catalog_item_name";
|
|
265
|
+
ErrorCodeType["InvalidCatalogItemId"] = "invalid_catalog_item_id";
|
|
266
|
+
ErrorCodeType["InvalidCatalogItemIdName"] = "catalog_item_id_name_mismatch";
|
|
267
|
+
ErrorCodeType["InvalidEmail"] = "invalid_email";
|
|
268
|
+
ErrorCodeType["NonUniqueEmail"] = "non_unique_email";
|
|
269
|
+
ErrorCodeType["InvalidPersonIdEmail"] = "invalid_person_id_email";
|
|
270
|
+
ErrorCodeType["UnrecognizedAttachmentId"] = "unrecognized_attachment_id";
|
|
271
|
+
ErrorCodeType["RequiredFieldMissing"] = "required_field_missing";
|
|
272
|
+
ErrorCodeType["FieldTypeIsNotSupported"] = "type_is_not_supported";
|
|
273
|
+
ErrorCodeType["IncorrectParametersCount"] = "incorrect_parameters_count";
|
|
274
|
+
ErrorCodeType["FilterTypeIsNotSupported"] = "filter_type_is_not_supported";
|
|
275
|
+
ErrorCodeType["StepFieldDoesNotExists"] = "step_field_does_not_exists";
|
|
276
|
+
ErrorCodeType["NoFileInRequest"] = "no_file_in_request";
|
|
277
|
+
ErrorCodeType["TooLargeRequestLength"] = "too_large_request_length";
|
|
278
|
+
ErrorCodeType["TaskHasNoForm"] = "task_has_no_form";
|
|
279
|
+
ErrorCodeType["RequiredParameterMissing"] = "required_parameter_missing";
|
|
280
|
+
ErrorCodeType["InvalidValueFormat"] = "invalid_value_format";
|
|
281
|
+
ErrorCodeType["InvalidJson"] = "invalid_json";
|
|
282
|
+
ErrorCodeType["EmptyBody"] = "empty_body";
|
|
283
|
+
ErrorCodeType["TextMissing"] = "text_missing";
|
|
284
|
+
ErrorCodeType["FormIdMissing"] = "form_id_missing";
|
|
285
|
+
ErrorCodeType["InvalidPersonId"] = "invalid_person_id";
|
|
286
|
+
ErrorCodeType["DeletedField"] = "deleted_field";
|
|
287
|
+
ErrorCodeType["PersonIdentityMissing"] = "person_identity_missing";
|
|
288
|
+
ErrorCodeType["CatalogItemIdMissing"] = "catalog_identity_missing";
|
|
289
|
+
ErrorCodeType["FormHasNoTask"] = "form_has_no_task";
|
|
290
|
+
ErrorCodeType["EitherDueDateOrDueCanBeSet"] = "either_due_date_or_due_can_be_set";
|
|
291
|
+
ErrorCodeType["NegativeDuration"] = "negative_duration";
|
|
292
|
+
ErrorCodeType["DurationIsTooLong"] = "duration_is_too_long";
|
|
293
|
+
ErrorCodeType["DueMissing"] = "due_missing";
|
|
294
|
+
ErrorCodeType["ScheduledDateInPast"] = "scheduled_date_in_past";
|
|
295
|
+
ErrorCodeType["CannotAddFormProject"] = "cannot_add_form_project";
|
|
296
|
+
ErrorCodeType["FormTemplateCantBeRemovedFromTask"] = "form_template_cant_be_removed_from_task";
|
|
297
|
+
ErrorCodeType["TooManyTaskSteps"] = "too_many_task_steps";
|
|
298
|
+
ErrorCodeType["TooManyComments"] = "too_many_comments";
|
|
299
|
+
ErrorCodeType["InvalidStepNumber"] = "invalid_step_number";
|
|
300
|
+
ErrorCodeType["TaskLimitExceeded"] = "task_limit_exceeded";
|
|
301
|
+
ErrorCodeType["FieldIsInTable"] = "field_is_in_table";
|
|
302
|
+
ErrorCodeType["RequiredTableFieldMissing"] = "required_table_field_missing";
|
|
303
|
+
ErrorCodeType["DepartmentCatalogCanNotBeModified"] = "department_catalog_can_not_be_modified";
|
|
304
|
+
ErrorCodeType["CatalogDuplicateItems"] = "catalog_duplicate_rows";
|
|
305
|
+
ErrorCodeType["EmptyCatalogHeaders"] = "empty_catalog_headers";
|
|
306
|
+
ErrorCodeType["CanNotModifyDeletedCatalog"] = "can_not_modify_deleted_catalog";
|
|
307
|
+
ErrorCodeType["CatalogDuplicateHeaders"] = "catalog_duplicate_headers";
|
|
308
|
+
ErrorCodeType["CanNotModifyFirstColumn"] = "can_not_modify_first_column";
|
|
309
|
+
ErrorCodeType["CatalogHeadersItemsMismatch"] = "catalog_headers_items_mismatch";
|
|
310
|
+
ErrorCodeType["TooManyCatalogItems"] = "too_many_catalog_items";
|
|
311
|
+
ErrorCodeType["CatalogItemMaxLengthExceeded"] = "catalog_item_max_length_exceeded";
|
|
312
|
+
ErrorCodeType["SingleValueIsNotSupported"] = "single_value_is_not_supported";
|
|
313
|
+
ErrorCodeType["ParticipantLimitExceeded"] = "participant_limit_exceeded";
|
|
314
|
+
ErrorCodeType["TableRowsLimitExceeded"] = "table_rows_limit_exceeded";
|
|
315
|
+
ErrorCodeType["TextFieldValueLimitExceeded"] = "text_field_value_limit_exceeded";
|
|
316
|
+
ErrorCodeType["UnableToEditField"] = "unable_to_edit_field";
|
|
317
|
+
ErrorCodeType["EmptyFile"] = "empty_file";
|
|
318
|
+
ErrorCodeType["BadMultipartContent"] = "bad_multipart_content";
|
|
319
|
+
ErrorCodeType["TooManyDecimalPlaces"] = "too_many_decimal_places";
|
|
320
|
+
ErrorCodeType["ExternalCommentEmptyText"] = "external_comment_empty_text";
|
|
321
|
+
ErrorCodeType["SenderAddressFieldMissing"] = "sender_address_field_missing";
|
|
322
|
+
ErrorCodeType["ExternalCommentRecipientNotFound"] = "external_comment_recipient_not_found";
|
|
323
|
+
ErrorCodeType["DefaultMailboxNotFound"] = "default_mailbox_not_found";
|
|
324
|
+
ErrorCodeType["CatalogNullValue"] = "catalog_null_value";
|
|
325
|
+
ErrorCodeType["MaxTextLengthExceeded"] = "max_text_length_exceeded";
|
|
326
|
+
ErrorCodeType["DueOutsideOfBounds"] = "due_outside_of_bounds";
|
|
327
|
+
ErrorCodeType["AttachmentsForbidden"] = "attachments_forbidden";
|
|
328
|
+
ErrorCodeType["UnrecognizedCallGuid"] = "unrecognized_call_guid";
|
|
329
|
+
ErrorCodeType["UnsupportedAttachmentFormat"] = "unsupported_attachment_format";
|
|
330
|
+
ErrorCodeType["ValidationError"] = "validation_error";
|
|
331
|
+
ErrorCodeType["UnrecognizedAccountId"] = "unrecognized_account_id";
|
|
332
|
+
ErrorCodeType["WebhookIsDisabled"] = "webhook_is_disabled";
|
|
333
|
+
ErrorCodeType["TooLargeMessageText"] = "too_large_message_text";
|
|
334
|
+
ErrorCodeType["UnrecognizedMessageType"] = "unrecognized_message_type";
|
|
335
|
+
ErrorCodeType["InvalidFieldMappingCode"] = "invalid_field_mapping_code";
|
|
336
|
+
ErrorCodeType["TooManyAttachments"] = "too_many_attachments";
|
|
337
|
+
ErrorCodeType["UnrecognizedCallId"] = "unrecognized_call_id";
|
|
338
|
+
ErrorCodeType["UnsupportedRecordFileFormat"] = "unsupported_record_file_format";
|
|
339
|
+
ErrorCodeType["UnrecognizedIntegrationGuid"] = "unrecognized_integration_guid";
|
|
340
|
+
ErrorCodeType["LimitExceeded"] = "limit_exceeded";
|
|
341
|
+
ErrorCodeType["MaxSmsTextLengthExceeded"] = "max_sms_text_length_exceeded";
|
|
342
|
+
ErrorCodeType["SmsIntegrationNotConfigured"] = "sms_integration_not_configured";
|
|
343
|
+
ErrorCodeType["AttachmentTooBig"] = "attachment_too_big";
|
|
344
|
+
ErrorCodeType["UncreatedOrDeletedTableRows"] = "invalid_table_row";
|
|
345
|
+
ErrorCodeType["PrivateChannelAccessDenied"] = "private_channel_access_denied";
|
|
346
|
+
ErrorCodeType["PrivateCommentHasForbiddenChanges"] = "private_comment_has_forbidden_changes";
|
|
347
|
+
ErrorCodeType["ItemsCountOutOfRange"] = "items_count_out_of_range";
|
|
348
|
+
ErrorCodeType["CannotAddExternalUser"] = "cannot_add_external_user";
|
|
349
|
+
ErrorCodeType["UnrecognizedTaskId"] = "unrecognized_task_id";
|
|
350
|
+
ErrorCodeType["TooManyDeletedCatalogItems"] = "too_many_deleted_catalog_items";
|
|
351
|
+
ErrorCodeType["FieldCannotHaveMultipleValues"] = "field_cannot_have_multiple_values";
|
|
352
|
+
ErrorCodeType["FieldEditingIsNotAllowed"] = "field_editing_is_not_allowed";
|
|
353
|
+
ErrorCodeType["NonUniqueCode"] = "non_unique_code";
|
|
354
|
+
ErrorCodeType["InvalidFieldCode"] = "invalid_field_code";
|
|
355
|
+
ErrorCodeType["AccessDeniedProject"] = "access_denied_project";
|
|
356
|
+
ErrorCodeType["AccessDeniedTask"] = "access_denied_task";
|
|
357
|
+
ErrorCodeType["AccessDeniedCatalog"] = "access_denied_catalog";
|
|
358
|
+
ErrorCodeType["AccessDeniedForm"] = "access_denied_form";
|
|
359
|
+
ErrorCodeType["AccessDeniedPerson"] = "access_denied_person";
|
|
360
|
+
ErrorCodeType["AccessDeniedCloseTask"] = "access_denied_close_task";
|
|
361
|
+
ErrorCodeType["AccessDeniedReopenTask"] = "access_denied_reopen_task";
|
|
362
|
+
ErrorCodeType["AccessDeniedFileAccessHistory"] = "access_denied_file_access_history";
|
|
363
|
+
ErrorCodeType["AccessDeniedFile"] = "access_denied_file";
|
|
364
|
+
ErrorCodeType["AccessDeniedReport"] = "access_denied_report";
|
|
365
|
+
ErrorCodeType["AccessDenied"] = "access_denied";
|
|
366
|
+
ErrorCodeType["FileIsMissing"] = "file_is_missing";
|
|
367
|
+
ErrorCodeType["TooManyRequests"] = "too_many_requests";
|
|
368
|
+
})(exports.ErrorCodeType || (exports.ErrorCodeType = {}));
|
|
369
|
+
|
|
370
|
+
exports.Flag = void 0;
|
|
371
|
+
(function (Flag) {
|
|
372
|
+
Flag["None"] = "none";
|
|
373
|
+
Flag["Checked"] = "checked";
|
|
374
|
+
Flag["Unchecked"] = "unchecked";
|
|
375
|
+
})(exports.Flag || (exports.Flag = {}));
|
|
376
|
+
|
|
377
|
+
exports.PermissionLevel = void 0;
|
|
378
|
+
(function (PermissionLevel) {
|
|
379
|
+
PermissionLevel["None"] = "none";
|
|
380
|
+
PermissionLevel["Manager"] = "manager";
|
|
381
|
+
PermissionLevel["Member"] = "member";
|
|
382
|
+
PermissionLevel["Administrator"] = "administrator";
|
|
383
|
+
})(exports.PermissionLevel || (exports.PermissionLevel = {}));
|
|
384
|
+
|
|
385
|
+
exports.PersonType = void 0;
|
|
386
|
+
(function (PersonType) {
|
|
387
|
+
PersonType["User"] = "user";
|
|
388
|
+
PersonType["Bot"] = "bot";
|
|
389
|
+
PersonType["Role"] = "role";
|
|
390
|
+
})(exports.PersonType || (exports.PersonType = {}));
|
|
391
|
+
|
|
392
|
+
exports.SendSmsError = void 0;
|
|
393
|
+
(function (SendSmsError) {
|
|
394
|
+
SendSmsError["None"] = "none";
|
|
395
|
+
SendSmsError["Unknown"] = "unknown";
|
|
396
|
+
SendSmsError["Expired"] = "expired";
|
|
397
|
+
SendSmsError["Forbidden"] = "forbidden";
|
|
398
|
+
SendSmsError["Unreachable"] = "unreachable";
|
|
399
|
+
SendSmsError["UnknownStatus"] = "unknown_status";
|
|
400
|
+
SendSmsError["UnableToDeliver"] = "unable_to_deliver";
|
|
401
|
+
SendSmsError["InvalidPhoneNumber"] = "invalid_phone_number";
|
|
402
|
+
SendSmsError["Rejected"] = "rejected";
|
|
403
|
+
})(exports.SendSmsError || (exports.SendSmsError = {}));
|
|
404
|
+
|
|
405
|
+
exports.SendSmsStatus = void 0;
|
|
406
|
+
(function (SendSmsStatus) {
|
|
407
|
+
SendSmsStatus["Sent"] = "sent";
|
|
408
|
+
SendSmsStatus["Delivered"] = "delivered";
|
|
409
|
+
SendSmsStatus["DeliveryFailed"] = "delivery_failed";
|
|
410
|
+
SendSmsStatus["SendFailed"] = "send_failed";
|
|
411
|
+
})(exports.SendSmsStatus || (exports.SendSmsStatus = {}));
|
|
412
|
+
|
|
413
|
+
/******************************************************************************
|
|
414
|
+
Copyright (c) Microsoft Corporation.
|
|
415
|
+
|
|
416
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
417
|
+
purpose with or without fee is hereby granted.
|
|
418
|
+
|
|
419
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
420
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
421
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
422
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
423
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
424
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
425
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
426
|
+
***************************************************************************** */
|
|
427
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
431
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
432
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
433
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
434
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
435
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
436
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
441
|
+
var e = new Error(message);
|
|
442
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
class BaseApi {
|
|
446
|
+
constructor({ token, authRequest, settings }) {
|
|
447
|
+
this._authRequest = null;
|
|
448
|
+
this._moduleSubPath = '';
|
|
449
|
+
if (token)
|
|
450
|
+
this._token = token;
|
|
451
|
+
if (authRequest)
|
|
452
|
+
this._authRequest = authRequest;
|
|
453
|
+
if (settings) {
|
|
454
|
+
this._settings = settings;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
loginDone() {
|
|
458
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
459
|
+
if (!this._authRequest) {
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
const { access_token, api_url, files_url } = yield this._authRequest;
|
|
463
|
+
this._token = access_token;
|
|
464
|
+
this._settings.apiUrl = trimTailingSlash(api_url);
|
|
465
|
+
this._settings.filesUrl = trimTailingSlash(files_url);
|
|
466
|
+
this._authRequest = null;
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
fetchApi(url, method, body, headersOverride) {
|
|
470
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
471
|
+
yield this.loginDone();
|
|
472
|
+
const resp = yield fetch(url, {
|
|
473
|
+
method: method,
|
|
474
|
+
headers: headersOverride || (yield this.defaultHeaders()),
|
|
475
|
+
body: body,
|
|
476
|
+
});
|
|
477
|
+
return yield this._checkResponse(resp);
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
_checkResponse(resp) {
|
|
481
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
482
|
+
if (resp.ok) {
|
|
483
|
+
const contentType = resp.headers.get("Content-Type");
|
|
484
|
+
if (contentType && contentType.includes("application/json")) {
|
|
485
|
+
return JSON.parse(yield resp.text(), extractDates);
|
|
486
|
+
}
|
|
487
|
+
return yield resp.blob();
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
return Promise.reject(yield resp.json());
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
getModulePath() {
|
|
495
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
496
|
+
yield this.loginDone();
|
|
497
|
+
return this._settings.apiUrl + this._moduleSubPath;
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
authorisationHeader() {
|
|
501
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
502
|
+
yield this.loginDone();
|
|
503
|
+
return {
|
|
504
|
+
"Authorization": `Bearer ${this._token}`
|
|
505
|
+
};
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
defaultHeaders() {
|
|
509
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
510
|
+
return Object.assign(Object.assign({}, (yield this.authorisationHeader())), { "Content-Type": "application/json" });
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
var Endpoints;
|
|
516
|
+
(function (Endpoints) {
|
|
517
|
+
Endpoints["Auth"] = "/auth";
|
|
518
|
+
Endpoints["Roles"] = "/roles";
|
|
519
|
+
Endpoints["Profile"] = "/profile";
|
|
520
|
+
Endpoints["Contacts"] = "/contacts";
|
|
521
|
+
Endpoints["Files"] = "/files";
|
|
522
|
+
Endpoints["V4"] = "/v4";
|
|
523
|
+
Endpoints["Upload"] = "/upload";
|
|
524
|
+
Endpoints["Download"] = "/download";
|
|
525
|
+
Endpoints["Lists"] = "/lists";
|
|
526
|
+
Endpoints["Inbox"] = "/inbox";
|
|
527
|
+
Endpoints["ListTasks"] = "/tasks";
|
|
528
|
+
Endpoints["Calendar"] = "/calendar";
|
|
529
|
+
Endpoints["Announcements"] = "/announcements";
|
|
530
|
+
Endpoints["AnnouncementComments"] = "/comments";
|
|
531
|
+
Endpoints["Catalogs"] = "/catalogs";
|
|
532
|
+
Endpoints["Members"] = "/members";
|
|
533
|
+
Endpoints["Tasks"] = "/tasks";
|
|
534
|
+
Endpoints["TasksComments"] = "/comments";
|
|
535
|
+
Endpoints["Forms"] = "/forms";
|
|
536
|
+
Endpoints["FormsRegister"] = "/register";
|
|
537
|
+
Endpoints["FormsPermissions"] = "/permissions";
|
|
538
|
+
Endpoints["EventHistory"] = "/eventhistory";
|
|
539
|
+
Endpoints["FileAccessHistory"] = "/fileaccesshistory";
|
|
540
|
+
Endpoints["TaskAccessHistory"] = "/taskaccesshistory";
|
|
541
|
+
Endpoints["TaskExportHistory"] = "/taskexporthistory";
|
|
542
|
+
Endpoints["RegistryDownloadHistory"] = "/registrydownloadhistory";
|
|
543
|
+
Endpoints["Integrations"] = "/integrations";
|
|
544
|
+
Endpoints["Call"] = "/call";
|
|
545
|
+
Endpoints["AttachCallRecord"] = "/attachcallrecord";
|
|
546
|
+
Endpoints["Bots"] = "/bots";
|
|
547
|
+
})(Endpoints || (Endpoints = {}));
|
|
548
|
+
|
|
549
|
+
class RoleApi extends BaseApi {
|
|
550
|
+
constructor() {
|
|
551
|
+
super(...arguments);
|
|
552
|
+
this._moduleSubPath = Endpoints.Roles;
|
|
553
|
+
}
|
|
554
|
+
create(request) {
|
|
555
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
556
|
+
return yield this.fetchApi(yield this.getModulePath(), "POST", JSON.stringify(request));
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
get(_a) {
|
|
560
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
561
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}`, "GET");
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
getAll(request) {
|
|
565
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
566
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
567
|
+
return yield this.fetchApi((yield this.getModulePath()) + searchParams, "GET");
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
update(request) {
|
|
571
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
572
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${request.id}`, "PUT", JSON.stringify(request));
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
const defaults = {
|
|
578
|
+
authUrl: "https://accounts.pyrus.com/api/v4",
|
|
579
|
+
apiUrl: "https://api.pyrus.com/v4",
|
|
580
|
+
filesUrl: "https://files.pyrus.com"
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
class ProfileApi extends BaseApi {
|
|
584
|
+
constructor() {
|
|
585
|
+
super(...arguments);
|
|
586
|
+
this._moduleSubPath = Endpoints.Profile;
|
|
587
|
+
}
|
|
588
|
+
get(request) {
|
|
589
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
590
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
591
|
+
return yield this.fetchApi((yield this.getModulePath()) + searchParams, "GET");
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
class ContactsApi extends BaseApi {
|
|
597
|
+
constructor() {
|
|
598
|
+
super(...arguments);
|
|
599
|
+
this._moduleSubPath = Endpoints.Contacts;
|
|
600
|
+
}
|
|
601
|
+
getAll(request) {
|
|
602
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
603
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
604
|
+
return yield this.fetchApi((yield this.getModulePath()) + searchParams, "GET");
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
class FilesApi extends BaseApi {
|
|
610
|
+
upload(file, filename) {
|
|
611
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
612
|
+
const formData = new FormData();
|
|
613
|
+
formData.append(filename, file, filename);
|
|
614
|
+
return yield this.fetchApi((yield this._filePath()) + Endpoints.Upload, "POST", formData, yield this.authorisationHeader());
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
download(_a) {
|
|
618
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
619
|
+
return yield this.fetchApi((yield this._filePath()) + Endpoints.Download + `/${id}`, "GET");
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
_filePath() {
|
|
623
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
624
|
+
yield this.loginDone();
|
|
625
|
+
if (this._settings.filesUrl)
|
|
626
|
+
return this._settings.filesUrl + Endpoints.V4 + Endpoints.Files;
|
|
627
|
+
return this._settings.apiUrl + Endpoints.Files;
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
class ListsApi extends BaseApi {
|
|
633
|
+
constructor() {
|
|
634
|
+
super(...arguments);
|
|
635
|
+
this._moduleSubPath = Endpoints.Lists;
|
|
636
|
+
}
|
|
637
|
+
getAll() {
|
|
638
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
639
|
+
return yield this.fetchApi(yield this.getModulePath(), "GET");
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
getTasksInList(listId, request) {
|
|
643
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
644
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
645
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${listId}` + Endpoints.ListTasks + searchParams, "GET");
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
getInbox(request) {
|
|
649
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
650
|
+
yield this.loginDone();
|
|
651
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
652
|
+
return yield this.fetchApi(this._settings.apiUrl + Endpoints.Inbox + searchParams, "GET");
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
create(request) {
|
|
656
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
657
|
+
return yield this.fetchApi(yield this.getModulePath(), "PUT", JSON.stringify(request));
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
delete(request) {
|
|
661
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
662
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${request.id}`, "DELETE", JSON.stringify(request));
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
update(request) {
|
|
666
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
667
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${request.id}`, "POST", JSON.stringify(request));
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
class CalendarApi extends BaseApi {
|
|
673
|
+
constructor() {
|
|
674
|
+
super(...arguments);
|
|
675
|
+
this._moduleSubPath = Endpoints.Calendar;
|
|
676
|
+
}
|
|
677
|
+
getTasks(request) {
|
|
678
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
679
|
+
return yield this.fetchApi((yield this.getModulePath()) + toSearchParams(request), "GET");
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
class AnnouncementsApi extends BaseApi {
|
|
685
|
+
constructor() {
|
|
686
|
+
super(...arguments);
|
|
687
|
+
this._moduleSubPath = Endpoints.Announcements;
|
|
688
|
+
}
|
|
689
|
+
getAll() {
|
|
690
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
691
|
+
return yield this.fetchApi(yield this.getModulePath(), "GET");
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
get(_a) {
|
|
695
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
696
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}`, "GET");
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
create(request) {
|
|
700
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
701
|
+
return yield this.fetchApi(yield this.getModulePath(), "POST", JSON.stringify(request));
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
addComment(id, request) {
|
|
705
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
706
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}` + Endpoints.AnnouncementComments, "POST", JSON.stringify(request));
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
class CatalogsApi extends BaseApi {
|
|
712
|
+
constructor() {
|
|
713
|
+
super(...arguments);
|
|
714
|
+
this._moduleSubPath = Endpoints.Catalogs;
|
|
715
|
+
}
|
|
716
|
+
getAll() {
|
|
717
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
718
|
+
return yield this.fetchApi(yield this.getModulePath(), "GET");
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
get(_a) {
|
|
722
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
723
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}`, "GET");
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
create(request) {
|
|
727
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
728
|
+
return yield this.fetchApi(yield this.getModulePath(), "PUT", JSON.stringify(request));
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
sync(request) {
|
|
732
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
733
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${request.id}`, "POST", JSON.stringify(request));
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
class MembersApi extends BaseApi {
|
|
739
|
+
constructor() {
|
|
740
|
+
super(...arguments);
|
|
741
|
+
this._moduleSubPath = Endpoints.Members;
|
|
742
|
+
}
|
|
743
|
+
create(request) {
|
|
744
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
745
|
+
return yield this.fetchApi(yield this.getModulePath(), "POST", JSON.stringify(request));
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
get(_a) {
|
|
749
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
750
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}`, "GET");
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
getAll(request) {
|
|
754
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
755
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
756
|
+
return yield this.fetchApi((yield this.getModulePath()) + searchParams, "GET");
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
update(request) {
|
|
760
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
761
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${request.id}`, "PUT", JSON.stringify(request));
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
delete(_a) {
|
|
765
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
766
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}`, "DELETE");
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
class TasksApi extends BaseApi {
|
|
772
|
+
constructor() {
|
|
773
|
+
super(...arguments);
|
|
774
|
+
this._moduleSubPath = Endpoints.Tasks;
|
|
775
|
+
}
|
|
776
|
+
get(_a) {
|
|
777
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
778
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}`, "GET");
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
create(request) {
|
|
782
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
783
|
+
return yield this.fetchApi(yield this.getModulePath(), "POST", JSON.stringify(request, packDates));
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
addComment(id, request) {
|
|
787
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
788
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}` + Endpoints.TasksComments, "POST", JSON.stringify(request, packDates));
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
class FormsApi extends BaseApi {
|
|
794
|
+
constructor() {
|
|
795
|
+
super(...arguments);
|
|
796
|
+
this._moduleSubPath = Endpoints.Forms;
|
|
797
|
+
}
|
|
798
|
+
get(_a) {
|
|
799
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
800
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}`, "GET");
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
getAll() {
|
|
804
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
805
|
+
return yield this.fetchApi(yield this.getModulePath(), "GET");
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
getTasks(id, request) {
|
|
809
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
810
|
+
const processedRequest = Object.assign(Object.assign({}, request), processFilters(request && request.filters));
|
|
811
|
+
if (processedRequest.filters)
|
|
812
|
+
delete processedRequest.filters;
|
|
813
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}` + Endpoints.FormsRegister, "POST", JSON.stringify(processedRequest, packDates));
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
getPermissions(_a) {
|
|
817
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
818
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}` + Endpoints.FormsPermissions, "GET");
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
setPermissions(id, request) {
|
|
822
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
823
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}` + Endpoints.FormsPermissions, "POST", JSON.stringify(request));
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
class LogsApi extends BaseApi {
|
|
829
|
+
getEvents(request) {
|
|
830
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
831
|
+
yield this.loginDone();
|
|
832
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
833
|
+
return yield this.fetchApi(this._settings.apiUrl + Endpoints.EventHistory + searchParams, "GET");
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
getFileAccess(request) {
|
|
837
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
838
|
+
yield this.loginDone();
|
|
839
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
840
|
+
return yield this.fetchApi(this._settings.apiUrl + Endpoints.FileAccessHistory + searchParams, "GET");
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
getTaskAccess(request) {
|
|
844
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
845
|
+
yield this.loginDone();
|
|
846
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
847
|
+
return yield this.fetchApi(this._settings.apiUrl + Endpoints.TaskAccessHistory + searchParams, "GET");
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
getTaskExport(request) {
|
|
851
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
852
|
+
yield this.loginDone();
|
|
853
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
854
|
+
return yield this.fetchApi(this._settings.apiUrl + Endpoints.TaskExportHistory + searchParams, "GET");
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
getRegistryDownload(request) {
|
|
858
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
859
|
+
yield this.loginDone();
|
|
860
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
861
|
+
return yield this.fetchApi(this._settings.apiUrl + Endpoints.RegistryDownloadHistory + searchParams, "GET");
|
|
862
|
+
});
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
class CallApi extends BaseApi {
|
|
867
|
+
constructor() {
|
|
868
|
+
super(...arguments);
|
|
869
|
+
this._moduleSubPath = Endpoints.Integrations;
|
|
870
|
+
}
|
|
871
|
+
registerCall(request) {
|
|
872
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
873
|
+
return yield this.fetchApi((yield this.getModulePath()) + Endpoints.Call, "POST", JSON.stringify(request));
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
attachCallRecord(request) {
|
|
877
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
878
|
+
return yield this.fetchApi((yield this.getModulePath()) + Endpoints.AttachCallRecord, "POST", JSON.stringify(request));
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
class BotApi extends BaseApi {
|
|
884
|
+
constructor() {
|
|
885
|
+
super(...arguments);
|
|
886
|
+
this._moduleSubPath = Endpoints.Bots;
|
|
887
|
+
}
|
|
888
|
+
create(request) {
|
|
889
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
890
|
+
return yield this.fetchApi(yield this.getModulePath(), "POST", JSON.stringify(request));
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
get(_a) {
|
|
894
|
+
return __awaiter(this, arguments, void 0, function* ({ id }) {
|
|
895
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${id}`, "GET");
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
getAll(request) {
|
|
899
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
900
|
+
const searchParams = request ? toSearchParams(request) : "";
|
|
901
|
+
return yield this.fetchApi((yield this.getModulePath()) + searchParams, "GET");
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
update(request) {
|
|
905
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
906
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${request.id}`, "PUT", JSON.stringify(request));
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
delete(request) {
|
|
910
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
911
|
+
return yield this.fetchApi((yield this.getModulePath()) + `/${request.id}`, "DELETE", JSON.stringify(request));
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
class PyrusApiClient extends BaseApi {
|
|
917
|
+
constructor(auth, settings) {
|
|
918
|
+
const currentSettings = !!settings
|
|
919
|
+
? Object.assign(Object.assign({}, defaults), settings) : defaults;
|
|
920
|
+
super({ settings: currentSettings });
|
|
921
|
+
if (typeof auth === "string")
|
|
922
|
+
this._token = auth;
|
|
923
|
+
else
|
|
924
|
+
this._authRequest = this._authenticateClient(auth);
|
|
925
|
+
}
|
|
926
|
+
_authenticateClient(auth) {
|
|
927
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
928
|
+
return this.fetchApi(this._settings.authUrl + Endpoints.Auth, "POST", JSON.stringify(auth), {
|
|
929
|
+
"Content-Type": "application/json",
|
|
930
|
+
});
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
get initParams() {
|
|
934
|
+
return {
|
|
935
|
+
authRequest: this._authRequest,
|
|
936
|
+
token: this._token,
|
|
937
|
+
settings: this._settings,
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
get role() {
|
|
941
|
+
if (!this._role)
|
|
942
|
+
this._role = new RoleApi(this.initParams);
|
|
943
|
+
return this._role;
|
|
944
|
+
}
|
|
945
|
+
get profile() {
|
|
946
|
+
if (!this._profile)
|
|
947
|
+
this._profile = new ProfileApi(this.initParams);
|
|
948
|
+
return this._profile;
|
|
949
|
+
}
|
|
950
|
+
get contacts() {
|
|
951
|
+
if (!this._contacts)
|
|
952
|
+
this._contacts = new ContactsApi(this.initParams);
|
|
953
|
+
return this._contacts;
|
|
954
|
+
}
|
|
955
|
+
get files() {
|
|
956
|
+
if (!this._files)
|
|
957
|
+
this._files = new FilesApi(this.initParams);
|
|
958
|
+
return this._files;
|
|
959
|
+
}
|
|
960
|
+
get lists() {
|
|
961
|
+
if (!this._lists)
|
|
962
|
+
this._lists = new ListsApi(this.initParams);
|
|
963
|
+
return this._lists;
|
|
964
|
+
}
|
|
965
|
+
get calendar() {
|
|
966
|
+
if (!this._calendar)
|
|
967
|
+
this._calendar = new CalendarApi(this.initParams);
|
|
968
|
+
return this._calendar;
|
|
969
|
+
}
|
|
970
|
+
get announcements() {
|
|
971
|
+
if (!this._announcements)
|
|
972
|
+
this._announcements = new AnnouncementsApi(this.initParams);
|
|
973
|
+
return this._announcements;
|
|
974
|
+
}
|
|
975
|
+
get catalogs() {
|
|
976
|
+
if (!this._catalogs)
|
|
977
|
+
this._catalogs = new CatalogsApi(this.initParams);
|
|
978
|
+
return this._catalogs;
|
|
979
|
+
}
|
|
980
|
+
get members() {
|
|
981
|
+
if (!this._members)
|
|
982
|
+
this._members = new MembersApi(this.initParams);
|
|
983
|
+
return this._members;
|
|
984
|
+
}
|
|
985
|
+
get tasks() {
|
|
986
|
+
if (!this._tasks)
|
|
987
|
+
this._tasks = new TasksApi(this.initParams);
|
|
988
|
+
return this._tasks;
|
|
989
|
+
}
|
|
990
|
+
get forms() {
|
|
991
|
+
if (!this._forms)
|
|
992
|
+
this._forms = new FormsApi(this.initParams);
|
|
993
|
+
return this._forms;
|
|
994
|
+
}
|
|
995
|
+
get logs() {
|
|
996
|
+
if (!this._logs)
|
|
997
|
+
this._logs = new LogsApi(this.initParams);
|
|
998
|
+
return this._logs;
|
|
999
|
+
}
|
|
1000
|
+
get call() {
|
|
1001
|
+
if (!this._call)
|
|
1002
|
+
this._call = new CallApi(this.initParams);
|
|
1003
|
+
return this._call;
|
|
1004
|
+
}
|
|
1005
|
+
get bot() {
|
|
1006
|
+
if (!this._bot)
|
|
1007
|
+
this._bot = new BotApi(this.initParams);
|
|
1008
|
+
return this._bot;
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
exports.PyrusApiClient = PyrusApiClient;
|
|
1013
|
+
exports.toDateString = toDateString;
|
|
1014
|
+
exports.toDateTimeString = toDateTimeString;
|
|
1015
|
+
exports.toTimeString = toTimeString;
|