@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.
package/dist/index.mjs CHANGED
@@ -378,9 +378,9 @@ var AccessService = class {
378
378
  this.httpRequest = httpRequest;
379
379
  }
380
380
  /**
381
- * Create CLI Login URL
381
+ * Initiate CLI Login
382
382
  * Generate authentication URL for CLI login
383
- * @returns LoginUrlResponse CLI login URL created successfully
383
+ * @returns LoginUrlResponse CLI login initiated successfully.
384
384
  * @throws ApiError
385
385
  */
386
386
  createCliLogin() {
@@ -392,26 +392,6 @@ var AccessService = class {
392
392
  }
393
393
  });
394
394
  }
395
- /**
396
- * CLI Login Callback
397
- * Handle CLI login callback from Auth0
398
- * @param code
399
- * @returns void
400
- * @throws ApiError
401
- */
402
- callbackCliLogin(code) {
403
- return this.httpRequest.request({
404
- method: "GET",
405
- url: "/api/access/cli/callback",
406
- query: {
407
- "code": code
408
- },
409
- errors: {
410
- 302: `Redirect with authentication token`,
411
- 500: `Internal server error`
412
- }
413
- });
414
- }
415
395
  /**
416
396
  * Create Web Login URL
417
397
  * Generate authentication URL for web login
@@ -483,6 +463,125 @@ var AccessService = class {
483
463
  }
484
464
  };
485
465
 
466
+ // src/services/ApiKeysService.ts
467
+ var ApiKeysService = class {
468
+ constructor(httpRequest) {
469
+ this.httpRequest = httpRequest;
470
+ }
471
+ /**
472
+ * Create API Key
473
+ * Create a new API key for the organization
474
+ * @param requestBody
475
+ * @returns ApiKeyResponse API key created successfully
476
+ * @throws ApiError
477
+ */
478
+ createApiKey(requestBody) {
479
+ return this.httpRequest.request({
480
+ method: "POST",
481
+ url: "/api/api_key",
482
+ body: requestBody,
483
+ mediaType: "application/json",
484
+ errors: {
485
+ 500: `Internal server error`
486
+ }
487
+ });
488
+ }
489
+ /**
490
+ * Get All API Keys
491
+ * Retrieve all API keys for the organization
492
+ * @returns ApiKeysResponse API keys retrieved successfully
493
+ * @throws ApiError
494
+ */
495
+ getAllApiKeys() {
496
+ return this.httpRequest.request({
497
+ method: "GET",
498
+ url: "/api/api_key",
499
+ errors: {
500
+ 500: `Internal server error`
501
+ }
502
+ });
503
+ }
504
+ /**
505
+ * Get API Key
506
+ * Retrieve a specific API key
507
+ * @param id
508
+ * @returns ApiKeyResponse API key retrieved successfully
509
+ * @throws ApiError
510
+ */
511
+ getApiKey(id) {
512
+ return this.httpRequest.request({
513
+ method: "GET",
514
+ url: "/api/api_key/{id}",
515
+ path: {
516
+ "id": id
517
+ },
518
+ errors: {
519
+ 500: `Internal server error`
520
+ }
521
+ });
522
+ }
523
+ /**
524
+ * Update API Key
525
+ * Update an existing API key
526
+ * @param id
527
+ * @param requestBody
528
+ * @returns ApiKeyResponse API key updated successfully
529
+ * @throws ApiError
530
+ */
531
+ updateApiKey(id, requestBody) {
532
+ return this.httpRequest.request({
533
+ method: "PUT",
534
+ url: "/api/api_key/{id}",
535
+ path: {
536
+ "id": id
537
+ },
538
+ body: requestBody,
539
+ mediaType: "application/json",
540
+ errors: {
541
+ 500: `Internal server error`
542
+ }
543
+ });
544
+ }
545
+ /**
546
+ * Delete API Key
547
+ * Delete an existing API key
548
+ * @param id
549
+ * @returns ApiKeyResponse API key deleted successfully
550
+ * @throws ApiError
551
+ */
552
+ deleteApiKey(id) {
553
+ return this.httpRequest.request({
554
+ method: "DELETE",
555
+ url: "/api/api_key/{id}",
556
+ path: {
557
+ "id": id
558
+ },
559
+ errors: {
560
+ 500: `Internal server error`
561
+ }
562
+ });
563
+ }
564
+ /**
565
+ * Regenerate API Key
566
+ * Generate a new value for an existing API key
567
+ * @param id
568
+ * @returns RegenerateApiKeyResponse API key regenerated successfully
569
+ * @throws ApiError
570
+ */
571
+ regenerateApiKey(id) {
572
+ return this.httpRequest.request({
573
+ method: "GET",
574
+ url: "/api/api_key/{id}/regenerate",
575
+ path: {
576
+ "id": id
577
+ },
578
+ errors: {
579
+ 500: `Internal server error`
580
+ }
581
+ });
582
+ }
583
+ };
584
+
486
585
  // src/services/ApplicationsService.ts
