@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.d.mts +236 -41
- package/dist/index.d.ts +236 -41
- package/dist/index.global.js +333 -61
- package/dist/index.js +339 -61
- package/dist/index.mjs +336 -61
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -374,6 +374,216 @@
|
|
|
374
374
|
}
|
|
375
375
|
};
|
|
376
376
|
|
|
377
|
+
// src/services/AccessService.ts
|
|
378
|
+
var AccessService = class {
|
|
379
|
+
constructor(httpRequest) {
|
|
380
|
+
this.httpRequest = httpRequest;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Initiate CLI Login
|
|
384
|
+
* Generate authentication URL for CLI login
|
|
385
|
+
* @returns LoginUrlResponse CLI login initiated successfully.
|
|
386
|
+
* @throws ApiError
|
|
387
|
+
*/
|
|
388
|
+
createCliLogin() {
|
|
389
|
+
return this.httpRequest.request({
|
|
390
|
+
method: "GET",
|
|
391
|
+
url: "/api/access/cli",
|
|
392
|
+
errors: {
|
|
393
|
+
500: `Internal server error`
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Create Web Login URL
|
|
399
|
+
* Generate authentication URL for web login
|
|
400
|
+
* @returns LoginUrlResponse Web login URL created successfully
|
|
401
|
+
* @throws ApiError
|
|
402
|
+
*/
|
|
403
|
+
createWebLogin() {
|
|
404
|
+
return this.httpRequest.request({
|
|
405
|
+
method: "GET",
|
|
406
|
+
url: "/api/access/web",
|
|
407
|
+
errors: {
|
|
408
|
+
500: `Internal server error`
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Web Login Callback
|
|
414
|
+
* Handle web login callback from Auth0
|
|
415
|
+
* @param code
|
|
416
|
+
* @returns void
|
|
417
|
+
* @throws ApiError
|
|
418
|
+
*/
|
|
419
|
+
callbackWebLogin(code) {
|
|
420
|
+
return this.httpRequest.request({
|
|
421
|
+
method: "GET",
|
|
422
|
+
url: "/api/access/web/callback",
|
|
423
|
+
query: {
|
|
424
|
+
"code": code
|
|
425
|
+
},
|
|
426
|
+
errors: {
|
|
427
|
+
302: `Redirect with authentication token`,
|
|
428
|
+
500: `Internal server error`
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Create API Login URL
|
|
434
|
+
* Generate authentication URL for API login
|
|
435
|
+
* @returns LoginUrlResponse API login URL created successfully
|
|
436
|
+
* @throws ApiError
|
|
437
|
+
*/
|
|
438
|
+
createApiLogin() {
|
|
439
|
+
return this.httpRequest.request({
|
|
440
|
+
method: "GET",
|
|
441
|
+
url: "/api/access/api",
|
|
442
|
+
errors: {
|
|
443
|
+
500: `Internal server error`
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* API Login Callback
|
|
449
|
+
* Handle API login callback from Auth0
|
|
450
|
+
* @param code
|
|
451
|
+
* @returns CallbackResponse API login callback successful
|
|
452
|
+
* @throws ApiError
|
|
453
|
+
*/
|
|
454
|
+
callbackApiLogin(code) {
|
|
455
|
+
return this.httpRequest.request({
|
|
456
|
+
method: "GET",
|
|
457
|
+
url: "/api/access/api/callback",
|
|
458
|
+
query: {
|
|
459
|
+
"code": code
|
|
460
|
+
},
|
|
461
|
+
errors: {
|
|
462
|
+
500: `Internal server error`
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
};
|
|
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
|
+
|
|
377
587
|
// src/services/ApplicationsService.ts
|
|
378
588
|
var ApplicationsService = class {
|
|
379
589
|
constructor(httpRequest) {
|
|
@@ -544,24 +754,6 @@
|
|
|
544
754
|
}
|
|
545
755
|
});
|
|
546
756
|
}
|
|
547
|
-
/**
|
|
548
|
-
* Create Environment Type
|
|
549
|
-
* Create a new environment type
|
|
550
|
-
* @param requestBody
|
|
551
|
-
* @returns EnvTypeResponse Environment type created successfully
|
|
552
|
-
* @throws ApiError
|
|
553
|
-
*/
|
|
554
|
-
createEnvType(requestBody) {
|
|
555
|
-
return this.httpRequest.request({
|
|
556
|
-
method: "POST",
|
|
557
|
-
url: "/api/env_type",
|
|
558
|
-
body: requestBody,
|
|
559
|
-
mediaType: "application/json",
|
|
560
|
-
errors: {
|
|
561
|
-
500: `Internal server error`
|
|
562
|
-
}
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
757
|
/**
|
|
566
758
|
* Get Environment Type
|
|
567
759
|
* Retrieve a specific environment type
|
|
@@ -581,47 +773,6 @@
|
|
|
581
773
|
}
|
|
582
774
|
});
|
|
583
775
|
}
|
|
584
|
-
/**
|
|
585
|
-
* Update Environment Type
|
|
586
|
-
* Update an existing environment type
|
|
587
|
-
* @param id
|
|
588
|
-
* @param requestBody
|
|
589
|
-
* @returns EnvTypeResponse Environment type updated successfully
|
|
590
|
-
* @throws ApiError
|
|
591
|
-
*/
|
|
592
|
-
updateEnvType(id, requestBody) {
|
|
593
|
-
return this.httpRequest.request({
|
|
594
|
-
method: "PATCH",
|
|
595
|
-
url: "/api/env_type/{id}",
|
|
596
|
-
path: {
|
|
597
|
-
"id": id
|
|
598
|
-
},
|
|
599
|
-
body: requestBody,
|
|
600
|
-
mediaType: "application/json",
|
|
601
|
-
errors: {
|
|
602
|
-
500: `Internal server error`
|
|
603
|
-
}
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* Delete Environment Type
|
|
608
|
-
* Delete an existing environment type
|
|
609
|
-
* @param id
|
|
610
|
-
* @returns DeleteEnvTypeRequest Environment type deleted successfully
|
|
611
|
-
* @throws ApiError
|
|
612
|
-
*/
|
|
613
|
-
deleteEnvType(id) {
|
|
614
|
-
return this.httpRequest.request({
|
|
615
|
-
method: "DELETE",
|
|
616
|
-
url: "/api/env_type/{id}",
|
|
617
|
-
path: {
|
|
618
|
-
"id": id
|
|
619
|
-
},
|
|
620
|
-
errors: {
|
|
621
|
-
500: `Internal server error`
|
|
622
|
-
}
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
776
|
};
|
|
626
777
|
|
|
627
778
|
// src/services/EnvironmentVariablesService.ts
|
|
@@ -975,6 +1126,121 @@
|
|
|
975
1126
|
}
|
|
976
1127
|
};
|
|
977
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
|
+
|
|
978
1244
|
// src/services/UsersService.ts
|
|
979
1245
|
var UsersService = class {
|
|
980
1246
|
constructor(httpRequest) {
|
|
@@ -1103,6 +1369,8 @@
|
|
|
1103
1369
|
|
|
1104
1370
|
// src/EnvSyncAPISDK.ts
|
|
1105
1371
|
var EnvSyncAPISDK = class {
|
|
1372
|
+
access;
|
|
1373
|
+
apiKeys;
|
|
1106
1374
|
applications;
|
|
1107
1375
|
auditLogs;
|
|
1108
1376
|
authentication;
|
|
@@ -1110,12 +1378,13 @@
|
|
|
1110
1378
|
environmentVariables;
|
|
1111
1379
|
onboarding;
|
|
1112
1380
|
organizations;
|
|
1381
|
+
roles;
|
|
1113
1382
|
users;
|
|
1114
1383
|
request;
|
|
1115
1384
|
constructor(config, HttpRequest = FetchHttpRequest) {
|
|
1116
1385
|
this.request = new HttpRequest({
|
|
1117
1386
|
BASE: config?.BASE ?? "http://localhost:8600",
|
|
1118
|
-
VERSION: config?.VERSION ?? "0.
|
|
1387
|
+
VERSION: config?.VERSION ?? "0.2.0",
|
|
1119
1388
|
WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
|
|
1120
1389
|
CREDENTIALS: config?.CREDENTIALS ?? "include",
|
|
1121
1390
|
TOKEN: config?.TOKEN,
|
|
@@ -1124,6 +1393,8 @@
|
|
|
1124
1393
|
HEADERS: config?.HEADERS,
|
|
1125
1394
|
ENCODE_PATH: config?.ENCODE_PATH
|
|
1126
1395
|
});
|
|
1396
|
+
this.access = new AccessService(this.request);
|
|
1397
|
+
this.apiKeys = new ApiKeysService(this.request);
|
|
1127
1398
|
this.applications = new ApplicationsService(this.request);
|
|
1128
1399
|
this.auditLogs = new AuditLogsService(this.request);
|
|
1129
1400
|
this.authentication = new AuthenticationService(this.request);
|
|
@@ -1131,6 +1402,7 @@
|
|
|
1131
1402
|
this.environmentVariables = new EnvironmentVariablesService(this.request);
|
|
1132
1403
|
this.onboarding = new OnboardingService(this.request);
|
|
1133
1404
|
this.organizations = new OrganizationsService(this.request);
|
|
1405
|
+
this.roles = new RolesService(this.request);
|
|
1134
1406
|
this.users = new UsersService(this.request);
|
|
1135
1407
|
}
|
|
1136
1408
|
};
|
|
@@ -1138,7 +1410,7 @@
|
|
|
1138
1410
|
// src/core/OpenAPI.ts
|
|
1139
1411
|
var OpenAPI = {
|
|
1140
1412
|
BASE: "http://localhost:8600",
|
|
1141
|
-
VERSION: "0.
|
|
1413
|
+
VERSION: "0.2.0",
|
|
1142
1414
|
WITH_CREDENTIALS: false,
|
|
1143
1415
|
CREDENTIALS: "include",
|
|
1144
1416
|
TOKEN: void 0,
|