@tradecafe/offer-service-sdk 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
- .gitignore
2
- .openapi-generator-ignore
3
- api.ts
4
- api/apis.ts
5
- api/healthApi.ts
6
- api/matchedOffersApi.ts
7
- api/offersApi.ts
8
- git_push.sh
9
- model/healthControllerPing200Response.ts
10
- model/healthControllerPing200ResponseInfoValue.ts
11
- model/healthControllerPing503Response.ts
12
- model/models.ts
13
- package.json
14
- tsconfig.json
1
+ .gitignore
2
+ .openapi-generator-ignore
3
+ api.ts
4
+ api/apis.ts
5
+ api/healthApi.ts
6
+ api/matchedOffersApi.ts
7
+ api/offersApi.ts
8
+ git_push.sh
9
+ model/healthControllerPing200Response.ts
10
+ model/healthControllerPing200ResponseInfoValue.ts
11
+ model/healthControllerPing503Response.ts
12
+ model/models.ts
13
+ package.json
14
+ tsconfig.json
@@ -736,6 +736,74 @@ export class MatchedOffersApi {
736
736
  });
737
737
  });
738
738
  }
739
+ /**
740
+ *
741
+ * @summary Reopens the matched offer with the provided ID and its associated supplier offer
742
+ * @param id
743
+ * @param account
744
+ */
745
+ public async matchedOffersControllerReopen (id: string, account: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
746
+ const localVarPath = this.basePath + '/matched-offers/{account}/{id}/reopen'
747
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)))
748
+ .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
749
+ let localVarQueryParameters: any = {};
750
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
751
+ let localVarFormParams: any = {};
752
+
753
+ // verify required parameter 'id' is not null or undefined
754
+ if (id === null || id === undefined) {
755
+ throw new Error('Required parameter id was null or undefined when calling matchedOffersControllerReopen.');
756
+ }
757
+
758
+ // verify required parameter 'account' is not null or undefined
759
+ if (account === null || account === undefined) {
760
+ throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerReopen.');
761
+ }
762
+
763
+ (<any>Object).assign(localVarHeaderParams, options.headers);
764
+
765
+ let localVarUseFormData = false;
766
+
767
+ let localVarRequestOptions: localVarRequest.Options = {
768
+ method: 'POST',
769
+ qs: localVarQueryParameters,
770
+ headers: localVarHeaderParams,
771
+ uri: localVarPath,
772
+ useQuerystring: this._useQuerystring,
773
+ json: true,
774
+ };
775
+
776
+ let authenticationPromise = Promise.resolve();
777
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
778
+
779
+ let interceptorPromise = authenticationPromise;
780
+ for (const interceptor of this.interceptors) {
781
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
782
+ }
783
+
784
+ return interceptorPromise.then(() => {
785
+ if (Object.keys(localVarFormParams).length) {
786
+ if (localVarUseFormData) {
787
+ (<any>localVarRequestOptions).formData = localVarFormParams;
788
+ } else {
789
+ localVarRequestOptions.form = localVarFormParams;
790
+ }
791
+ }
792
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
793
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
794
+ if (error) {
795
+ reject(error);
796
+ } else {
797
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
798
+ resolve({ response: response, body: body });
799
+ } else {
800
+ reject(new HttpError(response, body, response.statusCode));
801
+ }
802
+ }
803
+ });
804
+ });
805
+ });
806
+ }
739
807
  /**
740
808
  *
741
809
  * @summary Set confirmation index for the matched offer with the provided ID
@@ -815,8 +883,9 @@ export class MatchedOffersApi {
815
883
  *
816
884
  * @summary Returns total amount of matched offers in the DB
817
885
  * @param account
886
+ * @param body
818
887
  */
