@woodger/t-invest-node-sdk 0.5.2 → 0.5.3
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 +19 -0
- package/{THIRD_PARTY_NOTICES.md → LICENSE-APACHE-2.0} +1 -106
- package/NOTICE +98 -0
- package/dist/application/services/unary-limiter.js +9 -9
- 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 +1 -1
- package/dist/generated/google/api/field_behavior.js +1 -1
- package/dist/generated/google/protobuf/descriptor.js +1 -1
- package/dist/generated/google/protobuf/timestamp.js +1 -1
- package/dist/generated/instruments.js +1 -1
- package/dist/generated/marketdata.js +1 -1
- package/dist/generated/operations.js +1 -1
- package/dist/generated/orders.js +1 -1
- package/dist/generated/sandbox.js +1 -1
- package/dist/generated/signals.js +1 -1
- package/dist/generated/stoporders.js +1 -1
- package/dist/generated/users.js +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 +44 -41
- 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 +30 -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 +9 -9
- package/docs/limits-policy.md +10 -10
- package/docs/roadmap.md +12 -12
- package/docs/tls-policy.md +7 -7
- package/package.json +2 -1
- package/readme.md +42 -41
- 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
|
@@ -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,9 +12,8 @@ import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
|
12
12
|
import { PostStopOrderRequest, type PostStopOrderResponse } from '../../../generated/stoporders';
|
|
13
13
|
import { type InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatPostStopOrder } from './reporter';
|
|
16
15
|
type PostStopOrderSdk = {
|
|
17
|
-
|
|
16
|
+
stopOrders: {
|
|
18
17
|
postStopOrder(request: PostStopOrderRequest): Promise<PostStopOrderResponse>;
|
|
19
18
|
};
|
|
20
19
|
close(): void;
|
|
@@ -212,5 +211,5 @@ export declare const postStopOrderCommand: Omit<import("icore").CommandDefinitio
|
|
|
212
211
|
}, undefined, string, readonly ["stop-order", "place"], undefined, void, readonly []>, "metadata"> & {
|
|
213
212
|
metadata?: undefined;
|
|
214
213
|
};
|
|
215
|
-
export { formatPostStopOrder };
|
|
216
214
|
export declare function createPostStopOrderRequest(options: PostStopOrderRequestOptions): PostStopOrderRequest;
|
|
215
|
+
export {};
|
|
@@ -5,24 +5,23 @@
|
|
|
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.postStopOrderCommand = void 0;
|
|
14
14
|
exports.createPostStopOrderCommand = createPostStopOrderCommand;
|
|
15
15
|
exports.createPostStopOrderRequest = createPostStopOrderRequest;
|
|
16
16
|
const common_1 = require("../../../generated/common");
|
|
17
17
|
const stoporders_1 = require("../../../generated/stoporders");
|
|
18
18
|
const icore_1 = require("icore");
|
|
19
19
|
const contract_1 = require("../../cli/contract");
|
|
20
|
-
const
|
|
20
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
21
21
|
const command_options_1 = require("../../args/command-options");
|
|
22
22
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
23
23
|
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
24
24
|
const reporter_1 = require("./reporter");
|
|
25
|
-
Object.defineProperty(exports, "formatPostStopOrder", { enumerable: true, get: function () { return reporter_1.formatPostStopOrder; } });
|
|
26
25
|
const postStopOrderCommandPath = ['stop-order', 'place'];
|
|
27
26
|
const defaultPostStopOrderSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
28
27
|
const stopOrderDirections = {
|
|
@@ -102,14 +101,10 @@ async function runPostStopOrderCommand(options, createSdk) {
|
|
|
102
101
|
(0, side_effect_args_1.assertSideEffectConfirmed)(options.confirm);
|
|
103
102
|
const request = createPostStopOrderRequest(options);
|
|
104
103
|
const { format } = options;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const response = await sdk.stoporders.postStopOrder(request);
|
|
104
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
105
|
+
const response = await sdk.stopOrders.postStopOrder(request);
|
|
108
106
|
return (0, reporter_1.formatPostStopOrder)(response, format);
|
|
109
|
-
}
|
|
110
|
-
finally {
|
|
111
|
-
sdk.close();
|
|
112
|
-
}
|
|
107
|
+
});
|
|
113
108
|
}
|
|
114
109
|
function createPostStopOrderRequest(options) {
|
|
115
110
|
const expirationType = stopOrderExpirationTypes[options['expiration-type']];
|
|
@@ -3,16 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Здесь допустимы:
|
|
5
5
|
* - объявление command path и option schema;
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
6
|
+
* - делегирование request mapping в command-owned mapper;
|
|
7
|
+
* - выполнение короткого SDK lifecycle через общий bootstrap helper;
|
|
8
8
|
*
|
|
9
9
|
* Здесь не должно быть ручного table/json rendering или application report contracts.
|
|
10
10
|
*/
|
|
11
11
|
import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
12
12
|
import { type PostOrderResponse, type ReplaceOrderRequest } from '../../../generated/orders';
|
|
13
|
-
import type { InferOptions } from 'icore';
|
|
14
|
-
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatReplaceOrder } from './reporter';
|
|
16
13
|
type ReplaceOrderSdk = {
|
|
17
14
|
orders: {
|
|
18
15
|
replaceOrder(request: ReplaceOrderRequest): Promise<PostOrderResponse>;
|
|
@@ -20,58 +17,6 @@ type ReplaceOrderSdk = {
|
|
|
20
17
|
close(): void;
|
|
21
18
|
};
|
|
22
19
|
type ReplaceOrderSdkFactory = (options: TInvestOptions) => ReplaceOrderSdk;
|
|
23
|
-
declare const replaceOrderOptionsSchema: {
|
|
24
|
-
readonly token: {
|
|
25
|
-
readonly type: 'string';
|
|
26
|
-
};
|
|
27
|
-
readonly endpoint: {
|
|
28
|
-
readonly type: 'string';
|
|
29
|
-
};
|
|
30
|
-
readonly 'app-name': {
|
|
31
|
-
readonly type: 'string';
|
|
32
|
-
};
|
|
33
|
-
readonly insecure: {
|
|
34
|
-
readonly type: 'boolean';
|
|
35
|
-
};
|
|
36
|
-
readonly confirm: {
|
|
37
|
-
readonly type: 'boolean';
|
|
38
|
-
};
|
|
39
|
-
readonly 'account-id': {
|
|
40
|
-
readonly type: 'string';
|
|
41
|
-
readonly required: true;
|
|
42
|
-
};
|
|
43
|
-
readonly 'order-id': {
|
|
44
|
-
readonly type: 'string';
|
|
45
|
-
readonly required: true;
|
|
46
|
-
};
|
|
47
|
-
readonly 'idempotency-key': {
|
|
48
|
-
readonly type: 'string';
|
|
49
|
-
readonly required: true;
|
|
50
|
-
};
|
|
51
|
-
readonly quantity: {
|
|
52
|
-
readonly type: 'number';
|
|
53
|
-
readonly integer: true;
|
|
54
|
-
readonly min: 1;
|
|
55
|
-
readonly max: number;
|
|
56
|
-
readonly required: true;
|
|
57
|
-
};
|
|
58
|
-
readonly price: {
|
|
59
|
-
readonly type: 'string';
|
|
60
|
-
readonly required: true;
|
|
61
|
-
};
|
|
62
|
-
readonly 'price-type': {
|
|
63
|
-
readonly type: 'string';
|
|
64
|
-
readonly choices: ("currency" | "point")[];
|
|
65
|
-
readonly required: true;
|
|
66
|
-
};
|
|
67
|
-
readonly format: {
|
|
68
|
-
readonly type: 'string';
|
|
69
|
-
readonly choices: readonly ["json", "table"];
|
|
70
|
-
readonly default: 'table';
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
type ReplaceOrderOptions = InferOptions<typeof replaceOrderOptionsSchema>;
|
|
74
|
-
type ReplaceOrderRequestOptions = CommandRequestOptions<ReplaceOrderOptions, 'account-id' | 'order-id' | 'idempotency-key' | 'quantity' | 'price' | 'price-type'>;
|
|
75
20
|
export declare function createReplaceOrderCommand(createSdk?: ReplaceOrderSdkFactory): Omit<import("icore").CommandDefinition<{
|
|
76
21
|
readonly token: {
|
|
77
22
|
readonly type: 'string';
|
|
@@ -113,7 +58,7 @@ export declare function createReplaceOrderCommand(createSdk?: ReplaceOrderSdkFac
|
|
|
113
58
|
};
|
|
114
59
|
readonly 'price-type': {
|
|
115
60
|
readonly type: 'string';
|
|
116
|
-
readonly choices:
|
|
61
|
+
readonly choices: readonly ["point", "currency"];
|
|
117
62
|
readonly required: true;
|
|
118
63
|
};
|
|
119
64
|
readonly format: {
|
|
@@ -165,7 +110,7 @@ export declare const replaceOrderCommand: Omit<import("icore").CommandDefinition
|
|
|
165
110
|
};
|
|
166
111
|
readonly 'price-type': {
|
|
167
112
|
readonly type: 'string';
|
|
168
|
-
readonly choices:
|
|
113
|
+
readonly choices: readonly ["point", "currency"];
|
|
169
114
|
readonly required: true;
|
|
170
115
|
};
|
|
171
116
|
readonly format: {
|
|
@@ -176,5 +121,4 @@ export declare const replaceOrderCommand: Omit<import("icore").CommandDefinition
|
|
|
176
121
|
}, undefined, string, readonly ["order", "replace"], undefined, void, readonly []>, "metadata"> & {
|
|
177
122
|
metadata?: undefined;
|
|
178
123
|
};
|
|
179
|
-
export {
|
|
180
|
-
export declare function createReplaceOrderRequest(options: ReplaceOrderRequestOptions): ReplaceOrderRequest;
|
|
124
|
+
export {};
|
|
@@ -4,30 +4,24 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Здесь допустимы:
|
|
6
6
|
* - объявление command path и option schema;
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - делегирование request mapping в command-owned 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.replaceOrderCommand = void 0;
|
|
14
14
|
exports.createReplaceOrderCommand = createReplaceOrderCommand;
|
|
15
|
-
exports.createReplaceOrderRequest = createReplaceOrderRequest;
|
|
16
|
-
const common_1 = require("../../../generated/common");
|
|
17
15
|
const contract_1 = require("../../cli/contract");
|
|
18
|
-
const
|
|
16
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
19
17
|
const command_options_1 = require("../../args/command-options");
|
|
20
18
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
21
19
|
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
22
20
|
const reporter_1 = require("./reporter");
|
|
23
|
-
|
|
21
|
+
const request_mapper_1 = require("./request.mapper");
|
|
24
22
|
const replaceOrderCommandPath = ['order', 'replace'];
|
|
25
23
|
const defaultReplaceOrderSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
26
|
-
const
|
|
27
|
-
point: common_1.PriceType.PRICE_TYPE_POINT,
|
|
28
|
-
currency: common_1.PriceType.PRICE_TYPE_CURRENCY
|
|
29
|
-
};
|
|
30
|
-
const replaceOrderPriceTypeNames = Object.keys(replaceOrderPriceTypes);
|
|
24
|
+
const replaceOrderPriceTypeNames = ['point', 'currency'];
|
|
31
25
|
const replaceOrderRequestOptionsSchema = {
|
|
32
26
|
'account-id': {
|
|
33
27
|
type: 'string',
|
|
@@ -75,25 +69,10 @@ function createReplaceOrderCommand(createSdk = defaultReplaceOrderSdkFactory) {
|
|
|
75
69
|
exports.replaceOrderCommand = createReplaceOrderCommand();
|
|
76
70
|
async function runReplaceOrderCommand(options, createSdk) {
|
|
77
71
|
(0, side_effect_args_1.assertSideEffectConfirmed)(options.confirm);
|
|
78
|
-
const request = createReplaceOrderRequest(options);
|
|
72
|
+
const request = (0, request_mapper_1.createReplaceOrderRequest)(options);
|
|
79
73
|
const { format } = options;
|
|
80
|
-
|
|
81
|
-
try {
|
|
74
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
82
75
|
const response = await sdk.orders.replaceOrder(request);
|
|
83
76
|
return (0, reporter_1.formatReplaceOrder)(response, format);
|
|
84
|
-
}
|
|
85
|
-
finally {
|
|
86
|
-
sdk.close();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function createReplaceOrderRequest(options) {
|
|
90
|
-
return {
|
|
91
|
-
accountId: options['account-id'],
|
|
92
|
-
orderId: options['order-id'],
|
|
93
|
-
idempotencyKey: options['idempotency-key'],
|
|
94
|
-
quantity: options.quantity,
|
|
95
|
-
price: (0, side_effect_args_1.parsePositiveQuotationOption)(options.price, 'price'),
|
|
96
|
-
priceType: replaceOrderPriceTypes[options['price-type']],
|
|
97
|
-
confirmMarginTrade: false
|
|
98
|
-
};
|
|
77
|
+
});
|
|
99
78
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Модуль хранит request mapping, общий для production и Sandbox replace order.
|
|
3
|
+
*
|
|
4
|
+
* Здесь допустимы generated enum mapping и разбор цены заявки.
|
|
5
|
+
* Здесь не должно быть command schema, SDK calls или rendering.
|
|
6
|
+
*/
|
|
7
|
+
import { PriceType } from '../../../generated/common';
|
|
8
|
+
import type { ReplaceOrderRequest } from '../../../generated/orders';
|
|
9
|
+
declare const replaceOrderPriceTypes: {
|
|
10
|
+
readonly point: PriceType.PRICE_TYPE_POINT;
|
|
11
|
+
readonly currency: PriceType.PRICE_TYPE_CURRENCY;
|
|
12
|
+
};
|
|
13
|
+
interface ReplaceOrderRequestOptions {
|
|
14
|
+
readonly 'account-id': string;
|
|
15
|
+
readonly 'order-id': string;
|
|
16
|
+
readonly 'idempotency-key': string;
|
|
17
|
+
readonly quantity: number;
|
|
18
|
+
readonly price: string;
|
|
19
|
+
readonly 'price-type': keyof typeof replaceOrderPriceTypes;
|
|
20
|
+
}
|
|
21
|
+
export declare function createReplaceOrderRequest(options: ReplaceOrderRequestOptions): ReplaceOrderRequest;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Модуль хранит request mapping, общий для production и Sandbox replace order.
|
|
4
|
+
*
|
|
5
|
+
* Здесь допустимы generated enum mapping и разбор цены заявки.
|
|
6
|
+
* Здесь не должно быть command schema, SDK calls или rendering.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.createReplaceOrderRequest = createReplaceOrderRequest;
|
|
10
|
+
const common_1 = require("../../../generated/common");
|
|
11
|
+
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
12
|
+
const replaceOrderPriceTypes = {
|
|
13
|
+
point: common_1.PriceType.PRICE_TYPE_POINT,
|
|
14
|
+
currency: common_1.PriceType.PRICE_TYPE_CURRENCY
|
|
15
|
+
};
|
|
16
|
+
function createReplaceOrderRequest(options) {
|
|
17
|
+
return {
|
|
18
|
+
accountId: options['account-id'],
|
|
19
|
+
orderId: options['order-id'],
|
|
20
|
+
idempotencyKey: options['idempotency-key'],
|
|
21
|
+
quantity: options.quantity,
|
|
22
|
+
price: (0, side_effect_args_1.parsePositiveQuotationOption)(options.price, 'price'),
|
|
23
|
+
priceType: replaceOrderPriceTypes[options['price-type']],
|
|
24
|
+
confirmMarginTrade: false
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -4,13 +4,12 @@
|
|
|
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
|
*/
|
|
11
11
|
import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
12
12
|
import type { GetAccountsRequest, GetAccountsResponse } from '../../../generated/users';
|
|
13
|
-
import { formatAccounts } from '../accounts/reporter';
|
|
14
13
|
type SandboxAccountsSdk = {
|
|
15
14
|
sandbox: {
|
|
16
15
|
getSandboxAccounts(request: GetAccountsRequest): Promise<GetAccountsResponse>;
|
|
@@ -60,5 +59,5 @@ export declare const sandboxAccountsCommand: Omit<import("icore").CommandDefinit
|
|
|
60
59
|
}, undefined, string, readonly ["sandbox", "account", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
61
60
|
metadata?: undefined;
|
|
62
61
|
};
|
|
63
|
-
export { formatAccounts };
|
|
64
62
|
export declare function createSandboxAccountsRequest(): GetAccountsRequest;
|
|
63
|
+
export {};
|
|
@@ -5,20 +5,19 @@
|
|
|
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.sandboxAccountsCommand = void 0;
|
|
14
14
|
exports.createSandboxAccountsCommand = createSandboxAccountsCommand;
|
|
15
15
|
exports.createSandboxAccountsRequest = createSandboxAccountsRequest;
|
|
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
20
|
const reporter_1 = require("../accounts/reporter");
|
|
21
|
-
Object.defineProperty(exports, "formatAccounts", { enumerable: true, get: function () { return reporter_1.formatAccounts; } });
|
|
22
21
|
const sandboxAccountsCommandPath = ['sandbox', 'account', 'list'];
|
|
23
22
|
const defaultSandboxAccountsSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
24
23
|
const sandboxAccountsOptionsSchema = (0, command_options_1.withSdkOptions)({
|
|
@@ -40,14 +39,10 @@ function createSandboxAccountsCommand(createSdk = defaultSandboxAccountsSdkFacto
|
|
|
40
39
|
exports.sandboxAccountsCommand = createSandboxAccountsCommand();
|
|
41
40
|
async function runSandboxAccountsCommand(options, createSdk) {
|
|
42
41
|
const { format } = options;
|
|
43
|
-
|
|
44
|
-
try {
|
|
42
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
45
43
|
const response = await sdk.sandbox.getSandboxAccounts(createSandboxAccountsRequest());
|
|
46
44
|
return (0, reporter_1.formatAccounts)(response.accounts, format);
|
|
47
|
-
}
|
|
48
|
-
finally {
|
|
49
|
-
sdk.close();
|
|
50
|
-
}
|
|
45
|
+
});
|
|
51
46
|
}
|
|
52
47
|
function createSandboxAccountsRequest() {
|
|
53
48
|
return {};
|
|
@@ -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 { CancelOrderRequest, CancelOrderResponse } from '../../../generated/orders';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatCancelOrder } from '../cancel-order/reporter';
|
|
16
15
|
type SandboxCancelOrderSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
cancelSandboxOrder(request: CancelOrderRequest): Promise<CancelOrderResponse>;
|
|
@@ -116,5 +115,5 @@ export declare const sandboxCancelOrderCommand: Omit<import("icore").CommandDefi
|
|
|
116
115
|
}, undefined, string, readonly ["sandbox", "order", "cancel"], undefined, void, readonly []>, "metadata"> & {
|
|
117
116
|
metadata?: undefined;
|
|
118
117
|
};
|
|
119
|
-
export { formatCancelOrder };
|
|
120
118
|
export declare function createSandboxCancelOrderRequest(options: SandboxCancelOrderRequestOptions): CancelOrderRequest;
|
|
119
|
+
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.sandboxCancelOrderCommand = void 0;
|
|
14
14
|
exports.createSandboxCancelOrderCommand = createSandboxCancelOrderCommand;
|
|
15
15
|
exports.createSandboxCancelOrderRequest = createSandboxCancelOrderRequest;
|
|
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("../cancel-order/request.mapper");
|
|
21
21
|
const reporter_1 = require("../cancel-order/reporter");
|
|
22
|
-
Object.defineProperty(exports, "formatCancelOrder", { enumerable: true, get: function () { return reporter_1.formatCancelOrder; } });
|
|
23
22
|
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
24
23
|
const sandboxCancelOrderCommandPath = ['sandbox', 'order', 'cancel'];
|
|
25
24
|
const defaultSandboxCancelOrderSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
@@ -55,15 +54,11 @@ async function runSandboxCancelOrderCommand(options, createSdk) {
|
|
|
55
54
|
(0, side_effect_args_1.assertSideEffectConfirmed)(options.confirm);
|
|
56
55
|
const request = createSandboxCancelOrderRequest(options);
|
|
57
56
|
const { format } = options;
|
|
58
|
-
|
|
59
|
-
try {
|
|
57
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
60
58
|
const response = await sdk.sandbox.cancelSandboxOrder(request);
|
|
61
59
|
return (0, reporter_1.formatCancelOrder)(response, format);
|
|
62
|
-
}
|
|
63
|
-
finally {
|
|
64
|
-
sdk.close();
|
|
65
|
-
}
|
|
60
|
+
});
|
|
66
61
|
}
|
|
67
62
|
function createSandboxCancelOrderRequest(options) {
|
|
68
|
-
return (0,
|
|
63
|
+
return (0, request_mapper_1.createCancelOrderRequest)(options);
|
|
69
64
|
}
|
|
@@ -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 { CloseSandboxAccountRequest, CloseSandboxAccountResponse } from '../../../generated/sandbox';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatCloseSandboxAccount } from './reporter';
|
|
16
15
|
type SandboxCloseAccountSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
closeSandboxAccount(request: CloseSandboxAccountRequest): Promise<CloseSandboxAccountResponse>;
|
|
@@ -104,5 +103,5 @@ export declare const sandboxCloseAccountCommand: Omit<import("icore").CommandDef
|
|
|
104
103
|
}, undefined, string, readonly ["sandbox", "account", "close"], undefined, void, readonly []>, "metadata"> & {
|
|
105
104
|
metadata?: undefined;
|
|
106
105
|
};
|
|
107
|
-
export { formatCloseSandboxAccount };
|
|
108
106
|
export declare function createSandboxCloseAccountRequest(options: SandboxCloseAccountRequestOptions): CloseSandboxAccountRequest;
|
|
107
|
+
export {};
|
|
@@ -5,21 +5,20 @@
|
|
|
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.sandboxCloseAccountCommand = void 0;
|
|
14
14
|
exports.createSandboxCloseAccountCommand = createSandboxCloseAccountCommand;
|
|
15
15
|
exports.createSandboxCloseAccountRequest = createSandboxCloseAccountRequest;
|
|
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
20
|
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
21
21
|
const reporter_1 = require("./reporter");
|
|
22
|
-
Object.defineProperty(exports, "formatCloseSandboxAccount", { enumerable: true, get: function () { return reporter_1.formatCloseSandboxAccount; } });
|
|
23
22
|
const sandboxCloseAccountCommandPath = ['sandbox', 'account', 'close'];
|
|
24
23
|
const defaultSandboxCloseAccountSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
25
24
|
const sandboxCloseAccountRequestOptionsSchema = {
|
|
@@ -50,14 +49,10 @@ async function runSandboxCloseAccountCommand(options, createSdk) {
|
|
|
50
49
|
(0, side_effect_args_1.assertSideEffectConfirmed)(options.confirm);
|
|
51
50
|
const request = createSandboxCloseAccountRequest(options);
|
|
52
51
|
const { format } = options;
|
|
53
|
-
|
|
54
|
-
try {
|
|
52
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
55
53
|
await sdk.sandbox.closeSandboxAccount(request);
|
|
56
54
|
return (0, reporter_1.formatCloseSandboxAccount)(request.accountId, format);
|
|
57
|
-
}
|
|
58
|
-
finally {
|
|
59
|
-
sdk.close();
|
|
60
|
-
}
|
|
55
|
+
});
|
|
61
56
|
}
|
|
62
57
|
function createSandboxCloseAccountRequest(options) {
|
|
63
58
|
return {
|
|
@@ -4,13 +4,12 @@
|
|
|
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
|
*/
|
|
11
11
|
import type { TInvestOptions } from '../../../application/dto/t-invest-options';
|
|
12
12
|
import type { OpenSandboxAccountRequest, OpenSandboxAccountResponse } from '../../../generated/sandbox';
|
|
13
|
-
import { formatOpenSandboxAccount } from './reporter';
|
|
14
13
|
type SandboxOpenAccountSdk = {
|
|
15
14
|
sandbox: {
|
|
16
15
|
openSandboxAccount(request: OpenSandboxAccountRequest): Promise<OpenSandboxAccountResponse>;
|
|
@@ -66,5 +65,5 @@ export declare const sandboxOpenAccountCommand: Omit<import("icore").CommandDefi
|
|
|
66
65
|
}, undefined, string, readonly ["sandbox", "account", "open"], undefined, void, readonly []>, "metadata"> & {
|
|
67
66
|
metadata?: undefined;
|
|
68
67
|
};
|
|
69
|
-
export { formatOpenSandboxAccount };
|
|
70
68
|
export declare function createSandboxOpenAccountRequest(): OpenSandboxAccountRequest;
|
|
69
|
+
export {};
|
|
@@ -5,21 +5,20 @@
|
|
|
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.sandboxOpenAccountCommand = void 0;
|
|
14
14
|
exports.createSandboxOpenAccountCommand = createSandboxOpenAccountCommand;
|
|
15
15
|
exports.createSandboxOpenAccountRequest = createSandboxOpenAccountRequest;
|
|
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
20
|
const side_effect_args_1 = require("../../args/side-effect-args");
|
|
21
21
|
const reporter_1 = require("./reporter");
|
|
22
|
-
Object.defineProperty(exports, "formatOpenSandboxAccount", { enumerable: true, get: function () { return reporter_1.formatOpenSandboxAccount; } });
|
|
23
22
|
const sandboxOpenAccountCommandPath = ['sandbox', 'account', 'open'];
|
|
24
23
|
const defaultSandboxOpenAccountSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
25
24
|
const sandboxOpenAccountFormatOptionsSchema = {
|
|
@@ -43,14 +42,10 @@ exports.sandboxOpenAccountCommand = createSandboxOpenAccountCommand();
|
|
|
43
42
|
async function runSandboxOpenAccountCommand(options, createSdk) {
|
|
44
43
|
(0, side_effect_args_1.assertSideEffectConfirmed)(options.confirm);
|
|
45
44
|
const { format } = options;
|
|
46
|
-
|
|
47
|
-
try {
|
|
45
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
48
46
|
const response = await sdk.sandbox.openSandboxAccount(createSandboxOpenAccountRequest());
|
|
49
47
|
return (0, reporter_1.formatOpenSandboxAccount)(response, format);
|
|
50
|
-
}
|
|
51
|
-
finally {
|
|
52
|
-
sdk.close();
|
|
53
|
-
}
|
|
48
|
+
});
|
|
54
49
|
}
|
|
55
50
|
function createSandboxOpenAccountRequest() {
|
|
56
51
|
return {};
|
|
@@ -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 { OperationsRequest, OperationsResponse } from '../../../generated/operations';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatOperations } from '../operations/reporter';
|
|
16
15
|
type SandboxOperationsSdk = {
|
|
17
16
|
sandbox: {
|
|
18
17
|
getSandboxOperations(request: OperationsRequest): Promise<OperationsResponse>;
|
|
@@ -152,5 +151,5 @@ export declare const sandboxOperationsCommand: Omit<import("icore").CommandDefin
|
|
|
152
151
|
}, undefined, string, readonly ["sandbox", "operation", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
153
152
|
metadata?: undefined;
|
|
154
153
|
};
|
|
155
|
-
export { formatOperations };
|
|
156
154
|
export declare function createSandboxOperationsRequest(options: SandboxOperationsRequestOptions): OperationsRequest;
|
|
155
|
+
export {};
|
|
@@ -4,23 +4,22 @@
|
|
|
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.sandboxOperationsCommand = void 0;
|
|
14
14
|
exports.createSandboxOperationsCommand = createSandboxOperationsCommand;
|
|
15
15
|
exports.createSandboxOperationsRequest = createSandboxOperationsRequest;
|
|
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
20
|
const instrument_id_options_1 = require("../../args/instrument-id-options");
|
|
21
|
-
const
|
|
21
|
+
const request_mapper_1 = require("../operations/request.mapper");
|
|
22
22
|
const reporter_1 = require("../operations/reporter");
|
|
23
|
-
Object.defineProperty(exports, "formatOperations", { enumerable: true, get: function () { return reporter_1.formatOperations; } });
|
|
24
23
|
const sandboxOperationsCommandPath = ['sandbox', 'operation', 'list'];
|
|
25
24
|
const defaultSandboxOperationsSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
26
25
|
const sandboxOperationsRequestOptionsSchema = {
|
|
@@ -64,15 +63,11 @@ exports.sandboxOperationsCommand = createSandboxOperationsCommand();
|
|
|
64
63
|
async function runSandboxOperationsCommand(options, createSdk) {
|
|
65
64
|
const request = createSandboxOperationsRequest(options);
|
|
66
65
|
const { format } = options;
|
|
67
|
-
|
|
68
|
-
try {
|
|
66
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
69
67
|
const response = await sdk.sandbox.getSandboxOperations(request);
|
|
70
68
|
return (0, reporter_1.formatOperations)(response.operations, format);
|
|
71
|
-
}
|
|
72
|
-
finally {
|
|
73
|
-
sdk.close();
|
|
74
|
-
}
|
|
69
|
+
});
|
|
75
70
|
}
|
|
76
71
|
function createSandboxOperationsRequest(options) {
|
|
77
|
-
return (0,
|
|
72
|
+
return (0, request_mapper_1.createOperationsRequest)(options);
|
|
78
73
|
}
|