@envsync-cloud/envsync-ts-sdk 0.1.2 → 0.2.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.
@@ -380,9 +380,9 @@
380
380
  this.httpRequest = httpRequest;
381
381
  }
382
382
  /**
383
- * Create CLI Login URL
383
+ * Initiate CLI Login
384
384
  * Generate authentication URL for CLI login
385
- * @returns LoginUrlResponse CLI login URL created successfully
385
+ * @returns LoginUrlResponse CLI login initiated successfully.
386
386
  * @throws ApiError
387
387
  */
388
388
  createCliLogin() {
@@ -394,26 +394,6 @@
394
394
  }
395
395
  });
396
396
  }
397
- /**
398
- * CLI Login Callback
399
- * Handle CLI login callback from Auth0
400
- * @param code
401
- * @returns void
402
- * @throws ApiError
403
- */
404
- callbackCliLogin(code) {
405
- return this.httpRequest.request({
406
- method: "GET",
407
- url: "/api/access/cli/callback",
408
- query: {
409
- "code": code
410
- },
411
- errors: {
412
- 302: `Redirect with authentication token`,
413
- 500: `Internal server error`
414
- }
415
- });
416
- }
417
397
  /**
418
398
  * Create Web Login URL
419
399
  * Generate authentication URL for web login
@@ -485,6 +465,125 @@
485
465
  }
486
466
  };
487
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
+
488
587
  // src/services/ApplicationsService.ts
489
588
  var ApplicationsService = class {
490
589
  constructor(httpRequest) {
@@ -655,24 +754,6 @@
655
754
  }
656
755
  });
657
756
  }
658
- /**
659
- * Create Environment Type
660
- * Create a new environment type
661
- * @param requestBody
662
- * @returns EnvTypeResponse Environment type created successfully
663
- * @throws ApiError
664
- */
665
- createEnvType(requestBody) {
666
- return this.httpRequest.request({
667
- method: "POST",
668
- url: "/api/env_type",
669
- body: requestBody,
670
- mediaType: "application/json",
671
- errors: {
672
- 500: `Internal server error`
673
- }
674
- });
675
- }
676
757
  /**
677
758
  * Get Environment Type
678
759
  * Retrieve a specific environment type
@@ -692,47 +773,6 @@
692
773
  }
693
774
  });
694
775
  }
695
- /**
696
- * Update Environment Type
697
- * Update an existing environment type
698
- * @param id
699
- * @param requestBody
700
- * @returns EnvTypeResponse Environment type updated successfully
701
- * @throws ApiError
702
- */
703
- updateEnvType(id, requestBody) {
704
- return this.httpRequest.request({
705
- method: "PATCH",
706
- url: "/api/env_type/{id}",
707
- path: {
708
- "id": id
709
- },
710
- body: requestBody,
711
- mediaType: "application/json",
712
- errors: {
713
- 500: `Internal server error`
714
- }
715
- });
716
- }
717
- /**
718
- * Delete Environment Type
719
- * Delete an existing environment type
720
- * @param id
721
- * @returns DeleteEnvTypeRequest Environment type deleted successfully
722
- * @throws ApiError
723
- */
724
- deleteEnvType(id) {
725
- return this.httpRequest.request({
726
- method: "DELETE",
727
- url: "/api/env_type/{id}",
728
- path: {
729
- "id": id
730
- },
731
- errors: {
732
- 500: `Internal server error`
733
- }
734
- });
735
- }
736
776
  };
737
777
 
738
778
  // src/services/EnvironmentVariablesService.ts
@@ -1086,6 +1126,121 @@
1086
1126
  }
1087
1127
  };
1088
1128
 
