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