@leonardo-ai/sdk 1.1.1

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 (81) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +17 -0
  5. package/dist/internal/utils/contenttype.d.ts +1 -0
  6. package/dist/internal/utils/contenttype.js +30 -0
  7. package/dist/internal/utils/headers.d.ts +4 -0
  8. package/dist/internal/utils/headers.js +85 -0
  9. package/dist/internal/utils/index.d.ts +8 -0
  10. package/dist/internal/utils/index.js +24 -0
  11. package/dist/internal/utils/pathparams.d.ts +9 -0
  12. package/dist/internal/utils/pathparams.js +58 -0
  13. package/dist/internal/utils/queryparams.d.ts +3 -0
  14. package/dist/internal/utils/queryparams.js +104 -0
  15. package/dist/internal/utils/requestbody.d.ts +1 -0
  16. package/dist/internal/utils/requestbody.js +266 -0
  17. package/dist/internal/utils/retries.d.ts +20 -0
  18. package/dist/internal/utils/retries.js +223 -0
  19. package/dist/internal/utils/security.d.ts +2 -0
  20. package/dist/internal/utils/security.js +156 -0
  21. package/dist/internal/utils/utils.d.ts +19 -0
  22. package/dist/internal/utils/utils.js +202 -0
  23. package/dist/sdk/creatingdatasets.d.ts +41 -0
  24. package/dist/sdk/creatingdatasets.js +235 -0
  25. package/dist/sdk/generatingimages.d.ts +35 -0
  26. package/dist/sdk/generatingimages.js +182 -0
  27. package/dist/sdk/imagevariations.d.ts +23 -0
  28. package/dist/sdk/imagevariations.js +120 -0
  29. package/dist/sdk/index.d.ts +1 -0
  30. package/dist/sdk/index.js +17 -0
  31. package/dist/sdk/initimages.d.ts +29 -0
  32. package/dist/sdk/initimages.js +151 -0
  33. package/dist/sdk/models/operations/deletedatasetsid.d.ts +12 -0
  34. package/dist/sdk/models/operations/deletedatasetsid.js +72 -0
  35. package/dist/sdk/models/operations/deletegenerationsid.d.ts +12 -0
  36. package/dist/sdk/models/operations/deletegenerationsid.js +72 -0
  37. package/dist/sdk/models/operations/deleteinitimageid.d.ts +12 -0
  38. package/dist/sdk/models/operations/deleteinitimageid.js +72 -0
  39. package/dist/sdk/models/operations/deletemodelsid.d.ts +12 -0
  40. package/dist/sdk/models/operations/deletemodelsid.js +72 -0
  41. package/dist/sdk/models/operations/getdatasetsid.d.ts +12 -0
  42. package/dist/sdk/models/operations/getdatasetsid.js +72 -0
  43. package/dist/sdk/models/operations/getgenerationsid.d.ts +12 -0
  44. package/dist/sdk/models/operations/getgenerationsid.js +72 -0
  45. package/dist/sdk/models/operations/getgenerationsuseruserid.d.ts +17 -0
  46. package/dist/sdk/models/operations/getgenerationsuseruserid.js +92 -0
  47. package/dist/sdk/models/operations/getinitimageid.d.ts +12 -0
  48. package/dist/sdk/models/operations/getinitimageid.js +72 -0
  49. package/dist/sdk/models/operations/getme.d.ts +6 -0
  50. package/dist/sdk/models/operations/getme.js +48 -0
  51. package/dist/sdk/models/operations/getmodelsid.d.ts +12 -0
  52. package/dist/sdk/models/operations/getmodelsid.js +72 -0
  53. package/dist/sdk/models/operations/getvariationsid.d.ts +12 -0
  54. package/dist/sdk/models/operations/getvariationsid.js +72 -0
  55. package/dist/sdk/models/operations/index.d.ts +18 -0
  56. package/dist/sdk/models/operations/index.js +34 -0
  57. package/dist/sdk/models/operations/postdatasets.d.ts +13 -0
  58. package/dist/sdk/models/operations/postdatasets.js +76 -0
  59. package/dist/sdk/models/operations/postdatasetsdatasetidupload.d.ts +16 -0
  60. package/dist/sdk/models/operations/postdatasetsdatasetidupload.js +88 -0
  61. package/dist/sdk/models/operations/postdatasetsdatasetiduploadgen.d.ts +16 -0
  62. package/dist/sdk/models/operations/postdatasetsdatasetiduploadgen.js +88 -0
  63. package/dist/sdk/models/operations/postgenerations.d.ts +27 -0
  64. package/dist/sdk/models/operations/postgenerations.js +132 -0
  65. package/dist/sdk/models/operations/postinitimage.d.ts +12 -0
  66. package/dist/sdk/models/operations/postinitimage.js +72 -0
  67. package/dist/sdk/models/operations/postmodels.d.ts +20 -0
  68. package/dist/sdk/models/operations/postmodels.js +104 -0
  69. package/dist/sdk/models/operations/postvariationsupscale.d.ts +12 -0
  70. package/dist/sdk/models/operations/postvariationsupscale.js +72 -0
  71. package/dist/sdk/models/shared/index.d.ts +1 -0
  72. package/dist/sdk/models/shared/index.js +17 -0
  73. package/dist/sdk/models/shared/security.d.ts +7 -0
  74. package/dist/sdk/models/shared/security.js +52 -0
  75. package/dist/sdk/sdk.d.ts +29 -0
  76. package/dist/sdk/sdk.js +68 -0
  77. package/dist/sdk/trainingmodels.d.ts +29 -0
  78. package/dist/sdk/trainingmodels.js +151 -0
  79. package/dist/sdk/userinformation.d.ts +17 -0
  80. package/dist/sdk/userinformation.js +76 -0
  81. package/package.json +41 -0
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.GeneratingImages = void 0;
38
+ var utils = __importStar(require("../internal/utils"));
39
+ var operations = __importStar(require("./models/operations"));
40
+ var GeneratingImages = /** @class */ (function () {
41
+ function GeneratingImages(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
42
+ this._defaultClient = defaultClient;
43
+ this._securityClient = securityClient;
44
+ this._serverURL = serverURL;
45
+ this._language = language;
46
+ this._sdkVersion = sdkVersion;
47
+ this._genVersion = genVersion;
48
+ }
49
+ /**
50
+ * deleteGenerationsId - Delete a Single Generation
51
+ *
52
+ * This endpoint deletes a specific generation
53
+ **/
54
+ GeneratingImages.prototype.deleteGenerationsId = function (req, config) {
55
+ if (!(req instanceof utils.SpeakeasyBase)) {
56
+ req = new operations.DeleteGenerationsIdRequest(req);
57
+ }
58
+ var baseURL = this._serverURL;
59
+ var url = utils.generateURL(baseURL, "/generations/{id}", req.pathParams);
60
+ var client = this._securityClient;
61
+ var r = client.request(__assign({ url: url, method: "delete" }, config));
62
+ return r.then(function (httpRes) {
63
+ var _a, _b;
64
+ var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
65
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
66
+ throw new Error("status code not found in response: ".concat(httpRes));
67
+ var res = { statusCode: httpRes.status, contentType: contentType };
68
+ switch (true) {
69
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
70
+ if (utils.matchContentType(contentType, "application/json")) {
71
+ res.deleteGenerationsId200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
72
+ }
73
+ break;
74
+ }
75
+ return res;
76
+ });
77
+ };
78
+ /**
79
+ * getGenerationsUserUserId - Get generations by user ID
80
+ *
81
+ * This endpoint returns all generations by a specific user
82
+ **/
83
+ GeneratingImages.prototype.getGenerationsUserUserId = function (req, config) {
84
+ if (!(req instanceof utils.SpeakeasyBase)) {
85
+ req = new operations.GetGenerationsUserUserIdRequest(req);
86
+ }
87
+ var baseURL = this._serverURL;
88
+ var url = utils.generateURL(baseURL, "/generations/user/{userId}", req.pathParams);
89
+ var client = this._securityClient;
90
+ var qpSerializer = utils.getQueryParamSerializer(req.queryParams);
91
+ var requestConfig = __assign(__assign({}, config), { params: req.queryParams, paramsSerializer: qpSerializer });
92
+ var r = client.request(__assign({ url: url, method: "get" }, requestConfig));
93
+ return r.then(function (httpRes) {
94
+ var _a, _b;
95
+ var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
96
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
97
+ throw new Error("status code not found in response: ".concat(httpRes));
98
+ var res = { statusCode: httpRes.status, contentType: contentType };
99
+ switch (true) {
100
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
101
+ if (utils.matchContentType(contentType, "application/json")) {
102
+ res.getGenerationsUserUserId200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
103
+ }
104
+ break;
105
+ }
106
+ return res;
107
+ });
108
+ };
109
+ /**
110
+ * getGenerationsId - Get a Single Generation
111
+ *
112
+ * This endpoint will provide information about a specific generation
113
+ **/
114
+ GeneratingImages.prototype.getGenerationsId = function (req, config) {
115
+ if (!(req instanceof utils.SpeakeasyBase)) {
116
+ req = new operations.GetGenerationsIdRequest(req);
117
+ }
118
+ var baseURL = this._serverURL;
119
+ var url = utils.generateURL(baseURL, "/generations/{id}", req.pathParams);
120
+ var client = this._securityClient;
121
+ var r = client.request(__assign({ url: url, method: "get" }, config));
122
+ return r.then(function (httpRes) {
123
+ var _a, _b;
124
+ var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
125
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
126
+ throw new Error("status code not found in response: ".concat(httpRes));
127
+ var res = { statusCode: httpRes.status, contentType: contentType };
128
+ switch (true) {
129
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
130
+ if (utils.matchContentType(contentType, "application/json")) {
131
+ res.getGenerationsId200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
132
+ }
133
+ break;
134
+ }
135
+ return res;
136
+ });
137
+ };
138
+ /**
139
+ * postGenerations - Create a Generation of Images
140
+ *
141
+ * This endpoint will generate images
142
+ **/
143
+ GeneratingImages.prototype.postGenerations = function (req, config) {
144
+ var _a;
145
+ if (!(req instanceof utils.SpeakeasyBase)) {
146
+ req = new operations.PostGenerationsRequest(req);
147
+ }
148
+ var baseURL = this._serverURL;
149
+ var url = baseURL.replace(/\/$/, "") + "/generations";
150
+ var _b = [{}, {}], reqBodyHeaders = _b[0], reqBody = _b[1];
151
+ try {
152
+ _a = utils.serializeRequestBody(req), reqBodyHeaders = _a[0], reqBody = _a[1];
153
+ }
154
+ catch (e) {
155
+ if (e instanceof Error) {
156
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
157
+ }
158
+ }
159
+ var client = this._securityClient;
160
+ var headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
161
+ if (reqBody == null || Object.keys(reqBody).length === 0)
162
+ throw new Error("request body is required");
163
+ var r = client.request(__assign({ url: url, method: "post", headers: headers, data: reqBody }, config));
164
+ return r.then(function (httpRes) {
165
+ var _a, _b;
166
+ var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
167
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
168
+ throw new Error("status code not found in response: ".concat(httpRes));
169
+ var res = { statusCode: httpRes.status, contentType: contentType };
170
+ switch (true) {
171
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
172
+ if (utils.matchContentType(contentType, "application/json")) {
173
+ res.postGenerations200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
174
+ }
175
+ break;
176
+ }
177
+ return res;
178
+ });
179
+ };
180
+ return GeneratingImages;
181
+ }());
182
+ exports.GeneratingImages = GeneratingImages;
@@ -0,0 +1,23 @@
1
+ import * as operations from "./models/operations";
2
+ import { AxiosInstance, AxiosRequestConfig } from "axios";
3
+ export declare class ImageVariations {
4
+ _defaultClient: AxiosInstance;
5
+ _securityClient: AxiosInstance;
6
+ _serverURL: string;
7
+ _language: string;
8
+ _sdkVersion: string;
9
+ _genVersion: string;
10
+ constructor(defaultClient: AxiosInstance, securityClient: AxiosInstance, serverURL: string, language: string, sdkVersion: string, genVersion: string);
11
+ /**
12
+ * getVariationsId - Get variation by ID
13
+ *
14
+ * This endpoint will get the variation by ID
15
+ **/
16
+ getVariationsId(req: operations.GetVariationsIdRequest, config?: AxiosRequestConfig): Promise<operations.GetVariationsIdResponse>;
17
+ /**
18
+ * postVariationsUpscale - Create upscale
19
+ *
20
+ * This endpoint will create an upscale for the provided image ID
21
+ **/
22
+ postVariationsUpscale(req: operations.PostVariationsUpscaleRequest, config?: AxiosRequestConfig): Promise<operations.PostVariationsUpscaleResponse>;
23
+ }
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.ImageVariations = void 0;
38
+ var utils = __importStar(require("../internal/utils"));
39
+ var operations = __importStar(require("./models/operations"));
40
+ var ImageVariations = /** @class */ (function () {
41
+ function ImageVariations(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
42
+ this._defaultClient = defaultClient;
43
+ this._securityClient = securityClient;
44
+ this._serverURL = serverURL;
45
+ this._language = language;
46
+ this._sdkVersion = sdkVersion;
47
+ this._genVersion = genVersion;
48
+ }
49
+ /**
50
+ * getVariationsId - Get variation by ID
51
+ *
52
+ * This endpoint will get the variation by ID
53
+ **/
54
+ ImageVariations.prototype.getVariationsId = function (req, config) {
55
+ if (!(req instanceof utils.SpeakeasyBase)) {
56
+ req = new operations.GetVariationsIdRequest(req);
57
+ }
58
+ var baseURL = this._serverURL;
59
+ var url = utils.generateURL(baseURL, "/variations/{id}", req.pathParams);
60
+ var client = this._securityClient;
61
+ var r = client.request(__assign({ url: url, method: "get" }, config));
62
+ return r.then(function (httpRes) {
63
+ var _a, _b;
64
+ var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
65
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
66
+ throw new Error("status code not found in response: ".concat(httpRes));
67
+ var res = { statusCode: httpRes.status, contentType: contentType };
68
+ switch (true) {
69
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
70
+ if (utils.matchContentType(contentType, "application/json")) {
71
+ res.getVariationsId200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
72
+ }
73
+ break;
74
+ }
75
+ return res;
76
+ });
77
+ };
78
+ /**
79
+ * postVariationsUpscale - Create upscale
80
+ *
81
+ * This endpoint will create an upscale for the provided image ID
82
+ **/
83
+ ImageVariations.prototype.postVariationsUpscale = function (req, config) {
84
+ var _a;
85
+ if (!(req instanceof utils.SpeakeasyBase)) {
86
+ req = new operations.PostVariationsUpscaleRequest(req);
87
+ }
88
+ var baseURL = this._serverURL;
89
+ var url = baseURL.replace(/\/$/, "") + "/variations/upscale";
90
+ var _b = [{}, {}], reqBodyHeaders = _b[0], reqBody = _b[1];
91
+ try {
92
+ _a = utils.serializeRequestBody(req), reqBodyHeaders = _a[0], reqBody = _a[1];
93
+ }
94
+ catch (e) {
95
+ if (e instanceof Error) {
96
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
97
+ }
98
+ }
99
+ var client = this._securityClient;
100
+ var headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
101
+ var r = client.request(__assign({ url: url, method: "post", headers: headers, data: reqBody }, config));
102
+ return r.then(function (httpRes) {
103
+ var _a, _b;
104
+ var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
105
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
106
+ throw new Error("status code not found in response: ".concat(httpRes));
107
+ var res = { statusCode: httpRes.status, contentType: contentType };
108
+ switch (true) {
109
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
110
+ if (utils.matchContentType(contentType, "application/json")) {
111
+ res.postVariationsUpscale200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
112
+ }
113
+ break;
114
+ }
115
+ return res;
116
+ });
117
+ };
118
+ return ImageVariations;
119
+ }());
120
+ exports.ImageVariations = ImageVariations;
@@ -0,0 +1 @@
1
+ export * from "./sdk";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./sdk"), exports);
@@ -0,0 +1,29 @@
1
+ import * as operations from "./models/operations";
2
+ import { AxiosInstance, AxiosRequestConfig } from "axios";
3
+ export declare class InitImages {
4
+ _defaultClient: AxiosInstance;
5
+ _securityClient: AxiosInstance;
6
+ _serverURL: string;
7
+ _language: string;
8
+ _sdkVersion: string;
9
+ _genVersion: string;
10
+ constructor(defaultClient: AxiosInstance, securityClient: AxiosInstance, serverURL: string, language: string, sdkVersion: string, genVersion: string);
11
+ /**
12
+ * deleteInitImageId - Delete init image
13
+ *
14
+ * This endpoint deletes an init image
15
+ **/
16
+ deleteInitImageId(req: operations.DeleteInitImageIdRequest, config?: AxiosRequestConfig): Promise<operations.DeleteInitImageIdResponse>;
17
+ /**
18
+ * getInitImageId - Get single init image
19
+ *
20
+ * This endpoint will return a single init image
21
+ **/
22
+ getInitImageId(req: operations.GetInitImageIdRequest, config?: AxiosRequestConfig): Promise<operations.GetInitImageIdResponse>;
23
+ /**
24
+ * postInitImage - Upload init image
25
+ *
26
+ * This endpoint returns presigned details to upload an init image to S3
27
+ **/
28
+ postInitImage(req: operations.PostInitImageRequest, config?: AxiosRequestConfig): Promise<operations.PostInitImageResponse>;
29
+ }
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.InitImages = void 0;
38
+ var utils = __importStar(require("../internal/utils"));
39
+ var operations = __importStar(require("./models/operations"));
40
+ var InitImages = /** @class */ (function () {
41
+ function InitImages(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
42
+ this._defaultClient = defaultClient;
43
+ this._securityClient = securityClient;
44
+ this._serverURL = serverURL;
45
+ this._language = language;
46
+ this._sdkVersion = sdkVersion;
47
+ this._genVersion = genVersion;
48
+ }
49
+ /**
50
+ * deleteInitImageId - Delete init image
51
+ *
52
+ * This endpoint deletes an init image
53
+ **/
54
+ InitImages.prototype.deleteInitImageId = function (req, config) {
55
+ if (!(req instanceof utils.SpeakeasyBase)) {
56
+ req = new operations.DeleteInitImageIdRequest(req);
57
+ }
58
+ var baseURL = this._serverURL;
59
+ var url = utils.generateURL(baseURL, "/init-image/{id}", req.pathParams);
60
+ var client = this._securityClient;
61
+ var r = client.request(__assign({ url: url, method: "delete" }, config));
62
+ return r.then(function (httpRes) {
63
+ var _a, _b;
64
+ var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
65
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
66
+ throw new Error("status code not found in response: ".concat(httpRes));
67
+ var res = { statusCode: httpRes.status, contentType: contentType };
68
+ switch (true) {
69
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
70
+ if (utils.matchContentType(contentType, "application/json")) {
71
+ res.deleteInitImageId200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
72
+ }
73
+ break;
74
+ }
75
+ return res;
76
+ });
77
+ };
78
+ /**
79
+ * getInitImageId - Get single init image
80
+ *
81
+ * This endpoint will return a single init image
82
+ **/
83
+ InitImages.prototype.getInitImageId = function (req, config) {
84
+ if (!(req instanceof utils.SpeakeasyBase)) {
85
+ req = new operations.GetInitImageIdRequest(req);
86
+ }
87
+ var baseURL = this._serverURL;
88
+ var url = utils.generateURL(baseURL, "/init-image/{id}", req.pathParams);
89
+ var client = this._securityClient;
90
+ var r = client.request(__assign({ url: url, method: "get" }, config));
91
+ return r.then(function (httpRes) {
92
+ var _a, _b;
93
+ var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
94
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
95
+ throw new Error("status code not found in response: ".concat(httpRes));
96
+ var res = { statusCode: httpRes.status, contentType: contentType };
97
+ switch (true) {
98
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
99
+ if (utils.matchContentType(contentType, "application/json")) {
100
+ res.getInitImageId200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
101
+ }
102
+ break;
103
+ }
104
+ return res;
105
+ });
106
+ };
107
+ /**
108
+ * postInitImage - Upload init image
109
+ *
110
+ * This endpoint returns presigned details to upload an init image to S3
111
+ **/
112
+ InitImages.prototype.postInitImage = function (req, config) {
113
+ var _a;
114
+ if (!(req instanceof utils.SpeakeasyBase)) {
115
+ req = new operations.PostInitImageRequest(req);
116
+ }
117
+ var baseURL = this._serverURL;
118
+ var url = baseURL.replace(/\/$/, "") + "/init-image";
119
+ var _b = [{}, {}], reqBodyHeaders = _b[0], reqBody = _b[1];
120
+ try {
121
+ _a = utils.serializeRequestBody(req), reqBodyHeaders = _a[0], reqBody = _a[1];
122
+ }
123
+ catch (e) {
124
+ if (e instanceof Error) {
125
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
126
+ }
127
+ }
128
+ var client = this._securityClient;
129
+ var headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
130
+ if (reqBody == null || Object.keys(reqBody).length === 0)
131
+ throw new Error("request body is required");
132
+ var r = client.request(__assign({ url: url, method: "post", headers: headers, data: reqBody }, config));
133
+ return r.then(function (httpRes) {
134
+ var _a, _b;
135
+ var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
136
+ if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
137
+ throw new Error("status code not found in response: ".concat(httpRes));
138
+ var res = { statusCode: httpRes.status, contentType: contentType };
139
+ switch (true) {
140
+ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
141
+ if (utils.matchContentType(contentType, "application/json")) {
142
+ res.postInitImage200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
143
+ }
144
+ break;
145
+ }
146
+ return res;
147
+ });
148
+ };
149
+ return InitImages;
150
+ }());
151
+ exports.InitImages = InitImages;
@@ -0,0 +1,12 @@
1
+ import { SpeakeasyBase } from "../../../internal/utils";
2
+ export declare class DeleteDatasetsIdPathParams extends SpeakeasyBase {
3
+ id: string;
4
+ }
5
+ export declare class DeleteDatasetsIdRequest extends SpeakeasyBase {
6
+ pathParams: DeleteDatasetsIdPathParams;
7
+ }
8
+ export declare class DeleteDatasetsIdResponse extends SpeakeasyBase {
9
+ contentType: string;
10
+ statusCode: number;
11
+ deleteDatasetsId200ApplicationJSONAny?: any;
12
+ }
@@ -0,0 +1,72 @@
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 __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.DeleteDatasetsIdResponse = exports.DeleteDatasetsIdRequest = exports.DeleteDatasetsIdPathParams = void 0;
28
+ var utils_1 = require("../../../internal/utils");
29
+ var DeleteDatasetsIdPathParams = /** @class */ (function (_super) {
30
+ __extends(DeleteDatasetsIdPathParams, _super);
31
+ function DeleteDatasetsIdPathParams() {
32
+ return _super !== null && _super.apply(this, arguments) || this;
33
+ }
34
+ __decorate([
35
+ (0, utils_1.SpeakeasyMetadata)({ data: "pathParam, style=simple;explode=false;name=id" }),
36
+ __metadata("design:type", String)
37
+ ], DeleteDatasetsIdPathParams.prototype, "id", void 0);
38
+ return DeleteDatasetsIdPathParams;
39
+ }(utils_1.SpeakeasyBase));
40
+ exports.DeleteDatasetsIdPathParams = DeleteDatasetsIdPathParams;
41
+ var DeleteDatasetsIdRequest = /** @class */ (function (_super) {
42
+ __extends(DeleteDatasetsIdRequest, _super);
43
+ function DeleteDatasetsIdRequest() {
44
+ return _super !== null && _super.apply(this, arguments) || this;
45
+ }
46
+ __decorate([
47
+ (0, utils_1.SpeakeasyMetadata)(),
48
+ __metadata("design:type", DeleteDatasetsIdPathParams)
49
+ ], DeleteDatasetsIdRequest.prototype, "pathParams", void 0);
50
+ return DeleteDatasetsIdRequest;
51
+ }(utils_1.SpeakeasyBase));
52
+ exports.DeleteDatasetsIdRequest = DeleteDatasetsIdRequest;
53
+ var DeleteDatasetsIdResponse = /** @class */ (function (_super) {
54
+ __extends(DeleteDatasetsIdResponse, _super);
55
+ function DeleteDatasetsIdResponse() {
56
+ return _super !== null && _super.apply(this, arguments) || this;
57
+ }
58
+ __decorate([
59
+ (0, utils_1.SpeakeasyMetadata)(),
60
+ __metadata("design:type", String)
61
+ ], DeleteDatasetsIdResponse.prototype, "contentType", void 0);
62
+ __decorate([
63
+ (0, utils_1.SpeakeasyMetadata)(),
64
+ __metadata("design:type", Number)
65
+ ], DeleteDatasetsIdResponse.prototype, "statusCode", void 0);
66
+ __decorate([
67
+ (0, utils_1.SpeakeasyMetadata)(),
68
+ __metadata("design:type", Object)
69
+ ], DeleteDatasetsIdResponse.prototype, "deleteDatasetsId200ApplicationJSONAny", void 0);
70
+ return DeleteDatasetsIdResponse;
71
+ }(utils_1.SpeakeasyBase));
72
+ exports.DeleteDatasetsIdResponse = DeleteDatasetsIdResponse;
@@ -0,0 +1,12 @@
1
+ import { SpeakeasyBase } from "../../../internal/utils";
2
+ export declare class DeleteGenerationsIdPathParams extends SpeakeasyBase {
3
+ id: string;
4
+ }
5
+ export declare class DeleteGenerationsIdRequest extends SpeakeasyBase {
6
+ pathParams: DeleteGenerationsIdPathParams;
7
+ }
8
+ export declare class DeleteGenerationsIdResponse extends SpeakeasyBase {
9
+ contentType: string;
10
+ statusCode: number;
11
+ deleteGenerationsId200ApplicationJSONAny?: any;
12
+ }