@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
|
@@ -222,12 +222,12 @@ export declare const commandLineCommands: import("icore").Commands<readonly [Wit
|
|
|
222
222
|
};
|
|
223
223
|
readonly direction: {
|
|
224
224
|
readonly type: 'string';
|
|
225
|
-
readonly choices:
|
|
225
|
+
readonly choices: readonly ["buy", "sell"];
|
|
226
226
|
readonly required: true;
|
|
227
227
|
};
|
|
228
228
|
readonly 'order-type': {
|
|
229
229
|
readonly type: 'string';
|
|
230
|
-
readonly choices:
|
|
230
|
+
readonly choices: readonly ["limit", "market", "bestprice"];
|
|
231
231
|
readonly required: true;
|
|
232
232
|
};
|
|
233
233
|
readonly 'order-id': {
|
|
@@ -313,7 +313,7 @@ export declare const commandLineCommands: import("icore").Commands<readonly [Wit
|
|
|
313
313
|
};
|
|
314
314
|
readonly 'price-type': {
|
|
315
315
|
readonly type: 'string';
|
|
316
|
-
readonly choices:
|
|
316
|
+
readonly choices: readonly ["point", "currency"];
|
|
317
317
|
readonly required: true;
|
|
318
318
|
};
|
|
319
319
|
readonly format: {
|
|
@@ -1095,7 +1095,7 @@ export declare const commandLineCommands: import("icore").Commands<readonly [Wit
|
|
|
1095
1095
|
};
|
|
1096
1096
|
readonly state: {
|
|
1097
1097
|
readonly type: 'string';
|
|
1098
|
-
readonly choices:
|
|
1098
|
+
readonly choices: readonly ["unspecified", "executed", "canceled", "progress"];
|
|
1099
1099
|
readonly default: 'unspecified';
|
|
1100
1100
|
};
|
|
1101
1101
|
readonly 'account-id': {
|
|
@@ -1132,7 +1132,7 @@ export declare const commandLineCommands: import("icore").Commands<readonly [Wit
|
|
|
1132
1132
|
};
|
|
1133
1133
|
readonly state: {
|
|
1134
1134
|
readonly type: 'string';
|
|
1135
|
-
readonly choices:
|
|
1135
|
+
readonly choices: readonly ["unspecified", "executed", "canceled", "progress"];
|
|
1136
1136
|
readonly default: 'unspecified';
|
|
1137
1137
|
};
|
|
1138
1138
|
readonly limit: {
|
|
@@ -1265,7 +1265,7 @@ export declare const commandLineCommands: import("icore").Commands<readonly [Wit
|
|
|
1265
1265
|
};
|
|
1266
1266
|
readonly currency: {
|
|
1267
1267
|
readonly type: 'string';
|
|
1268
|
-
readonly choices:
|
|
1268
|
+
readonly choices: readonly ["rub", "usd", "eur"];
|
|
1269
1269
|
readonly default: 'rub';
|
|
1270
1270
|
};
|
|
1271
1271
|
readonly format: {
|
|
@@ -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 { GetAccountsResponse } from '../../../generated/users';
|
|
13
|
-
import { formatAccounts } from './reporter';
|
|
14
13
|
type AccountsSdk = {
|
|
15
14
|
users: {
|
|
16
15
|
getAccounts(request: Record<string, never>): Promise<GetAccountsResponse>;
|
|
@@ -60,4 +59,4 @@ export declare const accountsCommand: Omit<import("icore").CommandDefinition<{
|
|
|
60
59
|
}, undefined, string, readonly ["account", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
61
60
|
metadata?: undefined;
|
|
62
61
|
};
|
|
63
|
-
export {
|
|
62
|
+
export {};
|
|
@@ -5,19 +5,18 @@
|
|
|
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.accountsCommand = void 0;
|
|
14
14
|
exports.createAccountsCommand = createAccountsCommand;
|
|
15
15
|
const contract_1 = require("../../cli/contract");
|
|
16
|
-
const
|
|
16
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
17
17
|
const command_options_1 = require("../../args/command-options");
|
|
18
18
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
19
19
|
const reporter_1 = require("./reporter");
|
|
20
|
-
Object.defineProperty(exports, "formatAccounts", { enumerable: true, get: function () { return reporter_1.formatAccounts; } });
|
|
21
20
|
const accountsCommandPath = ['account', 'list'];
|
|
22
21
|
const defaultAccountsSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
23
22
|
const accountsOptionsSchema = (0, command_options_1.withSdkOptions)({
|
|
@@ -39,12 +38,8 @@ function createAccountsCommand(createSdk = defaultAccountsSdkFactory) {
|
|
|
39
38
|
exports.accountsCommand = createAccountsCommand();
|
|
40
39
|
async function runAccountsCommand(options, createSdk) {
|
|
41
40
|
const { format } = options;
|
|
42
|
-
|
|
43
|
-
try {
|
|
41
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
44
42
|
const response = await sdk.users.getAccounts({});
|
|
45
43
|
return (0, reporter_1.formatAccounts)(response.accounts, format);
|
|
46
|
-
}
|
|
47
|
-
finally {
|
|
48
|
-
sdk.close();
|
|
49
|
-
}
|
|
44
|
+
});
|
|
50
45
|
}
|
|
@@ -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 { GetAccruedInterestsRequest, type GetAccruedInterestsResponse } from '../../../generated/instruments';
|
|
13
13
|
import { type InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatAccruedInterests } from './reporter';
|
|
16
15
|
type AccruedInterestsSdk = {
|
|
17
16
|
instruments: {
|
|
18
17
|
getAccruedInterests(request: GetAccruedInterestsRequest): Promise<GetAccruedInterestsResponse>;
|
|
@@ -125,5 +124,5 @@ export declare const accruedInterestsCommand: Omit<import("icore").CommandDefini
|
|
|
125
124
|
}, undefined, string, readonly ["instrument", "bond", "accrued"], undefined, void, readonly []>, "metadata"> & {
|
|
126
125
|
metadata?: undefined;
|
|
127
126
|
};
|
|
128
|
-
export { formatAccruedInterests };
|
|
129
127
|
export declare function createAccruedInterestsRequest(options: AccruedInterestsRequestOptions): GetAccruedInterestsRequest;
|
|
128
|
+
export {};
|
|
@@ -5,23 +5,22 @@
|
|
|
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.accruedInterestsCommand = void 0;
|
|
14
14
|
exports.createAccruedInterestsCommand = createAccruedInterestsCommand;
|
|
15
15
|
exports.createAccruedInterestsRequest = createAccruedInterestsRequest;
|
|
16
16
|
const instruments_1 = require("../../../generated/instruments");
|
|
17
17
|
const icore_1 = require("icore");
|
|
18
18
|
const contract_1 = require("../../cli/contract");
|
|
19
|
-
const
|
|
19
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
20
20
|
const command_options_1 = require("../../args/command-options");
|
|
21
21
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
22
22
|
const instrument_id_options_1 = require("../../args/instrument-id-options");
|
|
23
23
|
const reporter_1 = require("./reporter");
|
|
24
|
-
Object.defineProperty(exports, "formatAccruedInterests", { enumerable: true, get: function () { return reporter_1.formatAccruedInterests; } });
|
|
25
24
|
const accruedInterestsCommandPath = ['instrument', 'bond', 'accrued'];
|
|
26
25
|
const defaultAccruedInterestsSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
27
26
|
const accruedInterestsRequestOptionsSchema = {
|
|
@@ -56,14 +55,10 @@ exports.accruedInterestsCommand = createAccruedInterestsCommand();
|
|
|
56
55
|
async function runAccruedInterestsCommand(options, createSdk) {
|
|
57
56
|
const request = createAccruedInterestsRequest(options);
|
|
58
57
|
const { format } = options;
|
|
59
|
-
|
|
60
|
-
try {
|
|
58
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
61
59
|
const response = await sdk.instruments.getAccruedInterests(request);
|
|
62
60
|
return (0, reporter_1.formatAccruedInterests)(response.accruedInterests, format);
|
|
63
|
-
}
|
|
64
|
-
finally {
|
|
65
|
-
sdk.close();
|
|
66
|
-
}
|
|
61
|
+
});
|
|
67
62
|
}
|
|
68
63
|
function createAccruedInterestsRequest(options) {
|
|
69
64
|
const from = (0, command_options_1.parseDateTimeOption)(options.from, 'from');
|
|
@@ -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 { AssetRequest, AssetResponse } from '../../../generated/instruments';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatAsset } from './reporter';
|
|
16
15
|
type AssetSdk = {
|
|
17
16
|
instruments: {
|
|
18
17
|
getAssetBy(request: AssetRequest): Promise<AssetResponse>;
|
|
@@ -95,5 +94,5 @@ export declare const assetCommand: Omit<import("icore").CommandDefinition<{
|
|
|
95
94
|
}, undefined, string, readonly ["instrument", "asset", "show"], undefined, void, readonly []>, "metadata"> & {
|
|
96
95
|
metadata?: undefined;
|
|
97
96
|
};
|
|
98
|
-
export { formatAsset };
|
|
99
97
|
export declare function createAssetRequest(options: AssetRequestOptions): AssetRequest;
|
|
98
|
+
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.assetCommand = void 0;
|
|
14
14
|
exports.createAssetCommand = createAssetCommand;
|
|
15
15
|
exports.createAssetRequest = createAssetRequest;
|
|
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("./reporter");
|
|
21
|
-
Object.defineProperty(exports, "formatAsset", { enumerable: true, get: function () { return reporter_1.formatAsset; } });
|
|
22
21
|
const assetCommandPath = ['instrument', 'asset', 'show'];
|
|
23
22
|
const defaultAssetSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
24
23
|
const assetRequestOptionsSchema = {
|
|
@@ -48,14 +47,10 @@ exports.assetCommand = createAssetCommand();
|
|
|
48
47
|
async function runAssetCommand(options, createSdk) {
|
|
49
48
|
const request = createAssetRequest(options);
|
|
50
49
|
const { format } = options;
|
|
51
|
-
|
|
52
|
-
try {
|
|
50
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
53
51
|
const response = await sdk.instruments.getAssetBy(request);
|
|
54
52
|
return (0, reporter_1.formatAsset)(response, format);
|
|
55
|
-
}
|
|
56
|
-
finally {
|
|
57
|
-
sdk.close();
|
|
58
|
-
}
|
|
53
|
+
});
|
|
59
54
|
}
|
|
60
55
|
function createAssetRequest(options) {
|
|
61
56
|
return {
|
|
@@ -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 { AssetsRequest, AssetsResponse } from '../../../generated/instruments';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatAssets } from './reporter';
|
|
16
15
|
type AssetsSdk = {
|
|
17
16
|
instruments: {
|
|
18
17
|
getAssets(request: AssetsRequest): Promise<AssetsResponse>;
|
|
@@ -98,5 +97,5 @@ export declare const assetsCommand: Omit<import("icore").CommandDefinition<{
|
|
|
98
97
|
}, undefined, string, readonly ["instrument", "asset", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
99
98
|
metadata?: undefined;
|
|
100
99
|
};
|
|
101
|
-
export { formatAssets };
|
|
102
100
|
export declare function createAssetsRequest(options: AssetsRequestOptions): AssetsRequest;
|
|
101
|
+
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.assetsCommand = void 0;
|
|
14
14
|
exports.createAssetsCommand = createAssetsCommand;
|
|
15
15
|
exports.createAssetsRequest = createAssetsRequest;
|
|
16
16
|
const common_1 = require("../../../generated/common");
|
|
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 reporter_1 = require("./reporter");
|
|
22
|
-
Object.defineProperty(exports, "formatAssets", { enumerable: true, get: function () { return reporter_1.formatAssets; } });
|
|
23
22
|
const assetsCommandPath = ['instrument', 'asset', 'list'];
|
|
24
23
|
const defaultAssetsSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
25
24
|
const assetInstrumentTypes = {
|
|
@@ -62,14 +61,10 @@ exports.assetsCommand = createAssetsCommand();
|
|
|
62
61
|
async function runAssetsCommand(options, createSdk) {
|
|
63
62
|
const request = createAssetsRequest(options);
|
|
64
63
|
const { format } = options;
|
|
65
|
-
|
|
66
|
-
try {
|
|
64
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
67
65
|
const response = await sdk.instruments.getAssets(request);
|
|
68
66
|
return (0, reporter_1.formatAssets)(response.assets, format);
|
|
69
|
-
}
|
|
70
|
-
finally {
|
|
71
|
-
sdk.close();
|
|
72
|
-
}
|
|
67
|
+
});
|
|
73
68
|
}
|
|
74
69
|
function createAssetsRequest(options) {
|
|
75
70
|
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 { BondResponse, InstrumentRequest } from '../../../generated/instruments';
|
|
13
|
-
import { formatBond } from './reporter';
|
|
14
13
|
type BondSdk = {
|
|
15
14
|
instruments: {
|
|
16
15
|
bondBy(request: InstrumentRequest): Promise<BondResponse>;
|
|
@@ -80,4 +79,4 @@ export declare const bondCommand: Omit<import("icore").CommandDefinition<{
|
|
|
80
79
|
}, undefined, string, readonly ["instrument", "bond", "show"], undefined, void, readonly []>, "metadata"> & {
|
|
81
80
|
metadata?: undefined;
|
|
82
81
|
};
|
|
83
|
-
export {
|
|
82
|
+
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.bondCommand = void 0;
|
|
14
14
|
exports.createBondCommand = createBondCommand;
|
|
15
15
|
const contract_1 = require("../../cli/contract");
|
|
16
|
-
const
|
|
16
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
17
17
|
const command_options_1 = require("../../args/command-options");
|
|
18
18
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
19
19
|
const instruments_args_1 = require("../../args/instruments-args");
|
|
20
20
|
const reporter_1 = require("./reporter");
|
|
21
|
-
Object.defineProperty(exports, "formatBond", { enumerable: true, get: function () { return reporter_1.formatBond; } });
|
|
22
21
|
const bondCommandPath = ['instrument', 'bond', 'show'];
|
|
23
22
|
const defaultBondSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
24
23
|
const bondFormatOptionsSchema = {
|
|
@@ -42,12 +41,8 @@ exports.bondCommand = createBondCommand();
|
|
|
42
41
|
async function runBondCommand(options, createSdk) {
|
|
43
42
|
const { format } = options;
|
|
44
43
|
const request = (0, instruments_args_1.createInstrumentLookupRequestFromOptions)(options);
|
|
45
|
-
|
|
46
|
-
try {
|
|
44
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
47
45
|
const response = await sdk.instruments.bondBy(request);
|
|
48
46
|
return (0, reporter_1.formatBond)(response, format);
|
|
49
|
-
}
|
|
50
|
-
finally {
|
|
51
|
-
sdk.close();
|
|
52
|
-
}
|
|
47
|
+
});
|
|
53
48
|
}
|
|
@@ -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 { GetBondCouponsRequest, type GetBondCouponsResponse } from '../../../generated/instruments';
|
|
13
13
|
import { type InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatBondCoupons } from './reporter';
|
|
16
15
|
type BondCouponsSdk = {
|
|
17
16
|
instruments: {
|
|
18
17
|
getBondCoupons(request: GetBondCouponsRequest): Promise<GetBondCouponsResponse>;
|
|
@@ -125,5 +124,5 @@ export declare const bondCouponsCommand: Omit<import("icore").CommandDefinition<
|
|
|
125
124
|
}, undefined, string, readonly ["instrument", "bond", "coupons"], undefined, void, readonly []>, "metadata"> & {
|
|
126
125
|
metadata?: undefined;
|
|
127
126
|
};
|
|
128
|
-
export { formatBondCoupons };
|
|
129
127
|
export declare function createBondCouponsRequest(options: BondCouponsRequestOptions): GetBondCouponsRequest;
|
|
128
|
+
export {};
|
|
@@ -5,23 +5,22 @@
|
|
|
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.bondCouponsCommand = void 0;
|
|
14
14
|
exports.createBondCouponsCommand = createBondCouponsCommand;
|
|
15
15
|
exports.createBondCouponsRequest = createBondCouponsRequest;
|
|
16
16
|
const instruments_1 = require("../../../generated/instruments");
|
|
17
17
|
const icore_1 = require("icore");
|
|
18
18
|
const contract_1 = require("../../cli/contract");
|
|
19
|
-
const
|
|
19
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
20
20
|
const command_options_1 = require("../../args/command-options");
|
|
21
21
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
22
22
|
const instrument_id_options_1 = require("../../args/instrument-id-options");
|
|
23
23
|
const reporter_1 = require("./reporter");
|
|
24
|
-
Object.defineProperty(exports, "formatBondCoupons", { enumerable: true, get: function () { return reporter_1.formatBondCoupons; } });
|
|
25
24
|
const bondCouponsCommandPath = ['instrument', 'bond', 'coupons'];
|
|
26
25
|
const defaultBondCouponsSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
27
26
|
const bondCouponsRequestOptionsSchema = {
|
|
@@ -56,14 +55,10 @@ exports.bondCouponsCommand = createBondCouponsCommand();
|
|
|
56
55
|
async function runBondCouponsCommand(options, createSdk) {
|
|
57
56
|
const request = createBondCouponsRequest(options);
|
|
58
57
|
const { format } = options;
|
|
59
|
-
|
|
60
|
-
try {
|
|
58
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
61
59
|
const response = await sdk.instruments.getBondCoupons(request);
|
|
62
60
|
return (0, reporter_1.formatBondCoupons)(response.events, format);
|
|
63
|
-
}
|
|
64
|
-
finally {
|
|
65
|
-
sdk.close();
|
|
66
|
-
}
|
|
61
|
+
});
|
|
67
62
|
}
|
|
68
63
|
function createBondCouponsRequest(options) {
|
|
69
64
|
const from = (0, command_options_1.parseDateTimeOption)(options.from, 'from');
|
|
@@ -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 { BondsResponse, InstrumentsRequest } from '../../../generated/instruments';
|
|
13
|
-
import { formatBonds } from './reporter';
|
|
14
13
|
type BondsSdk = {
|
|
15
14
|
instruments: {
|
|
16
15
|
bonds(request: InstrumentsRequest): Promise<BondsResponse>;
|
|
@@ -70,4 +69,4 @@ export declare const bondsCommand: Omit<import("icore").CommandDefinition<{
|
|
|
70
69
|
}, undefined, string, readonly ["instrument", "bond", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
71
70
|
metadata?: undefined;
|
|
72
71
|
};
|
|
73
|
-
export {
|
|
72
|
+
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.bondsCommand = void 0;
|
|
14
14
|
exports.createBondsCommand = createBondsCommand;
|
|
15
15
|
const contract_1 = require("../../cli/contract");
|
|
16
|
-
const
|
|
16
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
17
17
|
const command_options_1 = require("../../args/command-options");
|
|
18
18
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
19
19
|
const instruments_args_1 = require("../../args/instruments-args");
|
|
20
20
|
const reporter_1 = require("./reporter");
|
|
21
|
-
Object.defineProperty(exports, "formatBonds", { enumerable: true, get: function () { return reporter_1.formatBonds; } });
|
|
22
21
|
const bondsCommandPath = ['instrument', 'bond', 'list'];
|
|
23
22
|
const defaultBondsSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
24
23
|
const bondsFormatOptionsSchema = {
|
|
@@ -42,12 +41,8 @@ exports.bondsCommand = createBondsCommand();
|
|
|
42
41
|
async function runBondsCommand(options, createSdk) {
|
|
43
42
|
const { format } = options;
|
|
44
43
|
const request = (0, instruments_args_1.createInstrumentsRequestFromOptions)(options);
|
|
45
|
-
|
|
46
|
-
try {
|
|
44
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
47
45
|
const response = await sdk.instruments.bonds(request);
|
|
48
46
|
return (0, reporter_1.formatBonds)(response.instruments, format);
|
|
49
|
-
}
|
|
50
|
-
finally {
|
|
51
|
-
sdk.close();
|
|
52
|
-
}
|
|
47
|
+
});
|
|
53
48
|
}
|
|
@@ -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 { Brand, GetBrandRequest } from '../../../generated/instruments';
|
|
13
13
|
import type { InferOptions } from 'icore';
|
|
14
14
|
import type { CommandRequestOptions } from '../../args/command-options';
|
|
15
|
-
import { formatBrand } from './reporter';
|
|
16
15
|
type BrandSdk = {
|
|
17
16
|
instruments: {
|
|
18
17
|
getBrandBy(request: GetBrandRequest): Promise<Brand>;
|
|
@@ -95,5 +94,5 @@ export declare const brandCommand: Omit<import("icore").CommandDefinition<{
|
|
|
95
94
|
}, undefined, string, readonly ["instrument", "brand", "show"], undefined, void, readonly []>, "metadata"> & {
|
|
96
95
|
metadata?: undefined;
|
|
97
96
|
};
|
|
98
|
-
export { formatBrand };
|
|
99
97
|
export declare function createBrandRequest(options: BrandRequestOptions): GetBrandRequest;
|
|
98
|
+
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.brandCommand = void 0;
|
|
14
14
|
exports.createBrandCommand = createBrandCommand;
|
|
15
15
|
exports.createBrandRequest = createBrandRequest;
|
|
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("./reporter");
|
|
21
|
-
Object.defineProperty(exports, "formatBrand", { enumerable: true, get: function () { return reporter_1.formatBrand; } });
|
|
22
21
|
const brandCommandPath = ['instrument', 'brand', 'show'];
|
|
23
22
|
const defaultBrandSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
24
23
|
const brandRequestOptionsSchema = {
|
|
@@ -48,14 +47,10 @@ exports.brandCommand = createBrandCommand();
|
|
|
48
47
|
async function runBrandCommand(options, createSdk) {
|
|
49
48
|
const request = createBrandRequest(options);
|
|
50
49
|
const { format } = options;
|
|
51
|
-
|
|
52
|
-
try {
|
|
50
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
53
51
|
const response = await sdk.instruments.getBrandBy(request);
|
|
54
52
|
return (0, reporter_1.formatBrand)(response, format);
|
|
55
|
-
}
|
|
56
|
-
finally {
|
|
57
|
-
sdk.close();
|
|
58
|
-
}
|
|
53
|
+
});
|
|
59
54
|
}
|
|
60
55
|
function createBrandRequest(options) {
|
|
61
56
|
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 { GetBrandsRequest, GetBrandsResponse } from '../../../generated/instruments';
|
|
13
|
-
import { formatBrands } from './reporter';
|
|
14
13
|
type BrandsSdk = {
|
|
15
14
|
instruments: {
|
|
16
15
|
getBrands(request: GetBrandsRequest): Promise<GetBrandsResponse>;
|
|
@@ -60,4 +59,4 @@ export declare const brandsCommand: Omit<import("icore").CommandDefinition<{
|
|
|
60
59
|
}, undefined, string, readonly ["instrument", "brand", "list"], undefined, void, readonly []>, "metadata"> & {
|
|
61
60
|
metadata?: undefined;
|
|
62
61
|
};
|
|
63
|
-
export {
|
|
62
|
+
export {};
|
|
@@ -5,19 +5,18 @@
|
|
|
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.brandsCommand = void 0;
|
|
14
14
|
exports.createBrandsCommand = createBrandsCommand;
|
|
15
15
|
const contract_1 = require("../../cli/contract");
|
|
16
|
-
const
|
|
16
|
+
const sdk_command_lifecycle_1 = require("../sdk-command-lifecycle");
|
|
17
17
|
const command_options_1 = require("../../args/command-options");
|
|
18
18
|
const t_invest_node_sdk_1 = require("../../t-invest-node-sdk");
|
|
19
19
|
const reporter_1 = require("./reporter");
|
|
20
|
-
Object.defineProperty(exports, "formatBrands", { enumerable: true, get: function () { return reporter_1.formatBrands; } });
|
|
21
20
|
const brandsCommandPath = ['instrument', 'brand', 'list'];
|
|
22
21
|
const defaultBrandsSdkFactory = (options) => new t_invest_node_sdk_1.TInvestNodeSDK(options);
|
|
23
22
|
const brandsOptionsSchema = (0, command_options_1.withSdkOptions)({
|
|
@@ -39,12 +38,8 @@ function createBrandsCommand(createSdk = defaultBrandsSdkFactory) {
|
|
|
39
38
|
exports.brandsCommand = createBrandsCommand();
|
|
40
39
|
async function runBrandsCommand(options, createSdk) {
|
|
41
40
|
const { format } = options;
|
|
42
|
-
|
|
43
|
-
try {
|
|
41
|
+
return (0, sdk_command_lifecycle_1.runSdkCommand)(options, createSdk, async (sdk) => {
|
|
44
42
|
const response = await sdk.instruments.getBrands({ paging: undefined });
|
|
45
43
|
return (0, reporter_1.formatBrands)(response.brands, format);
|
|
46
|
-
}
|
|
47
|
-
finally {
|
|
48
|
-
sdk.close();
|
|
49
|
-
}
|
|
44
|
+
});
|
|
50
45
|
}
|