@envsync-cloud/envsync-ts-sdk 0.1.1 → 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.js CHANGED
@@ -20,7 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
+ AccessService: () => AccessService,
23
24
  ApiError: () => ApiError,
25
+ ApiKeysService: () => ApiKeysService,
24
26
  ApplicationsService: () => ApplicationsService,
25
27
  AuditLogsService: () => AuditLogsService,
26
28
  AuthenticationService: () => AuthenticationService,
@@ -33,6 +35,7 @@ __export(src_exports, {
33
35
  OnboardingService: () => OnboardingService,
34
36
  OpenAPI: () => OpenAPI,
35
37
  OrganizationsService: () => OrganizationsService,
38
+ RolesService: () => RolesService,
36
39
  UsersService: () => UsersService
37
40
  });
38
41
  module.exports = __toCommonJS(src_exports);
@@ -411,6 +414,216 @@ var FetchHttpRequest = class extends BaseHttpRequest {
411
414
  }
412
415
  };
413
416
 
417
+ // src/services/AccessService.ts
418
+ var AccessService = class {
419
+ constructor(httpRequest) {
420
+ this.httpRequest = httpRequest;
421
+ }
422
+ /**
423
+ * Initiate CLI Login
424
+ * Generate authentication URL for CLI login
425
+ * @returns LoginUrlResponse CLI login initiated successfully.
426
+ * @throws ApiError
427
+ */
428
+ createCliLogin() {
429
+ return this.httpRequest.request({
430
+ method: "GET",
431
+ url: "/api/access/cli",
432
+ errors: {
433
+ 500: `Internal server error`
434
+ }
435
+ });
436
+ }
437
+ /**
438
+ * Create Web Login URL
439
+ * Generate authentication URL for web login
440
+ * @returns LoginUrlResponse Web login URL created successfully
441
+ * @throws ApiError
442
+ */
443
+ createWebLogin() {
444
+ return this.httpRequest.request({
445
+ method: "GET",
446
+ url: "/api/access/web",
447
+ errors: {
448
+ 500: `Internal server error`
449
+ }
450
+ });
451
+ }
452
+ /**
453
+ * Web Login Callback
454
+ * Handle web login callback from Auth0
455
+ * @param code
456
+ * @returns void
457
+ * @throws ApiError
458
+ */
459
+ callbackWebLogin(code) {
460
+ return this.httpRequest.request({
461
+ method: "GET",
462
+ url: "/api/access/web/callback",
463
+ query: {
464
+ "code": code
465
+ },
466
+ errors: {
467
+ 302: `Redirect with authentication token`,
468
+ 500: `Internal server error`
469
+ }
470
+ });
471
+ }
472
+ /**
473
+ * Create API Login URL
474
+ * Generate authentication URL for API login
475
+ * @returns LoginUrlResponse API login URL created successfully
476
+ * @throws ApiError
477
+ */
478
+ createApiLogin() {
479
+ return this.httpRequest.request({
480
+ method: "GET",
481
+ url: "/api/access/api",
482
+ errors: {
483
+ 500: `Internal server error`
484
+ }
485
+ });
486
+ }
487
+ /**
488
+ * API Login Callback
489
+ * Handle API login callback from Auth0
490
+ * @param code
491
+ * @returns CallbackResponse API login callback successful
492
+ * @throws ApiError
493
+ */
494
+ callbackApiLogin(code) {
495
+ return this.httpRequest.request({
496
+ method: "GET",
497
+ url: "/api/access/api/callback",
498
+ query: {
499
+ "code": code
500
+ },
501
+ errors: {
502
+ 500: `Internal server error`
503
+ }
504
+ });
505
+ }
506
+ };
507
+
508
+ // src/services/ApiKeysService.ts
509
+ var ApiKeysService = class {
510
+ constructor(httpRequest) {
511
+ this.httpRequest = httpRequest;
512
+ }
513
+ /**
514
+ * Create API Key
515
+ * Create a new API key for the organization
516
+ * @param requestBody
517
+ * @returns ApiKeyResponse API key created successfully
518
+ * @throws ApiError
519
+ */
520
+ createApiKey(requestBody) {
521
+ return this.httpRequest.request({
522
+ method: "POST",
523
+ url: "/api/api_key",
524
+ body: requestBody,
525
+ mediaType: "application/json",
526
+ errors: {
527
+ 500: `Internal server error`
528
+ }
529
+ });
530
+ }
531
+ /**
532
+ * Get All API Keys
533
+ * Retrieve all API keys for the organization
534
+ * @returns ApiKeysResponse API keys retrieved successfully
535
+ * @throws ApiError
536
+ */
537
+ getAllApiKeys() {
538
+ return this.httpRequest.request({
539
+ method: "GET",
540
+ url: "/api/api_key",
541
+ errors: {
542
+ 500: `Internal server error`
543
+ }
544
+ });
545
+ }
546
+ /**
547
+ * Get API Key
548
+ * Retrieve a specific API key
549
+ * @param id
550
+ * @returns ApiKeyResponse API key retrieved successfully
551
+ * @throws ApiError
552
+ */
553
+ getApiKey(id) {
554
+ return this.httpRequest.request({
555
+ method: "GET",
556
+ url: "/api/api_key/{id}",
557
+ path: {
558
+ "id": id
559
+ },
560
+ errors: {
561
+ 500: `Internal server error`
562
+ }
563
+ });
564
+ }
565
+ /**
566
+ * Update API Key
567
+ * Update an existing API key
568
+ * @param id
569
+ * @param requestBody
570
+ * @returns ApiKeyResponse API key updated successfully
571
+ * @throws ApiError
572
+ */
573
+ updateApiKey(id, requestBody) {
574
+ return this.httpRequest.request({
575
+ method: "PUT",
576
+ url: "/api/api_key/{id}",
577
+ path: {
578
+ "id": id
579
+ },
580
+ body: requestBody,
581
+ mediaType: "application/json",
582
+ errors: {
583
+ 500: `Internal server error`
584
+ }
585
+ });
586
+ }
587
+ /**
588
+ * Delete API Key
589
+ * Delete an existing API key
590
+ * @param id
591
+ * @returns ApiKeyResponse API key deleted successfully
592
+ * @throws ApiError
593
+ */
594
+ deleteApiKey(id) {
595
+ return this.httpRequest.request({
596
+ method: "DELETE",
597
+ url: "/api/api_key/{id}",
598
+ path: {
599
+ "id": id
600
+ },
601
+ errors: {
602
+ 500: `Internal server error`
603
+ }
604
+ });
605
+ }
606
+ /**
607
+ * Regenerate API Key
608
+ * Generate a new value for an existing API key
609
+ * @param id
610
+ * @returns RegenerateApiKeyResponse API key regenerated successfully
611
+ * @throws ApiError
612
+ */
613
+ regenerateApiKey(id) {
614
+ return this.httpRequest.request({
615
+ method: "GET",
616
+ url: "/api/api_key/{id}/regenerate",
617
+ path: {
618
+ "id": id
619
+ },
620
+ errors: {
621
+ 500: `Internal server error`
622
+ }
623
+ });
624
+ }
625
+ };
626
+
414
627
  // src/services/ApplicationsService.ts
