@bitrix24/b24jssdk 0.2.0 → 0.2.2
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/dist/commonjs/index.cjs +101 -7
- package/dist/commonjs/index.cjs.map +1 -1
- package/dist/commonjs/index.d.cts +273 -5
- package/dist/commonjs/index.d.mts +273 -5
- package/dist/commonjs/index.d.ts +273 -5
- package/dist/esm/index.d.mts +273 -5
- package/dist/esm/index.d.ts +273 -5
- package/dist/esm/index.mjs +94 -8
- package/dist/esm/index.mjs.map +1 -1
- package/dist/umd/index.js +101 -7
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/index.min.js +16 -16
- package/dist/umd/index.min.js.map +1 -1
- package/package.json +1 -1
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ type ISODate = string;
|
|
|
35
35
|
type BoolString = 'Y' | 'N';
|
|
36
36
|
type GenderString = 'M' | 'F' | '';
|
|
37
37
|
type PlacementViewMode = 'view' | 'edit';
|
|
38
|
+
type TextType = 'text' | 'html';
|
|
38
39
|
type Fields = {
|
|
39
40
|
readonly [key: string]: {
|
|
40
41
|
readonly type: string;
|
|
@@ -294,6 +295,10 @@ declare class TypeManager {
|
|
|
294
295
|
}
|
|
295
296
|
declare const Type: TypeManager;
|
|
296
297
|
|
|
298
|
+
declare function pick<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Pick<Data, Keys>;
|
|
299
|
+
declare function omit<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Omit<Data, Keys>;
|
|
300
|
+
declare function isArrayOfArray<A>(item: A[] | A[][]): item is A[][];
|
|
301
|
+
|
|
297
302
|
/**
|
|
298
303
|
* The `Text` class provides a set of utility methods for working with text data.
|
|
299
304
|
* It includes functions for encoding and decoding HTML entities, generating random strings,
|
|
@@ -835,7 +840,8 @@ declare enum EnumCrmEntityType {
|
|
|
835
840
|
oldInvoice = "CRM_INVOICE",
|
|
836
841
|
invoice = "CRM_SMART_INVOICE",
|
|
837
842
|
quote = "CRM_QUOTE",
|
|
838
|
-
requisite = "CRM_REQUISITE"
|
|
843
|
+
requisite = "CRM_REQUISITE",
|
|
844
|
+
order = "ORDER"
|
|
839
845
|
}
|
|
840
846
|
declare enum EnumCrmEntityTypeId {
|
|
841
847
|
undefined = 0,
|
|
@@ -846,7 +852,266 @@ declare enum EnumCrmEntityTypeId {
|
|
|
846
852
|
oldInvoice = 5,
|
|
847
853
|
invoice = 31,
|
|
848
854
|
quote = 7,
|
|
849
|
-
requisite = 8
|
|
855
|
+
requisite = 8,
|
|
856
|
+
order = 14
|
|
857
|
+
}
|
|
858
|
+
declare enum EnumCrmEntityTypeShort {
|
|
859
|
+
undefined = "?",
|
|
860
|
+
lead = "L",
|
|
861
|
+
deal = "D",
|
|
862
|
+
contact = "C",
|
|
863
|
+
company = "CO",
|
|
864
|
+
oldInvoice = "I",
|
|
865
|
+
invoice = "SI",
|
|
866
|
+
quote = "Q",
|
|
867
|
+
requisite = "RQ",
|
|
868
|
+
order = "O"
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Data Types and Object Structure in the REST API Catalog
|
|
873
|
+
* @link https://apidocs.bitrix24.com/api-reference/catalog/data-types.html
|
|
874
|
+
*/
|
|
875
|
+
declare enum CatalogProductType {
|
|
876
|
+
undefined = 0,
|
|
877
|
+
product = 1,
|
|
878
|
+
service = 7,
|
|
879
|
+
sku = 3,
|
|
880
|
+
skuEmpty = 6,
|
|
881
|
+
offer = 4,
|
|
882
|
+
offerEmpty = 5
|
|
883
|
+
}
|
|
884
|
+
declare enum CatalogProductImageType {
|
|
885
|
+
undefined = "UNDEFINED",
|
|
886
|
+
detail = "DETAIL_PICTURE",
|
|
887
|
+
preview = "PREVIEW_PICTURE",
|
|
888
|
+
morePhoto = "MORE_PHOTO"
|
|
889
|
+
}
|
|
890
|
+
declare enum CatalogRoundingRuleType {
|
|
891
|
+
undefined = 0,
|
|
892
|
+
mathematical = 1,
|
|
893
|
+
roundingUp = 2,
|
|
894
|
+
roundingDown = 4
|
|
895
|
+
}
|
|
896
|
+
interface CatalogCatalog {
|
|
897
|
+
id: number;
|
|
898
|
+
iblockId: number;
|
|
899
|
+
iblockTypeId: string | 'CRM_PRODUCT_CATALOG';
|
|
900
|
+
lid: string;
|
|
901
|
+
name: string;
|
|
902
|
+
productIblockId?: number;
|
|
903
|
+
skuPropertyId?: number;
|
|
904
|
+
subscription?: BoolString;
|
|
905
|
+
vatId: number;
|
|
906
|
+
}
|
|
907
|
+
interface BaseProduct {
|
|
908
|
+
id: number;
|
|
909
|
+
iblockId: number;
|
|
910
|
+
sort: number;
|
|
911
|
+
name: string;
|
|
912
|
+
active: BoolString;
|
|
913
|
+
available: BoolString;
|
|
914
|
+
code: string;
|
|
915
|
+
xmlId: string;
|
|
916
|
+
barcodeMulti: BoolString;
|
|
917
|
+
bundle: BoolString;
|
|
918
|
+
canBuyZero?: BoolString;
|
|
919
|
+
type: number;
|
|
920
|
+
vatId: number;
|
|
921
|
+
vatIncluded: BoolString;
|
|
922
|
+
weight?: number;
|
|
923
|
+
height?: number;
|
|
924
|
+
length?: number;
|
|
925
|
+
width?: number;
|
|
926
|
+
createdBy: number;
|
|
927
|
+
modifiedBy: number;
|
|
928
|
+
dateActiveFrom?: ISODate;
|
|
929
|
+
dateActiveTo?: ISODate;
|
|
930
|
+
dateCreate: ISODate;
|
|
931
|
+
timestampX: ISODate;
|
|
932
|
+
iblockSectionId?: number;
|
|
933
|
+
measure?: number;
|
|
934
|
+
previewText?: string;
|
|
935
|
+
previewTextType?: TextType;
|
|
936
|
+
detailText?: string;
|
|
937
|
+
detailTextType?: TextType;
|
|
938
|
+
previewPicture?: object;
|
|
939
|
+
detailPicture?: object;
|
|
940
|
+
subscribe: 'Y' | 'N' | 'D';
|
|
941
|
+
quantityTrace: 'Y' | 'N' | 'D';
|
|
942
|
+
purchasingCurrency: string;
|
|
943
|
+
purchasingPrice: number;
|
|
944
|
+
quantity: number;
|
|
945
|
+
quantityReserved: number;
|
|
946
|
+
[key: string]: any;
|
|
947
|
+
}
|
|
948
|
+
interface CatalogProduct extends BaseProduct {
|
|
949
|
+
type: CatalogProductType.product;
|
|
950
|
+
}
|
|
951
|
+
interface CatalogProductSku extends BaseProduct {
|
|
952
|
+
type: CatalogProductType.sku | CatalogProductType.skuEmpty;
|
|
953
|
+
}
|
|
954
|
+
interface CatalogProductOffer extends BaseProduct {
|
|
955
|
+
type: CatalogProductType.offer | CatalogProductType.offerEmpty;
|
|
956
|
+
}
|
|
957
|
+
interface CatalogProductService extends Omit<BaseProduct, 'quantityReserved' | 'quantity' | 'purchasingPrice' | 'purchasingCurrency' | 'quantityTrace' | 'subscribe' | 'weight' | 'height' | 'length' | 'width' | 'canBuyZero' | 'barcodeMulti'> {
|
|
958
|
+
type: CatalogProductType.service;
|
|
959
|
+
}
|
|
960
|
+
interface CatalogSection {
|
|
961
|
+
id: number;
|
|
962
|
+
xmlId: string;
|
|
963
|
+
code: string;
|
|
964
|
+
iblockId: number;
|
|
965
|
+
sort: number;
|
|
966
|
+
iblockSectionId: number;
|
|
967
|
+
name: string;
|
|
968
|
+
active: BoolString;
|
|
969
|
+
description: string;
|
|
970
|
+
descriptionType: TextType;
|
|
971
|
+
}
|
|
972
|
+
interface CatalogProductImage {
|
|
973
|
+
id: number;
|
|
974
|
+
name: string;
|
|
975
|
+
productId: number;
|
|
976
|
+
type: typeof CatalogProductImageType[keyof typeof CatalogProductImageType];
|
|
977
|
+
createTime?: ISODate;
|
|
978
|
+
downloadUrl?: string;
|
|
979
|
+
detailUrl?: string;
|
|
980
|
+
}
|
|
981
|
+
interface CatalogStore {
|
|
982
|
+
id: number;
|
|
983
|
+
code: string;
|
|
984
|
+
xmlId: string;
|
|
985
|
+
sort: number;
|
|
986
|
+
address: string;
|
|
987
|
+
title: string;
|
|
988
|
+
active: BoolString;
|
|
989
|
+
description?: string;
|
|
990
|
+
gpsN: number;
|
|
991
|
+
gpsS: number;
|
|
992
|
+
imageId: object;
|
|
993
|
+
dateModify: ISODate;
|
|
994
|
+
dateCreate: ISODate;
|
|
995
|
+
userId: number;
|
|
996
|
+
modifiedBy: number;
|
|
997
|
+
phone: string;
|
|
998
|
+
email: string;
|
|
999
|
+
schedule: string;
|
|
1000
|
+
issuingCenter: BoolString;
|
|
1001
|
+
}
|
|
1002
|
+
interface CatalogMeasure {
|
|
1003
|
+
id: number;
|
|
1004
|
+
code: string;
|
|
1005
|
+
isDefault: BoolString;
|
|
1006
|
+
measureTitle: string;
|
|
1007
|
+
symbol: string;
|
|
1008
|
+
symbolIntl: string;
|
|
1009
|
+
symbolLetterIntl: string;
|
|
1010
|
+
}
|
|
1011
|
+
interface CatalogRatio {
|
|
1012
|
+
id: number;
|
|
1013
|
+
productId: number;
|
|
1014
|
+
ratio: number;
|
|
1015
|
+
isDefault: BoolString;
|
|
1016
|
+
}
|
|
1017
|
+
interface CatalogPriceType {
|
|
1018
|
+
id: number;
|
|
1019
|
+
xmlId: string;
|
|
1020
|
+
sort: number;
|
|
1021
|
+
name: string;
|
|
1022
|
+
base: BoolString;
|
|
1023
|
+
createdBy: number;
|
|
1024
|
+
modifiedBy: number;
|
|
1025
|
+
dateCreate: ISODate;
|
|
1026
|
+
timestampX: ISODate;
|
|
1027
|
+
}
|
|
1028
|
+
interface CatalogVat {
|
|
1029
|
+
id: number;
|
|
1030
|
+
name: string;
|
|
1031
|
+
active: BoolString;
|
|
1032
|
+
rate: number;
|
|
1033
|
+
sort: number;
|
|
1034
|
+
timestampX: ISODate;
|
|
1035
|
+
}
|
|
1036
|
+
interface CatalogPriceTypeLang {
|
|
1037
|
+
id: number;
|
|
1038
|
+
catalogGroupId: number;
|
|
1039
|
+
name: string;
|
|
1040
|
+
lang: string;
|
|
1041
|
+
}
|
|
1042
|
+
interface CatalogLanguage {
|
|
1043
|
+
lid: string;
|
|
1044
|
+
name: string;
|
|
1045
|
+
active: BoolString;
|
|
1046
|
+
}
|
|
1047
|
+
interface CatalogRoundingRule {
|
|
1048
|
+
id: number;
|
|
1049
|
+
catalogGroupId: number;
|
|
1050
|
+
price: number;
|
|
1051
|
+
roundType: typeof CatalogRoundingRuleType[keyof typeof CatalogRoundingRuleType];
|
|
1052
|
+
roundPrecision: number;
|
|
1053
|
+
createdBy: number;
|
|
1054
|
+
modifiedBy: number;
|
|
1055
|
+
dateCreate: ISODate;
|
|
1056
|
+
dateModify: ISODate;
|
|
1057
|
+
}
|
|
1058
|
+
interface CatalogExtra {
|
|
1059
|
+
id: number;
|
|
1060
|
+
name: string;
|
|
1061
|
+
percentage: number;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
declare enum ProductRowDiscountTypeId {
|
|
1065
|
+
undefined = 0,
|
|
1066
|
+
absolute = 1,
|
|
1067
|
+
percentage = 2
|
|
1068
|
+
}
|
|
1069
|
+
interface CrmItemProductRow {
|
|
1070
|
+
id: number;
|
|
1071
|
+
ownerId: number;
|
|
1072
|
+
ownerType: typeof EnumCrmEntityTypeShort[keyof typeof EnumCrmEntityTypeShort];
|
|
1073
|
+
productId: number;
|
|
1074
|
+
productName: string;
|
|
1075
|
+
sort: number;
|
|
1076
|
+
price: number;
|
|
1077
|
+
priceAccount: number;
|
|
1078
|
+
priceExclusive: number;
|
|
1079
|
+
priceNetto: number;
|
|
1080
|
+
priceBrutto: number;
|
|
1081
|
+
customized: BoolString;
|
|
1082
|
+
quantity: number;
|
|
1083
|
+
measureCode: string;
|
|
1084
|
+
measureName: string;
|
|
1085
|
+
taxRate: number | null;
|
|
1086
|
+
taxIncluded: BoolString;
|
|
1087
|
+
discountRate: number;
|
|
1088
|
+
discountSum: number;
|
|
1089
|
+
discountTypeId: typeof ProductRowDiscountTypeId[keyof typeof ProductRowDiscountTypeId];
|
|
1090
|
+
xmlId: string;
|
|
1091
|
+
type: typeof CatalogProductType[keyof typeof CatalogProductType];
|
|
1092
|
+
storeId: number;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
interface CrmItemDelivery {
|
|
1096
|
+
id: number;
|
|
1097
|
+
accountNumber: string;
|
|
1098
|
+
deducted: BoolString;
|
|
1099
|
+
dateDeducted?: ISODate;
|
|
1100
|
+
deliveryId: number;
|
|
1101
|
+
deliveryName: string;
|
|
1102
|
+
priceDelivery: number;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
interface CrmItemPayment {
|
|
1106
|
+
id: number;
|
|
1107
|
+
accountNumber: string;
|
|
1108
|
+
paid: BoolString;
|
|
1109
|
+
datePaid?: ISODate;
|
|
1110
|
+
empPaidId?: number;
|
|
1111
|
+
sum: number;
|
|
1112
|
+
currency: string;
|
|
1113
|
+
paySystemId: number;
|
|
1114
|
+
paySystemName: string;
|
|
850
1115
|
}
|
|
851
1116
|
|
|
852
1117
|
/**
|
|
@@ -1785,11 +2050,13 @@ declare class AppFrame {
|
|
|
1785
2050
|
* Parent Window Request Parameters
|
|
1786
2051
|
* @prop isSafely auto completion mode Promise.resolve()
|
|
1787
2052
|
* @prop safelyTime after what time (900 ms) should it be automatically resolved Promise
|
|
2053
|
+
* @prop callBack for placement event
|
|
1788
2054
|
*/
|
|
1789
2055
|
interface SendParams {
|
|
1790
2056
|
[index: string]: any;
|
|
1791
2057
|
isSafely?: boolean;
|
|
1792
2058
|
safelyTime?: number;
|
|
2059
|
+
callBack?: (...args: any[]) => void;
|
|
1793
2060
|
}
|
|
1794
2061
|
/**
|
|
1795
2062
|
* Parent Window Communication Manager at B24
|
|
@@ -1797,7 +2064,7 @@ interface SendParams {
|
|
|
1797
2064
|
declare class MessageManager {
|
|
1798
2065
|
#private;
|
|
1799
2066
|
protected _logger: null | LoggerBrowser;
|
|
1800
|
-
private runCallbackHandler;
|
|
2067
|
+
private readonly runCallbackHandler;
|
|
1801
2068
|
constructor(appFrame: AppFrame);
|
|
1802
2069
|
setLogger(logger: LoggerBrowser): void;
|
|
1803
2070
|
getLogger(): LoggerBrowser;
|
|
@@ -2223,11 +2490,12 @@ declare class PlacementManager {
|
|
|
2223
2490
|
/**
|
|
2224
2491
|
* Set Up the Interface Event Handler
|
|
2225
2492
|
* @param {string} eventName
|
|
2493
|
+
* @param {(...args: any[]) => void} callBack
|
|
2226
2494
|
* @return {Promise<any>}
|
|
2227
2495
|
*
|
|
2228
2496
|
* @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-bind-event.html
|
|
2229
2497
|
*/
|
|
2230
|
-
bindEvent(eventName: string): Promise<any>;
|
|
2498
|
+
bindEvent(eventName: string, callBack: (...args: any[]) => void): Promise<any>;
|
|
2231
2499
|
/**
|
|
2232
2500
|
* Call the Registered Interface Command
|
|
2233
2501
|
* @param {string} command
|
|
@@ -2929,4 +3197,4 @@ declare class PullClient implements ConnectorParent {
|
|
|
2929
3197
|
|
|
2930
3198
|
declare function initializeB24Frame(): Promise<B24Frame>;
|
|
2931
3199
|
|
|
2932
|
-
export { AbstractB24, AjaxError, type AjaxErrorParams, type AjaxQuery, AjaxResult, type AjaxResultParams, type AnswerError, AppFrame, type AuthActions, type AuthData, AuthHookManager, AuthManager, B24Frame, type B24FrameQueryParams, B24Hook, type B24HookParams, B24LangList, PullClient as B24PullClientManager, type BatchPayload, type BoolString, Browser, CloseReasons, type CommandHandlerFunctionV1, type CommandHandlerFunctionV2, ConnectionType, type ConnectorCallbacks, type ConnectorConfig, type ConnectorParent, type Currency, type CurrencyFormat, DataType, DialogManager, EnumAppStatus, EnumCrmEntityType, EnumCrmEntityTypeId, type Fields, type GenderString, type GetPayload, type IPlacementUF, type IRequestIdGenerator, type IResult, type ISODate, type JsonRpcRequest, type ListPayload, ListRpcError, LoadDataType, LoggerBrowser, LoggerType, LsKeys, MessageCommands, type MessageInitData, MessageManager, type MultiField, type MultiFieldArray, type NumberString, OptionsManager$1 as OptionsManager, ParentManager, type Payload, type PayloadTime, PlacementManager, type PlacementViewMode, PullStatus, type RefreshAuthData, RestrictionManagerParamsBase, RestrictionManagerParamsForEnterprise, Result, type RpcCommand, type RpcCommandResult, type RpcError, RpcMethod, type RpcRequest, type SelectCRMParams, type SelectCRMParamsEntityType, type SelectCRMParamsValue, type SelectedAccess, type SelectedCRM, type SelectedCRMEntity, type SelectedUser, type SendParams, SenderType, ServerMode, type SharedConfigCallbacks, type SharedConfigParams, SliderManager, type StatusClose, StatusDescriptions, type StorageManagerParams, SubscriptionType, SystemCommands, Text, Type, type TypeApp, type TypeB24, type TypeB24Form, type TypeChanel, type TypeChannelManagerParams, type TypeConnector, type TypeDescriptionError, type TypeEnumAppStatus, type TypeHttp, type TypeJsonRpcConfig, type TypeLicense, TypeOption, type TypePayment, type TypePublicIdDescriptor, type TypePullClientConfig, type TypePullClientEmitConfig, type TypePullClientMessageBatch, type TypePullClientMessageBody, type TypePullClientParams, type TypePullClientSession, type TypePullMessage, type TypeRestrictionManagerParams, type TypeRpcResponseAwaiters, type TypeSessionEvent, TypeSpecificUrl, type TypeStorageManager, type TypeSubscriptionCommandHandler, type TypeSubscriptionOptions, type TypeUser, type UserBasic, type UserBrief, type UserFieldType, type UserStatusCallback, initializeB24Frame, useB24Helper, useFormatter };
|
|
3200
|
+
export { AbstractB24, AjaxError, type AjaxErrorParams, type AjaxQuery, AjaxResult, type AjaxResultParams, type AnswerError, AppFrame, type AuthActions, type AuthData, AuthHookManager, AuthManager, B24Frame, type B24FrameQueryParams, B24Hook, type B24HookParams, B24LangList, PullClient as B24PullClientManager, type BatchPayload, type BoolString, Browser, type CatalogCatalog, type CatalogExtra, type CatalogLanguage, type CatalogMeasure, type CatalogPriceType, type CatalogPriceTypeLang, type CatalogProduct, type CatalogProductImage, CatalogProductImageType, type CatalogProductOffer, type CatalogProductService, type CatalogProductSku, CatalogProductType, type CatalogRatio, type CatalogRoundingRule, CatalogRoundingRuleType, type CatalogSection, type CatalogStore, type CatalogVat, CloseReasons, type CommandHandlerFunctionV1, type CommandHandlerFunctionV2, ConnectionType, type ConnectorCallbacks, type ConnectorConfig, type ConnectorParent, type CrmItemDelivery, type CrmItemPayment, type CrmItemProductRow, type Currency, type CurrencyFormat, DataType, DialogManager, EnumAppStatus, EnumCrmEntityType, EnumCrmEntityTypeId, EnumCrmEntityTypeShort, type Fields, type GenderString, type GetPayload, type IPlacementUF, type IRequestIdGenerator, type IResult, type ISODate, type JsonRpcRequest, type ListPayload, ListRpcError, LoadDataType, LoggerBrowser, LoggerType, LsKeys, MessageCommands, type MessageInitData, MessageManager, type MultiField, type MultiFieldArray, type NumberString, OptionsManager$1 as OptionsManager, ParentManager, type Payload, type PayloadTime, PlacementManager, type PlacementViewMode, ProductRowDiscountTypeId, PullStatus, type RefreshAuthData, RestrictionManagerParamsBase, RestrictionManagerParamsForEnterprise, Result, type RpcCommand, type RpcCommandResult, type RpcError, RpcMethod, type RpcRequest, type SelectCRMParams, type SelectCRMParamsEntityType, type SelectCRMParamsValue, type SelectedAccess, type SelectedCRM, type SelectedCRMEntity, type SelectedUser, type SendParams, SenderType, ServerMode, type SharedConfigCallbacks, type SharedConfigParams, SliderManager, type StatusClose, StatusDescriptions, type StorageManagerParams, SubscriptionType, SystemCommands, Text, type TextType, Type, type TypeApp, type TypeB24, type TypeB24Form, type TypeChanel, type TypeChannelManagerParams, type TypeConnector, type TypeDescriptionError, type TypeEnumAppStatus, type TypeHttp, type TypeJsonRpcConfig, type TypeLicense, TypeOption, type TypePayment, type TypePublicIdDescriptor, type TypePullClientConfig, type TypePullClientEmitConfig, type TypePullClientMessageBatch, type TypePullClientMessageBody, type TypePullClientParams, type TypePullClientSession, type TypePullMessage, type TypeRestrictionManagerParams, type TypeRpcResponseAwaiters, type TypeSessionEvent, TypeSpecificUrl, type TypeStorageManager, type TypeSubscriptionCommandHandler, type TypeSubscriptionOptions, type TypeUser, type UserBasic, type UserBrief, type UserFieldType, type UserStatusCallback, initializeB24Frame, isArrayOfArray, omit, pick, useB24Helper, useFormatter };
|
package/dist/esm/index.d.mts
CHANGED
|
@@ -35,6 +35,7 @@ type ISODate = string;
|
|
|
35
35
|
type BoolString = 'Y' | 'N';
|
|
36
36
|
type GenderString = 'M' | 'F' | '';
|
|
37
37
|
type PlacementViewMode = 'view' | 'edit';
|
|
38
|
+
type TextType = 'text' | 'html';
|
|
38
39
|
type Fields = {
|
|
39
40
|
readonly [key: string]: {
|
|
40
41
|
readonly type: string;
|
|
@@ -294,6 +295,10 @@ declare class TypeManager {
|
|
|
294
295
|
}
|
|
295
296
|
declare const Type: TypeManager;
|
|
296
297
|
|
|
298
|
+
declare function pick<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Pick<Data, Keys>;
|
|
299
|
+
declare function omit<Data extends object, Keys extends keyof Data>(data: Data, keys: Keys[]): Omit<Data, Keys>;
|
|
300
|
+
declare function isArrayOfArray<A>(item: A[] | A[][]): item is A[][];
|
|
301
|
+
|
|
297
302
|
/**
|
|
298
303
|
* The `Text` class provides a set of utility methods for working with text data.
|
|
299
304
|
* It includes functions for encoding and decoding HTML entities, generating random strings,
|
|
@@ -835,7 +840,8 @@ declare enum EnumCrmEntityType {
|
|
|
835
840
|
oldInvoice = "CRM_INVOICE",
|
|
836
841
|
invoice = "CRM_SMART_INVOICE",
|
|
837
842
|
quote = "CRM_QUOTE",
|
|
838
|
-
requisite = "CRM_REQUISITE"
|
|
843
|
+
requisite = "CRM_REQUISITE",
|
|
844
|
+
order = "ORDER"
|
|
839
845
|
}
|
|
840
846
|
declare enum EnumCrmEntityTypeId {
|
|
841
847
|
undefined = 0,
|
|
@@ -846,7 +852,266 @@ declare enum EnumCrmEntityTypeId {
|
|
|
846
852
|
oldInvoice = 5,
|
|
847
853
|
invoice = 31,
|
|
848
854
|
quote = 7,
|
|
849
|
-
requisite = 8
|
|
855
|
+
requisite = 8,
|
|
856
|
+
order = 14
|
|
857
|
+
}
|
|
858
|
+
declare enum EnumCrmEntityTypeShort {
|
|
859
|
+
undefined = "?",
|
|
860
|
+
lead = "L",
|
|
861
|
+
deal = "D",
|
|
862
|
+
contact = "C",
|
|
863
|
+
company = "CO",
|
|
864
|
+
oldInvoice = "I",
|
|
865
|
+
invoice = "SI",
|
|
866
|
+
quote = "Q",
|
|
867
|
+
requisite = "RQ",
|
|
868
|
+
order = "O"
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Data Types and Object Structure in the REST API Catalog
|
|
873
|
+
* @link https://apidocs.bitrix24.com/api-reference/catalog/data-types.html
|
|
874
|
+
*/
|
|
875
|
+
declare enum CatalogProductType {
|
|
876
|
+
undefined = 0,
|
|
877
|
+
product = 1,
|
|
878
|
+
service = 7,
|
|
879
|
+
sku = 3,
|
|
880
|
+
skuEmpty = 6,
|
|
881
|
+
offer = 4,
|
|
882
|
+
offerEmpty = 5
|
|
883
|
+
}
|
|
884
|
+
declare enum CatalogProductImageType {
|
|
885
|
+
undefined = "UNDEFINED",
|
|
886
|
+
detail = "DETAIL_PICTURE",
|
|
887
|
+
preview = "PREVIEW_PICTURE",
|
|
888
|
+
morePhoto = "MORE_PHOTO"
|
|
889
|
+
}
|
|
890
|
+
declare enum CatalogRoundingRuleType {
|
|
891
|
+
undefined = 0,
|
|
892
|
+
mathematical = 1,
|
|
893
|
+
roundingUp = 2,
|
|
894
|
+
roundingDown = 4
|
|
895
|
+
}
|
|
896
|
+
interface CatalogCatalog {
|
|
897
|
+
id: number;
|
|
898
|
+
iblockId: number;
|
|
899
|
+
iblockTypeId: string | 'CRM_PRODUCT_CATALOG';
|
|
900
|
+
lid: string;
|
|
901
|
+
name: string;
|
|
902
|
+
productIblockId?: number;
|
|
903
|
+
skuPropertyId?: number;
|
|
904
|
+
subscription?: BoolString;
|
|
905
|
+
vatId: number;
|
|
906
|
+
}
|
|
907
|
+
interface BaseProduct {
|
|
908
|
+
id: number;
|
|
909
|
+
iblockId: number;
|
|
910
|
+
sort: number;
|
|
911
|
+
name: string;
|
|
912
|
+
active: BoolString;
|
|
913
|
+
available: BoolString;
|
|
914
|
+
code: string;
|
|
915
|
+
xmlId: string;
|
|
916
|
+
barcodeMulti: BoolString;
|
|
917
|
+
bundle: BoolString;
|
|
918
|
+
canBuyZero?: BoolString;
|
|
919
|
+
type: number;
|
|
920
|
+
vatId: number;
|
|
921
|
+
vatIncluded: BoolString;
|
|
922
|
+
weight?: number;
|
|
923
|
+
height?: number;
|
|
924
|
+
length?: number;
|
|
925
|
+
width?: number;
|
|
926
|
+
createdBy: number;
|
|
927
|
+
modifiedBy: number;
|
|
928
|
+
dateActiveFrom?: ISODate;
|
|
929
|
+
dateActiveTo?: ISODate;
|
|
930
|
+
dateCreate: ISODate;
|
|
931
|
+
timestampX: ISODate;
|
|
932
|
+
iblockSectionId?: number;
|
|
933
|
+
measure?: number;
|
|
934
|
+
previewText?: string;
|
|
935
|
+
previewTextType?: TextType;
|
|
936
|
+
detailText?: string;
|
|
937
|
+
detailTextType?: TextType;
|
|
938
|
+
previewPicture?: object;
|
|
939
|
+
detailPicture?: object;
|
|
940
|
+
subscribe: 'Y' | 'N' | 'D';
|
|
941
|
+
quantityTrace: 'Y' | 'N' | 'D';
|
|
942
|
+
purchasingCurrency: string;
|
|
943
|
+
purchasingPrice: number;
|
|
944
|
+
quantity: number;
|
|
945
|
+
quantityReserved: number;
|
|
946
|
+
[key: string]: any;
|
|
947
|
+
}
|
|
948
|
+
interface CatalogProduct extends BaseProduct {
|
|
949
|
+
type: CatalogProductType.product;
|
|
950
|
+
}
|
|
951
|
+
interface CatalogProductSku extends BaseProduct {
|
|
952
|
+
type: CatalogProductType.sku | CatalogProductType.skuEmpty;
|
|
953
|
+
}
|
|
954
|
+
interface CatalogProductOffer extends BaseProduct {
|
|
955
|
+
type: CatalogProductType.offer | CatalogProductType.offerEmpty;
|
|
956
|
+
}
|
|
957
|
+
interface CatalogProductService extends Omit<BaseProduct, 'quantityReserved' | 'quantity' | 'purchasingPrice' | 'purchasingCurrency' | 'quantityTrace' | 'subscribe' | 'weight' | 'height' | 'length' | 'width' | 'canBuyZero' | 'barcodeMulti'> {
|
|
958
|
+
type: CatalogProductType.service;
|
|
959
|
+
}
|
|
960
|
+
interface CatalogSection {
|
|
961
|
+
id: number;
|
|
962
|
+
xmlId: string;
|
|
963
|
+
code: string;
|
|
964
|
+
iblockId: number;
|
|
965
|
+
sort: number;
|
|
966
|
+
iblockSectionId: number;
|
|
967
|
+
name: string;
|
|
968
|
+
active: BoolString;
|
|
969
|
+
description: string;
|
|
970
|
+
descriptionType: TextType;
|
|
971
|
+
}
|
|
972
|
+
interface CatalogProductImage {
|
|
973
|
+
id: number;
|
|
974
|
+
name: string;
|
|
975
|
+
productId: number;
|
|
976
|
+
type: typeof CatalogProductImageType[keyof typeof CatalogProductImageType];
|
|
977
|
+
createTime?: ISODate;
|
|
978
|
+
downloadUrl?: string;
|
|
979
|
+
detailUrl?: string;
|
|
980
|
+
}
|
|
981
|
+
interface CatalogStore {
|
|
982
|
+
id: number;
|
|
983
|
+
code: string;
|
|
984
|
+
xmlId: string;
|
|
985
|
+
sort: number;
|
|
986
|
+
address: string;
|
|
987
|
+
title: string;
|
|
988
|
+
active: BoolString;
|
|
989
|
+
description?: string;
|
|
990
|
+
gpsN: number;
|
|
991
|
+
gpsS: number;
|
|
992
|
+
imageId: object;
|
|
993
|
+
dateModify: ISODate;
|
|
994
|
+
dateCreate: ISODate;
|
|
995
|
+
userId: number;
|
|
996
|
+
modifiedBy: number;
|
|
997
|
+
phone: string;
|
|
998
|
+
email: string;
|
|
999
|
+
schedule: string;
|
|
1000
|
+
issuingCenter: BoolString;
|
|
1001
|
+
}
|
|
1002
|
+
interface CatalogMeasure {
|
|
1003
|
+
id: number;
|
|
1004
|
+
code: string;
|
|
1005
|
+
isDefault: BoolString;
|
|
1006
|
+
measureTitle: string;
|
|
1007
|
+
symbol: string;
|
|
1008
|
+
symbolIntl: string;
|
|
1009
|
+
symbolLetterIntl: string;
|
|
1010
|
+
}
|
|
1011
|
+
interface CatalogRatio {
|
|
1012
|
+
id: number;
|
|
1013
|
+
productId: number;
|
|
1014
|
+
ratio: number;
|
|
1015
|
+
isDefault: BoolString;
|
|
1016
|
+
}
|
|
1017
|
+
interface CatalogPriceType {
|
|
1018
|
+
id: number;
|
|
1019
|
+
xmlId: string;
|
|
1020
|
+
sort: number;
|
|
1021
|
+
name: string;
|
|
1022
|
+
base: BoolString;
|
|
1023
|
+
createdBy: number;
|
|
1024
|
+
modifiedBy: number;
|
|
1025
|
+
dateCreate: ISODate;
|
|
1026
|
+
timestampX: ISODate;
|
|
1027
|
+
}
|
|
1028
|
+
interface CatalogVat {
|
|
1029
|
+
id: number;
|
|
1030
|
+
name: string;
|
|
1031
|
+
active: BoolString;
|
|
1032
|
+
rate: number;
|
|
1033
|
+
sort: number;
|
|
1034
|
+
timestampX: ISODate;
|
|
1035
|
+
}
|
|
1036
|
+
interface CatalogPriceTypeLang {
|
|
1037
|
+
id: number;
|
|
1038
|
+
catalogGroupId: number;
|
|
1039
|
+
name: string;
|
|
1040
|
+
lang: string;
|
|
1041
|
+
}
|
|
1042
|
+
interface CatalogLanguage {
|
|
1043
|
+
lid: string;
|
|
1044
|
+
name: string;
|
|
1045
|
+
active: BoolString;
|
|
1046
|
+
}
|
|
1047
|
+
interface CatalogRoundingRule {
|
|
1048
|
+
id: number;
|
|
1049
|
+
catalogGroupId: number;
|
|
1050
|
+
price: number;
|
|
1051
|
+
roundType: typeof CatalogRoundingRuleType[keyof typeof CatalogRoundingRuleType];
|
|
1052
|
+
roundPrecision: number;
|
|
1053
|
+
createdBy: number;
|
|
1054
|
+
modifiedBy: number;
|
|
1055
|
+
dateCreate: ISODate;
|
|
1056
|
+
dateModify: ISODate;
|
|
1057
|
+
}
|
|
1058
|
+
interface CatalogExtra {
|
|
1059
|
+
id: number;
|
|
1060
|
+
name: string;
|
|
1061
|
+
percentage: number;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
declare enum ProductRowDiscountTypeId {
|
|
1065
|
+
undefined = 0,
|
|
1066
|
+
absolute = 1,
|
|
1067
|
+
percentage = 2
|
|
1068
|
+
}
|
|
1069
|
+
interface CrmItemProductRow {
|
|
1070
|
+
id: number;
|
|
1071
|
+
ownerId: number;
|
|
1072
|
+
ownerType: typeof EnumCrmEntityTypeShort[keyof typeof EnumCrmEntityTypeShort];
|
|
1073
|
+
productId: number;
|
|
1074
|
+
productName: string;
|
|
1075
|
+
sort: number;
|
|
1076
|
+
price: number;
|
|
1077
|
+
priceAccount: number;
|
|
1078
|
+
priceExclusive: number;
|
|
1079
|
+
priceNetto: number;
|
|
1080
|
+
priceBrutto: number;
|
|
1081
|
+
customized: BoolString;
|
|
1082
|
+
quantity: number;
|
|
1083
|
+
measureCode: string;
|
|
1084
|
+
measureName: string;
|
|
1085
|
+
taxRate: number | null;
|
|
1086
|
+
taxIncluded: BoolString;
|
|
1087
|
+
discountRate: number;
|
|
1088
|
+
discountSum: number;
|
|
1089
|
+
discountTypeId: typeof ProductRowDiscountTypeId[keyof typeof ProductRowDiscountTypeId];
|
|
1090
|
+
xmlId: string;
|
|
1091
|
+
type: typeof CatalogProductType[keyof typeof CatalogProductType];
|
|
1092
|
+
storeId: number;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
interface CrmItemDelivery {
|
|
1096
|
+
id: number;
|
|
1097
|
+
accountNumber: string;
|
|
1098
|
+
deducted: BoolString;
|
|
1099
|
+
dateDeducted?: ISODate;
|
|
1100
|
+
deliveryId: number;
|
|
1101
|
+
deliveryName: string;
|
|
1102
|
+
priceDelivery: number;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
interface CrmItemPayment {
|
|
1106
|
+
id: number;
|
|
1107
|
+
accountNumber: string;
|
|
1108
|
+
paid: BoolString;
|
|
1109
|
+
datePaid?: ISODate;
|
|
1110
|
+
empPaidId?: number;
|
|
1111
|
+
sum: number;
|
|
1112
|
+
currency: string;
|
|
1113
|
+
paySystemId: number;
|
|
1114
|
+
paySystemName: string;
|
|
850
1115
|
}
|
|
851
1116
|
|
|
852
1117
|
/**
|
|
@@ -1785,11 +2050,13 @@ declare class AppFrame {
|
|
|
1785
2050
|
* Parent Window Request Parameters
|
|
1786
2051
|
* @prop isSafely auto completion mode Promise.resolve()
|
|
1787
2052
|
* @prop safelyTime after what time (900 ms) should it be automatically resolved Promise
|
|
2053
|
+
* @prop callBack for placement event
|
|
1788
2054
|
*/
|
|
1789
2055
|
interface SendParams {
|
|
1790
2056
|
[index: string]: any;
|
|
1791
2057
|
isSafely?: boolean;
|
|
1792
2058
|
safelyTime?: number;
|
|
2059
|
+
callBack?: (...args: any[]) => void;
|
|
1793
2060
|
}
|
|
1794
2061
|
/**
|
|
1795
2062
|
* Parent Window Communication Manager at B24
|
|
@@ -1797,7 +2064,7 @@ interface SendParams {
|
|
|
1797
2064
|
declare class MessageManager {
|
|
1798
2065
|
#private;
|
|
1799
2066
|
protected _logger: null | LoggerBrowser;
|
|
1800
|
-
private runCallbackHandler;
|
|
2067
|
+
private readonly runCallbackHandler;
|
|
1801
2068
|
constructor(appFrame: AppFrame);
|
|
1802
2069
|
setLogger(logger: LoggerBrowser): void;
|
|
1803
2070
|
getLogger(): LoggerBrowser;
|
|
@@ -2223,11 +2490,12 @@ declare class PlacementManager {
|
|
|
2223
2490
|
/**
|
|
2224
2491
|
* Set Up the Interface Event Handler
|
|
2225
2492
|
* @param {string} eventName
|
|
2493
|
+
* @param {(...args: any[]) => void} callBack
|
|
2226
2494
|
* @return {Promise<any>}
|
|
2227
2495
|
*
|
|
2228
2496
|
* @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-bind-event.html
|
|
2229
2497
|
*/
|
|
2230
|
-
bindEvent(eventName: string): Promise<any>;
|
|
2498
|
+
bindEvent(eventName: string, callBack: (...args: any[]) => void): Promise<any>;
|
|
2231
2499
|
/**
|
|
2232
2500
|
* Call the Registered Interface Command
|
|
2233
2501
|
* @param {string} command
|
|
@@ -2929,4 +3197,4 @@ declare class PullClient implements ConnectorParent {
|
|
|
2929
3197
|
|
|
2930
3198
|
declare function initializeB24Frame(): Promise<B24Frame>;
|
|
2931
3199
|
|
|
2932
|
-
export { AbstractB24, AjaxError, type AjaxErrorParams, type AjaxQuery, AjaxResult, type AjaxResultParams, type AnswerError, AppFrame, type AuthActions, type AuthData, AuthHookManager, AuthManager, B24Frame, type B24FrameQueryParams, B24Hook, type B24HookParams, B24LangList, PullClient as B24PullClientManager, type BatchPayload, type BoolString, Browser, CloseReasons, type CommandHandlerFunctionV1, type CommandHandlerFunctionV2, ConnectionType, type ConnectorCallbacks, type ConnectorConfig, type ConnectorParent, type Currency, type CurrencyFormat, DataType, DialogManager, EnumAppStatus, EnumCrmEntityType, EnumCrmEntityTypeId, type Fields, type GenderString, type GetPayload, type IPlacementUF, type IRequestIdGenerator, type IResult, type ISODate, type JsonRpcRequest, type ListPayload, ListRpcError, LoadDataType, LoggerBrowser, LoggerType, LsKeys, MessageCommands, type MessageInitData, MessageManager, type MultiField, type MultiFieldArray, type NumberString, OptionsManager$1 as OptionsManager, ParentManager, type Payload, type PayloadTime, PlacementManager, type PlacementViewMode, PullStatus, type RefreshAuthData, RestrictionManagerParamsBase, RestrictionManagerParamsForEnterprise, Result, type RpcCommand, type RpcCommandResult, type RpcError, RpcMethod, type RpcRequest, type SelectCRMParams, type SelectCRMParamsEntityType, type SelectCRMParamsValue, type SelectedAccess, type SelectedCRM, type SelectedCRMEntity, type SelectedUser, type SendParams, SenderType, ServerMode, type SharedConfigCallbacks, type SharedConfigParams, SliderManager, type StatusClose, StatusDescriptions, type StorageManagerParams, SubscriptionType, SystemCommands, Text, Type, type TypeApp, type TypeB24, type TypeB24Form, type TypeChanel, type TypeChannelManagerParams, type TypeConnector, type TypeDescriptionError, type TypeEnumAppStatus, type TypeHttp, type TypeJsonRpcConfig, type TypeLicense, TypeOption, type TypePayment, type TypePublicIdDescriptor, type TypePullClientConfig, type TypePullClientEmitConfig, type TypePullClientMessageBatch, type TypePullClientMessageBody, type TypePullClientParams, type TypePullClientSession, type TypePullMessage, type TypeRestrictionManagerParams, type TypeRpcResponseAwaiters, type TypeSessionEvent, TypeSpecificUrl, type TypeStorageManager, type TypeSubscriptionCommandHandler, type TypeSubscriptionOptions, type TypeUser, type UserBasic, type UserBrief, type UserFieldType, type UserStatusCallback, initializeB24Frame, useB24Helper, useFormatter };
|
|
3200
|
+
export { AbstractB24, AjaxError, type AjaxErrorParams, type AjaxQuery, AjaxResult, type AjaxResultParams, type AnswerError, AppFrame, type AuthActions, type AuthData, AuthHookManager, AuthManager, B24Frame, type B24FrameQueryParams, B24Hook, type B24HookParams, B24LangList, PullClient as B24PullClientManager, type BatchPayload, type BoolString, Browser, type CatalogCatalog, type CatalogExtra, type CatalogLanguage, type CatalogMeasure, type CatalogPriceType, type CatalogPriceTypeLang, type CatalogProduct, type CatalogProductImage, CatalogProductImageType, type CatalogProductOffer, type CatalogProductService, type CatalogProductSku, CatalogProductType, type CatalogRatio, type CatalogRoundingRule, CatalogRoundingRuleType, type CatalogSection, type CatalogStore, type CatalogVat, CloseReasons, type CommandHandlerFunctionV1, type CommandHandlerFunctionV2, ConnectionType, type ConnectorCallbacks, type ConnectorConfig, type ConnectorParent, type CrmItemDelivery, type CrmItemPayment, type CrmItemProductRow, type Currency, type CurrencyFormat, DataType, DialogManager, EnumAppStatus, EnumCrmEntityType, EnumCrmEntityTypeId, EnumCrmEntityTypeShort, type Fields, type GenderString, type GetPayload, type IPlacementUF, type IRequestIdGenerator, type IResult, type ISODate, type JsonRpcRequest, type ListPayload, ListRpcError, LoadDataType, LoggerBrowser, LoggerType, LsKeys, MessageCommands, type MessageInitData, MessageManager, type MultiField, type MultiFieldArray, type NumberString, OptionsManager$1 as OptionsManager, ParentManager, type Payload, type PayloadTime, PlacementManager, type PlacementViewMode, ProductRowDiscountTypeId, PullStatus, type RefreshAuthData, RestrictionManagerParamsBase, RestrictionManagerParamsForEnterprise, Result, type RpcCommand, type RpcCommandResult, type RpcError, RpcMethod, type RpcRequest, type SelectCRMParams, type SelectCRMParamsEntityType, type SelectCRMParamsValue, type SelectedAccess, type SelectedCRM, type SelectedCRMEntity, type SelectedUser, type SendParams, SenderType, ServerMode, type SharedConfigCallbacks, type SharedConfigParams, SliderManager, type StatusClose, StatusDescriptions, type StorageManagerParams, SubscriptionType, SystemCommands, Text, type TextType, Type, type TypeApp, type TypeB24, type TypeB24Form, type TypeChanel, type TypeChannelManagerParams, type TypeConnector, type TypeDescriptionError, type TypeEnumAppStatus, type TypeHttp, type TypeJsonRpcConfig, type TypeLicense, TypeOption, type TypePayment, type TypePublicIdDescriptor, type TypePullClientConfig, type TypePullClientEmitConfig, type TypePullClientMessageBatch, type TypePullClientMessageBody, type TypePullClientParams, type TypePullClientSession, type TypePullMessage, type TypeRestrictionManagerParams, type TypeRpcResponseAwaiters, type TypeSessionEvent, TypeSpecificUrl, type TypeStorageManager, type TypeSubscriptionCommandHandler, type TypeSubscriptionOptions, type TypeUser, type UserBasic, type UserBrief, type UserFieldType, type UserStatusCallback, initializeB24Frame, isArrayOfArray, omit, pick, useB24Helper, useFormatter };
|