@mlhub/models-ts-sdk 0.0.0

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.
Files changed (132) hide show
  1. package/.openapi-generator/FILES +48 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +45 -0
  5. package/dist/apis/ArtifactsApi.d.ts +37 -0
  6. package/dist/apis/ArtifactsApi.js +158 -0
  7. package/dist/apis/IngestionsApi.d.ts +37 -0
  8. package/dist/apis/IngestionsApi.js +158 -0
  9. package/dist/apis/MetadataApi.d.ts +30 -0
  10. package/dist/apis/MetadataApi.js +122 -0
  11. package/dist/apis/PlatformsApi.d.ts +74 -0
  12. package/dist/apis/PlatformsApi.js +306 -0
  13. package/dist/apis/PublicationsApi.d.ts +60 -0
  14. package/dist/apis/PublicationsApi.js +251 -0
  15. package/dist/apis/index.d.ts +5 -0
  16. package/dist/apis/index.js +12 -0
  17. package/dist/index.d.ts +3 -0
  18. package/dist/index.js +10 -0
  19. package/dist/models/Accelerator.d.ts +46 -0
  20. package/dist/models/Accelerator.js +48 -0
  21. package/dist/models/Artifact.d.ts +46 -0
  22. package/dist/models/Artifact.js +47 -0
  23. package/dist/models/ArtifactIngestion.d.ts +70 -0
  24. package/dist/models/ArtifactIngestion.js +56 -0
  25. package/dist/models/ArtifactIngestionStatus.d.ts +30 -0
  26. package/dist/models/ArtifactIngestionStatus.js +44 -0
  27. package/dist/models/ArtifactPublication.d.ts +70 -0
  28. package/dist/models/ArtifactPublication.js +56 -0
  29. package/dist/models/ArtifactPublicationStatus.d.ts +31 -0
  30. package/dist/models/ArtifactPublicationStatus.js +45 -0
  31. package/dist/models/ArtifactType.d.ts +23 -0
  32. package/dist/models/ArtifactType.js +37 -0
  33. package/dist/models/BadRequestResponse.d.ts +51 -0
  34. package/dist/models/BadRequestResponse.js +48 -0
  35. package/dist/models/CreateModelMetadataResponse.d.ts +51 -0
  36. package/dist/models/CreateModelMetadataResponse.js +48 -0
  37. package/dist/models/DiscoverModelsByPlatformResponse.d.ts +51 -0
  38. package/dist/models/DiscoverModelsByPlatformResponse.js +48 -0
  39. package/dist/models/DiscoveryCriteria.d.ts +34 -0
  40. package/dist/models/DiscoveryCriteria.js +44 -0
  41. package/dist/models/GetModelArtifactResponse.d.ts +52 -0
  42. package/dist/models/GetModelArtifactResponse.js +49 -0
  43. package/dist/models/GetModelByPlatformResponse.d.ts +51 -0
  44. package/dist/models/GetModelByPlatformResponse.js +48 -0
  45. package/dist/models/GetModelIngestionResponse.d.ts +52 -0
  46. package/dist/models/GetModelIngestionResponse.js +49 -0
  47. package/dist/models/GetModelPublicationResponse.d.ts +52 -0
  48. package/dist/models/GetModelPublicationResponse.js +49 -0
  49. package/dist/models/HardwareRequirements.d.ts +52 -0
  50. package/dist/models/HardwareRequirements.js +50 -0
  51. package/dist/models/IngestArtifactRequest.d.ts +45 -0
  52. package/dist/models/IngestArtifactRequest.js +47 -0
  53. package/dist/models/IngestModelArtifactResponse.d.ts +52 -0
  54. package/dist/models/IngestModelArtifactResponse.js +49 -0
  55. package/dist/models/ListModelArtifactResponse.d.ts +52 -0
  56. package/dist/models/ListModelArtifactResponse.js +49 -0
  57. package/dist/models/ListModelIngestionsResponse.d.ts +52 -0
  58. package/dist/models/ListModelIngestionsResponse.js +49 -0
  59. package/dist/models/ListModelPublicationsForArtifactResponse.d.ts +52 -0
  60. package/dist/models/ListModelPublicationsForArtifactResponse.js +49 -0
  61. package/dist/models/ListModelPublicationsResponse.d.ts +52 -0
  62. package/dist/models/ListModelPublicationsResponse.js +49 -0
  63. package/dist/models/ListModelsByPlatformResponse.d.ts +53 -0
  64. package/dist/models/ListModelsByPlatformResponse.js +48 -0
  65. package/dist/models/ListPlatformsResponse.d.ts +52 -0
  66. package/dist/models/ListPlatformsResponse.js +49 -0
  67. package/dist/models/ModelIO.d.ts +33 -0
  68. package/dist/models/ModelIO.js +43 -0
  69. package/dist/models/ModelMetadata.d.ts +239 -0
  70. package/dist/models/ModelMetadata.js +112 -0
  71. package/dist/models/NotFoundResponse.d.ts +51 -0
  72. package/dist/models/NotFoundResponse.js +48 -0
  73. package/dist/models/Platform.d.ts +30 -0
  74. package/dist/models/Platform.js +44 -0
  75. package/dist/models/PlatformDetails.d.ts +34 -0
  76. package/dist/models/PlatformDetails.js +43 -0
  77. package/dist/models/PublishArtifactRequest.d.ts +33 -0
  78. package/dist/models/PublishArtifactRequest.js +43 -0
  79. package/dist/models/PublishModelArtifactResponse.d.ts +52 -0
  80. package/dist/models/PublishModelArtifactResponse.js +49 -0
  81. package/dist/models/ServerErrorResponse.d.ts +51 -0
  82. package/dist/models/ServerErrorResponse.js +48 -0
  83. package/dist/models/SystemRequirement.d.ts +33 -0
  84. package/dist/models/SystemRequirement.js +42 -0
  85. package/dist/models/index.d.ts +33 -0
  86. package/dist/models/index.js +40 -0
  87. package/dist/runtime.d.ts +140 -0
  88. package/dist/runtime.js +420 -0
  89. package/package.json +15 -0
  90. package/src/apis/ArtifactsApi.ts +100 -0
  91. package/src/apis/IngestionsApi.ts +100 -0
  92. package/src/apis/MetadataApi.ts +82 -0
  93. package/src/apis/PlatformsApi.ts +246 -0
  94. package/src/apis/PublicationsApi.ts +185 -0
  95. package/src/apis/index.ts +7 -0
  96. package/src/index.ts +5 -0
  97. package/src/models/Accelerator.ts +87 -0
  98. package/src/models/Artifact.ts +87 -0
  99. package/src/models/ArtifactIngestion.ts +119 -0
  100. package/src/models/ArtifactIngestionStatus.ts +43 -0
  101. package/src/models/ArtifactPublication.ts +119 -0
  102. package/src/models/ArtifactPublicationStatus.ts +44 -0
  103. package/src/models/ArtifactType.ts +36 -0
  104. package/src/models/BadRequestResponse.ts +88 -0
  105. package/src/models/CreateModelMetadataResponse.ts +88 -0
  106. package/src/models/DiscoverModelsByPlatformResponse.ts +88 -0
  107. package/src/models/DiscoveryCriteria.ts +71 -0
  108. package/src/models/GetModelArtifactResponse.ts +95 -0
  109. package/src/models/GetModelByPlatformResponse.ts +88 -0
  110. package/src/models/GetModelIngestionResponse.ts +95 -0
  111. package/src/models/GetModelPublicationResponse.ts +95 -0
  112. package/src/models/HardwareRequirements.ts +95 -0
  113. package/src/models/IngestArtifactRequest.ts +80 -0
  114. package/src/models/IngestModelArtifactResponse.ts +95 -0
  115. package/src/models/ListModelArtifactResponse.ts +95 -0
  116. package/src/models/ListModelIngestionsResponse.ts +95 -0
  117. package/src/models/ListModelPublicationsForArtifactResponse.ts +95 -0
  118. package/src/models/ListModelPublicationsResponse.ts +95 -0
  119. package/src/models/ListModelsByPlatformResponse.ts +88 -0
  120. package/src/models/ListPlatformsResponse.ts +95 -0
  121. package/src/models/ModelIO.ts +64 -0
  122. package/src/models/ModelMetadata.ts +348 -0
  123. package/src/models/NotFoundResponse.ts +88 -0
  124. package/src/models/Platform.ts +43 -0
  125. package/src/models/PlatformDetails.ts +71 -0
  126. package/src/models/PublishArtifactRequest.ts +64 -0
  127. package/src/models/PublishModelArtifactResponse.ts +95 -0
  128. package/src/models/ServerErrorResponse.ts +88 -0
  129. package/src/models/SystemRequirement.ts +64 -0
  130. package/src/models/index.ts +35 -0
  131. package/src/runtime.ts +320 -0
  132. package/tsconfig.json +20 -0