415
628
  var ApplicationsService = class {
416
629
  constructor(httpRequest) {
@@ -581,24 +794,6 @@ var EnvironmentTypesService = class {
581
794
  }
582
795
  });
583
796
  }
584
- /**
585
- * Create Environment Type
586
- * Create a new environment type
587
- * @param requestBody
588
- * @returns EnvTypeResponse Environment type created successfully
589
- * @throws ApiError
590
- */
591
- createEnvType(requestBody) {
592
- return this.httpRequest.request({
593
- method: "POST",
594
- url: "/api/env_type",
595
- body: requestBody,
596
- mediaType: "application/json",
597
- errors: {
598
- 500: `Internal server error`
599
- }
600
- });
601
- }
602
797
  /**
603
798
  * Get Environment Type
604
799
  * Retrieve a specific environment type
@@ -618,47 +813,6 @@ var EnvironmentTypesService = class {
618
813
  }
619
814
  });
620
815
  }
621
- /**
622
- * Update Environment Type
623
- * Update an existing environment type
624
- * @param id
625
- * @param requestBody
626
- * @returns EnvTypeResponse Environment type updated successfully
627
- * @throws ApiError
628
- */
629
- updateEnvType(id, requestBody) {
630
- return this.httpRequest.request({
631
- method: "PATCH",
632
- url: "/api/env_type/{id}",
633
- path: {
634
- "id": id
635
- },
636
- body: requestBody,
637
- mediaType: "application/json",
638
- errors: {
639
- 500: `Internal server error`
640
- }
641
- });
642
- }
643
- /**
644
- * Delete Environment Type
645
- * Delete an existing environment type
646
- * @param id
647
- * @returns DeleteEnvTypeRequest Environment type deleted successfully
648
- * @throws ApiError
649
- */
650
- deleteEnvType(id) {
651
- return this.httpRequest.request({
652
- method: "DELETE",
653
- url: "/api/env_type/{id}",
654
- path: {
655
- "id": id
656
- },
657
- errors: {
658
- 500: `Internal server error`
659
- }
660
- });
661
- }
662
816
  };
