@bitrix24/b24jssdk 1.0.5 → 1.1.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-AI.md +26 -3
- package/dist/esm/_virtual/_commonjsHelpers.mjs +1 -1
- package/dist/esm/_virtual/protobuf.mjs +1 -1
- package/dist/esm/_virtual/protobuf2.mjs +1 -1
- package/dist/esm/core/abstract-b24.mjs +1 -1
- package/dist/esm/core/actions/abstract-action.mjs +1 -1
- package/dist/esm/core/actions/abstract-batch.mjs +1 -1
- package/dist/esm/core/actions/manager.mjs +1 -1
- package/dist/esm/core/actions/v2/batch-by-chunk.mjs +1 -1
- package/dist/esm/core/actions/v2/batch.mjs +1 -1
- package/dist/esm/core/actions/v2/call-list.mjs +7 -3
- package/dist/esm/core/actions/v2/call-list.mjs.map +1 -1
- package/dist/esm/core/actions/v2/call.mjs +1 -1
- package/dist/esm/core/actions/v2/fetch-list.mjs +7 -3
- package/dist/esm/core/actions/v2/fetch-list.mjs.map +1 -1
- package/dist/esm/core/actions/v2/manager-v2.mjs +1 -1
- package/dist/esm/core/actions/v3/batch-by-chunk.mjs +1 -1
- package/dist/esm/core/actions/v3/batch.mjs +1 -1
- package/dist/esm/core/actions/v3/call-list.mjs +9 -5
- package/dist/esm/core/actions/v3/call-list.mjs.map +1 -1
- package/dist/esm/core/actions/v3/call.mjs +1 -1
- package/dist/esm/core/actions/v3/fetch-list.mjs +9 -5
- package/dist/esm/core/actions/v3/fetch-list.mjs.map +1 -1
- package/dist/esm/core/actions/v3/manager-v3.mjs +1 -1
- package/dist/esm/core/http/abstract-http.mjs +2 -2
- package/dist/esm/core/http/ajax-error.mjs +1 -1
- package/dist/esm/core/http/ajax-result.mjs +44 -4
- package/dist/esm/core/http/ajax-result.mjs.map +1 -1
- package/dist/esm/core/http/limiters/adaptive-delayer.mjs +1 -1
- package/dist/esm/core/http/limiters/manager.mjs +1 -1
- package/dist/esm/core/http/limiters/operating-limiter.mjs +1 -1
- package/dist/esm/core/http/limiters/params-factory.mjs +1 -1
- package/dist/esm/core/http/limiters/rate-limiter.mjs +1 -1
- package/dist/esm/core/http/v2.mjs +2 -2
- package/dist/esm/core/http/v3.mjs +2 -2
- package/dist/esm/core/interaction/batch/abstract-interaction-batch.mjs +1 -1
- package/dist/esm/core/interaction/batch/parse-row.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/interface-strategy.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/abstract-processing.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/abstract-processing.mjs.map +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/as-array.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/as-object.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v3/abstract-processing.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v3/abstract-processing.mjs.map +1 -1
- package/dist/esm/core/interaction/batch/processing/v3/as-array.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v3/as-object.mjs +1 -1
- package/dist/esm/core/interaction/batch/v2.mjs +1 -1
- package/dist/esm/core/interaction/batch/v3.mjs +1 -1
- package/dist/esm/core/language/list.mjs +1 -1
- package/dist/esm/core/request-id-generator.mjs +1 -1
- package/dist/esm/core/result.mjs +1 -1
- package/dist/esm/core/sdk-error.mjs +1 -1
- package/dist/esm/core/tools/abstract-tool.mjs +1 -1
- package/dist/esm/core/tools/healthcheck.mjs +1 -1
- package/dist/esm/core/tools/manager.mjs +1 -1
- package/dist/esm/core/tools/ping.mjs +1 -1
- package/dist/esm/core/version-manager.mjs +1 -1
- package/dist/esm/frame/auth.mjs +1 -1
- package/dist/esm/frame/b24.mjs +1 -1
- package/dist/esm/frame/dialog.mjs +45 -5
- package/dist/esm/frame/dialog.mjs.map +1 -1
- package/dist/esm/frame/frame.mjs +1 -1
- package/dist/esm/frame/message/commands.mjs +1 -1
- package/dist/esm/frame/message/controller.mjs +1 -1
- package/dist/esm/frame/options.mjs +1 -1
- package/dist/esm/frame/parent.mjs +1 -1
- package/dist/esm/frame/placement.mjs +32 -9
- package/dist/esm/frame/placement.mjs.map +1 -1
- package/dist/esm/frame/slider.mjs +1 -1
- package/dist/esm/helper/abstract-helper.mjs +1 -1
- package/dist/esm/helper/app-manager.mjs +1 -1
- package/dist/esm/helper/currency-manager.mjs +1 -1
- package/dist/esm/helper/helper-manager.mjs +2 -2
- package/dist/esm/helper/license-manager.mjs +1 -1
- package/dist/esm/helper/options-manager.mjs +1 -1
- package/dist/esm/helper/payment-manager.mjs +1 -1
- package/dist/esm/helper/profile-manager.mjs +1 -1
- package/dist/esm/helper/use-b24-helper.mjs +1 -1
- package/dist/esm/hook/auth.mjs +1 -1
- package/dist/esm/hook/b24.mjs +1 -1
- package/dist/esm/index.d.mts +109 -13
- package/dist/esm/index.d.ts +109 -13
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/loader-b24frame.mjs +1 -1
- package/dist/esm/logger/abstract-logger.mjs +1 -1
- package/dist/esm/logger/browser.mjs +1 -1
- package/dist/esm/logger/formatter/abstract-formatter.mjs +1 -1
- package/dist/esm/logger/formatter/json-formatter.mjs +1 -1
- package/dist/esm/logger/formatter/line-formatter.mjs +1 -1
- package/dist/esm/logger/formatter/telegram-formatter.mjs +1 -1
- package/dist/esm/logger/handler/abstract-handler.mjs +1 -1
- package/dist/esm/logger/handler/consola-adapter.mjs +1 -1
- package/dist/esm/logger/handler/console-handler.mjs +1 -1
- package/dist/esm/logger/handler/console-v2-handler.mjs +1 -1
- package/dist/esm/logger/handler/memory-handler.mjs +1 -1
- package/dist/esm/logger/handler/stream-handler.mjs +1 -1
- package/dist/esm/logger/handler/telegram-handler.mjs +1 -1
- package/dist/esm/logger/handler/winston-adapter.mjs +1 -1
- package/dist/esm/logger/logger-factory.mjs +1 -1
- package/dist/esm/logger/logger.mjs +1 -1
- package/dist/esm/logger/null-logger.mjs +1 -1
- package/dist/esm/logger/processor/memory-usage-processor.mjs +1 -1
- package/dist/esm/logger/processor/pid-processor.mjs +1 -1
- package/dist/esm/oauth/auth.mjs +1 -1
- package/dist/esm/oauth/b24.mjs +1 -1
- package/dist/esm/oauth/refresh-token-error.mjs +1 -1
- package/dist/esm/pullClient/abstract-connector.mjs +1 -1
- package/dist/esm/pullClient/channel-manager.mjs +1 -1
- package/dist/esm/pullClient/channel-manager.mjs.map +1 -1
- package/dist/esm/pullClient/client.mjs +1 -1
- package/dist/esm/pullClient/errors.mjs +1 -1
- package/dist/esm/pullClient/json-rpc.mjs +1 -1
- package/dist/esm/pullClient/long-polling-connector.mjs +1 -1
- package/dist/esm/pullClient/protobuf/index.mjs +1 -1
- package/dist/esm/pullClient/protobuf/model.mjs +1 -1
- package/dist/esm/pullClient/protobuf/protobuf.mjs +1 -1
- package/dist/esm/pullClient/shared-config.mjs +1 -1
- package/dist/esm/pullClient/storage-manager.mjs +1 -1
- package/dist/esm/pullClient/web-socket-connector.mjs +1 -1
- package/dist/esm/tools/browser.mjs +1 -1
- package/dist/esm/tools/environment.mjs +1 -1
- package/dist/esm/tools/formatters/iban.mjs +1 -1
- package/dist/esm/tools/formatters/numbers.mjs +1 -1
- package/dist/esm/tools/index.mjs +1 -1
- package/dist/esm/tools/scroll-size.mjs +1 -1
- package/dist/esm/tools/text.mjs +1 -1
- package/dist/esm/tools/type.mjs +1 -1
- package/dist/esm/tools/use-formatters.mjs +1 -1
- package/dist/esm/tools/uuidv7.mjs +1 -1
- package/dist/esm/types/b24-helper.mjs +1 -1
- package/dist/esm/types/b24.mjs +1 -1
- package/dist/esm/types/bizproc/index.mjs +1 -1
- package/dist/esm/types/catalog/index.mjs +1 -1
- package/dist/esm/types/common.mjs +1 -1
- package/dist/esm/types/crm/entity-type.mjs +1 -1
- package/dist/esm/types/crm/productrow.mjs +1 -1
- package/dist/esm/types/logger.mjs +1 -1
- package/dist/esm/types/pull.mjs +1 -1
- package/dist/umd/index.js +1321 -846
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/index.min.js +37 -34
- package/dist/umd/index.min.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package @bitrix24/b24jssdk
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @copyright (c) 2026 Bitrix24
|
|
5
5
|
* @license MIT
|
|
6
6
|
* @see https://github.com/bitrix24/b24jssdk
|
|
@@ -82,22 +82,45 @@ class PlacementManager {
|
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
|
+
async call(command, parameters = {}) {
|
|
86
|
+
if (command === "setValue" && !Type.isString(parameters?.["value"])) {
|
|
87
|
+
throw new TypeError(
|
|
88
|
+
"placement.call('setValue', { value }) expects `value` to be a JSON-serialized string. Use placement.setValue(value) to serialize automatically, or call JSON.stringify yourself."
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
return this.#messageManager.send(
|
|
92
|
+
command,
|
|
93
|
+
{
|
|
94
|
+
...parameters,
|
|
95
|
+
isSafely: true,
|
|
96
|
+
isRawValue: ["setValue"].includes(command)
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
85
100
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
101
|
+
* Set Value for the Current Embedding Location
|
|
102
|
+
*
|
|
103
|
+
* Convenience wrapper around `placement.call('setValue', ...)` that handles
|
|
104
|
+
* JSON serialization. Pass any value (string, number, boolean, object, array)
|
|
105
|
+
* — it will be serialized via `JSON.stringify` before being sent to the
|
|
106
|
+
* parent window, which performs `JSON.parse` on receipt.
|
|
107
|
+
*
|
|
108
|
+
* @param { unknown } value Any JSON-serializable value
|
|
89
109
|
* @return { Promise<any> }
|
|
90
110
|
*
|
|
91
111
|
* @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-call.html
|
|
92
|
-
*
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await b24.placement.setValue('test')
|
|
115
|
+
* await b24.placement.setValue({ id: 1, title: 'demo' })
|
|
93
116
|
*/
|
|
94
|
-
async
|
|
117
|
+
async setValue(value) {
|
|
95
118
|
return this.#messageManager.send(
|
|
96
|
-
|
|
119
|
+
"setValue",
|
|
97
120
|
{
|
|
98
|
-
|
|
121
|
+
value: JSON.stringify(value),
|
|
99
122
|
isSafely: true,
|
|
100
|
-
isRawValue:
|
|
123
|
+
isRawValue: true
|
|
101
124
|
}
|
|
102
125
|
);
|
|
103
126
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placement.mjs","sources":["../../../src/frame/placement.ts"],"sourcesContent":["import type { MessageManager } from './message'\nimport type { MessageInitData } from '../types/auth'\nimport { MessageCommands } from './message'\nimport { Type } from '../tools/type'\n\n/**\n * Placement Manager\n *\n * @see https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/index.html\n */\nexport class PlacementManager {\n #messageManager: MessageManager\n #placement: string = ''\n #options: object = {}\n\n constructor(messageManager: MessageManager) {\n this.#messageManager = messageManager\n }\n\n /**\n * Initializes the data received from the parent window message.\n * @param data\n */\n initData(data: MessageInitData): PlacementManager {\n this.#placement = data.PLACEMENT || 'DEFAULT'\n this.#options = Object.freeze(data.PLACEMENT_OPTIONS)\n\n return this\n }\n\n /**\n * Symlink on `placement`\n * For backward compatibility\n */\n get title(): string {\n return this.#placement\n }\n\n get placement(): string {\n return this.#placement\n }\n\n get isDefault(): boolean {\n return this.placement === 'DEFAULT'\n }\n\n get options(): any {\n return this.#options\n }\n\n get isSliderMode(): boolean {\n return this.options?.IFRAME === 'Y'\n }\n\n /**\n * Get Information About the JS Interface of the Current Embedding Location\n *\n * @return {Promise<any>}\n *\n * @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-get-interface.html\n */\n async getInterface(): Promise<any> {\n return this.#messageManager.send(\n MessageCommands.getInterface,\n {\n isSafely: true\n }\n )\n }\n\n /**\n * Set Up the Interface Event Handler\n * @param {string} eventName\n * @param {(...args: any[]) => void} callBack\n * @return {Promise<any>}\n *\n * @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-bind-event.html\n */\n async bindEvent(\n eventName: string,\n callBack: (...args: any[]) => void\n ): Promise<any> {\n return this.#messageManager.send(\n MessageCommands.placementBindEvent,\n {\n event: eventName,\n callBack,\n isSafely: true\n }\n )\n }\n\n /**\n * Call the Registered Interface Command\n * @
|
|
1
|
+
{"version":3,"file":"placement.mjs","sources":["../../../src/frame/placement.ts"],"sourcesContent":["import type { MessageManager } from './message'\nimport type { MessageInitData } from '../types/auth'\nimport { MessageCommands } from './message'\nimport { Type } from '../tools/type'\n\n/**\n * Placement Manager\n *\n * @see https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/index.html\n */\nexport class PlacementManager {\n #messageManager: MessageManager\n #placement: string = ''\n #options: object = {}\n\n constructor(messageManager: MessageManager) {\n this.#messageManager = messageManager\n }\n\n /**\n * Initializes the data received from the parent window message.\n * @param data\n */\n initData(data: MessageInitData): PlacementManager {\n this.#placement = data.PLACEMENT || 'DEFAULT'\n this.#options = Object.freeze(data.PLACEMENT_OPTIONS)\n\n return this\n }\n\n /**\n * Symlink on `placement`\n * For backward compatibility\n */\n get title(): string {\n return this.#placement\n }\n\n get placement(): string {\n return this.#placement\n }\n\n get isDefault(): boolean {\n return this.placement === 'DEFAULT'\n }\n\n get options(): any {\n return this.#options\n }\n\n get isSliderMode(): boolean {\n return this.options?.IFRAME === 'Y'\n }\n\n /**\n * Get Information About the JS Interface of the Current Embedding Location\n *\n * @return {Promise<any>}\n *\n * @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-get-interface.html\n */\n async getInterface(): Promise<any> {\n return this.#messageManager.send(\n MessageCommands.getInterface,\n {\n isSafely: true\n }\n )\n }\n\n /**\n * Set Up the Interface Event Handler\n * @param {string} eventName\n * @param {(...args: any[]) => void} callBack\n * @return {Promise<any>}\n *\n * @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-bind-event.html\n */\n async bindEvent(\n eventName: string,\n callBack: (...args: any[]) => void\n ): Promise<any> {\n return this.#messageManager.send(\n MessageCommands.placementBindEvent,\n {\n event: eventName,\n callBack,\n isSafely: true\n }\n )\n }\n\n /**\n * Call the Registered Interface Command\n *\n * @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-call.html\n *\n * @memo The `setValue` command is special: the parent window calls `JSON.parse(value)`\n * on the received payload, so `value` MUST be a JSON-serialized string\n * (e.g. `JSON.stringify('test')` or `JSON.stringify({ a: 1 })`).\n * Prefer {@link PlacementManager.setValue} which serializes for you.\n *\n * @throws {TypeError} when `command === 'setValue'` and `parameters.value` is not a string.\n */\n async call(command: 'setValue', parameters: { value: string }): Promise<any>\n async call(command: string, parameters?: Record<string, any>): Promise<any>\n async call(command: string, parameters: Record<string, any> = {}): Promise<any> {\n if (command === 'setValue' && !Type.isString(parameters?.['value'])) {\n throw new TypeError(\n 'placement.call(\\'setValue\\', { value }) expects `value` to be a JSON-serialized string. '\n + 'Use placement.setValue(value) to serialize automatically, or call JSON.stringify yourself.'\n )\n }\n\n return this.#messageManager.send(\n command,\n {\n ...parameters,\n isSafely: true,\n isRawValue: ['setValue'].includes(command)\n }\n )\n }\n\n /**\n * Set Value for the Current Embedding Location\n *\n * Convenience wrapper around `placement.call('setValue', ...)` that handles\n * JSON serialization. Pass any value (string, number, boolean, object, array)\n * — it will be serialized via `JSON.stringify` before being sent to the\n * parent window, which performs `JSON.parse` on receipt.\n *\n * @param { unknown } value Any JSON-serializable value\n * @return { Promise<any> }\n *\n * @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-call.html\n *\n * @example\n * await b24.placement.setValue('test')\n * await b24.placement.setValue({ id: 1, title: 'demo' })\n */\n async setValue(value: unknown): Promise<any> {\n return this.#messageManager.send(\n 'setValue',\n {\n value: JSON.stringify(value),\n isSafely: true,\n isRawValue: true\n }\n )\n }\n\n /**\n * Set Up the Interface Event Handler\n * @param {string} command\n * @param {null | string | Record<string, any>} parameters\n * @param {(...args: any[]) => void} callBack\n *\n * @return {Promise<any>}\n */\n async callCustomBind(\n command: string,\n parameters: null | string | Record<string, any> = null,\n callBack: (...args: any[]) => void\n ): Promise<any> {\n let options: Record<string, any> = {}\n if (Type.isString(parameters)) {\n options['singleOption'] = parameters\n } else if (Type.isObjectLike(parameters)) {\n options = { ...(parameters as object) }\n }\n\n return this.#messageManager.send(\n command,\n {\n ...options,\n callBack,\n isSafely: true\n }\n )\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package @bitrix24/b24jssdk
|
|
3
|
-
* @version 1.0
|
|
3
|
+
* @version 1.1.0
|
|
4
4
|
* @copyright (c) 2026 Bitrix24
|
|
5
5
|
* @license MIT
|
|
6
6
|
* @see https://github.com/bitrix24/b24jssdk
|
|
@@ -14,8 +14,8 @@ import { CurrencyManager } from './currency-manager.mjs';
|
|
|
14
14
|
import { OptionsManager } from './options-manager.mjs';
|
|
15
15
|
import { Text } from '../tools/text.mjs';
|
|
16
16
|
import { LoadDataType, TypeSpecificUrl } from '../types/b24-helper.mjs';
|
|
17
|
-
import { PullClient } from '../pullClient/client.mjs';
|
|
18
17
|
import { LoggerFactory } from '../logger/logger-factory.mjs';
|
|
18
|
+
import { PullClient } from '../pullClient/client.mjs';
|
|
19
19
|
|
|
20
20
|
var __defProp = Object.defineProperty;
|
|
21
21
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
package/dist/esm/hook/auth.mjs
CHANGED
package/dist/esm/hook/b24.mjs
CHANGED
package/dist/esm/index.d.mts
CHANGED
|
@@ -1418,7 +1418,7 @@ declare class CallV2 extends AbstractAction {
|
|
|
1418
1418
|
|
|
1419
1419
|
type ActionCallListV2 = ActionOptions & {
|
|
1420
1420
|
method: string;
|
|
1421
|
-
params?: Omit<TypeCallParams, 'start'>;
|
|
1421
|
+
params?: Omit<TypeCallParams, 'start' | 'order'>;
|
|
1422
1422
|
idKey?: string;
|
|
1423
1423
|
customKeyForResult?: string;
|
|
1424
1424
|
requestId?: string;
|
|
@@ -1481,7 +1481,7 @@ declare class CallListV2 extends AbstractAction {
|
|
|
1481
1481
|
|
|
1482
1482
|
type ActionFetchListV2 = ActionOptions & {
|
|
1483
1483
|
method: string;
|
|
1484
|
-
params?: Omit<TypeCallParams, 'start'>;
|
|
1484
|
+
params?: Omit<TypeCallParams, 'start' | 'order'>;
|
|
1485
1485
|
idKey?: string;
|
|
1486
1486
|
customKeyForResult?: string;
|
|
1487
1487
|
requestId?: string;
|
|
@@ -1786,7 +1786,7 @@ declare class CallV3 extends AbstractAction {
|
|
|
1786
1786
|
|
|
1787
1787
|
type ActionCallListV3 = ActionOptions & {
|
|
1788
1788
|
method: string;
|
|
1789
|
-
params?: Omit<TypeCallParams, 'pagination'>;
|
|
1789
|
+
params?: Omit<TypeCallParams, 'pagination' | 'order'>;
|
|
1790
1790
|
idKey?: string;
|
|
1791
1791
|
customKeyForResult: string;
|
|
1792
1792
|
requestId?: string;
|
|
@@ -1849,7 +1849,7 @@ declare class CallListV3 extends AbstractAction {
|
|
|
1849
1849
|
|
|
1850
1850
|
type ActionFetchListV3 = ActionOptions & {
|
|
1851
1851
|
method: string;
|
|
1852
|
-
params?: Omit<TypeCallParams, 'pagination'>;
|
|
1852
|
+
params?: Omit<TypeCallParams, 'pagination' | 'order'>;
|
|
1853
1853
|
idKey?: string;
|
|
1854
1854
|
customKeyForResult: string;
|
|
1855
1855
|
requestId?: string;
|
|
@@ -2534,7 +2534,21 @@ type BatchPayload<C> = {
|
|
|
2534
2534
|
readonly time: PayloadTime;
|
|
2535
2535
|
};
|
|
2536
2536
|
type Payload<P> = TypeDescriptionErrorV3 | TypeDescriptionError | GetPayload<P> | ListPayload<P> | BatchPayload<P>;
|
|
2537
|
-
|
|
2537
|
+
/**
|
|
2538
|
+
* Public shape of a successful REST response, as exposed by `AjaxResult.getData()`.
|
|
2539
|
+
*
|
|
2540
|
+
* The Bitrix24 REST API always wraps a success response in `{ result, time }` —
|
|
2541
|
+
* this is true for both `restApi:v2` and `restApi:v3`. Any v2-only envelope
|
|
2542
|
+
* fields (`next`, `total`) are intentionally NOT part of this type: they have
|
|
2543
|
+
* no `restApi:v3` counterpart, and the SDK's `actions.v{2,3}.{callList,fetchList}`
|
|
2544
|
+
* helpers handle pagination internally so consumers never need to read them.
|
|
2545
|
+
*
|
|
2546
|
+
* @see GetPayload
|
|
2547
|
+
*/
|
|
2548
|
+
type SuccessPayload<P> = {
|
|
2549
|
+
readonly result: P;
|
|
2550
|
+
readonly time: PayloadTime;
|
|
2551
|
+
};
|
|
2538
2552
|
|
|
2539
2553
|
type AjaxQuery = Readonly<{
|
|
2540
2554
|
method: string;
|
|
@@ -2561,9 +2575,35 @@ declare class AjaxResult<T = unknown> extends Result<Payload<T>> implements IRes
|
|
|
2561
2575
|
getData(): undefined | SuccessPayload<T>;
|
|
2562
2576
|
/**
|
|
2563
2577
|
* Alias for isMore
|
|
2578
|
+
*
|
|
2579
|
+
* @deprecated Will be removed in `2.0.0`. Tied to the `restApi:v2` envelope
|
|
2580
|
+
* field `next`, which `restApi:v3` does not return. Use the SDK's list
|
|
2581
|
+
* helpers — they hide pagination entirely:
|
|
2582
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
2583
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
2584
|
+
*
|
|
2585
|
+
* @removed 2.0.0
|
|
2564
2586
|
*/
|
|
2565
2587
|
hasMore(): boolean;
|
|
2588
|
+
/**
|
|
2589
|
+
* @deprecated Will be removed in `2.0.0`. Tied to the `restApi:v2` envelope
|
|
2590
|
+
* field `next`, which `restApi:v3` does not return. Use the SDK's list
|
|
2591
|
+
* helpers — they hide pagination entirely:
|
|
2592
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
2593
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
2594
|
+
*
|
|
2595
|
+
* @removed 2.0.0
|
|
2596
|
+
*/
|
|
2566
2597
|
isMore(): boolean;
|
|
2598
|
+
/**
|
|
2599
|
+
* @deprecated Will be removed in `2.0.0`. Tied to the `restApi:v2` envelope
|
|
2600
|
+
* field `total`, which `restApi:v3` does not return. For `restApi:v3` the
|
|
2601
|
+
* SDK exposes element counts via the `aggregate` action (`count` /
|
|
2602
|
+
* `countDistinct`); for `restApi:v2` use the list helpers, which iterate
|
|
2603
|
+
* without exposing `total`.
|
|
2604
|
+
*
|
|
2605
|
+
* @removed 2.0.0
|
|
2606
|
+
*/
|
|
2567
2607
|
getTotal(): number;
|
|
2568
2608
|
getStatus(): number;
|
|
2569
2609
|
getQuery(): Readonly<AjaxQuery>;
|
|
@@ -2571,9 +2611,25 @@ declare class AjaxResult<T = unknown> extends Result<Payload<T>> implements IRes
|
|
|
2571
2611
|
* Alias for getNext
|
|
2572
2612
|
* @param http
|
|
2573
2613
|
*
|
|
2574
|
-
* @
|
|
2614
|
+
* @deprecated Will be removed in `2.0.0`. `restApi:v3` does not support
|
|
2615
|
+
* `getNext()` (the v2 envelope field `next` does not exist). Use the SDK's
|
|
2616
|
+
* list helpers instead — they hide pagination entirely:
|
|
2617
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
2618
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
2619
|
+
*
|
|
2620
|
+
* @removed 2.0.0
|
|
2575
2621
|
*/
|
|
2576
2622
|
fetchNext(http: TypeHttp): Promise<AjaxResult<T> | null>;
|
|
2623
|
+
/**
|
|
2624
|
+
* @deprecated Will be removed in `2.0.0`. Throws on `restApi:v3` because the
|
|
2625
|
+
* v2 envelope field `next` is not part of the v3 protocol. Use the SDK's
|
|
2626
|
+
* list helpers instead — they hide pagination entirely:
|
|
2627
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
2628
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
2629
|
+
*
|
|
2630
|
+
* @throws {SdkError} `JSSDK_CORE_METHOD_NOT_SUPPORT_IN_API_V3` when called against a `restApi:v3` HTTP client. This throw is preserved until `2.0.0`.
|
|
2631
|
+
* @removed 2.0.0
|
|
2632
|
+
*/
|
|
2577
2633
|
getNext(http: TypeHttp): Promise<AjaxResult<T> | false>;
|
|
2578
2634
|
setData(): never;
|
|
2579
2635
|
}
|
|
@@ -4898,10 +4954,26 @@ declare class DialogManager {
|
|
|
4898
4954
|
*/
|
|
4899
4955
|
selectAccess(blockedAccessPermissions?: string[]): Promise<SelectedAccess[]>;
|
|
4900
4956
|
/**
|
|
4901
|
-
*
|
|
4957
|
+
* Invokes the system dialog for selecting CRM entities
|
|
4958
|
+
* (leads, contacts, companies, deals, quotes).
|
|
4902
4959
|
*
|
|
4903
|
-
*
|
|
4904
|
-
*
|
|
4960
|
+
* The resolved `SelectedCRM` object contains a separate bucket per
|
|
4961
|
+
* entity type. Each present bucket is a real `Array`, so consumers can
|
|
4962
|
+
* use `.length`, `.map()`, `for..of`, etc. directly. Buckets for entity
|
|
4963
|
+
* types that were not selected (or not requested via `entityType`) are
|
|
4964
|
+
* left `undefined` rather than being set to an empty array.
|
|
4965
|
+
*
|
|
4966
|
+
* Note: the parent window historically returned each bucket as a
|
|
4967
|
+
* `Record<string, SelectedCRMEntity>` (e.g. `{ 0: {...}, 1: {...} }`).
|
|
4968
|
+
* The SDK normalizes that response to a real array before returning it.
|
|
4969
|
+
*
|
|
4970
|
+
* @param {SelectCRMParams} [params] - Filter and behavior options.
|
|
4971
|
+
* - `entityType`: which entity types are shown in the dialog.
|
|
4972
|
+
* - `multiple`: allow multiple selection (default `false`).
|
|
4973
|
+
* - `value`: pre-selected entities (only applied when `multiple` is `true`).
|
|
4974
|
+
* @return {Promise<SelectedCRM>} Resolves to an object whose properties
|
|
4975
|
+
* (`lead`, `contact`, `company`, `deal`, `quote`) are arrays of
|
|
4976
|
+
* {@link SelectedCRMEntity} objects.
|
|
4905
4977
|
*
|
|
4906
4978
|
* @link https://apidocs.bitrix24.com/sdk/bx24-js-sdk/system-dialogues/bx24-select-crm.html
|
|
4907
4979
|
*/
|
|
@@ -4989,14 +5061,38 @@ declare class PlacementManager {
|
|
|
4989
5061
|
bindEvent(eventName: string, callBack: (...args: any[]) => void): Promise<any>;
|
|
4990
5062
|
/**
|
|
4991
5063
|
* Call the Registered Interface Command
|
|
4992
|
-
* @param { string } command
|
|
4993
|
-
* @param { Record<string, any> } parameters
|
|
4994
|
-
* @return { Promise<any> }
|
|
4995
5064
|
*
|
|
4996
5065
|
* @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-call.html
|
|
4997
|
-
*
|
|
5066
|
+
*
|
|
5067
|
+
* @memo The `setValue` command is special: the parent window calls `JSON.parse(value)`
|
|
5068
|
+
* on the received payload, so `value` MUST be a JSON-serialized string
|
|
5069
|
+
* (e.g. `JSON.stringify('test')` or `JSON.stringify({ a: 1 })`).
|
|
5070
|
+
* Prefer {@link PlacementManager.setValue} which serializes for you.
|
|
5071
|
+
*
|
|
5072
|
+
* @throws {TypeError} when `command === 'setValue'` and `parameters.value` is not a string.
|
|
4998
5073
|
*/
|
|
5074
|
+
call(command: 'setValue', parameters: {
|
|
5075
|
+
value: string;
|
|
5076
|
+
}): Promise<any>;
|
|
4999
5077
|
call(command: string, parameters?: Record<string, any>): Promise<any>;
|
|
5078
|
+
/**
|
|
5079
|
+
* Set Value for the Current Embedding Location
|
|
5080
|
+
*
|
|
5081
|
+
* Convenience wrapper around `placement.call('setValue', ...)` that handles
|
|
5082
|
+
* JSON serialization. Pass any value (string, number, boolean, object, array)
|
|
5083
|
+
* — it will be serialized via `JSON.stringify` before being sent to the
|
|
5084
|
+
* parent window, which performs `JSON.parse` on receipt.
|
|
5085
|
+
*
|
|
5086
|
+
* @param { unknown } value Any JSON-serializable value
|
|
5087
|
+
* @return { Promise<any> }
|
|
5088
|
+
*
|
|
5089
|
+
* @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-call.html
|
|
5090
|
+
*
|
|
5091
|
+
* @example
|
|
5092
|
+
* await b24.placement.setValue('test')
|
|
5093
|
+
* await b24.placement.setValue({ id: 1, title: 'demo' })
|
|
5094
|
+
*/
|
|
5095
|
+
setValue(value: unknown): Promise<any>;
|
|
5000
5096
|
/**
|
|
5001
5097
|
* Set Up the Interface Event Handler
|
|
5002
5098
|
* @param {string} command
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1418,7 +1418,7 @@ declare class CallV2 extends AbstractAction {
|
|
|
1418
1418
|
|
|
1419
1419
|
type ActionCallListV2 = ActionOptions & {
|
|
1420
1420
|
method: string;
|
|
1421
|
-
params?: Omit<TypeCallParams, 'start'>;
|
|
1421
|
+
params?: Omit<TypeCallParams, 'start' | 'order'>;
|
|
1422
1422
|
idKey?: string;
|
|
1423
1423
|
customKeyForResult?: string;
|
|
1424
1424
|
requestId?: string;
|
|
@@ -1481,7 +1481,7 @@ declare class CallListV2 extends AbstractAction {
|
|
|
1481
1481
|
|
|
1482
1482
|
type ActionFetchListV2 = ActionOptions & {
|
|
1483
1483
|
method: string;
|
|
1484
|
-
params?: Omit<TypeCallParams, 'start'>;
|
|
1484
|
+
params?: Omit<TypeCallParams, 'start' | 'order'>;
|
|
1485
1485
|
idKey?: string;
|
|
1486
1486
|
customKeyForResult?: string;
|
|
1487
1487
|
requestId?: string;
|
|
@@ -1786,7 +1786,7 @@ declare class CallV3 extends AbstractAction {
|
|
|
1786
1786
|
|
|
1787
1787
|
type ActionCallListV3 = ActionOptions & {
|
|
1788
1788
|
method: string;
|
|
1789
|
-
params?: Omit<TypeCallParams, 'pagination'>;
|
|
1789
|
+
params?: Omit<TypeCallParams, 'pagination' | 'order'>;
|
|
1790
1790
|
idKey?: string;
|
|
1791
1791
|
customKeyForResult: string;
|
|
1792
1792
|
requestId?: string;
|
|
@@ -1849,7 +1849,7 @@ declare class CallListV3 extends AbstractAction {
|
|
|
1849
1849
|
|
|
1850
1850
|
type ActionFetchListV3 = ActionOptions & {
|
|
1851
1851
|
method: string;
|
|
1852
|
-
params?: Omit<TypeCallParams, 'pagination'>;
|
|
1852
|
+
params?: Omit<TypeCallParams, 'pagination' | 'order'>;
|
|
1853
1853
|
idKey?: string;
|
|
1854
1854
|
customKeyForResult: string;
|
|
1855
1855
|
requestId?: string;
|
|
@@ -2534,7 +2534,21 @@ type BatchPayload<C> = {
|
|
|
2534
2534
|
readonly time: PayloadTime;
|
|
2535
2535
|
};
|
|
2536
2536
|
type Payload<P> = TypeDescriptionErrorV3 | TypeDescriptionError | GetPayload<P> | ListPayload<P> | BatchPayload<P>;
|
|
2537
|
-
|
|
2537
|
+
/**
|
|
2538
|
+
* Public shape of a successful REST response, as exposed by `AjaxResult.getData()`.
|
|
2539
|
+
*
|
|
2540
|
+
* The Bitrix24 REST API always wraps a success response in `{ result, time }` —
|
|
2541
|
+
* this is true for both `restApi:v2` and `restApi:v3`. Any v2-only envelope
|
|
2542
|
+
* fields (`next`, `total`) are intentionally NOT part of this type: they have
|
|
2543
|
+
* no `restApi:v3` counterpart, and the SDK's `actions.v{2,3}.{callList,fetchList}`
|
|
2544
|
+
* helpers handle pagination internally so consumers never need to read them.
|
|
2545
|
+
*
|
|
2546
|
+
* @see GetPayload
|
|
2547
|
+
*/
|
|
2548
|
+
type SuccessPayload<P> = {
|
|
2549
|
+
readonly result: P;
|
|
2550
|
+
readonly time: PayloadTime;
|
|
2551
|
+
};
|
|
2538
2552
|
|
|
2539
2553
|
type AjaxQuery = Readonly<{
|
|
2540
2554
|
method: string;
|
|
@@ -2561,9 +2575,35 @@ declare class AjaxResult<T = unknown> extends Result<Payload<T>> implements IRes
|
|
|
2561
2575
|
getData(): undefined | SuccessPayload<T>;
|
|
2562
2576
|
/**
|
|
2563
2577
|
* Alias for isMore
|
|
2578
|
+
*
|
|
2579
|
+
* @deprecated Will be removed in `2.0.0`. Tied to the `restApi:v2` envelope
|
|
2580
|
+
* field `next`, which `restApi:v3` does not return. Use the SDK's list
|
|
2581
|
+
* helpers — they hide pagination entirely:
|
|
2582
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
2583
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
2584
|
+
*
|
|
2585
|
+
* @removed 2.0.0
|
|
2564
2586
|
*/
|
|
2565
2587
|
hasMore(): boolean;
|
|
2588
|
+
/**
|
|
2589
|
+
* @deprecated Will be removed in `2.0.0`. Tied to the `restApi:v2` envelope
|
|
2590
|
+
* field `next`, which `restApi:v3` does not return. Use the SDK's list
|
|
2591
|
+
* helpers — they hide pagination entirely:
|
|
2592
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
2593
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
2594
|
+
*
|
|
2595
|
+
* @removed 2.0.0
|
|
2596
|
+
*/
|
|
2566
2597
|
isMore(): boolean;
|
|
2598
|
+
/**
|
|
2599
|
+
* @deprecated Will be removed in `2.0.0`. Tied to the `restApi:v2` envelope
|
|
2600
|
+
* field `total`, which `restApi:v3` does not return. For `restApi:v3` the
|
|
2601
|
+
* SDK exposes element counts via the `aggregate` action (`count` /
|
|
2602
|
+
* `countDistinct`); for `restApi:v2` use the list helpers, which iterate
|
|
2603
|
+
* without exposing `total`.
|
|
2604
|
+
*
|
|
2605
|
+
* @removed 2.0.0
|
|
2606
|
+
*/
|
|
2567
2607
|
getTotal(): number;
|
|
2568
2608
|
getStatus(): number;
|
|
2569
2609
|
getQuery(): Readonly<AjaxQuery>;
|
|
@@ -2571,9 +2611,25 @@ declare class AjaxResult<T = unknown> extends Result<Payload<T>> implements IRes
|
|
|
2571
2611
|
* Alias for getNext
|
|
2572
2612
|
* @param http
|
|
2573
2613
|
*
|
|
2574
|
-
* @
|
|
2614
|
+
* @deprecated Will be removed in `2.0.0`. `restApi:v3` does not support
|
|
2615
|
+
* `getNext()` (the v2 envelope field `next` does not exist). Use the SDK's
|
|
2616
|
+
* list helpers instead — they hide pagination entirely:
|
|
2617
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
2618
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
2619
|
+
*
|
|
2620
|
+
* @removed 2.0.0
|
|
2575
2621
|
*/
|
|
2576
2622
|
fetchNext(http: TypeHttp): Promise<AjaxResult<T> | null>;
|
|
2623
|
+
/**
|
|
2624
|
+
* @deprecated Will be removed in `2.0.0`. Throws on `restApi:v3` because the
|
|
2625
|
+
* v2 envelope field `next` is not part of the v3 protocol. Use the SDK's
|
|
2626
|
+
* list helpers instead — they hide pagination entirely:
|
|
2627
|
+
* - `restApi:v2`: {@link CallListV2.make `b24.actions.v2.callList.make`} or {@link FetchListV2.make `b24.actions.v2.fetchList.make`}
|
|
2628
|
+
* - `restApi:v3`: {@link CallListV3.make `b24.actions.v3.callList.make`} or {@link FetchListV3.make `b24.actions.v3.fetchList.make`}
|
|
2629
|
+
*
|
|
2630
|
+
* @throws {SdkError} `JSSDK_CORE_METHOD_NOT_SUPPORT_IN_API_V3` when called against a `restApi:v3` HTTP client. This throw is preserved until `2.0.0`.
|
|
2631
|
+
* @removed 2.0.0
|
|
2632
|
+
*/
|
|
2577
2633
|
getNext(http: TypeHttp): Promise<AjaxResult<T> | false>;
|
|
2578
2634
|
setData(): never;
|
|
2579
2635
|
}
|
|
@@ -4898,10 +4954,26 @@ declare class DialogManager {
|
|
|
4898
4954
|
*/
|
|
4899
4955
|
selectAccess(blockedAccessPermissions?: string[]): Promise<SelectedAccess[]>;
|
|
4900
4956
|
/**
|
|
4901
|
-
*
|
|
4957
|
+
* Invokes the system dialog for selecting CRM entities
|
|
4958
|
+
* (leads, contacts, companies, deals, quotes).
|
|
4902
4959
|
*
|
|
4903
|
-
*
|
|
4904
|
-
*
|
|
4960
|
+
* The resolved `SelectedCRM` object contains a separate bucket per
|
|
4961
|
+
* entity type. Each present bucket is a real `Array`, so consumers can
|
|
4962
|
+
* use `.length`, `.map()`, `for..of`, etc. directly. Buckets for entity
|
|
4963
|
+
* types that were not selected (or not requested via `entityType`) are
|
|
4964
|
+
* left `undefined` rather than being set to an empty array.
|
|
4965
|
+
*
|
|
4966
|
+
* Note: the parent window historically returned each bucket as a
|
|
4967
|
+
* `Record<string, SelectedCRMEntity>` (e.g. `{ 0: {...}, 1: {...} }`).
|
|
4968
|
+
* The SDK normalizes that response to a real array before returning it.
|
|
4969
|
+
*
|
|
4970
|
+
* @param {SelectCRMParams} [params] - Filter and behavior options.
|
|
4971
|
+
* - `entityType`: which entity types are shown in the dialog.
|
|
4972
|
+
* - `multiple`: allow multiple selection (default `false`).
|
|
4973
|
+
* - `value`: pre-selected entities (only applied when `multiple` is `true`).
|
|
4974
|
+
* @return {Promise<SelectedCRM>} Resolves to an object whose properties
|
|
4975
|
+
* (`lead`, `contact`, `company`, `deal`, `quote`) are arrays of
|
|
4976
|
+
* {@link SelectedCRMEntity} objects.
|
|
4905
4977
|
*
|
|
4906
4978
|
* @link https://apidocs.bitrix24.com/sdk/bx24-js-sdk/system-dialogues/bx24-select-crm.html
|
|
4907
4979
|
*/
|
|
@@ -4989,14 +5061,38 @@ declare class PlacementManager {
|
|
|
4989
5061
|
bindEvent(eventName: string, callBack: (...args: any[]) => void): Promise<any>;
|
|
4990
5062
|
/**
|
|
4991
5063
|
* Call the Registered Interface Command
|
|
4992
|
-
* @param { string } command
|
|
4993
|
-
* @param { Record<string, any> } parameters
|
|
4994
|
-
* @return { Promise<any> }
|
|
4995
5064
|
*
|
|
4996
5065
|
* @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-call.html
|
|
4997
|
-
*
|
|
5066
|
+
*
|
|
5067
|
+
* @memo The `setValue` command is special: the parent window calls `JSON.parse(value)`
|
|
5068
|
+
* on the received payload, so `value` MUST be a JSON-serialized string
|
|
5069
|
+
* (e.g. `JSON.stringify('test')` or `JSON.stringify({ a: 1 })`).
|
|
5070
|
+
* Prefer {@link PlacementManager.setValue} which serializes for you.
|
|
5071
|
+
*
|
|
5072
|
+
* @throws {TypeError} when `command === 'setValue'` and `parameters.value` is not a string.
|
|
4998
5073
|
*/
|
|
5074
|
+
call(command: 'setValue', parameters: {
|
|
5075
|
+
value: string;
|
|
5076
|
+
}): Promise<any>;
|
|
4999
5077
|
call(command: string, parameters?: Record<string, any>): Promise<any>;
|
|
5078
|
+
/**
|
|
5079
|
+
* Set Value for the Current Embedding Location
|
|
5080
|
+
*
|
|
5081
|
+
* Convenience wrapper around `placement.call('setValue', ...)` that handles
|
|
5082
|
+
* JSON serialization. Pass any value (string, number, boolean, object, array)
|
|
5083
|
+
* — it will be serialized via `JSON.stringify` before being sent to the
|
|
5084
|
+
* parent window, which performs `JSON.parse` on receipt.
|
|
5085
|
+
*
|
|
5086
|
+
* @param { unknown } value Any JSON-serializable value
|
|
5087
|
+
* @return { Promise<any> }
|
|
5088
|
+
*
|
|
5089
|
+
* @link https://apidocs.bitrix24.com/api-reference/widgets/ui-interaction/bx24-placement-call.html
|
|
5090
|
+
*
|
|
5091
|
+
* @example
|
|
5092
|
+
* await b24.placement.setValue('test')
|
|
5093
|
+
* await b24.placement.setValue({ id: 1, title: 'demo' })
|
|
5094
|
+
*/
|
|
5095
|
+
setValue(value: unknown): Promise<any>;
|
|
5000
5096
|
/**
|
|
5001
5097
|
* Set Up the Interface Event Handler
|
|
5002
5098
|
* @param {string} command
|
package/dist/esm/index.mjs
CHANGED