@daytonaio/api-client 0.4.0 → 0.5.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 (89) hide show
  1. package/.openapi-generator/FILES +4 -8
  2. package/README.md +2 -2
  3. package/api/api-keys-api.ts +353 -0
  4. package/api/default-api.ts +36 -3313
  5. package/api/docker-registry-api.ts +108 -108
  6. package/api/nodes-api.ts +274 -0
  7. package/api/users-api.ts +274 -0
  8. package/api/workspace-api.ts +760 -0
  9. package/api.ts +4 -0
  10. package/dist/api/api-keys-api.d.ts +171 -0
  11. package/dist/api/api-keys-api.js +339 -0
  12. package/dist/api/default-api.d.ts +15 -1454
  13. package/dist/api/default-api.js +43 -3090
  14. package/dist/api/docker-registry-api.d.ts +64 -64
  15. package/dist/api/docker-registry-api.js +108 -108
  16. package/dist/api/nodes-api.d.ts +135 -0
  17. package/dist/api/nodes-api.js +270 -0
  18. package/dist/api/users-api.d.ts +135 -0
  19. package/dist/api/users-api.js +270 -0
  20. package/dist/api/workspace-api.d.ts +356 -0
  21. package/dist/api/workspace-api.js +722 -0
  22. package/dist/api.d.ts +4 -0
  23. package/dist/api.js +4 -0
  24. package/dist/esm/api/api-keys-api.d.ts +171 -0
  25. package/dist/esm/api/api-keys-api.js +332 -0
  26. package/dist/esm/api/default-api.d.ts +15 -1454
  27. package/dist/esm/api/default-api.js +41 -3088
  28. package/dist/esm/api/docker-registry-api.d.ts +64 -64
  29. package/dist/esm/api/docker-registry-api.js +108 -108
  30. package/dist/esm/api/nodes-api.d.ts +135 -0
  31. package/dist/esm/api/nodes-api.js +263 -0
  32. package/dist/esm/api/users-api.d.ts +135 -0
  33. package/dist/esm/api/users-api.js +263 -0
  34. package/dist/esm/api/workspace-api.d.ts +356 -0
  35. package/dist/esm/api/workspace-api.js +715 -0
  36. package/dist/esm/api.d.ts +4 -0
  37. package/dist/esm/api.js +4 -0
  38. package/dist/esm/models/create-workspace-dto.d.ts +1 -1
  39. package/dist/esm/models/index.d.ts +0 -8
  40. package/dist/esm/models/index.js +0 -8
  41. package/dist/esm/models/workspace-dto.d.ts +14 -0
  42. package/dist/models/create-workspace-dto.d.ts +1 -1
  43. package/dist/models/index.d.ts +0 -8
  44. package/dist/models/index.js +0 -8
  45. package/dist/models/workspace-dto.d.ts +14 -0
  46. package/models/create-workspace-dto.ts +1 -1
  47. package/models/index.ts +0 -8
  48. package/models/workspace-dto.ts +12 -0
  49. package/package.json +1 -1
  50. package/dist/esm/models/execute-request-dto.d.ts +0 -30
  51. package/dist/esm/models/execute-request-dto.js +0 -14
  52. package/dist/esm/models/execute-response-dto.d.ts +0 -30
  53. package/dist/esm/models/execute-response-dto.js +0 -14
  54. package/dist/esm/models/git-add-request-dto.d.ts +0 -30
  55. package/dist/esm/models/git-add-request-dto.js +0 -14
  56. package/dist/esm/models/git-branch-request-dto.d.ts +0 -30
  57. package/dist/esm/models/git-branch-request-dto.js +0 -14
  58. package/dist/esm/models/git-clone-request-dto.d.ts +0 -54
  59. package/dist/esm/models/git-clone-request-dto.js +0 -14
  60. package/dist/esm/models/git-commit-request-dto.d.ts +0 -42
  61. package/dist/esm/models/git-commit-request-dto.js +0 -14
  62. package/dist/esm/models/git-repo-request-dto.d.ts +0 -36
  63. package/dist/esm/models/git-repo-request-dto.js +0 -14
  64. package/dist/esm/models/replace-request-dto.d.ts +0 -36
  65. package/dist/esm/models/replace-request-dto.js +0 -14
  66. package/dist/models/execute-request-dto.d.ts +0 -30
  67. package/dist/models/execute-request-dto.js +0 -15
  68. package/dist/models/execute-response-dto.d.ts +0 -30
  69. package/dist/models/execute-response-dto.js +0 -15
  70. package/dist/models/git-add-request-dto.d.ts +0 -30
  71. package/dist/models/git-add-request-dto.js +0 -15
  72. package/dist/models/git-branch-request-dto.d.ts +0 -30
  73. package/dist/models/git-branch-request-dto.js +0 -15
  74. package/dist/models/git-clone-request-dto.d.ts +0 -54
  75. package/dist/models/git-clone-request-dto.js +0 -15
  76. package/dist/models/git-commit-request-dto.d.ts +0 -42
  77. package/dist/models/git-commit-request-dto.js +0 -15
  78. package/dist/models/git-repo-request-dto.d.ts +0 -36
  79. package/dist/models/git-repo-request-dto.js +0 -15
  80. package/dist/models/replace-request-dto.d.ts +0 -36
  81. package/dist/models/replace-request-dto.js +0 -15
  82. package/models/execute-request-dto.ts +0 -36
  83. package/models/execute-response-dto.ts +0 -36
  84. package/models/git-add-request-dto.ts +0 -36
  85. package/models/git-branch-request-dto.ts +0 -36
  86. package/models/git-clone-request-dto.ts +0 -60
  87. package/models/git-commit-request-dto.ts +0 -48
  88. package/models/git-repo-request-dto.ts +0 -42
  89. package/models/replace-request-dto.ts +0 -42
