@veloceapps/api 8.0.0-173 → 8.0.0-174

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.
@@ -3215,27 +3215,68 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
3215
3215
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
3216
3216
 
3217
3217
  class SandboxManagerApiService {
3218
- constructor(baseHttpService) {
3219
- this.baseHttpService = baseHttpService;
3220
- this.serviceUrl = '/admin/portal';
3218
+ constructor(http) {
3219
+ this.http = http;
3220
+ this.TOKEN_HEADER = `signed_request=${encodeURIComponent(window.SANDBOX_TOKEN ?? '')}` ?? '';
3221
+ this.SANDBOX_URL_FALLBACK = 'https://sandbox-manager.velocecpq.com';
3222
+ this.hostUrl = `${window.VELO_SANDBOX_API ?? this.SANDBOX_URL_FALLBACK}/clients`;
3223
+ }
3224
+ getSalesforceOrganizations$() {
3225
+ return this.http.get(`${this.hostUrl}/${window.VELO_CLIENT}/orgs`, {
3226
+ headers: {
3227
+ 'Veloce-Token': this.TOKEN_HEADER,
3228
+ },
3229
+ });
3221
3230
  }
3222
- getSalesforceOrganizations$(skip = 1, name = '') {
3223
- return of([
3224
- { id: '1', name: 'Organization 1', active: true },
3225
- { id: '2', name: 'Organization 2', active: false },
3226
- { id: '3', name: 'Organization 3', active: true },
3227
- ]);
3231
+ getAvailableSalesforceOrganizationSizes$() {
3232
+ return this.http.get(`${this.hostUrl}/${window.VELO_CLIENT}/available-sizes`, {
3233
+ headers: {
3234
+ 'Veloce-Token': this.TOKEN_HEADER,
3235
+ },
3236
+ });
3228
3237
  }
3229
- getAvailableSalesforceOrganizations$() {
3230
- return of(2);
3238
+ createSalesforceOrganization$(payload) {
3239
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs`, payload, {
3240
+ headers: {
3241
+ 'Veloce-Token': this.TOKEN_HEADER,
3242
+ },
3243
+ });
3244
+ }
3245
+ updateSalesforceOrganization$(payload) {
3246
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}`, payload, {
3247
+ headers: {
3248
+ 'Veloce-Token': this.TOKEN_HEADER,
3249
+ },
3250
+ });
3251
+ }
3252
+ deleteSalesforceOrganization$(payload) {
3253
+ return this.http.delete(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}`, {
3254
+ headers: {
3255
+ 'Veloce-Token': this.TOKEN_HEADER,
3256
+ },
3257
+ });
3258
+ }
3259
+ activateSalesforceOrganization$(payload) {
3260
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}/activate`, {}, {
3261
+ headers: {
3262
+ 'Veloce-Token': this.TOKEN_HEADER,
3263
+ },
3264
+ });
3265
+ }
3266
+ deactivateSalesforceOrganization$(payload) {
3267
+ return this.http.post(`${this.hostUrl}/${window.VELO_CLIENT}/orgs/${payload.orgId}/deactivate`, {}, {
3268
+ headers: {
3269
+ 'Veloce-Token': this.TOKEN_HEADER,
3270
+ },
3271
+ });
3231
3272
  }
3232
3273
  }
3233
3274
  SandboxManagerApiService.MAX_RESULTS = 60;
3234
- SandboxManagerApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
3275
+ SandboxManagerApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
3235
3276
  SandboxManagerApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService });
3236
3277
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, decorators: [{
3237
3278
  type: Injectable
3238
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
3279
+ }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
3239
3280
 
3240
3281
  class ApiModule {
3241
3282
  }