@2bad/bitrix 2.5.0 → 3.0.0-beta.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 +10 -9
- package/build/bitrix.d.ts +65 -0
- package/build/bitrix.js +55 -0
- package/build/client/hooks/addAccessToken.js +9 -0
- package/build/{module/client → client}/index.d.ts +3 -3
- package/build/{module/client → client}/index.js +21 -16
- package/build/{module/client → client}/methods/batch.d.ts +6 -6
- package/build/client/methods/batch.js +75 -0
- package/build/{module/client → client}/methods/call.d.ts +4 -4
- package/build/{module/client → client}/methods/call.js +8 -9
- package/build/{module/client → client}/methods/list.d.ts +10 -10
- package/build/client/methods/list.js +58 -0
- package/build/{module/commands.d.ts → commands.d.ts} +3 -3
- package/build/commands.js +1 -0
- package/build/{module/methods.d.ts → methods.d.ts} +19 -19
- package/build/{module/methods.js → methods.js} +5 -5
- package/build/{main/payloads.d.ts → payloads.d.ts} +5 -5
- package/build/payloads.js +1 -0
- package/build/{main/services → services}/common.d.ts +7 -7
- package/build/services/common.js +2 -0
- package/build/{main/services → services}/companies/entities.d.ts +2 -2
- package/build/services/companies/entities.js +1 -0
- package/build/services/companies/index.d.ts +15 -0
- package/build/services/companies/index.js +17 -0
- package/build/{module/services → services}/companies/methods.d.ts +5 -5
- package/build/services/companies/methods.js +1 -0
- package/build/{module/services → services}/contacts/entities.d.ts +2 -2
- package/build/services/contacts/entities.js +1 -0
- package/build/services/contacts/index.d.ts +15 -0
- package/build/services/contacts/index.js +17 -0
- package/build/{module/services → services}/contacts/methods.d.ts +5 -5
- package/build/services/contacts/methods.js +1 -0
- package/build/{module/services → services}/currencies/entities.d.ts +2 -2
- package/build/services/currencies/entities.js +1 -0
- package/build/{module/services → services}/deals/entities.d.ts +2 -2
- package/build/services/deals/entities.js +1 -0
- package/build/services/deals/index.d.ts +15 -0
- package/build/services/deals/index.js +17 -0
- package/build/{main/services → services}/deals/methods.d.ts +5 -5
- package/build/services/deals/methods.js +1 -0
- package/build/{module/services → services}/leads/entities.d.ts +2 -2
- package/build/services/leads/entities.js +1 -0
- package/build/services/leads/index.d.ts +15 -0
- package/build/services/leads/index.js +17 -0
- package/build/{main/services → services}/leads/methods.d.ts +5 -5
- package/build/services/leads/methods.js +1 -0
- package/build/{main/services → services}/statuses/entities.d.ts +3 -3
- package/build/services/statuses/entities.js +1 -0
- package/build/services/statuses/index.d.ts +14 -0
- package/build/services/statuses/index.js +19 -0
- package/build/{main/services → services}/statuses/methods.d.ts +5 -5
- package/build/services/statuses/methods.js +1 -0
- package/build/{module/services → services}/users/entities.d.ts +2 -2
- package/build/services/users/entities.js +1 -0
- package/build/services/users/index.d.ts +9 -0
- package/build/services/users/index.js +7 -0
- package/build/{main/services → services}/users/methods.d.ts +4 -4
- package/build/services/users/methods.js +1 -0
- package/build/utils/Diff.d.ts +1 -0
- package/build/utils/Diff.js +7 -0
- package/build/{module/utils → utils}/ExtractValue.d.ts +1 -1
- package/build/{main/utils/ExtractValue.d.ts → utils/ExtractValue.js} +1 -2
- package/build/utils/isArray.d.ts +2 -0
- package/build/{module/utils → utils}/isArray.js +1 -1
- package/package.json +43 -49
- 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 -58
- 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.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.js +0 -2
- package/build/main/services/common.js +0 -2
- 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.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.js +0 -3
- 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.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.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.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 -39
- 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/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.unit.test.d.ts +0 -1
- package/build/module/client/methods/call.unit.test.js +0 -155
- 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.js +0 -1
- 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.js +0 -1
- 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.js +0 -1
- package/build/module/services/currencies/entities.js +0 -1
- 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.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.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.js +0 -1
- package/build/module/utils/isArray.d.ts +0 -2
- /package/build/{main/client → client}/hooks/addAccessToken.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type PayloadTime = {
|
|
2
2
|
readonly start: number;
|
|
3
3
|
readonly finish: number;
|
|
4
4
|
readonly duration: number;
|
|
@@ -6,18 +6,18 @@ export declare type PayloadTime = {
|
|
|
6
6
|
readonly date_start: string;
|
|
7
7
|
readonly date_finish: string;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type GetPayload<P> = {
|
|
10
10
|
readonly result: P;
|
|
11
11
|
readonly time: PayloadTime;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type ListPayload<P> = {
|
|
14
14
|
readonly result: readonly P[];
|
|
15
15
|
readonly error?: string;
|
|
16
16
|
readonly total: number;
|
|
17
17
|
readonly next?: number;
|
|
18
18
|
readonly time: PayloadTime;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type BatchPayload<C> = {
|
|
21
21
|
readonly result: {
|
|
22
22
|
readonly result: {
|
|
23
23
|
readonly [P in keyof C]?: C[P];
|
|
@@ -37,4 +37,4 @@ export declare type BatchPayload<C> = {
|
|
|
37
37
|
};
|
|
38
38
|
readonly time: PayloadTime;
|
|
39
39
|
};
|
|
40
|
-
export
|
|
40
|
+
export type Payload<P> = GetPayload<P> | ListPayload<P> | BatchPayload<P>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export type NumberString = string;
|
|
2
|
+
export type ISODate = string;
|
|
3
|
+
export type BoolString = 'Y' | 'N';
|
|
4
|
+
export type GenderString = 'M' | 'F' | '';
|
|
5
|
+
export type Fields = {
|
|
6
6
|
readonly [key: string]: {
|
|
7
7
|
readonly type: string;
|
|
8
8
|
readonly isRequired: boolean;
|
|
@@ -13,10 +13,10 @@ export declare type Fields = {
|
|
|
13
13
|
readonly title: string;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type MultiField = {
|
|
17
17
|
readonly ID: NumberString;
|
|
18
18
|
readonly VALUE_TYPE: string;
|
|
19
19
|
readonly VALUE: string;
|
|
20
20
|
readonly TYPE_ID: string;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type MultiFieldArray = ReadonlyArray<Pick<MultiField, 'VALUE' | 'VALUE_TYPE'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BoolString, ISODate, MultiField, NumberString } from '../common';
|
|
2
|
-
export
|
|
1
|
+
import { BoolString, ISODate, MultiField, NumberString } from '../common.js';
|
|
2
|
+
export type Company = {
|
|
3
3
|
readonly [key: string]: string | boolean | null | readonly MultiField[];
|
|
4
4
|
readonly ID: NumberString;
|
|
5
5
|
readonly COMPANY_TYPE: string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Call } from '../../client/methods/call.js';
|
|
2
|
+
import { List } from '../../client/methods/list.js';
|
|
3
|
+
import { Method, MethodParams } from '../../methods.js';
|
|
4
|
+
type Dependencies = {
|
|
5
|
+
readonly call: Call;
|
|
6
|
+
readonly list: List;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: ({ call, list }: Dependencies) => {
|
|
9
|
+
fields: () => Promise<import("../../payloads.ts").GetPayload<import("../common.ts").Fields>>;
|
|
10
|
+
create: <D extends MethodParams<Method.CRM_COMPANY_ADD>>(fields: D["fields"], params?: D["params"]) => Promise<import("../../payloads.ts").GetPayload<number>>;
|
|
11
|
+
get: (id: string) => Promise<import("../../payloads.ts").GetPayload<import("./entities.ts").Company>>;
|
|
12
|
+
list: (params?: MethodParams<Method.CRM_COMPANY_LIST>) => Promise<import("../../payloads.ts").ListPayload<import("./entities.ts").Company>>;
|
|
13
|
+
update: <D extends MethodParams<Method.CRM_COMPANY_UPDATE>>(id: string, fields: D["fields"], params?: D["params"]) => Promise<import("../../payloads.ts").GetPayload<boolean>>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Method } from "../../methods.js";
|
|
2
|
+
export default (({ call, list })=>({
|
|
3
|
+
fields: ()=>call(Method.CRM_COMPANY_FIELDS, {}),
|
|
4
|
+
create: (fields, params)=>call(Method.CRM_COMPANY_ADD, {
|
|
5
|
+
fields,
|
|
6
|
+
params
|
|
7
|
+
}),
|
|
8
|
+
get: (id)=>call(Method.CRM_COMPANY_GET, {
|
|
9
|
+
id
|
|
10
|
+
}),
|
|
11
|
+
list: (params = {})=>list(Method.CRM_COMPANY_LIST, params),
|
|
12
|
+
update: (id, fields, params)=>call(Method.CRM_COMPANY_UPDATE, {
|
|
13
|
+
id,
|
|
14
|
+
fields,
|
|
15
|
+
params
|
|
16
|
+
})
|
|
17
|
+
}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ListParams, Method } from '../../methods';
|
|
2
|
-
import { GetPayload, ListPayload } from '../../payloads';
|
|
3
|
-
import { Fields } from '../common';
|
|
4
|
-
import { Company } from './entities';
|
|
5
|
-
export
|
|
1
|
+
import { ListParams, Method } from '../../methods.js';
|
|
2
|
+
import { GetPayload, ListPayload } from '../../payloads.js';
|
|
3
|
+
import { Fields } from '../common.js';
|
|
4
|
+
import { Company } from './entities.js';
|
|
5
|
+
export type CompaniesMethods = {
|
|
6
6
|
readonly [Method.CRM_COMPANY_FIELDS]: {
|
|
7
7
|
readonly type: Company;
|
|
8
8
|
readonly payload: GetPayload<Fields>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BoolString, ISODate, MultiFieldArray, NumberString } from '../common';
|
|
2
|
-
export
|
|
1
|
+
import { BoolString, ISODate, MultiFieldArray, NumberString } from '../common.js';
|
|
2
|
+
export type Contact = {
|
|
3
3
|
readonly [key: string]: MultiFieldArray | string | null;
|
|
4
4
|
readonly ID: NumberString;
|
|
5
5
|
readonly POST: string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Call } from '../../client/methods/call.js';
|
|
2
|
+
import { List } from '../../client/methods/list.js';
|
|
3
|
+
import { Method, MethodParams } from '../../methods.js';
|
|
4
|
+
type Dependencies = {
|
|
5
|
+
readonly call: Call;
|
|
6
|
+
readonly list: List;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: ({ call, list }: Dependencies) => {
|
|
9
|
+
fields: () => Promise<import("../../payloads.ts").GetPayload<import("../common.ts").Fields>>;
|
|
10
|
+
create: <D extends MethodParams<Method.CRM_CONTACT_ADD>>(fields: D["fields"], params?: D["params"]) => Promise<import("../../payloads.ts").GetPayload<number>>;
|
|
11
|
+
get: (id: string) => Promise<import("../../payloads.ts").GetPayload<import("./entities.ts").Contact>>;
|
|
12
|
+
list: (params?: MethodParams<Method.CRM_CONTACT_LIST>) => Promise<import("../../payloads.ts").ListPayload<import("./entities.ts").Contact>>;
|
|
13
|
+
update: <D extends MethodParams<Method.CRM_CONTACT_UPDATE>>(id: string, fields: D["fields"], params?: D["params"]) => Promise<import("../../payloads.ts").GetPayload<boolean>>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Method } from "../../methods.js";
|
|
2
|
+
export default (({ call, list })=>({
|
|
3
|
+
fields: ()=>call(Method.CRM_CONTACT_FIELDS, {}),
|
|
4
|
+
create: (fields, params)=>call(Method.CRM_CONTACT_ADD, {
|
|
5
|
+
fields,
|
|
6
|
+
params
|
|
7
|
+
}),
|
|
8
|
+
get: (id)=>call(Method.CRM_CONTACT_GET, {
|
|
9
|
+
id
|
|
10
|
+
}),
|
|
11
|
+
list: (params = {})=>list(Method.CRM_CONTACT_LIST, params),
|
|
12
|
+
update: (id, fields, params)=>call(Method.CRM_CONTACT_UPDATE, {
|
|
13
|
+
id,
|
|
14
|
+
fields,
|
|
15
|
+
params
|
|
16
|
+
})
|
|
17
|
+
}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ListParams, Method } from '../../methods';
|
|
2
|
-
import { GetPayload, ListPayload } from '../../payloads';
|
|
3
|
-
import { Fields } from '../common';
|
|
4
|
-
import { Contact } from './entities';
|
|
5
|
-
export
|
|
1
|
+
import { ListParams, Method } from '../../methods.js';
|
|
2
|
+
import { GetPayload, ListPayload } from '../../payloads.js';
|
|
3
|
+
import { Fields } from '../common.js';
|
|
4
|
+
import { Contact } from './entities.js';
|
|
5
|
+
export type ContactsMethods = {
|
|
6
6
|
readonly [Method.CRM_CONTACT_FIELDS]: {
|
|
7
7
|
readonly type: Contact;
|
|
8
8
|
readonly payload: GetPayload<Fields>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BoolString, ISODate, NumberString } from '../common';
|
|
2
|
-
export
|
|
1
|
+
import { BoolString, ISODate, NumberString } from '../common.js';
|
|
2
|
+
export type Currency = {
|
|
3
3
|
readonly CURRENCY: string;
|
|
4
4
|
readonly AMOUNT_CNT: NumberString;
|
|
5
5
|
readonly AMOUNT: NumberString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BoolString, ISODate, NumberString } from '../common';
|
|
2
|
-
export
|
|
1
|
+
import { BoolString, ISODate, NumberString } from '../common.js';
|
|
2
|
+
export type Deal = {
|
|
3
3
|
readonly [key: string]: string | null;
|
|
4
4
|
readonly ID: NumberString;
|
|
5
5
|
readonly TITLE: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Call } from '../../client/methods/call.js';
|
|
2
|
+
import { List } from '../../client/methods/list.js';
|
|
3
|
+
import { Method, MethodParams } from '../../methods.js';
|
|
4
|
+
type Dependencies = {
|
|
5
|
+
readonly call: Call;
|
|
6
|
+
readonly list: List;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: ({ call, list }: Dependencies) => {
|
|
9
|
+
fields: () => Promise<import("../../payloads.ts").GetPayload<import("../common.ts").Fields>>;
|
|
10
|
+
create: <D extends MethodParams<Method.CRM_DEAL_ADD>>(fields: D["fields"], params?: D["params"]) => Promise<import("../../payloads.ts").GetPayload<number>>;
|
|
11
|
+
get: (id: string) => Promise<import("../../payloads.ts").GetPayload<import("./entities.ts").Deal>>;
|
|
12
|
+
list: (params?: MethodParams<Method.CRM_DEAL_LIST>) => Promise<import("../../payloads.ts").ListPayload<import("./entities.ts").Deal>>;
|
|
13
|
+
update: <D extends MethodParams<Method.CRM_DEAL_UPDATE>>(id: string, fields: D["fields"], params?: D["params"]) => Promise<import("../../payloads.ts").GetPayload<boolean>>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Method } from "../../methods.js";
|
|
2
|
+
export default (({ call, list })=>({
|
|
3
|
+
fields: ()=>call(Method.CRM_DEAL_FIELDS, {}),
|
|
4
|
+
create: (fields, params)=>call(Method.CRM_DEAL_ADD, {
|
|
5
|
+
fields,
|
|
6
|
+
params
|
|
7
|
+
}),
|
|
8
|
+
get: (id)=>call(Method.CRM_DEAL_GET, {
|
|
9
|
+
id
|
|
10
|
+
}),
|
|
11
|
+
list: (params = {})=>list(Method.CRM_DEAL_LIST, params),
|
|
12
|
+
update: (id, fields, params)=>call(Method.CRM_DEAL_UPDATE, {
|
|
13
|
+
id,
|
|
14
|
+
fields,
|
|
15
|
+
params
|
|
16
|
+
})
|
|
17
|
+
}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ListParams, Method } from '../../methods';
|
|
2
|
-
import { GetPayload, ListPayload } from '../../payloads';
|
|
3
|
-
import { Fields } from '../common';
|
|
4
|
-
import { Deal } from './entities';
|
|
5
|
-
export
|
|
1
|
+
import { ListParams, Method } from '../../methods.js';
|
|
2
|
+
import { GetPayload, ListPayload } from '../../payloads.js';
|
|
3
|
+
import { Fields } from '../common.js';
|
|
4
|
+
import { Deal } from './entities.js';
|
|
5
|
+
export type DealsMethods = {
|
|
6
6
|
readonly [Method.CRM_DEAL_FIELDS]: {
|
|
7
7
|
readonly type: Deal;
|
|
8
8
|
readonly payload: GetPayload<Fields>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BoolString, ISODate, NumberString } from '../common';
|
|
2
|
-
export
|
|
1
|
+
import { BoolString, ISODate, NumberString } from '../common.js';
|
|
2
|
+
export type Lead = {
|
|
3
3
|
readonly [key: string]: string | null;
|
|
4
4
|
readonly ID: NumberString;
|
|
5
5
|
readonly TITLE: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Call } from '../../client/methods/call.js';
|
|
2
|
+
import { List } from '../../client/methods/list.js';
|
|
3
|
+
import { Method, MethodParams } from '../../methods.js';
|
|
4
|
+
type Dependencies = {
|
|
5
|
+
readonly call: Call;
|
|
6
|
+
readonly list: List;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: ({ call, list }: Dependencies) => {
|
|
9
|
+
fields: () => Promise<import("../../payloads.ts").GetPayload<import("../common.ts").Fields>>;
|
|
10
|
+
create: <D extends MethodParams<Method.CRM_LEAD_ADD>>(fields: D["fields"], params?: D["params"]) => Promise<import("../../payloads.ts").GetPayload<number>>;
|
|
11
|
+
get: (id: string) => Promise<import("../../payloads.ts").GetPayload<import("./entities.ts").Lead>>;
|
|
12
|
+
list: (params?: MethodParams<Method.CRM_LEAD_LIST>) => Promise<import("../../payloads.ts").ListPayload<import("./entities.ts").Lead>>;
|
|
13
|
+
update: <D extends MethodParams<Method.CRM_LEAD_UPDATE>>(id: string, fields: D["fields"], params?: D["params"]) => Promise<import("../../payloads.ts").GetPayload<boolean>>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Method } from "../../methods.js";
|
|
2
|
+
export default (({ call, list })=>({
|
|
3
|
+
fields: ()=>call(Method.CRM_LEAD_FIELDS, {}),
|
|
4
|
+
create: (fields, params)=>call(Method.CRM_LEAD_ADD, {
|
|
5
|
+
fields,
|
|
6
|
+
params
|
|
7
|
+
}),
|
|
8
|
+
get: (id)=>call(Method.CRM_LEAD_GET, {
|
|
9
|
+
id
|
|
10
|
+
}),
|
|
11
|
+
list: (params = {})=>list(Method.CRM_LEAD_LIST, params),
|
|
12
|
+
update: (id, fields, params)=>call(Method.CRM_LEAD_UPDATE, {
|
|
13
|
+
id,
|
|
14
|
+
fields,
|
|
15
|
+
params
|
|
16
|
+
})
|
|
17
|
+
}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ListParams, Method } from '../../methods';
|
|
2
|
-
import { GetPayload, ListPayload } from '../../payloads';
|
|
3
|
-
import { Fields } from '../common';
|
|
4
|
-
import { Lead } from './entities';
|
|
5
|
-
export
|
|
1
|
+
import { ListParams, Method } from '../../methods.js';
|
|
2
|
+
import { GetPayload, ListPayload } from '../../payloads.js';
|
|
3
|
+
import { Fields } from '../common.js';
|
|
4
|
+
import { Lead } from './entities.js';
|
|
5
|
+
export type LeadsMethods = {
|
|
6
6
|
readonly [Method.CRM_LEAD_FIELDS]: {
|
|
7
7
|
readonly type: Lead;
|
|
8
8
|
readonly payload: GetPayload<Fields>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BoolString, NumberString } from '../common';
|
|
2
|
-
export
|
|
1
|
+
import { BoolString, NumberString } from '../common.js';
|
|
2
|
+
export type Extra = {
|
|
3
3
|
readonly SEMANTICS: string;
|
|
4
4
|
readonly COLOR: string;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type Status = {
|
|
7
7
|
readonly [key: string]: string | Extra | undefined;
|
|
8
8
|
readonly ID: NumberString;
|
|
9
9
|
readonly ENTITY_ID: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Call } from '../../client/methods/call.js';
|
|
2
|
+
import { Method, MethodParams } from '../../methods.js';
|
|
3
|
+
type Dependencies = {
|
|
4
|
+
readonly call: Call;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: ({ call }: Dependencies) => {
|
|
7
|
+
fields: () => Promise<import("../../payloads.ts").GetPayload<import("../common.ts").Fields>>;
|
|
8
|
+
create: (fields: MethodParams<Method.CRM_STATUS_ADD>["fields"]) => Promise<import("../../payloads.ts").GetPayload<number>>;
|
|
9
|
+
delete: (id: string | number, params?: MethodParams<Method.CRM_STATUS_DELETE>["params"]) => Promise<import("../../payloads.ts").GetPayload<boolean>>;
|
|
10
|
+
get: (id: string | number) => Promise<import("../../payloads.ts").GetPayload<import("./entities.ts").Status>>;
|
|
11
|
+
list: (params?: MethodParams<Method.CRM_STATUS_LIST>) => Promise<import("../../payloads.ts").ListPayload<import("./entities.ts").Status>>;
|
|
12
|
+
update: (id: string | number, fields: MethodParams<Method.CRM_STATUS_UPDATE>["fields"]) => Promise<import("../../payloads.ts").GetPayload<boolean>>;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Method } from "../../methods.js";
|
|
2
|
+
export default (({ call })=>({
|
|
3
|
+
fields: ()=>call(Method.CRM_STATUS_FIELDS, {}),
|
|
4
|
+
create: (fields)=>call(Method.CRM_STATUS_ADD, {
|
|
5
|
+
fields
|
|
6
|
+
}),
|
|
7
|
+
delete: (id, params = {})=>call(Method.CRM_STATUS_DELETE, {
|
|
8
|
+
id,
|
|
9
|
+
params
|
|
10
|
+
}),
|
|
11
|
+
get: (id)=>call(Method.CRM_STATUS_GET, {
|
|
12
|
+
id
|
|
13
|
+
}),
|
|
14
|
+
list: (params = {})=>call(Method.CRM_STATUS_LIST, params),
|
|
15
|
+
update: (id, fields)=>call(Method.CRM_STATUS_UPDATE, {
|
|
16
|
+
id,
|
|
17
|
+
fields
|
|
18
|
+
})
|
|
19
|
+
}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Method } from '../../methods';
|
|
2
|
-
import { GetPayload, ListPayload } from '../../payloads';
|
|
3
|
-
import { Fields } from '../common';
|
|
4
|
-
import { Status } from './entities';
|
|
5
|
-
export
|
|
1
|
+
import { Method } from '../../methods.js';
|
|
2
|
+
import { GetPayload, ListPayload } from '../../payloads.js';
|
|
3
|
+
import { Fields } from '../common.js';
|
|
4
|
+
import { Status } from './entities.js';
|
|
5
|
+
export type StatusesMethods = {
|
|
6
6
|
readonly [Method.CRM_STATUS_FIELDS]: {
|
|
7
7
|
readonly type: Status;
|
|
8
8
|
readonly payload: GetPayload<Fields>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GenderString, ISODate, NumberString } from '../common';
|
|
2
|
-
export
|
|
1
|
+
import { GenderString, ISODate, NumberString } from '../common.js';
|
|
2
|
+
export type User = {
|
|
3
3
|
readonly [key: string]: string | boolean | null | readonly number[];
|
|
4
4
|
readonly ID: NumberString;
|
|
5
5
|
readonly ACTIVE: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Call } from '../../client/methods/call.js';
|
|
2
|
+
type Dependencies = {
|
|
3
|
+
readonly call: Call;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: ({ call }: Dependencies) => {
|
|
6
|
+
fields: () => Promise<import("../../payloads.ts").GetPayload<import("./entities.ts").User>>;
|
|
7
|
+
get: (id?: string) => Promise<import("../../payloads.ts").GetPayload<readonly import("./entities.ts").User[]>>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Method } from '../../methods';
|
|
2
|
-
import { GetPayload } from '../../payloads';
|
|
3
|
-
import { User } from './entities';
|
|
4
|
-
export
|
|
1
|
+
import { Method } from '../../methods.js';
|
|
2
|
+
import { GetPayload } from '../../payloads.js';
|
|
3
|
+
import { User } from './entities.js';
|
|
4
|
+
export type UsersMethods = {
|
|
5
5
|
readonly [Method.USER_FIELDS]: {
|
|
6
6
|
readonly type: User;
|
|
7
7
|
readonly payload: GetPayload<User>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Diff<T, U> = T extends U ? never : T;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* It works with `enum` as a `KEY` when matched against dict as `enum` values as a keys,
|
|
4
4
|
* which justifies whole existence of that helper.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type ExtractValue<MAP extends Record<string, unknown>, KEY extends string | number | symbol, MAPKEY extends keyof MAP = KEY extends keyof MAP ? KEY : never> = MAP[MAPKEY];
|
|
@@ -2,5 +2,4 @@
|
|
|
2
2
|
* Extract value from the `MAP` following the `KEY`
|
|
3
3
|
* It works with `enum` as a `KEY` when matched against dict as `enum` values as a keys,
|
|
4
4
|
* which justifies whole existence of that helper.
|
|
5
|
-
*/
|
|
6
|
-
export declare type ExtractValue<MAP extends Record<string, unknown>, KEY extends string | number | symbol, MAPKEY extends keyof MAP = KEY extends keyof MAP ? KEY : never> = MAP[MAPKEY];
|
|
5
|
+
*/ export { };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Because `Array.isArray` itself give a strange result with `any[]`
|
|
2
|
-
export default (x)
|
|
2
|
+
export default ((x)=>Array.isArray(x));
|