663
817
 
664
818
  // src/services/EnvironmentVariablesService.ts
@@ -1012,6 +1166,121 @@ var OrganizationsService = class {
1012
1166
  }
1013
1167
  };
1014
1168
 
1169
+ // src/services/RolesService.ts
1170
+ var RolesService = class {
1171
+ constructor(httpRequest) {
1172
+ this.httpRequest = httpRequest;
1173
+ }
1174
+ /**
1175
+ * Get All Roles
1176
+ * Retrieve all roles in the organization
1177
+ * @returns RolesResponse Roles retrieved successfully
1178
+ * @throws ApiError
1179
+ */
1180
+ getAllRoles() {
1181
+ return this.httpRequest.request({
1182
+ method: "GET",
1183
+ url: "/api/role",
1184
+ errors: {
1185
+ 500: `Internal server error`
1186
+ }
1187
+ });
1188
+ }
1189
+ /**
1190
+ * Create Role
1191
+ * Create a new role in the organization
1192
+ * @param requestBody
1193
+ * @returns RoleResponse Role created successfully
1194
+ * @throws ApiError
1195
+ */
1196
+ createRole(requestBody) {
1197
+ return this.httpRequest.request({
1198
+ method: "POST",
1199
+ url: "/api/role",
1200
+ body: requestBody,
1201
+ mediaType: "application/json",
1202
+ errors: {
1203
+ 500: `Internal server error`
1204
+ }
1205
+ });
1206
+ }
1207
+ /**
1208
+ * Get Role Statistics
1209
+ * Retrieve statistics about roles in the organization
1210
+ * @returns RoleStatsResponse Role statistics retrieved successfully
1211
+ * @throws ApiError
1212
+ */
1213
+ getRoleStats() {
1214
+ return this.httpRequest.request({
1215
+ method: "GET",
1216
+ url: "/api/role/stats",
1217
+ errors: {
1218
+ 500: `Internal server error`
1219
+ }
1220
+ });
1221
+ }
1222
+ /**
1223
+ * Get Role
1224
+ * Retrieve a specific role by ID
1225
+ * @param id
1226
+ * @returns RoleResponse Role retrieved successfully
1227
+ * @throws ApiError
1228
+ */
1229
+ getRole(id) {
1230
+ return this.httpRequest.request({
1231
+ method: "GET",
1232
+ url: "/api/role/{id}",
1233
+ path: {
1234
+ "id": id
1235
+ },
1236
+ errors: {
1237
+ 500: `Internal server error`
1238
+ }
1239
+ });
1240
+ }
1241
+ /**
1242
+ * Update Role
1243
+ * Update an existing role
1244
+ * @param id
1245
+ * @param requestBody
1246
+ * @returns RoleResponse Role updated successfully
1247
+ * @throws ApiError
1248
+ */
1249
+ updateRole(id, requestBody) {
1250
+ return this.httpRequest.request({
1251
+ method: "PATCH",
1252
+ url: "/api/role/{id}",
1253
+ path: {
1254
+ "id": id
1255
+ },
1256
+ body: requestBody,
1257
+ mediaType: "application/json",
1258
+ errors: {
1259
+ 500: `Internal server error`
1260
+ }
1261
+ });
1262
+ }
1263
+ /**
1264
+ * Delete Role
1265
+ * Delete an existing role (non-master roles only)
1266
+ * @param id
1267
+ * @returns RoleResponse Role deleted successfully
1268
+ * @throws ApiError
1269
+ */
1270
+ deleteRole(id) {
1271
+ return this.httpRequest.request({
1272
+ method: "DELETE",
1273
+ url: "/api/role/{id}",
1274
+ path: {
1275
+ "id": id
1276
+ },
1277
+ errors: {
1278
+ 500: `Internal server error`
1279
+ }
1280
+ });
1281
+ }
1282
+ };
1283
+
1015
1284
  // src/services/UsersService.ts
