@envsync-cloud/envsync-management-ts-sdk 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1210 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ ApiError: () => ApiError,
24
+ BaseHttpRequest: () => BaseHttpRequest,
25
+ CancelError: () => CancelError,
26
+ CancelablePromise: () => CancelablePromise,
27
+ CreateIntegrationBindingRequest: () => CreateIntegrationBindingRequest,
28
+ CreateManualSyncRunRequest: () => CreateManualSyncRunRequest,
29
+ CreateProviderConnectionRequest: () => CreateProviderConnectionRequest,
30
+ EnterpriseProviderProfile: () => EnterpriseProviderProfile,
31
+ EnterpriseService: () => EnterpriseService,
32
+ EnvSyncManagementAPISDK: () => EnvSyncManagementAPISDK,
33
+ IntegrationBinding: () => IntegrationBinding,
34
+ LicenseService: () => LicenseService,
35
+ LicenseState: () => LicenseState,
36
+ OnboardingService: () => OnboardingService,
37
+ OpenAPI: () => OpenAPI,
38
+ ProviderConnection: () => ProviderConnection,
39
+ SyncAuditEvent: () => SyncAuditEvent,
40
+ SyncRun: () => SyncRun,
41
+ SystemService: () => SystemService,
42
+ SystemStatusState: () => SystemStatusState,
43
+ UpdateProviderConnectionRequest: () => UpdateProviderConnectionRequest
44
+ });
45
+ module.exports = __toCommonJS(src_exports);
46
+
47
+ // src/core/BaseHttpRequest.ts
48
+ var BaseHttpRequest = class {
49
+ constructor(config) {
50
+ this.config = config;
51
+ }
52
+ };
53
+
54
+ // src/core/ApiError.ts
55
+ var ApiError = class extends Error {
56
+ url;
57
+ status;
58
+ statusText;
59
+ body;
60
+ request;
61
+ constructor(request2, response, message) {
62
+ super(message);
63
+ this.name = "ApiError";
64
+ this.url = response.url;
65
+ this.status = response.status;
66
+ this.statusText = response.statusText;
67
+ this.body = response.body;
68
+ this.request = request2;
69
+ }
70
+ };
71
+
72
+ // src/core/CancelablePromise.ts
73
+ var CancelError = class extends Error {
74
+ constructor(message) {
75
+ super(message);
76
+ this.name = "CancelError";
77
+ }
78
+ get isCancelled() {
79
+ return true;
80
+ }
81
+ };
82
+ var CancelablePromise = class {
83
+ #isResolved;
84
+ #isRejected;
85
+ #isCancelled;
86
+ #cancelHandlers;
87
+ #promise;
88
+ #resolve;
89
+ #reject;
90
+ constructor(executor) {
91
+ this.#isResolved = false;
92
+ this.#isRejected = false;
93
+ this.#isCancelled = false;
94
+ this.#cancelHandlers = [];
95
+ this.#promise = new Promise((resolve2, reject) => {
96
+ this.#resolve = resolve2;
97
+ this.#reject = reject;
98
+ const onResolve = (value) => {
99
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
100
+ return;
101
+ }
102
+ this.#isResolved = true;
103
+ if (this.#resolve) this.#resolve(value);
104
+ };
105
+ const onReject = (reason) => {
106
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
107
+ return;
108
+ }
109
+ this.#isRejected = true;
110
+ if (this.#reject) this.#reject(reason);
111
+ };
112
+ const onCancel = (cancelHandler) => {
113
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
114
+ return;
115
+ }
116
+ this.#cancelHandlers.push(cancelHandler);
117
+ };
118
+ Object.defineProperty(onCancel, "isResolved", {
119
+ get: () => this.#isResolved
120
+ });
121
+ Object.defineProperty(onCancel, "isRejected", {
122
+ get: () => this.#isRejected
123
+ });
124
+ Object.defineProperty(onCancel, "isCancelled", {
125
+ get: () => this.#isCancelled
126
+ });
127
+ return executor(onResolve, onReject, onCancel);
128
+ });
129
+ }
130
+ get [Symbol.toStringTag]() {
131
+ return "Cancellable Promise";
132
+ }
133
+ then(onFulfilled, onRejected) {
134
+ return this.#promise.then(onFulfilled, onRejected);
135
+ }
136
+ catch(onRejected) {
137
+ return this.#promise.catch(onRejected);
138
+ }
139
+ finally(onFinally) {
140
+ return this.#promise.finally(onFinally);
141
+ }
142
+ cancel() {
143
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
144
+ return;
145
+ }
146
+ this.#isCancelled = true;
147
+ if (this.#cancelHandlers.length) {
148
+ try {
149
+ for (const cancelHandler of this.#cancelHandlers) {
150
+ cancelHandler();
151
+ }
152
+ } catch (error) {
153
+ console.warn("Cancellation threw an error", error);
154
+ return;
155
+ }
156
+ }
157
+ this.#cancelHandlers.length = 0;
158
+ if (this.#reject) this.#reject(new CancelError("Request aborted"));
159
+ }
160
+ get isCancelled() {
161
+ return this.#isCancelled;
162
+ }
163
+ };
164
+
165
+ // src/core/request.ts
166
+ var isDefined = (value) => {
167
+ return value !== void 0 && value !== null;
168
+ };
169
+ var isString = (value) => {
170
+ return typeof value === "string";
171
+ };
172
+ var isStringWithValue = (value) => {
173
+ return isString(value) && value !== "";
174
+ };
175
+ var isBlob = (value) => {
176
+ 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]);
177
+ };
178
+ var isFormData = (value) => {
179
+ return value instanceof FormData;
180
+ };
181
+ var base64 = (str) => {
182
+ try {
183
+ return btoa(str);
184
+ } catch (err) {
185
+ return Buffer.from(str).toString("base64");
186
+ }
187
+ };
188
+ var getQueryString = (params) => {
189
+ const qs = [];
190
+ const append = (key, value) => {
191
+ qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
192
+ };
193
+ const process = (key, value) => {
194
+ if (isDefined(value)) {
195
+ if (Array.isArray(value)) {
196
+ value.forEach((v) => {
197
+ process(key, v);
198
+ });
199
+ } else if (typeof value === "object") {
200
+ Object.entries(value).forEach(([k, v]) => {
201
+ process(`${key}[${k}]`, v);
202
+ });
203
+ } else {
204
+ append(key, value);
205
+ }
206
+ }
207
+ };
208
+ Object.entries(params).forEach(([key, value]) => {
209
+ process(key, value);
210
+ });
211
+ if (qs.length > 0) {
212
+ return `?${qs.join("&")}`;
213
+ }
214
+ return "";
215
+ };
216
+ var getUrl = (config, options) => {
217
+ const encoder = config.ENCODE_PATH || encodeURI;
218
+ const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
219
+ if (options.path?.hasOwnProperty(group)) {
220
+ return encoder(String(options.path[group]));
221
+ }
222
+ return substring;
223
+ });
224
+ const url = `${config.BASE}${path}`;
225
+ if (options.query) {
226
+ return `${url}${getQueryString(options.query)}`;
227
+ }
228
+ return url;
229
+ };
230
+ var getFormData = (options) => {
231
+ if (options.formData) {
232
+ const formData = new FormData();
233
+ const process = (key, value) => {
234
+ if (isString(value) || isBlob(value)) {
235
+ formData.append(key, value);
236
+ } else {
237
+ formData.append(key, JSON.stringify(value));
238
+ }
239
+ };
240
+ Object.entries(options.formData).filter(([_, value]) => isDefined(value)).forEach(([key, value]) => {
241
+ if (Array.isArray(value)) {
242
+ value.forEach((v) => process(key, v));
243
+ } else {
244
+ process(key, value);
245
+ }
246
+ });
247
+ return formData;
248
+ }
249
+ return void 0;
250
+ };
251
+ var resolve = async (options, resolver) => {
252
+ if (typeof resolver === "function") {
253
+ return resolver(options);
254
+ }
255
+ return resolver;
256
+ };
257
+ var getHeaders = async (config, options) => {
258
+ const [token, username, password, additionalHeaders] = await Promise.all([
259
+ resolve(options, config.TOKEN),
260
+ resolve(options, config.USERNAME),
261
+ resolve(options, config.PASSWORD),
262
+ resolve(options, config.HEADERS)
263
+ ]);
264
+ const headers = Object.entries({
265
+ Accept: "application/json",
266
+ ...additionalHeaders,
267
+ ...options.headers
268
+ }).filter(([_, value]) => isDefined(value)).reduce((headers2, [key, value]) => ({
269
+ ...headers2,
270
+ [key]: String(value)
271
+ }), {});
272
+ if (isStringWithValue(token)) {
273
+ headers["Authorization"] = `Bearer ${token}`;
274
+ }
275
+ if (isStringWithValue(username) && isStringWithValue(password)) {
276
+ const credentials = base64(`${username}:${password}`);
277
+ headers["Authorization"] = `Basic ${credentials}`;
278
+ }
279
+ if (options.body !== void 0) {
280
+ if (options.mediaType) {
281
+ headers["Content-Type"] = options.mediaType;
282
+ } else if (isBlob(options.body)) {
283
+ headers["Content-Type"] = options.body.type || "application/octet-stream";
284
+ } else if (isString(options.body)) {
285
+ headers["Content-Type"] = "text/plain";
286
+ } else if (!isFormData(options.body)) {
287
+ headers["Content-Type"] = "application/json";
288
+ }
289
+ }
290
+ return new Headers(headers);
291
+ };
292
+ var getRequestBody = (options) => {
293
+ if (options.body !== void 0) {
294
+ if (options.mediaType?.includes("/json")) {
295
+ return JSON.stringify(options.body);
296
+ } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
297
+ return options.body;
298
+ } else {
299
+ return JSON.stringify(options.body);
300
+ }
301
+ }
302
+ return void 0;
303
+ };
304
+ var sendRequest = async (config, options, url, body, formData, headers, onCancel) => {
305
+ const controller = new AbortController();
306
+ const request2 = {
307
+ headers,
308
+ body: body ?? formData,
309
+ method: options.method,
310
+ signal: controller.signal
311
+ };
312
+ if (config.WITH_CREDENTIALS) {
313
+ request2.credentials = config.CREDENTIALS;
314
+ }
315
+ onCancel(() => controller.abort());
316
+ return await fetch(url, request2);
317
+ };
318
+ var getResponseHeader = (response, responseHeader) => {
319
+ if (responseHeader) {
320
+ const content = response.headers.get(responseHeader);
321
+ if (isString(content)) {
322
+ return content;
323
+ }
324
+ }
325
+ return void 0;
326
+ };
327
+ var getResponseBody = async (response) => {
328
+ if (response.status !== 204) {
329
+ try {
330
+ const contentType = response.headers.get("Content-Type");
331
+ if (contentType) {
332
+ const jsonTypes = ["application/json", "application/problem+json"];
333
+ const isJSON = jsonTypes.some((type) => contentType.toLowerCase().startsWith(type));
334
+ if (isJSON) {
335
+ return await response.json();
336
+ } else {
337
+ return await response.text();
338
+ }
339
+ }
340
+ } catch (error) {
341
+ console.error(error);
342
+ }
343
+ }
344
+ return void 0;
345
+ };
346
+ var catchErrorCodes = (options, result) => {
347
+ const errors = {
348
+ 400: "Bad Request",
349
+ 401: "Unauthorized",
350
+ 403: "Forbidden",
351
+ 404: "Not Found",
352
+ 500: "Internal Server Error",
353
+ 502: "Bad Gateway",
354
+ 503: "Service Unavailable",
355
+ ...options.errors
356
+ };
357
+ const error = errors[result.status];
358
+ if (error) {
359
+ throw new ApiError(options, result, error);
360
+ }
361
+ if (!result.ok) {
362
+ const errorStatus = result.status ?? "unknown";
363
+ const errorStatusText = result.statusText ?? "unknown";
364
+ const errorBody = (() => {
365
+ try {
366
+ return JSON.stringify(result.body, null, 2);
367
+ } catch (e) {
368
+ return void 0;
369
+ }
370
+ })();
371
+ throw new ApiError(
372
+ options,
373
+ result,
374
+ `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
375
+ );
376
+ }
377
+ };
378
+ var request = (config, options) => {
379
+ return new CancelablePromise(async (resolve2, reject, onCancel) => {
380
+ try {
381
+ const url = getUrl(config, options);
382
+ const formData = getFormData(options);
383
+ const body = getRequestBody(options);
384
+ const headers = await getHeaders(config, options);
385
+ if (!onCancel.isCancelled) {
386
+ const response = await sendRequest(config, options, url, body, formData, headers, onCancel);
387
+ const responseBody = await getResponseBody(response);
388
+ const responseHeader = getResponseHeader(response, options.responseHeader);
389
+ const result = {
390
+ url,
391
+ ok: response.ok,
392
+ status: response.status,
393
+ statusText: response.statusText,
394
+ body: responseHeader ?? responseBody
395
+ };
396
+ catchErrorCodes(options, result);
397
+ resolve2(result.body);
398
+ }
399
+ } catch (error) {
400
+ reject(error);
401
+ }
402
+ });
403
+ };
404
+
405
+ // src/core/FetchHttpRequest.ts
406
+ var FetchHttpRequest = class extends BaseHttpRequest {
407
+ constructor(config) {
408
+ super(config);
409
+ }
410
+ /**
411
+ * Request method
412
+ * @param options The request options from the service
413
+ * @returns CancelablePromise<T>
414
+ * @throws ApiError
415
+ */
416
+ request(options) {
417
+ return request(this.config, options);
418
+ }
419
+ };
420
+
421
+ // src/services/EnterpriseService.ts
422
+ var EnterpriseService = class {
423
+ constructor(httpRequest) {
424
+ this.httpRequest = httpRequest;
425
+ }
426
+ /**
427
+ * List Enterprise Providers
428
+ * @returns EnterpriseProvidersResponse Enterprise provider catalog
429
+ * @throws ApiError
430
+ */
431
+ listEnterpriseProviders() {
432
+ return this.httpRequest.request({
433
+ method: "GET",
434
+ url: "/api/enterprise/providers",
435
+ errors: {
436
+ 500: `Internal server error`
437
+ }
438
+ });
439
+ }
440
+ /**
441
+ * Get Enterprise Org Secret Model
442
+ * @returns OrgSecretModelResponse Org secret model
443
+ * @throws ApiError
444
+ */
445
+ getEnterpriseOrgSecretModel() {
446
+ return this.httpRequest.request({
447
+ method: "GET",
448
+ url: "/api/enterprise/org-secrets/model",
449
+ errors: {
450
+ 500: `Internal server error`
451
+ }
452
+ });
453
+ }
454
+ /**
455
+ * List Enterprise Provider Connections
456
+ * @returns ProviderConnectionsResponse Provider connections
457
+ * @throws ApiError
458
+ */
459
+ listEnterpriseProviderConnections() {
460
+ return this.httpRequest.request({
461
+ method: "GET",
462
+ url: "/api/enterprise/provider-connections",
463
+ errors: {
464
+ 500: `Internal server error`
465
+ }
466
+ });
467
+ }
468
+ /**
469
+ * Create Enterprise Provider Connection
470
+ * @param requestBody
471
+ * @returns ProviderConnection Provider connection created
472
+ * @throws ApiError
473
+ */
474
+ createEnterpriseProviderConnection(requestBody) {
475
+ return this.httpRequest.request({
476
+ method: "POST",
477
+ url: "/api/enterprise/provider-connections",
478
+ body: requestBody,
479
+ mediaType: "application/json",
480
+ errors: {
481
+ 500: `Internal server error`
482
+ }
483
+ });
484
+ }
485
+ /**
486
+ * Update Enterprise Provider Connection
487
+ * @param id
488
+ * @param requestBody
489
+ * @returns ProviderConnection Provider connection updated
490
+ * @throws ApiError
491
+ */
492
+ updateEnterpriseProviderConnection(id, requestBody) {
493
+ return this.httpRequest.request({
494
+ method: "PATCH",
495
+ url: "/api/enterprise/provider-connections/{id}",
496
+ path: {
497
+ "id": id
498
+ },
499
+ body: requestBody,
500
+ mediaType: "application/json",
501
+ errors: {
502
+ 500: `Internal server error`
503
+ }
504
+ });
505
+ }
506
+ /**
507
+ * List Enterprise Org Secrets
508
+ * @returns OrgSecretsResponse Org secrets
509
+ * @throws ApiError
510
+ */
511
+ listEnterpriseOrgSecrets() {
512
+ return this.httpRequest.request({
513
+ method: "GET",
514
+ url: "/api/enterprise/org-secrets",
515
+ errors: {
516
+ 500: `Internal server error`
517
+ }
518
+ });
519
+ }
520
+ /**
521
+ * Create Enterprise Org Secret
522
+ * @param requestBody
523
+ * @returns OrgSecret Org secret created
524
+ * @throws ApiError
525
+ */
526
+ createEnterpriseOrgSecret(requestBody) {
527
+ return this.httpRequest.request({
528
+ method: "POST",
529
+ url: "/api/enterprise/org-secrets",
530
+ body: requestBody,
531
+ mediaType: "application/json",
532
+ errors: {
533
+ 500: `Internal server error`
534
+ }
535
+ });
536
+ }
537
+ /**
538
+ * Update Enterprise Org Secret
539
+ * @param id
540
+ * @param requestBody
541
+ * @returns OrgSecret Org secret updated
542
+ * @throws ApiError
543
+ */
544
+ updateEnterpriseOrgSecret(id, requestBody) {
545
+ return this.httpRequest.request({
546
+ method: "PATCH",
547
+ url: "/api/enterprise/org-secrets/{id}",
548
+ path: {
549
+ "id": id
550
+ },
551
+ body: requestBody,
552
+ mediaType: "application/json",
553
+ errors: {
554
+ 500: `Internal server error`
555
+ }
556
+ });
557
+ }
558
+ /**
559
+ * List Enterprise Integration Bindings
560
+ * @param appId
561
+ * @returns IntegrationBindingsResponse Integration bindings
562
+ * @throws ApiError
563
+ */
564
+ listEnterpriseIntegrationBindings(appId) {
565
+ return this.httpRequest.request({
566
+ method: "GET",
567
+ url: "/api/enterprise/apps/{app_id}/bindings",
568
+ path: {
569
+ "app_id": appId
570
+ },
571
+ errors: {
572
+ 500: `Internal server error`
573
+ }
574
+ });
575
+ }
576
+ /**
577
+ * Create Enterprise Integration Binding
578
+ * @param appId
579
+ * @param requestBody
580
+ * @returns IntegrationBinding Integration binding created
581
+ * @throws ApiError
582
+ */
583
+ createEnterpriseIntegrationBinding(appId, requestBody) {
584
+ return this.httpRequest.request({
585
+ method: "POST",
586
+ url: "/api/enterprise/apps/{app_id}/bindings",
587
+ path: {
588
+ "app_id": appId
589
+ },
590
+ body: requestBody,
591
+ mediaType: "application/json",
592
+ errors: {
593
+ 500: `Internal server error`
594
+ }
595
+ });
596
+ }
597
+ /**
598
+ * Update Enterprise Integration Binding
599
+ * @param appId
600
+ * @param id
601
+ * @param requestBody
602
+ * @returns IntegrationBinding Integration binding updated
603
+ * @throws ApiError
604
+ */
605
+ updateEnterpriseIntegrationBinding(appId, id, requestBody) {
606
+ return this.httpRequest.request({
607
+ method: "PATCH",
608
+ url: "/api/enterprise/apps/{app_id}/bindings/{id}",
609
+ path: {
610
+ "app_id": appId,
611
+ "id": id
612
+ },
613
+ body: requestBody,
614
+ mediaType: "application/json",
615
+ errors: {
616
+ 500: `Internal server error`
617
+ }
618
+ });
619
+ }
620
+ /**
621
+ * List Enterprise Env-Type Mappings
622
+ * @param appId
623
+ * @returns EnvTypeMappingsResponse Env-type mappings
624
+ * @throws ApiError
625
+ */
626
+ listEnterpriseEnvTypeMappings(appId) {
627
+ return this.httpRequest.request({
628
+ method: "GET",
629
+ url: "/api/enterprise/apps/{app_id}/env-type-mappings",
630
+ path: {
631
+ "app_id": appId
632
+ },
633
+ errors: {
634
+ 500: `Internal server error`
635
+ }
636
+ });
637
+ }
638
+ /**
639
+ * Create Enterprise Env-Type Mapping
640
+ * @param appId
641
+ * @param requestBody
642
+ * @returns EnvTypeMapping Env-type mapping created
643
+ * @throws ApiError
644
+ */
645
+ createEnterpriseEnvTypeMapping(appId, requestBody) {
646
+ return this.httpRequest.request({
647
+ method: "POST",
648
+ url: "/api/enterprise/apps/{app_id}/env-type-mappings",
649
+ path: {
650
+ "app_id": appId
651
+ },
652
+ body: requestBody,
653
+ mediaType: "application/json",
654
+ errors: {
655
+ 500: `Internal server error`
656
+ }
657
+ });
658
+ }
659
+ /**
660
+ * Update Enterprise Env-Type Mapping
661
+ * @param appId
662
+ * @param id
663
+ * @param requestBody
664
+ * @returns EnvTypeMapping Env-type mapping updated
665
+ * @throws ApiError
666
+ */
667
+ updateEnterpriseEnvTypeMapping(appId, id, requestBody) {
668
+ return this.httpRequest.request({
669
+ method: "PATCH",
670
+ url: "/api/enterprise/apps/{app_id}/env-type-mappings/{id}",
671
+ path: {
672
+ "app_id": appId,
673
+ "id": id
674
+ },
675
+ body: requestBody,
676
+ mediaType: "application/json",
677
+ errors: {
678
+ 500: `Internal server error`
679
+ }
680
+ });
681
+ }
682
+ /**
683
+ * List Enterprise Sync Runs
684
+ * @returns SyncRunsResponse Sync runs
685
+ * @throws ApiError
686
+ */
687
+ listEnterpriseSyncRuns() {
688
+ return this.httpRequest.request({
689
+ method: "GET",
690
+ url: "/api/enterprise/sync-runs",
691
+ errors: {
692
+ 500: `Internal server error`
693
+ }
694
+ });
695
+ }
696
+ /**
697
+ * Create Enterprise Manual Sync Run
698
+ * @param requestBody
699
+ * @returns SyncRun Sync run created
700
+ * @throws ApiError
701
+ */
702
+ createEnterpriseManualSyncRun(requestBody) {
703
+ return this.httpRequest.request({
704
+ method: "POST",
705
+ url: "/api/enterprise/sync-runs/manual",
706
+ body: requestBody,
707
+ mediaType: "application/json",
708
+ errors: {
709
+ 500: `Internal server error`
710
+ }
711
+ });
712
+ }
713
+ /**
714
+ * List Enterprise Sync Audit Events
715
+ * @param syncRunId
716
+ * @returns SyncAuditEventsResponse Sync audit events
717
+ * @throws ApiError
718
+ */
719
+ listEnterpriseSyncAuditEvents(syncRunId) {
720
+ return this.httpRequest.request({
721
+ method: "GET",
722
+ url: "/api/enterprise/sync-runs/{sync_run_id}/events",
723
+ path: {
724
+ "sync_run_id": syncRunId
725
+ },
726
+ errors: {
727
+ 500: `Internal server error`
728
+ }
729
+ });
730
+ }
731
+ };
732
+
733
+ // src/services/LicenseService.ts
734
+ var LicenseService = class {
735
+ constructor(httpRequest) {
736
+ this.httpRequest = httpRequest;
737
+ }
738
+ /**
739
+ * Get Management License Status
740
+ * @returns LicenseStatusResponse Current license status
741
+ * @throws ApiError
742
+ */
743
+ getManagementLicenseStatus() {
744
+ return this.httpRequest.request({
745
+ method: "GET",
746
+ url: "/api/license/status",
747
+ errors: {
748
+ 500: `Internal server error`
749
+ }
750
+ });
751
+ }
752
+ /**
753
+ * Activate Management License
754
+ * @returns LicenseActionResponse License activated
755
+ * @throws ApiError
756
+ */
757
+ activateManagementLicense() {
758
+ return this.httpRequest.request({
759
+ method: "POST",
760
+ url: "/api/license/activate",
761
+ errors: {
762
+ 500: `Internal server error`
763
+ }
764
+ });
765
+ }
766
+ /**
767
+ * Verify Management License
768
+ * @returns LicenseActionResponse License verified
769
+ * @throws ApiError
770
+ */
771
+ verifyManagementLicense() {
772
+ return this.httpRequest.request({
773
+ method: "POST",
774
+ url: "/api/license/verify",
775
+ errors: {
776
+ 500: `Internal server error`
777
+ }
778
+ });
779
+ }
780
+ };
781
+
782
+ // src/services/OnboardingService.ts
783
+ var OnboardingService = class {
784
+ constructor(httpRequest) {
785
+ this.httpRequest = httpRequest;
786
+ }
787
+ /**
788
+ * Create Organization Invite
789
+ * Create an organization invite
790
+ * @param requestBody
791
+ * @returns CreateOrgInviteResponse Successful greeting response
792
+ * @throws ApiError
793
+ */
794
+ createOrgInvite(requestBody) {
795
+ return this.httpRequest.request({
796
+ method: "POST",
797
+ url: "/api/onboarding/org",
798
+ body: requestBody,
799
+ mediaType: "application/json",
800
+ errors: {
801
+ 500: `Internal server error`
802
+ }
803
+ });
804
+ }
805
+ /**
806
+ * Get Organization Invite by Code
807
+ * Get organization invite by code
808
+ * @param inviteCode
809
+ * @returns GetOrgInviteByCodeResponse Organization invite retrieved successfully
810
+ * @throws ApiError
811
+ */
812
+ getOrgInviteByCode(inviteCode) {
813
+ return this.httpRequest.request({
814
+ method: "GET",
815
+ url: "/api/onboarding/org/{invite_code}",
816
+ path: {
817
+ "invite_code": inviteCode
818
+ },
819
+ errors: {
820
+ 500: `Internal server error`
821
+ }
822
+ });
823
+ }
824
+ /**
825
+ * Accept Organization Invite
826
+ * Accept organization invite
827
+ * @param inviteCode
828
+ * @param requestBody
829
+ * @returns AcceptOrgInviteResponse Organization invite accepted successfully
830
+ * @throws ApiError
831
+ */
832
+ acceptOrgInvite(inviteCode, requestBody) {
833
+ return this.httpRequest.request({
834
+ method: "PUT",
835
+ url: "/api/onboarding/org/{invite_code}/accept",
836
+ path: {
837
+ "invite_code": inviteCode
838
+ },
839
+ body: requestBody,
840
+ mediaType: "application/json",
841
+ errors: {
842
+ 500: `Internal server error`
843
+ }
844
+ });
845
+ }
846
+ /**
847
+ * Get User Invite by Code
848
+ * Get user invite by code
849
+ * @param inviteCode
850
+ * @returns GetUserInviteByTokenResponse User invite retrieved successfully
851
+ * @throws ApiError
852
+ */
853
+ getUserInviteByCode(inviteCode) {
854
+ return this.httpRequest.request({
855
+ method: "GET",
856
+ url: "/api/onboarding/user/{invite_code}",
857
+ path: {
858
+ "invite_code": inviteCode
859
+ },
860
+ errors: {
861
+ 500: `Internal server error`
862
+ }
863
+ });
864
+ }
865
+ /**
866
+ * Update User Invite
867
+ * Update user invite
868
+ * @param inviteCode
869
+ * @param requestBody
870
+ * @returns UpdateUserInviteResponse User invite updated successfully
871
+ * @throws ApiError
872
+ */
873
+ updateUserInvite(inviteCode, requestBody) {
874
+ return this.httpRequest.request({
875
+ method: "PATCH",
876
+ url: "/api/onboarding/user/{invite_code}",
877
+ path: {
878
+ "invite_code": inviteCode
879
+ },
880
+ body: requestBody,
881
+ mediaType: "application/json",
882
+ errors: {
883
+ 500: `Internal server error`
884
+ }
885
+ });
886
+ }
887
+ /**
888
+ * Accept User Invite
889
+ * Accept user invite
890
+ * @param inviteCode
891
+ * @param requestBody
892
+ * @returns AcceptUserInviteResponse User invite accepted successfully
893
+ * @throws ApiError
894
+ */
895
+ acceptUserInvite(inviteCode, requestBody) {
896
+ return this.httpRequest.request({
897
+ method: "PUT",
898
+ url: "/api/onboarding/user/{invite_code}/accept",
899
+ path: {
900
+ "invite_code": inviteCode
901
+ },
902
+ body: requestBody,
903
+ mediaType: "application/json",
904
+ errors: {
905
+ 500: `Internal server error`
906
+ }
907
+ });
908
+ }
909
+ /**
910
+ * Create User Invite
911
+ * Create a user invite
912
+ * @param requestBody
913
+ * @returns CreateUserInviteResponse User invite created successfully
914
+ * @throws ApiError
915
+ */
916
+ createUserInvite(requestBody) {
917
+ return this.httpRequest.request({
918
+ method: "POST",
919
+ url: "/api/onboarding/user",
920
+ body: requestBody,
921
+ mediaType: "application/json",
922
+ errors: {
923
+ 500: `Internal server error`
924
+ }
925
+ });
926
+ }
927
+ /**
928
+ * Get All User Invites
929
+ * Get all user invites
930
+ * @returns GetUserInviteByTokenResponse User invites retrieved successfully
931
+ * @throws ApiError
932
+ */
933
+ getAllUserInvites() {
934
+ return this.httpRequest.request({
935
+ method: "GET",
936
+ url: "/api/onboarding/user",
937
+ errors: {
938
+ 500: `Internal server error`
939
+ }
940
+ });
941
+ }
942
+ /**
943
+ * Delete User Invite
944
+ * Delete user invite
945
+ * @param inviteId
946
+ * @returns DeleteUserInviteResponse User invite deleted successfully
947
+ * @throws ApiError
948
+ */
949
+ deleteUserInvite(inviteId) {
950
+ return this.httpRequest.request({
951
+ method: "DELETE",
952
+ url: "/api/onboarding/user/{invite_id}",
953
+ path: {
954
+ "invite_id": inviteId
955
+ },
956
+ errors: {
957
+ 500: `Internal server error`
958
+ }
959
+ });
960
+ }
961
+ };
962
+
963
+ // src/services/SystemService.ts
964
+ var SystemService = class {
965
+ constructor(httpRequest) {
966
+ this.httpRequest = httpRequest;
967
+ }
968
+ /**
969
+ * Get Management System Status
970
+ * @returns SystemStatusResponse Management system status
971
+ * @throws ApiError
972
+ */
973
+ getManagementSystemStatus() {
974
+ return this.httpRequest.request({
975
+ method: "GET",
976
+ url: "/api/system/status",
977
+ errors: {
978
+ 500: `Internal server error`
979
+ }
980
+ });
981
+ }
982
+ };
983
+
984
+ // src/EnvSyncManagementAPISDK.ts
985
+ var EnvSyncManagementAPISDK = class {
986
+ enterprise;
987
+ license;
988
+ onboarding;
989
+ system;
990
+ request;
991
+ constructor(config, HttpRequest = FetchHttpRequest) {
992
+ this.request = new HttpRequest({
993
+ BASE: config?.BASE ?? "http://localhost:4001",
994
+ VERSION: config?.VERSION ?? "0.8.5",
995
+ WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
996
+ CREDENTIALS: config?.CREDENTIALS ?? "include",
997
+ TOKEN: config?.TOKEN,
998
+ USERNAME: config?.USERNAME,
999
+ PASSWORD: config?.PASSWORD,
1000
+ HEADERS: config?.HEADERS,
1001
+ ENCODE_PATH: config?.ENCODE_PATH
1002
+ });
1003
+ this.enterprise = new EnterpriseService(this.request);
1004
+ this.license = new LicenseService(this.request);
1005
+ this.onboarding = new OnboardingService(this.request);
1006
+ this.system = new SystemService(this.request);
1007
+ }
1008
+ };
1009
+
1010
+ // src/core/OpenAPI.ts
1011
+ var OpenAPI = {
1012
+ BASE: "http://localhost:4001",
1013
+ VERSION: "0.8.5",
1014
+ WITH_CREDENTIALS: false,
1015
+ CREDENTIALS: "include",
1016
+ TOKEN: void 0,
1017
+ USERNAME: void 0,
1018
+ PASSWORD: void 0,
1019
+ HEADERS: void 0,
1020
+ ENCODE_PATH: void 0
1021
+ };
1022
+
1023
+ // src/models/CreateIntegrationBindingRequest.ts
1024
+ var CreateIntegrationBindingRequest;
1025
+ ((CreateIntegrationBindingRequest2) => {
1026
+ let provider_type;
1027
+ ((provider_type2) => {
1028
+ provider_type2["GITHUB"] = "github";
1029
+ provider_type2["GITLAB"] = "gitlab";
1030
+ provider_type2["AWS_SSM"] = "aws-ssm";
1031
+ provider_type2["VERCEL"] = "vercel";
1032
+ provider_type2["GOOGLE_SECRET_MANAGER"] = "google-secret-manager";
1033
+ })(provider_type = CreateIntegrationBindingRequest2.provider_type || (CreateIntegrationBindingRequest2.provider_type = {}));
1034
+ })(CreateIntegrationBindingRequest || (CreateIntegrationBindingRequest = {}));
1035
+
1036
+ // src/models/CreateManualSyncRunRequest.ts
1037
+ var CreateManualSyncRunRequest;
1038
+ ((CreateManualSyncRunRequest2) => {
1039
+ let provider_type;
1040
+ ((provider_type2) => {
1041
+ provider_type2["GITHUB"] = "github";
1042
+ provider_type2["GITLAB"] = "gitlab";
1043
+ provider_type2["AWS_SSM"] = "aws-ssm";
1044
+ provider_type2["VERCEL"] = "vercel";
1045
+ provider_type2["GOOGLE_SECRET_MANAGER"] = "google-secret-manager";
1046
+ })(provider_type = CreateManualSyncRunRequest2.provider_type || (CreateManualSyncRunRequest2.provider_type = {}));
1047
+ })(CreateManualSyncRunRequest || (CreateManualSyncRunRequest = {}));
1048
+
1049
+ // src/models/CreateProviderConnectionRequest.ts
1050
+ var CreateProviderConnectionRequest;
1051
+ ((CreateProviderConnectionRequest2) => {
1052
+ let provider_type;
1053
+ ((provider_type2) => {
1054
+ provider_type2["GITHUB"] = "github";
1055
+ provider_type2["GITLAB"] = "gitlab";
1056
+ provider_type2["AWS_SSM"] = "aws-ssm";
1057
+ provider_type2["VERCEL"] = "vercel";
1058
+ provider_type2["GOOGLE_SECRET_MANAGER"] = "google-secret-manager";
1059
+ })(provider_type = CreateProviderConnectionRequest2.provider_type || (CreateProviderConnectionRequest2.provider_type = {}));
1060
+ let status;
1061
+ ((status2) => {
1062
+ status2["ACTIVE"] = "active";
1063
+ status2["INACTIVE"] = "inactive";
1064
+ status2["ERROR"] = "error";
1065
+ })(status = CreateProviderConnectionRequest2.status || (CreateProviderConnectionRequest2.status = {}));
1066
+ })(CreateProviderConnectionRequest || (CreateProviderConnectionRequest = {}));
1067
+
1068
+ // src/models/EnterpriseProviderProfile.ts
1069
+ var EnterpriseProviderProfile;
1070
+ ((EnterpriseProviderProfile2) => {
1071
+ let id;
1072
+ ((id2) => {
1073
+ id2["GITHUB"] = "github";
1074
+ id2["GITLAB"] = "gitlab";
1075
+ id2["AWS_SSM"] = "aws-ssm";
1076
+ id2["VERCEL"] = "vercel";
1077
+ id2["GOOGLE_SECRET_MANAGER"] = "google-secret-manager";
1078
+ })(id = EnterpriseProviderProfile2.id || (EnterpriseProviderProfile2.id = {}));
1079
+ })(EnterpriseProviderProfile || (EnterpriseProviderProfile = {}));
1080
+
1081
+ // src/models/IntegrationBinding.ts
1082
+ var IntegrationBinding;
1083
+ ((IntegrationBinding2) => {
1084
+ let provider_type;
1085
+ ((provider_type2) => {
1086
+ provider_type2["GITHUB"] = "github";
1087
+ provider_type2["GITLAB"] = "gitlab";
1088
+ provider_type2["AWS_SSM"] = "aws-ssm";
1089
+ provider_type2["VERCEL"] = "vercel";
1090
+ provider_type2["GOOGLE_SECRET_MANAGER"] = "google-secret-manager";
1091
+ })(provider_type = IntegrationBinding2.provider_type || (IntegrationBinding2.provider_type = {}));
1092
+ })(IntegrationBinding || (IntegrationBinding = {}));
1093
+
1094
+ // src/models/LicenseState.ts
1095
+ var LicenseState;
1096
+ ((LicenseState2) => {
1097
+ let status;
1098
+ ((status2) => {
1099
+ status2["UNKNOWN"] = "unknown";
1100
+ status2["ACTIVE"] = "active";
1101
+ status2["INACTIVE"] = "inactive";
1102
+ status2["EXPIRED"] = "expired";
1103
+ status2["ERROR"] = "error";
1104
+ status2["LOCKED"] = "locked";
1105
+ })(status = LicenseState2.status || (LicenseState2.status = {}));
1106
+ })(LicenseState || (LicenseState = {}));
1107
+
1108
+ // src/models/ProviderConnection.ts
1109
+ var ProviderConnection;
1110
+ ((ProviderConnection2) => {
1111
+ let provider_type;
1112
+ ((provider_type2) => {
1113
+ provider_type2["GITHUB"] = "github";
1114
+ provider_type2["GITLAB"] = "gitlab";
1115
+ provider_type2["AWS_SSM"] = "aws-ssm";
1116
+ provider_type2["VERCEL"] = "vercel";
1117
+ provider_type2["GOOGLE_SECRET_MANAGER"] = "google-secret-manager";
1118
+ })(provider_type = ProviderConnection2.provider_type || (ProviderConnection2.provider_type = {}));
1119
+ let status;
1120
+ ((status2) => {
1121
+ status2["ACTIVE"] = "active";
1122
+ status2["INACTIVE"] = "inactive";
1123
+ status2["ERROR"] = "error";
1124
+ })(status = ProviderConnection2.status || (ProviderConnection2.status = {}));
1125
+ })(ProviderConnection || (ProviderConnection = {}));
1126
+
1127
+ // src/models/SyncAuditEvent.ts
1128
+ var SyncAuditEvent;
1129
+ ((SyncAuditEvent2) => {
1130
+ let provider_type;
1131
+ ((provider_type2) => {
1132
+ provider_type2["GITHUB"] = "github";
1133
+ provider_type2["GITLAB"] = "gitlab";
1134
+ provider_type2["AWS_SSM"] = "aws-ssm";
1135
+ provider_type2["VERCEL"] = "vercel";
1136
+ provider_type2["GOOGLE_SECRET_MANAGER"] = "google-secret-manager";
1137
+ })(provider_type = SyncAuditEvent2.provider_type || (SyncAuditEvent2.provider_type = {}));
1138
+ let result;
1139
+ ((result2) => {
1140
+ result2["INFO"] = "info";
1141
+ result2["SUCCESS"] = "success";
1142
+ result2["ERROR"] = "error";
1143
+ })(result = SyncAuditEvent2.result || (SyncAuditEvent2.result = {}));
1144
+ })(SyncAuditEvent || (SyncAuditEvent = {}));
1145
+
1146
+ // src/models/SyncRun.ts
1147
+ var SyncRun;
1148
+ ((SyncRun2) => {
1149
+ let provider_type;
1150
+ ((provider_type2) => {
1151
+ provider_type2["GITHUB"] = "github";
1152
+ provider_type2["GITLAB"] = "gitlab";
1153
+ provider_type2["AWS_SSM"] = "aws-ssm";
1154
+ provider_type2["VERCEL"] = "vercel";
1155
+ provider_type2["GOOGLE_SECRET_MANAGER"] = "google-secret-manager";
1156
+ })(provider_type = SyncRun2.provider_type || (SyncRun2.provider_type = {}));
1157
+ let status;
1158
+ ((status2) => {
1159
+ status2["PENDING"] = "pending";
1160
+ status2["RUNNING"] = "running";
1161
+ status2["SUCCEEDED"] = "succeeded";
1162
+ status2["FAILED"] = "failed";
1163
+ })(status = SyncRun2.status || (SyncRun2.status = {}));
1164
+ })(SyncRun || (SyncRun = {}));
1165
+
1166
+ // src/models/SystemStatusState.ts
1167
+ var SystemStatusState;
1168
+ ((SystemStatusState2) => {
1169
+ let edition;
1170
+ ((edition2) => {
1171
+ edition2["OSS"] = "oss";
1172
+ edition2["ENTERPRISE"] = "enterprise";
1173
+ })(edition = SystemStatusState2.edition || (SystemStatusState2.edition = {}));
1174
+ })(SystemStatusState || (SystemStatusState = {}));
1175
+
1176
+ // src/models/UpdateProviderConnectionRequest.ts
1177
+ var UpdateProviderConnectionRequest;
1178
+ ((UpdateProviderConnectionRequest2) => {
1179
+ let status;
1180
+ ((status2) => {
1181
+ status2["ACTIVE"] = "active";
1182
+ status2["INACTIVE"] = "inactive";
1183
+ status2["ERROR"] = "error";
1184
+ })(status = UpdateProviderConnectionRequest2.status || (UpdateProviderConnectionRequest2.status = {}));
1185
+ })(UpdateProviderConnectionRequest || (UpdateProviderConnectionRequest = {}));
1186
+ // Annotate the CommonJS export names for ESM import in node:
1187
+ 0 && (module.exports = {
1188
+ ApiError,
1189
+ BaseHttpRequest,
1190
+ CancelError,
1191
+ CancelablePromise,
1192
+ CreateIntegrationBindingRequest,
1193
+ CreateManualSyncRunRequest,
1194
+ CreateProviderConnectionRequest,
1195
+ EnterpriseProviderProfile,
1196
+ EnterpriseService,
1197
+ EnvSyncManagementAPISDK,
1198
+ IntegrationBinding,
1199
+ LicenseService,
1200
+ LicenseState,
1201
+ OnboardingService,
1202
+ OpenAPI,
1203
+ ProviderConnection,
1204
+ SyncAuditEvent,
1205
+ SyncRun,
1206
+ SystemService,
1207
+ SystemStatusState,
1208
+ UpdateProviderConnectionRequest
1209
+ });
1210
+ //# sourceMappingURL=index.js.map