819
- public async matchedOffersControllerTotal (account: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
888
+ public async matchedOffersControllerTotal (account: string, body: object, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
820
889
  const localVarPath = this.basePath + '/matched-offers/{account}/total'
821
890
  .replace('{' + 'account' + '}', encodeURIComponent(String(account)));
822
891
  let localVarQueryParameters: any = {};
@@ -828,6 +897,11 @@ export class MatchedOffersApi {
828
897
  throw new Error('Required parameter account was null or undefined when calling matchedOffersControllerTotal.');
829
898
  }
830
899
 
900
+ // verify required parameter 'body' is not null or undefined
901
+ if (body === null || body === undefined) {
902
+ throw new Error('Required parameter body was null or undefined when calling matchedOffersControllerTotal.');
903
+ }
904
+
831
905
  (<any>Object).assign(localVarHeaderParams, options.headers);
832
906
 
833
907
  let localVarUseFormData = false;
@@ -839,6 +913,7 @@ export class MatchedOffersApi {
839
913
  uri: localVarPath,
840
914
  useQuerystring: this._useQuerystring,
841
915
  json: true,
916
+ body: ObjectSerializer.serialize(body, "object")
842
917
  };
843
918
 
844
919
  let authenticationPromise = Promise.resolve();
@@ -1,16 +1,16 @@
1
- /// <reference types="node" />
2
- export * from './healthApi';
3
- import { HealthApi } from './healthApi';
4
- export * from './matchedOffersApi';
5
- import { MatchedOffersApi } from './matchedOffersApi';
6
- export * from './offersApi';
7
- import { OffersApi } from './offersApi';
8
- import * as http from 'http';
9
- export declare class HttpError extends Error {
10
- response: http.IncomingMessage;
11
- body: any;
12
- statusCode?: number | undefined;
13
- constructor(response: http.IncomingMessage, body: any, statusCode?: number | undefined);
14
- }
15
- export { RequestFile } from '../model/models';
16
- export declare const APIS: (typeof HealthApi | typeof MatchedOffersApi | typeof OffersApi)[];
1
+ /// <reference types="node" />
2
+ export * from './healthApi';
3
+ import { HealthApi } from './healthApi';
4
+ export * from './matchedOffersApi';
5
+ import { MatchedOffersApi } from './matchedOffersApi';
6
+ export * from './offersApi';
7
+ import { OffersApi } from './offersApi';
8
+ import * as http from 'http';
9
+ export declare class HttpError extends Error {
10
+ response: http.IncomingMessage;
11
+ body: any;
12
+ statusCode?: number | undefined;
13
+ constructor(response: http.IncomingMessage, body: any, statusCode?: number | undefined);
14
+ }
15
+ export { RequestFile } from '../model/models';
16
+ export declare const APIS: (typeof HealthApi | typeof MatchedOffersApi | typeof OffersApi)[];
package/dist/api/apis.js CHANGED
@@ -1,53 +1,53 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- var desc = Object.getOwnPropertyDescriptor(m, k);
20
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
- desc = { enumerable: true, get: function() { return m[k]; } };
22
- }
23
- Object.defineProperty(o, k2, desc);
24
- }) : (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- o[k2] = m[k];
27
- }));
28
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.APIS = exports.HttpError = void 0;
33
- __exportStar(require("./healthApi"), exports);
34
- var healthApi_1 = require("./healthApi");
35
- __exportStar(require("./matchedOffersApi"), exports);
36
- var matchedOffersApi_1 = require("./matchedOffersApi");
37
- __exportStar(require("./offersApi"), exports);
38
- var offersApi_1 = require("./offersApi");
39
- var HttpError = (function (_super) {
40
- __extends(HttpError, _super);
41
- function HttpError(response, body, statusCode) {
42
- var _this = _super.call(this, 'HTTP request failed') || this;
43
- _this.response = response;
44
- _this.body = body;
45
- _this.statusCode = statusCode;
46
- _this.name = 'HttpError';
47
- return _this;
48
- }
49
- return HttpError;
50
- }(Error));
51
- exports.HttpError = HttpError;
52
- exports.APIS = [healthApi_1.HealthApi, matchedOffersApi_1.MatchedOffersApi, offersApi_1.OffersApi];
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.APIS = exports.HttpError = void 0;
33
+ __exportStar(require("./healthApi"), exports);
34
+ var healthApi_1 = require("./healthApi");
35
+ __exportStar(require("./matchedOffersApi"), exports);
36
+ var matchedOffersApi_1 = require("./matchedOffersApi");
37
+ __exportStar(require("./offersApi"), exports);
38
+ var offersApi_1 = require("./offersApi");
39
+ var HttpError = (function (_super) {
40
+ __extends(HttpError, _super);
41
+ function HttpError(response, body, statusCode) {
42
+ var _this = _super.call(this, 'HTTP request failed') || this;
43
+ _this.response = response;
44
+ _this.body = body;
45
+ _this.statusCode = statusCode;
46
+ _this.name = 'HttpError';
47
+ return _this;
48
+ }
49
+ return HttpError;
50
+ }(Error));
51
+ exports.HttpError = HttpError;
52
+ exports.APIS = [healthApi_1.HealthApi, matchedOffersApi_1.MatchedOffersApi, offersApi_1.OffersApi];
53
53
  //# sourceMappingURL=apis.js.map
