@bitrix24/b24jssdk 1.3.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 +3 -2
- 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 +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 +1 -1
- package/dist/esm/core/actions/v2/manager-v2.mjs +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 +30 -44
- 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 +24 -41
- 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 +25 -1
- package/dist/esm/core/actions/v3/manager-v3.mjs.map +1 -1
- package/dist/esm/core/http/abstract-http.mjs +68 -17
- 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 +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 +11 -4
- 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 +1 -1
- package/dist/esm/core/tools/ping.mjs +1 -1
- package/dist/esm/core/version-manager.mjs +19 -157
- 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 +1 -1
- package/dist/esm/frame/placement.mjs +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 +3 -3
- package/dist/esm/hook/b24.mjs.map +1 -1
- package/dist/esm/index.d.mts +412 -39
- package/dist/esm/index.d.ts +412 -39
- 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 +1258 -719
- 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
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @package @bitrix24/b24jssdk
|
|
3
|
+
* @version 2.0.0
|
|
4
|
+
* @copyright (c) 2026 Bitrix24
|
|
5
|
+
* @license MIT
|
|
6
|
+
* @see https://github.com/bitrix24/b24jssdk
|
|
7
|
+
* @see https://bitrix24.github.io/b24jssdk/
|
|
8
|
+
*/
|
|
9
|
+
import { AbstractAction } from '../abstract-action.mjs';
|
|
10
|
+
import { Result } from '../../result.mjs';
|
|
11
|
+
import { SdkError } from '../../sdk-error.mjs';
|
|
12
|
+
import { keysetPaginate, KeysetPaginationError } from './_keyset-paginate.mjs';
|
|
13
|
+
|
|
14
|
+
var __defProp = Object.defineProperty;
|
|
15
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
16
|
+
class CallTailV3 extends AbstractAction {
|
|
17
|
+
static {
|
|
18
|
+
__name(this, "CallTailV3");
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Returns every record of a `tail` method as one array.
|
|
22
|
+
*
|
|
23
|
+
* @template T - The type of the elements of the returned array (default is `unknown`).
|
|
24
|
+
*
|
|
25
|
+
* @param {ActionCallTailV3} options - parameters for executing the request.
|
|
26
|
+
* - `method: string` - A REST API `tail` method name (for example: `main.eventlog.tail`).
|
|
27
|
+
* - `params?: Omit<TypeCallParams, 'pagination' | 'order' | 'cursor'>` - Request parameters
|
|
28
|
+
* (`filter`, `select`). `pagination`, `order` and `cursor` are managed by this helper.
|
|
29
|
+
* The cursor field must NOT be used in `filter`.
|
|
30
|
+
* - `cursorField?: string` - The DTO field that drives the cursor. Default is `id`.
|
|
31
|
+
* - `order?: 'ASC' | 'DESC'` - Cursor direction. Default is `ASC`. For `DESC` you MUST pass
|
|
32
|
+
* `initialValue` (the server pages by `field < value`, so the default `0` returns nothing).
|
|
33
|
+
* - `customKeyForResult?: string` - The key the response groups rows under. Default is `items`.
|
|
34
|
+
* - `requestId?: string` - Unique request identifier for tracking.
|
|
35
|
+
* - `limit?: number` - How many records to retrieve at a time. Default is `50`. Maximum is `1000`.
|
|
36
|
+
* - `initialValue?: number | string` - Cursor start value for the first page. Default is `0`
|
|
37
|
+
* (valid for ascending numeric fields); required for `DESC` and for non-numeric fields.
|
|
38
|
+
*
|
|
39
|
+
* @returns {Promise<Result<T[]>>} A promise that resolves to the result of an REST API call.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* const response = await b24.actions.v3.callTail.make<{ id: string }>({
|
|
43
|
+
* method: 'main.eventlog.tail',
|
|
44
|
+
* params: { select: ['id', 'auditType'] },
|
|
45
|
+
* cursorField: 'id',
|
|
46
|
+
* customKeyForResult: 'items'
|
|
47
|
+
* })
|
|
48
|
+
* if (!response.isSuccess) {
|
|
49
|
+
* throw new Error(`Problem: ${response.getErrorMessages().join('; ')}`)
|
|
50
|
+
* }
|
|
51
|
+
* console.log(`Result: ${response.getData()?.length}`)
|
|
52
|
+
*/
|
|
53
|
+
async make(options) {
|
|
54
|
+
const batchSize = options?.limit ?? 50;
|
|
55
|
+
const result = new Result();
|
|
56
|
+
const cursorField = options?.cursorField ?? "id";
|
|
57
|
+
const order = options?.order ?? "ASC";
|
|
58
|
+
const customKeyForResult = options?.customKeyForResult ?? "items";
|
|
59
|
+
const params = options?.params ?? {};
|
|
60
|
+
if (/desc/i.test(order) && options?.initialValue === void 0) {
|
|
61
|
+
throw new SdkError({
|
|
62
|
+
code: "JSSDK_CORE_B24_CALL_TAIL_DESC_REQUIRES_INITIAL_VALUE",
|
|
63
|
+
description: 'callTail.make: order "DESC" requires an explicit `initialValue` (the server pages by `field < value`, so the default 0 returns nothing). Pass `initialValue` set to the type maximum / newest value.',
|
|
64
|
+
status: 500
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (Array.isArray(params["filter"]) && params["filter"].some((c) => Array.isArray(c) && c[0] === cursorField)) {
|
|
68
|
+
this._logger.warning(`callTail.make: the cursor field "${cursorField}" must not appear in \`filter\` \u2014 the server orders and pages by it and will reject a filter on the same field (INVALIDFILTEREXCEPTION). Remove it from \`filter\`.`);
|
|
69
|
+
}
|
|
70
|
+
let select = params["select"];
|
|
71
|
+
if (Array.isArray(select)) {
|
|
72
|
+
if (!select.includes(cursorField)) {
|
|
73
|
+
select = [...select, cursorField];
|
|
74
|
+
}
|
|
75
|
+
} else if (cursorField !== "id") {
|
|
76
|
+
this._logger.warning(`callTail.make: no \`select\` provided with a non-default cursorField "${cursorField}" \u2014 make sure it is in the server's default field set, otherwise pass \`select\` including "${cursorField}" so the cursor can advance.`);
|
|
77
|
+
}
|
|
78
|
+
const { select: _ignoredSelect, ...restParams } = params;
|
|
79
|
+
const allItems = [];
|
|
80
|
+
try {
|
|
81
|
+
for await (const page of keysetPaginate(this._b24, this._logger, {
|
|
82
|
+
method: options.method,
|
|
83
|
+
requestId: options.requestId,
|
|
84
|
+
customKeyForResult,
|
|
85
|
+
initialCursor: options?.initialValue ?? 0,
|
|
86
|
+
// Native keyset: drive the server's `cursor: { field, value, order, limit }`.
|
|
87
|
+
buildParams: /* @__PURE__ */ __name((cursor) => ({
|
|
88
|
+
...restParams,
|
|
89
|
+
...select ? { select } : {},
|
|
90
|
+
cursor: { field: cursorField, value: cursor, order, limit: batchSize }
|
|
91
|
+
}), "buildParams"),
|
|
92
|
+
// Advance by the raw cursor-field value from the last item; a missing
|
|
93
|
+
// value (cursorField not selected / wrong name) stops the walk.
|
|
94
|
+
readNextCursor: /* @__PURE__ */ __name((lastItem) => lastItem[cursorField] ?? null, "readNextCursor"),
|
|
95
|
+
noCursorWarning: `callTail.make: pagination stops here \u2014 no value could be read from the returned items via cursorField "${cursorField}". Make sure cursorField matches a field present in the response (and in \`select\`).`,
|
|
96
|
+
errorLabel: "callTailMethod"
|
|
97
|
+
})) {
|
|
98
|
+
for (const item of page) {
|
|
99
|
+
allItems.push(item);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
} catch (error) {
|
|
103
|
+
if (error instanceof KeysetPaginationError) {
|
|
104
|
+
for (const [index, err] of error.errors) {
|
|
105
|
+
result.addError(err, index);
|
|
106
|
+
}
|
|
107
|
+
} else {
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return result.setData(allItems);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { CallTailV3 };
|
|
116
|
+
//# sourceMappingURL=call-tail.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-tail.mjs","sources":["../../../../../src/core/actions/v3/call-tail.ts"],"sourcesContent":["import type { ActionOptions } from '../abstract-action'\nimport type { TypeCallParams } from '../../../types/http'\nimport { AbstractAction } from '../abstract-action'\nimport { Result } from '../../result'\nimport { SdkError } from '../../sdk-error'\nimport { keysetPaginate, KeysetPaginationError } from './_keyset-paginate'\n\nexport type ActionCallTailV3 = ActionOptions & {\n method: string\n params?: Omit<TypeCallParams, 'pagination' | 'order' | 'cursor'>\n cursorField?: string\n order?: 'ASC' | 'DESC' | 'asc' | 'desc' | string\n customKeyForResult?: string\n requestId?: string\n limit?: number\n initialValue?: number | string\n}\n\n/**\n * Fast data retrieval via the native `tail` (keyset cursor) action, without\n * counting the total number of records. `restApi:v3`\n *\n * The eager counterpart of `fetchTail`: it walks the same native\n * `cursor: { field, value, order, limit }` pagination and returns every record\n * as a single array. See the v3 reference §6.2. The cursor field MUST NOT appear\n * in `filter`.\n */\nexport class CallTailV3 extends AbstractAction {\n /**\n * Returns every record of a `tail` method as one array.\n *\n * @template T - The type of the elements of the returned array (default is `unknown`).\n *\n * @param {ActionCallTailV3} options - parameters for executing the request.\n * - `method: string` - A REST API `tail` method name (for example: `main.eventlog.tail`).\n * - `params?: Omit<TypeCallParams, 'pagination' | 'order' | 'cursor'>` - Request parameters\n * (`filter`, `select`). `pagination`, `order` and `cursor` are managed by this helper.\n * The cursor field must NOT be used in `filter`.\n * - `cursorField?: string` - The DTO field that drives the cursor. Default is `id`.\n * - `order?: 'ASC' | 'DESC'` - Cursor direction. Default is `ASC`. For `DESC` you MUST pass\n * `initialValue` (the server pages by `field < value`, so the default `0` returns nothing).\n * - `customKeyForResult?: string` - The key the response groups rows under. Default is `items`.\n * - `requestId?: string` - Unique request identifier for tracking.\n * - `limit?: number` - How many records to retrieve at a time. Default is `50`. Maximum is `1000`.\n * - `initialValue?: number | string` - Cursor start value for the first page. Default is `0`\n * (valid for ascending numeric fields); required for `DESC` and for non-numeric fields.\n *\n * @returns {Promise<Result<T[]>>} A promise that resolves to the result of an REST API call.\n *\n * @example\n * const response = await b24.actions.v3.callTail.make<{ id: string }>({\n * method: 'main.eventlog.tail',\n * params: { select: ['id', 'auditType'] },\n * cursorField: 'id',\n * customKeyForResult: 'items'\n * })\n * if (!response.isSuccess) {\n * throw new Error(`Problem: ${response.getErrorMessages().join('; ')}`)\n * }\n * console.log(`Result: ${response.getData()?.length}`)\n */\n public override async make<T = unknown>(options: ActionCallTailV3): Promise<Result<T[]>> {\n const batchSize = options?.limit ?? 50\n const result: Result<T[]> = new Result()\n\n const cursorField = options?.cursorField ?? 'id'\n const order = options?.order ?? 'ASC'\n const customKeyForResult = options?.customKeyForResult ?? 'items'\n const params = options?.params ?? {}\n\n // DESC keyset needs an explicit start: the server pages by `field < value`,\n // so the default first-page value 0 would match nothing for a non-negative\n // field. Require `initialValue` (the type maximum / newest value) for DESC.\n if (/desc/i.test(order) && options?.initialValue === undefined) {\n throw new SdkError({\n code: 'JSSDK_CORE_B24_CALL_TAIL_DESC_REQUIRES_INITIAL_VALUE',\n description: 'callTail.make: order \"DESC\" requires an explicit `initialValue` (the server pages by `field < value`, so the default 0 returns nothing). Pass `initialValue` set to the type maximum / newest value.',\n status: 500\n })\n }\n\n // Cursor field must not also live in `filter` (server rejects with\n // INVALIDFILTEREXCEPTION). Detection covers only the short-form triples.\n if (Array.isArray(params['filter']) && params['filter'].some((c: any) => Array.isArray(c) && c[0] === cursorField)) {\n this._logger.warning(`callTail.make: the cursor field \"${cursorField}\" must not appear in \\`filter\\` — the server orders and pages by it and will reject a filter on the same field (INVALIDFILTEREXCEPTION). Remove it from \\`filter\\`.`)\n }\n\n // Cursor field must be readable to advance. Append it to an explicit\n // `select`; warn for a non-default cursorField when `select` is omitted.\n let select = params['select'] as string[] | undefined\n if (Array.isArray(select)) {\n if (!select.includes(cursorField)) {\n select = [...select, cursorField]\n }\n } else if (cursorField !== 'id') {\n this._logger.warning(`callTail.make: no \\`select\\` provided with a non-default cursorField \"${cursorField}\" — make sure it is in the server's default field set, otherwise pass \\`select\\` including \"${cursorField}\" so the cursor can advance.`)\n }\n\n const { select: _ignoredSelect, ...restParams } = params as TypeCallParams\n\n const allItems: T[] = []\n try {\n for await (const page of keysetPaginate<T>(this._b24, this._logger, {\n method: options.method,\n requestId: options.requestId,\n customKeyForResult,\n initialCursor: options?.initialValue ?? 0,\n // Native keyset: drive the server's `cursor: { field, value, order, limit }`.\n buildParams: cursor => ({\n ...restParams,\n ...(select ? { select } : {}),\n cursor: { field: cursorField, value: cursor, order, limit: batchSize }\n }),\n // Advance by the raw cursor-field value from the last item; a missing\n // value (cursorField not selected / wrong name) stops the walk.\n readNextCursor: lastItem => lastItem[cursorField] ?? null,\n noCursorWarning: `callTail.make: pagination stops here — no value could be read from the returned items via cursorField \"${cursorField}\". Make sure cursorField matches a field present in the response (and in \\`select\\`).`,\n errorLabel: 'callTailMethod'\n })) {\n for (const item of page) {\n allItems.push(item)\n }\n }\n } catch (error) {\n if (error instanceof KeysetPaginationError) {\n for (const [index, err] of error.errors) {\n result.addError(err, index)\n }\n } else {\n throw error\n }\n }\n\n return result.setData(allItems)\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AA2BO,MAAM,mBAAmB,cAAA,CAAe;AAAA,EA3B/C;AA2B+C,IAAA,MAAA,CAAA,IAAA,EAAA,YAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkC7C,MAAsB,KAAkB,OAAA,EAAiD;AACvF,IAAA,MAAM,SA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AAS,KAAK,KAAK,CAAA;AAAA,QAC5B;AAAA,MACF,CAAA,MAAO;AACL,QAAA,MAAM,KAAA;AAAA,MACR;AAAA,IACF;AAEA,IAAA,OAAO,MAAA,CAAO,QAAQ,QAAQ,CAAA;AAAA,EAChC;AACF;;;;"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package @bitrix24/b24jssdk
|
|
3
|
-
* @version
|
|
3
|
+
* @version 2.0.0
|
|
4
4
|
* @copyright (c) 2026 Bitrix24
|
|
5
5
|
* @license MIT
|
|
6
6
|
* @see https://github.com/bitrix24/b24jssdk
|
|
7
7
|
* @see https://bitrix24.github.io/b24jssdk/
|
|
8
8
|
*/
|
|
9
9
|
import { AbstractAction } from '../abstract-action.mjs';
|
|
10
|
-
import { versionManager } from '../../version-manager.mjs';
|
|
11
10
|
import { ApiVersion } from '../../../types/b24.mjs';
|
|
12
|
-
import { SdkError } from '../../sdk-error.mjs';
|
|
13
11
|
|
|
14
12
|
var __defProp = Object.defineProperty;
|
|
15
13
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
@@ -42,13 +40,6 @@ class CallV3 extends AbstractAction {
|
|
|
42
40
|
* console.log(response.getData().result.item.title)
|
|
43
41
|
*/
|
|
44
42
|
async make(options) {
|
|
45
|
-
if (!versionManager.isSupport(ApiVersion.v3, options.method)) {
|
|
46
|
-
throw new SdkError({
|
|
47
|
-
code: "JSSDK_CORE_METHOD_NOT_SUPPORT_IN_API_V3",
|
|
48
|
-
description: `restApi:v3 not support method ${options.method}`,
|
|
49
|
-
status: 500
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
43
|
const params = options.params || {};
|
|
53
44
|
return this._b24.getHttpClient(ApiVersion.v3).call(options.method, params, options.requestId);
|
|
54
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.mjs","sources":["../../../../../src/core/actions/v3/call.ts"],"sourcesContent":["import type { ActionOptions } from '../abstract-action'\nimport type { TypeCallParams } from '../../../types/http'\nimport type { AjaxResult } from '../../http/ajax-result'\nimport { AbstractAction } from '../abstract-action'\nimport {
|
|
1
|
+
{"version":3,"file":"call.mjs","sources":["../../../../../src/core/actions/v3/call.ts"],"sourcesContent":["import type { ActionOptions } from '../abstract-action'\nimport type { TypeCallParams } from '../../../types/http'\nimport type { AjaxResult } from '../../http/ajax-result'\nimport { AbstractAction } from '../abstract-action'\nimport { ApiVersion } from '../../../types/b24'\n\nexport type ActionCallV3 = ActionOptions & {\n method: string\n params?: TypeCallParams\n requestId?: string\n}\n\n/**\n * Calls the Bitrix24 REST API method `restApi:v3`\n *\n * @todo add docs\n */\nexport class CallV3 extends AbstractAction {\n /**\n * Calls the Bitrix24 REST API method.\n *\n * @template T - The expected data type in the response (default is `unknown`).\n *\n * @param {ActionCallV3} options - parameters for executing the request.\n * - `method: string` - REST API method name (eg: `crm.item.get`)\n * - `params?: TypeCallParams` - Parameters for calling the method.\n * - `requestId?: string` - Unique request identifier for tracking. Used for query deduplication and debugging.\n *\n * @returns {Promise<AjaxResult<T>>} A promise that resolves to the result of an REST API call.\n *\n * @example\n * interface TaskItem { id: number, title: string }\n * const response = await b24.actions.v3.call.make<{ item: TaskItem }>({\n * method: 'tasks.task.get',\n * params: { id: 123, select: ['id', 'title'] },\n * requestId: 'task-123'\n * })\n * if (!response.isSuccess) {\n * throw new Error(`Problem: ${response.getErrorMessages().join('; ')}`)\n * }\n * console.log(response.getData().result.item.title)\n */\n public override async make<T = unknown>(options: ActionCallV3): Promise<AjaxResult<T>> {\n // No client-side allowlist: the method is sent straight to the v3 endpoint\n // and the server decides (an unknown method returns METHODNOTFOUNDEXCEPTION).\n const params = options.params || {}\n return this._b24.getHttpClient(ApiVersion.v3).call<T>(options.method, params, options.requestId)\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAiBO,MAAM,eAAe,cAAA,CAAe;AAAA,EAjB3C;AAiB2C,IAAA,MAAA,CAAA,IAAA,EAAA,QAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyBzC,MAAsB,KAAkB,OAAA,EAA+C;AAGrF,IAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,MAAA,IAAU,EAAC;AAClC,IAAA,OAAO,IAAA,CAAK,IAAA,CAAK,aAAA,CAAc,UAAA,CAAW,EAAE,CAAA,CAAE,IAAA,CAAQ,OAAA,CAAQ,MAAA,EAAQ,MAAA,EAAQ,OAAA,CAAQ,SAAS,CAAA;AAAA,EACjG;AACF;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package @bitrix24/b24jssdk
|
|
3
|
-
* @version
|
|
3
|
+
* @version 2.0.0
|
|
4
4
|
* @copyright (c) 2026 Bitrix24
|
|
5
5
|
* @license MIT
|
|
6
6
|
* @see https://github.com/bitrix24/b24jssdk
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { AbstractAction } from '../abstract-action.mjs';
|
|
10
10
|
import { SdkError } from '../../sdk-error.mjs';
|
|
11
|
+
import { keysetPaginate, KeysetPaginationError } from './_keyset-paginate.mjs';
|
|
11
12
|
|
|
12
13
|
var __defProp = Object.defineProperty;
|
|
13
14
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
@@ -83,53 +84,35 @@ class FetchListV3 extends AbstractAction {
|
|
|
83
84
|
filter: [...params["filter"] || []],
|
|
84
85
|
pagination: { page: 0, limit: batchSize }
|
|
85
86
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
do {
|
|
89
|
-
const sendParams = { ...requestParams, filter: [...requestParams.filter] };
|
|
90
|
-
sendParams.filter.push([cursorIdKey, ">", nextId]);
|
|
91
|
-
const response = await this._b24.actions.v3.call.make({
|
|
87
|
+
try {
|
|
88
|
+
yield* keysetPaginate(this._b24, this._logger, {
|
|
92
89
|
method: options.method,
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
requestId: options.requestId,
|
|
91
|
+
customKeyForResult,
|
|
92
|
+
initialCursor: 0,
|
|
93
|
+
// Emulated keyset: append the `[cursorIdKey, '>', cursor]` page filter.
|
|
94
|
+
buildParams: /* @__PURE__ */ __name((cursor) => ({ ...requestParams, filter: [...requestParams.filter, [cursorIdKey, ">", cursor]] }), "buildParams"),
|
|
95
|
+
// Advance by the numeric id read from the last item via `idKey`. A
|
|
96
|
+
// non-numeric value (almost always an `idKey` that doesn't match the
|
|
97
|
+
// response field — e.g. sorting by `ID` while the response carries a
|
|
98
|
+
// lowercase `id`) stops the walk instead of silently truncating.
|
|
99
|
+
readNextCursor: /* @__PURE__ */ __name((lastItem) => {
|
|
100
|
+
const value = Number.parseInt(lastItem[idKey], 10);
|
|
101
|
+
return Number.isFinite(value) ? value : null;
|
|
102
|
+
}, "readNextCursor"),
|
|
103
|
+
noCursorWarning: `fetchList.make: pagination stops here \u2014 no numeric id could be read from the returned items via idKey "${idKey}". Make sure idKey matches the id field in the response; if the sortable field name differs from it, also set cursorIdKey (e.g. idKey: 'id', cursorIdKey: 'ID').`,
|
|
104
|
+
errorLabel: "fetchListMethod"
|
|
95
105
|
});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
method: options.method,
|
|
99
|
-
requestId: options.requestId,
|
|
100
|
-
messages: response.getErrorMessages()
|
|
101
|
-
});
|
|
106
|
+
} catch (error) {
|
|
107
|
+
if (error instanceof KeysetPaginationError) {
|
|
102
108
|
throw new SdkError({
|
|
103
109
|
code: "JSSDK_CORE_B24_FETCH_LIST_METHOD_API_V3",
|
|
104
|
-
description: `API Error: ${
|
|
110
|
+
description: `API Error: ${error.messages.join("; ")}`,
|
|
105
111
|
status: 500
|
|
106
112
|
});
|
|
107
113
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
isContinue = false;
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
const resultData = responseData.result[customKeyForResult];
|
|
114
|
-
if (resultData.length === 0) {
|
|
115
|
-
isContinue = false;
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
yield resultData;
|
|
119
|
-
if (resultData.length < batchSize) {
|
|
120
|
-
isContinue = false;
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
const lastItem = resultData[resultData.length - 1];
|
|
124
|
-
const cursorValue = lastItem ? Number.parseInt(lastItem[idKey], 10) : Number.NaN;
|
|
125
|
-
if (Number.isFinite(cursorValue)) {
|
|
126
|
-
nextId = cursorValue;
|
|
127
|
-
} else {
|
|
128
|
-
this._logger.warning(`fetchList.make: pagination stops here \u2014 no numeric id could be read from the returned items via idKey "${idKey}". Make sure idKey matches the id field in the response; if the sortable field name differs from it, also set cursorIdKey (e.g. idKey: 'id', cursorIdKey: 'ID').`);
|
|
129
|
-
isContinue = false;
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
} while (isContinue);
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
133
116
|
}
|
|
134
117
|
}
|
|
135
118
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-list.mjs","sources":["../../../../../src/core/actions/v3/fetch-list.ts"],"sourcesContent":["import type { ActionOptions } from '../abstract-action'\nimport type { TypeCallParams } from '../../../types/http'\nimport
|
|
1
|
+
{"version":3,"file":"fetch-list.mjs","sources":["../../../../../src/core/actions/v3/fetch-list.ts"],"sourcesContent":["import type { ActionOptions } from '../abstract-action'\nimport type { TypeCallParams } from '../../../types/http'\nimport { AbstractAction } from '../abstract-action'\nimport { SdkError } from '../../sdk-error'\nimport { keysetPaginate, KeysetPaginationError } from './_keyset-paginate'\n\nexport type ActionFetchListV3 = ActionOptions & {\n method: string\n params?: Omit<TypeCallParams, 'pagination' | 'order'>\n idKey?: string\n cursorIdKey?: string\n customKeyForResult: string\n requestId?: string\n limit?: number\n}\n\n/**\n * Calls a REST API list method and returns an async generator for efficient large data retrieval. `restApi:v3`\n *\n * @todo add docs\n */\nexport class FetchListV3 extends AbstractAction {\n /**\n * Calls a REST API list method and returns an async generator for efficient large data retrieval.\n * Implements the fast algorithm for iterating over large datasets without loading all data into memory at once.\n *\n * @template T - The type of items in the returned arrays (default is `unknown`).\n *\n * @param {ActionFetchListV3} options - parameters for executing the request.\n * - `method: string` - The name of the REST API method that returns a list of data (for example: `crm.item.list`, `tasks.task.list`)\n * - `params?: Omit<TypeCallParams, 'pagination' | 'order'>` - Request parameters, excluding the `pagination` and `order` parameters,\n * since the method is designed to obtain all data in one call.\n * Note: Use `filter`, `order`, and `select` to control the selection.\n * - `idKey?: string` - The name of the id field as it appears in each RESPONSE item; its value\n * drives the cursor. Default is 'id'. Set it to match the id field the method returns.\n * - `cursorIdKey?: string` - The field name used in the REQUEST for `order` and the\n * `[field, '>', n]` page filter. Defaults to `idKey`. Set it only when the sortable /\n * filterable field name differs from the response field name (e.g. an uppercase request\n * field but a lowercase response id): pass `idKey: 'id', cursorIdKey: 'ID'`.\n * - `customKeyForResult: string` - A custom key indicating that the response REST API will be\n * grouped by this field.\n * Example: `items` to group a list of CRM items.\n * - `requestId?: string` - Unique request identifier for tracking. Used for query deduplication and debugging.\n * - `limit?: number` - How many records to retrieve at a time. Default is `50`. Maximum is `1000`.\n *\n * @returns {AsyncGenerator<T[]>} An async generator that yields chunks of data as arrays of type `T`.\n * Each iteration returns the next page/batch of results until all data is fetched.\n *\n * @example\n * import { Text } from '@bitrix24/b24jssdk'\n *\n * interface MainEventLogItem { id: number, userId: number }\n * const sixMonthAgo = new Date()\n * sixMonthAgo.setMonth((new Date()).getMonth() - 6)\n * sixMonthAgo.setHours(0, 0, 0)\n * const generator = b24.actions.v3.fetchList.make<MainEventLogItem>({\n * method: 'main.eventlog.list',\n * params: {\n * filter: [\n * ['timestampX', '>=', Text.toB24Format(sixMonthAgo)] // created at least 6 months ago\n * ],\n * select: ['id', 'userId']\n * },\n * idKey: 'id',\n * customKeyForResult: 'items',\n * requestId: 'eventlog-123',\n * limit: 60\n * })\n *\n * for await (const chunk of generator) {\n * // Process chunk (e.g., save to database, analyze, etc.)\n * console.log(`Processing ${chunk.length} items`)\n * }\n */\n public override async* make<T = unknown>(options: ActionFetchListV3): AsyncGenerator<T[]> {\n const batchSize = options?.limit ?? 50\n\n const idKey = options?.idKey ?? 'id'\n const cursorIdKey = options?.cursorIdKey ?? idKey\n const customKeyForResult = options?.customKeyForResult ?? null\n const params = options?.params ?? {}\n\n // Warn and strip user-provided `order` — cursor pagination requires ordering by cursorIdKey only\n if ('order' in params && params['order']) {\n this._logger.warning('fetchList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by cursorIdKey. Use `filter` to narrow results instead.')\n }\n\n const { order: _ignoredOrder, ...restParams } = params as TypeCallParams\n const requestParams: TypeCallParams = {\n ...restParams,\n order: { [cursorIdKey]: 'ASC' },\n filter: [...(params['filter'] || [])],\n pagination: { page: 0, limit: batchSize }\n }\n\n try {\n yield* keysetPaginate<T>(this._b24, this._logger, {\n method: options.method,\n requestId: options.requestId,\n customKeyForResult,\n initialCursor: 0,\n // Emulated keyset: append the `[cursorIdKey, '>', cursor]` page filter.\n buildParams: cursor => ({ ...requestParams, filter: [...requestParams.filter, [cursorIdKey, '>', cursor]] }),\n // Advance by the numeric id read from the last item via `idKey`. A\n // non-numeric value (almost always an `idKey` that doesn't match the\n // response field — e.g. sorting by `ID` while the response carries a\n // lowercase `id`) stops the walk instead of silently truncating.\n readNextCursor: (lastItem) => {\n const value = Number.parseInt(lastItem[idKey], 10)\n return Number.isFinite(value) ? value : null\n },\n noCursorWarning: `fetchList.make: pagination stops here — no numeric id could be read from the returned items via idKey \"${idKey}\". Make sure idKey matches the id field in the response; if the sortable field name differs from it, also set cursorIdKey (e.g. idKey: 'id', cursorIdKey: 'ID').`,\n errorLabel: 'fetchListMethod'\n })\n } catch (error) {\n if (error instanceof KeysetPaginationError) {\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,KAAA;AAAA,IACR;AAAA,EACF;AACF;;;;"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @package @bitrix24/b24jssdk
|
|
3
|
+
* @version 2.0.0
|
|
4
|
+
* @copyright (c) 2026 Bitrix24
|
|
5
|
+
* @license MIT
|
|
6
|
+
* @see https://github.com/bitrix24/b24jssdk
|
|
7
|
+
* @see https://bitrix24.github.io/b24jssdk/
|
|
8
|
+
*/
|
|
9
|
+
import { AbstractAction } from '../abstract-action.mjs';
|
|
10
|
+
import { SdkError } from '../../sdk-error.mjs';
|
|
11
|
+
import { keysetPaginate, KeysetPaginationError } from './_keyset-paginate.mjs';
|
|
12
|
+
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
+
class FetchTailV3 extends AbstractAction {
|
|
16
|
+
static {
|
|
17
|
+
__name(this, "FetchTailV3");
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Streams every record of a `tail` method as chunks, advancing the keyset
|
|
21
|
+
* cursor between requests.
|
|
22
|
+
*
|
|
23
|
+
* @template T - The type of items in the returned arrays (default is `unknown`).
|
|
24
|
+
*
|
|
25
|
+
* @param {ActionFetchTailV3} options - parameters for executing the request.
|
|
26
|
+
* - `method: string` - A REST API `tail` method name (for example: `main.eventlog.tail`).
|
|
27
|
+
* - `params?: Omit<TypeCallParams, 'pagination' | 'order' | 'cursor'>` - Request parameters.
|
|
28
|
+
* Use `filter` and `select` to control the selection. `pagination`, `order` and `cursor`
|
|
29
|
+
* are managed by this helper and must not be passed. The cursor field must NOT be used in `filter`.
|
|
30
|
+
* - `cursorField?: string` - The DTO field that drives the cursor. Must be monotonic and
|
|
31
|
+
* preferably unique, and present in `select`. Default is `id`.
|
|
32
|
+
* - `order?: 'ASC' | 'DESC'` - Cursor direction. Default is `ASC`. For `DESC` you MUST pass
|
|
33
|
+
* `initialValue` (the server pages by `field < value`, so the default `0` returns nothing).
|
|
34
|
+
* - `customKeyForResult?: string` - The key the response groups rows under. Default is `items`.
|
|
35
|
+
* - `requestId?: string` - Unique request identifier for tracking.
|
|
36
|
+
* - `limit?: number` - How many records to retrieve at a time. Default is `50`. Maximum is `1000`.
|
|
37
|
+
* - `initialValue?: number | string` - Cursor start value for the first page. Default is `0`
|
|
38
|
+
* (valid for ascending numeric fields); required for `DESC` and for non-numeric fields.
|
|
39
|
+
*
|
|
40
|
+
* @returns {AsyncGenerator<T[]>} An async generator that yields chunks of data as arrays of type `T`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const generator = b24.actions.v3.fetchTail.make<{ id: string }>({
|
|
44
|
+
* method: 'main.eventlog.tail',
|
|
45
|
+
* params: { select: ['id', 'auditType'] },
|
|
46
|
+
* cursorField: 'id',
|
|
47
|
+
* customKeyForResult: 'items'
|
|
48
|
+
* })
|
|
49
|
+
* for await (const chunk of generator) {
|
|
50
|
+
* console.log(`Processing ${chunk.length} items`)
|
|
51
|
+
* }
|
|
52
|
+
*/
|
|
53
|
+
async *make(options) {
|
|
54
|
+
const batchSize = options?.limit ?? 50;
|
|
55
|
+
const cursorField = options?.cursorField ?? "id";
|
|
56
|
+
const order = options?.order ?? "ASC";
|
|
57
|
+
const customKeyForResult = options?.customKeyForResult ?? "items";
|
|
58
|
+
const params = options?.params ?? {};
|
|
59
|
+
if (/desc/i.test(order) && options?.initialValue === void 0) {
|
|
60
|
+
throw new SdkError({
|
|
61
|
+
code: "JSSDK_CORE_B24_FETCH_TAIL_DESC_REQUIRES_INITIAL_VALUE",
|
|
62
|
+
description: 'fetchTail.make: order "DESC" requires an explicit `initialValue` (the server pages by `field < value`, so the default 0 returns nothing). Pass `initialValue` set to the type maximum / newest value.',
|
|
63
|
+
status: 500
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (Array.isArray(params["filter"]) && params["filter"].some((c) => Array.isArray(c) && c[0] === cursorField)) {
|
|
67
|
+
this._logger.warning(`fetchTail.make: the cursor field "${cursorField}" must not appear in \`filter\` \u2014 the server orders and pages by it and will reject a filter on the same field (INVALIDFILTEREXCEPTION). Remove it from \`filter\`.`);
|
|
68
|
+
}
|
|
69
|
+
let select = params["select"];
|
|
70
|
+
if (Array.isArray(select)) {
|
|
71
|
+
if (!select.includes(cursorField)) {
|
|
72
|
+
select = [...select, cursorField];
|
|
73
|
+
}
|
|
74
|
+
} else if (cursorField !== "id") {
|
|
75
|
+
this._logger.warning(`fetchTail.make: no \`select\` provided with a non-default cursorField "${cursorField}" \u2014 make sure it is in the server's default field set, otherwise pass \`select\` including "${cursorField}" so the cursor can advance.`);
|
|
76
|
+
}
|
|
77
|
+
const { select: _ignoredSelect, ...restParams } = params;
|
|
78
|
+
try {
|
|
79
|
+
yield* keysetPaginate(this._b24, this._logger, {
|
|
80
|
+
method: options.method,
|
|
81
|
+
requestId: options.requestId,
|
|
82
|
+
customKeyForResult,
|
|
83
|
+
initialCursor: options?.initialValue ?? 0,
|
|
84
|
+
// Native keyset: drive the server's `cursor: { field, value, order, limit }`.
|
|
85
|
+
buildParams: /* @__PURE__ */ __name((cursor) => ({
|
|
86
|
+
...restParams,
|
|
87
|
+
...select ? { select } : {},
|
|
88
|
+
cursor: { field: cursorField, value: cursor, order, limit: batchSize }
|
|
89
|
+
}), "buildParams"),
|
|
90
|
+
// Advance by the raw cursor-field value from the last item; a missing
|
|
91
|
+
// value (cursorField not selected / wrong name) stops the walk.
|
|
92
|
+
readNextCursor: /* @__PURE__ */ __name((lastItem) => lastItem[cursorField] ?? null, "readNextCursor"),
|
|
93
|
+
noCursorWarning: `fetchTail.make: pagination stops here \u2014 no value could be read from the returned items via cursorField "${cursorField}". Make sure cursorField matches a field present in the response (and in \`select\`).`,
|
|
94
|
+
errorLabel: "fetchTailMethod"
|
|
95
|
+
});
|
|
96
|
+
} catch (error) {
|
|
97
|
+
if (error instanceof KeysetPaginationError) {
|
|
98
|
+
throw new SdkError({
|
|
99
|
+
code: "JSSDK_CORE_B24_FETCH_TAIL_METHOD_API_V3",
|
|
100
|
+
description: `API Error: ${error.messages.join("; ")}`,
|
|
101
|
+
status: 500
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { FetchTailV3 };
|
|
110
|
+
//# sourceMappingURL=fetch-tail.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-tail.mjs","sources":["../../../../../src/core/actions/v3/fetch-tail.ts"],"sourcesContent":["import type { ActionOptions } from '../abstract-action'\nimport type { TypeCallParams } from '../../../types/http'\nimport { AbstractAction } from '../abstract-action'\nimport { SdkError } from '../../sdk-error'\nimport { keysetPaginate, KeysetPaginationError } from './_keyset-paginate'\n\nexport type ActionFetchTailV3 = ActionOptions & {\n method: string\n params?: Omit<TypeCallParams, 'pagination' | 'order' | 'cursor'>\n cursorField?: string\n order?: 'ASC' | 'DESC' | 'asc' | 'desc' | string\n customKeyForResult?: string\n requestId?: string\n limit?: number\n initialValue?: number | string\n}\n\n/**\n * Calls a REST API `tail` method (native keyset cursor) and returns an async\n * generator for efficient large data retrieval. `restApi:v3`\n *\n * Unlike `fetchList`, which emulates keyset pagination on top of the `list`\n * action by injecting a `[field, '>', n]` filter, this helper drives the server\n * `tail` action with its native `cursor: { field, value, order, limit }`\n * parameter (see the v3 reference §6.2). The server itself adds `field > value`\n * (asc) / `field < value` (desc) and sorts by `field`, so the cursor field\n * MUST NOT appear in `filter` (the server rejects it with\n * `INVALIDFILTEREXCEPTION`).\n */\nexport class FetchTailV3 extends AbstractAction {\n /**\n * Streams every record of a `tail` method as chunks, advancing the keyset\n * cursor between requests.\n *\n * @template T - The type of items in the returned arrays (default is `unknown`).\n *\n * @param {ActionFetchTailV3} options - parameters for executing the request.\n * - `method: string` - A REST API `tail` method name (for example: `main.eventlog.tail`).\n * - `params?: Omit<TypeCallParams, 'pagination' | 'order' | 'cursor'>` - Request parameters.\n * Use `filter` and `select` to control the selection. `pagination`, `order` and `cursor`\n * are managed by this helper and must not be passed. The cursor field must NOT be used in `filter`.\n * - `cursorField?: string` - The DTO field that drives the cursor. Must be monotonic and\n * preferably unique, and present in `select`. Default is `id`.\n * - `order?: 'ASC' | 'DESC'` - Cursor direction. Default is `ASC`. For `DESC` you MUST pass\n * `initialValue` (the server pages by `field < value`, so the default `0` returns nothing).\n * - `customKeyForResult?: string` - The key the response groups rows under. Default is `items`.\n * - `requestId?: string` - Unique request identifier for tracking.\n * - `limit?: number` - How many records to retrieve at a time. Default is `50`. Maximum is `1000`.\n * - `initialValue?: number | string` - Cursor start value for the first page. Default is `0`\n * (valid for ascending numeric fields); required for `DESC` and for non-numeric fields.\n *\n * @returns {AsyncGenerator<T[]>} An async generator that yields chunks of data as arrays of type `T`.\n *\n * @example\n * const generator = b24.actions.v3.fetchTail.make<{ id: string }>({\n * method: 'main.eventlog.tail',\n * params: { select: ['id', 'auditType'] },\n * cursorField: 'id',\n * customKeyForResult: 'items'\n * })\n * for await (const chunk of generator) {\n * console.log(`Processing ${chunk.length} items`)\n * }\n */\n public override async* make<T = unknown>(options: ActionFetchTailV3): AsyncGenerator<T[]> {\n const batchSize = options?.limit ?? 50\n const cursorField = options?.cursorField ?? 'id'\n const order = options?.order ?? 'ASC'\n const customKeyForResult = options?.customKeyForResult ?? 'items'\n const params = options?.params ?? {}\n\n // DESC keyset needs an explicit start: the server pages by `field < value`,\n // so the default first-page value 0 would match nothing for a non-negative\n // field. Require `initialValue` (the type maximum / newest value) for DESC.\n if (/desc/i.test(order) && options?.initialValue === undefined) {\n throw new SdkError({\n code: 'JSSDK_CORE_B24_FETCH_TAIL_DESC_REQUIRES_INITIAL_VALUE',\n description: 'fetchTail.make: order \"DESC\" requires an explicit `initialValue` (the server pages by `field < value`, so the default 0 returns nothing). Pass `initialValue` set to the type maximum / newest value.',\n status: 500\n })\n }\n\n // The cursor field cannot also live in `filter` — the server forces ordering\n // and the `> value` condition on it and rejects a duplicate with\n // INVALIDFILTEREXCEPTION. Warn instead of letting the server 400. (Detection\n // covers only the short-form `[field, op, value]` triples the SDK emits.)\n if (Array.isArray(params['filter']) && params['filter'].some((c: any) => Array.isArray(c) && c[0] === cursorField)) {\n this._logger.warning(`fetchTail.make: the cursor field \"${cursorField}\" must not appear in \\`filter\\` — the server orders and pages by it and will reject a filter on the same field (INVALIDFILTEREXCEPTION). Remove it from \\`filter\\`.`)\n }\n\n // The cursor field must be readable in the response to advance. Append it to\n // an explicit `select`; when `select` is omitted we rely on the server's\n // default field set — warn for a non-default cursorField, which may not be\n // in those defaults (the per-page guard below would otherwise stop silently).\n let select = params['select'] as string[] | undefined\n if (Array.isArray(select)) {\n if (!select.includes(cursorField)) {\n select = [...select, cursorField]\n }\n } else if (cursorField !== 'id') {\n this._logger.warning(`fetchTail.make: no \\`select\\` provided with a non-default cursorField \"${cursorField}\" — make sure it is in the server's default field set, otherwise pass \\`select\\` including \"${cursorField}\" so the cursor can advance.`)\n }\n\n const { select: _ignoredSelect, ...restParams } = params as TypeCallParams\n\n try {\n yield* keysetPaginate<T>(this._b24, this._logger, {\n method: options.method,\n requestId: options.requestId,\n customKeyForResult,\n initialCursor: options?.initialValue ?? 0,\n // Native keyset: drive the server's `cursor: { field, value, order, limit }`.\n buildParams: cursor => ({\n ...restParams,\n ...(select ? { select } : {}),\n cursor: { field: cursorField, value: cursor, order, limit: batchSize }\n }),\n // Advance by the raw cursor-field value from the last item; a missing\n // value (cursorField not selected / wrong name) stops the walk.\n readNextCursor: lastItem => lastItem[cursorField] ?? null,\n noCursorWarning: `fetchTail.make: pagination stops here — no value could be read from the returned items via cursorField \"${cursorField}\". Make sure cursorField matches a field present in the response (and in \\`select\\`).`,\n errorLabel: 'fetchTailMethod'\n })\n } catch (error) {\n if (error instanceof KeysetPaginationError) {\n throw new SdkError({\n code: 'JSSDK_CORE_B24_FETCH_TAIL_METHOD_API_V3',\n description: `API Error: ${error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,CAAA,qFAAA,CAAA;AAAA,QACvI,UAAA,EAAY;AAAA,OACb,CAAA;AAAA,IACH,SAAS,KAAA,EAAO;AACd,MAAA,IAAI,iBAAiB,qBAAA,EAAuB;AAC1C,QAAA,MAAM,IAAI,QAAA,CAAS;AAAA,UACjB,IAAA,EAAM,yCAAA;AAAA,UACN,aAAa,CAAA,WAAA,EAAc,KAAA,CAAM,QAAA,CAAS,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAAA,UACpD,MAAA,EAAQ;AAAA,SACT,CAAA;AAAA,MACH;AACA,MAAA,MAAM,KAAA;AAAA,IACR;AAAA,EACF;AACF;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package @bitrix24/b24jssdk
|
|
3
|
-
* @version
|
|
3
|
+
* @version 2.0.0
|
|
4
4
|
* @copyright (c) 2026 Bitrix24
|
|
5
5
|
* @license MIT
|
|
6
6
|
* @see https://github.com/bitrix24/b24jssdk
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
import { CallV3 } from './call.mjs';
|
|
10
10
|
import { CallListV3 } from './call-list.mjs';
|
|
11
11
|
import { FetchListV3 } from './fetch-list.mjs';
|
|
12
|
+
import { CallTailV3 } from './call-tail.mjs';
|
|
13
|
+
import { FetchTailV3 } from './fetch-tail.mjs';
|
|
14
|
+
import { AggregateV3 } from './aggregate.mjs';
|
|
12
15
|
import { BatchV3 } from './batch.mjs';
|
|
13
16
|
import { BatchByChunkV3 } from './batch-by-chunk.mjs';
|
|
14
17
|
import { LoggerFactory } from '../../../logger/logger-factory.mjs';
|
|
@@ -18,6 +21,9 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
18
21
|
const callName = /* @__PURE__ */ Symbol("call_V3");
|
|
19
22
|
const callListName = /* @__PURE__ */ Symbol("callList_V3");
|
|
20
23
|
const fetchListName = /* @__PURE__ */ Symbol("fetchList_V3");
|
|
24
|
+
const callTailName = /* @__PURE__ */ Symbol("callTail_V3");
|
|
25
|
+
const fetchTailName = /* @__PURE__ */ Symbol("fetchTail_V3");
|
|
26
|
+
const aggregateName = /* @__PURE__ */ Symbol("aggregate_V3");
|
|
21
27
|
const batchName = /* @__PURE__ */ Symbol("batch_V3");
|
|
22
28
|
const batchByChunkName = /* @__PURE__ */ Symbol("batchByChunk_V3");
|
|
23
29
|
class ActionsManagerV3 {
|
|
@@ -56,6 +62,24 @@ class ActionsManagerV3 {
|
|
|
56
62
|
}
|
|
57
63
|
return this._mapActions.get(fetchListName);
|
|
58
64
|
}
|
|
65
|
+
get callTail() {
|
|
66
|
+
if (!this._mapActions.has(callTailName)) {
|
|
67
|
+
this._mapActions.set(callTailName, new CallTailV3(this._b24, this._logger));
|
|
68
|
+
}
|
|
69
|
+
return this._mapActions.get(callTailName);
|
|
70
|
+
}
|
|
71
|
+
get fetchTail() {
|
|
72
|
+
if (!this._mapActions.has(fetchTailName)) {
|
|
73
|
+
this._mapActions.set(fetchTailName, new FetchTailV3(this._b24, this._logger));
|
|
74
|
+
}
|
|
75
|
+
return this._mapActions.get(fetchTailName);
|
|
76
|
+
}
|
|
77
|
+
get aggregate() {
|
|
78
|
+
if (!this._mapActions.has(aggregateName)) {
|
|
79
|
+
this._mapActions.set(aggregateName, new AggregateV3(this._b24, this._logger));
|
|
80
|
+
}
|
|
81
|
+
return this._mapActions.get(aggregateName);
|
|
82
|
+
}
|
|
59
83
|
get batch() {
|
|
60
84
|
if (!this._mapActions.has(batchName)) {
|
|
61
85
|
this._mapActions.set(batchName, new BatchV3(this._b24, this._logger));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager-v3.mjs","sources":["../../../../../src/core/actions/v3/manager-v3.ts"],"sourcesContent":["import type { TypeB24 } from '../../../types/b24'\nimport type { LoggerInterface } from '../../../types/logger'\nimport type { AbstractAction } from '../abstract-action'\nimport { LoggerFactory } from '../../../logger'\nimport { CallV3 } from './call'\nimport { CallListV3 } from './call-list'\nimport { FetchListV3 } from './fetch-list'\nimport { BatchV3 } from './batch'\nimport { BatchByChunkV3 } from './batch-by-chunk'\n\nconst callName = Symbol('call_V3')\nconst callListName = Symbol('callList_V3')\nconst fetchListName = Symbol('fetchList_V3')\nconst batchName = Symbol('batch_V3')\nconst batchByChunkName = Symbol('batchByChunk_V3')\n/**\n * Some actions for TypeB24 by Api:v3\n */\nexport class ActionsManagerV3 {\n protected _b24: TypeB24\n protected _logger: LoggerInterface\n\n protected _mapActions: Map<symbol, AbstractAction>\n\n constructor(b24: TypeB24) {\n this._b24 = b24\n this._logger = LoggerFactory.createNullLogger()\n\n this._mapActions = new Map()\n }\n\n public setLogger(logger: LoggerInterface): void {\n this._logger = logger\n }\n\n public getLogger(): LoggerInterface {\n return this._logger\n }\n\n get call(): CallV3 {\n if (!this._mapActions.has(callName)) {\n this._mapActions.set(callName, new CallV3(this._b24, this._logger))\n }\n return this._mapActions.get(callName)! as CallV3\n }\n\n get callList(): CallListV3 {\n if (!this._mapActions.has(callListName)) {\n this._mapActions.set(callListName, new CallListV3(this._b24, this._logger))\n }\n return this._mapActions.get(callListName)! as CallListV3\n }\n\n get fetchList(): FetchListV3 {\n if (!this._mapActions.has(fetchListName)) {\n this._mapActions.set(fetchListName, new FetchListV3(this._b24, this._logger))\n }\n return this._mapActions.get(fetchListName)! as FetchListV3\n }\n\n get batch(): BatchV3 {\n if (!this._mapActions.has(batchName)) {\n this._mapActions.set(batchName, new BatchV3(this._b24, this._logger))\n }\n return this._mapActions.get(batchName)! as BatchV3\n }\n\n get batchByChunk(): BatchByChunkV3 {\n if (!this._mapActions.has(batchByChunkName)) {\n this._mapActions.set(batchByChunkName, new BatchByChunkV3(this._b24, this._logger))\n }\n return this._mapActions.get(batchByChunkName)! as BatchByChunkV3\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manager-v3.mjs","sources":["../../../../../src/core/actions/v3/manager-v3.ts"],"sourcesContent":["import type { TypeB24 } from '../../../types/b24'\nimport type { LoggerInterface } from '../../../types/logger'\nimport type { AbstractAction } from '../abstract-action'\nimport { LoggerFactory } from '../../../logger'\nimport { CallV3 } from './call'\nimport { CallListV3 } from './call-list'\nimport { FetchListV3 } from './fetch-list'\nimport { CallTailV3 } from './call-tail'\nimport { FetchTailV3 } from './fetch-tail'\nimport { AggregateV3 } from './aggregate'\nimport { BatchV3 } from './batch'\nimport { BatchByChunkV3 } from './batch-by-chunk'\n\nconst callName = Symbol('call_V3')\nconst callListName = Symbol('callList_V3')\nconst fetchListName = Symbol('fetchList_V3')\nconst callTailName = Symbol('callTail_V3')\nconst fetchTailName = Symbol('fetchTail_V3')\nconst aggregateName = Symbol('aggregate_V3')\nconst batchName = Symbol('batch_V3')\nconst batchByChunkName = Symbol('batchByChunk_V3')\n/**\n * Some actions for TypeB24 by Api:v3\n */\nexport class ActionsManagerV3 {\n protected _b24: TypeB24\n protected _logger: LoggerInterface\n\n protected _mapActions: Map<symbol, AbstractAction>\n\n constructor(b24: TypeB24) {\n this._b24 = b24\n this._logger = LoggerFactory.createNullLogger()\n\n this._mapActions = new Map()\n }\n\n public setLogger(logger: LoggerInterface): void {\n this._logger = logger\n }\n\n public getLogger(): LoggerInterface {\n return this._logger\n }\n\n get call(): CallV3 {\n if (!this._mapActions.has(callName)) {\n this._mapActions.set(callName, new CallV3(this._b24, this._logger))\n }\n return this._mapActions.get(callName)! as CallV3\n }\n\n get callList(): CallListV3 {\n if (!this._mapActions.has(callListName)) {\n this._mapActions.set(callListName, new CallListV3(this._b24, this._logger))\n }\n return this._mapActions.get(callListName)! as CallListV3\n }\n\n get fetchList(): FetchListV3 {\n if (!this._mapActions.has(fetchListName)) {\n this._mapActions.set(fetchListName, new FetchListV3(this._b24, this._logger))\n }\n return this._mapActions.get(fetchListName)! as FetchListV3\n }\n\n get callTail(): CallTailV3 {\n if (!this._mapActions.has(callTailName)) {\n this._mapActions.set(callTailName, new CallTailV3(this._b24, this._logger))\n }\n return this._mapActions.get(callTailName)! as CallTailV3\n }\n\n get fetchTail(): FetchTailV3 {\n if (!this._mapActions.has(fetchTailName)) {\n this._mapActions.set(fetchTailName, new FetchTailV3(this._b24, this._logger))\n }\n return this._mapActions.get(fetchTailName)! as FetchTailV3\n }\n\n get aggregate(): AggregateV3 {\n if (!this._mapActions.has(aggregateName)) {\n this._mapActions.set(aggregateName, new AggregateV3(this._b24, this._logger))\n }\n return this._mapActions.get(aggregateName)! as AggregateV3\n }\n\n get batch(): BatchV3 {\n if (!this._mapActions.has(batchName)) {\n this._mapActions.set(batchName, new BatchV3(this._b24, this._logger))\n }\n return this._mapActions.get(batchName)! as BatchV3\n }\n\n get batchByChunk(): BatchByChunkV3 {\n if (!this._mapActions.has(batchByChunkName)) {\n this._mapActions.set(batchByChunkName, new BatchByChunkV3(this._b24, this._logger))\n }\n return this._mapActions.get(batchByChunkName)! as BatchByChunkV3\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAaA,MAAM,QAAA,0BAAkB,SAAS,CAAA;AACjC,MAAM,YAAA,0BAAsB,aAAa,CAAA;AACzC,MAAM,aAAA,0BAAuB,cAAc,CAAA;AAC3C,MAAM,YAAA,0BAAsB,aAAa,CAAA;AACzC,MAAM,aAAA,0BAAuB,cAAc,CAAA;AAC3C,MAAM,aAAA,0BAAuB,cAAc,CAAA;AAC3C,MAAM,SAAA,0BAAmB,UAAU,CAAA;AACnC,MAAM,gBAAA,0BAA0B,iBAAiB,CAAA;AAI1C,MAAM,gBAAA,CAAiB;AAAA,EAxB9B;AAwB8B,IAAA,MAAA,CAAA,IAAA,EAAA,kBAAA,CAAA;AAAA;AAAA,EAClB,IAAA;AAAA,EACA,OAAA;AAAA,EAEA,WAAA;AAAA,EAEV,YAAY,GAAA,EAAc;AACxB,IAAA,IAAA,CAAK,IAAA,GAAO,GAAA;AACZ,IAAA,IAAA,CAAK,OAAA,GAAU,cAAc,gBAAA,EAAiB;AAE9C,IAAA,IAAA,CAAK,WAAA,uBAAkB,GAAA,EAAI;AAAA,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