@bitrix24/b24jssdk 1.1.0 → 1.1.2
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 +2 -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 -1
- package/dist/esm/core/actions/v2/fetch-list.mjs +1 -1
- package/dist/esm/core/actions/v2/manager-v2.mjs +1 -1
- package/dist/esm/core/actions/v3/batch-by-chunk.mjs +1 -1
- package/dist/esm/core/actions/v3/batch.mjs +1 -1
- package/dist/esm/core/actions/v3/call-list.mjs +1 -1
- package/dist/esm/core/actions/v3/call.mjs +1 -1
- package/dist/esm/core/actions/v3/fetch-list.mjs +1 -1
- package/dist/esm/core/actions/v3/manager-v3.mjs +1 -1
- package/dist/esm/core/http/abstract-http.mjs +9 -13
- package/dist/esm/core/http/abstract-http.mjs.map +1 -1
- package/dist/esm/core/http/ajax-error.mjs +9 -5
- package/dist/esm/core/http/ajax-error.mjs.map +1 -1
- package/dist/esm/core/http/ajax-result.mjs +1 -1
- package/dist/esm/core/http/limiters/adaptive-delayer.mjs +1 -1
- package/dist/esm/core/http/limiters/manager.mjs +70 -38
- 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 +3 -2
- package/dist/esm/core/http/limiters/params-factory.mjs.map +1 -1
- package/dist/esm/core/http/limiters/rate-limiter.mjs +1 -1
- package/dist/esm/core/http/redact.mjs +52 -0
- package/dist/esm/core/http/redact.mjs.map +1 -0
- package/dist/esm/core/http/v2.mjs +2 -2
- package/dist/esm/core/http/v3.mjs +2 -2
- package/dist/esm/core/interaction/batch/abstract-interaction-batch.mjs +1 -1
- package/dist/esm/core/interaction/batch/parse-row.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/interface-strategy.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/abstract-processing.mjs +2 -2
- package/dist/esm/core/interaction/batch/processing/v2/abstract-processing.mjs.map +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/as-array.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v2/as-object.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v3/abstract-processing.mjs +16 -9
- package/dist/esm/core/interaction/batch/processing/v3/abstract-processing.mjs.map +1 -1
- package/dist/esm/core/interaction/batch/processing/v3/as-array.mjs +1 -1
- package/dist/esm/core/interaction/batch/processing/v3/as-object.mjs +1 -1
- package/dist/esm/core/interaction/batch/v2.mjs +1 -1
- package/dist/esm/core/interaction/batch/v3.mjs +1 -1
- package/dist/esm/core/language/list.mjs +1 -1
- package/dist/esm/core/request-id-generator.mjs +1 -1
- package/dist/esm/core/result.mjs +1 -1
- package/dist/esm/core/sdk-error.mjs +1 -1
- package/dist/esm/core/tools/abstract-tool.mjs +1 -1
- package/dist/esm/core/tools/healthcheck.mjs +1 -1
- package/dist/esm/core/tools/manager.mjs +1 -1
- package/dist/esm/core/tools/ping.mjs +1 -1
- package/dist/esm/core/version-manager.mjs +1 -1
- package/dist/esm/frame/auth.mjs +1 -1
- package/dist/esm/frame/b24.mjs +1 -1
- package/dist/esm/frame/dialog.mjs +1 -1
- package/dist/esm/frame/frame.mjs +1 -1
- package/dist/esm/frame/message/commands.mjs +1 -1
- package/dist/esm/frame/message/controller.mjs +1 -1
- package/dist/esm/frame/options.mjs +1 -1
- package/dist/esm/frame/parent.mjs +1 -1
- package/dist/esm/frame/placement.mjs +1 -1
- package/dist/esm/frame/slider.mjs +1 -1
- package/dist/esm/helper/abstract-helper.mjs +1 -1
- package/dist/esm/helper/app-manager.mjs +1 -1
- package/dist/esm/helper/currency-manager.mjs +1 -1
- package/dist/esm/helper/helper-manager.mjs +1 -1
- package/dist/esm/helper/license-manager.mjs +1 -1
- package/dist/esm/helper/options-manager.mjs +1 -1
- package/dist/esm/helper/payment-manager.mjs +1 -1
- package/dist/esm/helper/profile-manager.mjs +1 -1
- package/dist/esm/helper/use-b24-helper.mjs +1 -1
- package/dist/esm/hook/auth.mjs +1 -1
- package/dist/esm/hook/b24.mjs +1 -1
- package/dist/esm/index.d.mts +72 -9
- package/dist/esm/index.d.ts +72 -9
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/loader-b24frame.mjs +1 -1
- package/dist/esm/logger/abstract-logger.mjs +1 -1
- package/dist/esm/logger/browser.mjs +1 -1
- package/dist/esm/logger/formatter/abstract-formatter.mjs +1 -1
- package/dist/esm/logger/formatter/json-formatter.mjs +1 -1
- package/dist/esm/logger/formatter/line-formatter.mjs +1 -1
- package/dist/esm/logger/formatter/telegram-formatter.mjs +1 -1
- package/dist/esm/logger/handler/abstract-handler.mjs +1 -1
- package/dist/esm/logger/handler/consola-adapter.mjs +1 -1
- package/dist/esm/logger/handler/console-handler.mjs +1 -1
- package/dist/esm/logger/handler/console-v2-handler.mjs +1 -1
- package/dist/esm/logger/handler/memory-handler.mjs +1 -1
- package/dist/esm/logger/handler/stream-handler.mjs +1 -1
- package/dist/esm/logger/handler/telegram-handler.mjs +1 -1
- package/dist/esm/logger/handler/winston-adapter.mjs +1 -1
- package/dist/esm/logger/logger-factory.mjs +1 -1
- package/dist/esm/logger/logger.mjs +1 -1
- package/dist/esm/logger/null-logger.mjs +1 -1
- package/dist/esm/logger/processor/memory-usage-processor.mjs +1 -1
- package/dist/esm/logger/processor/pid-processor.mjs +1 -1
- package/dist/esm/oauth/auth.mjs +1 -1
- package/dist/esm/oauth/b24.mjs +1 -1
- package/dist/esm/oauth/refresh-token-error.mjs +1 -1
- package/dist/esm/pullClient/abstract-connector.mjs +1 -1
- package/dist/esm/pullClient/channel-manager.mjs +1 -1
- package/dist/esm/pullClient/client.mjs +1 -1
- package/dist/esm/pullClient/errors.mjs +1 -1
- package/dist/esm/pullClient/json-rpc.mjs +1 -1
- package/dist/esm/pullClient/long-polling-connector.mjs +1 -1
- package/dist/esm/pullClient/protobuf/index.mjs +1 -1
- package/dist/esm/pullClient/protobuf/model.mjs +1 -1
- package/dist/esm/pullClient/protobuf/protobuf.mjs +1 -1
- package/dist/esm/pullClient/shared-config.mjs +1 -1
- package/dist/esm/pullClient/storage-manager.mjs +1 -1
- package/dist/esm/pullClient/web-socket-connector.mjs +1 -1
- package/dist/esm/tools/browser.mjs +1 -1
- package/dist/esm/tools/environment.mjs +1 -1
- package/dist/esm/tools/formatters/iban.mjs +1 -1
- package/dist/esm/tools/formatters/numbers.mjs +1 -1
- package/dist/esm/tools/index.mjs +1 -1
- package/dist/esm/tools/scroll-size.mjs +1 -1
- package/dist/esm/tools/text.mjs +1 -1
- package/dist/esm/tools/type.mjs +1 -1
- package/dist/esm/tools/use-formatters.mjs +1 -1
- package/dist/esm/tools/uuidv7.mjs +1 -1
- package/dist/esm/types/b24-helper.mjs +1 -1
- package/dist/esm/types/b24.mjs +1 -1
- package/dist/esm/types/bizproc/index.mjs +1 -1
- package/dist/esm/types/catalog/index.mjs +1 -1
- package/dist/esm/types/common.mjs +1 -1
- package/dist/esm/types/crm/entity-type.mjs +1 -1
- package/dist/esm/types/crm/productrow.mjs +1 -1
- package/dist/esm/types/logger.mjs +1 -1
- package/dist/esm/types/pull.mjs +1 -1
- package/dist/umd/index.js +241 -161
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/index.min.js +21 -21
- package/dist/umd/index.min.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/core/result.mjs
CHANGED
package/dist/esm/frame/auth.mjs
CHANGED
package/dist/esm/frame/b24.mjs
CHANGED
package/dist/esm/frame/frame.mjs
CHANGED
package/dist/esm/hook/auth.mjs
CHANGED
package/dist/esm/hook/b24.mjs
CHANGED
package/dist/esm/index.d.mts
CHANGED
|
@@ -1324,6 +1324,51 @@ interface RestrictionParams {
|
|
|
1324
1324
|
* Default: 1_000
|
|
1325
1325
|
*/
|
|
1326
1326
|
retryDelay?: number;
|
|
1327
|
+
/**
|
|
1328
|
+
* Whether to retry on transport-level errors (`NETWORK_ERROR`, `REQUEST_TIMEOUT`).
|
|
1329
|
+
*
|
|
1330
|
+
* Default: `true` — preserves the historical retry behaviour.
|
|
1331
|
+
*
|
|
1332
|
+
* Set to `false` for **non-idempotent** calls (e.g. `crm.documentgenerator.document.add`,
|
|
1333
|
+
* any `*.add` that creates an entity, file uploads). When the request times out
|
|
1334
|
+
* client-side, the server may still have processed it successfully — retrying then
|
|
1335
|
+
* creates duplicates. With `retryOnNetworkError: false` the SDK immediately throws
|
|
1336
|
+
* `NETWORK_ERROR` / `REQUEST_TIMEOUT` instead of retrying.
|
|
1337
|
+
*
|
|
1338
|
+
* For long-running heavy operations also raise the axios timeout:
|
|
1339
|
+
* ```ts
|
|
1340
|
+
* const clientAxios = $b24.getHttpClient(ApiVersion.v2).ajaxClient
|
|
1341
|
+
* clientAxios.defaults.timeout = 120_000
|
|
1342
|
+
* ```
|
|
1343
|
+
*/
|
|
1344
|
+
retryOnNetworkError?: boolean;
|
|
1345
|
+
/**
|
|
1346
|
+
* Additional error codes that must be thrown as exceptions immediately,
|
|
1347
|
+
* without any retry. Merged with the SDK's built-in hard list — you can
|
|
1348
|
+
* only **add** codes, not remove built-ins (auth / fatal codes are always hard).
|
|
1349
|
+
*
|
|
1350
|
+
* Use this for business-specific or custom REST methods whose error codes
|
|
1351
|
+
* the SDK doesn't know about (otherwise the SDK treats unknown codes as
|
|
1352
|
+
* transient and retries them with backoff).
|
|
1353
|
+
*
|
|
1354
|
+
* @example
|
|
1355
|
+
* ```ts
|
|
1356
|
+
* await $b24.setRestrictionManagerParams({
|
|
1357
|
+
* ...ParamsFactory.getDefault(),
|
|
1358
|
+
* hardErrorCodes: ['DOCUMENT_GENERATOR_ALREADY_IN_QUEUE', 'MY_APP_BAD_PAYLOAD']
|
|
1359
|
+
* })
|
|
1360
|
+
* ```
|
|
1361
|
+
*/
|
|
1362
|
+
hardErrorCodes?: string[];
|
|
1363
|
+
/**
|
|
1364
|
+
* Additional error codes that should be returned inside `AjaxResult` as a
|
|
1365
|
+
* soft error instead of thrown. Merged with the SDK's built-in soft list.
|
|
1366
|
+
*
|
|
1367
|
+
* Use this when your application expects to inspect a specific REST error
|
|
1368
|
+
* code as part of normal control flow (e.g. validation errors from a
|
|
1369
|
+
* custom v3 endpoint).
|
|
1370
|
+
*/
|
|
1371
|
+
softErrorCodes?: string[];
|
|
1327
1372
|
}
|
|
1328
1373
|
/**
|
|
1329
1374
|
* Limiter operation statistics
|
|
@@ -3722,9 +3767,7 @@ type AjaxErrorParams = {
|
|
|
3722
3767
|
cause?: Error;
|
|
3723
3768
|
};
|
|
3724
3769
|
type AjaxErrorDetails = SdkErrorDetails & {
|
|
3725
|
-
requestInfo?: Partial<AjaxQuery
|
|
3726
|
-
url?: string;
|
|
3727
|
-
};
|
|
3770
|
+
requestInfo?: Partial<AjaxQuery>;
|
|
3728
3771
|
};
|
|
3729
3772
|
/**
|
|
3730
3773
|
* Error requesting RestApi
|
|
@@ -3761,13 +3804,11 @@ declare class AjaxError extends SdkError {
|
|
|
3761
3804
|
message: string;
|
|
3762
3805
|
status: number;
|
|
3763
3806
|
timestamp: string;
|
|
3764
|
-
requestInfo:
|
|
3807
|
+
requestInfo: Partial<Readonly<{
|
|
3765
3808
|
method: string;
|
|
3766
3809
|
params: TypeCallParams;
|
|
3767
3810
|
requestId: string;
|
|
3768
|
-
}>>
|
|
3769
|
-
url?: string;
|
|
3770
|
-
}) | undefined;
|
|
3811
|
+
}>> | undefined;
|
|
3771
3812
|
stack: string | undefined;
|
|
3772
3813
|
};
|
|
3773
3814
|
/**
|
|
@@ -3960,11 +4001,33 @@ declare class RestrictionManager {
|
|
|
3960
4001
|
updateStats(requestId: string, method: string, timeData: any): Promise<void>;
|
|
3961
4002
|
handleError(requestId: string, method: string, params: any, error: any, attempt: number): Promise<number>;
|
|
3962
4003
|
/**
|
|
3963
|
-
*
|
|
4004
|
+
* Built-in hard error codes (always throw, never retry).
|
|
4005
|
+
*
|
|
4006
|
+
* Includes authorization and fatal codes that must never be silently retried.
|
|
4007
|
+
* Use `RestrictionParams.hardErrorCodes` to extend this list with custom codes.
|
|
4008
|
+
*/
|
|
4009
|
+
static readonly BUILT_IN_HARD_ERROR_CODES: readonly string[];
|
|
4010
|
+
/**
|
|
4011
|
+
* Built-in soft error codes (returned as `AjaxResult` with error, never thrown).
|
|
4012
|
+
*
|
|
4013
|
+
* Use `RestrictionParams.softErrorCodes` to extend this list with custom codes.
|
|
4014
|
+
*/
|
|
4015
|
+
static readonly BUILT_IN_SOFT_ERROR_CODES: readonly string[];
|
|
4016
|
+
/**
|
|
4017
|
+
* Codes that cause the SDK to throw immediately.
|
|
4018
|
+
*
|
|
4019
|
+
* Composed of:
|
|
4020
|
+
* - `BUILT_IN_HARD_ERROR_CODES` (always included)
|
|
4021
|
+
* - `NETWORK_ERROR` and `REQUEST_TIMEOUT` when `retryOnNetworkError === false`
|
|
4022
|
+
* - `RestrictionParams.hardErrorCodes` (user-provided extensions)
|
|
3964
4023
|
*/
|
|
3965
4024
|
get exceptionCodeForHard(): string[];
|
|
3966
4025
|
/**
|
|
3967
|
-
*
|
|
4026
|
+
* Codes returned as `AjaxResult` with an `AjaxError` payload instead of thrown.
|
|
4027
|
+
*
|
|
4028
|
+
* Composed of:
|
|
4029
|
+
* - `BUILT_IN_SOFT_ERROR_CODES` (always included)
|
|
4030
|
+
* - `RestrictionParams.softErrorCodes` (user-provided extensions)
|
|
3968
4031
|
*/
|
|
3969
4032
|
get exceptionCodeForSoft(): string[];
|
|
3970
4033
|
incrementError(method: string): void;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1324,6 +1324,51 @@ interface RestrictionParams {
|
|
|
1324
1324
|
* Default: 1_000
|
|
1325
1325
|
*/
|
|
1326
1326
|
retryDelay?: number;
|
|
1327
|
+
/**
|
|
1328
|
+
* Whether to retry on transport-level errors (`NETWORK_ERROR`, `REQUEST_TIMEOUT`).
|
|
1329
|
+
*
|
|
1330
|
+
* Default: `true` — preserves the historical retry behaviour.
|
|
1331
|
+
*
|
|
1332
|
+
* Set to `false` for **non-idempotent** calls (e.g. `crm.documentgenerator.document.add`,
|
|
1333
|
+
* any `*.add` that creates an entity, file uploads). When the request times out
|
|
1334
|
+
* client-side, the server may still have processed it successfully — retrying then
|
|
1335
|
+
* creates duplicates. With `retryOnNetworkError: false` the SDK immediately throws
|
|
1336
|
+
* `NETWORK_ERROR` / `REQUEST_TIMEOUT` instead of retrying.
|
|
1337
|
+
*
|
|
1338
|
+
* For long-running heavy operations also raise the axios timeout:
|
|
1339
|
+
* ```ts
|
|
1340
|
+
* const clientAxios = $b24.getHttpClient(ApiVersion.v2).ajaxClient
|
|
1341
|
+
* clientAxios.defaults.timeout = 120_000
|
|
1342
|
+
* ```
|
|
1343
|
+
*/
|
|
1344
|
+
retryOnNetworkError?: boolean;
|
|
1345
|
+
/**
|
|
1346
|
+
* Additional error codes that must be thrown as exceptions immediately,
|
|
1347
|
+
* without any retry. Merged with the SDK's built-in hard list — you can
|
|
1348
|
+
* only **add** codes, not remove built-ins (auth / fatal codes are always hard).
|
|
1349
|
+
*
|
|
1350
|
+
* Use this for business-specific or custom REST methods whose error codes
|
|
1351
|
+
* the SDK doesn't know about (otherwise the SDK treats unknown codes as
|
|
1352
|
+
* transient and retries them with backoff).
|
|
1353
|
+
*
|
|
1354
|
+
* @example
|
|
1355
|
+
* ```ts
|
|
1356
|
+
* await $b24.setRestrictionManagerParams({
|
|
1357
|
+
* ...ParamsFactory.getDefault(),
|
|
1358
|
+
* hardErrorCodes: ['DOCUMENT_GENERATOR_ALREADY_IN_QUEUE', 'MY_APP_BAD_PAYLOAD']
|
|
1359
|
+
* })
|
|
1360
|
+
* ```
|
|
1361
|
+
*/
|
|
1362
|
+
hardErrorCodes?: string[];
|
|
1363
|
+
/**
|
|
1364
|
+
* Additional error codes that should be returned inside `AjaxResult` as a
|
|
1365
|
+
* soft error instead of thrown. Merged with the SDK's built-in soft list.
|
|
1366
|
+
*
|
|
1367
|
+
* Use this when your application expects to inspect a specific REST error
|
|
1368
|
+
* code as part of normal control flow (e.g. validation errors from a
|
|
1369
|
+
* custom v3 endpoint).
|
|
1370
|
+
*/
|
|
1371
|
+
softErrorCodes?: string[];
|
|
1327
1372
|
}
|
|
1328
1373
|
/**
|
|
1329
1374
|
* Limiter operation statistics
|
|
@@ -3722,9 +3767,7 @@ type AjaxErrorParams = {
|
|
|
3722
3767
|
cause?: Error;
|
|
3723
3768
|
};
|
|
3724
3769
|
type AjaxErrorDetails = SdkErrorDetails & {
|
|
3725
|
-
requestInfo?: Partial<AjaxQuery
|
|
3726
|
-
url?: string;
|
|
3727
|
-
};
|
|
3770
|
+
requestInfo?: Partial<AjaxQuery>;
|
|
3728
3771
|
};
|
|
3729
3772
|
/**
|
|
3730
3773
|
* Error requesting RestApi
|
|
@@ -3761,13 +3804,11 @@ declare class AjaxError extends SdkError {
|
|
|
3761
3804
|
message: string;
|
|
3762
3805
|
status: number;
|
|
3763
3806
|
timestamp: string;
|
|
3764
|
-
requestInfo:
|
|
3807
|
+
requestInfo: Partial<Readonly<{
|
|
3765
3808
|
method: string;
|
|
3766
3809
|
params: TypeCallParams;
|
|
3767
3810
|
requestId: string;
|
|
3768
|
-
}>>
|
|
3769
|
-
url?: string;
|
|
3770
|
-
}) | undefined;
|
|
3811
|
+
}>> | undefined;
|
|
3771
3812
|
stack: string | undefined;
|
|
3772
3813
|
};
|
|
3773
3814
|
/**
|
|
@@ -3960,11 +4001,33 @@ declare class RestrictionManager {
|
|
|
3960
4001
|
updateStats(requestId: string, method: string, timeData: any): Promise<void>;
|
|
3961
4002
|
handleError(requestId: string, method: string, params: any, error: any, attempt: number): Promise<number>;
|
|
3962
4003
|
/**
|
|
3963
|
-
*
|
|
4004
|
+
* Built-in hard error codes (always throw, never retry).
|
|
4005
|
+
*
|
|
4006
|
+
* Includes authorization and fatal codes that must never be silently retried.
|
|
4007
|
+
* Use `RestrictionParams.hardErrorCodes` to extend this list with custom codes.
|
|
4008
|
+
*/
|
|
4009
|
+
static readonly BUILT_IN_HARD_ERROR_CODES: readonly string[];
|
|
4010
|
+
/**
|
|
4011
|
+
* Built-in soft error codes (returned as `AjaxResult` with error, never thrown).
|
|
4012
|
+
*
|
|
4013
|
+
* Use `RestrictionParams.softErrorCodes` to extend this list with custom codes.
|
|
4014
|
+
*/
|
|
4015
|
+
static readonly BUILT_IN_SOFT_ERROR_CODES: readonly string[];
|
|
4016
|
+
/**
|
|
4017
|
+
* Codes that cause the SDK to throw immediately.
|
|
4018
|
+
*
|
|
4019
|
+
* Composed of:
|
|
4020
|
+
* - `BUILT_IN_HARD_ERROR_CODES` (always included)
|
|
4021
|
+
* - `NETWORK_ERROR` and `REQUEST_TIMEOUT` when `retryOnNetworkError === false`
|
|
4022
|
+
* - `RestrictionParams.hardErrorCodes` (user-provided extensions)
|
|
3964
4023
|
*/
|
|
3965
4024
|
get exceptionCodeForHard(): string[];
|
|
3966
4025
|
/**
|
|
3967
|
-
*
|
|
4026
|
+
* Codes returned as `AjaxResult` with an `AjaxError` payload instead of thrown.
|
|
4027
|
+
*
|
|
4028
|
+
* Composed of:
|
|
4029
|
+
* - `BUILT_IN_SOFT_ERROR_CODES` (always included)
|
|
4030
|
+
* - `RestrictionParams.softErrorCodes` (user-provided extensions)
|
|
3968
4031
|
*/
|
|
3969
4032
|
get exceptionCodeForSoft(): string[];
|
|
3970
4033
|
incrementError(method: string): void;
|
package/dist/esm/index.mjs
CHANGED