@envsync-cloud/envsync-ts-sdk 0.9.1 → 0.10.1

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
@@ -751,6 +751,47 @@ var AuthenticationService = class {
751
751
  }
752
752
  });
753
753
  }
754
+ /**
755
+ * Create Workspace
756
+ * Create a new workspace for the current enterprise web session and switch into it
757
+ * @param requestBody
758
+ * @returns WhoAmIResponse Workspace created successfully
759
+ * @throws ApiError
760
+ */
761
+ createWorkspace(requestBody) {
762
+ return this.httpRequest.request({
763
+ method: "POST",
764
+ url: "/api/auth/create-workspace",
765
+ body: requestBody,
766
+ mediaType: "application/json",
767
+ errors: {
768
+ 400: `Invalid request`,
769
+ 401: `Cookie session required`,
770
+ 403: `Enterprise edition required`,
771
+ 409: `Workspace slug conflict`
772
+ }
773
+ });
774
+ }
775
+ /**
776
+ * Switch Active Organization
777
+ * Switch the active organization membership for the current web session
778
+ * @param requestBody
779
+ * @returns WhoAmIResponse Active organization switched successfully
780
+ * @throws ApiError
781
+ */
782
+ switchOrg(requestBody) {
783
+ return this.httpRequest.request({
784
+ method: "POST",
785
+ url: "/api/auth/switch-org",
786
+ body: requestBody,
787
+ mediaType: "application/json",
788
+ errors: {
789
+ 400: `Invalid request`,
790
+ 401: `Cookie session required`,
791
+ 403: `User does not belong to the requested organization`
792
+ }
793
+ });
794
+ }
754
795
  };
755
796
 
756
797
  // src/services/CertificatesService.ts
@@ -2764,6 +2805,105 @@ var SecretsRollbackService = class {
2764
2805
  }
2765
2806
  };
2766
2807
 
2808
+ // src/services/ServiceTokensService.ts
2809
+ var ServiceTokensService = class {
2810
+ constructor(httpRequest) {
2811
+ this.httpRequest = httpRequest;
2812
+ }
2813
+ /**
2814
+ * Create Service Token
2815
+ * Create a new scoped service token for the organization
2816
+ * @param requestBody
2817
+ * @returns CreateServiceTokenResponse Service token created successfully
2818
+ * @throws ApiError
2819
+ */
2820
+ createServiceToken(requestBody) {
2821
+ return this.httpRequest.request({
2822
+ method: "POST",
2823
+ url: "/api/service_token",
2824
+ body: requestBody,
2825
+ mediaType: "application/json",
2826
+ errors: {
2827
+ 500: `Internal server error`
2828
+ }
2829
+ });
2830
+ }
2831
+ /**
2832
+ * Get All Service Tokens
2833
+ * Retrieve all service tokens for the organization
2834
+ * @returns ServiceTokensResponse Service tokens retrieved successfully
2835
+ * @throws ApiError
2836
+ */
2837
+ getAllServiceTokens() {
2838
+ return this.httpRequest.request({
2839
+ method: "GET",
2840
+ url: "/api/service_token",
2841
+ errors: {
2842
+ 500: `Internal server error`
2843
+ }
2844
+ });
2845
+ }
2846
+ /**
2847
+ * Get Service Token
2848
+ * Retrieve a specific service token (does not return the raw token)
2849
+ * @param id
2850
+ * @returns ServiceTokenResponse Service token retrieved successfully
2851
+ * @throws ApiError
2852
+ */
2853
+ getServiceToken(id) {
2854
+ return this.httpRequest.request({
2855
+ method: "GET",
2856
+ url: "/api/service_token/{id}",
2857
+ path: {
2858
+ "id": id
2859
+ },
2860
+ errors: {
2861
+ 500: `Internal server error`
2862
+ }
2863
+ });
2864
+ }
2865
+ /**
2866
+ * Delete Service Token
2867
+ * Delete an existing service token
2868
+ * @param id
2869
+ * @returns ErrorResponse Service token deleted successfully
2870
+ * @throws ApiError
2871
+ */
2872
+ deleteServiceToken(id) {
2873
+ return this.httpRequest.request({
2874
+ method: "DELETE",
2875
+ url: "/api/service_token/{id}",
2876
+ path: {
2877
+ "id": id
2878
+ },
2879
+ errors: {
2880
+ 500: `Internal server error`
2881
+ }
2882
+ });
2883
+ }
2884
+ };
2885
+
2886
+ // src/services/SystemService.ts
2887
+ var SystemService = class {
2888
+ constructor(httpRequest) {
2889
+ this.httpRequest = httpRequest;
2890
+ }
2891
+ /**
2892
+ * Get Management System Status
2893
+ * @returns SystemStatusResponse Management system status
2894
+ * @throws ApiError
2895
+ */
2896
+ getManagementSystemStatus() {
2897
+ return this.httpRequest.request({
2898
+ method: "GET",
2899
+ url: "/api/system/status",
2900
+ errors: {
2901
+ 500: `Internal server error`
2902
+ }
2903
+ });
2904
+ }
2905
+ };
2906
+
2767
2907
  // src/services/TeamsService.ts
