@2bad/bitrix 2.5.1 → 3.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/README.md +94 -188
- package/build/bin.d.ts +1 -0
- package/build/bin.js +160 -0
- package/build/client-Bk76ySik.js +769 -0
- package/build/index.d.ts +2881 -0
- package/build/index.js +1 -0
- package/package.json +46 -73
- package/build/main/bitrix.d.ts +0 -114
- package/build/main/bitrix.integration.test.d.ts +0 -0
- package/build/main/bitrix.integration.test.js +0 -31
- package/build/main/bitrix.js +0 -61
- package/build/main/bitrix.unit.test.d.ts +0 -1
- package/build/main/bitrix.unit.test.js +0 -44
- package/build/main/client/client.unit.test.d.ts +0 -1
- package/build/main/client/client.unit.test.js +0 -70
- package/build/main/client/hooks/addAccessToken.d.ts +0 -6
- package/build/main/client/hooks/addAccessToken.js +0 -13
- package/build/main/client/hooks/addAccessToken.unit.test.d.ts +0 -1
- package/build/main/client/hooks/addAccessToken.unit.test.js +0 -31
- package/build/main/client/index.d.ts +0 -15
- package/build/main/client/index.js +0 -53
- package/build/main/client/methods/batch.d.ts +0 -40
- package/build/main/client/methods/batch.js +0 -85
- package/build/main/client/methods/batch.unit.test.d.ts +0 -1
- package/build/main/client/methods/batch.unit.test.js +0 -494
- package/build/main/client/methods/call.d.ts +0 -17
- package/build/main/client/methods/call.js +0 -36
- package/build/main/client/methods/call.unit.test.d.ts +0 -1
- package/build/main/client/methods/call.unit.test.js +0 -183
- package/build/main/client/methods/list.d.ts +0 -30
- package/build/main/client/methods/list.js +0 -66
- package/build/main/client/methods/list.unit.test.d.ts +0 -1
- package/build/main/client/methods/list.unit.test.js +0 -277
- package/build/main/commands.d.ts +0 -10
- package/build/main/commands.js +0 -2
- package/build/main/methods.d.ts +0 -92
- package/build/main/methods.js +0 -41
- package/build/main/payloads.d.ts +0 -40
- package/build/main/payloads.js +0 -2
- package/build/main/services/common.d.ts +0 -22
- package/build/main/services/common.js +0 -2
- package/build/main/services/companies/entities.d.ts +0 -54
- package/build/main/services/companies/entities.js +0 -2
- package/build/main/services/companies/index.d.ts +0 -26
- package/build/main/services/companies/index.integration.test.d.ts +0 -1
- package/build/main/services/companies/index.integration.test.js +0 -19
- package/build/main/services/companies/index.js +0 -10
- package/build/main/services/companies/index.unit.test.d.ts +0 -1
- package/build/main/services/companies/index.unit.test.js +0 -72
- package/build/main/services/companies/methods.d.ts +0 -44
- package/build/main/services/companies/methods.js +0 -3
- package/build/main/services/contacts/entities.d.ts +0 -45
- package/build/main/services/contacts/entities.js +0 -2
- package/build/main/services/contacts/index.d.ts +0 -26
- package/build/main/services/contacts/index.integration.test.d.ts +0 -1
- package/build/main/services/contacts/index.integration.test.js +0 -19
- package/build/main/services/contacts/index.js +0 -10
- package/build/main/services/contacts/index.unit.test.d.ts +0 -1
- package/build/main/services/contacts/index.unit.test.js +0 -72
- package/build/main/services/contacts/methods.d.ts +0 -44
- package/build/main/services/contacts/methods.js +0 -3
- package/build/main/services/currencies/entities.d.ts +0 -15
- package/build/main/services/currencies/entities.js +0 -2
- package/build/main/services/deals/entities.d.ts +0 -43
- package/build/main/services/deals/entities.js +0 -2
- package/build/main/services/deals/index.d.ts +0 -26
- package/build/main/services/deals/index.integration.test.d.ts +0 -1
- package/build/main/services/deals/index.integration.test.js +0 -19
- package/build/main/services/deals/index.js +0 -10
- package/build/main/services/deals/index.unit.test.d.ts +0 -1
- package/build/main/services/deals/index.unit.test.js +0 -72
- package/build/main/services/deals/methods.d.ts +0 -44
- package/build/main/services/deals/methods.js +0 -3
- package/build/main/services/leads/entities.d.ts +0 -49
- package/build/main/services/leads/entities.js +0 -2
- package/build/main/services/leads/index.d.ts +0 -26
- package/build/main/services/leads/index.integration.test.d.ts +0 -1
- package/build/main/services/leads/index.integration.test.js +0 -19
- package/build/main/services/leads/index.js +0 -10
- package/build/main/services/leads/index.unit.test.d.ts +0 -1
- package/build/main/services/leads/index.unit.test.js +0 -72
- package/build/main/services/leads/methods.d.ts +0 -44
- package/build/main/services/leads/methods.js +0 -3
- package/build/main/services/statuses/entities.d.ts +0 -16
- package/build/main/services/statuses/entities.js +0 -2
- package/build/main/services/statuses/index.d.ts +0 -14
- package/build/main/services/statuses/index.integration.test.d.ts +0 -1
- package/build/main/services/statuses/index.integration.test.js +0 -90
- package/build/main/services/statuses/index.js +0 -11
- package/build/main/services/statuses/index.unit.test.d.ts +0 -1
- package/build/main/services/statuses/index.unit.test.js +0 -60
- package/build/main/services/statuses/methods.d.ts +0 -51
- package/build/main/services/statuses/methods.js +0 -3
- package/build/main/services/users/entities.d.ts +0 -40
- package/build/main/services/users/entities.js +0 -2
- package/build/main/services/users/index.d.ts +0 -9
- package/build/main/services/users/index.integration.test.d.ts +0 -1
- package/build/main/services/users/index.integration.test.js +0 -33
- package/build/main/services/users/index.js +0 -7
- package/build/main/services/users/index.unit.test.d.ts +0 -1
- package/build/main/services/users/index.unit.test.js +0 -25
- package/build/main/services/users/methods.d.ts +0 -17
- package/build/main/services/users/methods.js +0 -3
- package/build/main/utils/Diff.d.ts +0 -1
- package/build/main/utils/Diff.js +0 -2
- package/build/main/utils/ExtractValue.d.ts +0 -6
- package/build/main/utils/ExtractValue.js +0 -2
- package/build/main/utils/isArray.d.ts +0 -2
- package/build/main/utils/isArray.js +0 -4
- package/build/module/bitrix.d.ts +0 -114
- package/build/module/bitrix.integration.test.d.ts +0 -0
- package/build/module/bitrix.integration.test.js +0 -31
- package/build/module/bitrix.js +0 -40
- package/build/module/bitrix.unit.test.d.ts +0 -1
- package/build/module/bitrix.unit.test.js +0 -16
- package/build/module/client/client.unit.test.d.ts +0 -1
- package/build/module/client/client.unit.test.js +0 -65
- package/build/module/client/hooks/addAccessToken.d.ts +0 -6
- package/build/module/client/hooks/addAccessToken.js +0 -11
- package/build/module/client/hooks/addAccessToken.unit.test.d.ts +0 -1
- package/build/module/client/hooks/addAccessToken.unit.test.js +0 -26
- package/build/module/client/index.d.ts +0 -15
- package/build/module/client/index.js +0 -48
- package/build/module/client/methods/batch.d.ts +0 -40
- package/build/module/client/methods/batch.js +0 -76
- package/build/module/client/methods/batch.unit.test.d.ts +0 -1
- package/build/module/client/methods/batch.unit.test.js +0 -466
- package/build/module/client/methods/call.d.ts +0 -17
- package/build/module/client/methods/call.js +0 -28
- package/build/module/client/methods/call.unit.test.d.ts +0 -1
- package/build/module/client/methods/call.unit.test.js +0 -155
- package/build/module/client/methods/list.d.ts +0 -30
- package/build/module/client/methods/list.js +0 -55
- package/build/module/client/methods/list.unit.test.d.ts +0 -1
- package/build/module/client/methods/list.unit.test.js +0 -252
- package/build/module/commands.d.ts +0 -10
- package/build/module/commands.js +0 -1
- package/build/module/methods.d.ts +0 -92
- package/build/module/methods.js +0 -38
- package/build/module/payloads.d.ts +0 -40
- package/build/module/payloads.js +0 -1
- package/build/module/services/common.d.ts +0 -22
- package/build/module/services/common.js +0 -1
- package/build/module/services/companies/entities.d.ts +0 -54
- package/build/module/services/companies/entities.js +0 -1
- package/build/module/services/companies/index.d.ts +0 -26
- package/build/module/services/companies/index.integration.test.d.ts +0 -1
- package/build/module/services/companies/index.integration.test.js +0 -14
- package/build/module/services/companies/index.js +0 -8
- package/build/module/services/companies/index.unit.test.d.ts +0 -1
- package/build/module/services/companies/index.unit.test.js +0 -67
- package/build/module/services/companies/methods.d.ts +0 -44
- package/build/module/services/companies/methods.js +0 -1
- package/build/module/services/contacts/entities.d.ts +0 -45
- package/build/module/services/contacts/entities.js +0 -1
- package/build/module/services/contacts/index.d.ts +0 -26
- package/build/module/services/contacts/index.integration.test.d.ts +0 -1
- package/build/module/services/contacts/index.integration.test.js +0 -14
- package/build/module/services/contacts/index.js +0 -8
- package/build/module/services/contacts/index.unit.test.d.ts +0 -1
- package/build/module/services/contacts/index.unit.test.js +0 -67
- package/build/module/services/contacts/methods.d.ts +0 -44
- package/build/module/services/contacts/methods.js +0 -1
- package/build/module/services/currencies/entities.d.ts +0 -15
- package/build/module/services/currencies/entities.js +0 -1
- package/build/module/services/deals/entities.d.ts +0 -43
- package/build/module/services/deals/entities.js +0 -1
- package/build/module/services/deals/index.d.ts +0 -26
- package/build/module/services/deals/index.integration.test.d.ts +0 -1
- package/build/module/services/deals/index.integration.test.js +0 -14
- package/build/module/services/deals/index.js +0 -8
- package/build/module/services/deals/index.unit.test.d.ts +0 -1
- package/build/module/services/deals/index.unit.test.js +0 -67
- package/build/module/services/deals/methods.d.ts +0 -44
- package/build/module/services/deals/methods.js +0 -1
- package/build/module/services/leads/entities.d.ts +0 -49
- package/build/module/services/leads/entities.js +0 -1
- package/build/module/services/leads/index.d.ts +0 -26
- package/build/module/services/leads/index.integration.test.d.ts +0 -1
- package/build/module/services/leads/index.integration.test.js +0 -14
- package/build/module/services/leads/index.js +0 -8
- package/build/module/services/leads/index.unit.test.d.ts +0 -1
- package/build/module/services/leads/index.unit.test.js +0 -67
- package/build/module/services/leads/methods.d.ts +0 -44
- package/build/module/services/leads/methods.js +0 -1
- package/build/module/services/statuses/entities.d.ts +0 -16
- package/build/module/services/statuses/entities.js +0 -1
- package/build/module/services/statuses/index.d.ts +0 -14
- package/build/module/services/statuses/index.integration.test.d.ts +0 -1
- package/build/module/services/statuses/index.integration.test.js +0 -85
- package/build/module/services/statuses/index.js +0 -9
- package/build/module/services/statuses/index.unit.test.d.ts +0 -1
- package/build/module/services/statuses/index.unit.test.js +0 -55
- package/build/module/services/statuses/methods.d.ts +0 -51
- package/build/module/services/statuses/methods.js +0 -1
- package/build/module/services/users/entities.d.ts +0 -40
- package/build/module/services/users/entities.js +0 -1
- package/build/module/services/users/index.d.ts +0 -9
- package/build/module/services/users/index.integration.test.d.ts +0 -1
- package/build/module/services/users/index.integration.test.js +0 -28
- package/build/module/services/users/index.js +0 -5
- package/build/module/services/users/index.unit.test.d.ts +0 -1
- package/build/module/services/users/index.unit.test.js +0 -20
- package/build/module/services/users/methods.d.ts +0 -17
- package/build/module/services/users/methods.js +0 -1
- package/build/module/utils/Diff.d.ts +0 -1
- package/build/module/utils/Diff.js +0 -1
- package/build/module/utils/ExtractValue.d.ts +0 -6
- package/build/module/utils/ExtractValue.js +0 -1
- package/build/module/utils/isArray.d.ts +0 -2
- package/build/module/utils/isArray.js +0 -2
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export declare type PayloadTime = {
|
|
2
|
-
readonly start: number;
|
|
3
|
-
readonly finish: number;
|
|
4
|
-
readonly duration: number;
|
|
5
|
-
readonly processing: number;
|
|
6
|
-
readonly date_start: string;
|
|
7
|
-
readonly date_finish: string;
|
|
8
|
-
};
|
|
9
|
-
export declare type GetPayload<P> = {
|
|
10
|
-
readonly result: P;
|
|
11
|
-
readonly time: PayloadTime;
|
|
12
|
-
};
|
|
13
|
-
export declare type ListPayload<P> = {
|
|
14
|
-
readonly result: readonly P[];
|
|
15
|
-
readonly error?: string;
|
|
16
|
-
readonly total: number;
|
|
17
|
-
readonly next?: number;
|
|
18
|
-
readonly time: PayloadTime;
|
|
19
|
-
};
|
|
20
|
-
export declare type BatchPayload<C> = {
|
|
21
|
-
readonly result: {
|
|
22
|
-
readonly result: {
|
|
23
|
-
readonly [P in keyof C]?: C[P];
|
|
24
|
-
} | ReadonlyArray<C[keyof C]>;
|
|
25
|
-
readonly result_error: {
|
|
26
|
-
readonly [P in keyof C]?: string;
|
|
27
|
-
} | readonly string[];
|
|
28
|
-
readonly result_total: {
|
|
29
|
-
readonly [P in keyof C]?: number;
|
|
30
|
-
} | readonly number[];
|
|
31
|
-
readonly result_next: {
|
|
32
|
-
readonly [P in keyof C]?: number;
|
|
33
|
-
} | readonly number[];
|
|
34
|
-
readonly result_time: {
|
|
35
|
-
readonly [P in keyof C]?: PayloadTime;
|
|
36
|
-
} | readonly PayloadTime[];
|
|
37
|
-
};
|
|
38
|
-
readonly time: PayloadTime;
|
|
39
|
-
};
|
|
40
|
-
export declare type Payload<P> = GetPayload<P> | ListPayload<P> | BatchPayload<P>;
|
package/build/module/payloads.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare type NumberString = string;
|
|
2
|
-
export declare type ISODate = string;
|
|
3
|
-
export declare type BoolString = 'Y' | 'N';
|
|
4
|
-
export declare type GenderString = 'M' | 'F' | '';
|
|
5
|
-
export declare type Fields = {
|
|
6
|
-
readonly [key: string]: {
|
|
7
|
-
readonly type: string;
|
|
8
|
-
readonly isRequired: boolean;
|
|
9
|
-
readonly isReadOnly: boolean;
|
|
10
|
-
readonly isImmutable: boolean;
|
|
11
|
-
readonly isMultiple: boolean;
|
|
12
|
-
readonly isDynamic: boolean;
|
|
13
|
-
readonly title: string;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export declare type MultiField = {
|
|
17
|
-
readonly ID: NumberString;
|
|
18
|
-
readonly VALUE_TYPE: string;
|
|
19
|
-
readonly VALUE: string;
|
|
20
|
-
readonly TYPE_ID: string;
|
|
21
|
-
};
|
|
22
|
-
export declare type MultiFieldArray = ReadonlyArray<Pick<MultiField, 'VALUE' | 'VALUE_TYPE'>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { BoolString, ISODate, MultiField, NumberString } from '../common';
|
|
2
|
-
export declare type Company = {
|
|
3
|
-
readonly [key: string]: string | boolean | null | readonly MultiField[];
|
|
4
|
-
readonly ID: NumberString;
|
|
5
|
-
readonly COMPANY_TYPE: string | null;
|
|
6
|
-
readonly TITLE: string | null;
|
|
7
|
-
readonly LOGO: string | null;
|
|
8
|
-
readonly LEAD_ID: NumberString;
|
|
9
|
-
readonly HAS_PHONE: BoolString;
|
|
10
|
-
readonly HAS_EMAIL: BoolString;
|
|
11
|
-
readonly HAS_IMOL: BoolString;
|
|
12
|
-
readonly PHONE: readonly MultiField[];
|
|
13
|
-
readonly EMAIL: readonly MultiField[];
|
|
14
|
-
readonly WEB: readonly MultiField[];
|
|
15
|
-
readonly IM: readonly MultiField[];
|
|
16
|
-
readonly ASSIGNED_BY_ID: NumberString;
|
|
17
|
-
readonly CREATED_BY_ID: NumberString;
|
|
18
|
-
readonly MODIFY_BY_ID: NumberString;
|
|
19
|
-
readonly BANKING_DETAILS: string | null;
|
|
20
|
-
readonly INDUSTRY: string | null;
|
|
21
|
-
readonly REVENUE: string | null;
|
|
22
|
-
readonly CURRENCY_ID: string | null;
|
|
23
|
-
readonly EMPLOYEES: string | null;
|
|
24
|
-
readonly COMMENTS: string | null;
|
|
25
|
-
readonly DATE_CREATE: ISODate;
|
|
26
|
-
readonly DATE_MODIFY: ISODate;
|
|
27
|
-
readonly OPENED: BoolString;
|
|
28
|
-
readonly IS_MY_COMPANY: BoolString;
|
|
29
|
-
readonly ORIGINATOR_ID: string | null;
|
|
30
|
-
readonly ORIGIN_ID: NumberString;
|
|
31
|
-
readonly ORIGIN_VERSION: string | null;
|
|
32
|
-
readonly ADDRESS: string | null;
|
|
33
|
-
readonly ADDRESS_2: string | null;
|
|
34
|
-
readonly ADDRESS_CITY: string | null;
|
|
35
|
-
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
36
|
-
readonly ADDRESS_REGION: string | null;
|
|
37
|
-
readonly ADDRESS_PROVINCE: string | null;
|
|
38
|
-
readonly ADDRESS_COUNTRY: string | null;
|
|
39
|
-
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
40
|
-
readonly ADDRESS_LEGAL: string | null;
|
|
41
|
-
readonly REG_ADDRESS: string | null;
|
|
42
|
-
readonly REG_ADDRESS_2: string | null;
|
|
43
|
-
readonly REG_ADDRESS_CITY: string | null;
|
|
44
|
-
readonly REG_ADDRESS_POSTAL_CODE: string | null;
|
|
45
|
-
readonly REG_ADDRESS_REGION: string | null;
|
|
46
|
-
readonly REG_ADDRESS_PROVINCE: string | null;
|
|
47
|
-
readonly REG_ADDRESS_COUNTRY: string | null;
|
|
48
|
-
readonly REG_ADDRESS_COUNTRY_CODE: string | null;
|
|
49
|
-
readonly UTM_SOURCE: string | null;
|
|
50
|
-
readonly UTM_MEDIUM: string | null;
|
|
51
|
-
readonly UTM_CAMPAIGN: string | null;
|
|
52
|
-
readonly UTM_CONTENT: string | null;
|
|
53
|
-
readonly UTM_TERM: string | null;
|
|
54
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Call } from '../../client/methods/call';
|
|
2
|
-
import { List } from '../../client/methods/list';
|
|
3
|
-
import { Method, MethodParams } from '../../methods';
|
|
4
|
-
declare type Dependencies = {
|
|
5
|
-
readonly call: Call;
|
|
6
|
-
readonly list: List;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: ({ call, list }: Dependencies) => {
|
|
9
|
-
fields: () => Promise<import("../../payloads").GetPayload<import("../common").Fields>>;
|
|
10
|
-
create: <D extends {
|
|
11
|
-
readonly fields: Partial<import("./entities").Company>;
|
|
12
|
-
readonly params?: {
|
|
13
|
-
readonly REGISTER_SONET_EVENT: "Y" | "N";
|
|
14
|
-
} | undefined;
|
|
15
|
-
}>(fields: D["fields"], params?: D["params"] | undefined) => Promise<import("../../payloads").GetPayload<number>>;
|
|
16
|
-
get: (id: string) => Promise<import("../../payloads").GetPayload<import("./entities").Company>>;
|
|
17
|
-
list: (params?: MethodParams<Method.CRM_COMPANY_LIST>) => Promise<import("../../payloads").ListPayload<import("./entities").Company>>;
|
|
18
|
-
update: <D_1 extends {
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly fields: Record<string, unknown>;
|
|
21
|
-
readonly params?: {
|
|
22
|
-
readonly REGISTER_SONET_EVENT: "Y" | "N";
|
|
23
|
-
} | undefined;
|
|
24
|
-
}>(id: string, fields: D_1["fields"], params?: D_1["params"] | undefined) => Promise<import("../../payloads").GetPayload<boolean>>;
|
|
25
|
-
};
|
|
26
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Bitrix from './../../bitrix';
|
|
2
|
-
const WEBHOOK_URL = process.env['WEBHOOK_URL'];
|
|
3
|
-
if (!WEBHOOK_URL) {
|
|
4
|
-
throw Error('Integration tests require environmental variable `WEBHOOK_URL` to be set');
|
|
5
|
-
}
|
|
6
|
-
const { companies } = Bitrix(WEBHOOK_URL);
|
|
7
|
-
describe('Companies', () => {
|
|
8
|
-
describe('fields', () => {
|
|
9
|
-
it('should get all fields', async () => {
|
|
10
|
-
const { result } = await companies.fields();
|
|
11
|
-
expect(result).toMatchSnapshot();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Method } from '../../methods';
|
|
2
|
-
export default ({ call, list }) => ({
|
|
3
|
-
fields: () => call(Method.CRM_COMPANY_FIELDS, {}),
|
|
4
|
-
create: (fields, params) => call(Method.CRM_COMPANY_ADD, { fields, params }),
|
|
5
|
-
get: (id) => call(Method.CRM_COMPANY_GET, { id }),
|
|
6
|
-
list: (params = {}) => list(Method.CRM_COMPANY_LIST, params),
|
|
7
|
-
update: (id, fields, params) => call(Method.CRM_COMPANY_UPDATE, { id, fields, params })
|
|
8
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import Companies from '.';
|
|
2
|
-
const mockCall = jest.fn(() => Promise.resolve());
|
|
3
|
-
const mockList = jest.fn(() => Promise.resolve());
|
|
4
|
-
const companies = Companies({ call: mockCall, list: mockList });
|
|
5
|
-
const ID = '77';
|
|
6
|
-
describe('Companies', () => {
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
mockCall.mockClear();
|
|
9
|
-
mockList.mockClear();
|
|
10
|
-
});
|
|
11
|
-
it('should expose API methods', () => {
|
|
12
|
-
expect(companies).toMatchSnapshot();
|
|
13
|
-
});
|
|
14
|
-
describe('`create`', () => {
|
|
15
|
-
it('should invoke `call`', async () => {
|
|
16
|
-
await companies.create({
|
|
17
|
-
COMMENTS: 'Some comment'
|
|
18
|
-
}, {
|
|
19
|
-
REGISTER_SONET_EVENT: 'Y'
|
|
20
|
-
});
|
|
21
|
-
expect(mockCall.mock.calls).toMatchSnapshot();
|
|
22
|
-
});
|
|
23
|
-
it('should work without optional params', async () => {
|
|
24
|
-
await companies.create({
|
|
25
|
-
COMMENTS: 'Some comment'
|
|
26
|
-
});
|
|
27
|
-
expect(mockCall.mock.calls).toMatchSnapshot();
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
describe('`get`', () => {
|
|
31
|
-
it('should invoke `call`', async () => {
|
|
32
|
-
await companies.get(ID);
|
|
33
|
-
expect(mockCall.mock.calls).toMatchSnapshot();
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
describe('`list`', () => {
|
|
37
|
-
it('should invoke `list`', async () => {
|
|
38
|
-
await companies.list({
|
|
39
|
-
start: 0,
|
|
40
|
-
order: { COMMENTS: 'ASC' },
|
|
41
|
-
filter: { '>PROBABILITY': 50 },
|
|
42
|
-
select: ['*', 'UF_*']
|
|
43
|
-
});
|
|
44
|
-
expect(mockList.mock.calls).toMatchSnapshot();
|
|
45
|
-
});
|
|
46
|
-
it('should work without optional params', async () => {
|
|
47
|
-
await companies.list();
|
|
48
|
-
expect(mockList.mock.calls).toMatchSnapshot();
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
describe('`update`', () => {
|
|
52
|
-
it('should invoke `call`', async () => {
|
|
53
|
-
await companies.update(ID, {
|
|
54
|
-
COMMENTS: 'Some comment'
|
|
55
|
-
}, {
|
|
56
|
-
REGISTER_SONET_EVENT: 'Y'
|
|
57
|
-
});
|
|
58
|
-
expect(mockCall.mock.calls).toMatchSnapshot();
|
|
59
|
-
});
|
|
60
|
-
it('should work without optional params', async () => {
|
|
61
|
-
await companies.update(ID, {
|
|
62
|
-
COMMENTS: 'Some comment'
|
|
63
|
-
});
|
|
64
|
-
expect(mockCall.mock.calls).toMatchSnapshot();
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ListParams, Method } from '../../methods';
|
|
2
|
-
import { GetPayload, ListPayload } from '../../payloads';
|
|
3
|
-
import { Fields } from '../common';
|
|
4
|
-
import { Company } from './entities';
|
|
5
|
-
export declare type CompaniesMethods = {
|
|
6
|
-
readonly [Method.CRM_COMPANY_FIELDS]: {
|
|
7
|
-
readonly type: Company;
|
|
8
|
-
readonly payload: GetPayload<Fields>;
|
|
9
|
-
readonly params?: Record<string, unknown>;
|
|
10
|
-
};
|
|
11
|
-
readonly [Method.CRM_COMPANY_ADD]: {
|
|
12
|
-
readonly type: Company;
|
|
13
|
-
readonly payload: GetPayload<number>;
|
|
14
|
-
readonly params: {
|
|
15
|
-
readonly fields: Partial<Company>;
|
|
16
|
-
readonly params?: {
|
|
17
|
-
readonly REGISTER_SONET_EVENT: 'Y' | 'N';
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
readonly [Method.CRM_COMPANY_GET]: {
|
|
22
|
-
readonly type: Company;
|
|
23
|
-
readonly payload: GetPayload<Company>;
|
|
24
|
-
readonly params: {
|
|
25
|
-
readonly id: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
readonly [Method.CRM_COMPANY_LIST]: {
|
|
29
|
-
readonly type: Company;
|
|
30
|
-
readonly payload: ListPayload<Company>;
|
|
31
|
-
readonly params: ListParams;
|
|
32
|
-
};
|
|
33
|
-
readonly [Method.CRM_COMPANY_UPDATE]: {
|
|
34
|
-
readonly type: Company;
|
|
35
|
-
readonly payload: GetPayload<boolean>;
|
|
36
|
-
readonly params: {
|
|
37
|
-
readonly id: string;
|
|
38
|
-
readonly fields: Record<string, unknown>;
|
|
39
|
-
readonly params?: {
|
|
40
|
-
readonly REGISTER_SONET_EVENT: 'Y' | 'N';
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { Method } from '../../methods';
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { BoolString, ISODate, MultiFieldArray, NumberString } from '../common';
|
|
2
|
-
export declare type Contact = {
|
|
3
|
-
readonly [key: string]: MultiFieldArray | string | null;
|
|
4
|
-
readonly ID: NumberString;
|
|
5
|
-
readonly POST: string | null;
|
|
6
|
-
readonly COMMENTS: string | null;
|
|
7
|
-
readonly HONORIFIC: string | null;
|
|
8
|
-
readonly NAME: string | null;
|
|
9
|
-
readonly SECOND_NAME: string | null;
|
|
10
|
-
readonly LAST_NAME: string | null;
|
|
11
|
-
readonly PHOTO: string | null;
|
|
12
|
-
readonly LEAD_ID: NumberString;
|
|
13
|
-
readonly TYPE_ID: string | null;
|
|
14
|
-
readonly SOURCE_ID: NumberString;
|
|
15
|
-
readonly SOURCE_DESCRIPTION: string | null;
|
|
16
|
-
readonly COMPANY_ID: NumberString;
|
|
17
|
-
readonly BIRTHDATE: ISODate;
|
|
18
|
-
readonly EXPORT: BoolString;
|
|
19
|
-
readonly HAS_PHONE: BoolString;
|
|
20
|
-
readonly HAS_EMAIL: BoolString;
|
|
21
|
-
readonly HAS_IMOL: BoolString;
|
|
22
|
-
readonly DATE_CREATE: ISODate;
|
|
23
|
-
readonly DATE_MODIFY: ISODate;
|
|
24
|
-
readonly ASSIGNED_BY_ID: NumberString;
|
|
25
|
-
readonly CREATED_BY_ID: NumberString;
|
|
26
|
-
readonly MODIFY_BY_ID: NumberString;
|
|
27
|
-
readonly OPENED: BoolString;
|
|
28
|
-
readonly ORIGINATOR_ID: string | null;
|
|
29
|
-
readonly ORIGIN_ID: NumberString;
|
|
30
|
-
readonly ORIGIN_VERSION: string | null;
|
|
31
|
-
readonly FACE_ID: string | null;
|
|
32
|
-
readonly ADDRESS: string | null;
|
|
33
|
-
readonly ADDRESS_2: string | null;
|
|
34
|
-
readonly ADDRESS_CITY: string | null;
|
|
35
|
-
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
36
|
-
readonly ADDRESS_REGION: string | null;
|
|
37
|
-
readonly ADDRESS_PROVINCE: string | null;
|
|
38
|
-
readonly ADDRESS_COUNTRY: string | null;
|
|
39
|
-
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
40
|
-
readonly UTM_SOURCE: string | null;
|
|
41
|
-
readonly UTM_MEDIUM: string | null;
|
|
42
|
-
readonly UTM_CAMPAIGN: string | null;
|
|
43
|
-
readonly UTM_CONTENT: string | null;
|
|
44
|
-
readonly UTM_TERM: string | null;
|
|
45
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Call } from '../../client/methods/call';
|
|
2
|
-
import { List } from '../../client/methods/list';
|
|
3
|
-
import { Method, MethodParams } from '../../methods';
|
|
4
|
-
declare type Dependencies = {
|
|
5
|
-
readonly call: Call;
|
|
6
|
-
readonly list: List;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: ({ call, list }: Dependencies) => {
|
|
9
|
-
fields: () => Promise<import("../../payloads").GetPayload<import("../common").Fields>>;
|
|
10
|
-
create: <D extends {
|
|
11
|
-
readonly fields: Partial<import("./entities").Contact>;
|
|
12
|
-
readonly params?: {
|
|
13
|
-
readonly REGISTER_SONET_EVENT: "Y" | "N";
|
|
14
|
-
} | undefined;
|
|
15
|
-
}>(fields: D["fields"], params?: D["params"] | undefined) => Promise<import("../../payloads").GetPayload<number>>;
|
|
16
|
-
get: (id: string) => Promise<import("../../payloads").GetPayload<import("./entities").Contact>>;
|
|
17
|
-
list: (params?: MethodParams<Method.CRM_CONTACT_LIST>) => Promise<import("../../payloads").ListPayload<import("./entities").Contact>>;
|
|
18
|
-
update: <D_1 extends {
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly fields: Record<string, unknown>;
|
|
21
|
-
readonly params?: {
|
|
22
|
-
readonly REGISTER_SONET_EVENT: "Y" | "N";
|
|
23
|
-
} | undefined;
|
|
24
|
-
}>(id: string, fields: D_1["fields"], params?: D_1["params"] | undefined) => Promise<import("../../payloads").GetPayload<boolean>>;
|
|
25
|
-
};
|
|
26
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Bitrix from './../../bitrix';
|
|
2
|
-
const WEBHOOK_URL = process.env['WEBHOOK_URL'];
|
|
3
|
-
if (!WEBHOOK_URL) {
|
|
4
|
-
throw Error('Integration tests require environmental variable `WEBHOOK_URL` to be set');
|
|
5
|
-
}
|
|
6
|
-
const { contacts } = Bitrix(WEBHOOK_URL);
|
|
7
|
-
describe('Contacts', () => {
|
|
8
|
-
describe('fields', () => {
|
|
9
|
-
it('should get all fields', async () => {
|
|
10
|
-
const { result } = await contacts.fields();
|
|
11
|
-
expect(result).toMatchSnapshot();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Method } from '../../methods';
|
|
2
|
-
export default ({ call, list }) => ({
|
|
3
|
-
fields: () => call(Method.CRM_CONTACT_FIELDS, {}),
|
|
4
|
-
create: (fields, params) => call(Method.CRM_CONTACT_ADD, { fields, params }),
|
|
5
|
-
get: (id) => call(Method.CRM_CONTACT_GET, { id }),
|
|
6
|
-
list: (params = {}) => list(Method.CRM_CONTACT_LIST, params),
|
|
7
|
-
update: (id, fields, params) => call(Method.CRM_CONTACT_UPDATE, { id, fields, params })
|
|
8
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import Contacts from '.';
|
|
2
|
-
const mockCall = jest.fn(() => Promise.resolve());
|
|
3
|
-
const mockList = jest.fn(() => Promise.resolve());
|
|
4
|
-
const contacts = Contacts({ call: mockCall, list: mockList });
|
|
5
|
-
const ID = '77';
|
|
6
|
-
describe('Contacts', () => {
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
mockCall.mockClear();
|
|
9
|
-
mockList.mockClear();
|
|
10
|
-
});
|
|
11
|
-
it('should expose API methods', () => {
|
|
12
|
-
expect(contacts).toMatchSnapshot();
|
|
13
|
-
});
|
|
14
|
-
describe('`create`', () => {
|
|
15
|
-
it('should invoke `call`', async () => {
|
|
16
|
-
await contacts.create({
|
|
17
|
-
COMMENTS: 'Some comment'
|
|
18
|
-
}, {
|
|
19
|
-
REGISTER_SONET_EVENT: 'Y'
|
|
20
|
-
});
|
|
21
|
-
expect(mockCall.mock.calls).toMatchSnapshot();
|
|
22
|
-
});
|
|
23
|
-
it('should work without optional params', async () => {
|
|
24
|
-
await contacts.create({
|
|
25
|
-
COMMENTS: 'Some comment'
|
|
26
|
-
});
|
|
27
|
-
expect(mockCall.mock.calls).toMatchSnapshot();
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
describe('`get`', () => {
|
|
31
|
-
it('should invoke `call`', async () => {
|
|
32
|
-
await contacts.get(ID);
|
|
33
|
-
expect(mockCall.mock.calls).toMatchSnapshot();
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
describe('`list`', () => {
|
|
37
|
-
it('should invoke `list`', async () => {
|
|
38
|
-
await contacts.list({
|
|
39
|
-
start: 0,
|
|
40
|
-
order: { COMMENTS: 'ASC' },
|
|
41
|
-
filter: { '>PROBABILITY': 50 },
|
|
42
|
-
select: ['*', 'UF_*']
|
|
43
|
-
});
|
|
44
|
-
expect(mockList.mock.calls).toMatchSnapshot();
|
|
45
|
-
});
|
|
46
|
-
it('should work without optional params', async () => {
|
|
47
|
-
await contacts.list();
|
|
48
|
-
expect(mockList.mock.calls).toMatchSnapshot();
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
describe('`update`', () => {
|
|
52
|
-
it('should invoke `call`', async () => {
|
|
53
|
-
await contacts.update(ID, {
|
|
54
|
-
COMMENTS: 'Some comment'
|
|
55
|
-
}, {
|
|
56
|
-
REGISTER_SONET_EVENT: 'Y'
|
|
57
|
-
});
|
|
58
|
-
expect(mockCall.mock.calls).toMatchSnapshot();
|
|
59
|
-
});
|
|
60
|
-
it('should work without optional params', async () => {
|
|
61
|
-
await contacts.update(ID, {
|
|
62
|
-
COMMENTS: 'Some comment'
|
|
63
|
-
});
|
|
64
|
-
expect(mockCall.mock.calls).toMatchSnapshot();
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ListParams, Method } from '../../methods';
|
|
2
|
-
import { GetPayload, ListPayload } from '../../payloads';
|
|
3
|
-
import { Fields } from '../common';
|
|
4
|
-
import { Contact } from './entities';
|
|
5
|
-
export declare type ContactsMethods = {
|
|
6
|
-
readonly [Method.CRM_CONTACT_FIELDS]: {
|
|
7
|
-
readonly type: Contact;
|
|
8
|
-
readonly payload: GetPayload<Fields>;
|
|
9
|
-
readonly params?: Record<string, unknown>;
|
|
10
|
-
};
|
|
11
|
-
readonly [Method.CRM_CONTACT_ADD]: {
|
|
12
|
-
readonly type: Contact;
|
|
13
|
-
readonly payload: GetPayload<number>;
|
|
14
|
-
readonly params: {
|
|
15
|
-
readonly fields: Partial<Contact>;
|
|
16
|
-
readonly params?: {
|
|
17
|
-
readonly REGISTER_SONET_EVENT: 'Y' | 'N';
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
readonly [Method.CRM_CONTACT_GET]: {
|
|
22
|
-
readonly type: Contact;
|
|
23
|
-
readonly payload: GetPayload<Contact>;
|
|
24
|
-
readonly params: {
|
|
25
|
-
readonly id: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
readonly [Method.CRM_CONTACT_LIST]: {
|
|
29
|
-
readonly type: Contact;
|
|
30
|
-
readonly payload: ListPayload<Contact>;
|
|
31
|
-
readonly params: ListParams;
|
|
32
|
-
};
|
|
33
|
-
readonly [Method.CRM_CONTACT_UPDATE]: {
|
|
34
|
-
readonly type: Contact;
|
|
35
|
-
readonly payload: GetPayload<boolean>;
|
|
36
|
-
readonly params: {
|
|
37
|
-
readonly id: string;
|
|
38
|
-
readonly fields: Record<string, unknown>;
|
|
39
|
-
readonly params?: {
|
|
40
|
-
readonly REGISTER_SONET_EVENT: 'Y' | 'N';
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { Method } from '../../methods';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BoolString, ISODate, NumberString } from '../common';
|
|
2
|
-
export declare type Currency = {
|
|
3
|
-
readonly CURRENCY: string;
|
|
4
|
-
readonly AMOUNT_CNT: NumberString;
|
|
5
|
-
readonly AMOUNT: NumberString;
|
|
6
|
-
readonly SORT: NumberString;
|
|
7
|
-
readonly BASE: BoolString;
|
|
8
|
-
readonly FULL_NAME: string;
|
|
9
|
-
readonly LID: string;
|
|
10
|
-
readonly FORMAT_STRING: string;
|
|
11
|
-
readonly DEC_POINT: string;
|
|
12
|
-
readonly THOUSANDS_SEP: string;
|
|
13
|
-
readonly DECIMALS: NumberString;
|
|
14
|
-
readonly DATE_UPDATE: ISODate;
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { BoolString, ISODate, NumberString } from '../common';
|
|
2
|
-
export declare type Deal = {
|
|
3
|
-
readonly [key: string]: string | null;
|
|
4
|
-
readonly ID: NumberString;
|
|
5
|
-
readonly TITLE: string;
|
|
6
|
-
readonly TYPE_ID: string;
|
|
7
|
-
readonly STAGE_ID: string;
|
|
8
|
-
readonly PROBABILITY: NumberString | null;
|
|
9
|
-
readonly CURRENCY_ID: string;
|
|
10
|
-
readonly OPPORTUNITY: NumberString;
|
|
11
|
-
readonly TAX_VALUE: NumberString;
|
|
12
|
-
readonly LEAD_ID: NumberString;
|
|
13
|
-
readonly COMPANY_ID: NumberString;
|
|
14
|
-
readonly CONTACT_ID: NumberString | null;
|
|
15
|
-
readonly QUOTE_ID: NumberString | null;
|
|
16
|
-
readonly BEGINDATE: ISODate;
|
|
17
|
-
readonly CLOSEDATE: ISODate;
|
|
18
|
-
readonly ASSIGNED_BY_ID: NumberString;
|
|
19
|
-
readonly CREATED_BY_ID: NumberString;
|
|
20
|
-
readonly MODIFY_BY_ID: NumberString;
|
|
21
|
-
readonly DATE_CREATE: ISODate;
|
|
22
|
-
readonly DATE_MODIFY: ISODate;
|
|
23
|
-
readonly OPENED: BoolString;
|
|
24
|
-
readonly CLOSED: BoolString;
|
|
25
|
-
readonly COMMENTS: string;
|
|
26
|
-
readonly ADDITIONAL_INFO: NumberString | null;
|
|
27
|
-
readonly LOCATION_ID: NumberString | null;
|
|
28
|
-
readonly CATEGORY_ID: NumberString;
|
|
29
|
-
readonly STAGE_SEMANTIC_ID: NumberString;
|
|
30
|
-
readonly IS_NEW: BoolString;
|
|
31
|
-
readonly IS_RECURRING: BoolString;
|
|
32
|
-
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
33
|
-
readonly IS_REPEATED_APPROACH: BoolString;
|
|
34
|
-
readonly SOURCE_ID: NumberString | null;
|
|
35
|
-
readonly SOURCE_DESCRIPTION: string | null;
|
|
36
|
-
readonly ORIGINATOR_ID: string;
|
|
37
|
-
readonly ORIGIN_ID: NumberString;
|
|
38
|
-
readonly UTM_SOURCE: string | null;
|
|
39
|
-
readonly UTM_MEDIUM: string | null;
|
|
40
|
-
readonly UTM_CAMPAIGN: string | null;
|
|
41
|
-
readonly UTM_CONTENT: string | null;
|
|
42
|
-
readonly UTM_TERM: string | null;
|
|
43
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Call } from '../../client/methods/call';
|
|
2
|
-
import { List } from '../../client/methods/list';
|
|
3
|
-
import { Method, MethodParams } from '../../methods';
|
|
4
|
-
declare type Dependencies = {
|
|
5
|
-
readonly call: Call;
|
|
6
|
-
readonly list: List;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: ({ call, list }: Dependencies) => {
|
|
9
|
-
fields: () => Promise<import("../../payloads").GetPayload<import("../common").Fields>>;
|
|
10
|
-
create: <D extends {
|
|
11
|
-
readonly fields: Partial<import("./entities").Deal>;
|
|
12
|
-
readonly params?: {
|
|
13
|
-
readonly REGISTER_SONET_EVENT: "Y" | "N";
|
|
14
|
-
} | undefined;
|
|
15
|
-
}>(fields: D["fields"], params?: D["params"] | undefined) => Promise<import("../../payloads").GetPayload<number>>;
|
|
16
|
-
get: (id: string) => Promise<import("../../payloads").GetPayload<import("./entities").Deal>>;
|
|
17
|
-
list: (params?: MethodParams<Method.CRM_DEAL_LIST>) => Promise<import("../../payloads").ListPayload<import("./entities").Deal>>;
|
|
18
|
-
update: <D_1 extends {
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly fields: Record<string, unknown>;
|
|
21
|
-
readonly params?: {
|
|
22
|
-
readonly REGISTER_SONET_EVENT: "Y" | "N";
|
|
23
|
-
} | undefined;
|
|
24
|
-
}>(id: string, fields: D_1["fields"], params?: D_1["params"] | undefined) => Promise<import("../../payloads").GetPayload<boolean>>;
|
|
25
|
-
};
|
|
26
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Bitrix from './../../bitrix';
|
|
2
|
-
const WEBHOOK_URL = process.env['WEBHOOK_URL'];
|
|
3
|
-
if (!WEBHOOK_URL) {
|
|
4
|
-
throw Error('Integration tests require environmental variable `WEBHOOK_URL` to be set');
|
|
5
|
-
}
|
|
6
|
-
const { deals } = Bitrix(WEBHOOK_URL);
|
|
7
|
-
describe('Deals', () => {
|
|
8
|
-
describe('fields', () => {
|
|
9
|
-
it('should get all fields', async () => {
|
|
10
|
-
const { result } = await deals.fields();
|
|
11
|
-
expect(result).toMatchSnapshot();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Method } from '../../methods';
|
|
2
|
-
export default ({ call, list }) => ({
|
|
3
|
-
fields: () => call(Method.CRM_DEAL_FIELDS, {}),
|
|
4
|
-
create: (fields, params) => call(Method.CRM_DEAL_ADD, { fields, params }),
|
|
5
|
-
get: (id) => call(Method.CRM_DEAL_GET, { id }),
|
|
6
|
-
list: (params = {}) => list(Method.CRM_DEAL_LIST, params),
|
|
7
|
-
update: (id, fields, params) => call(Method.CRM_DEAL_UPDATE, { id, fields, params })
|
|
8
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|