1129
+ // src/services/RolesService.ts
1130
+ var RolesService = class {
1131
+ constructor(httpRequest) {
1132
+ this.httpRequest = httpRequest;
1133
+ }
1134
+ /**
1135
+ * Get All Roles
1136
+ * Retrieve all roles in the organization
1137
+ * @returns RolesResponse Roles retrieved successfully
1138
+ * @throws ApiError
1139
+ */
1140
+ getAllRoles() {
1141
+ return this.httpRequest.request({
1142
+ method: "GET",
1143
+ url: "/api/role",
1144
+ errors: {
1145
+ 500: `Internal server error`
1146
+ }
1147
+ });
1148
+ }
1149
+ /**
1150
+ * Create Role
1151
+ * Create a new role in the organization
1152
+ * @param requestBody
1153
+ * @returns RoleResponse Role created successfully
1154
+ * @throws ApiError
1155
+ */
1156
+ createRole(requestBody) {
1157
+ return this.httpRequest.request({
1158
+ method: "POST",
1159
+ url: "/api/role",
1160
+ body: requestBody,
1161
+ mediaType: "application/json",
1162
+ errors: {
1163
+ 500: `Internal server error`
1164
+ }
1165
+ });
1166
+ }
1167
+ /**
1168
+ * Get Role Statistics
1169
+ * Retrieve statistics about roles in the organization
1170
+ * @returns RoleStatsResponse Role statistics retrieved successfully
1171
+ * @throws ApiError
1172
+ */
1173
+ getRoleStats() {
1174
+ return this.httpRequest.request({
1175
+ method: "GET",
1176
+ url: "/api/role/stats",
1177
+ errors: {
1178
+ 500: `Internal server error`
1179
+ }
1180
+ });
1181
+ }
1182
+ /**
1183
+ * Get Role
1184
+ * Retrieve a specific role by ID
1185
+ * @param id
1186
+ * @returns RoleResponse Role retrieved successfully
1187
+ * @throws ApiError
1188
+ */
1189
+ getRole(id) {
1190
+ return this.httpRequest.request({
1191
+ method: "GET",
1192
+ url: "/api/role/{id}",
1193
+ path: {
1194
+ "id": id
1195
+ },
1196
+ errors: {
1197
+ 500: `Internal server error`
1198
+ }
1199
+ });
1200
+ }
1201
+ /**
1202
+ * Update Role
1203
+ * Update an existing role
1204
+ * @param id
1205
+ * @param requestBody
1206
+ * @returns RoleResponse Role updated successfully
1207
+ * @throws ApiError
1208
+ */
1209
+ updateRole(id, requestBody) {
1210
+ return this.httpRequest.request({
1211
+ method: "PATCH",
1212
+ url: "/api/role/{id}",
1213
+ path: {
1214
+ "id": id
1215
+ },
1216
+ body: requestBody,
1217
+ mediaType: "application/json",
1218
+ errors: {
1219
+ 500: `Internal server error`
1220
+ }
1221
+ });
1222
+ }
1223
+ /**
1224
+ * Delete Role
1225
+ * Delete an existing role (non-master roles only)
1226
+ * @param id
1227
+ * @returns RoleResponse Role deleted successfully
1228
+ * @throws ApiError
1229
+ */
1230
+ deleteRole(id) {
1231
+ return this.httpRequest.request({
1232
+ method: "DELETE",
1233
+ url: "/api/role/{id}",
1234
+ path: {
1235
+ "id": id
1236
+ },
1237
+ errors: {
1238
+ 500: `Internal server error`
1239
+ }
1240
+ });
1241
+ }
1242
+ };
1243
+
1089
1244
  // src/services/UsersService.ts
1090
1245
  var UsersService = class {
1091
1246
  constructor(httpRequest) {
@@ -1215,6 +1370,7 @@
1215
1370
  // src/EnvSyncAPISDK.ts
1216
1371
  var EnvSyncAPISDK = class {
1217
1372
  access;
1373
+ apiKeys;
1218
1374
  applications;
1219
1375
  auditLogs;
1220
1376
  authentication;
@@ -1222,12 +1378,13 @@
1222
1378
  environmentVariables;
1223
1379
  onboarding;
1224
1380
  organizations;
1381
+ roles;
1225
1382
  users;
1226
1383
  request;
1227
1384
  constructor(config, HttpRequest = FetchHttpRequest) {
1228
1385
  this.request = new HttpRequest({
1229
1386
  BASE: config?.BASE ?? "http://localhost:8600",
1230
- VERSION: config?.VERSION ?? "0.1.1",
1387
+ VERSION: config?.VERSION ?? "0.2.0",
1231
1388
  WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
1232
1389
  CREDENTIALS: config?.CREDENTIALS ?? "include",
1233
1390
  TOKEN: config?.TOKEN,
@@ -1237,6 +1394,7 @@
1237
1394
  ENCODE_PATH: config?.ENCODE_PATH
1238
1395
  });
1239
1396
  this.access = new AccessService(this.request);
1397
+ this.apiKeys = new ApiKeysService(this.request);
1240
1398
  this.applications = new ApplicationsService(this.request);
1241
1399
  this.auditLogs = new AuditLogsService(this.request);
1242
1400
  this.authentication = new AuthenticationService(this.request);
@@ -1244,6 +1402,7 @@
1244
1402
  this.environmentVariables = new EnvironmentVariablesService(this.request);
1245
1403
  this.onboarding = new OnboardingService(this.request);
1246
1404
  this.organizations = new OrganizationsService(this.request);
1405
+ this.roles = new RolesService(this.request);
1247
1406
  this.users = new UsersService(this.request);
1248
1407
  }
1249
1408
  };
@@ -1251,7 +1410,7 @@
1251
1410
  // src/core/OpenAPI.ts
1252
1411
  var OpenAPI = {
1253
1412
  BASE: "http://localhost:8600",
1254
- VERSION: "0.1.1",
1413
+ VERSION: "0.2.0",
1255
1414
  WITH_CREDENTIALS: false,
1256
1415
  CREDENTIALS: "include",
1257
1416
  TOKEN: void 0,