@@ -1,32 +1,32 @@
1
- /// <reference types="node" />
2
- import http from 'http';
3
- import { HealthControllerPing200Response } from '../model/healthControllerPing200Response';
4
- import { Authentication, Interceptor } from '../model/models';
5
- export declare enum HealthApiApiKeys {
6
- }
7
- export declare class HealthApi {
8
- protected _basePath: string;
9
- protected _defaultHeaders: any;
10
- protected _useQuerystring: boolean;
11
- protected authentications: {
12
- default: Authentication;
13
- };
14
- protected interceptors: Interceptor[];
15
- constructor(basePath?: string);
16
- set useQuerystring(value: boolean);
17
- set basePath(basePath: string);
18
- set defaultHeaders(defaultHeaders: any);
19
- get defaultHeaders(): any;
20
- get basePath(): string;
21
- setDefaultAuthentication(auth: Authentication): void;
22
- setApiKey(key: HealthApiApiKeys, value: string): void;
23
- addInterceptor(interceptor: Interceptor): void;
24
- healthControllerPing(options?: {
25
- headers: {
26
- [name: string]: string;
27
- };
28
- }): Promise<{
29
- response: http.IncomingMessage;
30
- body: HealthControllerPing200Response;
31
- }>;
32
- }
1
+ /// <reference types="node" />
2
+ import http from 'http';
3
+ import { HealthControllerPing200Response } from '../model/healthControllerPing200Response';
4
+ import { Authentication, Interceptor } from '../model/models';
5
+ export declare enum HealthApiApiKeys {
6
+ }
7
+ export declare class HealthApi {
8
+ protected _basePath: string;
9
+ protected _defaultHeaders: any;
10
+ protected _useQuerystring: boolean;
11
+ protected authentications: {
12
+ default: Authentication;
13
+ };
14
+ protected interceptors: Interceptor[];
15
+ constructor(basePath?: string);
16
+ set useQuerystring(value: boolean);
17
+ set basePath(basePath: string);
18
+ set defaultHeaders(defaultHeaders: any);
19
+ get defaultHeaders(): any;
20
+ get basePath(): string;
21
+ setDefaultAuthentication(auth: Authentication): void;
22
+ setApiKey(key: HealthApiApiKeys, value: string): void;
23
+ addInterceptor(interceptor: Interceptor): void;
24
+ healthControllerPing(options?: {
25
+ headers: {
26
+ [name: string]: string;
27
+ };
28
+ }): Promise<{
29
+ response: http.IncomingMessage;
30
+ body: HealthControllerPing200Response;
31
+ }>;
32
+ }