@2bad/bitrix 3.0.0-beta.0 → 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 +93 -186
- 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 +43 -64
- package/build/bitrix.d.ts +0 -65
- package/build/bitrix.js +0 -55
- package/build/client/hooks/addAccessToken.d.ts +0 -6
- package/build/client/hooks/addAccessToken.js +0 -9
- package/build/client/index.d.ts +0 -15
- package/build/client/index.js +0 -53
- package/build/client/methods/batch.d.ts +0 -40
- package/build/client/methods/batch.js +0 -75
- package/build/client/methods/call.d.ts +0 -17
- package/build/client/methods/call.js +0 -27
- package/build/client/methods/list.d.ts +0 -30
- package/build/client/methods/list.js +0 -58
- package/build/commands.d.ts +0 -10
- package/build/commands.js +0 -1
- package/build/methods.d.ts +0 -92
- package/build/methods.js +0 -38
- package/build/payloads.d.ts +0 -40
- package/build/payloads.js +0 -1
- package/build/services/common.d.ts +0 -22
- package/build/services/common.js +0 -2
- package/build/services/companies/entities.d.ts +0 -54
- package/build/services/companies/entities.js +0 -1
- package/build/services/companies/index.d.ts +0 -15
- package/build/services/companies/index.js +0 -17
- package/build/services/companies/methods.d.ts +0 -44
- package/build/services/companies/methods.js +0 -1
- package/build/services/contacts/entities.d.ts +0 -45
- package/build/services/contacts/entities.js +0 -1
- package/build/services/contacts/index.d.ts +0 -15
- package/build/services/contacts/index.js +0 -17
- package/build/services/contacts/methods.d.ts +0 -44
- package/build/services/contacts/methods.js +0 -1
- package/build/services/currencies/entities.d.ts +0 -15
- package/build/services/currencies/entities.js +0 -1
- package/build/services/deals/entities.d.ts +0 -43
- package/build/services/deals/entities.js +0 -1
- package/build/services/deals/index.d.ts +0 -15
- package/build/services/deals/index.js +0 -17
- package/build/services/deals/methods.d.ts +0 -44
- package/build/services/deals/methods.js +0 -1
- package/build/services/leads/entities.d.ts +0 -49
- package/build/services/leads/entities.js +0 -1
- package/build/services/leads/index.d.ts +0 -15
- package/build/services/leads/index.js +0 -17
- package/build/services/leads/methods.d.ts +0 -44
- package/build/services/leads/methods.js +0 -1
- package/build/services/statuses/entities.d.ts +0 -16
- package/build/services/statuses/entities.js +0 -1
- package/build/services/statuses/index.d.ts +0 -14
- package/build/services/statuses/index.js +0 -19
- package/build/services/statuses/methods.d.ts +0 -51
- package/build/services/statuses/methods.js +0 -1
- package/build/services/users/entities.d.ts +0 -40
- package/build/services/users/entities.js +0 -1
- package/build/services/users/index.d.ts +0 -9
- package/build/services/users/index.js +0 -7
- package/build/services/users/methods.d.ts +0 -17
- package/build/services/users/methods.js +0 -1
- package/build/utils/Diff.d.ts +0 -1
- package/build/utils/Diff.js +0 -7
- package/build/utils/ExtractValue.d.ts +0 -6
- package/build/utils/ExtractValue.js +0 -5
- package/build/utils/isArray.d.ts +0 -2
- package/build/utils/isArray.js +0 -2
package/build/methods.d.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { Commands } from './commands.js';
|
|
2
|
-
import { BatchPayload } from './payloads.js';
|
|
3
|
-
import { CompaniesMethods } from './services/companies/methods.js';
|
|
4
|
-
import { ContactsMethods } from './services/contacts/methods.js';
|
|
5
|
-
import { DealsMethods } from './services/deals/methods.js';
|
|
6
|
-
import { LeadsMethods } from './services/leads/methods.js';
|
|
7
|
-
import { StatusesMethods } from './services/statuses/methods.js';
|
|
8
|
-
import { UsersMethods } from './services/users/methods.js';
|
|
9
|
-
import { Diff } from './utils/Diff.js';
|
|
10
|
-
import { ExtractValue } from './utils/ExtractValue.js';
|
|
11
|
-
export declare enum Method {
|
|
12
|
-
BATCH = "batch",
|
|
13
|
-
CRM_COMPANY_FIELDS = "crm.company.fields",
|
|
14
|
-
CRM_COMPANY_ADD = "crm.company.add",
|
|
15
|
-
CRM_COMPANY_UPDATE = "crm.company.update",
|
|
16
|
-
CRM_COMPANY_GET = "crm.company.get",
|
|
17
|
-
CRM_COMPANY_LIST = "crm.company.list",
|
|
18
|
-
CRM_CONTACT_FIELDS = "crm.contact.fields",
|
|
19
|
-
CRM_CONTACT_ADD = "crm.contact.add",
|
|
20
|
-
CRM_CONTACT_UPDATE = "crm.contact.update",
|
|
21
|
-
CRM_CONTACT_GET = "crm.contact.get",
|
|
22
|
-
CRM_CONTACT_LIST = "crm.contact.list",
|
|
23
|
-
CRM_DEAL_FIELDS = "crm.deal.fields",
|
|
24
|
-
CRM_DEAL_ADD = "crm.deal.add",
|
|
25
|
-
CRM_DEAL_UPDATE = "crm.deal.update",
|
|
26
|
-
CRM_DEAL_GET = "crm.deal.get",
|
|
27
|
-
CRM_DEAL_LIST = "crm.deal.list",
|
|
28
|
-
CRM_LEAD_FIELDS = "crm.lead.fields",
|
|
29
|
-
CRM_LEAD_ADD = "crm.lead.add",
|
|
30
|
-
CRM_LEAD_UPDATE = "crm.lead.update",
|
|
31
|
-
CRM_LEAD_GET = "crm.lead.get",
|
|
32
|
-
CRM_LEAD_LIST = "crm.lead.list",
|
|
33
|
-
CRM_STATUS_FIELDS = "crm.status.fields",
|
|
34
|
-
CRM_STATUS_ADD = "crm.status.add",
|
|
35
|
-
CRM_STATUS_DELETE = "crm.status.delete",
|
|
36
|
-
CRM_STATUS_GET = "crm.status.get",
|
|
37
|
-
CRM_STATUS_LIST = "crm.status.list",
|
|
38
|
-
CRM_STATUS_UPDATE = "crm.status.update",
|
|
39
|
-
USER_FIELDS = "user.fields",
|
|
40
|
-
USER_GET = "user.get"
|
|
41
|
-
}
|
|
42
|
-
declare const LISTABLE_METHODS: readonly [Method.CRM_COMPANY_LIST, Method.CRM_CONTACT_LIST, Method.CRM_DEAL_LIST, Method.CRM_LEAD_LIST];
|
|
43
|
-
export type ListableMethod = typeof LISTABLE_METHODS[number];
|
|
44
|
-
export type GettableMethod = Diff<Method, ListableMethod>;
|
|
45
|
-
type MethodsMap = {
|
|
46
|
-
readonly [key: string]: {
|
|
47
|
-
readonly type: unknown;
|
|
48
|
-
readonly payload: unknown;
|
|
49
|
-
readonly params: Record<string, unknown>;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
export type ListParams = {
|
|
53
|
-
readonly start?: number;
|
|
54
|
-
readonly order?: {
|
|
55
|
-
readonly [key: string]: string;
|
|
56
|
-
};
|
|
57
|
-
readonly filter?: {
|
|
58
|
-
readonly [key: string]: string | number;
|
|
59
|
-
};
|
|
60
|
-
readonly select?: readonly string[];
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* A mega map of all supported Bitrix methods to their parameters. Used to resolve
|
|
64
|
-
* low-level client method required params and payload types.
|
|
65
|
-
* - `type` — a type that method associated with
|
|
66
|
-
* - `payload` — a payload that method returns
|
|
67
|
-
* - `params` — params that method accepts
|
|
68
|
-
*/
|
|
69
|
-
export type Methods = MethodsMap & CompaniesMethods & ContactsMethods & DealsMethods & LeadsMethods & StatusesMethods & UsersMethods & {
|
|
70
|
-
readonly [Method.BATCH]: {
|
|
71
|
-
readonly type: unknown;
|
|
72
|
-
readonly payload: BatchPayload<unknown>;
|
|
73
|
-
readonly params: Commands;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Retrieve specified method data
|
|
78
|
-
*/
|
|
79
|
-
export type MethodData<M extends Method> = ExtractValue<Methods, M>;
|
|
80
|
-
/**
|
|
81
|
-
* Retrieve associated with specified method type
|
|
82
|
-
*/
|
|
83
|
-
export type MethodPayloadType<M extends Method> = MethodData<M>['type'];
|
|
84
|
-
/**
|
|
85
|
-
* Retrieve specified method payload type
|
|
86
|
-
*/
|
|
87
|
-
export type MethodPayload<M extends Method> = MethodData<M>['payload'];
|
|
88
|
-
/**
|
|
89
|
-
* Retrieve specified method params
|
|
90
|
-
*/
|
|
91
|
-
export type MethodParams<M extends Method> = MethodData<M>['params'];
|
|
92
|
-
export {};
|
package/build/methods.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export var Method;
|
|
2
|
-
(function(Method) {
|
|
3
|
-
Method["BATCH"] = "batch";
|
|
4
|
-
Method["CRM_COMPANY_FIELDS"] = "crm.company.fields";
|
|
5
|
-
Method["CRM_COMPANY_ADD"] = "crm.company.add";
|
|
6
|
-
Method["CRM_COMPANY_UPDATE"] = "crm.company.update";
|
|
7
|
-
Method["CRM_COMPANY_GET"] = "crm.company.get";
|
|
8
|
-
Method["CRM_COMPANY_LIST"] = "crm.company.list";
|
|
9
|
-
Method["CRM_CONTACT_FIELDS"] = "crm.contact.fields";
|
|
10
|
-
Method["CRM_CONTACT_ADD"] = "crm.contact.add";
|
|
11
|
-
Method["CRM_CONTACT_UPDATE"] = "crm.contact.update";
|
|
12
|
-
Method["CRM_CONTACT_GET"] = "crm.contact.get";
|
|
13
|
-
Method["CRM_CONTACT_LIST"] = "crm.contact.list";
|
|
14
|
-
Method["CRM_DEAL_FIELDS"] = "crm.deal.fields";
|
|
15
|
-
Method["CRM_DEAL_ADD"] = "crm.deal.add";
|
|
16
|
-
Method["CRM_DEAL_UPDATE"] = "crm.deal.update";
|
|
17
|
-
Method["CRM_DEAL_GET"] = "crm.deal.get";
|
|
18
|
-
Method["CRM_DEAL_LIST"] = "crm.deal.list";
|
|
19
|
-
Method["CRM_LEAD_FIELDS"] = "crm.lead.fields";
|
|
20
|
-
Method["CRM_LEAD_ADD"] = "crm.lead.add";
|
|
21
|
-
Method["CRM_LEAD_UPDATE"] = "crm.lead.update";
|
|
22
|
-
Method["CRM_LEAD_GET"] = "crm.lead.get";
|
|
23
|
-
Method["CRM_LEAD_LIST"] = "crm.lead.list";
|
|
24
|
-
Method["CRM_STATUS_FIELDS"] = "crm.status.fields";
|
|
25
|
-
Method["CRM_STATUS_ADD"] = "crm.status.add";
|
|
26
|
-
Method["CRM_STATUS_DELETE"] = "crm.status.delete";
|
|
27
|
-
Method["CRM_STATUS_GET"] = "crm.status.get";
|
|
28
|
-
Method["CRM_STATUS_LIST"] = "crm.status.list";
|
|
29
|
-
Method["CRM_STATUS_UPDATE"] = "crm.status.update";
|
|
30
|
-
Method["USER_FIELDS"] = "user.fields";
|
|
31
|
-
Method["USER_GET"] = "user.get";
|
|
32
|
-
})(Method || (Method = {}));
|
|
33
|
-
const LISTABLE_METHODS = [
|
|
34
|
-
"crm.company.list",
|
|
35
|
-
"crm.contact.list",
|
|
36
|
-
"crm.deal.list",
|
|
37
|
-
"crm.lead.list"
|
|
38
|
-
];
|
package/build/payloads.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export 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 type GetPayload<P> = {
|
|
10
|
-
readonly result: P;
|
|
11
|
-
readonly time: PayloadTime;
|
|
12
|
-
};
|
|
13
|
-
export 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 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 type Payload<P> = GetPayload<P> | ListPayload<P> | BatchPayload<P>;
|
package/build/payloads.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
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 type MultiField = {
|
|
17
|
-
readonly ID: NumberString;
|
|
18
|
-
readonly VALUE_TYPE: string;
|
|
19
|
-
readonly VALUE: string;
|
|
20
|
-
readonly TYPE_ID: string;
|
|
21
|
-
};
|
|
22
|
-
export type MultiFieldArray = ReadonlyArray<Pick<MultiField, 'VALUE' | 'VALUE_TYPE'>>;
|
package/build/services/common.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { BoolString, ISODate, MultiField, NumberString } from '../common.js';
|
|
2
|
-
export 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,15 +0,0 @@
|
|
|
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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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,44 +0,0 @@
|
|
|
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
|
-
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
|
-
export { };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { BoolString, ISODate, MultiFieldArray, NumberString } from '../common.js';
|
|
2
|
-
export 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,15 +0,0 @@
|
|
|
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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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,44 +0,0 @@
|
|
|
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
|
-
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
|
-
export { };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BoolString, ISODate, NumberString } from '../common.js';
|
|
2
|
-
export 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.js';
|
|
2
|
-
export 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,15 +0,0 @@
|
|
|
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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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,44 +0,0 @@
|
|
|
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
|
-
readonly [Method.CRM_DEAL_FIELDS]: {
|
|
7
|
-
readonly type: Deal;
|
|
8
|
-
readonly payload: GetPayload<Fields>;
|
|
9
|
-
readonly params?: Record<string, unknown>;
|
|
10
|
-
};
|
|
11
|
-
readonly [Method.CRM_DEAL_ADD]: {
|
|
12
|
-
readonly type: Deal;
|
|
13
|
-
readonly payload: GetPayload<number>;
|
|
14
|
-
readonly params: {
|
|
15
|
-
readonly fields: Partial<Deal>;
|
|
16
|
-
readonly params?: {
|
|
17
|
-
readonly REGISTER_SONET_EVENT: 'Y' | 'N';
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
readonly [Method.CRM_DEAL_GET]: {
|
|
22
|
-
readonly type: Deal;
|
|
23
|
-
readonly payload: GetPayload<Deal>;
|
|
24
|
-
readonly params: {
|
|
25
|
-
readonly id: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
readonly [Method.CRM_DEAL_LIST]: {
|
|
29
|
-
readonly type: Deal;
|
|
30
|
-
readonly payload: ListPayload<Deal>;
|
|
31
|
-
readonly params: ListParams;
|
|
32
|
-
};
|
|
33
|
-
readonly [Method.CRM_DEAL_UPDATE]: {
|
|
34
|
-
readonly type: Deal;
|
|
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
|
-
export { };
|