@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.mjs CHANGED
@@ -372,6 +372,216 @@ var FetchHttpRequest = class extends BaseHttpRequest {
372
372
  }
373
373
  };
374
374
 
375
+ // src/services/AccessService.ts
376
+ var AccessService = class {
377
+ constructor(httpRequest) {
378
+ this.httpRequest = httpRequest;
379
+ }
380
+ /**
381
+ * Initiate CLI Login
382
+ * Generate authentication URL for CLI login
383
+ * @returns LoginUrlResponse CLI login initiated successfully.
384
+ * @throws ApiError
385
+ */
386
+ createCliLogin() {
387
+ return this.httpRequest.request({
388
+ method: "GET",
389
+ url: "/api/access/cli",
390
+ errors: {
391
+ 500: `Internal server error`
392
+ }
393
+ });
394
+ }
395
+ /**
396
+ * Create Web Login URL
397
+ * Generate authentication URL for web login
398
+ * @returns LoginUrlResponse Web login URL created successfully
399
+ * @throws ApiError
400
+ */
401
+ createWebLogin() {
402
+ return this.httpRequest.request({
403
+ method: "GET",
404
+ url: "/api/access/web",
405
+ errors: {
406
+ 500: `Internal server error`
407
+ }
408
+ });
409
+ }
410
+ /**
411
+ * Web Login Callback
412
+ * Handle web login callback from Auth0
413
+ * @param code
414
+ * @returns void
415
+ * @throws ApiError
416
+ */
417
+ callbackWebLogin(code) {
418
+ return this.httpRequest.request({
419
+ method: "GET",
420
+ url: "/api/access/web/callback",
421
+ query: {
422
+ "code": code
423
+ },
424
+ errors: {
425
+ 302: `Redirect with authentication token`,
426
+ 500: `Internal server error`
427
+ }
428
+ });
429
+ }
430
+ /**
431
+ * Create API Login URL
432
+ * Generate authentication URL for API login
433
+ * @returns LoginUrlResponse API login URL created successfully
434
+ * @throws ApiError
435
+ */
436
+ createApiLogin() {
437
+ return this.httpRequest.request({
438
+ method: "GET",
439
+ url: "/api/access/api",
440
+ errors: {
441
+ 500: `Internal server error`
442
+ }
443
+ });
444
+ }
445
+ /**
446
+ * API Login Callback
447
+ * Handle API login callback from Auth0
448
+ * @param code
449
+ * @returns CallbackResponse API login callback successful
450
+ * @throws ApiError
451
+ */
452
+ callbackApiLogin(code) {
453
+ return this.httpRequest.request({
454
+ method: "GET",
455
+ url: "/api/access/api/callback",
456
+ query: {
457
+ "code": code
458
+ },
459
+ errors: {
460
+ 500: `Internal server error`
461
+ }
462
+ });
463
+ }
464
+ };
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
+
375
585
  // src/services/ApplicationsService.ts
376
586
  var ApplicationsService = class {
377
587
  constructor(httpRequest) {
@@ -542,24 +752,6 @@ var EnvironmentTypesService = class {
542
752
  }
543
753
  });
544
754
  }
545
- /**
546
- * Create Environment Type
547
- * Create a new environment type
548
- * @param requestBody
549
- * @returns EnvTypeResponse Environment type created successfully
550
- * @throws ApiError
551
- */
552
- createEnvType(requestBody) {
553
- return this.httpRequest.request({
554
- method: "POST",
555
- url: "/api/env_type",
556
- body: requestBody,
557
- mediaType: "application/json",
558
- errors: {
559
- 500: `Internal server error`
560
- }
561
- });
562
- }
563
755
  /**
564
756
  * Get Environment Type
565
757
  * Retrieve a specific environment type
@@ -579,47 +771,6 @@ var EnvironmentTypesService = class {
579
771
  }
580
772
  });
581
773
  }
582
- /**
583
- * Update Environment Type
584
- * Update an existing environment type
585
- * @param id
586
- * @param requestBody
587
- * @returns EnvTypeResponse Environment type updated successfully
588
- * @throws ApiError
589
- */
590
- updateEnvType(id, requestBody) {
591
- return this.httpRequest.request({
592
- method: "PATCH",
593
- url: "/api/env_type/{id}",
594
- path: {
595
- "id": id
596
- },
597
- body: requestBody,
598
- mediaType: "application/json",
599
- errors: {
600
- 500: `Internal server error`
601
- }
602
- });
603
- }
604
- /**
605
- * Delete Environment Type
606
- * Delete an existing environment type
607
- * @param id
608
- * @returns DeleteEnvTypeRequest Environment type deleted successfully
609
- * @throws ApiError
610
- */
611
- deleteEnvType(id) {
612
- return this.httpRequest.request({
613
- method: "DELETE",
614
- url: "/api/env_type/{id}",
615
- path: {
616
- "id": id
617
- },
618
- errors: {
619
- 500: `Internal server error`
620
- }
621
- });
622
- }
623
774
  };