@@ -0,0 +1,420 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * MLHub Models API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: 0.1.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 = Object.setPrototypeOf ||
17
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
18
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
19
+ return function (d, b) {
20
+ extendStatics(d, b);
21
+ function __() { this.constructor = d; }
22
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
23
+ };
24
+ })();
25
+ var __assign = (this && this.__assign) || Object.assign || function(t) {
26
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
27
+ s = arguments[i];
28
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
29
+ t[p] = s[p];
30
+ }
31
+ return t;
32
+ };
33
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
34
+ return new (P || (P = Promise))(function (resolve, reject) {
35
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
36
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
37
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
38
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
39
+ });
40
+ };
41
+ var __generator = (this && this.__generator) || function (thisArg, body) {
42
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
43
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
44
+ function verb(n) { return function (v) { return step([n, v]); }; }
45
+ function step(op) {
46
+ if (f) throw new TypeError("Generator is already executing.");
47
+ while (_) try {
48
+ 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;
49
+ if (y = 0, t) op = [op[0] & 2, t.value];
50
+ switch (op[0]) {
51
+ case 0: case 1: t = op; break;
52
+ case 4: _.label++; return { value: op[1], done: false };
53
+ case 5: _.label++; y = op[1]; op = [0]; continue;
54
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
55
+ default:
56
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
57
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
58
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
59
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
60
+ if (t[2]) _.ops.pop();
61
+ _.trys.pop(); continue;
62
+ }
63
+ op = body.call(thisArg, _);
64
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
65
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
66
+ }
67
+ };
68
+ Object.defineProperty(exports, "__esModule", { value: true });
69
+ exports.BASE_PATH = "http://localhost".replace(/\/+$/, "");
70
+ var isBlob = function (value) { return typeof Blob !== 'undefined' && value instanceof Blob; };
71
+ /**
72
+ * This is the base class for all generated API classes.
73
+ */
74
+ var BaseAPI = /** @class */ (function () {
75
+ function BaseAPI(configuration) {
76
+ if (configuration === void 0) { configuration = new Configuration(); }
77
+ var _this = this;
78
+ this.configuration = configuration;
79
+ this.fetchApi = function (url, init) { return __awaiter(_this, void 0, void 0, function () {
80
+ var fetchParams, _i, _a, middleware, response, _b, _c, middleware;
81
+ return __generator(this, function (_d) {
82
+ switch (_d.label) {
83
+ case 0:
84
+ fetchParams = { url: url, init: init };
85
+ _i = 0, _a = this.middleware;
86
+ _d.label = 1;
87
+ case 1:
88
+ if (!(_i < _a.length)) return [3 /*break*/, 4];
89
+ middleware = _a[_i];
90
+ if (!middleware.pre) return [3 /*break*/, 3];
91
+ return [4 /*yield*/, middleware.pre(__assign({ fetch: this.fetchApi }, fetchParams))];
92
+ case 2:
93
+ fetchParams = (_d.sent()) || fetchParams;
94
+ _d.label = 3;
95
+ case 3:
96
+ _i++;
97
+ return [3 /*break*/, 1];
98
+ case 4: return [4 /*yield*/, (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init)];
99
+ case 5:
100
+ response = _d.sent();
101
+ _b = 0, _c = this.middleware;
102
+ _d.label = 6;
103
+ case 6:
104
+ if (!(_b < _c.length)) return [3 /*break*/, 9];
105
+ middleware = _c[_b];
106
+ if (!middleware.post) return [3 /*break*/, 8];
107
+ return [4 /*yield*/, middleware.post({
108
+ fetch: this.fetchApi,
109
+ url: fetchParams.url,
110
+ init: fetchParams.init,
111
+ response: response.clone(),
112
+ })];
113
+ case 7:
114
+ response = (_d.sent()) || response;
115
+ _d.label = 8;
116
+ case 8:
117
+ _b++;
118
+ return [3 /*break*/, 6];
119
+ case 9: return [2 /*return*/, response];
120
+ }
121
+ });
122
+ }); };
123
+ this.middleware = configuration.middleware;
124
+ }
125
+ BaseAPI.prototype.withMiddleware = function () {
126
+ var middlewares = [];
127
+ for (var _i = 0; _i < arguments.length; _i++) {
128
+ middlewares[_i] = arguments[_i];
129
+ }
130
+ var _a;
131
+ var next = this.clone();
132
+ next.middleware = (_a = next.middleware).concat.apply(_a, middlewares);
133
+ return next;
134
+ };
135
+ BaseAPI.prototype.withPreMiddleware = function () {
136
+ var preMiddlewares = [];
137
+ for (var _i = 0; _i < arguments.length; _i++) {
138
+ preMiddlewares[_i] = arguments[_i];
139
+ }
140
+ var middlewares = preMiddlewares.map(function (pre) { return ({ pre: pre }); });
141
+ return this.withMiddleware.apply(this, middlewares);
142
+ };
143
+ BaseAPI.prototype.withPostMiddleware = function () {
144
+ var postMiddlewares = [];
145
+ for (var _i = 0; _i < arguments.length; _i++) {
146
+ postMiddlewares[_i] = arguments[_i];
147
+ }
148
+ var middlewares = postMiddlewares.map(function (post) { return ({ post: post }); });
149
+ return this.withMiddleware.apply(this, middlewares);
150
+ };
151
+ BaseAPI.prototype.request = function (context, initOverrides) {
152
+ return __awaiter(this, void 0, void 0, function () {
153
+ var _a, url, init, response;
154
+ return __generator(this, function (_b) {
155
+ switch (_b.label) {
156
+ case 0:
157
+ _a = this.createFetchParams(context, initOverrides), url = _a.url, init = _a.init;
158
+ return [4 /*yield*/, this.fetchApi(url, init)];
159
+ case 1:
160
+ response = _b.sent();
161
+ if (response.status >= 200 && response.status < 300) {
162
+ return [2 /*return*/, response];
163
+ }
164
+ throw response;
165
+ }
166
+ });
167
+ });
168
+ };
169
+ BaseAPI.prototype.createFetchParams = function (context, initOverrides) {
170
+ var url = this.configuration.basePath + context.path;
171
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
172
+ // only add the querystring to the URL if there are query parameters.
173
+ // this is done to avoid urls ending with a "?" character which buggy webservers
174
+ // do not handle correctly sometimes.
175
+ url += '?' + this.configuration.queryParamsStringify(context.query);
176
+ }
177
+ var body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
178
+ ? context.body
179
+ : JSON.stringify(context.body);
180
+ var headers = Object.assign({}, this.configuration.headers, context.headers);
181
+ var init = __assign({ method: context.method, headers: headers, body: body, credentials: this.configuration.credentials }, initOverrides);
182
+ return { url: url, init: init };
183
+ };
184
+ /**
185
+ * Create a shallow clone of `this` by constructing a new instance
186
+ * and then shallow cloning data members.
187
+ */
188
+ BaseAPI.prototype.clone = function () {
189
+ var constructor = this.constructor;
190
+ var next = new constructor(this.configuration);
191
+ next.middleware = this.middleware.slice();
192
+ return next;
193
+ };
194
+ return BaseAPI;
195
+ }());
196
+ exports.BaseAPI = BaseAPI;
197
+ ;
198
+ var RequiredError = /** @class */ (function (_super) {
199
+ __extends(RequiredError, _super);
200
+ function RequiredError(field, msg) {
201
+ var _this = _super.call(this, msg) || this;
202
+ _this.field = field;
203
+ _this.name = "RequiredError";
204
+ return _this;
205
+ }
206
+ return RequiredError;
207
+ }(Error));
208
+ exports.RequiredError = RequiredError;
209
+ exports.COLLECTION_FORMATS = {
210
+ csv: ",",
211
+ ssv: " ",
212
+ tsv: "\t",
213
+ pipes: "|",
214
+ };
215
+ var Configuration = /** @class */ (function () {
216
+ function Configuration(configuration) {
217
+ if (configuration === void 0) { configuration = {}; }
218
+ this.configuration = configuration;
219
+ }
220
+ Object.defineProperty(Configuration.prototype, "basePath", {
221
+ get: function () {
222
+ return this.configuration.basePath != null ? this.configuration.basePath : exports.BASE_PATH;
223
+ },
224
+ enumerable: true,
225
+ configurable: true
226
+ });
227
+ Object.defineProperty(Configuration.prototype, "fetchApi", {
228
+ get: function () {
229
+ return this.configuration.fetchApi;
230
+ },
231
+ enumerable: true,
232
+ configurable: true
233
+ });
234
+ Object.defineProperty(Configuration.prototype, "middleware", {
235
+ get: function () {
236
+ return this.configuration.middleware || [];
237
+ },
238
+ enumerable: true,
239
+ configurable: true
240
+ });
241
+ Object.defineProperty(Configuration.prototype, "queryParamsStringify", {
242
+ get: function () {
243
+ return this.configuration.queryParamsStringify || querystring;
244
+ },
245
+ enumerable: true,
246
+ configurable: true
247
+ });
248
+ Object.defineProperty(Configuration.prototype, "username", {
249
+ get: function () {
250
+ return this.configuration.username;
251
+ },
252
+ enumerable: true,
253
+ configurable: true
254
+ });
255
+ Object.defineProperty(Configuration.prototype, "password", {
256
+ get: function () {
257
+ return this.configuration.password;
258
+ },
259
+ enumerable: true,
260
+ configurable: true
261
+ });
262
+ Object.defineProperty(Configuration.prototype, "apiKey", {
263
+ get: function () {
264
+ var apiKey = this.configuration.apiKey;
265
+ if (apiKey) {
266
+ return typeof apiKey === 'function' ? apiKey : function () { return apiKey; };
267
+ }
268
+ return undefined;
269
+ },
270
+ enumerable: true,
271
+ configurable: true
272
+ });
273
+ Object.defineProperty(Configuration.prototype, "accessToken", {
274
+ get: function () {
275
+ var _this = this;
276
+ var accessToken = this.configuration.accessToken;
277
+ if (accessToken) {
278
+ return typeof accessToken === 'function' ? accessToken : function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
279
+ return [2 /*return*/, accessToken];
280
+ }); }); };
281
+ }
282
+ return undefined;
283
+ },
284
+ enumerable: true,
285
+ configurable: true
286
+ });
287
+ Object.defineProperty(Configuration.prototype, "headers", {
288
+ get: function () {
289
+ return this.configuration.headers;
290
+ },
291
+ enumerable: true,
292
+ configurable: true
293
+ });
294
+ Object.defineProperty(Configuration.prototype, "credentials", {
295
+ get: function () {
296
+ return this.configuration.credentials;
297
+ },
298
+ enumerable: true,
299
+ configurable: true
300
+ });
301
+ return Configuration;
302
+ }());
303
+ exports.Configuration = Configuration;
304
+ function exists(json, key) {
305
+ var value = json[key];
306
+ return value !== null && value !== undefined;
307
+ }
308
+ exports.exists = exists;
309
+ function querystring(params, prefix) {
310
+ if (prefix === void 0) { prefix = ''; }
311
+ return Object.keys(params)
312
+ .map(function (key) {
313
+ var fullKey = prefix + (prefix.length ? "[" + key + "]" : key);
314
+ var value = params[key];
315
+ if (value instanceof Array) {
316
+ var multiValue = value.map(function (singleValue) { return encodeURIComponent(String(singleValue)); })
317
+ .join("&" + encodeURIComponent(fullKey) + "=");
318
+ return encodeURIComponent(fullKey) + "=" + multiValue;
319
+ }
320
+ if (value instanceof Date) {
321
+ return encodeURIComponent(fullKey) + "=" + encodeURIComponent(value.toISOString());
322
+ }
323
+ if (value instanceof Object) {
324
+ return querystring(value, fullKey);
325
+ }
326
+ return encodeURIComponent(fullKey) + "=" + encodeURIComponent(String(value));
327
+ })
328
+ .filter(function (part) { return part.length > 0; })
329
+ .join('&');
330
+ }
331
+ exports.querystring = querystring;
332
+ function mapValues(data, fn) {
333
+ return Object.keys(data).reduce(function (acc, key) {
334
+ var _a;
335
+ return (__assign({}, acc, (_a = {}, _a[key] = fn(data[key]), _a)));
336
+ }, {});
337
+ }
338
+ exports.mapValues = mapValues;
339
+ function canConsumeForm(consumes) {
340
+ for (var _i = 0, consumes_1 = consumes; _i < consumes_1.length; _i++) {
341
+ var consume = consumes_1[_i];
342
+ if ('multipart/form-data' === consume.contentType) {
343
+ return true;
344
+ }
345
+ }
346
+ return false;
347
+ }
348
+ exports.canConsumeForm = canConsumeForm;
349
+ var JSONApiResponse = /** @class */ (function () {
350
+ function JSONApiResponse(raw, transformer) {
351
+ if (transformer === void 0) { transformer = function (jsonValue) { return jsonValue; }; }
352
+ this.raw = raw;
353
+ this.transformer = transformer;
354
+ }
355
+ JSONApiResponse.prototype.value = function () {
356
+ return __awaiter(this, void 0, void 0, function () {
357
+ var _a;
358
+ return __generator(this, function (_b) {
359
+ switch (_b.label) {
360
+ case 0:
361
+ _a = this.transformer;
362
+ return [4 /*yield*/, this.raw.json()];
363
+ case 1: return [2 /*return*/, _a.apply(this, [_b.sent()])];
364
+ }
365
+ });
366
+ });
367
+ };
368
+ return JSONApiResponse;
369
+ }());
370
+ exports.JSONApiResponse = JSONApiResponse;
371
+ var VoidApiResponse = /** @class */ (function () {
372
+ function VoidApiResponse(raw) {
373
+ this.raw = raw;
374
+ }
375
+ VoidApiResponse.prototype.value = function () {
376
+ return __awaiter(this, void 0, void 0, function () {
377
+ return __generator(this, function (_a) {
378
+ return [2 /*return*/, undefined];
379
+ });
380
+ });
381
+ };
382
+ return VoidApiResponse;
383
+ }());
384
+ exports.VoidApiResponse = VoidApiResponse;
385
+ var BlobApiResponse = /** @class */ (function () {
386
+ function BlobApiResponse(raw) {
387
+ this.raw = raw;
388
+ }
389
+ BlobApiResponse.prototype.value = function () {
390
+ return __awaiter(this, void 0, void 0, function () {
391
+ return __generator(this, function (_a) {
392
+ switch (_a.label) {
393
+ case 0: return [4 /*yield*/, this.raw.blob()];
394
+ case 1: return [2 /*return*/, _a.sent()];
395
+ }
396
+ });
397
+ });
398
+ };
399
+ ;
400
+ return BlobApiResponse;
401
+ }());
402
+ exports.BlobApiResponse = BlobApiResponse;
403
+ var TextApiResponse = /** @class */ (function () {
404
+ function TextApiResponse(raw) {
405
+ this.raw = raw;
406
+ }
407
+ TextApiResponse.prototype.value = function () {
408
+ return __awaiter(this, void 0, void 0, function () {
409
+ return __generator(this, function (_a) {
410
+ switch (_a.label) {
411
+ case 0: return [4 /*yield*/, this.raw.text()];
412
+ case 1: return [2 /*return*/, _a.sent()];
413
+ }
414
+ });
415
+ });
416
+ };
417
+ ;
418
+ return TextApiResponse;
419
+ }());
420
+ exports.TextApiResponse = TextApiResponse;
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@mlhub/models-ts-sdk",
3
+ "version": "0.0.0",
4
+ "description": "OpenAPI client for @mlhub/models-ts-sdk",
5
+ "author": "OpenAPI-Generator",
6
+ "main": "./dist/index.js",
7
+ "typings": "./dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "prepare": "npm run build"
11
+ },
12
+ "devDependencies": {
13
+ "typescript": "^2.4"
14
+ }
15
+ }
@@ -0,0 +1,100 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * MLHub Models API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import {
18
+ BadRequestResponse,
19
+ BadRequestResponseFromJSON,
20
+ BadRequestResponseToJSON,
21
+ GetModelArtifactResponse,
22
+ GetModelArtifactResponseFromJSON,
23
+ GetModelArtifactResponseToJSON,
24
+ ListModelArtifactResponse,
25
+ ListModelArtifactResponseFromJSON,
26
+ ListModelArtifactResponseToJSON,
27
+ NotFoundResponse,
28
+ NotFoundResponseFromJSON,
29
+ NotFoundResponseToJSON,
30
+ ServerErrorResponse,
31
+ ServerErrorResponseFromJSON,
32
+ ServerErrorResponseToJSON,
33
+ } from '../models';
34
+
35
+ export interface GetModelArtifactRequest {
36
+ artifactId: string;
37
+ }
38
+
39
+ /**
40
+ *
41
+ */
42
+ export class ArtifactsApi extends runtime.BaseAPI {
43
+
44
+ /**
45
+ * Fetches the model artifact by the provided id
46
+ */
47
+ async getModelArtifactRaw(requestParameters: GetModelArtifactRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<GetModelArtifactResponse>> {
48
+ if (requestParameters.artifactId === null || requestParameters.artifactId === undefined) {
49
+ throw new runtime.RequiredError('artifactId','Required parameter requestParameters.artifactId was null or undefined when calling getModelArtifact.');
50
+ }
51
+
52
+ const queryParameters: any = {};
53
+
54
+ const headerParameters: runtime.HTTPHeaders = {};
55
+
56
+ const response = await this.request({
57
+ path: `/models-api/artifacts/{artifact_id}`.replace(`{${"artifact_id"}}`, encodeURIComponent(String(requestParameters.artifactId))),
58
+ method: 'GET',
59
+ headers: headerParameters,
60
+ query: queryParameters,
61
+ }, initOverrides);
62
+
63
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetModelArtifactResponseFromJSON(jsonValue));
64
+ }
65
+
66
+ /**
67
+ * Fetches the model artifact by the provided id
68
+ */
69
+ async getModelArtifact(requestParameters: GetModelArtifactRequest, initOverrides?: RequestInit): Promise<GetModelArtifactResponse> {
70
+ const response = await this.getModelArtifactRaw(requestParameters, initOverrides);
71
+ return await response.value();
72
+ }
73
+
74
+ /**
75
+ * List all model artifacts
76
+ */
77
+ async listModelArtifactsRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListModelArtifactResponse>> {
78
+ const queryParameters: any = {};
79
+
80
+ const headerParameters: runtime.HTTPHeaders = {};
81
+
82
+ const response = await this.request({
83
+ path: `/models-api/artifacts`,
84
+ method: 'GET',
85
+ headers: headerParameters,
86
+ query: queryParameters,
87
+ }, initOverrides);
88
+
89
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListModelArtifactResponseFromJSON(jsonValue));
90
+ }
91
+
92
+ /**
93
+ * List all model artifacts
94
+ */
95
+ async listModelArtifacts(initOverrides?: RequestInit): Promise<ListModelArtifactResponse> {
96
+ const response = await this.listModelArtifactsRaw(initOverrides);
97
+ return await response.value();
98
+ }
99
+
100
+ }
@@ -0,0 +1,100 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * MLHub Models API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import {
18
+ BadRequestResponse,
19
+ BadRequestResponseFromJSON,
20
+ BadRequestResponseToJSON,
21
+ GetModelIngestionResponse,
22
+ GetModelIngestionResponseFromJSON,
23
+ GetModelIngestionResponseToJSON,
24
+ ListModelIngestionsResponse,
25
+ ListModelIngestionsResponseFromJSON,
26
+ ListModelIngestionsResponseToJSON,
27
+ NotFoundResponse,
28
+ NotFoundResponseFromJSON,
29
+ NotFoundResponseToJSON,
30
+ ServerErrorResponse,
31
+ ServerErrorResponseFromJSON,
32
+ ServerErrorResponseToJSON,
33
+ } from '../models';
34
+
35
+ export interface GetModelIngestionRequest {
36
+ ingestionId: string;
37
+ }
38
+
39
+ /**
40
+ *
41
+ */
42
+ export class IngestionsApi extends runtime.BaseAPI {
43
+
44
+ /**
45
+ * Fetch an ingestion by id
46
+ */
47
+ async getModelIngestionRaw(requestParameters: GetModelIngestionRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<GetModelIngestionResponse>> {
48
+ if (requestParameters.ingestionId === null || requestParameters.ingestionId === undefined) {
49
+ throw new runtime.RequiredError('ingestionId','Required parameter requestParameters.ingestionId was null or undefined when calling getModelIngestion.');
50
+ }
51
+
52
+ const queryParameters: any = {};
53
+
54
+ const headerParameters: runtime.HTTPHeaders = {};
55
+
56
+ const response = await this.request({
57
+ path: `/models-api/ingestions/{ingestion_id}`.replace(`{${"ingestion_id"}}`, encodeURIComponent(String(requestParameters.ingestionId))),
58
+ method: 'GET',
59
+ headers: headerParameters,
60
+ query: queryParameters,
61
+ }, initOverrides);
62
+
63
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetModelIngestionResponseFromJSON(jsonValue));
64
+ }
65
+
66
+ /**
67
+ * Fetch an ingestion by id
68
+ */
69
+ async getModelIngestion(requestParameters: GetModelIngestionRequest, initOverrides?: RequestInit): Promise<GetModelIngestionResponse> {
70
+ const response = await this.getModelIngestionRaw(requestParameters, initOverrides);
71
+ return await response.value();
72
+ }
73
+
74
+ /**
75
+ * List all model ingestions
76
+ */
77
+ async listModelIngestionsRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListModelIngestionsResponse>> {
78
+ const queryParameters: any = {};
79
+
80
+ const headerParameters: runtime.HTTPHeaders = {};
81
+
82
+ const response = await this.request({
83
+ path: `/models-api/ingestions`,
84
+ method: 'GET',
85
+ headers: headerParameters,
86
+ query: queryParameters,
87
+ }, initOverrides);
88
+
89
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListModelIngestionsResponseFromJSON(jsonValue));
90
+ }
91
+
92
+ /**
93
+ * List all model ingestions
94
+ */
95
+ async listModelIngestions(initOverrides?: RequestInit): Promise<ListModelIngestionsResponse> {
96
+ const response = await this.listModelIngestionsRaw(initOverrides);
97
+ return await response.value();
98
+ }
99
+
100
+ }