@envsync-cloud/envsync-ts-sdk 0.9.1 → 0.10.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
@@ -45,6 +45,7 @@ __export(src_exports, {
45
45
  GpgKeysService: () => GpgKeysService,
46
46
  GrantAccessRequest: () => GrantAccessRequest,
47
47
  GrantEntry: () => GrantEntry,
48
+ LicenseState: () => LicenseState,
48
49
  OnboardingService: () => OnboardingService,
49
50
  OpenAPI: () => OpenAPI,
50
51
  OrganizationsService: () => OrganizationsService,
@@ -56,7 +57,10 @@ __export(src_exports, {
56
57
  SecretsPointInTimeService: () => SecretsPointInTimeService,
57
58
  SecretsRollbackService: () => SecretsRollbackService,
58
59
  SecretsService: () => SecretsService,
60
+ ServiceTokensService: () => ServiceTokensService,
59
61
  SignDataRequest: () => SignDataRequest,
62
+ SystemService: () => SystemService,
63
+ SystemStatusState: () => SystemStatusState,
60
64
  TeamsService: () => TeamsService,
61
65
  UpdateTrustLevelRequest: () => UpdateTrustLevelRequest,
62
66
  UpdateWebhookRequest: () => UpdateWebhookRequest,
@@ -820,6 +824,47 @@ var AuthenticationService = class {
820
824
  }
821
825
  });
822
826
  }
827
+ /**
828
+ * Create Workspace
829
+ * Create a new workspace for the current enterprise web session and switch into it
830
+ * @param requestBody
831
+ * @returns WhoAmIResponse Workspace created successfully
832
+ * @throws ApiError
833
+ */
834
+ createWorkspace(requestBody) {
835
+ return this.httpRequest.request({
836
+ method: "POST",
837
+ url: "/api/auth/create-workspace",
838
+ body: requestBody,
839
+ mediaType: "application/json",
840
+ errors: {
841
+ 400: `Invalid request`,
842
+ 401: `Cookie session required`,
843
+ 403: `Enterprise edition required`,
844
+ 409: `Workspace slug conflict`
845
+ }
846
+ });
847
+ }
848
+ /**
849
+ * Switch Active Organization
850
+ * Switch the active organization membership for the current web session
851
+ * @param requestBody
852
+ * @returns WhoAmIResponse Active organization switched successfully
853
+ * @throws ApiError
854
+ */
855
+ switchOrg(requestBody) {
856
+ return this.httpRequest.request({
857
+ method: "POST",
858
+ url: "/api/auth/switch-org",
859
+ body: requestBody,
860
+ mediaType: "application/json",
861
+ errors: {
862
+ 400: `Invalid request`,
863
+ 401: `Cookie session required`,
864
+ 403: `User does not belong to the requested organization`
865
+ }
866
+ });
867
+ }
823
868
  };
824
869
 
825
870
  // src/services/CertificatesService.ts
@@ -2833,6 +2878,105 @@ var SecretsRollbackService = class {
2833
2878
  }
2834
2879
  };
2835
2880
 
2881
+ // src/services/ServiceTokensService.ts
2882
+ var ServiceTokensService = class {
2883
+ constructor(httpRequest) {
2884
+ this.httpRequest = httpRequest;
2885
+ }
2886
+ /**
2887
+ * Create Service Token
2888
+ * Create a new scoped service token for the organization
2889
+ * @param requestBody
2890
+ * @returns CreateServiceTokenResponse Service token created successfully
2891
+ * @throws ApiError
2892
+ */
2893
+ createServiceToken(requestBody) {
2894
+ return this.httpRequest.request({
2895
+ method: "POST",
2896
+ url: "/api/service_token",
2897
+ body: requestBody,
2898
+ mediaType: "application/json",
2899
+ errors: {
2900
+ 500: `Internal server error`
2901
+ }
2902
+ });
2903
+ }
2904
+ /**
2905
+ * Get All Service Tokens
2906
+ * Retrieve all service tokens for the organization
2907
+ * @returns ServiceTokensResponse Service tokens retrieved successfully
2908
+ * @throws ApiError
2909
+ */
2910
+ getAllServiceTokens() {
2911
+ return this.httpRequest.request({
2912
+ method: "GET",
2913
+ url: "/api/service_token",
2914
+ errors: {
2915
+ 500: `Internal server error`
2916
+ }
2917
+ });
2918
+ }
2919
+ /**
2920
+ * Get Service Token
2921
+ * Retrieve a specific service token (does not return the raw token)
2922
+ * @param id
2923
+ * @returns ServiceTokenResponse Service token retrieved successfully
2924
+ * @throws ApiError
2925
+ */
2926
+ getServiceToken(id) {
2927
+ return this.httpRequest.request({
2928
+ method: "GET",
2929
+ url: "/api/service_token/{id}",
2930
+ path: {
2931
+ "id": id
2932
+ },
2933
+ errors: {
2934
+ 500: `Internal server error`
2935
+ }
2936
+ });
2937
+ }
2938
+ /**
2939
+ * Delete Service Token
2940
+ * Delete an existing service token
2941
+ * @param id
2942
+ * @returns ErrorResponse Service token deleted successfully
2943
+ * @throws ApiError
2944
+ */
2945
+ deleteServiceToken(id) {
2946
+ return this.httpRequest.request({
2947
+ method: "DELETE",
2948
+ url: "/api/service_token/{id}",
2949
+ path: {
2950
+ "id": id
2951
+ },
2952
+ errors: {
2953
+ 500: `Internal server error`
2954
+ }
2955
+ });
2956
+ }
2957
+ };
2958
+
2959
+ // src/services/SystemService.ts
2960
+ var SystemService = class {
2961
+ constructor(httpRequest) {
2962
+ this.httpRequest = httpRequest;
2963
+ }
2964
+ /**
2965
+ * Get Management System Status
2966
+ * @returns SystemStatusResponse Management system status
2967
+ * @throws ApiError
2968
+ */
2969
+ getManagementSystemStatus() {
2970
+ return this.httpRequest.request({
2971
+ method: "GET",
2972
+ url: "/api/system/status",
2973
+ errors: {
2974
+ 500: `Internal server error`
2975
+ }
2976
+ });
2977
+ }
2978
+ };
2979
+
2836
2980
  // src/services/TeamsService.ts
