@jprogrami/mobbcadona 1.0.2
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/.openapi-generator/FILES +18 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator/openapi.yaml-generate-sdk-typescript.sha256 +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +46 -0
- package/dist/apis/AuthenticationApi.d.ts +40 -0
- package/dist/apis/AuthenticationApi.js +168 -0
- package/dist/apis/InventoriesApi.d.ts +52 -0
- package/dist/apis/InventoriesApi.js +239 -0
- package/dist/apis/ProductsApi.d.ts +110 -0
- package/dist/apis/ProductsApi.js +515 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +21 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/Inventory.d.ts +37 -0
- package/dist/models/Inventory.js +47 -0
- package/dist/models/LoginRequest.d.ts +37 -0
- package/dist/models/LoginRequest.js +47 -0
- package/dist/models/ProblemDetail.d.ts +55 -0
- package/dist/models/ProblemDetail.js +53 -0
- package/dist/models/Product.d.ts +49 -0
- package/dist/models/Product.js +55 -0
- package/dist/models/ProductDto.d.ts +43 -0
- package/dist/models/ProductDto.js +49 -0
- package/dist/models/RegisterRequest.d.ts +43 -0
- package/dist/models/RegisterRequest.js +49 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +24 -0
- package/dist/runtime.d.ts +181 -0
- package/dist/runtime.js +557 -0
- package/package.json +19 -0
- package/src/apis/AuthenticationApi.ts +114 -0
- package/src/apis/InventoriesApi.ts +170 -0
- package/src/apis/ProductsApi.ts +431 -0
- package/src/apis/index.ts +5 -0
- package/src/index.ts +5 -0
- package/src/models/Inventory.ts +68 -0
- package/src/models/LoginRequest.ts +68 -0
- package/src/models/ProblemDetail.ts +92 -0
- package/src/models/Product.ts +86 -0
- package/src/models/ProductDto.ts +76 -0
- package/src/models/RegisterRequest.ts +76 -0
- package/src/models/index.ts +8 -0
- package/src/runtime.ts +426 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.gitignore
|
|
2
|
+
.npmignore
|
|
3
|
+
README.md
|
|
4
|
+
package.json
|
|
5
|
+
src/apis/AuthenticationApi.ts
|
|
6
|
+
src/apis/InventoriesApi.ts
|
|
7
|
+
src/apis/ProductsApi.ts
|
|
8
|
+
src/apis/index.ts
|
|
9
|
+
src/index.ts
|
|
10
|
+
src/models/Inventory.ts
|
|
11
|
+
src/models/LoginRequest.ts
|
|
12
|
+
src/models/ProblemDetail.ts
|
|
13
|
+
src/models/Product.ts
|
|
14
|
+
src/models/ProductDto.ts
|
|
15
|
+
src/models/RegisterRequest.ts
|
|
16
|
+
src/models/index.ts
|
|
17
|
+
src/runtime.ts
|
|
18
|
+
tsconfig.json
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7.4.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
634bfb6836f2454007578ae81edf76ab9f8c6e9fb508dada37f1bb4332b8176f
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# OpenAPI Generator Ignore
|
|
2
|
+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
+
|
|
4
|
+
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
+
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
+
|
|
7
|
+
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
+
#ApiClient.cs
|
|
10
|
+
|
|
11
|
+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
+
#foo/*/qux
|
|
13
|
+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
+
|
|
15
|
+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
+
#foo/**/qux
|
|
17
|
+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
+
|
|
19
|
+
# You can also negate patterns with an exclamation (!).
|
|
20
|
+
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
+
#docs/*.md
|
|
22
|
+
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
+
#!docs/README.md
|
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
## @jprogrami/mobbcadona@1.0.0
|
|
2
|
+
|
|
3
|
+
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
|
+
|
|
5
|
+
Environment
|
|
6
|
+
* Node.js
|
|
7
|
+
* Webpack
|
|
8
|
+
* Browserify
|
|
9
|
+
|
|
10
|
+
Language level
|
|
11
|
+
* ES5 - you must have a Promises/A+ library installed
|
|
12
|
+
* ES6
|
|
13
|
+
|
|
14
|
+
Module system
|
|
15
|
+
* CommonJS
|
|
16
|
+
* ES6 module system
|
|
17
|
+
|
|
18
|
+
It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html))
|
|
19
|
+
|
|
20
|
+
### Building
|
|
21
|
+
|
|
22
|
+
To build and compile the typescript sources to javascript use:
|
|
23
|
+
```
|
|
24
|
+
npm install
|
|
25
|
+
npm run build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Publishing
|
|
29
|
+
|
|
30
|
+
First build the package then run `npm publish`
|
|
31
|
+
|
|
32
|
+
### Consuming
|
|
33
|
+
|
|
34
|
+
navigate to the folder of your consuming project and run one of the following commands.
|
|
35
|
+
|
|
36
|
+
_published:_
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
npm install @jprogrami/mobbcadona@1.0.0 --save
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
_unPublished (not recommended):_
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
npm install PATH_TO_GENERATED_PACKAGE --save
|
|
46
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inventory Management API
|
|
3
|
+
* RESTful API for inventory and product management, secured with JWT.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { LoginRequest, RegisterRequest } from '../models/index';
|
|
14
|
+
export interface AuthLoginPostRequest {
|
|
15
|
+
loginRequest: LoginRequest;
|
|
16
|
+
}
|
|
17
|
+
export interface AuthRegisterPostRequest {
|
|
18
|
+
registerRequest: RegisterRequest;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export declare class AuthenticationApi extends runtime.BaseAPI {
|
|
24
|
+
/**
|
|
25
|
+
* User login
|
|
26
|
+
*/
|
|
27
|
+
authLoginPostRaw(requestParameters: AuthLoginPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
28
|
+
/**
|
|
29
|
+
* User login
|
|
30
|
+
*/
|
|
31
|
+
authLoginPost(requestParameters: AuthLoginPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* User registration
|
|
34
|
+
*/
|
|
35
|
+
authRegisterPostRaw(requestParameters: AuthRegisterPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
36
|
+
/**
|
|
37
|
+
* User registration
|
|
38
|
+
*/
|
|
39
|
+
authRegisterPost(requestParameters: AuthRegisterPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Inventory Management API
|
|
6
|
+
* RESTful API for inventory and product management, secured with JWT.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __extends = (this && this.__extends) || (function () {
|
|
16
|
+
var extendStatics = function (d, b) {
|
|
17
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
+
extendStatics(d, b);
|
|
26
|
+
function __() { this.constructor = d; }
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
40
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
41
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
42
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
43
|
+
function step(op) {
|
|
44
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
45
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
46
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
47
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48
|
+
switch (op[0]) {
|
|
49
|
+
case 0: case 1: t = op; break;
|
|
50
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
51
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
52
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
53
|
+
default:
|
|
54
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
55
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
56
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
57
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58
|
+
if (t[2]) _.ops.pop();
|
|
59
|
+
_.trys.pop(); continue;
|
|
60
|
+
}
|
|
61
|
+
op = body.call(thisArg, _);
|
|
62
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
63
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
+
exports.AuthenticationApi = void 0;
|
|
68
|
+
var runtime = require("../runtime");
|
|
69
|
+
var index_1 = require("../models/index");
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
var AuthenticationApi = /** @class */ (function (_super) {
|
|
74
|
+
__extends(AuthenticationApi, _super);
|
|
75
|
+
function AuthenticationApi() {
|
|
76
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* User login
|
|
80
|
+
*/
|
|
81
|
+
AuthenticationApi.prototype.authLoginPostRaw = function (requestParameters, initOverrides) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var queryParameters, headerParameters, response;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
switch (_a.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
if (requestParameters['loginRequest'] == null) {
|
|
88
|
+
throw new runtime.RequiredError('loginRequest', 'Required parameter "loginRequest" was null or undefined when calling authLoginPost().');
|
|
89
|
+
}
|
|
90
|
+
queryParameters = {};
|
|
91
|
+
headerParameters = {};
|
|
92
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
93
|
+
return [4 /*yield*/, this.request({
|
|
94
|
+
path: "/auth/login",
|
|
95
|
+
method: 'POST',
|
|
96
|
+
headers: headerParameters,
|
|
97
|
+
query: queryParameters,
|
|
98
|
+
body: (0, index_1.LoginRequestToJSON)(requestParameters['loginRequest']),
|
|
99
|
+
}, initOverrides)];
|
|
100
|
+
case 1:
|
|
101
|
+
response = _a.sent();
|
|
102
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* User login
|
|
109
|
+
*/
|
|
110
|
+
AuthenticationApi.prototype.authLoginPost = function (requestParameters, initOverrides) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
+
return __generator(this, function (_a) {
|
|
113
|
+
switch (_a.label) {
|
|
114
|
+
case 0: return [4 /*yield*/, this.authLoginPostRaw(requestParameters, initOverrides)];
|
|
115
|
+
case 1:
|
|
116
|
+
_a.sent();
|
|
117
|
+
return [2 /*return*/];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* User registration
|
|
124
|
+
*/
|
|
125
|
+
AuthenticationApi.prototype.authRegisterPostRaw = function (requestParameters, initOverrides) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
127
|
+
var queryParameters, headerParameters, response;
|
|
128
|
+
return __generator(this, function (_a) {
|
|
129
|
+
switch (_a.label) {
|
|
130
|
+
case 0:
|
|
131
|
+
if (requestParameters['registerRequest'] == null) {
|
|
132
|
+
throw new runtime.RequiredError('registerRequest', 'Required parameter "registerRequest" was null or undefined when calling authRegisterPost().');
|
|
133
|
+
}
|
|
134
|
+
queryParameters = {};
|
|
135
|
+
headerParameters = {};
|
|
136
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
137
|
+
return [4 /*yield*/, this.request({
|
|
138
|
+
path: "/auth/register",
|
|
139
|
+
method: 'POST',
|
|
140
|
+
headers: headerParameters,
|
|
141
|
+
query: queryParameters,
|
|
142
|
+
body: (0, index_1.RegisterRequestToJSON)(requestParameters['registerRequest']),
|
|
143
|
+
}, initOverrides)];
|
|
144
|
+
case 1:
|
|
145
|
+
response = _a.sent();
|
|
146
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* User registration
|
|
153
|
+
*/
|
|
154
|
+
AuthenticationApi.prototype.authRegisterPost = function (requestParameters, initOverrides) {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
156
|
+
return __generator(this, function (_a) {
|
|
157
|
+
switch (_a.label) {
|
|
158
|
+
case 0: return [4 /*yield*/, this.authRegisterPostRaw(requestParameters, initOverrides)];
|
|
159
|
+
case 1:
|
|
160
|
+
_a.sent();
|
|
161
|
+
return [2 /*return*/];
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
return AuthenticationApi;
|
|
167
|
+
}(runtime.BaseAPI));
|
|
168
|
+
exports.AuthenticationApi = AuthenticationApi;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inventory Management API
|
|
3
|
+
* RESTful API for inventory and product management, secured with JWT.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { Inventory } from '../models/index';
|
|
14
|
+
export interface ApiInvIdDeleteRequest {
|
|
15
|
+
id: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ApiInvPaginatedGetRequest {
|
|
18
|
+
page?: number;
|
|
19
|
+
size?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ApiInvPostRequest {
|
|
22
|
+
inventory: Inventory;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export declare class InventoriesApi extends runtime.BaseAPI {
|
|
28
|
+
/**
|
|
29
|
+
* Delete inventory
|
|
30
|
+
*/
|
|
31
|
+
apiInvIdDeleteRaw(requestParameters: ApiInvIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
32
|
+
/**
|
|
33
|
+
* Delete inventory
|
|
34
|
+
*/
|
|
35
|
+
apiInvIdDelete(requestParameters: ApiInvIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* List inventories (Paginated)
|
|
38
|
+
*/
|
|
39
|
+
apiInvPaginatedGetRaw(requestParameters: ApiInvPaginatedGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
40
|
+
/**
|
|
41
|
+
* List inventories (Paginated)
|
|
42
|
+
*/
|
|
43
|
+
apiInvPaginatedGet(requestParameters?: ApiInvPaginatedGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Create inventory
|
|
46
|
+
*/
|
|
47
|
+
apiInvPostRaw(requestParameters: ApiInvPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
48
|
+
/**
|
|
49
|
+
* Create inventory
|
|
50
|
+
*/
|
|
51
|
+
apiInvPost(requestParameters: ApiInvPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Inventory Management API
|
|
6
|
+
* RESTful API for inventory and product management, secured with JWT.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __extends = (this && this.__extends) || (function () {
|
|
16
|
+
var extendStatics = function (d, b) {
|
|
17
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
+
extendStatics(d, b);
|
|
26
|
+
function __() { this.constructor = d; }
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
40
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
41
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
42
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
43
|
+
function step(op) {
|
|
44
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
45
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
46
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
47
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48
|
+
switch (op[0]) {
|
|
49
|
+
case 0: case 1: t = op; break;
|
|
50
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
51
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
52
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
53
|
+
default:
|
|
54
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
55
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
56
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
57
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58
|
+
if (t[2]) _.ops.pop();
|
|
59
|
+
_.trys.pop(); continue;
|
|
60
|
+
}
|
|
61
|
+
op = body.call(thisArg, _);
|
|
62
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
63
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
+
exports.InventoriesApi = void 0;
|
|
68
|
+
var runtime = require("../runtime");
|
|
69
|
+
var index_1 = require("../models/index");
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
var InventoriesApi = /** @class */ (function (_super) {
|
|
74
|
+
__extends(InventoriesApi, _super);
|
|
75
|
+
function InventoriesApi() {
|
|
76
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Delete inventory
|
|
80
|
+
*/
|
|
81
|
+
InventoriesApi.prototype.apiInvIdDeleteRaw = function (requestParameters, initOverrides) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var queryParameters, headerParameters, token, tokenString, response;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
switch (_a.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
if (requestParameters['id'] == null) {
|
|
88
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling apiInvIdDelete().');
|
|
89
|
+
}
|
|
90
|
+
queryParameters = {};
|
|
91
|
+
headerParameters = {};
|
|
92
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
93
|
+
token = this.configuration.accessToken;
|
|
94
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
95
|
+
case 1:
|
|
96
|
+
tokenString = _a.sent();
|
|
97
|
+
if (tokenString) {
|
|
98
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
99
|
+
}
|
|
100
|
+
_a.label = 2;
|
|
101
|
+
case 2: return [4 /*yield*/, this.request({
|
|
102
|
+
path: "/api/inv/{id}".replace("{".concat("id", "}"), encodeURIComponent(String(requestParameters['id']))),
|
|
103
|
+
method: 'DELETE',
|
|
104
|
+
headers: headerParameters,
|
|
105
|
+
query: queryParameters,
|
|
106
|
+
}, initOverrides)];
|
|
107
|
+
case 3:
|
|
108
|
+
response = _a.sent();
|
|
109
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Delete inventory
|
|
116
|
+
*/
|
|
117
|
+
InventoriesApi.prototype.apiInvIdDelete = function (requestParameters, initOverrides) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
+
return __generator(this, function (_a) {
|
|
120
|
+
switch (_a.label) {
|
|
121
|
+
case 0: return [4 /*yield*/, this.apiInvIdDeleteRaw(requestParameters, initOverrides)];
|
|
122
|
+
case 1:
|
|
123
|
+
_a.sent();
|
|
124
|
+
return [2 /*return*/];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* List inventories (Paginated)
|
|
131
|
+
*/
|
|
132
|
+
InventoriesApi.prototype.apiInvPaginatedGetRaw = function (requestParameters, initOverrides) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
var queryParameters, headerParameters, token, tokenString, response;
|
|
135
|
+
return __generator(this, function (_a) {
|
|
136
|
+
switch (_a.label) {
|
|
137
|
+
case 0:
|
|
138
|
+
queryParameters = {};
|
|
139
|
+
if (requestParameters['page'] != null) {
|
|
140
|
+
queryParameters['page'] = requestParameters['page'];
|
|
141
|
+
}
|
|
142
|
+
if (requestParameters['size'] != null) {
|
|
143
|
+
queryParameters['size'] = requestParameters['size'];
|
|
144
|
+
}
|
|
145
|
+
headerParameters = {};
|
|
146
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
147
|
+
token = this.configuration.accessToken;
|
|
148
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
149
|
+
case 1:
|
|
150
|
+
tokenString = _a.sent();
|
|
151
|
+
if (tokenString) {
|
|
152
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
153
|
+
}
|
|
154
|
+
_a.label = 2;
|
|
155
|
+
case 2: return [4 /*yield*/, this.request({
|
|
156
|
+
path: "/api/inv/paginated",
|
|
157
|
+
method: 'GET',
|
|
158
|
+
headers: headerParameters,
|
|
159
|
+
query: queryParameters,
|
|
160
|
+
}, initOverrides)];
|
|
161
|
+
case 3:
|
|
162
|
+
response = _a.sent();
|
|
163
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* List inventories (Paginated)
|
|
170
|
+
*/
|
|
171
|
+
InventoriesApi.prototype.apiInvPaginatedGet = function (requestParameters, initOverrides) {
|
|
172
|
+
if (requestParameters === void 0) { requestParameters = {}; }
|
|
173
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
174
|
+
return __generator(this, function (_a) {
|
|
175
|
+
switch (_a.label) {
|
|
176
|
+
case 0: return [4 /*yield*/, this.apiInvPaginatedGetRaw(requestParameters, initOverrides)];
|
|
177
|
+
case 1:
|
|
178
|
+
_a.sent();
|
|
179
|
+
return [2 /*return*/];
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Create inventory
|
|
186
|
+
*/
|
|
187
|
+
InventoriesApi.prototype.apiInvPostRaw = function (requestParameters, initOverrides) {
|
|
188
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
189
|
+
var queryParameters, headerParameters, token, tokenString, response;
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
192
|
+
case 0:
|
|
193
|
+
if (requestParameters['inventory'] == null) {
|
|
194
|
+
throw new runtime.RequiredError('inventory', 'Required parameter "inventory" was null or undefined when calling apiInvPost().');
|
|
195
|
+
}
|
|
196
|
+
queryParameters = {};
|
|
197
|
+
headerParameters = {};
|
|
198
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
199
|
+
if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
|
|
200
|
+
token = this.configuration.accessToken;
|
|
201
|
+
return [4 /*yield*/, token("bearerAuth", [])];
|
|
202
|
+
case 1:
|
|
203
|
+
tokenString = _a.sent();
|
|
204
|
+
if (tokenString) {
|
|
205
|
+
headerParameters["Authorization"] = "Bearer ".concat(tokenString);
|
|
206
|
+
}
|
|
207
|
+
_a.label = 2;
|
|
208
|
+
case 2: return [4 /*yield*/, this.request({
|
|
209
|
+
path: "/api/inv",
|
|
210
|
+
method: 'POST',
|
|
211
|
+
headers: headerParameters,
|
|
212
|
+
query: queryParameters,
|
|
213
|
+
body: (0, index_1.InventoryToJSON)(requestParameters['inventory']),
|
|
214
|
+
}, initOverrides)];
|
|
215
|
+
case 3:
|
|
216
|
+
response = _a.sent();
|
|
217
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Create inventory
|
|
224
|
+
*/
|
|
225
|
+
InventoriesApi.prototype.apiInvPost = function (requestParameters, initOverrides) {
|
|
226
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
227
|
+
return __generator(this, function (_a) {
|
|
228
|
+
switch (_a.label) {
|
|
229
|
+
case 0: return [4 /*yield*/, this.apiInvPostRaw(requestParameters, initOverrides)];
|
|
230
|
+
case 1:
|
|
231
|
+
_a.sent();
|
|
232
|
+
return [2 /*return*/];
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
return InventoriesApi;
|
|
238
|
+
}(runtime.BaseAPI));
|
|
239
|
+
exports.InventoriesApi = InventoriesApi;
|