@bitrix24/b24jssdk 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-AI.md +6 -5
- package/README.md +2 -0
- package/dist/cjs/_virtual/_commonjsHelpers.cjs +19 -0
- package/dist/cjs/_virtual/_commonjsHelpers.cjs.map +1 -0
- package/dist/cjs/_virtual/protobuf.cjs +20 -0
- package/dist/cjs/_virtual/protobuf.cjs.map +1 -0
- package/dist/cjs/_virtual/protobuf2.cjs +14 -0
- package/dist/cjs/_virtual/protobuf2.cjs.map +1 -0
- package/dist/cjs/core/abstract-b24.cjs +357 -0
- package/dist/cjs/core/abstract-b24.cjs.map +1 -0
- package/dist/cjs/core/actions/abstract-action.cjs +26 -0
- package/dist/cjs/core/actions/abstract-action.cjs.map +1 -0
- package/dist/cjs/core/actions/abstract-batch.cjs +97 -0
- package/dist/cjs/core/actions/abstract-batch.cjs.map +1 -0
- package/dist/cjs/core/actions/manager.cjs +55 -0
- package/dist/cjs/core/actions/manager.cjs.map +1 -0
- package/dist/cjs/core/actions/v2/batch-by-chunk.cjs +95 -0
- package/dist/cjs/core/actions/v2/batch-by-chunk.cjs.map +1 -0
- package/dist/cjs/core/actions/v2/batch.cjs +128 -0
- package/dist/cjs/core/actions/v2/batch.cjs.map +1 -0
- package/dist/cjs/core/actions/v2/call-list.cjs +144 -0
- package/dist/cjs/core/actions/v2/call-list.cjs.map +1 -0
- package/dist/cjs/core/actions/v2/call.cjs +56 -0
- package/dist/cjs/core/actions/v2/call.cjs.map +1 -0
- package/dist/cjs/core/actions/v2/fetch-list.cjs +145 -0
- package/dist/cjs/core/actions/v2/fetch-list.cjs.map +1 -0
- package/dist/cjs/core/actions/v2/manager-v2.cjs +76 -0
- package/dist/cjs/core/actions/v2/manager-v2.cjs.map +1 -0
- package/dist/cjs/core/actions/v3/_keyset-paginate.cjs +69 -0
- package/dist/cjs/core/actions/v3/_keyset-paginate.cjs.map +1 -0
- package/dist/cjs/core/actions/v3/aggregate.cjs +96 -0
- package/dist/cjs/core/actions/v3/aggregate.cjs.map +1 -0
- package/dist/cjs/core/actions/v3/batch-by-chunk.cjs +93 -0
- package/dist/cjs/core/actions/v3/batch-by-chunk.cjs.map +1 -0
- package/dist/cjs/core/actions/v3/batch.cjs +122 -0
- package/dist/cjs/core/actions/v3/batch.cjs.map +1 -0
- package/dist/cjs/core/actions/v3/call-list.cjs +126 -0
- package/dist/cjs/core/actions/v3/call-list.cjs.map +1 -0
- package/dist/cjs/core/actions/v3/call-tail.cjs +118 -0
- package/dist/cjs/core/actions/v3/call-tail.cjs.map +1 -0
- package/dist/cjs/core/actions/v3/call.cjs +51 -0
- package/dist/cjs/core/actions/v3/call.cjs.map +1 -0
- package/dist/cjs/core/actions/v3/fetch-list.cjs +122 -0
- package/dist/cjs/core/actions/v3/fetch-list.cjs.map +1 -0
- package/dist/cjs/core/actions/v3/fetch-tail.cjs +112 -0
- package/dist/cjs/core/actions/v3/fetch-tail.cjs.map +1 -0
- package/dist/cjs/core/actions/v3/manager-v3.cjs +100 -0
- package/dist/cjs/core/actions/v3/manager-v3.cjs.map +1 -0
- package/dist/cjs/core/http/abstract-http.cjs +641 -0
- package/dist/cjs/core/http/abstract-http.cjs.map +1 -0
- package/dist/cjs/core/http/ajax-error.cjs +113 -0
- package/dist/cjs/core/http/ajax-error.cjs.map +1 -0
- package/dist/cjs/core/http/ajax-result.cjs +219 -0
- package/dist/cjs/core/http/ajax-result.cjs.map +1 -0
- package/dist/cjs/core/http/limiters/adaptive-delayer.cjs +137 -0
- package/dist/cjs/core/http/limiters/adaptive-delayer.cjs.map +1 -0
- package/dist/cjs/core/http/limiters/manager.cjs +373 -0
- package/dist/cjs/core/http/limiters/manager.cjs.map +1 -0
- package/dist/cjs/core/http/limiters/operating-limiter.cjs +173 -0
- package/dist/cjs/core/http/limiters/operating-limiter.cjs.map +1 -0
- package/dist/cjs/core/http/limiters/params-factory.cjs +124 -0
- package/dist/cjs/core/http/limiters/params-factory.cjs.map +1 -0
- package/dist/cjs/core/http/limiters/rate-limiter.cjs +404 -0
- package/dist/cjs/core/http/limiters/rate-limiter.cjs.map +1 -0
- package/dist/cjs/core/http/redact.cjs +85 -0
- package/dist/cjs/core/http/redact.cjs.map +1 -0
- package/dist/cjs/core/http/v2.cjs +85 -0
- package/dist/cjs/core/http/v2.cjs.map +1 -0
- package/dist/cjs/core/http/v3.cjs +82 -0
- package/dist/cjs/core/http/v3.cjs.map +1 -0
- package/dist/cjs/core/interaction/batch/abstract-interaction-batch.cjs +71 -0
- package/dist/cjs/core/interaction/batch/abstract-interaction-batch.cjs.map +1 -0
- package/dist/cjs/core/interaction/batch/parse-row.cjs +69 -0
- package/dist/cjs/core/interaction/batch/parse-row.cjs.map +1 -0
- package/dist/cjs/core/interaction/batch/processing/interface-strategy.cjs +87 -0
- package/dist/cjs/core/interaction/batch/processing/interface-strategy.cjs.map +1 -0
- package/dist/cjs/core/interaction/batch/processing/v2/abstract-processing.cjs +138 -0
- package/dist/cjs/core/interaction/batch/processing/v2/abstract-processing.cjs.map +1 -0
- package/dist/cjs/core/interaction/batch/processing/v2/as-array.cjs +34 -0
- package/dist/cjs/core/interaction/batch/processing/v2/as-array.cjs.map +1 -0
- package/dist/cjs/core/interaction/batch/processing/v2/as-object.cjs +34 -0
- package/dist/cjs/core/interaction/batch/processing/v2/as-object.cjs.map +1 -0
- package/dist/cjs/core/interaction/batch/processing/v3/abstract-processing.cjs +115 -0
- package/dist/cjs/core/interaction/batch/processing/v3/abstract-processing.cjs.map +1 -0
- package/dist/cjs/core/interaction/batch/processing/v3/as-array.cjs +34 -0
- package/dist/cjs/core/interaction/batch/processing/v3/as-array.cjs.map +1 -0
- package/dist/cjs/core/interaction/batch/processing/v3/as-object.cjs +34 -0
- package/dist/cjs/core/interaction/batch/processing/v3/as-object.cjs.map +1 -0
- package/dist/cjs/core/interaction/batch/v2.cjs +47 -0
- package/dist/cjs/core/interaction/batch/v2.cjs.map +1 -0
- package/dist/cjs/core/interaction/batch/v3.cjs +45 -0
- package/dist/cjs/core/interaction/batch/v3.cjs.map +1 -0
- package/dist/cjs/core/language/list.cjs +59 -0
- package/dist/cjs/core/language/list.cjs.map +1 -0
- package/dist/cjs/core/request-id-generator.cjs +44 -0
- package/dist/cjs/core/request-id-generator.cjs.map +1 -0
- package/dist/cjs/core/result.cjs +137 -0
- package/dist/cjs/core/result.cjs.map +1 -0
- package/dist/cjs/core/sdk-error.cjs +85 -0
- package/dist/cjs/core/sdk-error.cjs.map +1 -0
- package/dist/cjs/core/tools/abstract-tool.cjs +26 -0
- package/dist/cjs/core/tools/abstract-tool.cjs.map +1 -0
- package/dist/cjs/core/tools/healthcheck.cjs +50 -0
- package/dist/cjs/core/tools/healthcheck.cjs.map +1 -0
- package/dist/cjs/core/tools/manager.cjs +52 -0
- package/dist/cjs/core/tools/manager.cjs.map +1 -0
- package/dist/cjs/core/tools/ping.cjs +58 -0
- package/dist/cjs/core/tools/ping.cjs.map +1 -0
- package/dist/cjs/core/version-manager.cjs +57 -0
- package/dist/cjs/core/version-manager.cjs.map +1 -0
- package/dist/cjs/frame/auth.cjs +100 -0
- package/dist/cjs/frame/auth.cjs.map +1 -0
- package/dist/cjs/frame/b24.cjs +178 -0
- package/dist/cjs/frame/b24.cjs.map +1 -0
- package/dist/cjs/frame/dialog.cjs +120 -0
- package/dist/cjs/frame/dialog.cjs.map +1 -0
- package/dist/cjs/frame/frame.cjs +103 -0
- package/dist/cjs/frame/frame.cjs.map +1 -0
- package/dist/cjs/frame/message/commands.cjs +39 -0
- package/dist/cjs/frame/message/commands.cjs.map +1 -0
- package/dist/cjs/frame/message/controller.cjs +191 -0
- package/dist/cjs/frame/message/controller.cjs.map +1 -0
- package/dist/cjs/frame/options.cjs +108 -0
- package/dist/cjs/frame/options.cjs.map +1 -0
- package/dist/cjs/frame/parent.cjs +259 -0
- package/dist/cjs/frame/parent.cjs.map +1 -0
- package/dist/cjs/frame/placement.cjs +156 -0
- package/dist/cjs/frame/placement.cjs.map +1 -0
- package/dist/cjs/frame/slider.cjs +162 -0
- package/dist/cjs/frame/slider.cjs.map +1 -0
- package/dist/cjs/helper/abstract-helper.cjs +55 -0
- package/dist/cjs/helper/abstract-helper.cjs.map +1 -0
- package/dist/cjs/helper/app-manager.cjs +39 -0
- package/dist/cjs/helper/app-manager.cjs.map +1 -0
- package/dist/cjs/helper/currency-manager.cjs +215 -0
- package/dist/cjs/helper/currency-manager.cjs.map +1 -0
- package/dist/cjs/helper/helper-manager.cjs +397 -0
- package/dist/cjs/helper/helper-manager.cjs.map +1 -0
- package/dist/cjs/helper/license-manager.cjs +52 -0
- package/dist/cjs/helper/license-manager.cjs.map +1 -0
- package/dist/cjs/helper/options-manager.cjs +205 -0
- package/dist/cjs/helper/options-manager.cjs.map +1 -0
- package/dist/cjs/helper/payment-manager.cjs +35 -0
- package/dist/cjs/helper/payment-manager.cjs.map +1 -0
- package/dist/cjs/helper/profile-manager.cjs +35 -0
- package/dist/cjs/helper/profile-manager.cjs.map +1 -0
- package/dist/cjs/helper/use-b24-helper.cjs +85 -0
- package/dist/cjs/helper/use-b24-helper.cjs.map +1 -0
- package/dist/cjs/hook/auth.cjs +79 -0
- package/dist/cjs/hook/auth.cjs.map +1 -0
- package/dist/cjs/hook/b24.cjs +117 -0
- package/dist/cjs/hook/b24.cjs.map +1 -0
- package/dist/cjs/index.cjs +176 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +6415 -0
- package/dist/cjs/index.d.mts +6415 -0
- package/dist/cjs/index.d.ts +6415 -0
- package/dist/cjs/loader-b24frame.cjs +103 -0
- package/dist/cjs/loader-b24frame.cjs.map +1 -0
- package/dist/cjs/logger/abstract-logger.cjs +71 -0
- package/dist/cjs/logger/abstract-logger.cjs.map +1 -0
- package/dist/cjs/logger/browser.cjs +165 -0
- package/dist/cjs/logger/browser.cjs.map +1 -0
- package/dist/cjs/logger/formatter/abstract-formatter.cjs +36 -0
- package/dist/cjs/logger/formatter/abstract-formatter.cjs.map +1 -0
- package/dist/cjs/logger/formatter/json-formatter.cjs +36 -0
- package/dist/cjs/logger/formatter/json-formatter.cjs.map +1 -0
- package/dist/cjs/logger/formatter/line-formatter.cjs +43 -0
- package/dist/cjs/logger/formatter/line-formatter.cjs.map +1 -0
- package/dist/cjs/logger/formatter/telegram-formatter.cjs +105 -0
- package/dist/cjs/logger/formatter/telegram-formatter.cjs.map +1 -0
- package/dist/cjs/logger/handler/abstract-handler.cjs +41 -0
- package/dist/cjs/logger/handler/abstract-handler.cjs.map +1 -0
- package/dist/cjs/logger/handler/consola-adapter.cjs +64 -0
- package/dist/cjs/logger/handler/consola-adapter.cjs.map +1 -0
- package/dist/cjs/logger/handler/console-handler.cjs +100 -0
- package/dist/cjs/logger/handler/console-handler.cjs.map +1 -0
- package/dist/cjs/logger/handler/console-v2-handler.cjs +53 -0
- package/dist/cjs/logger/handler/console-v2-handler.cjs.map +1 -0
- package/dist/cjs/logger/handler/memory-handler.cjs +50 -0
- package/dist/cjs/logger/handler/memory-handler.cjs.map +1 -0
- package/dist/cjs/logger/handler/stream-handler.cjs +75 -0
- package/dist/cjs/logger/handler/stream-handler.cjs.map +1 -0
- package/dist/cjs/logger/handler/telegram-handler.cjs +159 -0
- package/dist/cjs/logger/handler/telegram-handler.cjs.map +1 -0
- package/dist/cjs/logger/handler/winston-adapter.cjs +59 -0
- package/dist/cjs/logger/handler/winston-adapter.cjs.map +1 -0
- package/dist/cjs/logger/logger-factory.cjs +69 -0
- package/dist/cjs/logger/logger-factory.cjs.map +1 -0
- package/dist/cjs/logger/logger.cjs +78 -0
- package/dist/cjs/logger/logger.cjs.map +1 -0
- package/dist/cjs/logger/null-logger.cjs +34 -0
- package/dist/cjs/logger/null-logger.cjs.map +1 -0
- package/dist/cjs/logger/processor/memory-usage-processor.cjs +22 -0
- package/dist/cjs/logger/processor/memory-usage-processor.cjs.map +1 -0
- package/dist/cjs/logger/processor/pid-processor.cjs +22 -0
- package/dist/cjs/logger/processor/pid-processor.cjs.map +1 -0
- package/dist/cjs/oauth/auth.cjs +214 -0
- package/dist/cjs/oauth/auth.cjs.map +1 -0
- package/dist/cjs/oauth/b24.cjs +119 -0
- package/dist/cjs/oauth/b24.cjs.map +1 -0
- package/dist/cjs/oauth/refresh-token-error.cjs +22 -0
- package/dist/cjs/oauth/refresh-token-error.cjs.map +1 -0
- package/dist/cjs/pullClient/abstract-connector.cjs +80 -0
- package/dist/cjs/pullClient/abstract-connector.cjs.map +1 -0
- package/dist/cjs/pullClient/channel-manager.cjs +91 -0
- package/dist/cjs/pullClient/channel-manager.cjs.map +1 -0
- package/dist/cjs/pullClient/client.cjs +2177 -0
- package/dist/cjs/pullClient/client.cjs.map +1 -0
- package/dist/cjs/pullClient/errors.cjs +34 -0
- package/dist/cjs/pullClient/errors.cjs.map +1 -0
- package/dist/cjs/pullClient/json-rpc.cjs +213 -0
- package/dist/cjs/pullClient/json-rpc.cjs.map +1 -0
- package/dist/cjs/pullClient/long-polling-connector.cjs +159 -0
- package/dist/cjs/pullClient/long-polling-connector.cjs.map +1 -0
- package/dist/cjs/pullClient/protobuf/index.cjs +22 -0
- package/dist/cjs/pullClient/protobuf/index.cjs.map +1 -0
- package/dist/cjs/pullClient/protobuf/model.cjs +1060 -0
- package/dist/cjs/pullClient/protobuf/model.cjs.map +1 -0
- package/dist/cjs/pullClient/protobuf/protobuf.cjs +4655 -0
- package/dist/cjs/pullClient/protobuf/protobuf.cjs.map +1 -0
- package/dist/cjs/pullClient/shared-config.cjs +135 -0
- package/dist/cjs/pullClient/shared-config.cjs.map +1 -0
- package/dist/cjs/pullClient/storage-manager.cjs +74 -0
- package/dist/cjs/pullClient/storage-manager.cjs.map +1 -0
- package/dist/cjs/pullClient/web-socket-connector.cjs +131 -0
- package/dist/cjs/pullClient/web-socket-connector.cjs.map +1 -0
- package/dist/cjs/tools/batch-ref-v3.cjs +54 -0
- package/dist/cjs/tools/batch-ref-v3.cjs.map +1 -0
- package/dist/cjs/tools/browser.cjs +156 -0
- package/dist/cjs/tools/browser.cjs.map +1 -0
- package/dist/cjs/tools/environment.cjs +32 -0
- package/dist/cjs/tools/environment.cjs.map +1 -0
- package/dist/cjs/tools/filter-v3.cjs +139 -0
- package/dist/cjs/tools/filter-v3.cjs.map +1 -0
- package/dist/cjs/tools/formatters/iban.cjs +307 -0
- package/dist/cjs/tools/formatters/iban.cjs.map +1 -0
- package/dist/cjs/tools/formatters/numbers.cjs +68 -0
- package/dist/cjs/tools/formatters/numbers.cjs.map +1 -0
- package/dist/cjs/tools/index.cjs +42 -0
- package/dist/cjs/tools/index.cjs.map +1 -0
- package/dist/cjs/tools/scroll-size.cjs +29 -0
- package/dist/cjs/tools/scroll-size.cjs.map +1 -0
- package/dist/cjs/tools/text.cjs +210 -0
- package/dist/cjs/tools/text.cjs.map +1 -0
- package/dist/cjs/tools/type.cjs +339 -0
- package/dist/cjs/tools/type.cjs.map +1 -0
- package/dist/cjs/tools/use-formatters.cjs +462 -0
- package/dist/cjs/tools/use-formatters.cjs.map +1 -0
- package/dist/cjs/tools/uuidv7.cjs +58 -0
- package/dist/cjs/tools/uuidv7.cjs.map +1 -0
- package/dist/cjs/types/b24-helper.cjs +62 -0
- package/dist/cjs/types/b24-helper.cjs.map +1 -0
- package/dist/cjs/types/b24.cjs +18 -0
- package/dist/cjs/types/b24.cjs.map +1 -0
- package/dist/cjs/types/bizproc/index.cjs +195 -0
- package/dist/cjs/types/bizproc/index.cjs.map +1 -0
- package/dist/cjs/types/catalog/index.cjs +39 -0
- package/dist/cjs/types/catalog/index.cjs.map +1 -0
- package/dist/cjs/types/common.cjs +33 -0
- package/dist/cjs/types/common.cjs.map +1 -0
- package/dist/cjs/types/crm/entity-type.cjs +62 -0
- package/dist/cjs/types/crm/entity-type.cjs.map +1 -0
- package/dist/cjs/types/crm/productrow.cjs +19 -0
- package/dist/cjs/types/crm/productrow.cjs.map +1 -0
- package/dist/cjs/types/logger.cjs +24 -0
- package/dist/cjs/types/logger.cjs.map +1 -0
- package/dist/cjs/types/pull.cjs +94 -0
- package/dist/cjs/types/pull.cjs.map +1 -0
- 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 +17 -10
- package/dist/esm/core/actions/v2/call-list.mjs.map +1 -1
- package/dist/esm/core/actions/v2/call.mjs +1 -15
- package/dist/esm/core/actions/v2/call.mjs.map +1 -1
- package/dist/esm/core/actions/v2/fetch-list.mjs +17 -10
- package/dist/esm/core/actions/v2/fetch-list.mjs.map +1 -1
- package/dist/esm/core/actions/v2/manager-v2.mjs +6 -6
- package/dist/esm/core/actions/v2/manager-v2.mjs.map +1 -1
- package/dist/esm/core/actions/v3/_keyset-paginate.mjs +66 -0
- package/dist/esm/core/actions/v3/_keyset-paginate.mjs.map +1 -0
- package/dist/esm/core/actions/v3/aggregate.mjs +94 -0
- package/dist/esm/core/actions/v3/aggregate.mjs.map +1 -0
- package/dist/esm/core/actions/v3/batch-by-chunk.mjs +1 -1
- package/dist/esm/core/actions/v3/batch.mjs +1 -10
- package/dist/esm/core/actions/v3/batch.mjs.map +1 -1
- package/dist/esm/core/actions/v3/call-list.mjs +40 -47
- package/dist/esm/core/actions/v3/call-list.mjs.map +1 -1
- package/dist/esm/core/actions/v3/call-tail.mjs +116 -0
- package/dist/esm/core/actions/v3/call-tail.mjs.map +1 -0
- package/dist/esm/core/actions/v3/call.mjs +1 -10
- package/dist/esm/core/actions/v3/call.mjs.map +1 -1
- package/dist/esm/core/actions/v3/fetch-list.mjs +34 -44
- package/dist/esm/core/actions/v3/fetch-list.mjs.map +1 -1
- package/dist/esm/core/actions/v3/fetch-tail.mjs +110 -0
- package/dist/esm/core/actions/v3/fetch-tail.mjs.map +1 -0
- package/dist/esm/core/actions/v3/manager-v3.mjs +30 -6
- package/dist/esm/core/actions/v3/manager-v3.mjs.map +1 -1
- package/dist/esm/core/http/abstract-http.mjs +96 -21
- package/dist/esm/core/http/abstract-http.mjs.map +1 -1
- package/dist/esm/core/http/ajax-error.mjs +1 -1
- package/dist/esm/core/http/ajax-result.mjs +9 -8
- 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 +2 -1
- package/dist/esm/core/http/limiters/manager.mjs.map +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/redact.mjs +41 -13
- package/dist/esm/core/http/redact.mjs.map +1 -1
- package/dist/esm/core/http/v2.mjs +1 -18
- package/dist/esm/core/http/v2.mjs.map +1 -1
- package/dist/esm/core/http/v3.mjs +1 -15
- package/dist/esm/core/http/v3.mjs.map +1 -1
- 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 +44 -1
- package/dist/esm/core/interaction/batch/processing/interface-strategy.mjs.map +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/abstract-processing.mjs +7 -6
- 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 +3 -3
- package/dist/esm/core/interaction/batch/processing/v2/as-array.mjs.map +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 +7 -19
- 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 +3 -3
- package/dist/esm/core/interaction/batch/processing/v3/as-array.mjs.map +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 +35 -1
- package/dist/esm/core/result.mjs.map +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 +3 -3
- package/dist/esm/core/tools/manager.mjs.map +1 -1
- package/dist/esm/core/tools/ping.mjs +1 -1
- package/dist/esm/core/version-manager.mjs +19 -80
- package/dist/esm/core/version-manager.mjs.map +1 -1
- package/dist/esm/frame/auth.mjs +1 -1
- package/dist/esm/frame/b24.mjs +8 -2
- package/dist/esm/frame/b24.mjs.map +1 -1
- package/dist/esm/frame/dialog.mjs +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 +17 -6
- package/dist/esm/frame/message/controller.mjs.map +1 -1
- package/dist/esm/frame/options.mjs +1 -1
- package/dist/esm/frame/parent.mjs +6 -2
- package/dist/esm/frame/parent.mjs.map +1 -1
- package/dist/esm/frame/placement.mjs +1 -1
- package/dist/esm/frame/slider.mjs +5 -1
- package/dist/esm/frame/slider.mjs.map +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 +3 -3
- package/dist/esm/hook/b24.mjs.map +1 -1
- package/dist/esm/index.d.mts +501 -49
- package/dist/esm/index.d.ts +501 -49
- package/dist/esm/index.mjs +3 -1
- package/dist/esm/index.mjs.map +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 +13 -16
- package/dist/esm/oauth/auth.mjs.map +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/client.mjs +141 -30
- package/dist/esm/pullClient/client.mjs.map +1 -1
- package/dist/esm/pullClient/errors.mjs +1 -1
- package/dist/esm/pullClient/json-rpc.mjs +5 -4
- package/dist/esm/pullClient/json-rpc.mjs.map +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/batch-ref-v3.mjs +52 -0
- package/dist/esm/tools/batch-ref-v3.mjs.map +1 -0
- package/dist/esm/tools/browser.mjs +1 -1
- package/dist/esm/tools/environment.mjs +1 -1
- package/dist/esm/tools/filter-v3.mjs +137 -0
- package/dist/esm/tools/filter-v3.mjs.map +1 -0
- 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 +1384 -680
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/index.min.js +26 -26
- package/dist/umd/index.min.js.map +1 -1
- package/dist/umd/package.json +3 -0
- package/package.json +12 -4
package/dist/esm/index.d.mts
CHANGED
|
@@ -1006,6 +1006,7 @@ interface IResult<T = any> {
|
|
|
1006
1006
|
* Retrieves an iterator for the errors collected in the result.
|
|
1007
1007
|
*
|
|
1008
1008
|
* @returns {IterableIterator<Error>} An iterator over the stored Error objects.
|
|
1009
|
+
* @see {@link IResult.getErrorsByKey} — keeps the request keys.
|
|
1009
1010
|
*/
|
|
1010
1011
|
getErrors: () => IterableIterator<Error>;
|
|
1011
1012
|
/**
|
|
@@ -1014,6 +1015,21 @@ interface IResult<T = any> {
|
|
|
1014
1015
|
* @returns {string[]} An array of strings representing the error messages.
|
|
1015
1016
|
*/
|
|
1016
1017
|
getErrorMessages: () => string[];
|
|
1018
|
+
/**
|
|
1019
|
+
* Retrieves all errors keyed by their identifier (e.g. the batch request key),
|
|
1020
|
+
* preserving which request produced each error. Unlike {@link getErrors}, the
|
|
1021
|
+
* keys are not discarded — useful for batch calls with `isHaltOnError: false`.
|
|
1022
|
+
*
|
|
1023
|
+
* @returns {Record<string, Error>} A map of error key to Error object.
|
|
1024
|
+
*/
|
|
1025
|
+
getErrorsByKey: () => Record<string, Error>;
|
|
1026
|
+
/**
|
|
1027
|
+
* Retrieves all error messages keyed by their identifier (e.g. the batch
|
|
1028
|
+
* request key). Unlike {@link getErrorMessages}, the keys are preserved.
|
|
1029
|
+
*
|
|
1030
|
+
* @returns {Record<string, string>} A map of error key to error message.
|
|
1031
|
+
*/
|
|
1032
|
+
getErrorMessagesByKey: () => Record<string, string>;
|
|
1017
1033
|
/**
|
|
1018
1034
|
* Checks for an error in a collection by key
|
|
1019
1035
|
* @param key - Error key
|
|
@@ -1050,6 +1066,34 @@ declare class Result<T = any> implements IResult<T> {
|
|
|
1050
1066
|
* contains the message of a corresponding error object.
|
|
1051
1067
|
*/
|
|
1052
1068
|
getErrorMessages(): string[];
|
|
1069
|
+
/**
|
|
1070
|
+
* Retrieves all errors as a plain object (a snapshot copy) keyed by their
|
|
1071
|
+
* identifier, preserving which request produced each error. Unlike
|
|
1072
|
+
* {@link Result.getErrors}, the keys are not discarded — useful for batch
|
|
1073
|
+
* calls with `isHaltOnError: false`.
|
|
1074
|
+
*
|
|
1075
|
+
* For batch calls the key tells you *which* command failed:
|
|
1076
|
+
* - an **object / named-command batch** keys each error by the command label;
|
|
1077
|
+
* - an **array-mode batch** keys each per-command error by its **numeric
|
|
1078
|
+
* position** (`'0'`, `'1'`, … as a string), matching the command order you
|
|
1079
|
+
* passed in. (#255 — previously these fell back to a random UUID.)
|
|
1080
|
+
*
|
|
1081
|
+
* An envelope-level soft error (not tied to one command) lands under the
|
|
1082
|
+
* internal `'base-error'` key, and {@link Result.addErrors} (no explicit key)
|
|
1083
|
+
* still uses generated UUIDs — for those, prefer {@link Result.getErrors} /
|
|
1084
|
+
* {@link Result.getErrorMessages}. (#230)
|
|
1085
|
+
*
|
|
1086
|
+
* @returns {Record<string, Error>} A map of error key to Error object.
|
|
1087
|
+
*/
|
|
1088
|
+
getErrorsByKey(): Record<string, Error>;
|
|
1089
|
+
/**
|
|
1090
|
+
* Retrieves all error messages as a plain object (a snapshot copy) keyed by
|
|
1091
|
+
* their identifier. Unlike {@link Result.getErrorMessages}, the keys are
|
|
1092
|
+
* preserved. See {@link Result.getErrorsByKey} for when keys are meaningful.
|
|
1093
|
+
*
|
|
1094
|
+
* @returns {Record<string, string>} A map of error key to error message.
|
|
1095
|
+
*/
|
|
1096
|
+
getErrorMessagesByKey(): Record<string, string>;
|
|
1053
1097
|
/**
|
|
1054
1098
|
* Converts the Result object to a string.
|
|
1055
1099
|
*
|
|
@@ -1465,6 +1509,7 @@ type ActionCallListV2 = ActionOptions & {
|
|
|
1465
1509
|
method: string;
|
|
1466
1510
|
params?: Omit<TypeCallParams, 'start' | 'order'>;
|
|
1467
1511
|
idKey?: string;
|
|
1512
|
+
cursorIdKey?: string;
|
|
1468
1513
|
customKeyForResult?: string;
|
|
1469
1514
|
requestId?: string;
|
|
1470
1515
|
};
|
|
@@ -1481,12 +1526,16 @@ declare class CallListV2 extends AbstractAction {
|
|
|
1481
1526
|
*
|
|
1482
1527
|
* @param {ActionCallListV2} options - parameters for executing the request.
|
|
1483
1528
|
* - `method: string` - The name of the REST API method that returns a list of data (for example: `crm.item.list`, `tasks.task.list`)
|
|
1484
|
-
* - `params?: Omit<TypeCallParams, 'start'>` - Request parameters, excluding the `start`
|
|
1529
|
+
* - `params?: Omit<TypeCallParams, 'start' | 'order'>` - Request parameters, excluding the `start` and `order` parameters,
|
|
1485
1530
|
* since the method is designed to obtain all data in one call.
|
|
1486
1531
|
* Note: Use `filter`, `order`, and `select` to control the selection.
|
|
1487
|
-
* - `idKey?: string` - The name of the field
|
|
1488
|
-
* Default is 'ID' (uppercase).
|
|
1489
|
-
*
|
|
1532
|
+
* - `idKey?: string` - The name of the id field as it appears in each RESPONSE item; its value
|
|
1533
|
+
* drives the cursor. Default is 'ID' (uppercase). For methods that return a lowercase /
|
|
1534
|
+
* camelCase id (for example `tasks.task.list` returns `id`), set `idKey: 'id'`.
|
|
1535
|
+
* - `cursorIdKey?: string` - The field name used in the REQUEST for `order` and the `>` page
|
|
1536
|
+
* filter. Defaults to `idKey`. Set it only when the sortable / filterable field name differs
|
|
1537
|
+
* from the response field name — e.g. `tasks.task.list` sorts and filters by `ID` (uppercase)
|
|
1538
|
+
* but returns `id` (lowercase): pass `idKey: 'id', cursorIdKey: 'ID'`.
|
|
1490
1539
|
* - `customKeyForResult?: string` - A custom key indicating that the response REST API will be
|
|
1491
1540
|
* grouped by this field.
|
|
1492
1541
|
* Example: `items` to group a list of CRM items.
|
|
@@ -1528,6 +1577,7 @@ type ActionFetchListV2 = ActionOptions & {
|
|
|
1528
1577
|
method: string;
|
|
1529
1578
|
params?: Omit<TypeCallParams, 'start' | 'order'>;
|
|
1530
1579
|
idKey?: string;
|
|
1580
|
+
cursorIdKey?: string;
|
|
1531
1581
|
customKeyForResult?: string;
|
|
1532
1582
|
requestId?: string;
|
|
1533
1583
|
};
|
|
@@ -1545,12 +1595,16 @@ declare class FetchListV2 extends AbstractAction {
|
|
|
1545
1595
|
*
|
|
1546
1596
|
* @param {ActionFetchListV2} options - parameters for executing the request.
|
|
1547
1597
|
* - `method: string` - The name of the REST API method that returns a list of data (for example: `crm.item.list`, `tasks.task.list`)
|
|
1548
|
-
* - `params?: Omit<TypeCallParams, 'start'>` - Request parameters, excluding the `start`
|
|
1598
|
+
* - `params?: Omit<TypeCallParams, 'start' | 'order'>` - Request parameters, excluding the `start` and `order` parameters,
|
|
1549
1599
|
* since the method is designed to obtain all data in one call.
|
|
1550
1600
|
* Note: Use `filter`, `order`, and `select` to control the selection.
|
|
1551
|
-
* - `idKey?: string` - The name of the field
|
|
1552
|
-
* Default is 'ID' (uppercase).
|
|
1553
|
-
*
|
|
1601
|
+
* - `idKey?: string` - The name of the id field as it appears in each RESPONSE item; its value
|
|
1602
|
+
* drives the cursor. Default is 'ID' (uppercase). For methods that return a lowercase /
|
|
1603
|
+
* camelCase id (for example `tasks.task.list` returns `id`), set `idKey: 'id'`.
|
|
1604
|
+
* - `cursorIdKey?: string` - The field name used in the REQUEST for `order` and the `>` page
|
|
1605
|
+
* filter. Defaults to `idKey`. Set it only when the sortable / filterable field name differs
|
|
1606
|
+
* from the response field name — e.g. `tasks.task.list` sorts and filters by `ID` (uppercase)
|
|
1607
|
+
* but returns `id` (lowercase): pass `idKey: 'id', cursorIdKey: 'ID'`.
|
|
1554
1608
|
* - `customKeyForResult?: string` - A custom key indicating that the response REST API will be
|
|
1555
1609
|
* grouped by this field.
|
|
1556
1610
|
* Example: `items` to group a list of CRM items.
|
|
@@ -1833,6 +1887,7 @@ type ActionCallListV3 = ActionOptions & {
|
|
|
1833
1887
|
method: string;
|
|
1834
1888
|
params?: Omit<TypeCallParams, 'pagination' | 'order'>;
|
|
1835
1889
|
idKey?: string;
|
|
1890
|
+
cursorIdKey?: string;
|
|
1836
1891
|
customKeyForResult: string;
|
|
1837
1892
|
requestId?: string;
|
|
1838
1893
|
limit?: number;
|
|
@@ -1850,11 +1905,15 @@ declare class CallListV3 extends AbstractAction {
|
|
|
1850
1905
|
*
|
|
1851
1906
|
* @param {ActionCallListV3} options - parameters for executing the request.
|
|
1852
1907
|
* - `method: string` - The name of the REST API method that returns a list of data (for example: `crm.item.list`, `tasks.task.list`)
|
|
1853
|
-
* - `params?: Omit<TypeCallParams, 'pagination'>` - Request parameters, excluding the `pagination`
|
|
1908
|
+
* - `params?: Omit<TypeCallParams, 'pagination' | 'order'>` - Request parameters, excluding the `pagination` and `order` parameters,
|
|
1854
1909
|
* since the method is designed to obtain all data in one call.
|
|
1855
1910
|
* Note: Use `filter`, `order`, and `select` to control the selection.
|
|
1856
|
-
* - `idKey?: string` - The name of the field
|
|
1857
|
-
* Default is 'id'.
|
|
1911
|
+
* - `idKey?: string` - The name of the id field as it appears in each RESPONSE item; its value
|
|
1912
|
+
* drives the cursor. Default is 'id'. Set it to match the id field the method returns.
|
|
1913
|
+
* - `cursorIdKey?: string` - The field name used in the REQUEST for `order` and the
|
|
1914
|
+
* `[field, '>', n]` page filter. Defaults to `idKey`. Set it only when the sortable /
|
|
1915
|
+
* filterable field name differs from the response field name (e.g. an uppercase request
|
|
1916
|
+
* field but a lowercase response id): pass `idKey: 'id', cursorIdKey: 'ID'`.
|
|
1858
1917
|
* - `customKeyForResult: string` - A custom key indicating that the response REST API will be
|
|
1859
1918
|
* grouped by this field.
|
|
1860
1919
|
* Example: `items` to group a list of CRM items.
|
|
@@ -1896,6 +1955,7 @@ type ActionFetchListV3 = ActionOptions & {
|
|
|
1896
1955
|
method: string;
|
|
1897
1956
|
params?: Omit<TypeCallParams, 'pagination' | 'order'>;
|
|
1898
1957
|
idKey?: string;
|
|
1958
|
+
cursorIdKey?: string;
|
|
1899
1959
|
customKeyForResult: string;
|
|
1900
1960
|
requestId?: string;
|
|
1901
1961
|
limit?: number;
|
|
@@ -1914,11 +1974,15 @@ declare class FetchListV3 extends AbstractAction {
|
|
|
1914
1974
|
*
|
|
1915
1975
|
* @param {ActionFetchListV3} options - parameters for executing the request.
|
|
1916
1976
|
* - `method: string` - The name of the REST API method that returns a list of data (for example: `crm.item.list`, `tasks.task.list`)
|
|
1917
|
-
* - `params?: Omit<TypeCallParams, 'pagination'>` - Request parameters, excluding the `pagination`
|
|
1977
|
+
* - `params?: Omit<TypeCallParams, 'pagination' | 'order'>` - Request parameters, excluding the `pagination` and `order` parameters,
|
|
1918
1978
|
* since the method is designed to obtain all data in one call.
|
|
1919
1979
|
* Note: Use `filter`, `order`, and `select` to control the selection.
|
|
1920
|
-
* - `idKey?: string` - The name of the field
|
|
1921
|
-
* Default is 'id'.
|
|
1980
|
+
* - `idKey?: string` - The name of the id field as it appears in each RESPONSE item; its value
|
|
1981
|
+
* drives the cursor. Default is 'id'. Set it to match the id field the method returns.
|
|
1982
|
+
* - `cursorIdKey?: string` - The field name used in the REQUEST for `order` and the
|
|
1983
|
+
* `[field, '>', n]` page filter. Defaults to `idKey`. Set it only when the sortable /
|
|
1984
|
+
* filterable field name differs from the response field name (e.g. an uppercase request
|
|
1985
|
+
* field but a lowercase response id): pass `idKey: 'id', cursorIdKey: 'ID'`.
|
|
1922
1986
|
* - `customKeyForResult: string` - A custom key indicating that the response REST API will be
|
|
1923
1987
|
* grouped by this field.
|
|
1924
1988
|
* Example: `items` to group a list of CRM items.
|
|
@@ -1957,6 +2021,178 @@ declare class FetchListV3 extends AbstractAction {
|
|
|
1957
2021
|
make<T = unknown>(options: ActionFetchListV3): AsyncGenerator<T[]>;
|
|
1958
2022
|
}
|
|
1959
2023
|
|
|
2024
|
+
type ActionCallTailV3 = ActionOptions & {
|
|
2025
|
+
method: string;
|
|
2026
|
+
params?: Omit<TypeCallParams, 'pagination' | 'order' | 'cursor'>;
|
|
2027
|
+
cursorField?: string;
|
|
2028
|
+
order?: 'ASC' | 'DESC' | 'asc' | 'desc' | string;
|
|
2029
|
+
customKeyForResult?: string;
|
|
2030
|
+
requestId?: string;
|
|
2031
|
+
limit?: number;
|
|
2032
|
+
initialValue?: number | string;
|
|
2033
|
+
};
|
|
2034
|
+
/**
|
|
2035
|
+
* Fast data retrieval via the native `tail` (keyset cursor) action, without
|
|
2036
|
+
* counting the total number of records. `restApi:v3`
|
|
2037
|
+
*
|
|
2038
|
+
* The eager counterpart of `fetchTail`: it walks the same native
|
|
2039
|
+
* `cursor: { field, value, order, limit }` pagination and returns every record
|
|
2040
|
+
* as a single array. See the v3 reference §6.2. The cursor field MUST NOT appear
|
|
2041
|
+
* in `filter`.
|
|
2042
|
+
*/
|
|
2043
|
+
declare class CallTailV3 extends AbstractAction {
|
|
2044
|
+
/**
|
|
2045
|
+
* Returns every record of a `tail` method as one array.
|
|
2046
|
+
*
|
|
2047
|
+
* @template T - The type of the elements of the returned array (default is `unknown`).
|
|
2048
|
+
*
|
|
2049
|
+
* @param {ActionCallTailV3} options - parameters for executing the request.
|
|
2050
|
+
* - `method: string` - A REST API `tail` method name (for example: `main.eventlog.tail`).
|
|
2051
|
+
* - `params?: Omit<TypeCallParams, 'pagination' | 'order' | 'cursor'>` - Request parameters
|
|
2052
|
+
* (`filter`, `select`). `pagination`, `order` and `cursor` are managed by this helper.
|
|
2053
|
+
* The cursor field must NOT be used in `filter`.
|
|
2054
|
+
* - `cursorField?: string` - The DTO field that drives the cursor. Default is `id`.
|
|
2055
|
+
* - `order?: 'ASC' | 'DESC'` - Cursor direction. Default is `ASC`. For `DESC` you MUST pass
|
|
2056
|
+
* `initialValue` (the server pages by `field < value`, so the default `0` returns nothing).
|
|
2057
|
+
* - `customKeyForResult?: string` - The key the response groups rows under. Default is `items`.
|
|
2058
|
+
* - `requestId?: string` - Unique request identifier for tracking.
|
|
2059
|
+
* - `limit?: number` - How many records to retrieve at a time. Default is `50`. Maximum is `1000`.
|
|
2060
|
+
* - `initialValue?: number | string` - Cursor start value for the first page. Default is `0`
|
|
2061
|
+
* (valid for ascending numeric fields); required for `DESC` and for non-numeric fields.
|
|
2062
|
+
*
|
|
2063
|
+
* @returns {Promise<Result<T[]>>} A promise that resolves to the result of an REST API call.
|
|
2064
|
+
*
|
|
2065
|
+
* @example
|
|
2066
|
+
* const response = await b24.actions.v3.callTail.make<{ id: string }>({
|
|
2067
|
+
* method: 'main.eventlog.tail',
|
|
2068
|
+
* params: { select: ['id', 'auditType'] },
|
|
2069
|
+
* cursorField: 'id',
|
|
2070
|
+
* customKeyForResult: 'items'
|
|
2071
|
+
* })
|
|
2072
|
+
* if (!response.isSuccess) {
|
|
2073
|
+
* throw new Error(`Problem: ${response.getErrorMessages().join('; ')}`)
|
|
2074
|
+
* }
|
|
2075
|
+
* console.log(`Result: ${response.getData()?.length}`)
|
|
2076
|
+
*/
|
|
2077
|
+
make<T = unknown>(options: ActionCallTailV3): Promise<Result<T[]>>;
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
type ActionFetchTailV3 = ActionOptions & {
|
|
2081
|
+
method: string;
|
|
2082
|
+
params?: Omit<TypeCallParams, 'pagination' | 'order' | 'cursor'>;
|
|
2083
|
+
cursorField?: string;
|
|
2084
|
+
order?: 'ASC' | 'DESC' | 'asc' | 'desc' | string;
|
|
2085
|
+
customKeyForResult?: string;
|
|
2086
|
+
requestId?: string;
|
|
2087
|
+
limit?: number;
|
|
2088
|
+
initialValue?: number | string;
|
|
2089
|
+
};
|
|
2090
|
+
/**
|
|
2091
|
+
* Calls a REST API `tail` method (native keyset cursor) and returns an async
|
|
2092
|
+
* generator for efficient large data retrieval. `restApi:v3`
|
|
2093
|
+
*
|
|
2094
|
+
* Unlike `fetchList`, which emulates keyset pagination on top of the `list`
|
|
2095
|
+
* action by injecting a `[field, '>', n]` filter, this helper drives the server
|
|
2096
|
+
* `tail` action with its native `cursor: { field, value, order, limit }`
|
|
2097
|
+
* parameter (see the v3 reference §6.2). The server itself adds `field > value`
|
|
2098
|
+
* (asc) / `field < value` (desc) and sorts by `field`, so the cursor field
|
|
2099
|
+
* MUST NOT appear in `filter` (the server rejects it with
|
|
2100
|
+
* `INVALIDFILTEREXCEPTION`).
|
|
2101
|
+
*/
|
|
2102
|
+
declare class FetchTailV3 extends AbstractAction {
|
|
2103
|
+
/**
|
|
2104
|
+
* Streams every record of a `tail` method as chunks, advancing the keyset
|
|
2105
|
+
* cursor between requests.
|
|
2106
|
+
*
|
|
2107
|
+
* @template T - The type of items in the returned arrays (default is `unknown`).
|
|
2108
|
+
*
|
|
2109
|
+
* @param {ActionFetchTailV3} options - parameters for executing the request.
|
|
2110
|
+
* - `method: string` - A REST API `tail` method name (for example: `main.eventlog.tail`).
|
|
2111
|
+
* - `params?: Omit<TypeCallParams, 'pagination' | 'order' | 'cursor'>` - Request parameters.
|
|
2112
|
+
* Use `filter` and `select` to control the selection. `pagination`, `order` and `cursor`
|
|
2113
|
+
* are managed by this helper and must not be passed. The cursor field must NOT be used in `filter`.
|
|
2114
|
+
* - `cursorField?: string` - The DTO field that drives the cursor. Must be monotonic and
|
|
2115
|
+
* preferably unique, and present in `select`. Default is `id`.
|
|
2116
|
+
* - `order?: 'ASC' | 'DESC'` - Cursor direction. Default is `ASC`. For `DESC` you MUST pass
|
|
2117
|
+
* `initialValue` (the server pages by `field < value`, so the default `0` returns nothing).
|
|
2118
|
+
* - `customKeyForResult?: string` - The key the response groups rows under. Default is `items`.
|
|
2119
|
+
* - `requestId?: string` - Unique request identifier for tracking.
|
|
2120
|
+
* - `limit?: number` - How many records to retrieve at a time. Default is `50`. Maximum is `1000`.
|
|
2121
|
+
* - `initialValue?: number | string` - Cursor start value for the first page. Default is `0`
|
|
2122
|
+
* (valid for ascending numeric fields); required for `DESC` and for non-numeric fields.
|
|
2123
|
+
*
|
|
2124
|
+
* @returns {AsyncGenerator<T[]>} An async generator that yields chunks of data as arrays of type `T`.
|
|
2125
|
+
*
|
|
2126
|
+
* @example
|
|
2127
|
+
* const generator = b24.actions.v3.fetchTail.make<{ id: string }>({
|
|
2128
|
+
* method: 'main.eventlog.tail',
|
|
2129
|
+
* params: { select: ['id', 'auditType'] },
|
|
2130
|
+
* cursorField: 'id',
|
|
2131
|
+
* customKeyForResult: 'items'
|
|
2132
|
+
* })
|
|
2133
|
+
* for await (const chunk of generator) {
|
|
2134
|
+
* console.log(`Processing ${chunk.length} items`)
|
|
2135
|
+
* }
|
|
2136
|
+
*/
|
|
2137
|
+
make<T = unknown>(options: ActionFetchTailV3): AsyncGenerator<T[]>;
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
/**
|
|
2141
|
+
* The six aggregate functions the v3 `aggregate` action accepts (reference §7).
|
|
2142
|
+
* Anything else is rejected server-side with `UNKNOWNAGGREGATEFUNCTIONEXCEPTION`.
|
|
2143
|
+
*/
|
|
2144
|
+
type AggregateFunctionV3 = 'sum' | 'avg' | 'min' | 'max' | 'count' | 'countDistinct';
|
|
2145
|
+
/**
|
|
2146
|
+
* Per-function field selection. Two forms (reference §7):
|
|
2147
|
+
* - list: `['amount', 'qty']` — default alias `<func>_<field>`;
|
|
2148
|
+
* - map: `{ amount: 'totalAmount' }` — custom alias.
|
|
2149
|
+
* Note: the response keys buckets by the **field name**, not the alias.
|
|
2150
|
+
*/
|
|
2151
|
+
type AggregateSelectV3 = Partial<Record<AggregateFunctionV3, string[] | Record<string, string>>>;
|
|
2152
|
+
/**
|
|
2153
|
+
* Aggregate response buckets: `{ sum: { amount: 12345 }, count: { id: 87 } }`.
|
|
2154
|
+
* Keyed by function, then by field name.
|
|
2155
|
+
*/
|
|
2156
|
+
type AggregateResultV3 = Partial<Record<AggregateFunctionV3, Record<string, number>>>;
|
|
2157
|
+
/** @experimental options for the v3 `aggregate` action — unverified live (see {@link AggregateV3}). */
|
|
2158
|
+
type ActionAggregateV3 = ActionOptions & {
|
|
2159
|
+
method: string;
|
|
2160
|
+
select: AggregateSelectV3;
|
|
2161
|
+
params?: Pick<TypeCallParams, 'filter'>;
|
|
2162
|
+
requestId?: string;
|
|
2163
|
+
};
|
|
2164
|
+
/**
|
|
2165
|
+
* Runs the v3 `aggregate` action for modules that support it (reference §7).
|
|
2166
|
+
* `restApi:v3`
|
|
2167
|
+
*
|
|
2168
|
+
* @experimental NOT verified against a live portal — no module on the SDK's
|
|
2169
|
+
* reference test portal currently exposes an `*.aggregate` endpoint. The
|
|
2170
|
+
* request/response shapes follow the published v3 reference and may change once
|
|
2171
|
+
* verified live; pin to a version if you depend on the exact shape.
|
|
2172
|
+
*/
|
|
2173
|
+
declare class AggregateV3 extends AbstractAction {
|
|
2174
|
+
/**
|
|
2175
|
+
* @param {ActionAggregateV3} options
|
|
2176
|
+
* - `method: string` - an `*.aggregate` method name.
|
|
2177
|
+
* - `select: AggregateSelectV3` - per-function field selection (`sum`/`avg`/`min`/`max`/`count`/`countDistinct`).
|
|
2178
|
+
* - `params?: { filter }` - optional v3 filter (array-of-triples; use `FilterV3` to build it).
|
|
2179
|
+
* - `requestId?: string` - tracking id.
|
|
2180
|
+
*
|
|
2181
|
+
* @returns {Promise<Result<AggregateResultV3>>} buckets keyed by function then field name.
|
|
2182
|
+
*
|
|
2183
|
+
* @example
|
|
2184
|
+
* const response = await b24.actions.v3.aggregate.make({
|
|
2185
|
+
* method: 'some.entity.aggregate',
|
|
2186
|
+
* select: { sum: { amount: 'totalAmount' }, count: ['id'] },
|
|
2187
|
+
* params: { filter: FilterV3.build(FilterV3.eq('status', 'NEW')) }
|
|
2188
|
+
* })
|
|
2189
|
+
* if (response.isSuccess) {
|
|
2190
|
+
* const total = response.getData()?.sum?.amount
|
|
2191
|
+
* }
|
|
2192
|
+
*/
|
|
2193
|
+
make(options: ActionAggregateV3): Promise<Result<AggregateResultV3>>;
|
|
2194
|
+
}
|
|
2195
|
+
|
|
1960
2196
|
type ActionBatchV3 = ActionOptions & {
|
|
1961
2197
|
calls: BatchCommandsArrayUniversal | BatchCommandsObjectUniversal | BatchNamedCommandsUniversal;
|
|
1962
2198
|
options?: IB24BatchOptions;
|
|
@@ -2134,6 +2370,9 @@ declare class ActionsManagerV3 {
|
|
|
2134
2370
|
get call(): CallV3;
|
|
2135
2371
|
get callList(): CallListV3;
|
|
2136
2372
|
get fetchList(): FetchListV3;
|
|
2373
|
+
get callTail(): CallTailV3;
|
|
2374
|
+
get fetchTail(): FetchTailV3;
|
|
2375
|
+
get aggregate(): AggregateV3;
|
|
2137
2376
|
get batch(): BatchV3;
|
|
2138
2377
|
get batchByChunk(): BatchByChunkV3;
|
|
2139
2378
|
}
|
|
@@ -2642,10 +2881,10 @@ declare class AjaxResult<T = unknown> extends Result<Payload<T>> implements IRes
|
|
|
2642
2881
|
isMore(): boolean;
|
|
2643
2882
|
/**
|
|
2644
2883
|
* @deprecated Will be removed in `2.0.0`. Tied to the `restApi:v2` envelope
|
|
2645
|
-
* field `total`, which `restApi:v3` does not return.
|
|
2646
|
-
*
|
|
2647
|
-
* `countDistinct`); for `restApi:v2`
|
|
2648
|
-
* without exposing `total`.
|
|
2884
|
+
* field `total`, which `restApi:v3` does not return. `restApi:v3` has no
|
|
2885
|
+
* element-count replacement yet — an `aggregate` action (`count` /
|
|
2886
|
+
* `countDistinct`) is planned but not exposed in the SDK; for `restApi:v2`
|
|
2887
|
+
* use the list helpers, which iterate without exposing `total`.
|
|
2649
2888
|
*
|
|
2650
2889
|
* @removed 2.0.0
|
|
2651
2890
|
*/
|
|
@@ -2706,12 +2945,16 @@ type TypeCallParams = {
|
|
|
2706
2945
|
offset?: number;
|
|
2707
2946
|
};
|
|
2708
2947
|
/**
|
|
2709
|
-
* Used only in Api:V3
|
|
2948
|
+
* Used only in Api:V3 — keyset (`tail`) pagination cursor.
|
|
2949
|
+
* `value` is the last seen value of `field`; `0` (or the type minimum) on the
|
|
2950
|
+
* first page. `order` defaults to `asc`; `limit` shares the 50/1000 rule of
|
|
2951
|
+
* `pagination`.
|
|
2710
2952
|
*/
|
|
2711
2953
|
cursor?: {
|
|
2712
2954
|
field: string;
|
|
2713
|
-
value: number;
|
|
2714
|
-
order
|
|
2955
|
+
value: number | string;
|
|
2956
|
+
order?: 'ASC' | 'DESC' | 'asc' | 'desc' | string;
|
|
2957
|
+
limit?: number;
|
|
2715
2958
|
};
|
|
2716
2959
|
[key: string]: any;
|
|
2717
2960
|
};
|
|
@@ -4053,31 +4296,46 @@ declare class RestrictionManager {
|
|
|
4053
4296
|
}
|
|
4054
4297
|
|
|
4055
4298
|
/**
|
|
4056
|
-
*
|
|
4299
|
+
* Decides which REST API version a method is routed through.
|
|
4300
|
+
*
|
|
4301
|
+
* The SDK no longer maintains a hardcoded v3 method allowlist. A portal's set of
|
|
4302
|
+
* v3 methods is large and version/edition-dependent (the authoritative list is
|
|
4303
|
+
* the portal's own OpenAPI document, `rest.documentation.openapi`), so gating on
|
|
4304
|
+
* a static list both lagged behind the server and blocked valid methods. The
|
|
4305
|
+
* server is now the single source of truth: an unknown v3 method simply comes
|
|
4306
|
+
* back as `METHODNOTFOUNDEXCEPTION`.
|
|
4307
|
+
*
|
|
4308
|
+
* Consequences:
|
|
4309
|
+
* - `actions.v3.*` no longer pre-flight-rejects a method — it is sent to the v3
|
|
4310
|
+
* endpoint and the server validates it.
|
|
4311
|
+
* - v3 is opt-in only via the explicit `actions.v3.*` surface; version
|
|
4312
|
+
* auto-detection therefore defaults to v2 (the universal endpoint).
|
|
4057
4313
|
*/
|
|
4058
4314
|
declare class VersionManager {
|
|
4059
|
-
#private;
|
|
4060
|
-
constructor();
|
|
4061
4315
|
static create(): VersionManager;
|
|
4062
4316
|
/**
|
|
4063
|
-
* List of supported API versions
|
|
4064
|
-
* The highest version must be first
|
|
4317
|
+
* List of supported API versions.
|
|
4318
|
+
* The highest version must be first.
|
|
4065
4319
|
*/
|
|
4066
4320
|
getAllApiVersions(): ApiVersion[];
|
|
4067
|
-
isSupport(version: ApiVersion, method: string): boolean;
|
|
4068
4321
|
/**
|
|
4069
|
-
*
|
|
4322
|
+
* Retained for backward compatibility. The SDK no longer keeps a v3 method
|
|
4323
|
+
* allowlist, so support is not decided client-side any more — always returns
|
|
4324
|
+
* `true`. Method existence is validated by the server.
|
|
4070
4325
|
*/
|
|
4071
|
-
|
|
4326
|
+
isSupport(_version: ApiVersion, _method: string): boolean;
|
|
4072
4327
|
/**
|
|
4073
|
-
*
|
|
4074
|
-
*
|
|
4075
|
-
*
|
|
4076
|
-
*
|
|
4077
|
-
* `[{ method: 'crm.item.get', params: { entityTypeId: 3, id: 1 } }]`
|
|
4078
|
-
* `{ cmd1: { method: 'crm.item.get', params: { entityTypeId: 3, id: 1 } }, cmd2: ['crm.item.get', { entityTypeId: 2, id: 2 }] }`
|
|
4328
|
+
* Returns the API version to use when the caller did not specify one. With the
|
|
4329
|
+
* allowlist removed there is no client-side signal that a method is a v3
|
|
4330
|
+
* method, so this defaults to v2 (the universal endpoint). Use the explicit
|
|
4331
|
+
* `actions.v3.*` surface to call a method on v3.
|
|
4079
4332
|
*/
|
|
4080
|
-
|
|
4333
|
+
automaticallyObtainApiVersion(_method: string): ApiVersion;
|
|
4334
|
+
/**
|
|
4335
|
+
* Batch counterpart of {@link automaticallyObtainApiVersion}. Defaults to v2;
|
|
4336
|
+
* call `actions.v3.batch.make` explicitly to run a batch on v3.
|
|
4337
|
+
*/
|
|
4338
|
+
automaticallyObtainApiVersionForBatch(_calls: BatchCommandsArrayUniversal | BatchCommandsObjectUniversal | BatchNamedCommandsUniversal): ApiVersion;
|
|
4081
4339
|
}
|
|
4082
4340
|
declare const versionManager: VersionManager;
|
|
4083
4341
|
|
|
@@ -4226,6 +4484,12 @@ declare abstract class AbstractHttp implements TypeHttp {
|
|
|
4226
4484
|
protected _authActions: AuthActions;
|
|
4227
4485
|
protected _requestIdGenerator: RequestIdGenerator;
|
|
4228
4486
|
protected _restrictionManager: RestrictionManager;
|
|
4487
|
+
/**
|
|
4488
|
+
* In-flight token refresh, shared so concurrent 401s coalesce into a single
|
|
4489
|
+
* `refreshAuth()` round-trip — avoids OAuth refresh-token reuse errors when a
|
|
4490
|
+
* burst of requests expires together. (#182)
|
|
4491
|
+
*/
|
|
4492
|
+
protected _pendingRefresh: Promise<AuthData> | null;
|
|
4229
4493
|
protected _logger: LoggerInterface;
|
|
4230
4494
|
protected _isClientSideWarning: boolean;
|
|
4231
4495
|
protected _clientSideWarningMessage: string;
|
|
@@ -4298,6 +4562,12 @@ declare abstract class AbstractHttp implements TypeHttp {
|
|
|
4298
4562
|
*/
|
|
4299
4563
|
protected _executeSingleCall<T = unknown>(requestId: string, method: string, params: TypeCallParams): Promise<AjaxResult<T>>;
|
|
4300
4564
|
protected _ensureAuth(requestId: string): Promise<AuthData>;
|
|
4565
|
+
/**
|
|
4566
|
+
* Refresh the auth token, coalescing concurrent callers onto a single
|
|
4567
|
+
* in-flight `refreshAuth()` so a burst of 401s triggers exactly one refresh
|
|
4568
|
+
* round-trip. The slot clears once the refresh settles. (#182)
|
|
4569
|
+
*/
|
|
4570
|
+
protected _refreshAuth(): Promise<AuthData>;
|
|
4301
4571
|
protected _makeRequestWithAuthRetry<T>(requestId: string, method: string, params: TypeCallParams, authData: AuthData): Promise<AjaxResponse<T>>;
|
|
4302
4572
|
protected _makeAxiosRequest<T>(requestId: string, method: string, params: TypeCallParams, authData: AuthData): Promise<AjaxResponse<T>>;
|
|
4303
4573
|
protected _isAuthError(error: unknown): boolean;
|
|
@@ -4307,9 +4577,35 @@ declare abstract class AbstractHttp implements TypeHttp {
|
|
|
4307
4577
|
*/
|
|
4308
4578
|
protected _createAjaxResultWithErrorFromResponse<T>(ajaxError: AjaxError, requestId: string, method: string, params: TypeCallParams): AjaxResult<T>;
|
|
4309
4579
|
/**
|
|
4310
|
-
*
|
|
4580
|
+
* Builds the request URL: the method path plus the SDK telemetry query params
|
|
4581
|
+
* (`bx24_request_id` / `bx24_sdk_ver` / `bx24_sdk_type` — request tracing and
|
|
4582
|
+
* SDK identification, not auth material).
|
|
4583
|
+
*
|
|
4584
|
+
* Carve-out for the legacy positional `task.*` methods (`task.commentitem.*`,
|
|
4585
|
+
* `task.checklistitem.*`, `task.elapseditem.*`, …): these read the request
|
|
4586
|
+
* **query string positionally**, so appending the telemetry params shifts
|
|
4587
|
+
* `Param #0` and the server rejects the call —
|
|
4588
|
+
* `WRONG_ARGUMENTS: Param #0 (taskId) ... expected integer, but given
|
|
4589
|
+
* something else`. Verified live against a portal: the same
|
|
4590
|
+
* `task.commentitem.getlist` / `task.checklistitem.getlist` call succeeds
|
|
4591
|
+
* without the telemetry params and fails with them; modern `tasks.task.*`
|
|
4592
|
+
* (named params) is unaffected. So telemetry is omitted for any method whose
|
|
4593
|
+
* name contains `task.`.
|
|
4594
|
+
*
|
|
4595
|
+
* Shared by v2 and v3 (rather than per-transport): once the v3 method
|
|
4596
|
+
* allowlist was dropped (#259) a positional `task.*` method can be routed via
|
|
4597
|
+
* `actions.v3.*` too, so v3 needs the same suppression — keeping the rule in
|
|
4598
|
+
* one place stops the two transports drifting apart again (#207).
|
|
4599
|
+
*
|
|
4600
|
+
* `includes('task.')` is a deliberate over-approximation: it also drops the
|
|
4601
|
+
* (optional, telemetry-safe) params for modern `tasks.task.*` / `bizproc.task.*`.
|
|
4602
|
+
* Narrowing to an anchored `^task\.` is possible but unverified across the
|
|
4603
|
+
* whole task surface, so the broad, safe match is kept. Bitrix24 method names
|
|
4604
|
+
* are lowercase by convention, so the case-sensitive match is sufficient.
|
|
4605
|
+
*
|
|
4606
|
+
* @see https://apidocs.bitrix24.com/settings/how-to-call-rest-api/data-encoding.html#order-of-parameters
|
|
4311
4607
|
*/
|
|
4312
|
-
protected
|
|
4608
|
+
protected _prepareMethod(requestId: string, method: string, baseUrl: string): string;
|
|
4313
4609
|
/**
|
|
4314
4610
|
* Processes function parameters and adds authorization
|
|
4315
4611
|
*/
|
|
@@ -4352,10 +4648,6 @@ declare abstract class AbstractHttp implements TypeHttp {
|
|
|
4352
4648
|
declare class HttpV2 extends AbstractHttp implements TypeHttp {
|
|
4353
4649
|
constructor(authActions: AuthActions, options?: null | object, restrictionParams?: Partial<RestrictionParams>);
|
|
4354
4650
|
batch<T = unknown>(calls: BatchCommandsArrayUniversal | BatchCommandsObjectUniversal | BatchNamedCommandsUniversal, options?: ICallBatchOptions): Promise<Result<ICallBatchResult<T>>>;
|
|
4355
|
-
/**
|
|
4356
|
-
* @inheritDoc
|
|
4357
|
-
*/
|
|
4358
|
-
protected _prepareMethod(requestId: string, method: string, baseUrl: string): string;
|
|
4359
4651
|
}
|
|
4360
4652
|
|
|
4361
4653
|
/**
|
|
@@ -4369,10 +4661,6 @@ declare class HttpV2 extends AbstractHttp implements TypeHttp {
|
|
|
4369
4661
|
declare class HttpV3 extends AbstractHttp implements TypeHttp {
|
|
4370
4662
|
constructor(authActions: AuthActions, options?: null | object, restrictionParams?: Partial<RestrictionParams>);
|
|
4371
4663
|
batch<T = unknown>(calls: BatchCommandsArrayUniversal | BatchCommandsObjectUniversal | BatchNamedCommandsUniversal, options?: ICallBatchOptions): Promise<Result<ICallBatchResult<T>>>;
|
|
4372
|
-
/**
|
|
4373
|
-
* @inheritDoc
|
|
4374
|
-
*/
|
|
4375
|
-
protected _prepareMethod(requestId: string, method: string, baseUrl: string): string;
|
|
4376
4664
|
}
|
|
4377
4665
|
|
|
4378
4666
|
declare class FormatterNumbers {
|
|
@@ -4523,6 +4811,146 @@ declare const useFormatter: () => {
|
|
|
4523
4811
|
formatterIban: FormatterIban;
|
|
4524
4812
|
};
|
|
4525
4813
|
|
|
4814
|
+
/**
|
|
4815
|
+
* The eight — and only eight — comparison operators the Bitrix24 REST API v3
|
|
4816
|
+
* filter grammar accepts. Anything else is rejected server-side with
|
|
4817
|
+
* `UNKNOWNFILTEROPERATOREXCEPTION`.
|
|
4818
|
+
*/
|
|
4819
|
+
type FilterV3Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'in' | 'between';
|
|
4820
|
+
/**
|
|
4821
|
+
* A single condition in short-form: `[field, operator, value]`.
|
|
4822
|
+
*/
|
|
4823
|
+
type FilterV3Condition = [string, FilterV3Operator, unknown];
|
|
4824
|
+
/**
|
|
4825
|
+
* A logical group of conditions / nested groups. `logic` defaults to `'and'`;
|
|
4826
|
+
* `negative: true` wraps the whole group in a NOT.
|
|
4827
|
+
*/
|
|
4828
|
+
interface FilterV3Group {
|
|
4829
|
+
logic?: 'and' | 'or';
|
|
4830
|
+
negative?: boolean;
|
|
4831
|
+
conditions: FilterV3Node[];
|
|
4832
|
+
}
|
|
4833
|
+
type FilterV3Node = FilterV3Condition | FilterV3Group;
|
|
4834
|
+
/**
|
|
4835
|
+
* Typed builder for Bitrix24 REST API **v3** filters (the array-of-triples
|
|
4836
|
+
* dialect with AND/OR/NOT groups — see the v3 reference §3). Produces exactly
|
|
4837
|
+
* the structures the server accepts, so a bad operator or a malformed
|
|
4838
|
+
* `in` / `between` value fails fast on the client instead of as a server 400.
|
|
4839
|
+
*
|
|
4840
|
+
* @example
|
|
4841
|
+
* import { FilterV3 as F } from '@bitrix24/b24jssdk'
|
|
4842
|
+
*
|
|
4843
|
+
* // status = NEW AND (id in [1,2] OR id > 100)
|
|
4844
|
+
* const filter = F.build(
|
|
4845
|
+
* F.eq('status', 'NEW'),
|
|
4846
|
+
* F.or(
|
|
4847
|
+
* F.in('id', [1, 2]),
|
|
4848
|
+
* F.gt('id', 100)
|
|
4849
|
+
* )
|
|
4850
|
+
* )
|
|
4851
|
+
* await b24.actions.v3.call.make({ method: 'tasks.task.list', params: { filter } })
|
|
4852
|
+
*/
|
|
4853
|
+
declare const FilterV3: Readonly<{
|
|
4854
|
+
/** `field = value` */
|
|
4855
|
+
eq(field: string, value: unknown): FilterV3Condition;
|
|
4856
|
+
/** `field != value` */
|
|
4857
|
+
ne(field: string, value: unknown): FilterV3Condition;
|
|
4858
|
+
/** `field > value` */
|
|
4859
|
+
gt(field: string, value: unknown): FilterV3Condition;
|
|
4860
|
+
/** `field >= value` */
|
|
4861
|
+
ge(field: string, value: unknown): FilterV3Condition;
|
|
4862
|
+
/** `field < value` */
|
|
4863
|
+
lt(field: string, value: unknown): FilterV3Condition;
|
|
4864
|
+
/** `field <= value` */
|
|
4865
|
+
le(field: string, value: unknown): FilterV3Condition;
|
|
4866
|
+
/** `field in [values]` — `values` must be a non-empty array. */
|
|
4867
|
+
in(field: string, values: unknown[]): FilterV3Condition;
|
|
4868
|
+
/** `field between [from, to]` — inclusive range of exactly two defined operands. */
|
|
4869
|
+
between(field: string, from: unknown, to: unknown): FilterV3Condition;
|
|
4870
|
+
/** Combine nodes with AND (for nesting inside an OR; the top level is already AND). */
|
|
4871
|
+
and(...conditions: FilterV3Node[]): FilterV3Group;
|
|
4872
|
+
/** Combine nodes with OR. */
|
|
4873
|
+
or(...conditions: FilterV3Node[]): FilterV3Group;
|
|
4874
|
+
/**
|
|
4875
|
+
* Negate a condition or group (wraps it in a NOT). A bare condition is wrapped
|
|
4876
|
+
* in a single-item AND group so the `negative` flag has somewhere to live.
|
|
4877
|
+
* Returns a fresh group (the input's `conditions` array is copied, not shared).
|
|
4878
|
+
*/
|
|
4879
|
+
not(node: FilterV3Node): FilterV3Group;
|
|
4880
|
+
/**
|
|
4881
|
+
* Assemble the top-level filter array (its elements are AND-joined) ready to
|
|
4882
|
+
* pass as `params.filter`. Falsy nodes are skipped, so you can inline
|
|
4883
|
+
* conditionals: `F.build(F.eq('a', 1), flag && F.gt('b', 2))`.
|
|
4884
|
+
*
|
|
4885
|
+
* Always wrap with `build` (or an array) even for a single condition —
|
|
4886
|
+
* `params.filter` must be an array, so pass `build(F.eq('a', 1))`, not the bare
|
|
4887
|
+
* `F.eq('a', 1)`. Each surviving node is shape-checked, so a forgotten spread
|
|
4888
|
+
* (`build([F.eq(...)])`) or a hand-rolled malformed triple fails fast here
|
|
4889
|
+
* instead of as an opaque server error.
|
|
4890
|
+
*/
|
|
4891
|
+
build(...nodes: Array<FilterV3Node | false | null | undefined>): FilterV3Node[];
|
|
4892
|
+
}>;
|
|
4893
|
+
|
|
4894
|
+
/**
|
|
4895
|
+
* A `$ref` substitution marker: pulls a single value from an earlier batch
|
|
4896
|
+
* command's context by dotted path (reference §8).
|
|
4897
|
+
*/
|
|
4898
|
+
interface BatchRef {
|
|
4899
|
+
$ref: string;
|
|
4900
|
+
}
|
|
4901
|
+
/**
|
|
4902
|
+
* A `$refArray` substitution marker: collects one field across the `items[]` of
|
|
4903
|
+
* an earlier list/tail command into an array (reference §8).
|
|
4904
|
+
*/
|
|
4905
|
+
interface BatchRefArray {
|
|
4906
|
+
$refArray: string;
|
|
4907
|
+
}
|
|
4908
|
+
/**
|
|
4909
|
+
* Helpers for the v3 batch `$ref` / `$refArray` substitution markers (reference
|
|
4910
|
+
* §8). The **server** performs the substitution: these helpers just build the
|
|
4911
|
+
* marker objects you drop into a later command's `params` (the SDK forwards
|
|
4912
|
+
* `params` to the wire `query`), with a little client-side validation. Reference
|
|
4913
|
+
* an earlier command by its `as` alias — or by its numeric index if you omit `as`.
|
|
4914
|
+
* Only `item` (get) and `items` (list/tail) results land in context; `add` → id
|
|
4915
|
+
* and `update` → bool results do not.
|
|
4916
|
+
*
|
|
4917
|
+
* **v3 only.** Substitution is a v3 batch feature. Dropped into a v2 batch
|
|
4918
|
+
* (`actions.v2.batch.make`) the markers are NOT substituted — they are encoded
|
|
4919
|
+
* as literal filter values and silently yield wrong/empty results.
|
|
4920
|
+
*
|
|
4921
|
+
* **Security:** the `path` selects from the batch's own response context, but do
|
|
4922
|
+
* not build it from untrusted end-user input — a crafted path could read context
|
|
4923
|
+
* the caller did not intend to expose to the next command.
|
|
4924
|
+
*
|
|
4925
|
+
* @example
|
|
4926
|
+
* import { BatchRefV3 as R } from '@bitrix24/b24jssdk'
|
|
4927
|
+
*
|
|
4928
|
+
* const response = await b24.actions.v3.batch.make({
|
|
4929
|
+
* calls: [
|
|
4930
|
+
* { method: 'tasks.task.list', as: 'tasks', params: { select: ['id'] } },
|
|
4931
|
+
* {
|
|
4932
|
+
* method: 'tasks.task.comment.list',
|
|
4933
|
+
* // server substitutes the array of ids collected from the first command's items[]
|
|
4934
|
+
* params: { filter: [['taskId', 'in', R.refArray('tasks.id')]] }
|
|
4935
|
+
* }
|
|
4936
|
+
* ]
|
|
4937
|
+
* })
|
|
4938
|
+
*/
|
|
4939
|
+
declare const BatchRefV3: Readonly<{
|
|
4940
|
+
/**
|
|
4941
|
+
* `{ $ref: path }` — substitute a single value from context, e.g.
|
|
4942
|
+
* `ref('newTask.item.id')`. `add` → id / `update` → bool results are NOT in
|
|
4943
|
+
* context (reference §8); only `item` (get) and `items` (list/tail) are.
|
|
4944
|
+
*/
|
|
4945
|
+
ref(path: string): BatchRef;
|
|
4946
|
+
/**
|
|
4947
|
+
* `{ $refArray: path }` — collect one field across the `items[]` of an earlier
|
|
4948
|
+
* list/tail command, e.g. `refArray('tasks.id')`. The path MUST contain a dot
|
|
4949
|
+
* (`alias.field`); the server rejects a dot-less path with INVALIDSELECTEXCEPTION.
|
|
4950
|
+
*/
|
|
4951
|
+
refArray(path: string): BatchRefArray;
|
|
4952
|
+
}>;
|
|
4953
|
+
|
|
4526
4954
|
/**
|
|
4527
4955
|
* B24.Hook Manager.
|
|
4528
4956
|
*
|
|
@@ -4785,7 +5213,11 @@ declare class ParentManager {
|
|
|
4785
5213
|
*/
|
|
4786
5214
|
reloadWindow(): Promise<void>;
|
|
4787
5215
|
/**
|
|
4788
|
-
*
|
|
5216
|
+
* Sets the in-layout page title (the `#pagetitle` element the portal renders around the app).
|
|
5217
|
+
*
|
|
5218
|
+
* Does NOT change the browser tab title (`document.title`): the portal applies this command to
|
|
5219
|
+
* `#pagetitle`, never to the tab. To set the browser tab title, open the view as a slider via
|
|
5220
|
+
* `SliderManager.openSliderAppPage` with a `bx24_title` option.
|
|
4789
5221
|
*
|
|
4790
5222
|
* @param {string} title
|
|
4791
5223
|
*
|
|
@@ -5060,6 +5492,10 @@ declare class SliderManager {
|
|
|
5060
5492
|
/**
|
|
5061
5493
|
* When the method is called, a pop-up window with the application frame will be opened.
|
|
5062
5494
|
*
|
|
5495
|
+
* Settings are passed via `bx24_`-prefixed keys (e.g. `bx24_title`, `bx24_width`).
|
|
5496
|
+
* `bx24_title` sets the slider title; the portal also reflects it to the browser tab title
|
|
5497
|
+
* (`document.title`) — unlike `ParentManager.setTitle`, which only updates the in-layout `#pagetitle`.
|
|
5498
|
+
*
|
|
5063
5499
|
* @link https://apidocs.bitrix24.com/sdk/bx24-js-sdk/additional-functions/bx24-open-application.html
|
|
5064
5500
|
*/
|
|
5065
5501
|
openSliderAppPage(params?: any): Promise<any>;
|
|
@@ -5604,8 +6040,12 @@ declare class PullClient implements ConnectorParent {
|
|
|
5604
6040
|
private _watchUpdateTimeout;
|
|
5605
6041
|
private _pingWaitTimeout;
|
|
5606
6042
|
private _isManualDisconnect;
|
|
6043
|
+
private _disposed;
|
|
5607
6044
|
private _loggingEnabled;
|
|
5608
6045
|
private _onPingTimeoutHandler;
|
|
6046
|
+
private _onBeforeUnloadHandler;
|
|
6047
|
+
private _onOfflineHandler;
|
|
6048
|
+
private _onOnlineHandler;
|
|
5609
6049
|
private _userStatusCallbacks;
|
|
5610
6050
|
private _connectPromise;
|
|
5611
6051
|
private _startingPromise;
|
|
@@ -5615,6 +6055,12 @@ declare class PullClient implements ConnectorParent {
|
|
|
5615
6055
|
constructor(params: TypePullClientParams);
|
|
5616
6056
|
setLogger(logger: LoggerInterface): void;
|
|
5617
6057
|
getLogger(): LoggerInterface;
|
|
6058
|
+
/**
|
|
6059
|
+
* Terminal teardown: removes the window listeners, cancels every pending timer,
|
|
6060
|
+
* persists the session for a quick re-init, and disconnects. Irreversible — a
|
|
6061
|
+
* destroyed client schedules no further work and `start()` rejects with
|
|
6062
|
+
* `PULL_DISPOSED`; create a new instance to reconnect.
|
|
6063
|
+
*/
|
|
5618
6064
|
destroy(): void;
|
|
5619
6065
|
private init;
|
|
5620
6066
|
get connector(): null | TypeConnector;
|
|
@@ -5637,7 +6083,11 @@ declare class PullClient implements ConnectorParent {
|
|
|
5637
6083
|
*/
|
|
5638
6084
|
private attachCommandHandler;
|
|
5639
6085
|
/**
|
|
6086
|
+
* Connects the client and begins receiving events.
|
|
6087
|
+
*
|
|
5640
6088
|
* @param config
|
|
6089
|
+
* @throws Rejects with `{ ex: { error: 'PULL_DISPOSED' } }` when called after
|
|
6090
|
+
* `destroy()` — a destroyed client cannot be restarted; create a new instance.
|
|
5641
6091
|
*/
|
|
5642
6092
|
start(config?: null | (TypePullClientConfig & {
|
|
5643
6093
|
skipReconnectToLastSession?: boolean;
|
|
@@ -5648,6 +6098,7 @@ declare class PullClient implements ConnectorParent {
|
|
|
5648
6098
|
*/
|
|
5649
6099
|
restart(disconnectCode?: number | CloseReasons, disconnectReason?: string): void;
|
|
5650
6100
|
stop(disconnectCode?: number | CloseReasons, disconnectReason?: string): void;
|
|
6101
|
+
private clearAllTimers;
|
|
5651
6102
|
reconnect(disconnectCode: number | CloseReasons, disconnectReason: string, delay?: number): void;
|
|
5652
6103
|
/**
|
|
5653
6104
|
* @param lastMessageId
|
|
@@ -5891,6 +6342,7 @@ declare class PullClient implements ConnectorParent {
|
|
|
5891
6342
|
private onOffline;
|
|
5892
6343
|
private onOnline;
|
|
5893
6344
|
private onBeforeUnload;
|
|
6345
|
+
private persistSession;
|
|
5894
6346
|
/**
|
|
5895
6347
|
* @param status
|
|
5896
6348
|
* @param delay
|
|
@@ -5959,5 +6411,5 @@ declare function initializeB24Frame(options?: {
|
|
|
5959
6411
|
restrictionParams?: Partial<RestrictionParams>;
|
|
5960
6412
|
}): Promise<B24Frame>;
|
|
5961
6413
|
|
|
5962
|
-
export { AbstractB24, AbstractLogger, AdaptiveDelayer, AjaxError, AjaxResult, ApiVersion, AppFrame, AuthHookManager, AuthManager, AuthOAuthManager, B24Frame, B24Hook, B24LangList, B24LocaleMap, B24OAuth, PullClient as B24PullClientManager, Browser, CatalogProductImageType, CatalogProductType, CatalogRoundingRuleType, CloseReasons, ConnectionType, ConsolaAdapter, ConsoleHandler, ConsoleV2Handler, DataType, DialogManager, EnumAppStatus, EnumBitrix24Edition, EnumBizprocBaseType, EnumBizprocDocumentType, EnumCrmEntityType, EnumCrmEntityTypeId, EnumCrmEntityTypeShort, Environment, HttpV2, HttpV3, JsonFormatter, LineFormatter, ListRpcError, LoadDataType, LogLevel, Logger, LoggerBrowser, LoggerFactory, LoggerType, LsKeys, MemoryHandler, MessageCommands, MessageManager, NullLogger, OperatingLimiter, OptionsManager$1 as OptionsManager, ParamsFactory, ParentManager, PlacementManager, ProductRowDiscountTypeId, PullStatus, RateLimiter, RefreshTokenError, RestrictionManager, Result, RpcMethod, SdkError, SenderType, ServerMode, SliderManager, StatusDescriptions, StreamHandler, SubscriptionType, SystemCommands, TelegramFormatter, TelegramHandler, Text$1 as Text, Type, TypeOption, TypeSpecificUrl, WinstonAdapter, convertBizprocDocumentTypeToCrmEntityTypeId, getDocumentId, getDocumentType, getDocumentTypeForFilter, getEnumCrmEntityTypeShort, getEnumValue, getEnvironment, initializeB24Frame, isArrayOfArray, memoryUsageProcessor, omit, pick, pidProcessor, useB24Helper, useFormatter, versionManager };
|
|
5963
|
-
export type { ActivityConfig, ActivityHandlerParams, ActivityOrRobotConfig, ActivityProperty, ActivityPropertyType, AdaptiveConfig, AjaxErrorParams, AjaxQuery, AnswerError, AuthActions, AuthData, B24FrameQueryParams, B24HookParams, B24OAuthParams, B24OAuthSecret, BatchCommandV3, BatchCommandsArrayUniversal, BatchCommandsObjectUniversal, BatchCommandsUniversal, BatchNamedCommandsUniversal, BatchPayload, BatchPayloadResult, BoolString, CallBatchResult, CallbackRefreshAuth, CatalogCatalog, CatalogExtra, CatalogLanguage, CatalogMeasure, CatalogPriceType, CatalogPriceTypeLang, CatalogProduct, CatalogProductImage, CatalogProductOffer, CatalogProductService, CatalogProductSku, CatalogRatio, CatalogRoundingRule, CatalogSection, CatalogStore, CatalogVat, CommandHandlerFunctionV1, CommandHandlerFunctionV2, CommandObject, CommandTuple, CommandUniversal, ConnectorCallbacks, ConnectorConfig, ConnectorParent, ConsolaAdapterOptions, ConsoleHandlerOptions, CrmItemDelivery, CrmItemPayment, CrmItemProductRow, Currency, CurrencyFormat, CustomRefreshAuth, EventHandlerParams, EventOnAppInstallHandlerParams, EventOnAppUnInstallHandlerParams, Fields, Formatter, GenderString, GetPayload, Handler, HandlerAuthParams, HandlerOptions, HandlerRefreshAuth, IB24BatchOptions, ICallBatchOptions, ICallBatchResult, ILimiter, IPlacementUF, IRequestIdGenerator, IResult, ISODate, JsonRpcRequest, ListPayload, LogLevelName, LogRecord, LoggerInterface, MemoryHandlerOptions, MessageInitData, MultiField, MultiFieldArray, NumberString, OperatingLimitConfig, Payload, PayloadOAuthToken, PayloadTime, PlacementViewMode, Processor, RateLimitConfig, RefreshAuthData, RestrictionManagerStats, RestrictionParams, RpcCommand, RpcCommandResult, RpcError, RpcRequest, SdkErrorDetails, SelectCRMParams, SelectCRMParamsEntityType, SelectCRMParamsValue, SelectedAccess, SelectedCRM, SelectedCRMEntity, SelectedUser, SendParams, SharedConfigCallbacks, SharedConfigParams, StatusClose, StorageManagerParams, StreamHandlerOptions, SuccessPayload, TelegramHandlerOptions, TextType, TypeApp, TypeB24, TypeB24Form, TypeCallParams, TypeChanel, TypeChannelManagerParams, TypeConnector, TypeDescriptionError, TypeDescriptionErrorV3, TypeEnumAppStatus, TypeHttp, TypeJsonRpcConfig, TypeLicense, TypePayment, TypePublicIdDescriptor, TypePullClientConfig, TypePullClientEmitConfig, TypePullClientMessageBatch, TypePullClientMessageBody, TypePullClientParams, TypePullClientSession, TypePullMessage, TypeRpcResponseAwaiters, TypeSessionEvent, TypeStorageManager, TypeSubscriptionCommandHandler, TypeSubscriptionOptions, TypeUser, UserBasic, UserBrief, UserFieldType, UserStatusCallback, WinstonAdapterOptions };
|
|
6414
|
+
export { AbstractB24, AbstractLogger, AdaptiveDelayer, AjaxError, AjaxResult, ApiVersion, AppFrame, AuthHookManager, AuthManager, AuthOAuthManager, B24Frame, B24Hook, B24LangList, B24LocaleMap, B24OAuth, PullClient as B24PullClientManager, BatchRefV3, Browser, CatalogProductImageType, CatalogProductType, CatalogRoundingRuleType, CloseReasons, ConnectionType, ConsolaAdapter, ConsoleHandler, ConsoleV2Handler, DataType, DialogManager, EnumAppStatus, EnumBitrix24Edition, EnumBizprocBaseType, EnumBizprocDocumentType, EnumCrmEntityType, EnumCrmEntityTypeId, EnumCrmEntityTypeShort, Environment, FilterV3, HttpV2, HttpV3, JsonFormatter, LineFormatter, ListRpcError, LoadDataType, LogLevel, Logger, LoggerBrowser, LoggerFactory, LoggerType, LsKeys, MemoryHandler, MessageCommands, MessageManager, NullLogger, OperatingLimiter, OptionsManager$1 as OptionsManager, ParamsFactory, ParentManager, PlacementManager, ProductRowDiscountTypeId, PullStatus, RateLimiter, RefreshTokenError, RestrictionManager, Result, RpcMethod, SdkError, SenderType, ServerMode, SliderManager, StatusDescriptions, StreamHandler, SubscriptionType, SystemCommands, TelegramFormatter, TelegramHandler, Text$1 as Text, Type, TypeOption, TypeSpecificUrl, WinstonAdapter, convertBizprocDocumentTypeToCrmEntityTypeId, getDocumentId, getDocumentType, getDocumentTypeForFilter, getEnumCrmEntityTypeShort, getEnumValue, getEnvironment, initializeB24Frame, isArrayOfArray, memoryUsageProcessor, omit, pick, pidProcessor, useB24Helper, useFormatter, versionManager };
|
|
6415
|
+
export type { ActivityConfig, ActivityHandlerParams, ActivityOrRobotConfig, ActivityProperty, ActivityPropertyType, AdaptiveConfig, AjaxErrorParams, AjaxQuery, AnswerError, AuthActions, AuthData, B24FrameQueryParams, B24HookParams, B24OAuthParams, B24OAuthSecret, BatchCommandV3, BatchCommandsArrayUniversal, BatchCommandsObjectUniversal, BatchCommandsUniversal, BatchNamedCommandsUniversal, BatchPayload, BatchPayloadResult, BatchRef, BatchRefArray, BoolString, CallBatchResult, CallbackRefreshAuth, CatalogCatalog, CatalogExtra, CatalogLanguage, CatalogMeasure, CatalogPriceType, CatalogPriceTypeLang, CatalogProduct, CatalogProductImage, CatalogProductOffer, CatalogProductService, CatalogProductSku, CatalogRatio, CatalogRoundingRule, CatalogSection, CatalogStore, CatalogVat, CommandHandlerFunctionV1, CommandHandlerFunctionV2, CommandObject, CommandTuple, CommandUniversal, ConnectorCallbacks, ConnectorConfig, ConnectorParent, ConsolaAdapterOptions, ConsoleHandlerOptions, CrmItemDelivery, CrmItemPayment, CrmItemProductRow, Currency, CurrencyFormat, CustomRefreshAuth, EventHandlerParams, EventOnAppInstallHandlerParams, EventOnAppUnInstallHandlerParams, Fields, FilterV3Condition, FilterV3Group, FilterV3Node, FilterV3Operator, Formatter, GenderString, GetPayload, Handler, HandlerAuthParams, HandlerOptions, HandlerRefreshAuth, IB24BatchOptions, ICallBatchOptions, ICallBatchResult, ILimiter, IPlacementUF, IRequestIdGenerator, IResult, ISODate, JsonRpcRequest, ListPayload, LogLevelName, LogRecord, LoggerInterface, MemoryHandlerOptions, MessageInitData, MultiField, MultiFieldArray, NumberString, OperatingLimitConfig, Payload, PayloadOAuthToken, PayloadTime, PlacementViewMode, Processor, RateLimitConfig, RefreshAuthData, RestrictionManagerStats, RestrictionParams, RpcCommand, RpcCommandResult, RpcError, RpcRequest, SdkErrorDetails, SelectCRMParams, SelectCRMParamsEntityType, SelectCRMParamsValue, SelectedAccess, SelectedCRM, SelectedCRMEntity, SelectedUser, SendParams, SharedConfigCallbacks, SharedConfigParams, StatusClose, StorageManagerParams, StreamHandlerOptions, SuccessPayload, TelegramHandlerOptions, TextType, TypeApp, TypeB24, TypeB24Form, TypeCallParams, TypeChanel, TypeChannelManagerParams, TypeConnector, TypeDescriptionError, TypeDescriptionErrorV3, TypeEnumAppStatus, TypeHttp, TypeJsonRpcConfig, TypeLicense, TypePayment, TypePublicIdDescriptor, TypePullClientConfig, TypePullClientEmitConfig, TypePullClientMessageBatch, TypePullClientMessageBody, TypePullClientParams, TypePullClientSession, TypePullMessage, TypeRpcResponseAwaiters, TypeSessionEvent, TypeStorageManager, TypeSubscriptionCommandHandler, TypeSubscriptionOptions, TypeUser, UserBasic, UserBrief, UserFieldType, UserStatusCallback, WinstonAdapterOptions };
|