2837
2981
  var TeamsService = class {
2838
2982
  constructor(httpRequest) {
@@ -3278,6 +3422,8 @@ var EnvSyncAPISDK = class {
3278
3422
  secrets;
3279
3423
  secretsPointInTime;
3280
3424
  secretsRollback;
3425
+ serviceTokens;
3426
+ system;
3281
3427
  teams;
3282
3428
  users;
3283
3429
  webhooks;
@@ -3285,7 +3431,7 @@ var EnvSyncAPISDK = class {
3285
3431
  constructor(config, HttpRequest = FetchHttpRequest) {
3286
3432
  this.request = new HttpRequest({
3287
3433
  BASE: config?.BASE ?? "http://localhost:4000",
3288
- VERSION: config?.VERSION ?? "0.7.7",
3434
+ VERSION: config?.VERSION ?? "0.10.0",
3289
3435
  WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
3290
3436
  CREDENTIALS: config?.CREDENTIALS ?? "include",
3291
3437
  TOKEN: config?.TOKEN,
@@ -3314,6 +3460,8 @@ var EnvSyncAPISDK = class {
3314
3460
  this.secrets = new SecretsService(this.request);
3315
3461
  this.secretsPointInTime = new SecretsPointInTimeService(this.request);
3316
3462
  this.secretsRollback = new SecretsRollbackService(this.request);
3463
+ this.serviceTokens = new ServiceTokensService(this.request);
3464
+ this.system = new SystemService(this.request);
3317
3465
  this.teams = new TeamsService(this.request);
3318
3466
  this.users = new UsersService(this.request);
3319
3467
  this.webhooks = new WebhooksService(this.request);
@@ -3323,7 +3471,7 @@ var EnvSyncAPISDK = class {
3323
3471
  // src/core/OpenAPI.ts
3324
3472
  var OpenAPI = {
3325
3473
  BASE: "http://localhost:4000",
3326
- VERSION: "0.7.7",
3474
+ VERSION: "0.10.0",
3327
3475
  WITH_CREDENTIALS: false,
3328
3476
  CREDENTIALS: "include",
3329
3477
  TOKEN: void 0,
@@ -3358,6 +3506,13 @@ var CreateWebhookRequest;
3358
3506
  webhook_type2["DISCORD"] = "DISCORD";
3359
3507
  webhook_type2["SLACK"] = "SLACK";
3360
3508
  webhook_type2["CUSTOM"] = "CUSTOM";
3509
+ webhook_type2["GITHUB_ACTIONS"] = "GITHUB_ACTIONS";
3510
+ webhook_type2["GITLAB_PIPELINE"] = "GITLAB_PIPELINE";
3511
+ webhook_type2["AWS_CODEPIPELINE"] = "AWS_CODEPIPELINE";
3512
+ webhook_type2["GCP_CLOUD_BUILD"] = "GCP_CLOUD_BUILD";
3513
+ webhook_type2["CIRCLECI"] = "CIRCLECI";
3514
+ webhook_type2["TRAVIS_CI"] = "TRAVIS_CI";
3515
+ webhook_type2["JENKINS"] = "JENKINS";
3361
3516
  })(webhook_type = CreateWebhookRequest2.webhook_type || (CreateWebhookRequest2.webhook_type = {}));
3362
3517
  let linked_to;
3363
3518
  ((linked_to2) => {
@@ -3456,6 +3611,26 @@ var GrantEntry;
3456
3611
  })(relation = GrantEntry2.relation || (GrantEntry2.relation = {}));
3457
3612
  })(GrantEntry || (GrantEntry = {}));
3458
3613
 
3614
+ // src/models/LicenseState.ts
3615
+ var LicenseState;
3616
+ ((LicenseState2) => {
3617
+ let status;
3618
+ ((status2) => {
3619
+ status2["UNKNOWN"] = "unknown";
3620
+ status2["ACTIVE"] = "active";
3621
+ status2["INACTIVE"] = "inactive";
3622
+ status2["EXPIRED"] = "expired";
3623
+ status2["ERROR"] = "error";
3624
+ status2["LOCKED"] = "locked";
3625
+ })(status = LicenseState2.status || (LicenseState2.status = {}));
3626
+ let validation_mode;
3627
+ ((validation_mode2) => {
3628
+ validation_mode2["NONE"] = "none";
3629
+ validation_mode2["LEASE"] = "lease";
3630
+ validation_mode2["CERTIFICATE"] = "certificate";
3631
+ })(validation_mode = LicenseState2.validation_mode || (LicenseState2.validation_mode = {}));
3632
+ })(LicenseState || (LicenseState = {}));
3633
+
3459
3634
  // src/models/RevokeAccessRequest.ts
3460
3635
  var RevokeAccessRequest;
3461
3636
  ((RevokeAccessRequest2) => {
@@ -3506,6 +3681,16 @@ var SignDataRequest;
3506
3681
  })(mode = SignDataRequest2.mode || (SignDataRequest2.mode = {}));
3507
3682
  })(SignDataRequest || (SignDataRequest = {}));
3508
3683
 
3684
+ // src/models/SystemStatusState.ts
3685
+ var SystemStatusState;
3686
+ ((SystemStatusState2) => {
3687
+ let edition;
3688
+ ((edition2) => {
3689
+ edition2["OSS"] = "oss";
3690
+ edition2["ENTERPRISE"] = "enterprise";
3691
+ })(edition = SystemStatusState2.edition || (SystemStatusState2.edition = {}));
3692
+ })(SystemStatusState || (SystemStatusState = {}));
3693
+
3509
3694
  // src/models/UpdateTrustLevelRequest.ts
3510
3695
  var UpdateTrustLevelRequest;
3511
3696
  ((UpdateTrustLevelRequest2) => {
@@ -3527,6 +3712,13 @@ var UpdateWebhookRequest;
3527
3712
  webhook_type2["DISCORD"] = "DISCORD";
3528
3713
  webhook_type2["SLACK"] = "SLACK";
3529
3714
  webhook_type2["CUSTOM"] = "CUSTOM";
3715
+ webhook_type2["GITHUB_ACTIONS"] = "GITHUB_ACTIONS";
3716
+ webhook_type2["GITLAB_PIPELINE"] = "GITLAB_PIPELINE";
3717
+ webhook_type2["AWS_CODEPIPELINE"] = "AWS_CODEPIPELINE";
3718
+ webhook_type2["GCP_CLOUD_BUILD"] = "GCP_CLOUD_BUILD";
3719
+ webhook_type2["CIRCLECI"] = "CIRCLECI";
3720
+ webhook_type2["TRAVIS_CI"] = "TRAVIS_CI";
3721
+ webhook_type2["JENKINS"] = "JENKINS";
3530
3722
  })(webhook_type = UpdateWebhookRequest2.webhook_type || (UpdateWebhookRequest2.webhook_type = {}));
3531
3723
  let linked_to;
3532
3724
  ((linked_to2) => {
@@ -3554,6 +3746,13 @@ var WebhookResponse;
3554
3746
  webhook_type2["DISCORD"] = "DISCORD";
3555
3747
  webhook_type2["SLACK"] = "SLACK";
3556
3748
  webhook_type2["CUSTOM"] = "CUSTOM";
3749
+ webhook_type2["GITHUB_ACTIONS"] = "GITHUB_ACTIONS";
3750
+ webhook_type2["GITLAB_PIPELINE"] = "GITLAB_PIPELINE";
3751
+ webhook_type2["AWS_CODEPIPELINE"] = "AWS_CODEPIPELINE";
3752
+ webhook_type2["GCP_CLOUD_BUILD"] = "GCP_CLOUD_BUILD";
3753
+ webhook_type2["CIRCLECI"] = "CIRCLECI";
3754
+ webhook_type2["TRAVIS_CI"] = "TRAVIS_CI";
3755
+ webhook_type2["JENKINS"] = "JENKINS";
3557
3756
  })(webhook_type = WebhookResponse2.webhook_type || (WebhookResponse2.webhook_type = {}));
3558
3757
  let linked_to;
3559
3758
  ((linked_to2) => {
@@ -3588,6 +3787,7 @@ var WebhookResponse;
3588
3787
  GpgKeysService,
3589
3788
  GrantAccessRequest,
3590
3789
  GrantEntry,
3790
+ LicenseState,
3591
3791
  OnboardingService,
3592
3792
  OpenAPI,
3593
3793
  OrganizationsService,
@@ -3599,7 +3799,10 @@ var WebhookResponse;
3599
3799
  SecretsPointInTimeService,
3600
3800
  SecretsRollbackService,
3601
3801
  SecretsService,
3802
+ ServiceTokensService,
3602
3803
  SignDataRequest,
3804
+ SystemService,
3805
+ SystemStatusState,
3603
3806
  TeamsService,
3604
3807
  UpdateTrustLevelRequest,
3605
3808
  UpdateWebhookRequest,