624
775
 
625
776
  // src/services/EnvironmentVariablesService.ts
@@ -973,6 +1124,121 @@ var OrganizationsService = class {
973
1124
  }
974
1125
  };
975
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
+
976
1242
  // src/services/UsersService.ts
977
1243
  var UsersService = class {
978
1244
  constructor(httpRequest) {
@@ -1101,6 +1367,8 @@ var UsersService = class {
1101
1367
 
1102
1368
  // src/EnvSyncAPISDK.ts
1103
1369
  var EnvSyncAPISDK = class {
1370
+ access;
1371
+ apiKeys;
1104
1372
  applications;
1105
1373
  auditLogs;
1106
1374
  authentication;
@@ -1108,12 +1376,13 @@ var EnvSyncAPISDK = class {
1108
1376
  environmentVariables;
1109
1377
  onboarding;
1110
1378
  organizations;
1379
+ roles;
1111
1380
  users;
1112
1381
  request;
1113
1382
  constructor(config, HttpRequest = FetchHttpRequest) {
1114
1383
  this.request = new HttpRequest({
1115
1384
  BASE: config?.BASE ?? "http://localhost:8600",
1116
- VERSION: config?.VERSION ?? "0.0.0",
1385
+ VERSION: config?.VERSION ?? "0.2.0",
1117
1386
  WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
1118
1387
  CREDENTIALS: config?.CREDENTIALS ?? "include",
1119
1388
  TOKEN: config?.TOKEN,
@@ -1122,6 +1391,8 @@ var EnvSyncAPISDK = class {
1122
1391
  HEADERS: config?.HEADERS,
1123
1392
  ENCODE_PATH: config?.ENCODE_PATH
1124
1393
  });
1394
+ this.access = new AccessService(this.request);
1395
+ this.apiKeys = new ApiKeysService(this.request);
1125
1396
  this.applications = new ApplicationsService(this.request);
1126
1397
  this.auditLogs = new AuditLogsService(this.request);
1127
1398
  this.authentication = new AuthenticationService(this.request);
@@ -1129,6 +1400,7 @@ var EnvSyncAPISDK = class {
1129
1400
  this.environmentVariables = new EnvironmentVariablesService(this.request);
1130
1401
  this.onboarding = new OnboardingService(this.request);
1131
1402
  this.organizations = new OrganizationsService(this.request);
1403
+ this.roles = new RolesService(this.request);
1132
1404
  this.users = new UsersService(this.request);
1133
1405
  }
1134
1406
  };
@@ -1136,7 +1408,7 @@ var EnvSyncAPISDK = class {
1136
1408
  // src/core/OpenAPI.ts
1137
1409
  var OpenAPI = {
1138
1410
  BASE: "http://localhost:8600",
1139
- VERSION: "0.0.0",
1411
+ VERSION: "0.2.0",
1140
1412
  WITH_CREDENTIALS: false,
1141
1413
  CREDENTIALS: "include",
1142
1414
  TOKEN: void 0,
@@ -1146,7 +1418,9 @@ var OpenAPI = {
1146
1418
  ENCODE_PATH: void 0
1147
1419
  };
1148
1420
  export {
1421
+ AccessService,
1149
1422
  ApiError,
1423
+ ApiKeysService,
1150
1424
  ApplicationsService,
1151
1425
  AuditLogsService,
1152
1426
  AuthenticationService,
@@ -1159,5 +1433,6 @@ export {
1159
1433
  OnboardingService,
1160
1434
  OpenAPI,
1161
1435
  OrganizationsService,
1436
+ RolesService,
1162
1437
  UsersService
1163
1438
  };
package/package.json CHANGED
@@ -33,7 +33,7 @@
33
33
  "peerDependencies": {
34
34
  "typescript": "^5"
35
35
  },
36
- "version": "0.1.1",
36
+ "version": "0.2.0",
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  }