@bitrix24/b24jssdk 0.2.1 → 0.2.3
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 +96 -7
- package/dist/commonjs/index.cjs.map +1 -1
- package/dist/commonjs/index.d.cts +273 -3
- package/dist/commonjs/index.d.mts +273 -3
- package/dist/commonjs/index.d.ts +273 -3
- package/dist/esm/index.d.mts +273 -3
- package/dist/esm/index.d.ts +273 -3
- package/dist/esm/index.mjs +92 -8
- package/dist/esm/index.mjs.map +1 -1
- package/dist/umd/index.js +96 -7
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/index.min.js +17 -17
- package/dist/umd/index.min.js.map +1 -1
- package/package.json +1 -1
package/dist/commonjs/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @version @bitrix24/b24jssdk v0.2.
|
|
2
|
+
* @version @bitrix24/b24jssdk v0.2.3
|
|
3
3
|
* @copyright (c) 2025 Bitrix24
|
|
4
4
|
* @licence MIT
|
|
5
5
|
* @links https://github.com/bitrix24/b24jssdk - GitHub
|
|
@@ -930,6 +930,7 @@ var EnumCrmEntityType = /* @__PURE__ */ ((EnumCrmEntityType2) => {
|
|
|
930
930
|
EnumCrmEntityType2["invoice"] = "CRM_SMART_INVOICE";
|
|
931
931
|
EnumCrmEntityType2["quote"] = "CRM_QUOTE";
|
|
932
932
|
EnumCrmEntityType2["requisite"] = "CRM_REQUISITE";
|
|
933
|
+
EnumCrmEntityType2["order"] = "ORDER";
|
|
933
934
|
return EnumCrmEntityType2;
|
|
934
935
|
})(EnumCrmEntityType || {});
|
|
935
936
|
var EnumCrmEntityTypeId = /* @__PURE__ */ ((EnumCrmEntityTypeId2) => {
|
|
@@ -942,8 +943,54 @@ var EnumCrmEntityTypeId = /* @__PURE__ */ ((EnumCrmEntityTypeId2) => {
|
|
|
942
943
|
EnumCrmEntityTypeId2[EnumCrmEntityTypeId2["invoice"] = 31] = "invoice";
|
|
943
944
|
EnumCrmEntityTypeId2[EnumCrmEntityTypeId2["quote"] = 7] = "quote";
|
|
944
945
|
EnumCrmEntityTypeId2[EnumCrmEntityTypeId2["requisite"] = 8] = "requisite";
|
|
946
|
+
EnumCrmEntityTypeId2[EnumCrmEntityTypeId2["order"] = 14] = "order";
|
|
945
947
|
return EnumCrmEntityTypeId2;
|
|
946
948
|
})(EnumCrmEntityTypeId || {});
|
|
949
|
+
var EnumCrmEntityTypeShort = /* @__PURE__ */ ((EnumCrmEntityTypeShort2) => {
|
|
950
|
+
EnumCrmEntityTypeShort2["undefined"] = "?";
|
|
951
|
+
EnumCrmEntityTypeShort2["lead"] = "L";
|
|
952
|
+
EnumCrmEntityTypeShort2["deal"] = "D";
|
|
953
|
+
EnumCrmEntityTypeShort2["contact"] = "C";
|
|
954
|
+
EnumCrmEntityTypeShort2["company"] = "CO";
|
|
955
|
+
EnumCrmEntityTypeShort2["oldInvoice"] = "I";
|
|
956
|
+
EnumCrmEntityTypeShort2["invoice"] = "SI";
|
|
957
|
+
EnumCrmEntityTypeShort2["quote"] = "Q";
|
|
958
|
+
EnumCrmEntityTypeShort2["requisite"] = "RQ";
|
|
959
|
+
EnumCrmEntityTypeShort2["order"] = "O";
|
|
960
|
+
return EnumCrmEntityTypeShort2;
|
|
961
|
+
})(EnumCrmEntityTypeShort || {});
|
|
962
|
+
|
|
963
|
+
var ProductRowDiscountTypeId = /* @__PURE__ */ ((ProductRowDiscountTypeId2) => {
|
|
964
|
+
ProductRowDiscountTypeId2[ProductRowDiscountTypeId2["undefined"] = 0] = "undefined";
|
|
965
|
+
ProductRowDiscountTypeId2[ProductRowDiscountTypeId2["absolute"] = 1] = "absolute";
|
|
966
|
+
ProductRowDiscountTypeId2[ProductRowDiscountTypeId2["percentage"] = 2] = "percentage";
|
|
967
|
+
return ProductRowDiscountTypeId2;
|
|
968
|
+
})(ProductRowDiscountTypeId || {});
|
|
969
|
+
|
|
970
|
+
var CatalogProductType = /* @__PURE__ */ ((CatalogProductType2) => {
|
|
971
|
+
CatalogProductType2[CatalogProductType2["undefined"] = 0] = "undefined";
|
|
972
|
+
CatalogProductType2[CatalogProductType2["product"] = 1] = "product";
|
|
973
|
+
CatalogProductType2[CatalogProductType2["service"] = 7] = "service";
|
|
974
|
+
CatalogProductType2[CatalogProductType2["sku"] = 3] = "sku";
|
|
975
|
+
CatalogProductType2[CatalogProductType2["skuEmpty"] = 6] = "skuEmpty";
|
|
976
|
+
CatalogProductType2[CatalogProductType2["offer"] = 4] = "offer";
|
|
977
|
+
CatalogProductType2[CatalogProductType2["offerEmpty"] = 5] = "offerEmpty";
|
|
978
|
+
return CatalogProductType2;
|
|
979
|
+
})(CatalogProductType || {});
|
|
980
|
+
var CatalogProductImageType = /* @__PURE__ */ ((CatalogProductImageType2) => {
|
|
981
|
+
CatalogProductImageType2["undefined"] = "UNDEFINED";
|
|
982
|
+
CatalogProductImageType2["detail"] = "DETAIL_PICTURE";
|
|
983
|
+
CatalogProductImageType2["preview"] = "PREVIEW_PICTURE";
|
|
984
|
+
CatalogProductImageType2["morePhoto"] = "MORE_PHOTO";
|
|
985
|
+
return CatalogProductImageType2;
|
|
986
|
+
})(CatalogProductImageType || {});
|
|
987
|
+
var CatalogRoundingRuleType = /* @__PURE__ */ ((CatalogRoundingRuleType2) => {
|
|
988
|
+
CatalogRoundingRuleType2[CatalogRoundingRuleType2["undefined"] = 0] = "undefined";
|
|
989
|
+
CatalogRoundingRuleType2[CatalogRoundingRuleType2["mathematical"] = 1] = "mathematical";
|
|
990
|
+
CatalogRoundingRuleType2[CatalogRoundingRuleType2["roundingUp"] = 2] = "roundingUp";
|
|
991
|
+
CatalogRoundingRuleType2[CatalogRoundingRuleType2["roundingDown"] = 4] = "roundingDown";
|
|
992
|
+
return CatalogRoundingRuleType2;
|
|
993
|
+
})(CatalogRoundingRuleType || {});
|
|
947
994
|
|
|
948
995
|
var LoadDataType = /* @__PURE__ */ ((LoadDataType2) => {
|
|
949
996
|
LoadDataType2["App"] = "app";
|
|
@@ -1496,9 +1543,16 @@ class Http {
|
|
|
1496
1543
|
#isClientSideWarning = false;
|
|
1497
1544
|
#clientSideWarningMessage = "";
|
|
1498
1545
|
constructor(baseURL, authActions, options) {
|
|
1546
|
+
const defaultHeaders = {
|
|
1547
|
+
// 'X-Sdk': 'b24-js-sdk-v-0.2.3'
|
|
1548
|
+
};
|
|
1499
1549
|
this.#clientAxios = axios.create({
|
|
1500
1550
|
baseURL,
|
|
1501
|
-
|
|
1551
|
+
headers: {
|
|
1552
|
+
...defaultHeaders,
|
|
1553
|
+
...options ? options.headers : {}
|
|
1554
|
+
},
|
|
1555
|
+
...options && { ...options, headers: void 0 }
|
|
1502
1556
|
});
|
|
1503
1557
|
this.#authActions = authActions;
|
|
1504
1558
|
this.#restrictionManager = new RestrictionManager();
|
|
@@ -1900,7 +1954,7 @@ class Http {
|
|
|
1900
1954
|
result.logTag = this.#logTag;
|
|
1901
1955
|
}
|
|
1902
1956
|
result[this.#requestIdGenerator.getQueryStringParameterName()] = this.#requestIdGenerator.getRequestId();
|
|
1903
|
-
result[this.#requestIdGenerator.getQueryStringSdkParameterName()] = "0.2.
|
|
1957
|
+
result[this.#requestIdGenerator.getQueryStringSdkParameterName()] = "0.2.3";
|
|
1904
1958
|
if (!!result.data && !!result.data.start) {
|
|
1905
1959
|
delete result.data.start;
|
|
1906
1960
|
}
|
|
@@ -3118,22 +3172,28 @@ class MessageManager {
|
|
|
3118
3172
|
timeoutId: null
|
|
3119
3173
|
};
|
|
3120
3174
|
const keyPromise = this.#setCallbackPromise(promiseHandler);
|
|
3121
|
-
|
|
3122
|
-
const
|
|
3175
|
+
let paramsSend = null;
|
|
3176
|
+
const optionsSend = omit(params || {}, ["singleOption", "callBack", "isSafely", "safelyTime"]);
|
|
3177
|
+
const { callBack, singleOption } = params || {};
|
|
3123
3178
|
if (callBack) {
|
|
3124
3179
|
this.#callbackSingletone.set(keyPromise, callBack);
|
|
3125
3180
|
}
|
|
3181
|
+
if (singleOption) {
|
|
3182
|
+
paramsSend = singleOption;
|
|
3183
|
+
} else if (Object.keys(optionsSend).length > 0) {
|
|
3184
|
+
paramsSend = { ...optionsSend };
|
|
3185
|
+
}
|
|
3126
3186
|
if (command.toString().includes(":")) {
|
|
3127
3187
|
cmd = {
|
|
3128
3188
|
method: command.toString(),
|
|
3129
|
-
params: paramsSend
|
|
3189
|
+
params: paramsSend || "",
|
|
3130
3190
|
callback: keyPromise,
|
|
3131
3191
|
appSid: this.#appFrame.getAppSid()
|
|
3132
3192
|
};
|
|
3133
3193
|
} else {
|
|
3134
3194
|
cmd = command.toString();
|
|
3135
3195
|
const listParams = [
|
|
3136
|
-
|
|
3196
|
+
paramsSend ? JSON.stringify(paramsSend) : "",
|
|
3137
3197
|
keyPromise,
|
|
3138
3198
|
this.#appFrame.getAppSid()
|
|
3139
3199
|
];
|
|
@@ -3951,6 +4011,30 @@ class PlacementManager {
|
|
|
3951
4011
|
}
|
|
3952
4012
|
);
|
|
3953
4013
|
}
|
|
4014
|
+
/**
|
|
4015
|
+
* Set Up the Interface Event Handler
|
|
4016
|
+
* @param {string} command
|
|
4017
|
+
* @param {null | string | Record<string, any>} parameters
|
|
4018
|
+
* @param {(...args: any[]) => void} callBack
|
|
4019
|
+
*
|
|
4020
|
+
* @return {Promise<any>}
|
|
4021
|
+
*/
|
|
4022
|
+
async callCustomBind(command, parameters = null, callBack) {
|
|
4023
|
+
let options = {};
|
|
4024
|
+
if (Type.isString(parameters)) {
|
|
4025
|
+
options["singleOption"] = parameters;
|
|
4026
|
+
} else if (Type.isObjectLike(parameters)) {
|
|
4027
|
+
options = { ...parameters };
|
|
4028
|
+
}
|
|
4029
|
+
return this.#messageManager.send(
|
|
4030
|
+
command,
|
|
4031
|
+
{
|
|
4032
|
+
...options,
|
|
4033
|
+
callBack,
|
|
4034
|
+
isSafely: true
|
|
4035
|
+
}
|
|
4036
|
+
);
|
|
4037
|
+
}
|
|
3954
4038
|
}
|
|
3955
4039
|
|
|
3956
4040
|
class B24Frame extends AbstractB24 {
|
|
@@ -13575,6 +13659,9 @@ exports.B24Hook = B24Hook;
|
|
|
13575
13659
|
exports.B24LangList = B24LangList;
|
|
13576
13660
|
exports.B24PullClientManager = PullClient;
|
|
13577
13661
|
exports.Browser = Browser;
|
|
13662
|
+
exports.CatalogProductImageType = CatalogProductImageType;
|
|
13663
|
+
exports.CatalogProductType = CatalogProductType;
|
|
13664
|
+
exports.CatalogRoundingRuleType = CatalogRoundingRuleType;
|
|
13578
13665
|
exports.CloseReasons = CloseReasons;
|
|
13579
13666
|
exports.ConnectionType = ConnectionType;
|
|
13580
13667
|
exports.DataType = DataType;
|
|
@@ -13582,6 +13669,7 @@ exports.DialogManager = DialogManager;
|
|
|
13582
13669
|
exports.EnumAppStatus = EnumAppStatus;
|
|
13583
13670
|
exports.EnumCrmEntityType = EnumCrmEntityType;
|
|
13584
13671
|
exports.EnumCrmEntityTypeId = EnumCrmEntityTypeId;
|
|
13672
|
+
exports.EnumCrmEntityTypeShort = EnumCrmEntityTypeShort;
|
|
13585
13673
|
exports.ListRpcError = ListRpcError;
|
|
13586
13674
|
exports.LoadDataType = LoadDataType;
|
|
13587
13675
|
exports.LoggerBrowser = LoggerBrowser;
|
|
@@ -13592,6 +13680,7 @@ exports.MessageManager = MessageManager;
|
|
|
13592
13680
|
exports.OptionsManager = OptionsManager$1;
|
|
13593
13681
|
exports.ParentManager = ParentManager;
|
|
13594
13682
|
exports.PlacementManager = PlacementManager;
|
|
13683
|
+
exports.ProductRowDiscountTypeId = ProductRowDiscountTypeId;
|
|
13595
13684
|
exports.PullStatus = PullStatus;
|
|
13596
13685
|
exports.RestrictionManagerParamsBase = RestrictionManagerParamsBase;
|
|
13597
13686
|
exports.RestrictionManagerParamsForEnterprise = RestrictionManagerParamsForEnterprise;
|