@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.d.mts +179 -51
- package/dist/index.d.ts +179 -51
- package/dist/index.global.js +242 -83
- package/dist/index.js +246 -83
- package/dist/index.mjs +244 -83
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ var src_exports = {};
|
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
AccessService: () => AccessService,
|
|
24
24
|
ApiError: () => ApiError,
|
|
25
|
+
ApiKeysService: () => ApiKeysService,
|
|
25
26
|
ApplicationsService: () => ApplicationsService,
|
|
26
27
|
AuditLogsService: () => AuditLogsService,
|
|
27
28
|
AuthenticationService: () => AuthenticationService,
|
|
@@ -34,6 +35,7 @@ __export(src_exports, {
|
|
|
34
35
|
OnboardingService: () => OnboardingService,
|
|
35
36
|
OpenAPI: () => OpenAPI,
|
|
36
37
|
OrganizationsService: () => OrganizationsService,
|
|
38
|
+
RolesService: () => RolesService,
|
|
37
39
|
UsersService: () => UsersService
|
|
38
40
|
});
|
|
39
41
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -418,9 +420,9 @@ var AccessService = class {
|
|
|
418
420
|
this.httpRequest = httpRequest;
|
|
419
421
|
}
|
|
420
422
|
/**
|
|
421
|
-
*
|
|
423
|
+
* Initiate CLI Login
|
|
422
424
|
* Generate authentication URL for CLI login
|
|
423
|
-
* @returns LoginUrlResponse CLI login
|
|
425
|
+
* @returns LoginUrlResponse CLI login initiated successfully.
|
|
424
426
|
* @throws ApiError
|
|
425
427
|
*/
|
|
426
428
|
createCliLogin() {
|
|
@@ -432,26 +434,6 @@ var AccessService = class {
|
|
|
432
434
|
}
|
|
433
435
|
});
|
|
434
436
|
}
|
|
435
|
-
/**
|
|
436
|
-
* CLI Login Callback
|
|
437
|
-
* Handle CLI login callback from Auth0
|
|
438
|
-
* @param code
|
|
439
|
-
* @returns void
|
|
440
|
-
* @throws ApiError
|
|
441
|
-
*/
|
|
442
|
-
callbackCliLogin(code) {
|
|
443
|
-
return this.httpRequest.request({
|
|
444
|
-
method: "GET",
|
|
445
|
-
url: "/api/access/cli/callback",
|
|
446
|
-
query: {
|
|
447
|
-
"code": code
|
|
448
|
-
},
|
|
449
|
-
errors: {
|
|
450
|
-
302: `Redirect with authentication token`,
|
|
451
|
-
500: `Internal server error`
|
|
452
|
-
}
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
437
|
/**
|
|
456
438
|
* Create Web Login URL
|
|
457
439
|
* Generate authentication URL for web login
|
|
@@ -523,6 +505,125 @@ var AccessService = class {
|
|
|
523
505
|
}
|
|
524
506
|
};
|
|
525
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
|
+
|
|
526
627
|
// src/services/ApplicationsService.ts
|
|
527
628
|
var ApplicationsService = class {
|
|
528
629
|
constructor(httpRequest) {
|
|
@@ -693,24 +794,6 @@ var EnvironmentTypesService = class {
|
|
|
693
794
|
}
|
|
694
795
|
});
|
|
695
796
|
}
|
|
696
|
-
/**
|
|
697
|
-
* Create Environment Type
|
|
698
|
-
* Create a new environment type
|
|
699
|
-
* @param requestBody
|
|
700
|
-
* @returns EnvTypeResponse Environment type created successfully
|
|
701
|
-
* @throws ApiError
|
|
702
|
-
*/
|
|
703
|
-
createEnvType(requestBody) {
|
|
704
|
-
return this.httpRequest.request({
|
|
705
|
-
method: "POST",
|
|
706
|
-
url: "/api/env_type",
|
|
707
|
-
body: requestBody,
|
|
708
|
-
mediaType: "application/json",
|
|
709
|
-
errors: {
|
|
710
|
-
500: `Internal server error`
|
|
711
|
-
}
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
797
|
/**
|
|
715
798
|
* Get Environment Type
|
|
716
799
|
* Retrieve a specific environment type
|
|
@@ -730,47 +813,6 @@ var EnvironmentTypesService = class {
|
|
|
730
813
|
}
|
|
731
814
|
});
|
|
732
815
|
}
|
|
733
|
-
/**
|
|
734
|
-
* Update Environment Type
|
|
735
|
-
* Update an existing environment type
|
|
736
|
-
* @param id
|
|
737
|
-
* @param requestBody
|
|
738
|
-
* @returns EnvTypeResponse Environment type updated successfully
|
|
739
|
-
* @throws ApiError
|
|
740
|
-
*/
|
|
741
|
-
updateEnvType(id, requestBody) {
|
|
742
|
-
return this.httpRequest.request({
|
|
743
|
-
method: "PATCH",
|
|
744
|
-
url: "/api/env_type/{id}",
|
|
745
|
-
path: {
|
|
746
|
-
"id": id
|
|
747
|
-
},
|
|
748
|
-
body: requestBody,
|
|
749
|
-
mediaType: "application/json",
|
|
750
|
-
errors: {
|
|
751
|
-
500: `Internal server error`
|
|
752
|
-
}
|
|
753
|
-
});
|
|
754
|
-
}
|
|
755
|
-
/**
|
|
756
|
-
* Delete Environment Type
|
|
757
|
-
* Delete an existing environment type
|
|
758
|
-
* @param id
|
|
759
|
-
* @returns DeleteEnvTypeRequest Environment type deleted successfully
|
|
760
|
-
* @throws ApiError
|
|
761
|
-
*/
|
|
762
|
-
deleteEnvType(id) {
|
|
763
|
-
return this.httpRequest.request({
|
|
764
|
-
method: "DELETE",
|
|
765
|
-
url: "/api/env_type/{id}",
|
|
766
|
-
path: {
|
|
767
|
-
"id": id
|
|
768
|
-
},
|
|
769
|
-
errors: {
|
|
770
|
-
500: `Internal server error`
|
|
771
|
-
}
|
|
772
|
-
});
|
|
773
|
-
}
|
|
774
816
|
};
|
|
775
817
|
|
|
776
818
|
// src/services/EnvironmentVariablesService.ts
|
|
@@ -1124,6 +1166,121 @@ var OrganizationsService = class {
|
|
|
1124
1166
|
}
|
|
1125
1167
|
};
|
|
1126
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
|
+
|
|
1127
1284
|
// src/services/UsersService.ts
|
|
1128
1285
|
var UsersService = class {
|
|
1129
1286
|
constructor(httpRequest) {
|
|
@@ -1253,6 +1410,7 @@ var UsersService = class {
|
|
|
1253
1410
|
// src/EnvSyncAPISDK.ts
|
|
1254
1411
|
var EnvSyncAPISDK = class {
|
|
1255
1412
|
access;
|
|
1413
|
+
apiKeys;
|
|
1256
1414
|
applications;
|
|
1257
1415
|
auditLogs;
|
|
1258
1416
|
authentication;
|
|
@@ -1260,12 +1418,13 @@ var EnvSyncAPISDK = class {
|
|
|
1260
1418
|
environmentVariables;
|
|
1261
1419
|
onboarding;
|
|
1262
1420
|
organizations;
|
|
1421
|
+
roles;
|
|
1263
1422
|
users;
|
|
1264
1423
|
request;
|
|
1265
1424
|
constructor(config, HttpRequest = FetchHttpRequest) {
|
|
1266
1425
|
this.request = new HttpRequest({
|
|
1267
1426
|
BASE: config?.BASE ?? "http://localhost:8600",
|
|
1268
|
-
VERSION: config?.VERSION ?? "0.
|
|
1427
|
+
VERSION: config?.VERSION ?? "0.2.0",
|
|
1269
1428
|
WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
|
|
1270
1429
|
CREDENTIALS: config?.CREDENTIALS ?? "include",
|
|
1271
1430
|
TOKEN: config?.TOKEN,
|
|
@@ -1275,6 +1434,7 @@ var EnvSyncAPISDK = class {
|
|
|
1275
1434
|
ENCODE_PATH: config?.ENCODE_PATH
|
|
1276
1435
|
});
|
|
1277
1436
|
this.access = new AccessService(this.request);
|
|
1437
|
+
this.apiKeys = new ApiKeysService(this.request);
|
|
1278
1438
|
this.applications = new ApplicationsService(this.request);
|
|
1279
1439
|
this.auditLogs = new AuditLogsService(this.request);
|
|
1280
1440
|
this.authentication = new AuthenticationService(this.request);
|
|
@@ -1282,6 +1442,7 @@ var EnvSyncAPISDK = class {
|
|
|
1282
1442
|
this.environmentVariables = new EnvironmentVariablesService(this.request);
|
|
1283
1443
|
this.onboarding = new OnboardingService(this.request);
|
|
1284
1444
|
this.organizations = new OrganizationsService(this.request);
|
|
1445
|
+
this.roles = new RolesService(this.request);
|
|
1285
1446
|
this.users = new UsersService(this.request);
|
|
1286
1447
|
}
|
|
1287
1448
|
};
|
|
@@ -1289,7 +1450,7 @@ var EnvSyncAPISDK = class {
|
|
|
1289
1450
|
// src/core/OpenAPI.ts
|
|
1290
1451
|
var OpenAPI = {
|
|
1291
1452
|
BASE: "http://localhost:8600",
|
|
1292
|
-
VERSION: "0.
|
|
1453
|
+
VERSION: "0.2.0",
|
|
1293
1454
|
WITH_CREDENTIALS: false,
|
|
1294
1455
|
CREDENTIALS: "include",
|
|
1295
1456
|
TOKEN: void 0,
|
|
@@ -1302,6 +1463,7 @@ var OpenAPI = {
|
|
|
1302
1463
|
0 && (module.exports = {
|
|
1303
1464
|
AccessService,
|
|
1304
1465
|
ApiError,
|
|
1466
|
+
ApiKeysService,
|
|
1305
1467
|
ApplicationsService,
|
|
1306
1468
|
AuditLogsService,
|
|
1307
1469
|
AuthenticationService,
|
|
@@ -1314,5 +1476,6 @@ var OpenAPI = {
|
|
|
1314
1476
|
OnboardingService,
|
|
1315
1477
|
OpenAPI,
|
|
1316
1478
|
OrganizationsService,
|
|
1479
|
+
RolesService,
|
|
1317
1480
|
UsersService
|
|
1318
1481
|
});
|