487
586
  var ApplicationsService = class {
488
587
  constructor(httpRequest) {
@@ -653,24 +752,6 @@ var EnvironmentTypesService = class {
653
752
  }
654
753
  });
655
754
  }
656
- /**
657
- * Create Environment Type
658
- * Create a new environment type
659
- * @param requestBody
660
- * @returns EnvTypeResponse Environment type created successfully
661
- * @throws ApiError
662
- */
663
- createEnvType(requestBody) {
664
- return this.httpRequest.request({
665
- method: "POST",
666
- url: "/api/env_type",
667
- body: requestBody,
668
- mediaType: "application/json",
669
- errors: {
670
- 500: `Internal server error`
671
- }
672
- });
673
- }
674
755
  /**
675
756
  * Get Environment Type
676
757
  * Retrieve a specific environment type
@@ -690,47 +771,6 @@ var EnvironmentTypesService = class {
690
771
  }
691
772
  });
692
773
  }
693
- /**
694
- * Update Environment Type
695
- * Update an existing environment type
696
- * @param id
697
- * @param requestBody
698
- * @returns EnvTypeResponse Environment type updated successfully
699
- * @throws ApiError
700
- */
701
- updateEnvType(id, requestBody) {
702
- return this.httpRequest.request({
703
- method: "PATCH",
704
- url: "/api/env_type/{id}",
705
- path: {
706
- "id": id
707
- },
708
- body: requestBody,
709
- mediaType: "application/json",
710
- errors: {
711
- 500: `Internal server error`
712
- }
713
- });
714
- }
715
- /**
716
- * Delete Environment Type
717
- * Delete an existing environment type
718
- * @param id
719
- * @returns DeleteEnvTypeRequest Environment type deleted successfully
720
- * @throws ApiError
721
- */
722
- deleteEnvType(id) {
723
- return this.httpRequest.request({
724
- method: "DELETE",
725
- url: "/api/env_type/{id}",
726
- path: {
727
- "id": id
728
- },
729
- errors: {
730
- 500: `Internal server error`
731
- }
732
- });
733
- }
734
774
  };
735
775
 
736
776
  // src/services/EnvironmentVariablesService.ts
@@ -1084,6 +1124,121 @@ var OrganizationsService = class {
1084
1124
  }
1085
1125
  };
1086
1126
 
1127
+ // src/services/RolesService.ts
1128
+ var RolesService = class {
1129
+ constructor(httpRequest) {
1130
+ this.httpRequest = httpRequest;
1131
+ }
1132
+ /**
1133
+ * Get All Roles
1134
+ * Retrieve all roles in the organization
1135
+ * @returns RolesResponse Roles retrieved successfully
1136
+ * @throws ApiError
1137
+ */
1138
+ getAllRoles() {
1139
+ return this.httpRequest.request({
1140
+ method: "GET",
1141
+ url: "/api/role",
1142
+ errors: {
1143
+ 500: `Internal server error`
1144
+ }
1145
+ });
1146
+ }
1147
+ /**
1148
+ * Create Role
1149
+ * Create a new role in the organization
1150
+ * @param requestBody
1151
+ * @returns RoleResponse Role created successfully
1152
+ * @throws ApiError
1153
+ */
1154
+ createRole(requestBody) {
1155
+ return this.httpRequest.request({
1156
+ method: "POST",
1157
+ url: "/api/role",
1158
+ body: requestBody,
1159
+ mediaType: "application/json",
1160
+ errors: {
1161
+ 500: `Internal server error`
1162
+ }
1163
+ });
1164
+ }
1165
+ /**
1166
+ * Get Role Statistics
1167
+ * Retrieve statistics about roles in the organization
1168
+ * @returns RoleStatsResponse Role statistics retrieved successfully
1169
+ * @throws ApiError
1170
+ */
1171
+ getRoleStats() {
1172
+ return this.httpRequest.request({
1173
+ method: "GET",
1174
+ url: "/api/role/stats",
1175
+ errors: {
1176
+ 500: `Internal server error`
1177
+ }
1178
+ });
1179
+ }
1180
+ /**
1181
+ * Get Role
1182
+ * Retrieve a specific role by ID
1183
+ * @param id
1184
+ * @returns RoleResponse Role retrieved successfully
1185
+ * @throws ApiError
1186
+ */
1187
+ getRole(id) {
1188
+ return this.httpRequest.request({
1189
+ method: "GET",
1190
+ url: "/api/role/{id}",
1191
+ path: {
1192
+ "id": id
1193
+ },
1194
+ errors: {
1195
+ 500: `Internal server error`
1196
+ }
1197
+ });
1198
+ }
1199
+ /**
1200
+ * Update Role
1201
+ * Update an existing role
1202
+ * @param id
1203
+ * @param requestBody
1204
+ * @returns RoleResponse Role updated successfully
1205
+ * @throws ApiError
1206
+ */
1207
+ updateRole(id, requestBody) {
1208
+ return this.httpRequest.request({
1209
+ method: "PATCH",
1210
+ url: "/api/role/{id}",
1211
+ path: {
1212
+ "id": id
1213
+ },
1214
+ body: requestBody,
1215
+ mediaType: "application/json",
1216
+ errors: {
1217
+ 500: `Internal server error`
1218
+ }
1219
+ });
1220
+ }
1221
+ /**
1222
+ * Delete Role
1223
+ * Delete an existing role (non-master roles only)
1224
+ * @param id
1225
+ * @returns RoleResponse Role deleted successfully
1226
+ * @throws ApiError
1227
+ */
1228
+ deleteRole(id) {
1229
+ return this.httpRequest.request({
1230
+ method: "DELETE",
1231
+ url: "/api/role/{id}",
1232
+ path: {
1233
+ "id": id
1234
+ },
1235
+ errors: {
1236
+ 500: `Internal server error`
1237
+ }
1238
+ });
1239
+ }
1240
+ };
1241
+
1087
1242
  // src/services/UsersService.ts
