@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
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { BoolString, ISODate, NumberString } from '../common.js';
|
|
2
|
-
export type Lead = {
|
|
3
|
-
readonly [key: string]: string | null;
|
|
4
|
-
readonly ID: NumberString;
|
|
5
|
-
readonly TITLE: string;
|
|
6
|
-
readonly HONORIFIC: string | null;
|
|
7
|
-
readonly NAME: string | null;
|
|
8
|
-
readonly SECOND_NAME: string | null;
|
|
9
|
-
readonly LAST_NAME: string | null;
|
|
10
|
-
readonly COMPANY_TITLE: string | null;
|
|
11
|
-
readonly COMPANY_ID: NumberString | null;
|
|
12
|
-
readonly CONTACT_ID: NumberString | null;
|
|
13
|
-
readonly IS_RETURN_CUSTOMER: BoolString;
|
|
14
|
-
readonly BIRTHDATE: ISODate;
|
|
15
|
-
readonly SOURCE_ID: NumberString;
|
|
16
|
-
readonly SOURCE_DESCRIPTION: string | null;
|
|
17
|
-
readonly STATUS_ID: string;
|
|
18
|
-
readonly STATUS_DESCRIPTION: string | null;
|
|
19
|
-
readonly POST: string | null;
|
|
20
|
-
readonly COMMENTS: string | null;
|
|
21
|
-
readonly CURRENCY_ID: string;
|
|
22
|
-
readonly OPPORTUNITY: NumberString;
|
|
23
|
-
readonly HAS_PHONE: BoolString;
|
|
24
|
-
readonly HAS_EMAIL: BoolString;
|
|
25
|
-
readonly HAS_IMOL: BoolString;
|
|
26
|
-
readonly ASSIGNED_BY_ID: NumberString;
|
|
27
|
-
readonly CREATED_BY_ID: NumberString;
|
|
28
|
-
readonly MODIFY_BY_ID: NumberString;
|
|
29
|
-
readonly DATE_CREATE: ISODate;
|
|
30
|
-
readonly DATE_MODIFY: ISODate;
|
|
31
|
-
readonly DATE_CLOSED: ISODate;
|
|
32
|
-
readonly STATUS_SEMANTIC_ID: string;
|
|
33
|
-
readonly OPENED: BoolString;
|
|
34
|
-
readonly ORIGINATOR_ID: string | null;
|
|
35
|
-
readonly ORIGIN_ID: NumberString | null;
|
|
36
|
-
readonly ADDRESS: string | null;
|
|
37
|
-
readonly ADDRESS_2: string | null;
|
|
38
|
-
readonly ADDRESS_CITY: string | null;
|
|
39
|
-
readonly ADDRESS_POSTAL_CODE: string | null;
|
|
40
|
-
readonly ADDRESS_REGION: string | null;
|
|
41
|
-
readonly ADDRESS_PROVINCE: string | null;
|
|
42
|
-
readonly ADDRESS_COUNTRY: string | null;
|
|
43
|
-
readonly ADDRESS_COUNTRY_CODE: string | null;
|
|
44
|
-
readonly UTM_SOURCE: string | null;
|
|
45
|
-
readonly UTM_MEDIUM: string | null;
|
|
46
|
-
readonly UTM_CAMPAIGN: string | null;
|
|
47
|
-
readonly UTM_CONTENT: string | null;
|
|
48
|
-
readonly UTM_TERM: string | null;
|
|
49
|
-
};
|
|
@@ -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_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;
|
|
@@ -1,17 +0,0 @@
|
|
|
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,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 { Lead } from './entities.js';
|
|
5
|
-
export type LeadsMethods = {
|
|
6
|
-
readonly [Method.CRM_LEAD_FIELDS]: {
|
|
7
|
-
readonly type: Lead;
|
|
8
|
-
readonly payload: GetPayload<Fields>;
|
|
9
|
-
readonly params?: Record<string, unknown>;
|
|
10
|
-
};
|
|
11
|
-
readonly [Method.CRM_LEAD_ADD]: {
|
|
12
|
-
readonly type: Lead;
|
|
13
|
-
readonly payload: GetPayload<number>;
|
|
14
|
-
readonly params: {
|
|
15
|
-
readonly fields: Partial<Lead>;
|
|
16
|
-
readonly params?: {
|
|
17
|
-
readonly REGISTER_SONET_EVENT: 'Y' | 'N';
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
readonly [Method.CRM_LEAD_GET]: {
|
|
22
|
-
readonly type: Lead;
|
|
23
|
-
readonly payload: GetPayload<Lead>;
|
|
24
|
-
readonly params: {
|
|
25
|
-
readonly id: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
readonly [Method.CRM_LEAD_LIST]: {
|
|
29
|
-
readonly type: Lead;
|
|
30
|
-
readonly payload: ListPayload<Lead>;
|
|
31
|
-
readonly params: ListParams;
|
|
32
|
-
};
|
|
33
|
-
readonly [Method.CRM_LEAD_UPDATE]: {
|
|
34
|
-
readonly type: Lead;
|
|
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,16 +0,0 @@
|
|
|
1
|
-
import { BoolString, NumberString } from '../common.js';
|
|
2
|
-
export type Extra = {
|
|
3
|
-
readonly SEMANTICS: string;
|
|
4
|
-
readonly COLOR: string;
|
|
5
|
-
};
|
|
6
|
-
export type Status = {
|
|
7
|
-
readonly [key: string]: string | Extra | undefined;
|
|
8
|
-
readonly ID: NumberString;
|
|
9
|
-
readonly ENTITY_ID: string;
|
|
10
|
-
readonly STATUS_ID: NumberString;
|
|
11
|
-
readonly NAME: string;
|
|
12
|
-
readonly NAME_INIT: string;
|
|
13
|
-
readonly SORT: NumberString;
|
|
14
|
-
readonly SYSTEM: BoolString;
|
|
15
|
-
readonly EXTRA: Extra | undefined;
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
|
@@ -1,19 +0,0 @@
|
|
|
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,51 +0,0 @@
|
|
|
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
|
-
readonly [Method.CRM_STATUS_FIELDS]: {
|
|
7
|
-
readonly type: Status;
|
|
8
|
-
readonly payload: GetPayload<Fields>;
|
|
9
|
-
readonly params?: Record<string, unknown>;
|
|
10
|
-
};
|
|
11
|
-
readonly [Method.CRM_STATUS_ADD]: {
|
|
12
|
-
readonly type: Status;
|
|
13
|
-
readonly payload: GetPayload<number>;
|
|
14
|
-
readonly params: {
|
|
15
|
-
readonly fields: Partial<Status>;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
readonly [Method.CRM_STATUS_DELETE]: {
|
|
19
|
-
readonly type: Status;
|
|
20
|
-
readonly payload: GetPayload<boolean>;
|
|
21
|
-
readonly params: {
|
|
22
|
-
readonly id: string | number;
|
|
23
|
-
readonly params?: {
|
|
24
|
-
readonly FORCED?: 'Y' | 'N';
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
readonly [Method.CRM_STATUS_GET]: {
|
|
29
|
-
readonly type: Status;
|
|
30
|
-
readonly payload: GetPayload<Status>;
|
|
31
|
-
readonly params: {
|
|
32
|
-
readonly id: string | number;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
readonly [Method.CRM_STATUS_LIST]: {
|
|
36
|
-
readonly type: Status;
|
|
37
|
-
readonly payload: ListPayload<Status>;
|
|
38
|
-
readonly params: {
|
|
39
|
-
readonly order?: Record<string, unknown>;
|
|
40
|
-
readonly filter?: Record<string, unknown>;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
readonly [Method.CRM_STATUS_UPDATE]: {
|
|
44
|
-
readonly type: Status;
|
|
45
|
-
readonly payload: GetPayload<boolean>;
|
|
46
|
-
readonly params: {
|
|
47
|
-
readonly id: string | number;
|
|
48
|
-
readonly fields: Record<string, unknown>;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { GenderString, ISODate, NumberString } from '../common.js';
|
|
2
|
-
export type User = {
|
|
3
|
-
readonly [key: string]: string | boolean | null | readonly number[];
|
|
4
|
-
readonly ID: NumberString;
|
|
5
|
-
readonly ACTIVE: boolean;
|
|
6
|
-
readonly EMAIL: string | null;
|
|
7
|
-
readonly NAME: string | null;
|
|
8
|
-
readonly LAST_NAME: string | null;
|
|
9
|
-
readonly SECOND_NAME: string | null;
|
|
10
|
-
readonly PERSONAL_GENDER: GenderString;
|
|
11
|
-
readonly PERSONAL_PROFESSION: string | null;
|
|
12
|
-
readonly PERSONAL_WWW: string | null;
|
|
13
|
-
readonly PERSONAL_BIRTHDAY: ISODate;
|
|
14
|
-
readonly PERSONAL_PHOTO: string | null;
|
|
15
|
-
readonly PERSONAL_ICQ: string | null;
|
|
16
|
-
readonly PERSONAL_PHONE: string | null;
|
|
17
|
-
readonly PERSONAL_FAX: string | null;
|
|
18
|
-
readonly PERSONAL_MOBILE: string | null;
|
|
19
|
-
readonly PERSONAL_PAGER: string | null;
|
|
20
|
-
readonly PERSONAL_STREET: string | null;
|
|
21
|
-
readonly PERSONAL_CITY: string | null;
|
|
22
|
-
readonly PERSONAL_STATE: string | null;
|
|
23
|
-
readonly PERSONAL_ZIP: string | null;
|
|
24
|
-
readonly PERSONAL_COUNTRY: string | null;
|
|
25
|
-
readonly WORK_COMPANY: string | null;
|
|
26
|
-
readonly WORK_POSITION: string | null;
|
|
27
|
-
readonly WORK_PHONE: string | null;
|
|
28
|
-
readonly UF_DEPARTMENT: readonly number[];
|
|
29
|
-
readonly UF_INTERESTS: string | null;
|
|
30
|
-
readonly UF_SKILLS: string | null;
|
|
31
|
-
readonly UF_WEB_SITES: string | null;
|
|
32
|
-
readonly UF_XING: string | null;
|
|
33
|
-
readonly UF_LINKEDIN: string | null;
|
|
34
|
-
readonly UF_FACEBOOK: string | null;
|
|
35
|
-
readonly UF_TWITTER: string | null;
|
|
36
|
-
readonly UF_SKYPE: string | null;
|
|
37
|
-
readonly UF_DISTRICT: string | null;
|
|
38
|
-
readonly UF_PHONE_INNER: NumberString | null;
|
|
39
|
-
readonly USER_TYPE: 'employee';
|
|
40
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1,9 +0,0 @@
|
|
|
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,17 +0,0 @@
|
|
|
1
|
-
import { Method } from '../../methods.js';
|
|
2
|
-
import { GetPayload } from '../../payloads.js';
|
|
3
|
-
import { User } from './entities.js';
|
|
4
|
-
export type UsersMethods = {
|
|
5
|
-
readonly [Method.USER_FIELDS]: {
|
|
6
|
-
readonly type: User;
|
|
7
|
-
readonly payload: GetPayload<User>;
|
|
8
|
-
readonly params?: Record<string, unknown>;
|
|
9
|
-
};
|
|
10
|
-
readonly [Method.USER_GET]: {
|
|
11
|
-
readonly type: User;
|
|
12
|
-
readonly payload: GetPayload<readonly User[]>;
|
|
13
|
-
readonly params: {
|
|
14
|
-
readonly id?: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/build/utils/Diff.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Diff<T, U> = T extends U ? never : T;
|
package/build/utils/Diff.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extract value from the `MAP` following the `KEY`
|
|
3
|
-
* It works with `enum` as a `KEY` when matched against dict as `enum` values as a keys,
|
|
4
|
-
* which justifies whole existence of that helper.
|
|
5
|
-
*/
|
|
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];
|
package/build/utils/isArray.d.ts
DELETED
package/build/utils/isArray.js
DELETED