@woodger/t-invest-node-sdk 0.5.2 → 0.5.4
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/CHANGELOG.md +30 -0
- package/{THIRD_PARTY_NOTICES.md → LICENSE-APACHE-2.0} +1 -106
- package/NOTICE +98 -0
- package/dist/application/services/unary-limiter.d.ts +10 -1
- package/dist/application/services/unary-limiter.js +35 -11
- package/dist/bootstrap/args/sdk-options.d.ts +1 -2
- package/dist/bootstrap/cli/help-catalog.d.ts +733 -0
- package/dist/bootstrap/cli/help-catalog.js +1649 -0
- package/dist/bootstrap/cli/help.d.ts +2 -730
- package/dist/bootstrap/cli/help.js +5 -1647
- package/dist/bootstrap/cli/registry.d.ts +6 -6
- package/dist/bootstrap/commands/accounts/cli.d.ts +2 -3
- package/dist/bootstrap/commands/accounts/cli.js +5 -10
- package/dist/bootstrap/commands/accrued-interests/cli.d.ts +2 -3
- package/dist/bootstrap/commands/accrued-interests/cli.js +5 -10
- package/dist/bootstrap/commands/asset/cli.d.ts +2 -3
- package/dist/bootstrap/commands/asset/cli.js +5 -10
- package/dist/bootstrap/commands/assets/cli.d.ts +2 -3
- package/dist/bootstrap/commands/assets/cli.js +5 -10
- package/dist/bootstrap/commands/bond/cli.d.ts +2 -3
- package/dist/bootstrap/commands/bond/cli.js +5 -10
- package/dist/bootstrap/commands/bond-coupons/cli.d.ts +2 -3
- package/dist/bootstrap/commands/bond-coupons/cli.js +5 -10
- package/dist/bootstrap/commands/bonds/cli.d.ts +2 -3
- package/dist/bootstrap/commands/bonds/cli.js +5 -10
- package/dist/bootstrap/commands/brand/cli.d.ts +2 -3
- package/dist/bootstrap/commands/brand/cli.js +5 -10
- package/dist/bootstrap/commands/brands/cli.d.ts +2 -3
- package/dist/bootstrap/commands/brands/cli.js +5 -10
- package/dist/bootstrap/commands/broker-report/cli.d.ts +2 -3
- package/dist/bootstrap/commands/broker-report/cli.js +5 -10
- package/dist/bootstrap/commands/cancel-order/cli.d.ts +3 -39
- package/dist/bootstrap/commands/cancel-order/cli.js +8 -19
- package/dist/bootstrap/commands/cancel-order/request.mapper.d.ts +7 -0
- package/dist/bootstrap/commands/cancel-order/request.mapper.js +9 -0
- package/dist/bootstrap/commands/cancel-stop-order/cli.d.ts +3 -4
- package/dist/bootstrap/commands/cancel-stop-order/cli.js +6 -11
- package/dist/bootstrap/commands/candles/cli.d.ts +3 -4
- package/dist/bootstrap/commands/candles/cli.js +6 -11
- package/dist/bootstrap/commands/close-prices/cli.d.ts +3 -4
- package/dist/bootstrap/commands/close-prices/cli.js +6 -11
- package/dist/bootstrap/commands/countries/cli.d.ts +2 -3
- package/dist/bootstrap/commands/countries/cli.js +5 -10
- package/dist/bootstrap/commands/currencies/cli.d.ts +2 -3
- package/dist/bootstrap/commands/currencies/cli.js +5 -10
- package/dist/bootstrap/commands/currency/cli.d.ts +2 -3
- package/dist/bootstrap/commands/currency/cli.js +5 -10
- package/dist/bootstrap/commands/dividends/cli.d.ts +2 -3
- package/dist/bootstrap/commands/dividends/cli.js +5 -10
- package/dist/bootstrap/commands/dividends-foreign-issuer/cli.d.ts +2 -3
- package/dist/bootstrap/commands/dividends-foreign-issuer/cli.js +5 -10
- package/dist/bootstrap/commands/edit-favorites/cli.d.ts +2 -3
- package/dist/bootstrap/commands/edit-favorites/cli.js +5 -10
- package/dist/bootstrap/commands/etf/cli.d.ts +2 -3
- package/dist/bootstrap/commands/etf/cli.js +5 -10
- package/dist/bootstrap/commands/etfs/cli.d.ts +2 -3
- package/dist/bootstrap/commands/etfs/cli.js +5 -10
- package/dist/bootstrap/commands/favorites/cli.d.ts +2 -3
- package/dist/bootstrap/commands/favorites/cli.js +5 -10
- package/dist/bootstrap/commands/find-instrument/cli.d.ts +2 -3
- package/dist/bootstrap/commands/find-instrument/cli.js +5 -10
- package/dist/bootstrap/commands/future/cli.d.ts +2 -3
- package/dist/bootstrap/commands/future/cli.js +5 -10
- package/dist/bootstrap/commands/futures/cli.d.ts +2 -3
- package/dist/bootstrap/commands/futures/cli.js +5 -10
- package/dist/bootstrap/commands/futures-margin/cli.d.ts +2 -3
- package/dist/bootstrap/commands/futures-margin/cli.js +5 -10
- package/dist/bootstrap/commands/instrument/cli.d.ts +2 -3
- package/dist/bootstrap/commands/instrument/cli.js +5 -10
- package/dist/bootstrap/commands/last-prices/cli.d.ts +3 -4
- package/dist/bootstrap/commands/last-prices/cli.js +6 -11
- package/dist/bootstrap/commands/last-trades/cli.d.ts +3 -4
- package/dist/bootstrap/commands/last-trades/cli.js +6 -11
- package/dist/bootstrap/commands/margin-attributes/cli.d.ts +2 -3
- package/dist/bootstrap/commands/margin-attributes/cli.js +5 -10
- package/dist/bootstrap/commands/operations/cli.d.ts +5 -53
- package/dist/bootstrap/commands/operations/cli.js +9 -36
- package/dist/bootstrap/commands/operations/request.mapper.d.ts +23 -0
- package/dist/bootstrap/commands/operations/request.mapper.js +33 -0
- package/dist/bootstrap/commands/operations-by-cursor/cli.d.ts +5 -69
- package/dist/bootstrap/commands/operations-by-cursor/cli.js +9 -74
- package/dist/bootstrap/commands/operations-by-cursor/request.mapper.d.ts +28 -0
- package/dist/bootstrap/commands/operations-by-cursor/request.mapper.js +70 -0
- package/dist/bootstrap/commands/option/cli.d.ts +2 -3
- package/dist/bootstrap/commands/option/cli.js +5 -10
- package/dist/bootstrap/commands/options-by/cli.d.ts +2 -3
- package/dist/bootstrap/commands/options-by/cli.js +5 -10
- package/dist/bootstrap/commands/order-book/cli.d.ts +3 -4
- package/dist/bootstrap/commands/order-book/cli.js +6 -11
- package/dist/bootstrap/commands/order-state/cli.d.ts +3 -36
- package/dist/bootstrap/commands/order-state/cli.js +8 -21
- package/dist/bootstrap/commands/order-state/request.mapper.d.ts +13 -0
- package/dist/bootstrap/commands/order-state/request.mapper.js +17 -0
- package/dist/bootstrap/commands/orders/cli.d.ts +3 -32
- package/dist/bootstrap/commands/orders/cli.js +8 -18
- package/dist/bootstrap/commands/orders/request.mapper.d.ts +6 -0
- package/dist/bootstrap/commands/orders/request.mapper.js +8 -0
- package/dist/bootstrap/commands/portfolio/cli.d.ts +6 -40
- package/dist/bootstrap/commands/portfolio/cli.js +9 -26
- package/dist/bootstrap/commands/portfolio/request.mapper.d.ts +18 -0
- package/dist/bootstrap/commands/portfolio/request.mapper.js +21 -0
- package/dist/bootstrap/commands/positions/cli.d.ts +3 -32
- package/dist/bootstrap/commands/positions/cli.js +8 -18
- package/dist/bootstrap/commands/positions/request.mapper.d.ts +6 -0
- package/dist/bootstrap/commands/positions/request.mapper.js +8 -0
- package/dist/bootstrap/commands/post-order/cli.d.ts +8 -68
- package/dist/bootstrap/commands/post-order/cli.js +9 -39
- package/dist/bootstrap/commands/post-order/request.mapper.d.ts +27 -0
- package/dist/bootstrap/commands/post-order/request.mapper.js +35 -0
- package/dist/bootstrap/commands/post-stop-order/cli.d.ts +3 -4
- package/dist/bootstrap/commands/post-stop-order/cli.js +6 -11
- package/dist/bootstrap/commands/replace-order/cli.d.ts +5 -61
- package/dist/bootstrap/commands/replace-order/cli.js +9 -30
- package/dist/bootstrap/commands/replace-order/request.mapper.d.ts +22 -0
- package/dist/bootstrap/commands/replace-order/request.mapper.js +26 -0
- package/dist/bootstrap/commands/sandbox-accounts/cli.d.ts +2 -3
- package/dist/bootstrap/commands/sandbox-accounts/cli.js +5 -10
- package/dist/bootstrap/commands/sandbox-cancel-order/cli.d.ts +3 -4
- package/dist/bootstrap/commands/sandbox-cancel-order/cli.js +8 -13
- package/dist/bootstrap/commands/sandbox-close-account/cli.d.ts +2 -3
- package/dist/bootstrap/commands/sandbox-close-account/cli.js +5 -10
- package/dist/bootstrap/commands/sandbox-open-account/cli.d.ts +2 -3
- package/dist/bootstrap/commands/sandbox-open-account/cli.js +5 -10
- package/dist/bootstrap/commands/sandbox-operations/cli.d.ts +3 -4
- package/dist/bootstrap/commands/sandbox-operations/cli.js +8 -13
- package/dist/bootstrap/commands/sandbox-operations-by-cursor/cli.d.ts +3 -4
- package/dist/bootstrap/commands/sandbox-operations-by-cursor/cli.js +8 -13
- package/dist/bootstrap/commands/sandbox-order-state/cli.d.ts +3 -4
- package/dist/bootstrap/commands/sandbox-order-state/cli.js +8 -13
- package/dist/bootstrap/commands/sandbox-orders/cli.d.ts +3 -4
- package/dist/bootstrap/commands/sandbox-orders/cli.js +8 -13
- package/dist/bootstrap/commands/sandbox-pay-in/cli.d.ts +2 -3
- package/dist/bootstrap/commands/sandbox-pay-in/cli.js +5 -10
- package/dist/bootstrap/commands/sandbox-portfolio/cli.d.ts +3 -4
- package/dist/bootstrap/commands/sandbox-portfolio/cli.js +8 -13
- package/dist/bootstrap/commands/sandbox-positions/cli.d.ts +3 -4
- package/dist/bootstrap/commands/sandbox-positions/cli.js +8 -13
- package/dist/bootstrap/commands/sandbox-post-order/cli.d.ts +3 -4
- package/dist/bootstrap/commands/sandbox-post-order/cli.js +8 -13
- package/dist/bootstrap/commands/sandbox-replace-order/cli.d.ts +3 -4
- package/dist/bootstrap/commands/sandbox-replace-order/cli.js +8 -13
- package/dist/bootstrap/commands/sandbox-withdraw-limits/cli.d.ts +3 -4
- package/dist/bootstrap/commands/sandbox-withdraw-limits/cli.js +8 -13
- package/dist/bootstrap/commands/sdk-command-lifecycle.d.ts +15 -0
- package/dist/bootstrap/commands/sdk-command-lifecycle.js +21 -0
- package/dist/bootstrap/commands/share/cli.d.ts +2 -3
- package/dist/bootstrap/commands/share/cli.js +5 -10
- package/dist/bootstrap/commands/shares/cli.d.ts +2 -3
- package/dist/bootstrap/commands/shares/cli.js +5 -10
- package/dist/bootstrap/commands/stop-orders/cli.d.ts +3 -4
- package/dist/bootstrap/commands/stop-orders/cli.js +6 -11
- package/dist/bootstrap/commands/stream-run/cli.d.ts +2 -24
- package/dist/bootstrap/commands/stream-run/cli.js +7 -142
- package/dist/bootstrap/commands/stream-run/config.d.ts +7 -15
- package/dist/bootstrap/commands/stream-run/config.js +1 -101
- package/dist/bootstrap/commands/stream-run/request.mapper.d.ts +14 -0
- package/dist/bootstrap/commands/stream-run/request.mapper.js +111 -0
- package/dist/bootstrap/commands/stream-run/stream-session.d.ts +37 -0
- package/dist/bootstrap/commands/stream-run/stream-session.js +152 -0
- package/dist/bootstrap/commands/trading-schedules/cli.d.ts +2 -3
- package/dist/bootstrap/commands/trading-schedules/cli.js +5 -10
- package/dist/bootstrap/commands/trading-status/cli.d.ts +3 -4
- package/dist/bootstrap/commands/trading-status/cli.js +6 -11
- package/dist/bootstrap/commands/trading-statuses/cli.d.ts +3 -4
- package/dist/bootstrap/commands/trading-statuses/cli.js +6 -11
- package/dist/bootstrap/commands/user-info/cli.d.ts +2 -3
- package/dist/bootstrap/commands/user-info/cli.js +5 -10
- package/dist/bootstrap/commands/user-tariff/cli.d.ts +2 -3
- package/dist/bootstrap/commands/user-tariff/cli.js +5 -10
- package/dist/bootstrap/commands/withdraw-limits/cli.d.ts +3 -32
- package/dist/bootstrap/commands/withdraw-limits/cli.js +8 -18
- package/dist/bootstrap/commands/withdraw-limits/request.mapper.d.ts +6 -0
- package/dist/bootstrap/commands/withdraw-limits/request.mapper.js +8 -0
- package/dist/bootstrap/index.js +2 -2
- package/dist/bootstrap/proto/compile-proto.d.ts +1 -1
- package/dist/bootstrap/proto/compile-proto.js +28 -35
- package/dist/bootstrap/t-invest-node-sdk.d.ts +9 -9
- package/dist/bootstrap/t-invest-node-sdk.js +33 -18
- package/dist/bootstrap/unary-limit-config.js +4 -4
- package/dist/generated/common.js +2 -2
- package/dist/generated/google/api/field_behavior.js +2 -2
- package/dist/generated/google/protobuf/descriptor.js +2 -2
- package/dist/generated/google/protobuf/timestamp.js +2 -2
- package/dist/generated/instruments.js +2 -2
- package/dist/generated/marketdata.js +2 -2
- package/dist/generated/operations.js +2 -2
- package/dist/generated/orders.js +2 -2
- package/dist/generated/sandbox.js +2 -2
- package/dist/generated/signals.js +2 -2
- package/dist/generated/stoporders.js +2 -2
- package/dist/generated/users.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/infrastructure/interceptor/warning-interceptor.d.ts +1 -1
- package/dist/infrastructure/interceptor/warning-interceptor.js +2 -2
- package/dist/infrastructure/transport/grpc/sdk-call-error.d.ts +12 -0
- package/dist/infrastructure/transport/grpc/sdk-call-error.js +180 -0
- package/dist/infrastructure/transport/grpc/sdk-client.d.ts +1 -1
- package/dist/infrastructure/transport/grpc/sdk-client.js +2 -2
- package/dist/infrastructure/transport/grpc/sdk-middleware.d.ts +1 -1
- package/dist/infrastructure/transport/grpc/sdk-middleware.js +8 -174
- package/dist/infrastructure/transport/grpc/unary-limit-resolver.d.ts +3 -1
- package/dist/infrastructure/transport/grpc/unary-limit-resolver.js +19 -18
- package/docs/architecture.md +45 -42
- package/docs/bundled-ca.md +12 -12
- package/docs/clean-architecture/adapters.md +15 -15
- package/docs/clean-architecture/api-commands.md +63 -52
- package/docs/clean-architecture/application.md +13 -13
- package/docs/clean-architecture/cli-output-boundaries.md +23 -23
- package/docs/clean-architecture/dto.md +9 -9
- package/docs/clean-architecture/index.md +13 -12
- package/docs/cli-stream-configuration.md +9 -9
- package/docs/cli-stream-reference.md +11 -11
- package/docs/guides/custom-unary-limiter.md +44 -30
- package/docs/guides/errors-and-lifecycle.md +10 -10
- package/docs/guides/getting-started.md +9 -9
- package/docs/guides/index.md +3 -3
- package/docs/guides/streams-and-cancellation.md +6 -6
- package/docs/guides/testing-with-service-definitions.md +4 -4
- package/docs/guides/unary-calls.md +8 -8
- package/docs/index.md +14 -10
- package/docs/limits-policy.md +10 -10
- package/docs/roadmap.md +14 -14
- package/docs/tls-policy.md +7 -7
- package/package.json +6 -5
- package/readme.md +37 -85
- package/dist/infrastructure/interceptor/index.d.ts +0 -1
- package/dist/infrastructure/interceptor/index.js +0 -17
- /package/dist/infrastructure/transport/grpc/{unary-limits.d.ts → unary-method-path.d.ts} +0 -0
- /package/dist/infrastructure/transport/grpc/{unary-limits.js → unary-method-path.js} +0 -0
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Здесь допустимы:
|
|
5
5
|
* - объявление command path и option schema;
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
6
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
7
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
8
8
|
*
|
|
9
9
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
10
|
*/
|
|
@@ -12,7 +12,6 @@ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
|
12
12
|
import type { GetOperationsByCursorRequest, GetOperationsByCursorResponse } from '../../../generated/operations';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatOperationsByCursor } from '../operations-by-cursor/reporter';
|
|
16
15
|
type SandboxOperationsByCursorSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
getSandboxOperationsByCursor(request: GetOperationsByCursorRequest): Promise<GetOperationsByCursorResponse>;
|
|
@@ -200,5 +199,5 @@ export declare const sandboxOperationsByCursorCommand: Omit<import("icore").Comm
|
|
|
200
199
|
}, undefined, string, readonly ["sandbox", "operation", "page"], undefined, void, readonly []>, "metadata"> & {
|
|
201
200
|
metadata?: undefined;
|
|
202
201
|
};
|
|
203
|
-
export { formatOperationsByCursor };
|
|
204
202
|
export declare function createSandboxOperationsByCursorRequest(options: SandboxOperationsByCursorRequestOptions): GetOperationsByCursorRequest;
|
|
203
|
+
export {};
|
|
@@ -4,22 +4,21 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Здесь допустимы:
|
|
6
6
|
* - объявление command path и option schema;
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
8
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
9
9
|
*
|
|
10
10
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.sandboxOperationsByCursorCommand = void 0;
|
|
14
14
|
exports.createSandboxOperationsByCursorCommand = createSandboxOperationsByCursorCommand;
|
|
15
15
|
exports.createSandboxOperationsByCursorRequest = createSandboxOperationsByCursorRequest;
|
|
16
16
|
const contract_1 = require("../../cli/contract");
|
|
17
|
-
const
|
|
17
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
18
18
|
const command_options_1 = require("../../args/command-options");
|
|
19
19
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
20
|
-
const
|
|
20
|
+
const request_mapper_1 = require("../operations-by-cursor/request.mapper");
|
|
21
21
|
const reporter_1 = require("../operations-by-cursor/reporter");
|
|
22
|
-
Object.defineProperty(exports, "formatOperationsByCursor", { enumerable: true, get: function () { return reporter_1.formatOperationsByCursor; } });
|
|
23
22
|
const sandboxOperationsByCursorCommandPath = ['sandbox', 'operation', 'page'];
|
|
24
23
|
const defaultSandboxOperationsByCursorSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
25
24
|
const sandboxOperationsByCursorRequestOptionsSchema = {
|
|
@@ -84,15 +83,11 @@ exports.sandboxOperationsByCursorCommand = createSandboxOperationsByCursorComman
|
|
|
84
83
|
async function runSandboxOperationsByCursorCommand(options, createSdk) {
|
|
85
84
|
const request = createSandboxOperationsByCursorRequest(options);
|
|
86
85
|
const { format } = options;
|
|
87
|
-
|
|
88
|
-
try {
|
|
86
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
89
87
|
const response = await sdk.sandbox.getSandboxOperationsByCursor(request);
|
|
90
88
|
return (0, reporter_1.formatOperationsByCursor)(response, format);
|
|
91
|
-
}
|
|
92
|
-
finally {
|
|
93
|
-
sdk.close();
|
|
94
|
-
}
|
|
89
|
+
});
|
|
95
90
|
}
|
|
96
91
|
function createSandboxOperationsByCursorRequest(options) {
|
|
97
|
-
return (0,
|
|
92
|
+
return (0, request_mapper_1.createOperationsByCursorRequest)(options);
|
|
98
93
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Здесь допустимы:
|
|
5
5
|
* - объявление command path и option schema;
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
6
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
7
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
8
8
|
*
|
|
9
9
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
10
|
*/
|
|
@@ -12,7 +12,6 @@ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
|
12
12
|
import type { GetOrderStateRequest, OrderState } from '../../../generated/orders';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatOrderState } from '../order-state/reporter';
|
|
16
15
|
type SandboxOrderStateSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
getSandboxOrderState(request: GetOrderStateRequest): Promise<OrderState>;
|
|
@@ -107,5 +106,5 @@ export declare const sandboxOrderStateCommand: Omit<import("icore").CommandDefin
|
|
|
107
106
|
}, undefined, string, readonly ["sandbox", "order", "show"], undefined, void, readonly []>, "metadata"> & {
|
|
108
107
|
metadata?: undefined;
|
|
109
108
|
};
|
|
110
|
-
export { formatOrderState };
|
|
111
109
|
export declare function createSandboxOrderStateRequest(options: SandboxOrderStateRequestOptions): GetOrderStateRequest;
|
|
110
|
+
export {};
|
|
@@ -4,22 +4,21 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Здесь допустимы:
|
|
6
6
|
* - объявление command path и option schema;
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
8
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
9
9
|
*
|
|
10
10
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.sandboxOrderStateCommand = void 0;
|
|
14
14
|
exports.createSandboxOrderStateCommand = createSandboxOrderStateCommand;
|
|
15
15
|
exports.createSandboxOrderStateRequest = createSandboxOrderStateRequest;
|
|
16
16
|
const contract_1 = require("../../cli/contract");
|
|
17
|
-
const
|
|
17
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
18
18
|
const command_options_1 = require("../../args/command-options");
|
|
19
19
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
20
|
-
const
|
|
20
|
+
const request_mapper_1 = require("../order-state/request.mapper");
|
|
21
21
|
const reporter_1 = require("../order-state/reporter");
|
|
22
|
-
Object.defineProperty(exports, "formatOrderState", { enumerable: true, get: function () { return reporter_1.formatOrderState; } });
|
|
23
22
|
const sandboxOrderStateCommandPath = ['sandbox', 'order', 'show'];
|
|
24
23
|
const defaultSandboxOrderStateSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
25
24
|
const sandboxOrderStateRequestOptionsSchema = {
|
|
@@ -53,15 +52,11 @@ exports.sandboxOrderStateCommand = createSandboxOrderStateCommand();
|
|
|
53
52
|
async function runSandboxOrderStateCommand(options, createSdk) {
|
|
54
53
|
const request = createSandboxOrderStateRequest(options);
|
|
55
54
|
const { format } = options;
|
|
56
|
-
|
|
57
|
-
try {
|
|
55
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
58
56
|
const response = await sdk.sandbox.getSandboxOrderState(request);
|
|
59
57
|
return (0, reporter_1.formatOrderState)(response, format);
|
|
60
|
-
}
|
|
61
|
-
finally {
|
|
62
|
-
sdk.close();
|
|
63
|
-
}
|
|
58
|
+
});
|
|
64
59
|
}
|
|
65
60
|
function createSandboxOrderStateRequest(options) {
|
|
66
|
-
return (0,
|
|
61
|
+
return (0, request_mapper_1.createOrderStateRequest)(options);
|
|
67
62
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Здесь допустимы:
|
|
5
5
|
* - объявление command path и option schema;
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
6
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
7
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
8
8
|
*
|
|
9
9
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
10
|
*/
|
|
@@ -12,7 +12,6 @@ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
|
12
12
|
import type { GetOrdersRequest, GetOrdersResponse } from '../../../generated/orders';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatOrders } from '../orders/reporter';
|
|
16
15
|
type SandboxOrdersSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
getSandboxOrders(request: GetOrdersRequest): Promise<GetOrdersResponse>;
|
|
@@ -95,5 +94,5 @@ export declare const sandboxOrdersCommand: Omit<import("icore").CommandDefinitio
|
|
|
95
94
|
}, undefined, string, readonly ["sandbox", "order", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
96
95
|
metadata?: undefined;
|
|
97
96
|
};
|
|
98
|
-
export { formatOrders };
|
|
99
97
|
export declare function createSandboxOrdersRequest(options: SandboxOrdersRequestOptions): GetOrdersRequest;
|
|
98
|
+
export {};
|
|
@@ -4,22 +4,21 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Здесь допустимы:
|
|
6
6
|
* - объявление command path и option schema;
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
8
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
9
9
|
*
|
|
10
10
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.sandboxOrdersCommand = void 0;
|
|
14
14
|
exports.createSandboxOrdersCommand = createSandboxOrdersCommand;
|
|
15
15
|
exports.createSandboxOrdersRequest = createSandboxOrdersRequest;
|
|
16
16
|
const contract_1 = require("../../cli/contract");
|
|
17
|
-
const
|
|
17
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
18
18
|
const command_options_1 = require("../../args/command-options");
|
|
19
19
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
20
|
-
const
|
|
20
|
+
const request_mapper_1 = require("../orders/request.mapper");
|
|
21
21
|
const reporter_1 = require("../orders/reporter");
|
|
22
|
-
Object.defineProperty(exports, "formatOrders", { enumerable: true, get: function () { return reporter_1.formatOrders; } });
|
|
23
22
|
const sandboxOrdersCommandPath = ['sandbox', 'order', 'list'];
|
|
24
23
|
const defaultSandboxOrdersSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
25
24
|
const sandboxOrdersRequestOptionsSchema = {
|
|
@@ -49,15 +48,11 @@ exports.sandboxOrdersCommand = createSandboxOrdersCommand();
|
|
|
49
48
|
async function runSandboxOrdersCommand(options, createSdk) {
|
|
50
49
|
const request = createSandboxOrdersRequest(options);
|
|
51
50
|
const { format } = options;
|
|
52
|
-
|
|
53
|
-
try {
|
|
51
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
54
52
|
const response = await sdk.sandbox.getSandboxOrders(request);
|
|
55
53
|
return (0, reporter_1.formatOrders)(response, format);
|
|
56
|
-
}
|
|
57
|
-
finally {
|
|
58
|
-
sdk.close();
|
|
59
|
-
}
|
|
54
|
+
});
|
|
60
55
|
}
|
|
61
56
|
function createSandboxOrdersRequest(options) {
|
|
62
|
-
return (0,
|
|
57
|
+
return (0, request_mapper_1.createOrdersRequest)(options);
|
|
63
58
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Здесь допустимы:
|
|
5
5
|
* - объявление command path и option schema;
|
|
6
6
|
* - преобразование CLI options в generated request;
|
|
7
|
-
* -
|
|
7
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
8
8
|
*
|
|
9
9
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
10
|
*/
|
|
@@ -12,7 +12,6 @@ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
|
12
12
|
import type { SandboxPayInRequest, SandboxPayInResponse } from '../../../generated/sandbox';
|
|
13
13
|
import { type InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatSandboxPayIn } from './reporter';
|
|
16
15
|
type SandboxPayInSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
sandboxPayIn(request: SandboxPayInRequest): Promise<SandboxPayInResponse>;
|
|
@@ -131,5 +130,5 @@ export declare const sandboxPayInCommand: Omit<import("icore").CommandDefinition
|
|
|
131
130
|
}, undefined, string, readonly ["sandbox", "pay-in"], undefined, void, readonly []>, "metadata"> & {
|
|
132
131
|
metadata?: undefined;
|
|
133
132
|
};
|
|
134
|
-
export { formatSandboxPayIn };
|
|
135
133
|
export declare function createSandboxPayInRequest(options: SandboxPayInRequestOptions): SandboxPayInRequest;
|
|
134
|
+
export {};
|
|
@@ -5,22 +5,21 @@
|
|
|
5
5
|
* Здесь допустимы:
|
|
6
6
|
* - объявление command path и option schema;
|
|
7
7
|
* - преобразование CLI options в generated request;
|
|
8
|
-
* -
|
|
8
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
9
9
|
*
|
|
10
10
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.sandboxPayInCommand = void 0;
|
|
14
14
|
exports.createSandboxPayInCommand = createSandboxPayInCommand;
|
|
15
15
|
exports.createSandboxPayInRequest = createSandboxPayInRequest;
|
|
16
16
|
const icore_1 = require("icore");
|
|
17
17
|
const contract_1 = require("../../cli/contract");
|
|
18
|
-
const
|
|
18
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
19
19
|
const command_options_1 = require("../../args/command-options");
|
|
20
20
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
21
21
|
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
22
22
|
const reporter_1 = require("./reporter");
|
|
23
|
-
Object.defineProperty(exports, "formatSandboxPayIn", { enumerable: true, get: function () { return reporter_1.formatSandboxPayIn; } });
|
|
24
23
|
const sandboxPayInCommandPath = ['sandbox', 'pay-in'];
|
|
25
24
|
const defaultSandboxPayInSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
26
25
|
const sandboxPayInCurrencies = ['rub', 'usd'];
|
|
@@ -61,14 +60,10 @@ async function runSandboxPayInCommand(options, createSdk) {
|
|
|
61
60
|
(0, side_effect_args_1.assertSideEffectConfirmed)(options.confirm);
|
|
62
61
|
const request = createSandboxPayInRequest(options);
|
|
63
62
|
const { format } = options;
|
|
64
|
-
|
|
65
|
-
try {
|
|
63
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
66
64
|
const response = await sdk.sandbox.sandboxPayIn(request);
|
|
67
65
|
return (0, reporter_1.formatSandboxPayIn)(response, format);
|
|
68
|
-
}
|
|
69
|
-
finally {
|
|
70
|
-
sdk.close();
|
|
71
|
-
}
|
|
66
|
+
});
|
|
72
67
|
}
|
|
73
68
|
function createSandboxPayInRequest(options) {
|
|
74
69
|
if (options.currency === 'usd') {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Здесь допустимы:
|
|
5
5
|
* - объявление command path и option schema;
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
6
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
7
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
8
8
|
*
|
|
9
9
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
10
|
*/
|
|
@@ -12,7 +12,6 @@ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
|
12
12
|
import type { PortfolioRequest, PortfolioResponse } from '../../../generated/operations';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatPortfolio } from '../portfolio/reporter';
|
|
16
15
|
type SandboxPortfolioSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
getSandboxPortfolio(request: PortfolioRequest): Promise<PortfolioResponse>;
|
|
@@ -110,5 +109,5 @@ export declare const sandboxPortfolioCommand: Omit<import("icore").CommandDefini
|
|
|
110
109
|
}, undefined, string, readonly ["sandbox", "portfolio"], undefined, void, readonly []>, "metadata"> & {
|
|
111
110
|
metadata?: undefined;
|
|
112
111
|
};
|
|
113
|
-
export { formatPortfolio };
|
|
114
112
|
export declare function createSandboxPortfolioRequest(options: SandboxPortfolioRequestOptions): PortfolioRequest;
|
|
113
|
+
export {};
|
|
@@ -4,22 +4,21 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Здесь допустимы:
|
|
6
6
|
* - объявление command path и option schema;
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
8
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
9
9
|
*
|
|
10
10
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.sandboxPortfolioCommand = void 0;
|
|
14
14
|
exports.createSandboxPortfolioCommand = createSandboxPortfolioCommand;
|
|
15
15
|
exports.createSandboxPortfolioRequest = createSandboxPortfolioRequest;
|
|
16
16
|
const contract_1 = require("../../cli/contract");
|
|
17
|
-
const
|
|
17
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
18
18
|
const command_options_1 = require("../../args/command-options");
|
|
19
19
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
20
|
-
const
|
|
20
|
+
const request_mapper_1 = require("../portfolio/request.mapper");
|
|
21
21
|
const reporter_1 = require("../portfolio/reporter");
|
|
22
|
-
Object.defineProperty(exports, "formatPortfolio", { enumerable: true, get: function () { return reporter_1.formatPortfolio; } });
|
|
23
22
|
const sandboxPortfolioCommandPath = ['sandbox', 'portfolio'];
|
|
24
23
|
const defaultSandboxPortfolioSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
25
24
|
const sandboxPortfolioRequestOptionsSchema = {
|
|
@@ -54,15 +53,11 @@ exports.sandboxPortfolioCommand = createSandboxPortfolioCommand();
|
|
|
54
53
|
async function runSandboxPortfolioCommand(options, createSdk) {
|
|
55
54
|
const request = createSandboxPortfolioRequest(options);
|
|
56
55
|
const { format } = options;
|
|
57
|
-
|
|
58
|
-
try {
|
|
56
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
59
57
|
const response = await sdk.sandbox.getSandboxPortfolio(request);
|
|
60
58
|
return (0, reporter_1.formatPortfolio)(response, format);
|
|
61
|
-
}
|
|
62
|
-
finally {
|
|
63
|
-
sdk.close();
|
|
64
|
-
}
|
|
59
|
+
});
|
|
65
60
|
}
|
|
66
61
|
function createSandboxPortfolioRequest(options) {
|
|
67
|
-
return (0,
|
|
62
|
+
return (0, request_mapper_1.createPortfolioRequest)(options);
|
|
68
63
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Здесь допустимы:
|
|
5
5
|
* - объявление command path и option schema;
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
6
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
7
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
8
8
|
*
|
|
9
9
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
10
|
*/
|
|
@@ -12,7 +12,6 @@ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
|
12
12
|
import type { PositionsRequest, PositionsResponse } from '../../../generated/operations';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatPositions } from '../positions/reporter';
|
|
16
15
|
type SandboxPositionsSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
getSandboxPositions(request: PositionsRequest): Promise<PositionsResponse>;
|
|
@@ -95,5 +94,5 @@ export declare const sandboxPositionsCommand: Omit<import("icore").CommandDefini
|
|
|
95
94
|
}, undefined, string, readonly ["sandbox", "position", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
96
95
|
metadata?: undefined;
|
|
97
96
|
};
|
|
98
|
-
export { formatPositions };
|
|
99
97
|
export declare function createSandboxPositionsRequest(options: SandboxPositionsRequestOptions): PositionsRequest;
|
|
98
|
+
export {};
|
|
@@ -4,22 +4,21 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Здесь допустимы:
|
|
6
6
|
* - объявление command path и option schema;
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
8
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
9
9
|
*
|
|
10
10
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.sandboxPositionsCommand = void 0;
|
|
14
14
|
exports.createSandboxPositionsCommand = createSandboxPositionsCommand;
|
|
15
15
|
exports.createSandboxPositionsRequest = createSandboxPositionsRequest;
|
|
16
16
|
const contract_1 = require("../../cli/contract");
|
|
17
|
-
const
|
|
17
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
18
18
|
const command_options_1 = require("../../args/command-options");
|
|
19
19
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
20
|
-
const
|
|
20
|
+
const request_mapper_1 = require("../positions/request.mapper");
|
|
21
21
|
const reporter_1 = require("../positions/reporter");
|
|
22
|
-
Object.defineProperty(exports, "formatPositions", { enumerable: true, get: function () { return reporter_1.formatPositions; } });
|
|
23
22
|
const sandboxPositionsCommandPath = ['sandbox', 'position', 'list'];
|
|
24
23
|
const defaultSandboxPositionsSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
25
24
|
const sandboxPositionsRequestOptionsSchema = {
|
|
@@ -49,15 +48,11 @@ exports.sandboxPositionsCommand = createSandboxPositionsCommand();
|
|
|
49
48
|
async function runSandboxPositionsCommand(options, createSdk) {
|
|
50
49
|
const request = createSandboxPositionsRequest(options);
|
|
51
50
|
const { format } = options;
|
|
52
|
-
|
|
53
|
-
try {
|
|
51
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
54
52
|
const response = await sdk.sandbox.getSandboxPositions(request);
|
|
55
53
|
return (0, reporter_1.formatPositions)(response, format);
|
|
56
|
-
}
|
|
57
|
-
finally {
|
|
58
|
-
sdk.close();
|
|
59
|
-
}
|
|
54
|
+
});
|
|
60
55
|
}
|
|
61
56
|
function createSandboxPositionsRequest(options) {
|
|
62
|
-
return (0,
|
|
57
|
+
return (0, request_mapper_1.createPositionsRequest)(options);
|
|
63
58
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Здесь допустимы:
|
|
5
5
|
* - объявление command path и option schema;
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
6
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
7
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
8
8
|
*
|
|
9
9
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
10
|
*/
|
|
@@ -12,7 +12,6 @@ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
|
12
12
|
import type { PostOrderRequest, PostOrderResponse } from '../../../generated/orders';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatPostOrder } from '../post-order/reporter';
|
|
16
15
|
type SandboxPostOrderSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
postSandboxOrder(request: PostOrderRequest): Promise<PostOrderResponse>;
|
|
@@ -188,5 +187,5 @@ export declare const sandboxPostOrderCommand: Omit<import("icore").CommandDefini
|
|
|
188
187
|
}, undefined, string, readonly ["sandbox", "order", "place"], undefined, void, readonly []>, "metadata"> & {
|
|
189
188
|
metadata?: undefined;
|
|
190
189
|
};
|
|
191
|
-
export { formatPostOrder };
|
|
192
190
|
export declare function createSandboxPostOrderRequest(options: SandboxPostOrderRequestOptions): PostOrderRequest;
|
|
191
|
+
export {};
|
|
@@ -4,22 +4,21 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Здесь допустимы:
|
|
6
6
|
* - объявление command path и option schema;
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
8
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
9
9
|
*
|
|
10
10
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.sandboxPostOrderCommand = void 0;
|
|
14
14
|
exports.createSandboxPostOrderCommand = createSandboxPostOrderCommand;
|
|
15
15
|
exports.createSandboxPostOrderRequest = createSandboxPostOrderRequest;
|
|
16
16
|
const contract_1 = require("../../cli/contract");
|
|
17
|
-
const
|
|
17
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
18
18
|
const command_options_1 = require("../../args/command-options");
|
|
19
19
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
20
|
-
const
|
|
20
|
+
const request_mapper_1 = require("../post-order/request.mapper");
|
|
21
21
|
const reporter_1 = require("../post-order/reporter");
|
|
22
|
-
Object.defineProperty(exports, "formatPostOrder", { enumerable: true, get: function () { return reporter_1.formatPostOrder; } });
|
|
23
22
|
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
24
23
|
const sandboxPostOrderCommandPath = ['sandbox', 'order', 'place'];
|
|
25
24
|
const defaultSandboxPostOrderSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
@@ -76,15 +75,11 @@ async function runSandboxPostOrderCommand(options, createSdk) {
|
|
|
76
75
|
(0, side_effect_args_1.assertSideEffectConfirmed)(options.confirm);
|
|
77
76
|
const request = createSandboxPostOrderRequest(options);
|
|
78
77
|
const { format } = options;
|
|
79
|
-
|
|
80
|
-
try {
|
|
78
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
81
79
|
const response = await sdk.sandbox.postSandboxOrder(request);
|
|
82
80
|
return (0, reporter_1.formatPostOrder)(response, format);
|
|
83
|
-
}
|
|
84
|
-
finally {
|
|
85
|
-
sdk.close();
|
|
86
|
-
}
|
|
81
|
+
});
|
|
87
82
|
}
|
|
88
83
|
function createSandboxPostOrderRequest(options) {
|
|
89
|
-
return (0,
|
|
84
|
+
return (0, request_mapper_1.createPostOrderRequest)(options);
|
|
90
85
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Здесь допустимы:
|
|
5
5
|
* - объявление command path и option schema;
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
6
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
7
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
8
8
|
*
|
|
9
9
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
10
|
*/
|
|
@@ -12,7 +12,6 @@ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
|
12
12
|
import type { PostOrderResponse, ReplaceOrderRequest } from '../../../generated/orders';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatReplaceOrder } from '../replace-order/reporter';
|
|
16
15
|
type SandboxReplaceOrderSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
replaceSandboxOrder(request: ReplaceOrderRequest): Promise<PostOrderResponse>;
|
|
@@ -176,5 +175,5 @@ export declare const sandboxReplaceOrderCommand: Omit<import("icore").CommandDef
|
|
|
176
175
|
}, undefined, string, readonly ["sandbox", "order", "replace"], undefined, void, readonly []>, "metadata"> & {
|
|
177
176
|
metadata?: undefined;
|
|
178
177
|
};
|
|
179
|
-
export { formatReplaceOrder };
|
|
180
178
|
export declare function createSandboxReplaceOrderRequest(options: SandboxReplaceOrderRequestOptions): ReplaceOrderRequest;
|
|
179
|
+
export {};
|
|
@@ -4,22 +4,21 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Здесь допустимы:
|
|
6
6
|
* - объявление command path и option schema;
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
8
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
9
9
|
*
|
|
10
10
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.sandboxReplaceOrderCommand = void 0;
|
|
14
14
|
exports.createSandboxReplaceOrderCommand = createSandboxReplaceOrderCommand;
|
|
15
15
|
exports.createSandboxReplaceOrderRequest = createSandboxReplaceOrderRequest;
|
|
16
16
|
const contract_1 = require("../../cli/contract");
|
|
17
|
-
const
|
|
17
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
18
18
|
const command_options_1 = require("../../args/command-options");
|
|
19
19
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
20
|
-
const
|
|
20
|
+
const request_mapper_1 = require("../replace-order/request.mapper");
|
|
21
21
|
const reporter_1 = require("../replace-order/reporter");
|
|
22
|
-
Object.defineProperty(exports, "formatReplaceOrder", { enumerable: true, get: function () { return reporter_1.formatReplaceOrder; } });
|
|
23
22
|
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
24
23
|
const sandboxReplaceOrderCommandPath = ['sandbox', 'order', 'replace'];
|
|
25
24
|
const defaultSandboxReplaceOrderSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
@@ -72,15 +71,11 @@ async function runSandboxReplaceOrderCommand(options, createSdk) {
|
|
|
72
71
|
(0, side_effect_args_1.assertSideEffectConfirmed)(options.confirm);
|
|
73
72
|
const request = createSandboxReplaceOrderRequest(options);
|
|
74
73
|
const { format } = options;
|
|
75
|
-
|
|
76
|
-
try {
|
|
74
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
77
75
|
const response = await sdk.sandbox.replaceSandboxOrder(request);
|
|
78
76
|
return (0, reporter_1.formatReplaceOrder)(response, format);
|
|
79
|
-
}
|
|
80
|
-
finally {
|
|
81
|
-
sdk.close();
|
|
82
|
-
}
|
|
77
|
+
});
|
|
83
78
|
}
|
|
84
79
|
function createSandboxReplaceOrderRequest(options) {
|
|
85
|
-
return (0,
|
|
80
|
+
return (0, request_mapper_1.createReplaceOrderRequest)(options);
|
|
86
81
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Здесь допустимы:
|
|
5
5
|
* - объявление command path и option schema;
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
6
|
+
* - переиспользование общего production/Sandbox request mapper-а;
|
|
7
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
8
8
|
*
|
|
9
9
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
10
|
*/
|
|
@@ -12,7 +12,6 @@ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
|
12
12
|
import type { WithdrawLimitsRequest, WithdrawLimitsResponse } from '../../../generated/operations';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatWithdrawLimits } from '../withdraw-limits/reporter';
|
|
16
15
|
type SandboxWithdrawLimitsSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
getSandboxWithdrawLimits(request: WithdrawLimitsRequest): Promise<WithdrawLimitsResponse>;
|
|
@@ -95,5 +94,5 @@ export declare const sandboxWithdrawLimitsCommand: Omit<import("icore").CommandD
|
|
|
95
94
|
}, undefined, string, readonly ["sandbox", "withdraw-limits"], undefined, void, readonly []>, "metadata"> & {
|
|
96
95
|
metadata?: undefined;
|
|
97
96
|
};
|
|
98
|
-
export { formatWithdrawLimits };
|
|
99
97
|
export declare function createSandboxWithdrawLimitsRequest(options: SandboxWithdrawLimitsRequestOptions): WithdrawLimitsRequest;
|
|
98
|
+
export {};
|