1088
1243
  var UsersService = class {
1089
1244
  constructor(httpRequest) {
@@ -1213,6 +1368,7 @@ var UsersService = class {
1213
1368
  // src/EnvSyncAPISDK.ts
1214
1369
  var EnvSyncAPISDK = class {
1215
1370
  access;
1371
+ apiKeys;
1216
1372
  applications;
1217
1373
  auditLogs;
1218
1374
  authentication;
@@ -1220,12 +1376,13 @@ var EnvSyncAPISDK = class {
1220
1376
  environmentVariables;
1221
1377
  onboarding;
1222
1378
  organizations;
1379
+ roles;
1223
1380
  users;
1224
1381
  request;
1225
1382
  constructor(config, HttpRequest = FetchHttpRequest) {
1226
1383
  this.request = new HttpRequest({
1227
1384
  BASE: config?.BASE ?? "http://localhost:8600",
1228
- VERSION: config?.VERSION ?? "0.1.1",
1385
+ VERSION: config?.VERSION ?? "0.2.0",
1229
1386
  WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
1230
1387
  CREDENTIALS: config?.CREDENTIALS ?? "include",
1231
1388
  TOKEN: config?.TOKEN,
@@ -1235,6 +1392,7 @@ var EnvSyncAPISDK = class {
1235
1392
  ENCODE_PATH: config?.ENCODE_PATH
1236
1393
  });
1237
1394
  this.access = new AccessService(this.request);
1395
+ this.apiKeys = new ApiKeysService(this.request);
1238
1396
  this.applications = new ApplicationsService(this.request);
1239
1397
  this.auditLogs = new AuditLogsService(this.request);
1240
1398
  this.authentication = new AuthenticationService(this.request);
@@ -1242,6 +1400,7 @@ var EnvSyncAPISDK = class {
1242
1400
  this.environmentVariables = new EnvironmentVariablesService(this.request);
1243
1401
  this.onboarding = new OnboardingService(this.request);
1244
1402
  this.organizations = new OrganizationsService(this.request);
1403
+ this.roles = new RolesService(this.request);
1245
1404
  this.users = new UsersService(this.request);
1246
1405
  }
1247
1406
  };
@@ -1249,7 +1408,7 @@ var EnvSyncAPISDK = class {
1249
1408
  // src/core/OpenAPI.ts
1250
1409
  var OpenAPI = {
1251
1410
  BASE: "http://localhost:8600",
1252
- VERSION: "0.1.1",
1411
+ VERSION: "0.2.0",
1253
1412
  WITH_CREDENTIALS: false,
1254
1413
  CREDENTIALS: "include",
1255
1414
  TOKEN: void 0,
@@ -1261,6 +1420,7 @@ var OpenAPI = {
1261
1420
  export {
1262
1421
  AccessService,
1263
1422
  ApiError,
1423
+ ApiKeysService,
1264
1424
  ApplicationsService,
1265
1425
  AuditLogsService,
1266
1426
  AuthenticationService,
@@ -1273,5 +1433,6 @@ export {
1273
1433
  OnboardingService,
1274
1434
  OpenAPI,
1275
1435
  OrganizationsService,
1436
+ RolesService,
1276
1437
  UsersService
1277
1438
  };
package/package.json CHANGED
@@ -33,7 +33,7 @@
33
33
  "peerDependencies": {
34
34
  "typescript": "^5"
35
35
  },
36
- "version": "0.1.2",
36
+ "version": "0.2.0",
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  }