snaptrade-typescript-sdk 13.1.8 → 13.1.10

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/dist/index.mjs CHANGED
@@ -4031,6 +4031,83 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
4031
4031
  };
4032
4032
  },
4033
4033
  /**
4034
+ * Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
4035
+ * @summary List all account orders
4036
+ * @param {string} accountId
4037
+ * @param {'all' | 'open' | 'executed'} [state] defaults to \"all\"
4038
+ * @param {number} [days] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
4039
+ * @param {string} [userId]
4040
+ * @param {string} [userSecret]
4041
+ * @param {*} [options] Override http request option.
4042
+ * @throws {RequiredError}
4043
+ */
4044
+ getAllAccountOrders: async (accountId, state, days, userId, userSecret, options = {}) => {
4045
+ assertParamExists("getAllAccountOrders", "accountId", accountId);
4046
+ const localVarPath = `/accounts/{accountId}/orders/all`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
4047
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4048
+ let baseOptions;
4049
+ if (configuration) baseOptions = configuration.baseOptions;
4050
+ const localVarRequestOptions = {
4051
+ method: "GET",
4052
+ ...baseOptions,
4053
+ ...options
4054
+ };
4055
+ const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
4056
+ const localVarQueryParameter = {};
4057
+ if (configuration?.authMode === "commercialApiKey") {
4058
+ await setApiKeyToObject({
4059
+ object: localVarQueryParameter,
4060
+ key: "clientId",
4061
+ keyParamName: "clientId",
4062
+ configuration
4063
+ });
4064
+ if (userId !== void 0) localVarQueryParameter["userId"] = userId;
4065
+ if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
4066
+ }
4067
+ if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
4068
+ object: localVarQueryParameter,
4069
+ key: "clientId",
4070
+ keyParamName: "clientId",
4071
+ configuration
4072
+ });
4073
+ if (state !== void 0) localVarQueryParameter["state"] = state;
4074
+ if (days !== void 0) localVarQueryParameter["days"] = days;
4075
+ const localVarOperationAuth = {
4076
+ authModes: ["commercialApiKey", "personalApiKey"],
4077
+ requestSigningByAuthMode: {
4078
+ "commercialApiKey": {
4079
+ secretParameter: "consumerKey",
4080
+ signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
4081
+ },
4082
+ "personalApiKey": {
4083
+ secretParameter: "consumerKey",
4084
+ signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
4085
+ }
4086
+ },
4087
+ selectedAuthMode: configuration?.authMode
4088
+ };
4089
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
4090
+ localVarRequestOptions.headers = {
4091
+ ...localVarHeaderParameter,
4092
+ ...headersFromBaseOptions,
4093
+ ...options.headers
4094
+ };
4095
+ requestBeforeHook({
4096
+ queryParameters: localVarQueryParameter,
4097
+ requestConfig: localVarRequestOptions,
4098
+ path: localVarPath,
4099
+ configuration,
4100
+ pathTemplate: "/accounts/{accountId}/orders/all",
4101
+ httpMethod: "GET",
4102
+ operationAuth: localVarOperationAuth
4103
+ });
4104
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
4105
+ return {
4106
+ url: toPathString(localVarUrlObj),
4107
+ options: localVarRequestOptions
4108
+ };
4109
+ },
4110
+ /**
4034
4111
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
4035
4112
  * @summary Get account order detail (V2)
4036
4113
  * @param {string} accountId
@@ -4461,6 +4538,29 @@ const ExperimentalEndpointsApiFp = function(configuration) {
4461
4538
  });
4462
4539
  },
4463
4540
  /**
4541
+ * Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
4542
+ * @summary List all account orders
4543
+ * @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
4544
+ * @param {*} [options] Override http request option.
4545
+ * @throws {RequiredError}
4546
+ */
4547
+ async getAllAccountOrders(...args) {
4548
+ const [requestParameters = {}, options] = args;
4549
+ return createRequestFunction(await localVarAxiosParamCreator.getAllAccountOrders(requestParameters.accountId, requestParameters.state, requestParameters.days, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
4550
+ authModes: ["commercialApiKey", "personalApiKey"],
4551
+ requestSigningByAuthMode: {
4552
+ "commercialApiKey": {
4553
+ secretParameter: "consumerKey",
4554
+ signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
4555
+ },
4556
+ "personalApiKey": {
4557
+ secretParameter: "consumerKey",
4558
+ signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
4559
+ }
4560
+ }
4561
+ });
4562
+ },
4563
+ /**
4464
4564
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
4465
4565
  * @summary Get account order detail (V2)
4466
4566
  * @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
@@ -4616,6 +4716,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios)
4616
4716
  return localVarFp.cancelSubscription(...args).then((request) => request(axios, basePath));
4617
4717
  },
4618
4718
  /**
4719
+ * Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
4720
+ * @summary List all account orders
4721
+ * @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
4722
+ * @param {*} [options] Override http request option.
4723
+ * @throws {RequiredError}
4724
+ */
4725
+ getAllAccountOrders(...args) {
4726
+ return localVarFp.getAllAccountOrders(...args).then((request) => request(axios, basePath));
4727
+ },
4728
+ /**
4619
4729
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
4620
4730
  * @summary Get account order detail (V2)
4621
4731
  * @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
@@ -4696,6 +4806,17 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
4696
4806
  return ExperimentalEndpointsApiFp(this.configuration).cancelSubscription(...args).then((request) => request(this.axios, this.basePath));
4697
4807
  }
4698
4808
  /**
4809
+ * Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
4810
+ * @summary List all account orders
4811
+ * @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
4812
+ * @param {*} [options] Override http request option.
4813
+ * @throws {RequiredError}
4814
+ * @memberof ExperimentalEndpointsApiGenerated
4815
+ */
4816
+ getAllAccountOrders(...args) {
4817
+ return ExperimentalEndpointsApiFp(this.configuration).getAllAccountOrders(...args).then((request) => request(this.axios, this.basePath));
4818
+ }
4819
+ /**
4699
4820
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
4700
4821
  * @summary Get account order detail (V2)
4701
4822
  * @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
@@ -7883,7 +8004,7 @@ var Configuration = class {
7883
8004
  }
7884
8005
  this.basePath = param.basePath;
7885
8006
  this.baseOptions = param.baseOptions ?? {};
7886
- this.userAgent = param.userAgent === void 0 ? "Konfig/13.1.8/typescript" : param.userAgent;
8007
+ this.userAgent = param.userAgent === void 0 ? "Konfig/13.1.10/typescript" : param.userAgent;
7887
8008
  this.formDataCtor = param.formDataCtor;
7888
8009
  }
7889
8010
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snaptrade-typescript-sdk",
3
- "version": "13.1.8",
3
+ "version": "13.1.10",
4
4
  "description": "Client for SnapTrade",
5
5
  "author": "Konfig",
6
6
  "engines": {