2768
2908
  var TeamsService = class {
2769
2909
  constructor(httpRequest) {
@@ -3209,6 +3349,8 @@ var EnvSyncAPISDK = class {
3209
3349
  secrets;
3210
3350
  secretsPointInTime;
3211
3351
  secretsRollback;
3352
+ serviceTokens;
3353
+ system;
3212
3354
  teams;
3213
3355
  users;
3214
3356
  webhooks;
@@ -3216,7 +3358,7 @@ var EnvSyncAPISDK = class {
3216
3358
  constructor(config, HttpRequest = FetchHttpRequest) {
3217
3359
  this.request = new HttpRequest({
3218
3360
  BASE: config?.BASE ?? "http://localhost:4000",
3219
- VERSION: config?.VERSION ?? "0.7.7",
3361
+ VERSION: config?.VERSION ?? "0.10.0",
3220
3362
  WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
3221
3363
  CREDENTIALS: config?.CREDENTIALS ?? "include",
3222
3364
  TOKEN: config?.TOKEN,
@@ -3245,6 +3387,8 @@ var EnvSyncAPISDK = class {
3245
3387
  this.secrets = new SecretsService(this.request);
3246
3388
  this.secretsPointInTime = new SecretsPointInTimeService(this.request);
3247
3389
  this.secretsRollback = new SecretsRollbackService(this.request);
3390
+ this.serviceTokens = new ServiceTokensService(this.request);
3391
+ this.system = new SystemService(this.request);
3248
3392
  this.teams = new TeamsService(this.request);
3249
3393
  this.users = new UsersService(this.request);
3250
3394
  this.webhooks = new WebhooksService(this.request);
@@ -3254,7 +3398,7 @@ var EnvSyncAPISDK = class {
3254
3398
  // src/core/OpenAPI.ts
3255
3399
  var OpenAPI = {
3256
3400
  BASE: "http://localhost:4000",
3257
- VERSION: "0.7.7",
3401
+ VERSION: "0.10.0",
3258
3402
  WITH_CREDENTIALS: false,
3259
3403
  CREDENTIALS: "include",
3260
3404
  TOKEN: void 0,
@@ -3289,6 +3433,13 @@ var CreateWebhookRequest;
3289
3433
  webhook_type2["DISCORD"] = "DISCORD";
3290
3434
  webhook_type2["SLACK"] = "SLACK";
3291
3435
  webhook_type2["CUSTOM"] = "CUSTOM";
3436
+ webhook_type2["GITHUB_ACTIONS"] = "GITHUB_ACTIONS";
3437
+ webhook_type2["GITLAB_PIPELINE"] = "GITLAB_PIPELINE";
3438
+ webhook_type2["AWS_CODEPIPELINE"] = "AWS_CODEPIPELINE";
3439
+ webhook_type2["GCP_CLOUD_BUILD"] = "GCP_CLOUD_BUILD";
3440
+ webhook_type2["CIRCLECI"] = "CIRCLECI";
3441
+ webhook_type2["TRAVIS_CI"] = "TRAVIS_CI";
3442
+ webhook_type2["JENKINS"] = "JENKINS";
3292
3443
  })(webhook_type = CreateWebhookRequest2.webhook_type || (CreateWebhookRequest2.webhook_type = {}));
3293
3444
  let linked_to;
3294
3445
  ((linked_to2) => {
@@ -3387,6 +3538,26 @@ var GrantEntry;
3387
3538
  })(relation = GrantEntry2.relation || (GrantEntry2.relation = {}));
3388
3539
  })(GrantEntry || (GrantEntry = {}));
3389
3540
 
3541
+ // src/models/LicenseState.ts
3542
+ var LicenseState;
3543
+ ((LicenseState2) => {
3544
+ let status;
3545
+ ((status2) => {
3546
+ status2["UNKNOWN"] = "unknown";
3547
+ status2["ACTIVE"] = "active";
3548
+ status2["INACTIVE"] = "inactive";
3549
+ status2["EXPIRED"] = "expired";
3550
+ status2["ERROR"] = "error";
3551
+ status2["LOCKED"] = "locked";
3552
+ })(status = LicenseState2.status || (LicenseState2.status = {}));
3553
+ let validation_mode;
3554
+ ((validation_mode2) => {
3555
+ validation_mode2["NONE"] = "none";
3556
+ validation_mode2["LEASE"] = "lease";
3557
+ validation_mode2["CERTIFICATE"] = "certificate";
3558
+ })(validation_mode = LicenseState2.validation_mode || (LicenseState2.validation_mode = {}));
3559
+ })(LicenseState || (LicenseState = {}));
3560
+
3390
3561
  // src/models/RevokeAccessRequest.ts
3391
3562
  var RevokeAccessRequest;
3392
3563
  ((RevokeAccessRequest2) => {
@@ -3437,6 +3608,16 @@ var SignDataRequest;
3437
3608
  })(mode = SignDataRequest2.mode || (SignDataRequest2.mode = {}));
3438
3609
  })(SignDataRequest || (SignDataRequest = {}));
3439
3610
 
3611
+ // src/models/SystemStatusState.ts
3612
+ var SystemStatusState;
3613
+ ((SystemStatusState2) => {
3614
+ let edition;
3615
+ ((edition2) => {
3616
+ edition2["OSS"] = "oss";
3617
+ edition2["ENTERPRISE"] = "enterprise";
3618
+ })(edition = SystemStatusState2.edition || (SystemStatusState2.edition = {}));
3619
+ })(SystemStatusState || (SystemStatusState = {}));
3620
+
3440
3621
  // src/models/UpdateTrustLevelRequest.ts
3441
3622
  var UpdateTrustLevelRequest;
3442
3623
  ((UpdateTrustLevelRequest2) => {
@@ -3458,6 +3639,13 @@ var UpdateWebhookRequest;
3458
3639
  webhook_type2["DISCORD"] = "DISCORD";
3459
3640
  webhook_type2["SLACK"] = "SLACK";
3460
3641
  webhook_type2["CUSTOM"] = "CUSTOM";
3642
+ webhook_type2["GITHUB_ACTIONS"] = "GITHUB_ACTIONS";
3643
+ webhook_type2["GITLAB_PIPELINE"] = "GITLAB_PIPELINE";
3644
+ webhook_type2["AWS_CODEPIPELINE"] = "AWS_CODEPIPELINE";
3645
+ webhook_type2["GCP_CLOUD_BUILD"] = "GCP_CLOUD_BUILD";
3646
+ webhook_type2["CIRCLECI"] = "CIRCLECI";
3647
+ webhook_type2["TRAVIS_CI"] = "TRAVIS_CI";
3648
+ webhook_type2["JENKINS"] = "JENKINS";
3461
3649
  })(webhook_type = UpdateWebhookRequest2.webhook_type || (UpdateWebhookRequest2.webhook_type = {}));
3462
3650
  let linked_to;
3463
3651
  ((linked_to2) => {
@@ -3485,6 +3673,13 @@ var WebhookResponse;
3485
3673
  webhook_type2["DISCORD"] = "DISCORD";
3486
3674
  webhook_type2["SLACK"] = "SLACK";
3487
3675
  webhook_type2["CUSTOM"] = "CUSTOM";
3676
+ webhook_type2["GITHUB_ACTIONS"] = "GITHUB_ACTIONS";
3677
+ webhook_type2["GITLAB_PIPELINE"] = "GITLAB_PIPELINE";
3678
+ webhook_type2["AWS_CODEPIPELINE"] = "AWS_CODEPIPELINE";
3679
+ webhook_type2["GCP_CLOUD_BUILD"] = "GCP_CLOUD_BUILD";
3680
+ webhook_type2["CIRCLECI"] = "CIRCLECI";
3681
+ webhook_type2["TRAVIS_CI"] = "TRAVIS_CI";
3682
+ webhook_type2["JENKINS"] = "JENKINS";
3488
3683
  })(webhook_type = WebhookResponse2.webhook_type || (WebhookResponse2.webhook_type = {}));
3489
3684
  let linked_to;
3490
3685
  ((linked_to2) => {
@@ -3518,6 +3713,7 @@ export {
3518
3713
  GpgKeysService,
3519
3714
  GrantAccessRequest,
3520
3715
  GrantEntry,
3716
+ LicenseState,
3521
3717
  OnboardingService,
3522
3718
  OpenAPI,
3523
3719
  OrganizationsService,
@@ -3529,7 +3725,10 @@ export {
3529
3725
  SecretsPointInTimeService,
3530
3726
  SecretsRollbackService,
3531
3727
  SecretsService,
3728
+ ServiceTokensService,
3532
3729
  SignDataRequest,
3730
+ SystemService,
3731
+ SystemStatusState,
3533
3732
  TeamsService,
3534
3733
  UpdateTrustLevelRequest,
3535
3734
  UpdateWebhookRequest,