bx-rest 1.4.0 → 1.5.1
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/CHANGELOG.md +126 -0
- package/README.en.md +3 -3
- package/README.md +3 -3
- package/esm2022/functions/errors.mjs +2 -1
- package/esm2022/functions/mapResult.mjs +4 -2
- package/esm2022/map/disk.mjs +13 -0
- package/esm2022/map/im/recent.mjs +1 -9
- package/esm2022/map/task.mjs +11 -5
- package/esm2022/map/tasks/task.mjs +3 -3
- package/esm2022/map/tasks.mjs +4 -3
- package/esm2022/map/user.mjs +5 -4
- package/esm2022/public-api.mjs +1 -1
- package/esm2022/request-navvy/bizproc.mjs +2 -2
- package/esm2022/request-navvy/crm/item.mjs +1 -1
- package/esm2022/request-navvy/crm/type.mjs +1 -1
- package/esm2022/request-navvy/pull/config.mjs +1 -3
- package/esm2022/request-navvy/task/operation/elapseditem.mjs +8 -65
- package/esm2022/rest/map.mjs +3 -3
- package/esm2022/services/base.mjs +7 -4
- package/esm2022/services/http/HttpBX.mjs +8 -3
- package/esm2022/services/navvy/extends/navvy-pag-base.mjs +78 -9
- package/esm2022/services/navvy/navvy-alternative-pagination-navigation.mjs +21 -71
- package/esm2022/services/navvy/navvy-pag-nav-result-key-object.mjs +12 -52
- package/esm2022/services/navvy/navvy-pag-nav-result-key.mjs +15 -71
- package/esm2022/services/navvy/navvy-pag-nav-tasks.mjs +5 -76
- package/esm2022/services/navvy/navvy-pag-nav-with-useless-key.mjs +10 -76
- package/esm2022/services/navvy/navvy-pag.mjs +7 -65
- package/esm2022/typification/rest/crm/universal.mjs +1 -1
- package/esm2022/typification/rest/settings.mjs +1 -1
- package/esm2022/typification/rest/user/user.mjs +1 -1
- package/fesm2022/bx-rest.mjs +507 -1653
- package/fesm2022/bx-rest.mjs.map +1 -1
- package/functions/errors.d.ts +1 -0
- package/map/disk.d.ts +10 -0
- package/map/task.d.ts +3 -3
- package/map/tasks/task.d.ts +1 -1
- package/map/tasks.d.ts +1 -1
- package/package.json +8 -2
- package/public-api.d.ts +5 -2
- package/request-navvy/crm/item.d.ts +6 -6
- package/request-navvy/crm/type.d.ts +6 -6
- package/request-navvy/pull/config.d.ts +0 -2
- package/rest/map.d.ts +2 -2
- package/services/navvy/extends/navvy-pag-base.d.ts +21 -1
- package/services/navvy/navvy-alternative-pagination-navigation.d.ts +5 -2
- package/services/navvy/navvy-pag-nav-result-key-object.d.ts +0 -2
- package/services/navvy/navvy-pag-nav-result-key.d.ts +1 -4
- package/services/navvy/navvy-pag-nav-tasks.d.ts +5 -9
- package/services/navvy/navvy-pag-nav-with-useless-key.d.ts +0 -2
- package/services/navvy/navvy-pag.d.ts +0 -2
- package/typification/rest/crm/universal.d.ts +116 -0
- package/typification/rest/settings.d.ts +1 -0
- package/typification/rest/user/user.d.ts +3 -3
package/functions/errors.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare function getAuthRefreshError(error: unknown): unknown;
|
|
|
35
35
|
* the error comes in the body of a 2xx response, `.res()` resolves as
|
|
36
36
|
* `undefined` by default and fails with it only with
|
|
37
37
|
* `{ throwOnApiError: true }` — see the "Error handling" section of the README.
|
|
38
|
+
* `.resAll()` always fails with it on an error in the body of a 2xx response.
|
|
38
39
|
*/
|
|
39
40
|
export declare class BXRestApiError extends Error {
|
|
40
41
|
error: string | undefined;
|
package/map/disk.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BXRestMapDiskFolder } from './disk/folder';
|
|
2
|
+
import { BXRestMapDiskAttachedObject } from './disk/attachedObject';
|
|
3
|
+
import { BXRestMapDiskFile } from './disk/file';
|
|
4
|
+
import { BXRestMapDiskStorage } from './disk/storage';
|
|
5
|
+
export declare class BXRestMapDisk {
|
|
6
|
+
readonly folder: BXRestMapDiskFolder;
|
|
7
|
+
readonly attachedObject: BXRestMapDiskAttachedObject;
|
|
8
|
+
readonly file: BXRestMapDiskFile;
|
|
9
|
+
readonly storage: BXRestMapDiskStorage;
|
|
10
|
+
}
|
package/map/task.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BXRestMapTaskCommentItem } from './task/commentitem';
|
|
|
2
2
|
import { BXRestMapTaskElapsedItem } from './task/elapseditem';
|
|
3
3
|
import { BXRestMapTaskStage } from './task/stages';
|
|
4
4
|
export declare class BXRestMapTask {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
static get commentItem(): typeof BXRestMapTaskCommentItem;
|
|
6
|
+
static get elapsedItem(): typeof BXRestMapTaskElapsedItem;
|
|
7
|
+
static get stages(): typeof BXRestMapTaskStage;
|
|
8
8
|
}
|
package/map/tasks/task.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { BXRestMapTasksTaskResult } from './task/result';
|
|
|
5
5
|
import { iBXRestHttpTask, iBXRestTask } from '../../typification/rest/tasks/task';
|
|
6
6
|
import { iBXRestTaskFieldsName } from '../../typification/rest/tasks/base/fields-name';
|
|
7
7
|
export declare class BXRestMapTasksTask {
|
|
8
|
-
|
|
8
|
+
static get result(): typeof BXRestMapTasksTaskResult;
|
|
9
9
|
static getAccess(v: iBXRestTaskGetAccess | undefined): Record<number, import("../../typification/rest/task/access/getaccess").iBXRestTaskGetAccessItem> | undefined;
|
|
10
10
|
static add(item: {
|
|
11
11
|
task: iBXRestTasksTaskGetHttpDefault;
|
package/map/tasks.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bx-rest",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Bitrix24 REST API client and TypeScript SDK for Angular, Vue and browser apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bitrix",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"url": "git+https://github.com/Aricatofuka/bx-rest.git"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"axios": "^1.
|
|
35
|
+
"axios": "^1.21.0",
|
|
36
36
|
"countries-and-timezones": "^3.7.2",
|
|
37
37
|
"just-camel-case": "^6.2.0",
|
|
38
38
|
"just-clone": "^6.2.0",
|
|
@@ -68,6 +68,9 @@
|
|
|
68
68
|
"./typification/app": {
|
|
69
69
|
"types": "./typification/rest/app.d.ts"
|
|
70
70
|
},
|
|
71
|
+
"./typification/batch": {
|
|
72
|
+
"types": "./typification/rest/batch.d.ts"
|
|
73
|
+
},
|
|
71
74
|
"./typification/bizproc": {
|
|
72
75
|
"types": "./typification/rest/bizproc.d.ts"
|
|
73
76
|
},
|
|
@@ -77,6 +80,9 @@
|
|
|
77
80
|
"./typification/common": {
|
|
78
81
|
"types": "./typification/rest/common.d.ts"
|
|
79
82
|
},
|
|
83
|
+
"./typification/crm": {
|
|
84
|
+
"types": "./typification/rest/crm/index.d.ts"
|
|
85
|
+
},
|
|
80
86
|
"./typification/department": {
|
|
81
87
|
"types": "./typification/rest/department.d.ts"
|
|
82
88
|
},
|
package/public-api.d.ts
CHANGED
|
@@ -10,11 +10,14 @@ export { HttpBXServices as BXRestRequest } from './services/http/HttpBX';
|
|
|
10
10
|
export { SessionKeyServices, SessionKeyError } from './services/http/sessionKey';
|
|
11
11
|
export { instanceOfiBXRestAnswerSuccess as isBXRestAnswerSuccess } from './functions/mapResult';
|
|
12
12
|
export { BXRestApiError, getAuthRefreshError } from './functions/errors';
|
|
13
|
+
export type { BXRestApiErrorDetails } from './functions/errors';
|
|
13
14
|
export { isBXRestAuthError } from './services/http/authRefresh';
|
|
14
15
|
export { BXRestFrame } from './services/frame/frame';
|
|
15
|
-
export { BXRestFrameError
|
|
16
|
+
export { BXRestFrameError } from './services/frame/transport';
|
|
17
|
+
export type { BXRestFrameErrorCode } from './services/frame/transport';
|
|
16
18
|
export * from './services/frame/types';
|
|
17
|
-
export { BXRestResOptions } from './services/navvy/extends/navvy-pag-base';
|
|
19
|
+
export type { BXRestResOptions } from './services/navvy/extends/navvy-pag-base';
|
|
20
|
+
export type { iBXRestSettings } from './typification/settings';
|
|
18
21
|
export { HttpNavvyServices } from './services/http/httpNavvy';
|
|
19
22
|
export * as partNameMethods from './consts/part-name-methods';
|
|
20
23
|
export * as BXBaseServices from './services/base';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { iBXRestCrmObject, iBXRestParamCrmEntityType, iBXRestParamCrmItemBatchImport, iBXRestParamCrmItemFields, iBXRestParamCrmItemId, iBXRestParamCrmItemImport, iBXRestParamCrmItemList, iBXRestParamCrmItemUpdate } from '../../typification/rest/crm';
|
|
1
|
+
import { iBXRestCrmItem, iBXRestCrmItemFieldsResult, iBXRestCrmItemResult, iBXRestCrmObject, iBXRestParamCrmEntityType, iBXRestParamCrmItemBatchImport, iBXRestParamCrmItemFields, iBXRestParamCrmItemId, iBXRestParamCrmItemImport, iBXRestParamCrmItemList, iBXRestParamCrmItemUpdate } from '../../typification/rest/crm';
|
|
2
2
|
import { BXRestNavvyCrmItemDelivery } from './item/delivery';
|
|
3
3
|
import { BXRestNavvyCrmItemDetails } from './item/details';
|
|
4
4
|
import { BXRestNavvyCrmItemPayment } from './item/payment';
|
|
@@ -24,7 +24,7 @@ export declare class BXRestNavvyCrmItem {
|
|
|
24
24
|
/**
|
|
25
25
|
* Создаёт элемент CRM.
|
|
26
26
|
*/
|
|
27
|
-
add(param: iBXRestParamCrmItemFields): import("../../services/navvy").NavvySimple<
|
|
27
|
+
add(param: iBXRestParamCrmItemFields): import("../../services/navvy").NavvySimple<iBXRestCrmItemResult, iBXRestCrmItemResult, iBXRestParamCrmItemFields | undefined>;
|
|
28
28
|
/**
|
|
29
29
|
* Пакетно импортирует элементы CRM.
|
|
30
30
|
*/
|
|
@@ -36,11 +36,11 @@ export declare class BXRestNavvyCrmItem {
|
|
|
36
36
|
/**
|
|
37
37
|
* Возвращает описание полей элемента CRM.
|
|
38
38
|
*/
|
|
39
|
-
fields(param: iBXRestParamCrmEntityType): import("../../services/navvy").NavvySimple<
|
|
39
|
+
fields(param: iBXRestParamCrmEntityType): import("../../services/navvy").NavvySimple<iBXRestCrmItemFieldsResult, iBXRestCrmItemFieldsResult, iBXRestParamCrmEntityType | undefined>;
|
|
40
40
|
/**
|
|
41
41
|
* Возвращает данные элемента CRM по идентификатору.
|
|
42
42
|
*/
|
|
43
|
-
get(param: iBXRestParamCrmItemId): import("../../services/navvy").NavvySimple<
|
|
43
|
+
get(param: iBXRestParamCrmItemId): import("../../services/navvy").NavvySimple<iBXRestCrmItemResult, iBXRestCrmItemResult, iBXRestParamCrmItemId | undefined>;
|
|
44
44
|
/**
|
|
45
45
|
* Импортирует элемент CRM.
|
|
46
46
|
*/
|
|
@@ -48,9 +48,9 @@ export declare class BXRestNavvyCrmItem {
|
|
|
48
48
|
/**
|
|
49
49
|
* Возвращает список элементов CRM.
|
|
50
50
|
*/
|
|
51
|
-
list(param: iBXRestParamCrmItemList): import("../../services/navvy").NavvyPagNavResultKey<
|
|
51
|
+
list(param: iBXRestParamCrmItemList): import("../../services/navvy").NavvyPagNavResultKey<iBXRestCrmItem, iBXRestCrmItem, iBXRestParamCrmItemList, "items">;
|
|
52
52
|
/**
|
|
53
53
|
* Изменяет поля элемента CRM.
|
|
54
54
|
*/
|
|
55
|
-
update(param: iBXRestParamCrmItemUpdate): import("../../services/navvy").NavvySimple<
|
|
55
|
+
update(param: iBXRestParamCrmItemUpdate): import("../../services/navvy").NavvySimple<iBXRestCrmItemResult, iBXRestCrmItemResult, iBXRestParamCrmItemUpdate | undefined>;
|
|
56
56
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { iBXRestCrmObject, iBXRestParamCrmEntityType, iBXRestParamCrmTypeAdd, iBXRestParamCrmTypeId, iBXRestParamCrmTypeList, iBXRestParamCrmTypeUpdate } from '../../typification/rest/crm';
|
|
1
|
+
import { iBXRestCrmObject, iBXRestCrmType, iBXRestCrmTypeResult, iBXRestParamCrmEntityType, iBXRestParamCrmTypeAdd, iBXRestParamCrmTypeId, iBXRestParamCrmTypeList, iBXRestParamCrmTypeUpdate } from '../../typification/rest/crm';
|
|
2
2
|
export declare class BXRestNavvyCrmType {
|
|
3
3
|
private readonly Navvy;
|
|
4
4
|
/**
|
|
5
5
|
* Создаёт новый смарт-процесс.
|
|
6
6
|
*/
|
|
7
|
-
add(param: iBXRestParamCrmTypeAdd): import("../../services/navvy").NavvySimple<
|
|
7
|
+
add(param: iBXRestParamCrmTypeAdd): import("../../services/navvy").NavvySimple<iBXRestCrmTypeResult, iBXRestCrmTypeResult, iBXRestParamCrmTypeAdd | undefined>;
|
|
8
8
|
/**
|
|
9
9
|
* Удаляет смарт-процесс.
|
|
10
10
|
*/
|
|
@@ -16,17 +16,17 @@ export declare class BXRestNavvyCrmType {
|
|
|
16
16
|
/**
|
|
17
17
|
* Возвращает смарт-процесс по идентификатору.
|
|
18
18
|
*/
|
|
19
|
-
get(param: iBXRestParamCrmTypeId): import("../../services/navvy").NavvySimple<
|
|
19
|
+
get(param: iBXRestParamCrmTypeId): import("../../services/navvy").NavvySimple<iBXRestCrmTypeResult, iBXRestCrmTypeResult, iBXRestParamCrmTypeId | undefined>;
|
|
20
20
|
/**
|
|
21
21
|
* Возвращает смарт-процесс по entityTypeId.
|
|
22
22
|
*/
|
|
23
|
-
getByEntityTypeId(param: iBXRestParamCrmEntityType): import("../../services/navvy").NavvySimple<
|
|
23
|
+
getByEntityTypeId(param: iBXRestParamCrmEntityType): import("../../services/navvy").NavvySimple<iBXRestCrmTypeResult, iBXRestCrmTypeResult, iBXRestParamCrmEntityType | undefined>;
|
|
24
24
|
/**
|
|
25
25
|
* Возвращает список смарт-процессов.
|
|
26
26
|
*/
|
|
27
|
-
list(param?: iBXRestParamCrmTypeList): import("../../services/navvy").NavvyPagNavResultKey<
|
|
27
|
+
list(param?: iBXRestParamCrmTypeList): import("../../services/navvy").NavvyPagNavResultKey<iBXRestCrmType, iBXRestCrmType, iBXRestParamCrmTypeList, "types">;
|
|
28
28
|
/**
|
|
29
29
|
* Обновляет смарт-процесс.
|
|
30
30
|
*/
|
|
31
|
-
update(param: iBXRestParamCrmTypeUpdate): import("../../services/navvy").NavvySimple<
|
|
31
|
+
update(param: iBXRestParamCrmTypeUpdate): import("../../services/navvy").NavvySimple<iBXRestCrmTypeResult, iBXRestCrmTypeResult, iBXRestParamCrmTypeUpdate | undefined>;
|
|
32
32
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { iBXRestPullConfigGet, iBXRestPullConfigGetHttp } from '../../typification/rest/pull';
|
|
2
|
-
import { BXRestMapPullChannelPublic } from '../../map/channel/public';
|
|
3
2
|
export declare class BXRestNavvyPullConfig {
|
|
4
3
|
url: {
|
|
5
4
|
/**
|
|
@@ -8,7 +7,6 @@ export declare class BXRestNavvyPullConfig {
|
|
|
8
7
|
get: string[];
|
|
9
8
|
};
|
|
10
9
|
private Navvy;
|
|
11
|
-
static public: BXRestMapPullChannelPublic;
|
|
12
10
|
/**
|
|
13
11
|
* @experimental
|
|
14
12
|
* Этот метод находится в процессе тестирования и может измениться.
|
package/rest/map.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { BXRestMapLists } from '../map/lists';
|
|
|
2
2
|
import { BXRestMapUser } from '../map/user';
|
|
3
3
|
import { BXRestMapSonetGroup } from '../map/sonet_group';
|
|
4
4
|
import { BXRestMapServer } from '../map/server';
|
|
5
|
-
import {
|
|
5
|
+
import { BXRestMapDisk } from '../map/disk';
|
|
6
6
|
import { BXRestMapCalendar } from '../map/calendar';
|
|
7
7
|
import { BXRestMapLog } from '../map/log';
|
|
8
8
|
import { BXRestMapTask } from '../map/task';
|
|
@@ -12,7 +12,7 @@ export declare class BXRestMap {
|
|
|
12
12
|
get sonet_group(): typeof BXRestMapSonetGroup;
|
|
13
13
|
get server(): typeof BXRestMapServer;
|
|
14
14
|
get lists(): typeof BXRestMapLists;
|
|
15
|
-
get disk(): typeof
|
|
15
|
+
get disk(): typeof BXRestMapDisk;
|
|
16
16
|
get calendar(): typeof BXRestMapCalendar;
|
|
17
17
|
get log(): typeof BXRestMapLog;
|
|
18
18
|
get task(): typeof BXRestMapTask;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { iBXRestAnswer } from '../../../typification/rest/base/answer';
|
|
2
|
+
import { iBXRestAnswer, iBXRestAnswerSuccess } from '../../../typification/rest/base/answer';
|
|
3
3
|
import { HttpBXServices } from '../../http/HttpBX';
|
|
4
4
|
import { ReturnTypeNavvy } from '../navvy-support';
|
|
5
|
+
import { iBXRestPagination } from '../../../typification/rest/base/api-pagination-bx';
|
|
5
6
|
export interface BXRestResOptions {
|
|
6
7
|
/**
|
|
7
8
|
* When `true`, a Bitrix-level API error that comes in the body of a 2xx
|
|
@@ -16,6 +17,11 @@ export interface BXRestResOptions {
|
|
|
16
17
|
*/
|
|
17
18
|
throwOnApiError?: boolean;
|
|
18
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Параметры остальных страниц для методов с постраничной навигацией через `start`.
|
|
22
|
+
* Отсчёт идёт от `start` самого запроса: первая страница уже получена именно с него.
|
|
23
|
+
*/
|
|
24
|
+
export declare function offsetPageParams<P extends iBXRestPagination>(param: P, total: number | undefined, pageSize: number): P[];
|
|
19
25
|
export declare abstract class NavvyPagBase<T, R, P> {
|
|
20
26
|
protected url: string[];
|
|
21
27
|
protected param: P;
|
|
@@ -39,4 +45,18 @@ export declare abstract class NavvyPagBase<T, R, P> {
|
|
|
39
45
|
mapForVanilla(): Observable<iBXRestAnswer<ReturnTypeNavvy<T, R>> | undefined>;
|
|
40
46
|
res(options?: BXRestResOptions): Observable<ReturnTypeNavvy<T, R> | undefined>;
|
|
41
47
|
mapAndError<T>(request: Observable<iBXRestAnswer<T> | undefined>, options?: BXRestResOptions): Observable<T | undefined>;
|
|
48
|
+
/**
|
|
49
|
+
* Первая страница для `.resAll()`. Ошибка Bitrix в теле ответа 2xx становится `BXRestApiError`:
|
|
50
|
+
* страниц в таком ответе нет, и без этого `.resAll()` завершился бы безликим `EmptyError`.
|
|
51
|
+
*/
|
|
52
|
+
protected resFirstPage(): Observable<iBXRestAnswerSuccess<T>>;
|
|
53
|
+
/**
|
|
54
|
+
* Остальные страницы для `.resAll()`, в порядке `params`. Команды уходят через `batch`,
|
|
55
|
+
* пакеты — по очереди. Ошибка любой страницы завершает весь запрос: неполный список
|
|
56
|
+
* выглядел бы для вызывающего кода как полный.
|
|
57
|
+
*/
|
|
58
|
+
protected resPages<Page>(params: P[]): Observable<Page[]>;
|
|
59
|
+
private batchPages;
|
|
60
|
+
private notRestAnswerError;
|
|
61
|
+
private apiErrorFromBody;
|
|
42
62
|
}
|
|
@@ -9,6 +9,9 @@ import { NavvyPagBase } from './extends/navvy-pag-base';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare class NavvyAlterPagNav<T, R, P extends iBXRestAlternativePagination> extends NavvyPagBase<T[], R[], P> {
|
|
11
11
|
resAll(): import("rxjs").Observable<ReturnTypeNavvy<T, R>[]>;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Параметры остальных страниц. Размер страницы берётся из запроса: портал ограничивает
|
|
14
|
+
* его 50 записями, но вызывающий код может попросить и меньше.
|
|
15
|
+
*/
|
|
16
|
+
private pageParams;
|
|
14
17
|
}
|
|
@@ -6,7 +6,5 @@ export declare class NavvyPagNavResultKeyObject<T, R, P extends iBXRestPaginatio
|
|
|
6
6
|
private readonly key;
|
|
7
7
|
constructor(url: string[], param: P, key: K, mapResult?: (param: KeyedObjectResult<K, T> | undefined) => R[] | undefined);
|
|
8
8
|
resAll(): import("rxjs").Observable<R[] | undefined>;
|
|
9
|
-
private resultAllEnd;
|
|
10
|
-
private mapResult;
|
|
11
9
|
}
|
|
12
10
|
export {};
|
|
@@ -4,10 +4,7 @@ import { NavvyPagBase } from './extends/navvy-pag-base';
|
|
|
4
4
|
type KeyedResult<K extends string, T> = Record<K, T[] | undefined>;
|
|
5
5
|
export declare class NavvyPagNavResultKey<T, R, P extends iBXRestPagination, K extends string> extends NavvyPagBase<KeyedResult<K, T>, R[], P> {
|
|
6
6
|
private readonly key;
|
|
7
|
-
|
|
8
|
-
constructor(url: string[], param: P, key: K, map?: (param: KeyedResult<K, T> | undefined) => R[] | undefined);
|
|
7
|
+
constructor(url: string[], param: P, key: K, map?: (param: KeyedResult<K, T> | undefined) => R[] | undefined, restApi?: boolean);
|
|
9
8
|
resAll(): import("rxjs").Observable<ReturnTypeNavvy<T, R>[]>;
|
|
10
|
-
private resultAllEnd;
|
|
11
|
-
private mapResForGetAll;
|
|
12
9
|
}
|
|
13
10
|
export {};
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { iBXRestPagination } from '../../typification/rest/base/api-pagination-bx';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
save: ReturnTypeNavvy<T, R>[];
|
|
8
|
-
resAll(): import("rxjs").Observable<ReturnTypeNavvy<T, R>[]>;
|
|
9
|
-
private resultAllEnd;
|
|
10
|
-
private mapResForGetAll;
|
|
2
|
+
import { NavvyPagNavResultKey } from './navvy-pag-nav-result-key';
|
|
3
|
+
export declare class NavvyPagNavTasks<T, R, P extends iBXRestPagination> extends NavvyPagNavResultKey<T, R, P, 'tasks'> {
|
|
4
|
+
constructor(url: string[], param: P, map?: (param: {
|
|
5
|
+
tasks: T[] | undefined;
|
|
6
|
+
} | undefined) => R[] | undefined, restApi?: boolean);
|
|
11
7
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { iBXRestPagination } from '../../typification/rest/base/api-pagination-bx';
|
|
2
2
|
import { NavvyPagBase } from './extends/navvy-pag-base';
|
|
3
|
-
import { ReturnTypeNavvy } from './navvy-support';
|
|
4
3
|
export declare class NavvyPagNavWithUselessKey<T, R, P extends iBXRestPagination> extends NavvyPagBase<Record<string, T>, R[], P> {
|
|
5
|
-
save: ReturnTypeNavvy<Record<string, T>, R[]>;
|
|
6
4
|
resAll(): import("rxjs").Observable<R[] | undefined>;
|
|
7
5
|
}
|
|
@@ -2,7 +2,5 @@ import { iBXRestPagination } from '../../typification/rest/base/api-pagination-b
|
|
|
2
2
|
import { ReturnTypeNavvy } from './navvy-support';
|
|
3
3
|
import { NavvyPagBase } from './extends/navvy-pag-base';
|
|
4
4
|
export declare class NavvyPag<T, R, P extends iBXRestPagination> extends NavvyPagBase<T[], R[], P> {
|
|
5
|
-
save: ReturnTypeNavvy<T, R>[];
|
|
6
5
|
resAll(): import("rxjs").Observable<ReturnTypeNavvy<T, R>[]>;
|
|
7
|
-
private mapResForGetAll;
|
|
8
6
|
}
|
|
@@ -1,7 +1,123 @@
|
|
|
1
1
|
import { iBXRestPagination } from '../base/api-pagination-bx';
|
|
2
|
+
import { iBXRestYesNo } from '../base/yes-no';
|
|
2
3
|
export type iBXRestCrmObject = Record<string, unknown>;
|
|
3
4
|
export type iBXRestCrmFields = Record<string, unknown>;
|
|
4
5
|
export type iBXRestCrmParams = Record<string, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* Тип поля в ответе `crm.item.fields`. Портал может вернуть и другой тип,
|
|
8
|
+
* например зарегистрированный приложением через `userfieldtype.add`.
|
|
9
|
+
*/
|
|
10
|
+
export type iBXRestCrmItemFieldType = 'integer' | 'double' | 'string' | 'text' | 'boolean' | 'date' | 'datetime' | 'money' | 'url' | 'address' | 'file' | 'location' | 'user' | 'employee' | 'enumeration' | 'iblock_section' | 'iblock_element' | 'crm' | 'crm_status' | 'crm_category' | 'crm_currency' | 'crm_company' | 'crm_contact' | 'crm_lead' | 'crm_deal' | 'crm_quote' | 'crm_entity' | 'crm_multifield' | (string & {});
|
|
11
|
+
/** Настройки поля. Состав зависит от типа, поэтому описан только ключ, который задокументирован. */
|
|
12
|
+
export interface iBXRestCrmItemFieldSettings {
|
|
13
|
+
/** У поля связи — `entityTypeId` родителя (`parentId1098` → 1098, `companyId` → 4). */
|
|
14
|
+
parentEntityTypeId?: number;
|
|
15
|
+
[setting: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
/** Описание одного поля элемента CRM. */
|
|
18
|
+
export interface iBXRestCrmItemField {
|
|
19
|
+
type: iBXRestCrmItemFieldType;
|
|
20
|
+
title: string;
|
|
21
|
+
isRequired: boolean;
|
|
22
|
+
isReadOnly: boolean;
|
|
23
|
+
isImmutable: boolean;
|
|
24
|
+
isMultiple: boolean;
|
|
25
|
+
isDynamic: boolean;
|
|
26
|
+
upperName: string;
|
|
27
|
+
settings?: iBXRestCrmItemFieldSettings;
|
|
28
|
+
/** У поля `crm_status` — справочник значений для `crm.status.list`, например `DYNAMIC_1268_STAGE_52`. */
|
|
29
|
+
statusType?: string;
|
|
30
|
+
isDeprecated?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Ответ `crm.item.fields`. Ключ — идентификатор поля. */
|
|
33
|
+
export interface iBXRestCrmItemFieldsResult {
|
|
34
|
+
fields: Record<string, iBXRestCrmItemField>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Элемент CRM в методах `crm.item.*`. Описаны поля, общие для типов объектов; какие из них придут,
|
|
38
|
+
* зависит от типа объекта, настроек смарт-процесса и `select`. Остальное, включая `parentId<entityTypeId>`
|
|
39
|
+
* и пользовательские поля `ufCrm...`, доступно по индексу: их набор у каждого портала свой.
|
|
40
|
+
*
|
|
41
|
+
* Значения приходят как есть: `stageId` — код стадии, `companyId` — идентификатор, поле типа `money` —
|
|
42
|
+
* строка `1500.00|RUB`. Названия нужно получать отдельно.
|
|
43
|
+
*/
|
|
44
|
+
export interface iBXRestCrmItem {
|
|
45
|
+
/** В `crm.item.list` при заданном `select` приходит, только если указан в нём. */
|
|
46
|
+
id?: number;
|
|
47
|
+
xmlId?: string;
|
|
48
|
+
/** Нет у контактов: у них имя в `name`, `secondName` и `lastName`. */
|
|
49
|
+
title?: string;
|
|
50
|
+
/** Есть только у лидов и контактов, как и `secondName` и `lastName`. Незаполненное значение приходит как `null`. */
|
|
51
|
+
name?: string | null;
|
|
52
|
+
secondName?: string | null;
|
|
53
|
+
lastName?: string | null;
|
|
54
|
+
assignedById?: number;
|
|
55
|
+
createdBy?: number;
|
|
56
|
+
updatedBy?: number;
|
|
57
|
+
movedBy?: number;
|
|
58
|
+
createdTime?: string;
|
|
59
|
+
updatedTime?: string;
|
|
60
|
+
movedTime?: string;
|
|
61
|
+
categoryId?: number;
|
|
62
|
+
stageId?: string;
|
|
63
|
+
previousStageId?: string;
|
|
64
|
+
begindate?: string;
|
|
65
|
+
closedate?: string;
|
|
66
|
+
/** У контактов устарел, там нужен `companyIds`. */
|
|
67
|
+
companyId?: number;
|
|
68
|
+
/** Есть только у контактов. */
|
|
69
|
+
companyIds?: number[];
|
|
70
|
+
/** @deprecated Используйте `contactIds`. */
|
|
71
|
+
contactId?: number;
|
|
72
|
+
contactIds?: number[];
|
|
73
|
+
opportunity?: number;
|
|
74
|
+
taxValue?: number;
|
|
75
|
+
currencyId?: string;
|
|
76
|
+
observers?: number[];
|
|
77
|
+
[field: string]: unknown;
|
|
78
|
+
}
|
|
79
|
+
/** Ответ `crm.item.add`, `crm.item.get` и `crm.item.update`. `select` у них нет, поэтому `id` приходит всегда. */
|
|
80
|
+
export interface iBXRestCrmItemResult {
|
|
81
|
+
item: iBXRestCrmItem & {
|
|
82
|
+
id: number;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Смарт-процесс в методах `crm.type.*`. Остальное, например `relations` и `linkedUserFields`
|
|
87
|
+
* в ответе `crm.type.get`, доступно по индексу.
|
|
88
|
+
*/
|
|
89
|
+
export interface iBXRestCrmType {
|
|
90
|
+
id: number;
|
|
91
|
+
title: string;
|
|
92
|
+
code?: string;
|
|
93
|
+
entityTypeId: number;
|
|
94
|
+
customSectionId?: number | null;
|
|
95
|
+
isCategoriesEnabled?: iBXRestYesNo;
|
|
96
|
+
isStagesEnabled?: iBXRestYesNo;
|
|
97
|
+
isBeginCloseDatesEnabled?: iBXRestYesNo;
|
|
98
|
+
isClientEnabled?: iBXRestYesNo;
|
|
99
|
+
isUseInUserfieldEnabled?: iBXRestYesNo;
|
|
100
|
+
isLinkWithProductsEnabled?: iBXRestYesNo;
|
|
101
|
+
isMycompanyEnabled?: iBXRestYesNo;
|
|
102
|
+
isDocumentsEnabled?: iBXRestYesNo;
|
|
103
|
+
isSourceEnabled?: iBXRestYesNo;
|
|
104
|
+
isObserversEnabled?: iBXRestYesNo;
|
|
105
|
+
isRecyclebinEnabled?: iBXRestYesNo;
|
|
106
|
+
isAutomationEnabled?: iBXRestYesNo;
|
|
107
|
+
isBizProcEnabled?: iBXRestYesNo;
|
|
108
|
+
isSetOpenPermissions?: iBXRestYesNo;
|
|
109
|
+
isPaymentsEnabled?: iBXRestYesNo;
|
|
110
|
+
isCountersEnabled?: iBXRestYesNo;
|
|
111
|
+
createdBy?: number;
|
|
112
|
+
updatedBy?: number;
|
|
113
|
+
createdTime?: string;
|
|
114
|
+
updatedTime?: string;
|
|
115
|
+
[field: string]: unknown;
|
|
116
|
+
}
|
|
117
|
+
/** Ответ `crm.type.add`, `crm.type.get`, `crm.type.getByEntityTypeId` и `crm.type.update`. */
|
|
118
|
+
export interface iBXRestCrmTypeResult {
|
|
119
|
+
type: iBXRestCrmType;
|
|
120
|
+
}
|
|
5
121
|
export interface iBXRestParamCrmEntityType {
|
|
6
122
|
entityTypeId: number;
|
|
7
123
|
}
|
|
@@ -2,8 +2,8 @@ import { iBXRestYesNo } from '../base/yes-no';
|
|
|
2
2
|
export interface iBXRestUser extends iBXRestUserBase {
|
|
3
3
|
ID: number;
|
|
4
4
|
IS_ONLINE: boolean;
|
|
5
|
-
DATE_REGISTER
|
|
6
|
-
PERSONAL_BIRTHDAY
|
|
5
|
+
DATE_REGISTER?: Date;
|
|
6
|
+
PERSONAL_BIRTHDAY?: Date;
|
|
7
7
|
LAST_LOGIN?: Date;
|
|
8
8
|
}
|
|
9
9
|
export interface iBXRestUserHttp extends iBXRestUserBase {
|
|
@@ -22,7 +22,7 @@ interface iBXRestUserBase {
|
|
|
22
22
|
PERSONAL_GENDER?: iAllBXGender;
|
|
23
23
|
PERSONAL_PROFESSION?: string;
|
|
24
24
|
PERSONAL_WWW?: string;
|
|
25
|
-
PERSONAL_BIRTHDAY
|
|
25
|
+
PERSONAL_BIRTHDAY?: string | Date;
|
|
26
26
|
PERSONAL_PHOTO: string | null;
|
|
27
27
|
PERSONAL_ICQ: string | null;
|
|
28
28
|
PERSONAL_PHONE: string | null;
|