@envsync-cloud/envsync-ts-sdk 0.3.6 → 0.6.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.
@@ -1,2291 +0,0 @@
1
- "use strict";
2
- (() => {
3
- // src/core/BaseHttpRequest.ts
4
- var BaseHttpRequest = class {
5
- constructor(config) {
6
- this.config = config;
7
- }
8
- };
9
-
10
- // src/core/ApiError.ts
11
- var ApiError = class extends Error {
12
- url;
13
- status;
14
- statusText;
15
- body;
16
- request;
17
- constructor(request2, response, message) {
18
- super(message);
19
- this.name = "ApiError";
20
- this.url = response.url;
21
- this.status = response.status;
22
- this.statusText = response.statusText;
23
- this.body = response.body;
24
- this.request = request2;
25
- }
26
- };
27
-
28
- // src/core/CancelablePromise.ts
29
- var CancelError = class extends Error {
30
- constructor(message) {
31
- super(message);
32
- this.name = "CancelError";
33
- }
34
- get isCancelled() {
35
- return true;
36
- }
37
- };
38
- var CancelablePromise = class {
39
- #isResolved;
40
- #isRejected;
41
- #isCancelled;
42
- #cancelHandlers;
43
- #promise;
44
- #resolve;
45
- #reject;
46
- constructor(executor) {
47
- this.#isResolved = false;
48
- this.#isRejected = false;
49
- this.#isCancelled = false;
50
- this.#cancelHandlers = [];
51
- this.#promise = new Promise((resolve2, reject) => {
52
- this.#resolve = resolve2;
53
- this.#reject = reject;
54
- const onResolve = (value) => {
55
- if (this.#isResolved || this.#isRejected || this.#isCancelled) {
56
- return;
57
- }
58
- this.#isResolved = true;
59
- if (this.#resolve) this.#resolve(value);
60
- };
61
- const onReject = (reason) => {
62
- if (this.#isResolved || this.#isRejected || this.#isCancelled) {
63
- return;
64
- }
65
- this.#isRejected = true;
66
- if (this.#reject) this.#reject(reason);
67
- };
68
- const onCancel = (cancelHandler) => {
69
- if (this.#isResolved || this.#isRejected || this.#isCancelled) {
70
- return;
71
- }
72
- this.#cancelHandlers.push(cancelHandler);
73
- };
74
- Object.defineProperty(onCancel, "isResolved", {
75
- get: () => this.#isResolved
76
- });
77
- Object.defineProperty(onCancel, "isRejected", {
78
- get: () => this.#isRejected
79
- });
80
- Object.defineProperty(onCancel, "isCancelled", {
81
- get: () => this.#isCancelled
82
- });
83
- return executor(onResolve, onReject, onCancel);
84
- });
85
- }
86
- get [Symbol.toStringTag]() {
87
- return "Cancellable Promise";
88
- }
89
- then(onFulfilled, onRejected) {
90
- return this.#promise.then(onFulfilled, onRejected);
91
- }
92
- catch(onRejected) {
93
- return this.#promise.catch(onRejected);
94
- }
95
- finally(onFinally) {
96
- return this.#promise.finally(onFinally);
97
- }
98
- cancel() {
99
- if (this.#isResolved || this.#isRejected || this.#isCancelled) {
100
- return;
101
- }
102
- this.#isCancelled = true;
103
- if (this.#cancelHandlers.length) {
104
- try {
105
- for (const cancelHandler of this.#cancelHandlers) {
106
- cancelHandler();
107
- }
108
- } catch (error) {
109
- console.warn("Cancellation threw an error", error);
110
- return;
111
- }
112
- }
113
- this.#cancelHandlers.length = 0;
114
- if (this.#reject) this.#reject(new CancelError("Request aborted"));
115
- }
116
- get isCancelled() {
117
- return this.#isCancelled;
118
- }
119
- };
120
-
121
- // src/core/request.ts
122
- var isDefined = (value) => {
123
- return value !== void 0 && value !== null;
124
- };
125
- var isString = (value) => {
126
- return typeof value === "string";
127
- };
128
- var isStringWithValue = (value) => {
129
- return isString(value) && value !== "";
130
- };
131
- var isBlob = (value) => {
132
- return typeof value === "object" && typeof value.type === "string" && typeof value.stream === "function" && typeof value.arrayBuffer === "function" && typeof value.constructor === "function" && typeof value.constructor.name === "string" && /^(Blob|File)$/.test(value.constructor.name) && /^(Blob|File)$/.test(value[Symbol.toStringTag]);
133
- };
134
- var isFormData = (value) => {
135
- return value instanceof FormData;
136
- };
137
- var base64 = (str) => {
138
- try {
139
- return btoa(str);
140
- } catch (err) {
141
- return Buffer.from(str).toString("base64");
142
- }
143
- };
144
- var getQueryString = (params) => {
145
- const qs = [];
146
- const append = (key, value) => {
147
- qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
148
- };
149
- const process = (key, value) => {
150
- if (isDefined(value)) {
151
- if (Array.isArray(value)) {
152
- value.forEach((v) => {
153
- process(key, v);
154
- });
155
- } else if (typeof value === "object") {
156
- Object.entries(value).forEach(([k, v]) => {
157
- process(`${key}[${k}]`, v);
158
- });
159
- } else {
160
- append(key, value);
161
- }
162
- }
163
- };
164
- Object.entries(params).forEach(([key, value]) => {
165
- process(key, value);
166
- });
167
- if (qs.length > 0) {
168
- return `?${qs.join("&")}`;
169
- }
170
- return "";
171
- };
172
- var getUrl = (config, options) => {
173
- const encoder = config.ENCODE_PATH || encodeURI;
174
- const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
175
- if (options.path?.hasOwnProperty(group)) {
176
- return encoder(String(options.path[group]));
177
- }
178
- return substring;
179
- });
180
- const url = `${config.BASE}${path}`;
181
- if (options.query) {
182
- return `${url}${getQueryString(options.query)}`;
183
- }
184
- return url;
185
- };
186
- var getFormData = (options) => {
187
- if (options.formData) {
188
- const formData = new FormData();
189
- const process = (key, value) => {
190
- if (isString(value) || isBlob(value)) {
191
- formData.append(key, value);
192
- } else {
193
- formData.append(key, JSON.stringify(value));
194
- }
195
- };
196
- Object.entries(options.formData).filter(([_, value]) => isDefined(value)).forEach(([key, value]) => {
197
- if (Array.isArray(value)) {
198
- value.forEach((v) => process(key, v));
199
- } else {
200
- process(key, value);
201
- }
202
- });
203
- return formData;
204
- }
205
- return void 0;
206
- };
207
- var resolve = async (options, resolver) => {
208
- if (typeof resolver === "function") {
209
- return resolver(options);
210
- }
211
- return resolver;
212
- };
213
- var getHeaders = async (config, options) => {
214
- const [token, username, password, additionalHeaders] = await Promise.all([
215
- resolve(options, config.TOKEN),
216
- resolve(options, config.USERNAME),
217
- resolve(options, config.PASSWORD),
218
- resolve(options, config.HEADERS)
219
- ]);
220
- const headers = Object.entries({
221
- Accept: "application/json",
222
- ...additionalHeaders,
223
- ...options.headers
224
- }).filter(([_, value]) => isDefined(value)).reduce((headers2, [key, value]) => ({
225
- ...headers2,
226
- [key]: String(value)
227
- }), {});
228
- if (isStringWithValue(token)) {
229
- headers["Authorization"] = `Bearer ${token}`;
230
- }
231
- if (isStringWithValue(username) && isStringWithValue(password)) {
232
- const credentials = base64(`${username}:${password}`);
233
- headers["Authorization"] = `Basic ${credentials}`;
234
- }
235
- if (options.body !== void 0) {
236
- if (options.mediaType) {
237
- headers["Content-Type"] = options.mediaType;
238
- } else if (isBlob(options.body)) {
239
- headers["Content-Type"] = options.body.type || "application/octet-stream";
240
- } else if (isString(options.body)) {
241
- headers["Content-Type"] = "text/plain";
242
- } else if (!isFormData(options.body)) {
243
- headers["Content-Type"] = "application/json";
244
- }
245
- }
246
- return new Headers(headers);
247
- };
248
- var getRequestBody = (options) => {
249
- if (options.body !== void 0) {
250
- if (options.mediaType?.includes("/json")) {
251
- return JSON.stringify(options.body);
252
- } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
253
- return options.body;
254
- } else {
255
- return JSON.stringify(options.body);
256
- }
257
- }
258
- return void 0;
259
- };
260
- var sendRequest = async (config, options, url, body, formData, headers, onCancel) => {
261
- const controller = new AbortController();
262
- const request2 = {
263
- headers,
264
- body: body ?? formData,
265
- method: options.method,
266
- signal: controller.signal
267
- };
268
- if (config.WITH_CREDENTIALS) {
269
- request2.credentials = config.CREDENTIALS;
270
- }
271
- onCancel(() => controller.abort());
272
- return await fetch(url, request2);
273
- };
274
- var getResponseHeader = (response, responseHeader) => {
275
- if (responseHeader) {
276
- const content = response.headers.get(responseHeader);
277
- if (isString(content)) {
278
- return content;
279
- }
280
- }
281
- return void 0;
282
- };
283
- var getResponseBody = async (response) => {
284
- if (response.status !== 204) {
285
- try {
286
- const contentType = response.headers.get("Content-Type");
287
- if (contentType) {
288
- const jsonTypes = ["application/json", "application/problem+json"];
289
- const isJSON = jsonTypes.some((type) => contentType.toLowerCase().startsWith(type));
290
- if (isJSON) {
291
- return await response.json();
292
- } else {
293
- return await response.text();
294
- }
295
- }
296
- } catch (error) {
297
- console.error(error);
298
- }
299
- }
300
- return void 0;
301
- };
302
- var catchErrorCodes = (options, result) => {
303
- const errors = {
304
- 400: "Bad Request",
305
- 401: "Unauthorized",
306
- 403: "Forbidden",
307
- 404: "Not Found",
308
- 500: "Internal Server Error",
309
- 502: "Bad Gateway",
310
- 503: "Service Unavailable",
311
- ...options.errors
312
- };
313
- const error = errors[result.status];
314
- if (error) {
315
- throw new ApiError(options, result, error);
316
- }
317
- if (!result.ok) {
318
- const errorStatus = result.status ?? "unknown";
319
- const errorStatusText = result.statusText ?? "unknown";
320
- const errorBody = (() => {
321
- try {
322
- return JSON.stringify(result.body, null, 2);
323
- } catch (e) {
324
- return void 0;
325
- }
326
- })();
327
- throw new ApiError(
328
- options,
329
- result,
330
- `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
331
- );
332
- }
333
- };
334
- var request = (config, options) => {
335
- return new CancelablePromise(async (resolve2, reject, onCancel) => {
336
- try {
337
- const url = getUrl(config, options);
338
- const formData = getFormData(options);
339
- const body = getRequestBody(options);
340
- const headers = await getHeaders(config, options);
341
- if (!onCancel.isCancelled) {
342
- const response = await sendRequest(config, options, url, body, formData, headers, onCancel);
343
- const responseBody = await getResponseBody(response);
344
- const responseHeader = getResponseHeader(response, options.responseHeader);
345
- const result = {
346
- url,
347
- ok: response.ok,
348
- status: response.status,
349
- statusText: response.statusText,
350
- body: responseHeader ?? responseBody
351
- };
352
- catchErrorCodes(options, result);
353
- resolve2(result.body);
354
- }
355
- } catch (error) {
356
- reject(error);
357
- }
358
- });
359
- };
360
-
361
- // src/core/FetchHttpRequest.ts
362
- var FetchHttpRequest = class extends BaseHttpRequest {
363
- constructor(config) {
364
- super(config);
365
- }
366
- /**
367
- * Request method
368
- * @param options The request options from the service
369
- * @returns CancelablePromise<T>
370
- * @throws ApiError
371
- */
372
- request(options) {
373
- return request(this.config, options);
374
- }
375
- };
376
-
377
- // src/services/AccessService.ts
378
- var AccessService = class {
379
- constructor(httpRequest) {
380
- this.httpRequest = httpRequest;
381
- }
382
- /**
383
- * Initiate CLI Login
384
- * Generate authentication URL for CLI login
385
- * @returns LoginUrlResponse CLI login initiated successfully.
386
- * @throws ApiError
387
- */
388
- createCliLogin() {
389
- return this.httpRequest.request({
390
- method: "GET",
391
- url: "/api/access/cli",
392
- errors: {
393
- 500: `Internal server error`
394
- }
395
- });
396
- }
397
- /**
398
- * Create Web Login URL
399
- * Generate authentication URL for web login
400
- * @returns LoginUrlResponse Web login URL created successfully
401
- * @throws ApiError
402
- */
403
- createWebLogin() {
404
- return this.httpRequest.request({
405
- method: "GET",
406
- url: "/api/access/web",
407
- errors: {
408
- 500: `Internal server error`
409
- }
410
- });
411
- }
412
- /**
413
- * Web Login Callback
414
- * Handle web login callback from Auth0
415
- * @param code
416
- * @returns void
417
- * @throws ApiError
418
- */
419
- callbackWebLogin(code) {
420
- return this.httpRequest.request({
421
- method: "GET",
422
- url: "/api/access/web/callback",
423
- query: {
424
- "code": code
425
- },
426
- errors: {
427
- 302: `Redirect with authentication token`,
428
- 500: `Internal server error`
429
- }
430
- });
431
- }
432
- /**
433
- * Create API Login URL
434
- * Generate authentication URL for API login
435
- * @returns LoginUrlResponse API login URL created successfully
436
- * @throws ApiError
437
- */
438
- createApiLogin() {
439
- return this.httpRequest.request({
440
- method: "GET",
441
- url: "/api/access/api",
442
- errors: {
443
- 500: `Internal server error`
444
- }
445
- });
446
- }
447
- /**
448
- * API Login Callback
449
- * Handle API login callback from Auth0
450
- * @param code
451
- * @returns CallbackResponse API login callback successful
452
- * @throws ApiError
453
- */
454
- callbackApiLogin(code) {
455
- return this.httpRequest.request({
456
- method: "GET",
457
- url: "/api/access/api/callback",
458
- query: {
459
- "code": code
460
- },
461
- errors: {
462
- 500: `Internal server error`
463
- }
464
- });
465
- }
466
- };
467
-
468
- // src/services/ApiKeysService.ts
469
- var ApiKeysService = class {
470
- constructor(httpRequest) {
471
- this.httpRequest = httpRequest;
472
- }
473
- /**
474
- * Create API Key
475
- * Create a new API key for the organization
476
- * @param requestBody
477
- * @returns ApiKeyResponse API key created successfully
478
- * @throws ApiError
479
- */
480
- createApiKey(requestBody) {
481
- return this.httpRequest.request({
482
- method: "POST",
483
- url: "/api/api_key",
484
- body: requestBody,
485
- mediaType: "application/json",
486
- errors: {
487
- 500: `Internal server error`
488
- }
489
- });
490
- }
491
- /**
492
- * Get All API Keys
493
- * Retrieve all API keys for the organization
494
- * @returns ApiKeysResponse API keys retrieved successfully
495
- * @throws ApiError
496
- */
497
- getAllApiKeys() {
498
- return this.httpRequest.request({
499
- method: "GET",
500
- url: "/api/api_key",
501
- errors: {
502
- 500: `Internal server error`
503
- }
504
- });
505
- }
506
- /**
507
- * Get API Key
508
- * Retrieve a specific API key
509
- * @param id
510
- * @returns ApiKeyResponse API key retrieved successfully
511
- * @throws ApiError
512
- */
513
- getApiKey(id) {
514
- return this.httpRequest.request({
515
- method: "GET",
516
- url: "/api/api_key/{id}",
517
- path: {
518
- "id": id
519
- },
520
- errors: {
521
- 500: `Internal server error`
522
- }
523
- });
524
- }
525
- /**
526
- * Update API Key
527
- * Update an existing API key
528
- * @param id
529
- * @param requestBody
530
- * @returns ApiKeyResponse API key updated successfully
531
- * @throws ApiError
532
- */
533
- updateApiKey(id, requestBody) {
534
- return this.httpRequest.request({
535
- method: "PUT",
536
- url: "/api/api_key/{id}",
537
- path: {
538
- "id": id
539
- },
540
- body: requestBody,
541
- mediaType: "application/json",
542
- errors: {
543
- 500: `Internal server error`
544
- }
545
- });
546
- }
547
- /**
548
- * Delete API Key
549
- * Delete an existing API key
550
- * @param id
551
- * @returns ApiKeyResponse API key deleted successfully
552
- * @throws ApiError
553
- */
554
- deleteApiKey(id) {
555
- return this.httpRequest.request({
556
- method: "DELETE",
557
- url: "/api/api_key/{id}",
558
- path: {
559
- "id": id
560
- },
561
- errors: {
562
- 500: `Internal server error`
563
- }
564
- });
565
- }
566
- /**
567
- * Regenerate API Key
568
- * Generate a new value for an existing API key
569
- * @param id
570
- * @returns RegenerateApiKeyResponse API key regenerated successfully
571
- * @throws ApiError
572
- */
573
- regenerateApiKey(id) {
574
- return this.httpRequest.request({
575
- method: "GET",
576
- url: "/api/api_key/{id}/regenerate",
577
- path: {
578
- "id": id
579
- },
580
- errors: {
581
- 500: `Internal server error`
582
- }
583
- });
584
- }
585
- };
586
-
587
- // src/services/ApplicationsService.ts
588
- var ApplicationsService = class {
589
- constructor(httpRequest) {
590
- this.httpRequest = httpRequest;
591
- }
592
- /**
593
- * Get All Applications
594
- * Retrieve all applications for the organization
595
- * @returns GetAppsResponse Applications retrieved successfully
596
- * @throws ApiError
597
- */
598
- getApps() {
599
- return this.httpRequest.request({
600
- method: "GET",
601
- url: "/api/app",
602
- errors: {
603
- 500: `Internal server error`
604
- }
605
- });
606
- }
607
- /**
608
- * Create Application
609
- * Create a new application
610
- * @param requestBody
611
- * @returns CreateAppResponse Application created successfully
612
- * @throws ApiError
613
- */
614
- createApp(requestBody) {
615
- return this.httpRequest.request({
616
- method: "POST",
617
- url: "/api/app",
618
- body: requestBody,
619
- mediaType: "application/json",
620
- errors: {
621
- 500: `Internal server error`
622
- }
623
- });
624
- }
625
- /**
626
- * Get Application
627
- * Retrieve a specific application by ID
628
- * @param id
629
- * @returns GetAppResponse Application retrieved successfully
630
- * @throws ApiError
631
- */
632
- getApp(id) {
633
- return this.httpRequest.request({
634
- method: "GET",
635
- url: "/api/app/{id}",
636
- path: {
637
- "id": id
638
- },
639
- errors: {
640
- 500: `Internal server error`
641
- }
642
- });
643
- }
644
- /**
645
- * Update Application
646
- * Update an existing application
647
- * @param id
648
- * @param requestBody
649
- * @returns UpdateAppResponse Application updated successfully
650
- * @throws ApiError
651
- */
652
- updateApp(id, requestBody) {
653
- return this.httpRequest.request({
654
- method: "PATCH",
655
- url: "/api/app/{id}",
656
- path: {
657
- "id": id
658
- },
659
- body: requestBody,
660
- mediaType: "application/json",
661
- errors: {
662
- 500: `Internal server error`
663
- }
664
- });
665
- }
666
- /**
667
- * Delete Application
668
- * Delete an existing application
669
- * @param id
670
- * @returns DeleteAppResponse Application deleted successfully
671
- * @throws ApiError
672
- */
673
- deleteApp(id) {
674
- return this.httpRequest.request({
675
- method: "DELETE",
676
- url: "/api/app/{id}",
677
- path: {
678
- "id": id
679
- },
680
- errors: {
681
- 500: `Internal server error`
682
- }
683
- });
684
- }
685
- };
686
-
687
- // src/services/AuditLogsService.ts
688
- var AuditLogsService = class {
689
- constructor(httpRequest) {
690
- this.httpRequest = httpRequest;
691
- }
692
- /**
693
- * Get Audit Logs
694
- * Retrieve audit logs for the organization with pagination
695
- * @param page
696
- * @param perPage
697
- * @returns GetAuditLogsResponseWrapper Audit logs retrieved successfully
698
- * @throws ApiError
699
- */
700
- getAuditLogs(page = "1", perPage = "20") {
701
- return this.httpRequest.request({
702
- method: "GET",
703
- url: "/api/audit_log",
704
- query: {
705
- "page": page,
706
- "per_page": perPage
707
- },
708
- errors: {
709
- 500: `Internal server error`
710
- }
711
- });
712
- }
713
- };
714
-
715
- // src/services/AuthenticationService.ts
716
- var AuthenticationService = class {
717
- constructor(httpRequest) {
718
- this.httpRequest = httpRequest;
719
- }
720
- /**
721
- * Get Current User
722
- * Retrieve the current authenticated user's information and their organization details
723
- * @returns WhoAmIResponse User information retrieved successfully
724
- * @throws ApiError
725
- */
726
- whoami() {
727
- return this.httpRequest.request({
728
- method: "GET",
729
- url: "/api/auth/me",
730
- errors: {
731
- 500: `Internal server error`
732
- }
733
- });
734
- }
735
- };
736
-
737
- // src/services/EnvironmentTypesService.ts
738
- var EnvironmentTypesService = class {
739
- constructor(httpRequest) {
740
- this.httpRequest = httpRequest;
741
- }
742
- /**
743
- * Get Environment Types
744
- * Retrieve all environment types for the organization
745
- * @returns EnvTypesResponse Environment types retrieved successfully
746
- * @throws ApiError
747
- */
748
- getEnvTypes() {
749
- return this.httpRequest.request({
750
- method: "GET",
751
- url: "/api/env_type",
752
- errors: {
753
- 500: `Internal server error`
754
- }
755
- });
756
- }
757
- /**
758
- * Create Environment Type
759
- * Create a new environment type
760
- * @param requestBody
761
- * @returns EnvTypeResponse Environment type created successfully
762
- * @throws ApiError
763
- */
764
- createEnvType(requestBody) {
765
- return this.httpRequest.request({
766
- method: "POST",
767
- url: "/api/env_type",
768
- body: requestBody,
769
- mediaType: "application/json",
770
- errors: {
771
- 500: `Internal server error`
772
- }
773
- });
774
- }
775
- /**
776
- * Get Environment Type
777
- * Retrieve a specific environment type
778
- * @param id
779
- * @returns EnvTypeResponse Environment type retrieved successfully
780
- * @throws ApiError
781
- */
782
- getEnvType(id) {
783
- return this.httpRequest.request({
784
- method: "GET",
785
- url: "/api/env_type/{id}",
786
- path: {
787
- "id": id
788
- },
789
- errors: {
790
- 500: `Internal server error`
791
- }
792
- });
793
- }
794
- /**
795
- * Update Environment Type
796
- * Update an existing environment type
797
- * @param id
798
- * @param requestBody
799
- * @returns EnvTypeResponse Environment type updated successfully
800
- * @throws ApiError
801
- */
802
- updateEnvType(id, requestBody) {
803
- return this.httpRequest.request({
804
- method: "PATCH",
805
- url: "/api/env_type/{id}",
806
- path: {
807
- "id": id
808
- },
809
- body: requestBody,
810
- mediaType: "application/json",
811
- errors: {
812
- 500: `Internal server error`
813
- }
814
- });
815
- }
816
- /**
817
- * Delete Environment Type
818
- * Delete an existing environment type
819
- * @param id
820
- * @returns DeleteEnvTypeRequest Environment type deleted successfully
821
- * @throws ApiError
822
- */
823
- deleteEnvType(id) {
824
- return this.httpRequest.request({
825
- method: "DELETE",
826
- url: "/api/env_type/{id}",
827
- path: {
828
- "id": id
829
- },
830
- errors: {
831
- 500: `Internal server error`
832
- }
833
- });
834
- }
835
- };
836
-
837
- // src/services/EnvironmentVariablesService.ts
838
- var EnvironmentVariablesService = class {
839
- constructor(httpRequest) {
840
- this.httpRequest = httpRequest;
841
- }
842
- /**
843
- * Get Environment Variables
844
- * Retrieve all environment variables for an application and environment type
845
- * @param requestBody
846
- * @returns EnvsResponse Environment variables retrieved successfully
847
- * @throws ApiError
848
- */
849
- getEnvs(requestBody) {
850
- return this.httpRequest.request({
851
- method: "POST",
852
- url: "/api/env",
853
- body: requestBody,
854
- mediaType: "application/json",
855
- errors: {
856
- 500: `Internal server error`
857
- }
858
- });
859
- }
860
- /**
861
- * Delete Environment Variable
862
- * Delete an existing environment variable
863
- * @param requestBody
864
- * @returns DeleteEnvRequest Environment variable deleted successfully
865
- * @throws ApiError
866
- */
867
- deleteEnv(requestBody) {
868
- return this.httpRequest.request({
869
- method: "DELETE",
870
- url: "/api/env",
871
- body: requestBody,
872
- mediaType: "application/json",
873
- errors: {
874
- 500: `Internal server error`
875
- }
876
- });
877
- }
878
- /**
879
- * Get Single Environment Variable
880
- * Retrieve a specific environment variable
881
- * @param key
882
- * @param requestBody
883
- * @returns EnvResponse Environment variable retrieved successfully
884
- * @throws ApiError
885
- */
886
- getEnv(key, requestBody) {
887
- return this.httpRequest.request({
888
- method: "POST",
889
- url: "/api/env/i/{key}",
890
- path: {
891
- "key": key
892
- },
893
- body: requestBody,
894
- mediaType: "application/json",
895
- errors: {
896
- 500: `Internal server error`
897
- }
898
- });
899
- }
900
- /**
901
- * Update Environment Variable
902
- * Update an existing environment variable
903
- * @param key
904
- * @param requestBody
905
- * @returns EnvResponse Environment variable updated successfully
906
- * @throws ApiError
907
- */
908
- updateEnv(key, requestBody) {
909
- return this.httpRequest.request({
910
- method: "PATCH",
911
- url: "/api/env/i/{key}",
912
- path: {
913
- "key": key
914
- },
915
- body: requestBody,
916
- mediaType: "application/json",
917
- errors: {
918
- 500: `Internal server error`
919
- }
920
- });
921
- }
922
- /**
923
- * Create Environment Variable
924
- * Create a new environment variable
925
- * @param requestBody
926
- * @returns EnvResponse Environment variable created successfully
927
- * @throws ApiError
928
- */
929
- createEnv(requestBody) {
930
- return this.httpRequest.request({
931
- method: "PUT",
932
- url: "/api/env/single",
933
- body: requestBody,
934
- mediaType: "application/json",
935
- errors: {
936
- 500: `Internal server error`
937
- }
938
- });
939
- }
940
- /**
941
- * Batch Create Environment Variables
942
- * Create multiple environment variables in a single request
943
- * @param requestBody
944
- * @returns BatchEnvsResponse Environment variables created successfully
945
- * @throws ApiError
946
- */
947
- batchCreateEnvs(requestBody) {
948
- return this.httpRequest.request({
949
- method: "PUT",
950
- url: "/api/env/batch",
951
- body: requestBody,
952
- mediaType: "application/json",
953
- errors: {
954
- 500: `Internal server error`
955
- }
956
- });
957
- }
958
- /**
959
- * Batch Update Environment Variables
960
- * Update multiple environment variables in a single request
961
- * @param requestBody
962
- * @returns BatchEnvsResponse Environment variables updated successfully
963
- * @throws ApiError
964
- */
965
- batchUpdateEnvs(requestBody) {
966
- return this.httpRequest.request({
967
- method: "PATCH",
968
- url: "/api/env/batch",
969
- body: requestBody,
970
- mediaType: "application/json",
971
- errors: {
972
- 500: `Internal server error`
973
- }
974
- });
975
- }
976
- /**
977
- * Batch Delete Environment Variables
978
- * Delete multiple environment variables in a single request
979
- * @param requestBody
980
- * @returns BatchEnvsResponse Environment variables deleted successfully
981
- * @throws ApiError
982
- */
983
- deleteBatchEnv(requestBody) {
984
- return this.httpRequest.request({
985
- method: "DELETE",
986
- url: "/api/env/batch",
987
- body: requestBody,
988
- mediaType: "application/json",
989
- errors: {
990
- 500: `Internal server error`
991
- }
992
- });
993
- }
994
- };
995
-
996
- // src/services/EnvironmentVariablesPointInTimeService.ts
997
- var EnvironmentVariablesPointInTimeService = class {
998
- constructor(httpRequest) {
999
- this.httpRequest = httpRequest;
1000
- }
1001
- /**
1002
- * Get Environment Variables History
1003
- * Retrieve paginated history of environment variable changes
1004
- * @param requestBody
1005
- * @returns EnvHistoryResponse Environment variables history retrieved successfully
1006
- * @throws ApiError
1007
- */
1008
- getEnvHistory(requestBody) {
1009
- return this.httpRequest.request({
1010
- method: "POST",
1011
- url: "/api/env/history",
1012
- body: requestBody,
1013
- mediaType: "application/json",
1014
- errors: {
1015
- 500: `Internal server error`
1016
- }
1017
- });
1018
- }
1019
- /**
1020
- * Get Environment Variables at Point in Time
1021
- * Retrieve environment variables state at a specific point in time
1022
- * @param requestBody
1023
- * @returns EnvPitStateResponse Environment variables at point in time retrieved successfully
1024
- * @throws ApiError
1025
- */
1026
- getEnvsAtPointInTime(requestBody) {
1027
- return this.httpRequest.request({
1028
- method: "POST",
1029
- url: "/api/env/pit",
1030
- body: requestBody,
1031
- mediaType: "application/json",
1032
- errors: {
1033
- 500: `Internal server error`
1034
- }
1035
- });
1036
- }
1037
- /**
1038
- * Get Environment Variables at Timestamp
1039
- * Retrieve environment variables state at a specific timestamp
1040
- * @param requestBody
1041
- * @returns EnvPitStateResponse Environment variables at timestamp retrieved successfully
1042
- * @throws ApiError
1043
- */
1044
- getEnvsAtTimestamp(requestBody) {
1045
- return this.httpRequest.request({
1046
- method: "POST",
1047
- url: "/api/env/timestamp",
1048
- body: requestBody,
1049
- mediaType: "application/json",
1050
- errors: {
1051
- 500: `Internal server error`
1052
- }
1053
- });
1054
- }
1055
- /**
1056
- * Get Environment Variables Diff
1057
- * Compare environment variables between two points in time
1058
- * @param requestBody
1059
- * @returns EnvDiffResponse Environment variables diff retrieved successfully
1060
- * @throws ApiError
1061
- */
1062
- getEnvDiff(requestBody) {
1063
- return this.httpRequest.request({
1064
- method: "POST",
1065
- url: "/api/env/diff",
1066
- body: requestBody,
1067
- mediaType: "application/json",
1068
- errors: {
1069
- 500: `Internal server error`
1070
- }
1071
- });
1072
- }
1073
- /**
1074
- * Get Variable Timeline
1075
- * Get timeline of changes for a specific environment variable
1076
- * @param key
1077
- * @param requestBody
1078
- * @returns VariableTimelineResponse Variable timeline retrieved successfully
1079
- * @throws ApiError
1080
- */
1081
- getVariableTimeline(key, requestBody) {
1082
- return this.httpRequest.request({
1083
- method: "POST",
1084
- url: "/api/env/timeline/{key}",
1085
- path: {
1086
- "key": key
1087
- },
1088
- body: requestBody,
1089
- mediaType: "application/json",
1090
- errors: {
1091
- 500: `Internal server error`
1092
- }
1093
- });
1094
- }
1095
- };
1096
-
1097
- // src/services/EnvironmentVariablesRollbackService.ts
1098
- var EnvironmentVariablesRollbackService = class {
1099
- constructor(httpRequest) {
1100
- this.httpRequest = httpRequest;
1101
- }
1102
- /**
1103
- * Rollback Environment Variables to Point in Time
1104
- * Rollback all environment variables to a specific point in time
1105
- * @param requestBody
1106
- * @returns RollbackResponse Environment variables rolled back successfully
1107
- * @throws ApiError
1108
- */
1109
- rollbackEnvsToPitId(requestBody) {
1110
- return this.httpRequest.request({
1111
- method: "POST",
1112
- url: "/api/env/rollback/pit",
1113
- body: requestBody,
1114
- mediaType: "application/json",
1115
- errors: {
1116
- 500: `Internal server error`
1117
- }
1118
- });
1119
- }
1120
- /**
1121
- * Rollback Environment Variables to Timestamp
1122
- * Rollback all environment variables to a specific timestamp
1123
- * @param requestBody
1124
- * @returns RollbackResponse Environment variables rolled back successfully
1125
- * @throws ApiError
1126
- */
1127
- rollbackEnvsToTimestamp(requestBody) {
1128
- return this.httpRequest.request({
1129
- method: "POST",
1130
- url: "/api/env/rollback/timestamp",
1131
- body: requestBody,
1132
- mediaType: "application/json",
1133
- errors: {
1134
- 500: `Internal server error`
1135
- }
1136
- });
1137
- }
1138
- /**
1139
- * Rollback Single Variable to Point in Time
1140
- * Rollback a specific environment variable to a point in time
1141
- * @param key
1142
- * @param requestBody
1143
- * @returns VariableRollbackResponse Variable rolled back successfully
1144
- * @throws ApiError
1145
- */
1146
- rollbackVariableToPitId(key, requestBody) {
1147
- return this.httpRequest.request({
1148
- method: "POST",
1149
- url: "/api/env/rollback/variable/{key}/pit",
1150
- path: {
1151
- "key": key
1152
- },
1153
- body: requestBody,
1154
- mediaType: "application/json",
1155
- errors: {
1156
- 500: `Internal server error`
1157
- }
1158
- });
1159
- }
1160
- /**
1161
- * Rollback Single Variable to Timestamp
1162
- * Rollback a specific environment variable to a timestamp
1163
- * @param key
1164
- * @param requestBody
1165
- * @returns VariableRollbackResponse Variable rolled back successfully
1166
- * @throws ApiError
1167
- */
1168
- rollbackVariableToTimestamp(key, requestBody) {
1169
- return this.httpRequest.request({
1170
- method: "POST",
1171
- url: "/api/env/rollback/variable/{key}/timestamp",
1172
- path: {
1173
- "key": key
1174
- },
1175
- body: requestBody,
1176
- mediaType: "application/json",
1177
- errors: {
1178
- 500: `Internal server error`
1179
- }
1180
- });
1181
- }
1182
- };
1183
-
1184
- // src/services/FileUploadService.ts
1185
- var FileUploadService = class {
1186
- constructor(httpRequest) {
1187
- this.httpRequest = httpRequest;
1188
- }
1189
- /**
1190
- * Upload File
1191
- * Upload a file to the server. The file should be less than 5MB in size.
1192
- * @param formData
1193
- * @returns UploadFileResponse File uploaded successfully
1194
- * @throws ApiError
1195
- */
1196
- uploadFile(formData) {
1197
- return this.httpRequest.request({
1198
- method: "POST",
1199
- url: "/api/upload/file",
1200
- formData,
1201
- mediaType: "multipart/form-data",
1202
- errors: {
1203
- 500: `Internal server error`
1204
- }
1205
- });
1206
- }
1207
- };
1208
-
1209
- // src/services/OnboardingService.ts
1210
- var OnboardingService = class {
1211
- constructor(httpRequest) {
1212
- this.httpRequest = httpRequest;
1213
- }
1214
- /**
1215
- * Create Organization Invite
1216
- * Create an organization invite
1217
- * @param requestBody
1218
- * @returns CreateOrgInviteResponse Successful greeting response
1219
- * @throws ApiError
1220
- */
1221
- createOrgInvite(requestBody) {
1222
- return this.httpRequest.request({
1223
- method: "POST",
1224
- url: "/api/onboarding/org",
1225
- body: requestBody,
1226
- mediaType: "application/json",
1227
- errors: {
1228
- 500: `Internal server error`
1229
- }
1230
- });
1231
- }
1232
- /**
1233
- * Get Organization Invite by Code
1234
- * Get organization invite by code
1235
- * @param inviteCode
1236
- * @returns GetOrgInviteByCodeResponse Organization invite retrieved successfully
1237
- * @throws ApiError
1238
- */
1239
- getOrgInviteByCode(inviteCode) {
1240
- return this.httpRequest.request({
1241
- method: "GET",
1242
- url: "/api/onboarding/org/{invite_code}",
1243
- path: {
1244
- "invite_code": inviteCode
1245
- },
1246
- errors: {
1247
- 500: `Internal server error`
1248
- }
1249
- });
1250
- }
1251
- /**
1252
- * Accept Organization Invite
1253
- * Accept organization invite
1254
- * @param inviteCode
1255
- * @param requestBody
1256
- * @returns AcceptOrgInviteResponse Organization invite accepted successfully
1257
- * @throws ApiError
1258
- */
1259
- acceptOrgInvite(inviteCode, requestBody) {
1260
- return this.httpRequest.request({
1261
- method: "PUT",
1262
- url: "/api/onboarding/org/{invite_code}/accept",
1263
- path: {
1264
- "invite_code": inviteCode
1265
- },
1266
- body: requestBody,
1267
- mediaType: "application/json",
1268
- errors: {
1269
- 500: `Internal server error`
1270
- }
1271
- });
1272
- }
1273
- /**
1274
- * Get User Invite by Code
1275
- * Get user invite by code
1276
- * @param inviteCode
1277
- * @returns GetUserInviteByTokenResponse User invite retrieved successfully
1278
- * @throws ApiError
1279
- */
1280
- getUserInviteByCode(inviteCode) {
1281
- return this.httpRequest.request({
1282
- method: "GET",
1283
- url: "/api/onboarding/user/{invite_code}",
1284
- path: {
1285
- "invite_code": inviteCode
1286
- },
1287
- errors: {
1288
- 500: `Internal server error`
1289
- }
1290
- });
1291
- }
1292
- /**
1293
- * Update User Invite
1294
- * Update user invite
1295
- * @param inviteCode
1296
- * @param requestBody
1297
- * @returns UpdateUserInviteResponse User invite updated successfully
1298
- * @throws ApiError
1299
- */
1300
- updateUserInvite(inviteCode, requestBody) {
1301
- return this.httpRequest.request({
1302
- method: "PATCH",
1303
- url: "/api/onboarding/user/{invite_code}",
1304
- path: {
1305
- "invite_code": inviteCode
1306
- },
1307
- body: requestBody,
1308
- mediaType: "application/json",
1309
- errors: {
1310
- 500: `Internal server error`
1311
- }
1312
- });
1313
- }
1314
- /**
1315
- * Accept User Invite
1316
- * Accept user invite
1317
- * @param inviteCode
1318
- * @param requestBody
1319
- * @returns AcceptUserInviteResponse User invite accepted successfully
1320
- * @throws ApiError
1321
- */
1322
- acceptUserInvite(inviteCode, requestBody) {
1323
- return this.httpRequest.request({
1324
- method: "PUT",
1325
- url: "/api/onboarding/user/{invite_code}/accept",
1326
- path: {
1327
- "invite_code": inviteCode
1328
- },
1329
- body: requestBody,
1330
- mediaType: "application/json",
1331
- errors: {
1332
- 500: `Internal server error`
1333
- }
1334
- });
1335
- }
1336
- /**
1337
- * Create User Invite
1338
- * Create a user invite
1339
- * @param requestBody
1340
- * @returns CreateUserInviteResponse User invite created successfully
1341
- * @throws ApiError
1342
- */
1343
- createUserInvite(requestBody) {
1344
- return this.httpRequest.request({
1345
- method: "POST",
1346
- url: "/api/onboarding/user",
1347
- body: requestBody,
1348
- mediaType: "application/json",
1349
- errors: {
1350
- 500: `Internal server error`
1351
- }
1352
- });
1353
- }
1354
- /**
1355
- * Get All User Invites
1356
- * Get all user invites
1357
- * @returns GetUserInviteByTokenResponse User invites retrieved successfully
1358
- * @throws ApiError
1359
- */
1360
- getAllUserInvites() {
1361
- return this.httpRequest.request({
1362
- method: "GET",
1363
- url: "/api/onboarding/user",
1364
- errors: {
1365
- 500: `Internal server error`
1366
- }
1367
- });
1368
- }
1369
- /**
1370
- * Delete User Invite
1371
- * Delete user invite
1372
- * @param inviteId
1373
- * @param requestBody
1374
- * @returns DeleteUserInviteResponse User invite deleted successfully
1375
- * @throws ApiError
1376
- */
1377
- deleteUserInvite(inviteId, requestBody) {
1378
- return this.httpRequest.request({
1379
- method: "DELETE",
1380
- url: "/api/onboarding/user/{invite_id}",
1381
- path: {
1382
- "invite_id": inviteId
1383
- },
1384
- body: requestBody,
1385
- mediaType: "application/json",
1386
- errors: {
1387
- 500: `Internal server error`
1388
- }
1389
- });
1390
- }
1391
- };
1392
-
1393
- // src/services/OrganizationsService.ts
1394
- var OrganizationsService = class {
1395
- constructor(httpRequest) {
1396
- this.httpRequest = httpRequest;
1397
- }
1398
- /**
1399
- * Get Organization
1400
- * Retrieve the current organization's details
1401
- * @returns OrgResponse Organization retrieved successfully
1402
- * @throws ApiError
1403
- */
1404
- getOrg() {
1405
- return this.httpRequest.request({
1406
- method: "GET",
1407
- url: "/api/org",
1408
- errors: {
1409
- 500: `Internal server error`
1410
- }
1411
- });
1412
- }
1413
- /**
1414
- * Update Organization
1415
- * Update the current organization's details
1416
- * @param requestBody
1417
- * @returns OrgResponse Organization updated successfully
1418
- * @throws ApiError
1419
- */
1420
- updateOrg(requestBody) {
1421
- return this.httpRequest.request({
1422
- method: "PATCH",
1423
- url: "/api/org",
1424
- body: requestBody,
1425
- mediaType: "application/json",
1426
- errors: {
1427
- 500: `Internal server error`
1428
- }
1429
- });
1430
- }
1431
- /**
1432
- * Check Slug Availability
1433
- * Check if an organization slug is available
1434
- * @param slug
1435
- * @returns CheckSlugResponse Slug availability checked successfully
1436
- * @throws ApiError
1437
- */
1438
- checkIfSlugExists(slug) {
1439
- return this.httpRequest.request({
1440
- method: "GET",
1441
- url: "/api/org/check-slug",
1442
- query: {
1443
- "slug": slug
1444
- },
1445
- errors: {
1446
- 500: `Internal server error`
1447
- }
1448
- });
1449
- }
1450
- };
1451
-
1452
- // src/services/RolesService.ts
1453
- var RolesService = class {
1454
- constructor(httpRequest) {
1455
- this.httpRequest = httpRequest;
1456
- }
1457
- /**
1458
- * Get All Roles
1459
- * Retrieve all roles in the organization
1460
- * @returns RolesResponse Roles retrieved successfully
1461
- * @throws ApiError
1462
- */
1463
- getAllRoles() {
1464
- return this.httpRequest.request({
1465
- method: "GET",
1466
- url: "/api/role",
1467
- errors: {
1468
- 500: `Internal server error`
1469
- }
1470
- });
1471
- }
1472
- /**
1473
- * Create Role
1474
- * Create a new role in the organization
1475
- * @param requestBody
1476
- * @returns RoleResponse Role created successfully
1477
- * @throws ApiError
1478
- */
1479
- createRole(requestBody) {
1480
- return this.httpRequest.request({
1481
- method: "POST",
1482
- url: "/api/role",
1483
- body: requestBody,
1484
- mediaType: "application/json",
1485
- errors: {
1486
- 500: `Internal server error`
1487
- }
1488
- });
1489
- }
1490
- /**
1491
- * Get Role Statistics
1492
- * Retrieve statistics about roles in the organization
1493
- * @returns RoleStatsResponse Role statistics retrieved successfully
1494
- * @throws ApiError
1495
- */
1496
- getRoleStats() {
1497
- return this.httpRequest.request({
1498
- method: "GET",
1499
- url: "/api/role/stats",
1500
- errors: {
1501
- 500: `Internal server error`
1502
- }
1503
- });
1504
- }
1505
- /**
1506
- * Get Role
1507
- * Retrieve a specific role by ID
1508
- * @param id
1509
- * @returns RoleResponse Role retrieved successfully
1510
- * @throws ApiError
1511
- */
1512
- getRole(id) {
1513
- return this.httpRequest.request({
1514
- method: "GET",
1515
- url: "/api/role/{id}",
1516
- path: {
1517
- "id": id
1518
- },
1519
- errors: {
1520
- 500: `Internal server error`
1521
- }
1522
- });
1523
- }
1524
- /**
1525
- * Update Role
1526
- * Update an existing role
1527
- * @param id
1528
- * @param requestBody
1529
- * @returns RoleResponse Role updated successfully
1530
- * @throws ApiError
1531
- */
1532
- updateRole(id, requestBody) {
1533
- return this.httpRequest.request({
1534
- method: "PATCH",
1535
- url: "/api/role/{id}",
1536
- path: {
1537
- "id": id
1538
- },
1539
- body: requestBody,
1540
- mediaType: "application/json",
1541
- errors: {
1542
- 500: `Internal server error`
1543
- }
1544
- });
1545
- }
1546
- /**
1547
- * Delete Role
1548
- * Delete an existing role (non-master roles only)
1549
- * @param id
1550
- * @returns RoleResponse Role deleted successfully
1551
- * @throws ApiError
1552
- */
1553
- deleteRole(id) {
1554
- return this.httpRequest.request({
1555
- method: "DELETE",
1556
- url: "/api/role/{id}",
1557
- path: {
1558
- "id": id
1559
- },
1560
- errors: {
1561
- 500: `Internal server error`
1562
- }
1563
- });
1564
- }
1565
- };
1566
-
1567
- // src/services/SecretsService.ts
1568
- var SecretsService = class {
1569
- constructor(httpRequest) {
1570
- this.httpRequest = httpRequest;
1571
- }
1572
- /**
1573
- * Get Secrets
1574
- * Retrieve all secrets for an application and environment type
1575
- * @param requestBody
1576
- * @returns SecretsResponse Secrets retrieved successfully
1577
- * @throws ApiError
1578
- */
1579
- getSecrets(requestBody) {
1580
- return this.httpRequest.request({
1581
- method: "POST",
1582
- url: "/api/secret",
1583
- body: requestBody,
1584
- mediaType: "application/json",
1585
- errors: {
1586
- 500: `Internal server error`
1587
- }
1588
- });
1589
- }
1590
- /**
1591
- * Delete Secret
1592
- * Delete an existing secret
1593
- * @param requestBody
1594
- * @returns BatchSecretsResponse Secret deleted successfully
1595
- * @throws ApiError
1596
- */
1597
- deleteSecret(requestBody) {
1598
- return this.httpRequest.request({
1599
- method: "DELETE",
1600
- url: "/api/secret",
1601
- body: requestBody,
1602
- mediaType: "application/json",
1603
- errors: {
1604
- 500: `Internal server error`
1605
- }
1606
- });
1607
- }
1608
- /**
1609
- * Get Single Secret
1610
- * Retrieve a specific secret
1611
- * @param key
1612
- * @param requestBody
1613
- * @returns SecretResponse Secret retrieved successfully
1614
- * @throws ApiError
1615
- */
1616
- getSecret(key, requestBody) {
1617
- return this.httpRequest.request({
1618
- method: "POST",
1619
- url: "/api/secret/i/{key}",
1620
- path: {
1621
- "key": key
1622
- },
1623
- body: requestBody,
1624
- mediaType: "application/json",
1625
- errors: {
1626
- 500: `Internal server error`
1627
- }
1628
- });
1629
- }
1630
- /**
1631
- * Update Secret
1632
- * Update an existing secret
1633
- * @param key
1634
- * @param requestBody
1635
- * @returns BatchSecretsResponse Secret updated successfully
1636
- * @throws ApiError
1637
- */
1638
- updateSecret(key, requestBody) {
1639
- return this.httpRequest.request({
1640
- method: "PATCH",
1641
- url: "/api/secret/i/{key}",
1642
- path: {
1643
- "key": key
1644
- },
1645
- body: requestBody,
1646
- mediaType: "application/json",
1647
- errors: {
1648
- 500: `Internal server error`
1649
- }
1650
- });
1651
- }
1652
- /**
1653
- * Create Secret
1654
- * Create a new secret
1655
- * @param requestBody
1656
- * @returns SecretResponse Secret created successfully
1657
- * @throws ApiError
1658
- */
1659
- createSecret(requestBody) {
1660
- return this.httpRequest.request({
1661
- method: "PUT",
1662
- url: "/api/secret/single",
1663
- body: requestBody,
1664
- mediaType: "application/json",
1665
- errors: {
1666
- 500: `Internal server error`
1667
- }
1668
- });
1669
- }
1670
- /**
1671
- * Batch Create Secrets
1672
- * Create multiple secrets in a single request
1673
- * @param requestBody
1674
- * @returns BatchSecretsResponse Secrets created successfully
1675
- * @throws ApiError
1676
- */
1677
- batchCreateSecrets(requestBody) {
1678
- return this.httpRequest.request({
1679
- method: "PUT",
1680
- url: "/api/secret/batch",
1681
- body: requestBody,
1682
- mediaType: "application/json",
1683
- errors: {
1684
- 500: `Internal server error`
1685
- }
1686
- });
1687
- }
1688
- /**
1689
- * Batch Update Secrets
1690
- * Update multiple secrets in a single request
1691
- * @param requestBody
1692
- * @returns BatchSecretsResponse Secrets updated successfully
1693
- * @throws ApiError
1694
- */
1695
- batchUpdateSecrets(requestBody) {
1696
- return this.httpRequest.request({
1697
- method: "PATCH",
1698
- url: "/api/secret/batch",
1699
- body: requestBody,
1700
- mediaType: "application/json",
1701
- errors: {
1702
- 500: `Internal server error`
1703
- }
1704
- });
1705
- }
1706
- /**
1707
- * Batch Delete Secrets
1708
- * Delete multiple secrets in a single request
1709
- * @param requestBody
1710
- * @returns BatchSecretsResponse Secrets deleted successfully
1711
- * @throws ApiError
1712
- */
1713
- deleteBatchSecrets(requestBody) {
1714
- return this.httpRequest.request({
1715
- method: "DELETE",
1716
- url: "/api/secret/batch",
1717
- body: requestBody,
1718
- mediaType: "application/json",
1719
- errors: {
1720
- 500: `Internal server error`
1721
- }
1722
- });
1723
- }
1724
- /**
1725
- * Reveal Secrets
1726
- * Decrypt and reveal secret values for managed apps
1727
- * @param requestBody
1728
- * @returns RevealSecretsResponse Secrets revealed successfully
1729
- * @throws ApiError
1730
- */
1731
- revealSecrets(requestBody) {
1732
- return this.httpRequest.request({
1733
- method: "POST",
1734
- url: "/api/secret/reveal",
1735
- body: requestBody,
1736
- mediaType: "application/json",
1737
- errors: {
1738
- 500: `Internal server error`
1739
- }
1740
- });
1741
- }
1742
- };
1743
-
1744
- // src/services/SecretsPointInTimeService.ts
1745
- var SecretsPointInTimeService = class {
1746
- constructor(httpRequest) {
1747
- this.httpRequest = httpRequest;
1748
- }
1749
- /**
1750
- * Get Secrets History
1751
- * Retrieve paginated history of secret changes
1752
- * @param requestBody
1753
- * @returns SecretHistoryResponse Secrets history retrieved successfully
1754
- * @throws ApiError
1755
- */
1756
- getSecretHistory(requestBody) {
1757
- return this.httpRequest.request({
1758
- method: "POST",
1759
- url: "/api/secret/history",
1760
- body: requestBody,
1761
- mediaType: "application/json",
1762
- errors: {
1763
- 500: `Internal server error`
1764
- }
1765
- });
1766
- }
1767
- /**
1768
- * Get Secrets at Point in Time
1769
- * Retrieve secrets state at a specific point in time
1770
- * @param requestBody
1771
- * @returns SecretPitStateResponse Secrets at point in time retrieved successfully
1772
- * @throws ApiError
1773
- */
1774
- getSecretsAtPointInTime(requestBody) {
1775
- return this.httpRequest.request({
1776
- method: "POST",
1777
- url: "/api/secret/pit",
1778
- body: requestBody,
1779
- mediaType: "application/json",
1780
- errors: {
1781
- 500: `Internal server error`
1782
- }
1783
- });
1784
- }
1785
- /**
1786
- * Get Secrets at Timestamp
1787
- * Retrieve secrets state at a specific timestamp
1788
- * @param requestBody
1789
- * @returns SecretPitStateResponse Secrets at timestamp retrieved successfully
1790
- * @throws ApiError
1791
- */
1792
- getSecretsAtTimestamp(requestBody) {
1793
- return this.httpRequest.request({
1794
- method: "POST",
1795
- url: "/api/secret/timestamp",
1796
- body: requestBody,
1797
- mediaType: "application/json",
1798
- errors: {
1799
- 500: `Internal server error`
1800
- }
1801
- });
1802
- }
1803
- /**
1804
- * Get Secrets Diff
1805
- * Compare secrets between two points in time
1806
- * @param requestBody
1807
- * @returns SecretDiffResponse Secrets diff retrieved successfully
1808
- * @throws ApiError
1809
- */
1810
- getSecretDiff(requestBody) {
1811
- return this.httpRequest.request({
1812
- method: "POST",
1813
- url: "/api/secret/diff",
1814
- body: requestBody,
1815
- mediaType: "application/json",
1816
- errors: {
1817
- 500: `Internal server error`
1818
- }
1819
- });
1820
- }
1821
- /**
1822
- * Get Secret Variable Timeline
1823
- * Get timeline of changes for a specific secret variable
1824
- * @param key
1825
- * @param requestBody
1826
- * @returns SecretVariableTimelineResponse Secret variable timeline retrieved successfully
1827
- * @throws ApiError
1828
- */
1829
- getSecretVariableTimeline(key, requestBody) {
1830
- return this.httpRequest.request({
1831
- method: "POST",
1832
- url: "/api/secret/timeline/{key}",
1833
- path: {
1834
- "key": key
1835
- },
1836
- body: requestBody,
1837
- mediaType: "application/json",
1838
- errors: {
1839
- 500: `Internal server error`
1840
- }
1841
- });
1842
- }
1843
- };
1844
-
1845
- // src/services/SecretsRollbackService.ts
1846
- var SecretsRollbackService = class {
1847
- constructor(httpRequest) {
1848
- this.httpRequest = httpRequest;
1849
- }
1850
- /**
1851
- * Rollback Secrets to Point in Time
1852
- * Rollback all secrets to a specific point in time
1853
- * @param requestBody
1854
- * @returns RollbackSecretsResponse Secrets rolled back successfully
1855
- * @throws ApiError
1856
- */
1857
- rollbackSecretsToPitId(requestBody) {
1858
- return this.httpRequest.request({
1859
- method: "POST",
1860
- url: "/api/secret/rollback/pit",
1861
- body: requestBody,
1862
- mediaType: "application/json",
1863
- errors: {
1864
- 500: `Internal server error`
1865
- }
1866
- });
1867
- }
1868
- /**
1869
- * Rollback Secrets to Timestamp
1870
- * Rollback all secrets to a specific timestamp
1871
- * @param requestBody
1872
- * @returns RollbackSecretsResponse Secrets rolled back successfully
1873
- * @throws ApiError
1874
- */
1875
- rollbackSecretsToTimestamp(requestBody) {
1876
- return this.httpRequest.request({
1877
- method: "POST",
1878
- url: "/api/secret/rollback/timestamp",
1879
- body: requestBody,
1880
- mediaType: "application/json",
1881
- errors: {
1882
- 500: `Internal server error`
1883
- }
1884
- });
1885
- }
1886
- /**
1887
- * Rollback Single Secret Variable to Point in Time
1888
- * Rollback a specific secret variable to a point in time
1889
- * @param key
1890
- * @param requestBody
1891
- * @returns SecretVariableRollbackResponse Secret variable rolled back successfully
1892
- * @throws ApiError
1893
- */
1894
- rollbackSecretVariableToPitId(key, requestBody) {
1895
- return this.httpRequest.request({
1896
- method: "POST",
1897
- url: "/api/secret/rollback/variable/{key}/pit",
1898
- path: {
1899
- "key": key
1900
- },
1901
- body: requestBody,
1902
- mediaType: "application/json",
1903
- errors: {
1904
- 500: `Internal server error`
1905
- }
1906
- });
1907
- }
1908
- /**
1909
- * Rollback Single Secret Variable to Timestamp
1910
- * Rollback a specific secret variable to a timestamp
1911
- * @param key
1912
- * @param requestBody
1913
- * @returns SecretVariableRollbackResponse Secret variable rolled back successfully
1914
- * @throws ApiError
1915
- */
1916
- rollbackSecretVariableToTimestamp(key, requestBody) {
1917
- return this.httpRequest.request({
1918
- method: "POST",
1919
- url: "/api/secret/rollback/variable/{key}/timestamp",
1920
- path: {
1921
- "key": key
1922
- },
1923
- body: requestBody,
1924
- mediaType: "application/json",
1925
- errors: {
1926
- 500: `Internal server error`
1927
- }
1928
- });
1929
- }
1930
- };
1931
-
1932
- // src/services/UsersService.ts
1933
- var UsersService = class {
1934
- constructor(httpRequest) {
1935
- this.httpRequest = httpRequest;
1936
- }
1937
- /**
1938
- * Get All Users
1939
- * Retrieve all users in the organization
1940
- * @returns UsersResponse Users retrieved successfully
1941
- * @throws ApiError
1942
- */
1943
- getUsers() {
1944
- return this.httpRequest.request({
1945
- method: "GET",
1946
- url: "/api/user",
1947
- errors: {
1948
- 500: `Internal server error`
1949
- }
1950
- });
1951
- }
1952
- /**
1953
- * Get User by ID
1954
- * Retrieve a specific user by their ID
1955
- * @param id
1956
- * @returns UserResponse User retrieved successfully
1957
- * @throws ApiError
1958
- */
1959
- getUserById(id) {
1960
- return this.httpRequest.request({
1961
- method: "GET",
1962
- url: "/api/user/{id}",
1963
- path: {
1964
- "id": id
1965
- },
1966
- errors: {
1967
- 500: `Internal server error`
1968
- }
1969
- });
1970
- }
1971
- /**
1972
- * Update User
1973
- * Update a user's profile information
1974
- * @param id
1975
- * @param requestBody
1976
- * @returns UserResponse User updated successfully
1977
- * @throws ApiError
1978
- */
1979
- updateUser(id, requestBody) {
1980
- return this.httpRequest.request({
1981
- method: "PATCH",
1982
- url: "/api/user/{id}",
1983
- path: {
1984
- "id": id
1985
- },
1986
- body: requestBody,
1987
- mediaType: "application/json",
1988
- errors: {
1989
- 500: `Internal server error`
1990
- }
1991
- });
1992
- }
1993
- /**
1994
- * Delete User
1995
- * Delete a user from the organization (Admin only)
1996
- * @param id
1997
- * @returns UserResponse User deleted successfully
1998
- * @throws ApiError
1999
- */
2000
- deleteUser(id) {
2001
- return this.httpRequest.request({
2002
- method: "DELETE",
2003
- url: "/api/user/{id}",
2004
- path: {
2005
- "id": id
2006
- },
2007
- errors: {
2008
- 500: `Internal server error`
2009
- }
2010
- });
2011
- }
2012
- /**
2013
- * Update User Role
2014
- * Update a user's role (Admin only)
2015
- * @param id
2016
- * @param requestBody
2017
- * @returns UserResponse User role updated successfully
2018
- * @throws ApiError
2019
- */
2020
- updateRole(id, requestBody) {
2021
- return this.httpRequest.request({
2022
- method: "PATCH",
2023
- url: "/api/user/role/{id}",
2024
- path: {
2025
- "id": id
2026
- },
2027
- body: requestBody,
2028
- mediaType: "application/json",
2029
- errors: {
2030
- 500: `Internal server error`
2031
- }
2032
- });
2033
- }
2034
- /**
2035
- * Update User Password
2036
- * Update a user's password (Admin only)
2037
- * @param id
2038
- * @returns UserResponse Password update request sent successfully
2039
- * @throws ApiError
2040
- */
2041
- updatePassword(id) {
2042
- return this.httpRequest.request({
2043
- method: "PATCH",
2044
- url: "/api/user/password/{id}",
2045
- path: {
2046
- "id": id
2047
- },
2048
- errors: {
2049
- 500: `Internal server error`
2050
- }
2051
- });
2052
- }
2053
- };
2054
-
2055
- // src/services/WebhooksService.ts
2056
- var WebhooksService = class {
2057
- constructor(httpRequest) {
2058
- this.httpRequest = httpRequest;
2059
- }
2060
- /**
2061
- * Create Webhook
2062
- * Create a new webhook for the organization
2063
- * @param requestBody
2064
- * @returns WebhookResponse Webhook created successfully
2065
- * @throws ApiError
2066
- */
2067
- createWebhook(requestBody) {
2068
- return this.httpRequest.request({
2069
- method: "POST",
2070
- url: "/api/webhook",
2071
- body: requestBody,
2072
- mediaType: "application/json",
2073
- errors: {
2074
- 500: `Internal server error`
2075
- }
2076
- });
2077
- }
2078
- /**
2079
- * Get All Webhooks
2080
- * Retrieve all webhooks for the organization
2081
- * @returns WebhooksResponse Webhooks retrieved successfully
2082
- * @throws ApiError
2083
- */
2084
- getWebhooks() {
2085
- return this.httpRequest.request({
2086
- method: "GET",
2087
- url: "/api/webhook",
2088
- errors: {
2089
- 500: `Internal server error`
2090
- }
2091
- });
2092
- }
2093
- /**
2094
- * Get Webhook
2095
- * Retrieve a specific webhook
2096
- * @param id
2097
- * @returns WebhookResponse Webhook retrieved successfully
2098
- * @throws ApiError
2099
- */
2100
- getWebhook(id) {
2101
- return this.httpRequest.request({
2102
- method: "GET",
2103
- url: "/api/webhook/{id}",
2104
- path: {
2105
- "id": id
2106
- },
2107
- errors: {
2108
- 500: `Internal server error`
2109
- }
2110
- });
2111
- }
2112
- /**
2113
- * Update Webhook
2114
- * Update an existing webhook
2115
- * @param id
2116
- * @param requestBody
2117
- * @returns WebhookResponse Webhook updated successfully
2118
- * @throws ApiError
2119
- */
2120
- updateWebhook(id, requestBody) {
2121
- return this.httpRequest.request({
2122
- method: "PUT",
2123
- url: "/api/webhook/{id}",
2124
- path: {
2125
- "id": id
2126
- },
2127
- body: requestBody,
2128
- mediaType: "application/json",
2129
- errors: {
2130
- 500: `Internal server error`
2131
- }
2132
- });
2133
- }
2134
- /**
2135
- * Delete Webhook
2136
- * Delete an existing webhook
2137
- * @param id
2138
- * @returns WebhookResponse Webhook deleted successfully
2139
- * @throws ApiError
2140
- */
2141
- deleteWebhook(id) {
2142
- return this.httpRequest.request({
2143
- method: "DELETE",
2144
- url: "/api/webhook/{id}",
2145
- path: {
2146
- "id": id
2147
- },
2148
- errors: {
2149
- 500: `Internal server error`
2150
- }
2151
- });
2152
- }
2153
- };
2154
-
2155
- // src/EnvSyncAPISDK.ts
2156
- var EnvSyncAPISDK = class {
2157
- access;
2158
- apiKeys;
2159
- applications;
2160
- auditLogs;
2161
- authentication;
2162
- environmentTypes;
2163
- environmentVariables;
2164
- environmentVariablesPointInTime;
2165
- environmentVariablesRollback;
2166
- fileUpload;
2167
- onboarding;
2168
- organizations;
2169
- roles;
2170
- secrets;
2171
- secretsPointInTime;
2172
- secretsRollback;
2173
- users;
2174
- webhooks;
2175
- request;
2176
- constructor(config, HttpRequest = FetchHttpRequest) {
2177
- this.request = new HttpRequest({
2178
- BASE: config?.BASE ?? "http://localhost:8600",
2179
- VERSION: config?.VERSION ?? "0.3.6",
2180
- WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
2181
- CREDENTIALS: config?.CREDENTIALS ?? "include",
2182
- TOKEN: config?.TOKEN,
2183
- USERNAME: config?.USERNAME,
2184
- PASSWORD: config?.PASSWORD,
2185
- HEADERS: config?.HEADERS,
2186
- ENCODE_PATH: config?.ENCODE_PATH
2187
- });
2188
- this.access = new AccessService(this.request);
2189
- this.apiKeys = new ApiKeysService(this.request);
2190
- this.applications = new ApplicationsService(this.request);
2191
- this.auditLogs = new AuditLogsService(this.request);
2192
- this.authentication = new AuthenticationService(this.request);
2193
- this.environmentTypes = new EnvironmentTypesService(this.request);
2194
- this.environmentVariables = new EnvironmentVariablesService(this.request);
2195
- this.environmentVariablesPointInTime = new EnvironmentVariablesPointInTimeService(this.request);
2196
- this.environmentVariablesRollback = new EnvironmentVariablesRollbackService(this.request);
2197
- this.fileUpload = new FileUploadService(this.request);
2198
- this.onboarding = new OnboardingService(this.request);
2199
- this.organizations = new OrganizationsService(this.request);
2200
- this.roles = new RolesService(this.request);
2201
- this.secrets = new SecretsService(this.request);
2202
- this.secretsPointInTime = new SecretsPointInTimeService(this.request);
2203
- this.secretsRollback = new SecretsRollbackService(this.request);
2204
- this.users = new UsersService(this.request);
2205
- this.webhooks = new WebhooksService(this.request);
2206
- }
2207
- };
2208
-
2209
- // src/core/OpenAPI.ts
2210
- var OpenAPI = {
2211
- BASE: "http://localhost:8600",
2212
- VERSION: "0.3.6",
2213
- WITH_CREDENTIALS: false,
2214
- CREDENTIALS: "include",
2215
- TOKEN: void 0,
2216
- USERNAME: void 0,
2217
- PASSWORD: void 0,
2218
- HEADERS: void 0,
2219
- ENCODE_PATH: void 0
2220
- };
2221
-
2222
- // src/models/CreateWebhookRequest.ts
2223
- var CreateWebhookRequest;
2224
- ((CreateWebhookRequest2) => {
2225
- let webhook_type;
2226
- ((webhook_type2) => {
2227
- webhook_type2["DISCORD"] = "DISCORD";
2228
- webhook_type2["SLACK"] = "SLACK";
2229
- webhook_type2["CUSTOM"] = "CUSTOM";
2230
- })(webhook_type = CreateWebhookRequest2.webhook_type || (CreateWebhookRequest2.webhook_type = {}));
2231
- let linked_to;
2232
- ((linked_to2) => {
2233
- linked_to2["ORG"] = "org";
2234
- linked_to2["APP"] = "app";
2235
- })(linked_to = CreateWebhookRequest2.linked_to || (CreateWebhookRequest2.linked_to = {}));
2236
- })(CreateWebhookRequest || (CreateWebhookRequest = {}));
2237
-
2238
- // src/models/SecretVariableRollbackResponse.ts
2239
- var SecretVariableRollbackResponse;
2240
- ((SecretVariableRollbackResponse2) => {
2241
- let operation;
2242
- ((operation2) => {
2243
- operation2["CREATE"] = "CREATE";
2244
- operation2["UPDATE"] = "UPDATE";
2245
- operation2["DELETE"] = "DELETE";
2246
- })(operation = SecretVariableRollbackResponse2.operation || (SecretVariableRollbackResponse2.operation = {}));
2247
- })(SecretVariableRollbackResponse || (SecretVariableRollbackResponse = {}));
2248
-
2249
- // src/models/UpdateWebhookRequest.ts
2250
- var UpdateWebhookRequest;
2251
- ((UpdateWebhookRequest2) => {
2252
- let webhook_type;
2253
- ((webhook_type2) => {
2254
- webhook_type2["DISCORD"] = "DISCORD";
2255
- webhook_type2["SLACK"] = "SLACK";
2256
- webhook_type2["CUSTOM"] = "CUSTOM";
2257
- })(webhook_type = UpdateWebhookRequest2.webhook_type || (UpdateWebhookRequest2.webhook_type = {}));
2258
- let linked_to;
2259
- ((linked_to2) => {
2260
- linked_to2["ORG"] = "org";
2261
- linked_to2["APP"] = "app";
2262
- })(linked_to = UpdateWebhookRequest2.linked_to || (UpdateWebhookRequest2.linked_to = {}));
2263
- })(UpdateWebhookRequest || (UpdateWebhookRequest = {}));
2264
-
2265
- // src/models/VariableRollbackResponse.ts
2266
- var VariableRollbackResponse;
2267
- ((VariableRollbackResponse2) => {
2268
- let operation;
2269
- ((operation2) => {
2270
- operation2["CREATE"] = "CREATE";
2271
- operation2["UPDATE"] = "UPDATE";
2272
- operation2["DELETE"] = "DELETE";
2273
- })(operation = VariableRollbackResponse2.operation || (VariableRollbackResponse2.operation = {}));
2274
- })(VariableRollbackResponse || (VariableRollbackResponse = {}));
2275
-
2276
- // src/models/WebhookResponse.ts
2277
- var WebhookResponse;
2278
- ((WebhookResponse2) => {
2279
- let webhook_type;
2280
- ((webhook_type2) => {
2281
- webhook_type2["DISCORD"] = "DISCORD";
2282
- webhook_type2["SLACK"] = "SLACK";
2283
- webhook_type2["CUSTOM"] = "CUSTOM";
2284
- })(webhook_type = WebhookResponse2.webhook_type || (WebhookResponse2.webhook_type = {}));
2285
- let linked_to;
2286
- ((linked_to2) => {
2287
- linked_to2["ORG"] = "org";
2288
- linked_to2["APP"] = "app";
2289
- })(linked_to = WebhookResponse2.linked_to || (WebhookResponse2.linked_to = {}));
2290
- })(WebhookResponse || (WebhookResponse = {}));
2291
- })();