1016
1285
  var UsersService = class {
1017
1286
  constructor(httpRequest) {
@@ -1140,6 +1409,8 @@ var UsersService = class {
1140
1409
 
1141
1410
  // src/EnvSyncAPISDK.ts
1142
1411
  var EnvSyncAPISDK = class {
1412
+ access;
1413
+ apiKeys;
1143
1414
  applications;
1144
1415
  auditLogs;
1145
1416
  authentication;
@@ -1147,12 +1418,13 @@ var EnvSyncAPISDK = class {
1147
1418
  environmentVariables;
1148
1419
  onboarding;
1149
1420
  organizations;
1421
+ roles;
1150
1422
  users;
1151
1423
  request;
1152
1424
  constructor(config, HttpRequest = FetchHttpRequest) {
1153
1425
  this.request = new HttpRequest({
1154
1426
  BASE: config?.BASE ?? "http://localhost:8600",
1155
- VERSION: config?.VERSION ?? "0.0.0",
1427
+ VERSION: config?.VERSION ?? "0.2.0",
1156
1428
  WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
1157
1429
  CREDENTIALS: config?.CREDENTIALS ?? "include",
1158
1430
  TOKEN: config?.TOKEN,
@@ -1161,6 +1433,8 @@ var EnvSyncAPISDK = class {
1161
1433
  HEADERS: config?.HEADERS,
1162
1434
  ENCODE_PATH: config?.ENCODE_PATH
1163
1435
  });
1436
+ this.access = new AccessService(this.request);
1437
+ this.apiKeys = new ApiKeysService(this.request);
1164
1438
  this.applications = new ApplicationsService(this.request);
1165
1439
  this.auditLogs = new AuditLogsService(this.request);
1166
1440
  this.authentication = new AuthenticationService(this.request);
@@ -1168,6 +1442,7 @@ var EnvSyncAPISDK = class {
1168
1442
  this.environmentVariables = new EnvironmentVariablesService(this.request);
1169
1443
  this.onboarding = new OnboardingService(this.request);
1170
1444
  this.organizations = new OrganizationsService(this.request);
1445
+ this.roles = new RolesService(this.request);
1171
1446
  this.users = new UsersService(this.request);
1172
1447
  }
1173
1448
  };
@@ -1175,7 +1450,7 @@ var EnvSyncAPISDK = class {
1175
1450
  // src/core/OpenAPI.ts
1176
1451
  var OpenAPI = {
1177
1452
  BASE: "http://localhost:8600",
1178
- VERSION: "0.0.0",
1453
+ VERSION: "0.2.0",
1179
1454
  WITH_CREDENTIALS: false,
1180
1455
  CREDENTIALS: "include",
1181
1456
  TOKEN: void 0,
@@ -1186,7 +1461,9 @@ var OpenAPI = {
1186
1461
  };
1187
1462
  // Annotate the CommonJS export names for ESM import in node:
1188
1463
  0 && (module.exports = {
1464
+ AccessService,
1189
1465
  ApiError,
1466
+ ApiKeysService,
1190
1467
  ApplicationsService,
1191
1468
  AuditLogsService,
1192
1469
  AuthenticationService,
@@ -1199,5 +1476,6 @@ var OpenAPI = {
1199
1476
  OnboardingService,
1200
1477
  OpenAPI,
1201
1478
  OrganizationsService,
1479
+ RolesService,
1202
1480
  UsersService
1203
1481
  });