@veloceapps/api 8.0.0-195 → 8.0.0-197
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/esm2020/lib/services/org-info-api.service.mjs +19 -6
- package/esm2020/lib/services/sandbox-manager-api.service.mjs +72 -45
- package/esm2020/lib/utils/canvas.utils.mjs +33 -0
- package/fesm2015/veloceapps-api.mjs +120 -54
- package/fesm2015/veloceapps-api.mjs.map +1 -1
- package/fesm2020/veloceapps-api.mjs +120 -53
- package/fesm2020/veloceapps-api.mjs.map +1 -1
- package/lib/services/org-info-api.service.d.ts +9 -0
- package/lib/services/sandbox-manager-api.service.d.ts +15 -13
- package/lib/utils/canvas.utils.d.ts +18 -0
- package/package.json +1 -1
@@ -1,10 +1,19 @@
|
|
1
|
+
import { MessageService } from 'primeng/api';
|
1
2
|
import { Observable } from 'rxjs';
|
2
3
|
import { AvailableVersionsInfo, OrgInfo } from '../types/org-info.types';
|
3
4
|
import * as i0 from "@angular/core";
|
4
5
|
export declare class OrgInfoApiService {
|
6
|
+
private messageService;
|
7
|
+
constructor(messageService: MessageService);
|
5
8
|
getOrgInfo$(): Observable<OrgInfo | undefined>;
|
6
9
|
getAvailableVersionsInfo$(): Observable<AvailableVersionsInfo | undefined>;
|
7
10
|
upgradeVersion$(targetVersion: string): Observable<OrgInfo | undefined>;
|
11
|
+
/**
|
12
|
+
* Shows an error message using the message service.
|
13
|
+
*
|
14
|
+
* @param {string} message - the error message to be published.
|
15
|
+
*/
|
16
|
+
private publishErrorMessage;
|
8
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<OrgInfoApiService, never>;
|
9
18
|
static ɵprov: i0.ɵɵInjectableDeclaration<OrgInfoApiService>;
|
10
19
|
}
|
@@ -1,22 +1,24 @@
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
2
1
|
import { NewSalesforceOrganization, SalesforceOrganization } from '@veloceapps/core';
|
3
|
-
import { Observable } from 'rxjs';
|
4
2
|
import { Dictionary } from 'lodash';
|
3
|
+
import { MessageService } from 'primeng/api';
|
4
|
+
import { Observable } from 'rxjs';
|
5
5
|
import * as i0 from "@angular/core";
|
6
6
|
export declare class SandboxManagerApiService {
|
7
|
-
private
|
8
|
-
|
9
|
-
private readonly TOKEN_HEADER;
|
10
|
-
private readonly SANDBOX_URL_FALLBACK;
|
11
|
-
private readonly hostUrl;
|
12
|
-
constructor(http: HttpClient);
|
7
|
+
private messageService;
|
8
|
+
constructor(messageService: MessageService);
|
13
9
|
getSalesforceOrganizations$(): Observable<SalesforceOrganization[]>;
|
14
10
|
getAvailableSalesforceOrganizationSizes$(): Observable<Dictionary<number>>;
|
15
|
-
createSalesforceOrganization$(payload: NewSalesforceOrganization): Observable<SalesforceOrganization>;
|
16
|
-
updateSalesforceOrganization$(payload: SalesforceOrganization): Observable<SalesforceOrganization>;
|
17
|
-
deleteSalesforceOrganization$(payload: SalesforceOrganization): Observable<SalesforceOrganization>;
|
18
|
-
activateSalesforceOrganization$(payload: SalesforceOrganization): Observable<SalesforceOrganization>;
|
19
|
-
deactivateSalesforceOrganization$(payload: SalesforceOrganization): Observable<SalesforceOrganization>;
|
11
|
+
createSalesforceOrganization$(payload: NewSalesforceOrganization): Observable<SalesforceOrganization | undefined>;
|
12
|
+
updateSalesforceOrganization$(payload: SalesforceOrganization): Observable<SalesforceOrganization | undefined>;
|
13
|
+
deleteSalesforceOrganization$(payload: SalesforceOrganization): Observable<SalesforceOrganization | undefined>;
|
14
|
+
activateSalesforceOrganization$(payload: SalesforceOrganization): Observable<SalesforceOrganization | undefined>;
|
15
|
+
deactivateSalesforceOrganization$(payload: SalesforceOrganization): Observable<SalesforceOrganization | undefined>;
|
16
|
+
/**
|
17
|
+
* Shows an error message using the message service.
|
18
|
+
*
|
19
|
+
* @param {string} message - the error message to be published.
|
20
|
+
*/
|
21
|
+
private publishErrorMessage;
|
20
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<SandboxManagerApiService, never>;
|
21
23
|
static ɵprov: i0.ɵɵInjectableDeclaration<SandboxManagerApiService>;
|
22
24
|
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* Parses the response from Canvas and checks for errors.
|
3
|
+
* - If an error is found, publishes an error message and returns the failover value.
|
4
|
+
* - If no error is found, returns the parsed response.
|
5
|
+
*
|
6
|
+
* Note! The API call first goes to APEX before reaching the Canvas, so errors can originate from either APEX or Canvas.
|
7
|
+
*
|
8
|
+
* @param {string} response - The JSON string response from the Canvas call.
|
9
|
+
* @param {T} failover - The value to return in case of error.
|
10
|
+
* @returns {T | K} The parsed response or the failover value.
|
11
|
+
*
|
12
|
+
* @template T The expected type of the parsed response.
|
13
|
+
* @template K The type of the failover value.
|
14
|
+
*
|
15
|
+
* @remarks If there's an Apex error, the response data can be an array.
|
16
|
+
* In such cases, the function extracts the first element of the array.
|
17
|
+
*/
|
18
|
+
export declare const handleCanvasResponse: <T, K>(response: string, failover: K, errorPublisher: (message: string) => void) => T | K;
|