@bitrix24/b24jssdk 1.0.6 → 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 +1 -1
- package/dist/esm/core/actions/v2/call.mjs +1 -1
- package/dist/esm/core/actions/v2/fetch-list.mjs +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 +1 -1
- package/dist/esm/core/actions/v3/call.mjs +1 -1
- package/dist/esm/core/actions/v3/fetch-list.mjs +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 +1 -1
- 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 +105 -9
- package/dist/esm/index.d.ts +105 -9
- 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 +122 -19
- 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/esm/index.d.mts
CHANGED
|
@@ -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
|
@@ -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
package/dist/esm/oauth/auth.mjs
CHANGED
package/dist/esm/oauth/b24.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-manager.mjs","sources":["../../../src/pullClient/channel-manager.ts"],"sourcesContent":["import type { AjaxResult } from '../core/http/ajax-result'\nimport type { TypeChanel, TypeChannelManagerParams, TypePublicIdDescriptor } from '../types/pull'\nimport type { TypeB24 } from '../types/b24'\nimport type { SuccessPayload } from '../types/payloads'\nimport type { LoggerInterface } from '../logger'\nimport { LoggerFactory } from '../logger'\n\nexport class ChannelManager {\n private _logger: LoggerInterface\n private _publicIds: Map<number, TypeChanel>\n private _restClient: TypeB24\n private _getPublicListMethod: string\n\n constructor(params: TypeChannelManagerParams) {\n this._logger = LoggerFactory.createNullLogger()\n this._publicIds = new Map()\n\n this._restClient = params.b24\n this._getPublicListMethod = params.getPublicListMethod\n }\n\n setLogger(logger: LoggerInterface): void {\n this._logger = logger\n }\n\n getLogger(): LoggerInterface {\n return this._logger\n }\n\n /**\n * @param {Array} users Array of user ids.\n * @return {Promise}\n */\n async getPublicIds(users: number[]): Promise<Record<number, TypeChanel>> {\n const now = new Date()\n\n const result: Record<number, TypeChanel> = {}\n const unknownUsers: number[] = []\n\n for (const userId of users) {\n const chanel = this._publicIds.get(userId)\n\n if (chanel && chanel.end > now) {\n result[chanel.userId] = chanel\n } else {\n unknownUsers.push(userId)\n }\n }\n\n if (unknownUsers.length === 0) {\n return Promise.resolve(result)\n }\n\n /**\n * @memo we not use Promise.reject()\n */\n return new Promise((resolve) => {\n this._restClient\n .callMethod(this._getPublicListMethod, {\n users: unknownUsers\n })\n .then((response: AjaxResult) => {\n const data = (response.getData() as SuccessPayload<TypePublicIdDescriptor
|
|
1
|
+
{"version":3,"file":"channel-manager.mjs","sources":["../../../src/pullClient/channel-manager.ts"],"sourcesContent":["import type { AjaxResult } from '../core/http/ajax-result'\nimport type { TypeChanel, TypeChannelManagerParams, TypePublicIdDescriptor } from '../types/pull'\nimport type { TypeB24 } from '../types/b24'\nimport type { SuccessPayload } from '../types/payloads'\nimport type { LoggerInterface } from '../logger'\nimport { LoggerFactory } from '../logger'\n\nexport class ChannelManager {\n private _logger: LoggerInterface\n private _publicIds: Map<number, TypeChanel>\n private _restClient: TypeB24\n private _getPublicListMethod: string\n\n constructor(params: TypeChannelManagerParams) {\n this._logger = LoggerFactory.createNullLogger()\n this._publicIds = new Map()\n\n this._restClient = params.b24\n this._getPublicListMethod = params.getPublicListMethod\n }\n\n setLogger(logger: LoggerInterface): void {\n this._logger = logger\n }\n\n getLogger(): LoggerInterface {\n return this._logger\n }\n\n /**\n * @param {Array} users Array of user ids.\n * @return {Promise}\n */\n async getPublicIds(users: number[]): Promise<Record<number, TypeChanel>> {\n const now = new Date()\n\n const result: Record<number, TypeChanel> = {}\n const unknownUsers: number[] = []\n\n for (const userId of users) {\n const chanel = this._publicIds.get(userId)\n\n if (chanel && chanel.end > now) {\n result[chanel.userId] = chanel\n } else {\n unknownUsers.push(userId)\n }\n }\n\n if (unknownUsers.length === 0) {\n return Promise.resolve(result)\n }\n\n /**\n * @memo we not use Promise.reject()\n */\n return new Promise((resolve) => {\n this._restClient\n .callMethod(this._getPublicListMethod, {\n users: unknownUsers\n })\n .then((response: AjaxResult) => {\n const data = (response.getData() as SuccessPayload<Record<string, TypePublicIdDescriptor>>).result\n\n /**\n * @memo test this\n */\n this.setPublicIds(Object.values(data))\n\n for (const userId of unknownUsers) {\n const chanel = this._publicIds.get(userId)\n if (chanel) {\n result[chanel.userId] = chanel\n }\n }\n\n resolve(result)\n })\n .catch((error: Error | string) => {\n this.getLogger().error('some error in getPublicIds', { error })\n return resolve({})\n })\n })\n }\n\n /**\n * @param {TypePublicIdDescriptor[]} publicIds\n */\n public setPublicIds(publicIds: TypePublicIdDescriptor[]): void {\n publicIds.forEach((publicIdDescriptor: TypePublicIdDescriptor) => {\n const userId = Number(publicIdDescriptor.user_id)\n this._publicIds.set(userId, {\n userId: userId,\n publicId: publicIdDescriptor.public_id,\n signature: publicIdDescriptor.signature,\n start: new Date(publicIdDescriptor.start),\n end: new Date(publicIdDescriptor.end)\n } as TypeChanel)\n })\n }\n}\n"],"names":[],"mappings":"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"}
|