@@ -0,0 +1,270 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Daytona Workspaces
6
+ * Daytona Workspaces API Docs
7
+ *
8
+ * The version of the OpenAPI document: 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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.NodesApi = exports.NodesApiFactory = exports.NodesApiFp = exports.NodesApiAxiosParamCreator = void 0;
26
+ const axios_1 = require("axios");
27
+ // Some imports not used depending on template conditions
28
+ // @ts-ignore
29
+ const common_1 = require("../common");
30
+ // @ts-ignore
31
+ const base_1 = require("../base");
32
+ /**
33
+ * NodesApi - axios parameter creator
34
+ * @export
35
+ */
36
+ const NodesApiAxiosParamCreator = function (configuration) {
37
+ return {
38
+ /**
39
+ *
40
+ * @summary Create node
41
+ * @param {object} body
42
+ * @param {*} [options] Override http request option.
43
+ * @throws {RequiredError}
44
+ */
45
+ createNode: (body_1, ...args_1) => __awaiter(this, [body_1, ...args_1], void 0, function* (body, options = {}) {
46
+ // verify required parameter 'body' is not null or undefined
47
+ (0, common_1.assertParamExists)('createNode', 'body', body);
48
+ const localVarPath = `/nodes`;
49
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
50
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
51
+ let baseOptions;
52
+ if (configuration) {
53
+ baseOptions = configuration.baseOptions;
54
+ }
55
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
56
+ const localVarHeaderParameter = {};
57
+ const localVarQueryParameter = {};
58
+ // authentication oauth2 required
59
+ // oauth required
60
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["openid", "profile", "email"], configuration);
61
+ localVarHeaderParameter['Content-Type'] = 'application/json';
62
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
63
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
64
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
65
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
66
+ return {
67
+ url: (0, common_1.toPathString)(localVarUrlObj),
68
+ options: localVarRequestOptions,
69
+ };
70
+ }),
71
+ /**
72
+ *
73
+ * @summary List all nodes
74
+ * @param {*} [options] Override http request option.
75
+ * @throws {RequiredError}
76
+ */
77
+ listNodes: (...args_2) => __awaiter(this, [...args_2], void 0, function* (options = {}) {
78
+ const localVarPath = `/nodes`;
79
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
80
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
81
+ let baseOptions;
82
+ if (configuration) {
83
+ baseOptions = configuration.baseOptions;
84
+ }
85
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
86
+ const localVarHeaderParameter = {};
87
+ const localVarQueryParameter = {};
88
+ // authentication oauth2 required
89
+ // oauth required
90
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["openid", "profile", "email"], configuration);
91
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
92
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
93
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
94
+ return {
95
+ url: (0, common_1.toPathString)(localVarUrlObj),
96
+ options: localVarRequestOptions,
97
+ };
98
+ }),
99
+ /**
100
+ *
101
+ * @summary Update node scheduling status
102
+ * @param {string} id
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ updateNodeScheduling: (id_1, ...args_3) => __awaiter(this, [id_1, ...args_3], void 0, function* (id, options = {}) {
107
+ // verify required parameter 'id' is not null or undefined
108
+ (0, common_1.assertParamExists)('updateNodeScheduling', 'id', id);
109
+ const localVarPath = `/nodes/{id}/scheduling`
110
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
111
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
112
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
113
+ let baseOptions;
114
+ if (configuration) {
115
+ baseOptions = configuration.baseOptions;
116
+ }
117
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
118
+ const localVarHeaderParameter = {};
119
+ const localVarQueryParameter = {};
120
+ // authentication oauth2 required
121
+ // oauth required
122
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["openid", "profile", "email"], configuration);
123
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
124
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
125
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
126
+ return {
127
+ url: (0, common_1.toPathString)(localVarUrlObj),
128
+ options: localVarRequestOptions,
129
+ };
130
+ }),
131
+ };
132
+ };
133
+ exports.NodesApiAxiosParamCreator = NodesApiAxiosParamCreator;
134
+ /**
135
+ * NodesApi - functional programming interface
136
+ * @export
137
+ */
138
+ const NodesApiFp = function (configuration) {
139
+ const localVarAxiosParamCreator = (0, exports.NodesApiAxiosParamCreator)(configuration);
140
+ return {
141
+ /**
142
+ *
143
+ * @summary Create node
144
+ * @param {object} body
145
+ * @param {*} [options] Override http request option.
146
+ * @throws {RequiredError}
147
+ */
148
+ createNode(body, options) {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ var _a, _b, _c;
151
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createNode(body, options);
152
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
153
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['NodesApi.createNode']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
154
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
155
+ });
156
+ },
157
+ /**
158
+ *
159
+ * @summary List all nodes
160
+ * @param {*} [options] Override http request option.
161
+ * @throws {RequiredError}
162
+ */
163
+ listNodes(options) {
164
+ return __awaiter(this, void 0, void 0, function* () {
165
+ var _a, _b, _c;
166
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listNodes(options);
167
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
168
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['NodesApi.listNodes']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
169
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
170
+ });
171
+ },
172
+ /**
173
+ *
174
+ * @summary Update node scheduling status
175
+ * @param {string} id
176
+ * @param {*} [options] Override http request option.
177
+ * @throws {RequiredError}
178
+ */
179
+ updateNodeScheduling(id, options) {
180
+ return __awaiter(this, void 0, void 0, function* () {
181
+ var _a, _b, _c;
182
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.updateNodeScheduling(id, options);
183
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
184
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['NodesApi.updateNodeScheduling']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
185
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
186
+ });
187
+ },
188
+ };
189
+ };
190
+ exports.NodesApiFp = NodesApiFp;
191
+ /**
192
+ * NodesApi - factory interface
193
+ * @export
194
+ */
195
+ const NodesApiFactory = function (configuration, basePath, axios) {
196
+ const localVarFp = (0, exports.NodesApiFp)(configuration);
197
+ return {
198
+ /**
199
+ *
200
+ * @summary Create node
201
+ * @param {object} body
202
+ * @param {*} [options] Override http request option.
203
+ * @throws {RequiredError}
204
+ */
205
+ createNode(body, options) {
206
+ return localVarFp.createNode(body, options).then((request) => request(axios, basePath));
207
+ },
208
+ /**
209
+ *
210
+ * @summary List all nodes
211
+ * @param {*} [options] Override http request option.
212
+ * @throws {RequiredError}
213
+ */
214
+ listNodes(options) {
215
+ return localVarFp.listNodes(options).then((request) => request(axios, basePath));
216
+ },
217
+ /**
218
+ *
219
+ * @summary Update node scheduling status
220
+ * @param {string} id
221
+ * @param {*} [options] Override http request option.
222
+ * @throws {RequiredError}
223
+ */
224
+ updateNodeScheduling(id, options) {
225
+ return localVarFp.updateNodeScheduling(id, options).then((request) => request(axios, basePath));
226
+ },
227
+ };
228
+ };
229
+ exports.NodesApiFactory = NodesApiFactory;
230
+ /**
231
+ * NodesApi - object-oriented interface
232
+ * @export
233
+ * @class NodesApi
234
+ * @extends {BaseAPI}
235
+ */
236
+ class NodesApi extends base_1.BaseAPI {
237
+ /**
238
+ *
239
+ * @summary Create node
240
+ * @param {object} body
241
+ * @param {*} [options] Override http request option.
242
+ * @throws {RequiredError}
243
+ * @memberof NodesApi
244
+ */
245
+ createNode(body, options) {
246
+ return (0, exports.NodesApiFp)(this.configuration).createNode(body, options).then((request) => request(this.axios, this.basePath));
247
+ }
248
+ /**
249
+ *
250
+ * @summary List all nodes
251
+ * @param {*} [options] Override http request option.
252
+ * @throws {RequiredError}
253
+ * @memberof NodesApi
254
+ */
255
+ listNodes(options) {
256
+ return (0, exports.NodesApiFp)(this.configuration).listNodes(options).then((request) => request(this.axios, this.basePath));
257
+ }
258
+ /**
259
+ *
260
+ * @summary Update node scheduling status
261
+ * @param {string} id
262
+ * @param {*} [options] Override http request option.
263
+ * @throws {RequiredError}
264
+ * @memberof NodesApi
265
+ */
266
+ updateNodeScheduling(id, options) {
267
+ return (0, exports.NodesApiFp)(this.configuration).updateNodeScheduling(id, options).then((request) => request(this.axios, this.basePath));
268
+ }
269
+ }
270
+ exports.NodesApi = NodesApi;
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Daytona Workspaces
3
+ * Daytona Workspaces API Docs
4
+ *
5
+ * The version of the OpenAPI document: 1.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 type { Configuration } from '../configuration';
13
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
14
+ import { type RequestArgs, BaseAPI } from '../base';
15
+ /**
16
+ * UsersApi - axios parameter creator
17
+ * @export
18
+ */
19
+ export declare const UsersApiAxiosParamCreator: (configuration?: Configuration) => {
20
+ /**
21
+ *
22
+ * @summary Create user
23
+ * @param {object} body
24
+ * @param {*} [options] Override http request option.
25
+ * @throws {RequiredError}
26
+ */
27
+ createUser: (body: object, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
28
+ /**
29
+ *
30
+ * @summary List all users
31
+ * @param {*} [options] Override http request option.
32
+ * @throws {RequiredError}
33
+ */
34
+ listUsers: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
35
+ /**
36
+ *
37
+ * @summary Regenerate user key pair
38
+ * @param {string} id
39
+ * @param {*} [options] Override http request option.
40
+ * @throws {RequiredError}
41
+ */
42
+ regenerateKeyPair: (id: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
43
+ };
44
+ /**
45
+ * UsersApi - functional programming interface
46
+ * @export
47
+ */
48
+ export declare const UsersApiFp: (configuration?: Configuration) => {
49
+ /**
50
+ *
51
+ * @summary Create user
52
+ * @param {object} body
53
+ * @param {*} [options] Override http request option.
54
+ * @throws {RequiredError}
55
+ */
56
+ createUser(body: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
57
+ /**
58
+ *
59
+ * @summary List all users
60
+ * @param {*} [options] Override http request option.
61
+ * @throws {RequiredError}
62
+ */
63
+ listUsers(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
64
+ /**
65
+ *
66
+ * @summary Regenerate user key pair
67
+ * @param {string} id
68
+ * @param {*} [options] Override http request option.
69
+ * @throws {RequiredError}
70
+ */
71
+ regenerateKeyPair(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
72
+ };
73
+ /**
74
+ * UsersApi - factory interface
75
+ * @export
76
+ */
77
+ export declare const UsersApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
78
+ /**
79
+ *
80
+ * @summary Create user
81
+ * @param {object} body
82
+ * @param {*} [options] Override http request option.
83
+ * @throws {RequiredError}
84
+ */
85
+ createUser(body: object, options?: RawAxiosRequestConfig): AxiosPromise<void>;
86
+ /**
87
+ *
88
+ * @summary List all users
89
+ * @param {*} [options] Override http request option.
90
+ * @throws {RequiredError}
91
+ */
92
+ listUsers(options?: RawAxiosRequestConfig): AxiosPromise<void>;
93
+ /**
94
+ *
95
+ * @summary Regenerate user key pair
96
+ * @param {string} id
97
+ * @param {*} [options] Override http request option.
98
+ * @throws {RequiredError}
99
+ */
100
+ regenerateKeyPair(id: string, options?: RawAxiosRequestConfig): AxiosPromise<void>;
101
+ };
102
+ /**
103
+ * UsersApi - object-oriented interface
104
+ * @export
105
+ * @class UsersApi
106
+ * @extends {BaseAPI}
107
+ */
108
+ export declare class UsersApi extends BaseAPI {
109
+ /**
110
+ *
111
+ * @summary Create user
112
+ * @param {object} body
113
+ * @param {*} [options] Override http request option.
114
+ * @throws {RequiredError}
115
+ * @memberof UsersApi
116
+ */
117
+ createUser(body: object, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
118
+ /**
119
+ *
120
+ * @summary List all users
121
+ * @param {*} [options] Override http request option.
122
+ * @throws {RequiredError}
123
+ * @memberof UsersApi
124
+ */
125
+ listUsers(options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
126
+ /**
127
+ *
128
+ * @summary Regenerate user key pair
129
+ * @param {string} id
130
+ * @param {*} [options] Override http request option.
131
+ * @throws {RequiredError}
132
+ * @memberof UsersApi
133
+ */
134
+ regenerateKeyPair(id: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
135
+ }
@@ -0,0 +1,270 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Daytona Workspaces
6
+ * Daytona Workspaces API Docs
7
+ *
8
+ * The version of the OpenAPI document: 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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.UsersApi = exports.UsersApiFactory = exports.UsersApiFp = exports.UsersApiAxiosParamCreator = void 0;
26
+ const axios_1 = require("axios");
27
+ // Some imports not used depending on template conditions
28
+ // @ts-ignore
29
+ const common_1 = require("../common");
30
+ // @ts-ignore
31
+ const base_1 = require("../base");
32
+ /**
33
+ * UsersApi - axios parameter creator
34
+ * @export
35
+ */
36
+ const UsersApiAxiosParamCreator = function (configuration) {
37
+ return {
38
+ /**
39
+ *
40
+ * @summary Create user
41
+ * @param {object} body
42
+ * @param {*} [options] Override http request option.
43
+ * @throws {RequiredError}
44
+ */
45
+ createUser: (body_1, ...args_1) => __awaiter(this, [body_1, ...args_1], void 0, function* (body, options = {}) {
46
+ // verify required parameter 'body' is not null or undefined
47
+ (0, common_1.assertParamExists)('createUser', 'body', body);
48
+ const localVarPath = `/users`;
49
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
50
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
51
+ let baseOptions;
52
+ if (configuration) {
53
+ baseOptions = configuration.baseOptions;
54
+ }
55
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
56
+ const localVarHeaderParameter = {};
57
+ const localVarQueryParameter = {};
58
+ // authentication oauth2 required
59
+ // oauth required
60
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["openid", "profile", "email"], configuration);
61
+ localVarHeaderParameter['Content-Type'] = 'application/json';
62
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
63
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
64
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
65
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
66
+ return {
67
+ url: (0, common_1.toPathString)(localVarUrlObj),
68
+ options: localVarRequestOptions,
69
+ };
70
+ }),
71
+ /**
72
+ *
73
+ * @summary List all users
74
+ * @param {*} [options] Override http request option.
75
+ * @throws {RequiredError}
76
+ */
77
+ listUsers: (...args_2) => __awaiter(this, [...args_2], void 0, function* (options = {}) {
78
+ const localVarPath = `/users`;
79
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
80
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
81
+ let baseOptions;
82
+ if (configuration) {
83
+ baseOptions = configuration.baseOptions;
84
+ }
85
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
86
+ const localVarHeaderParameter = {};
87
+ const localVarQueryParameter = {};
88
+ // authentication oauth2 required
89
+ // oauth required
90
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["openid", "profile", "email"], configuration);
91
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
92
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
93
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
94
+ return {
95
+ url: (0, common_1.toPathString)(localVarUrlObj),
96
+ options: localVarRequestOptions,
97
+ };
98
+ }),
99
+ /**
100
+ *
101
+ * @summary Regenerate user key pair
102
+ * @param {string} id
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ regenerateKeyPair: (id_1, ...args_3) => __awaiter(this, [id_1, ...args_3], void 0, function* (id, options = {}) {
107
+ // verify required parameter 'id' is not null or undefined
108
+ (0, common_1.assertParamExists)('regenerateKeyPair', 'id', id);
109
+ const localVarPath = `/users/{id}/regenerate-key-pair`
110
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
111
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
112
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
113
+ let baseOptions;
114
+ if (configuration) {
115
+ baseOptions = configuration.baseOptions;
116
+ }
117
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
118
+ const localVarHeaderParameter = {};
119
+ const localVarQueryParameter = {};
120
+ // authentication oauth2 required
121
+ // oauth required
122
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["openid", "profile", "email"], configuration);
123
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
124
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
125
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
126
+ return {
127
+ url: (0, common_1.toPathString)(localVarUrlObj),
128
+ options: localVarRequestOptions,
129
+ };
130
+ }),
131
+ };
132
+ };
133
+ exports.UsersApiAxiosParamCreator = UsersApiAxiosParamCreator;
134
+ /**
135
+ * UsersApi - functional programming interface
136
+ * @export
137
+ */
138
+ const UsersApiFp = function (configuration) {
139
+ const localVarAxiosParamCreator = (0, exports.UsersApiAxiosParamCreator)(configuration);
140
+ return {
141
+ /**
142
+ *
143
+ * @summary Create user
144
+ * @param {object} body
145
+ * @param {*} [options] Override http request option.
146
+ * @throws {RequiredError}
147
+ */
148
+ createUser(body, options) {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ var _a, _b, _c;
151
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createUser(body, options);
152
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
153
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UsersApi.createUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
154
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
155
+ });
156
+ },
157
+ /**
158
+ *
159
+ * @summary List all users
160
+ * @param {*} [options] Override http request option.
161
+ * @throws {RequiredError}
162
+ */
163
+ listUsers(options) {
164
+ return __awaiter(this, void 0, void 0, function* () {
165
+ var _a, _b, _c;
166
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listUsers(options);
167
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
168
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UsersApi.listUsers']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
169
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
170
+ });
171
+ },
172
+ /**
173
+ *
174
+ * @summary Regenerate user key pair
175
+ * @param {string} id
176
+ * @param {*} [options] Override http request option.
177
+ * @throws {RequiredError}
178
+ */
179
+ regenerateKeyPair(id, options) {
180
+ return __awaiter(this, void 0, void 0, function* () {
181
+ var _a, _b, _c;
182
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.regenerateKeyPair(id, options);
183
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
184
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UsersApi.regenerateKeyPair']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
185
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
186
+ });
187
+ },
188
+ };
189
+ };
190
+ exports.UsersApiFp = UsersApiFp;
191
+ /**
192
+ * UsersApi - factory interface
193
+ * @export
194
+ */
195
+ const UsersApiFactory = function (configuration, basePath, axios) {
196
+ const localVarFp = (0, exports.UsersApiFp)(configuration);
197
+ return {
198
+ /**
199
+ *
200
+ * @summary Create user
201
+ * @param {object} body
202
+ * @param {*} [options] Override http request option.
203
+ * @throws {RequiredError}
204
+ */
205
+ createUser(body, options) {
206
+ return localVarFp.createUser(body, options).then((request) => request(axios, basePath));
207
+ },
208
+ /**
209
+ *
210
+ * @summary List all users
211
+ * @param {*} [options] Override http request option.
212
+ * @throws {RequiredError}
213
+ */
214
+ listUsers(options) {
215
+ return localVarFp.listUsers(options).then((request) => request(axios, basePath));
216
+ },
217
+ /**
218
+ *
219
+ * @summary Regenerate user key pair
220
+ * @param {string} id
221
+ * @param {*} [options] Override http request option.
222
+ * @throws {RequiredError}
223
+ */
224
+ regenerateKeyPair(id, options) {
225
+ return localVarFp.regenerateKeyPair(id, options).then((request) => request(axios, basePath));
226
+ },
227
+ };
228
+ };
229
+ exports.UsersApiFactory = UsersApiFactory;
230
+ /**
231
+ * UsersApi - object-oriented interface
232
+ * @export
233
+ * @class UsersApi
234
+ * @extends {BaseAPI}
235
+ */
236
+ class UsersApi extends base_1.BaseAPI {
237
+ /**
238
+ *
239
+ * @summary Create user
240
+ * @param {object} body
241
+ * @param {*} [options] Override http request option.
242
+ * @throws {RequiredError}
243
+ * @memberof UsersApi
244
+ */
245
+ createUser(body, options) {
246
+ return (0, exports.UsersApiFp)(this.configuration).createUser(body, options).then((request) => request(this.axios, this.basePath));
247
+ }
248
+ /**
249
+ *
250
+ * @summary List all users
251
+ * @param {*} [options] Override http request option.
252
+ * @throws {RequiredError}
253
+ * @memberof UsersApi
254
+ */
255
+ listUsers(options) {
256
+ return (0, exports.UsersApiFp)(this.configuration).listUsers(options).then((request) => request(this.axios, this.basePath));
257
+ }
258
+ /**
259
+ *
260
+ * @summary Regenerate user key pair
261
+ * @param {string} id
262
+ * @param {*} [options] Override http request option.
263
+ * @throws {RequiredError}
264
+ * @memberof UsersApi
265
+ */
266
+ regenerateKeyPair(id, options) {
267
+ return (0, exports.UsersApiFp)(this.configuration).regenerateKeyPair(id, options).then((request) => request(this.axios, this.basePath));
268
+ }
269
+ }
270
+ exports.UsersApi = UsersApi;