@veloceapps/api 8.0.0-99 → 9.0.0-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/esm2020/index.mjs +5 -3
- package/esm2020/lib/api.module.mjs +9 -3
- package/esm2020/lib/services/account-api.service.mjs +8 -1
- package/esm2020/lib/services/configuration-api.service.mjs +23 -4
- package/esm2020/lib/services/configuration-processors-api.service.mjs +1 -1
- package/esm2020/lib/services/document-templates-api.service.mjs +5 -3
- package/esm2020/lib/services/flow-state-api.mjs +142 -0
- package/esm2020/lib/services/flows-api.service.mjs +7 -2
- package/esm2020/lib/services/org-info-api.service.mjs +45 -10
- package/esm2020/lib/services/procedures-api.service.mjs +7 -1
- package/esm2020/lib/services/quote-api.service.mjs +18 -2
- package/esm2020/lib/services/salesforce-api.service.mjs +3 -3
- package/esm2020/lib/services/sandbox-manager-api.service.mjs +94 -0
- package/esm2020/lib/services/scripts-api.service.mjs +6 -3
- package/esm2020/lib/services/stateful-configuration-api.mjs +1 -1
- package/esm2020/lib/services/ui-templates-api.service.mjs +6 -1
- package/esm2020/lib/types/index.mjs +2 -1
- package/esm2020/lib/types/org-info.types.mjs +1 -1
- package/esm2020/lib/types/quote.types.mjs +2 -0
- package/esm2020/lib/utils/canvas.utils.mjs +33 -0
- package/fesm2015/veloceapps-api.mjs +471 -126
- package/fesm2015/veloceapps-api.mjs.map +1 -1
- package/fesm2020/veloceapps-api.mjs +484 -126
- package/fesm2020/veloceapps-api.mjs.map +1 -1
- package/index.d.ts +4 -2
- package/lib/services/account-api.service.d.ts +2 -1
- package/lib/services/flow-state-api.d.ts +84 -0
- package/lib/services/flows-api.service.d.ts +1 -1
- package/lib/services/org-info-api.service.d.ts +13 -7
- package/lib/services/procedures-api.service.d.ts +1 -0
- package/lib/services/quote-api.service.d.ts +13 -6
- package/lib/services/sandbox-manager-api.service.d.ts +24 -0
- package/lib/services/scripts-api.service.d.ts +1 -1
- package/lib/services/stateful-configuration-api.d.ts +2 -2
- package/lib/services/ui-templates-api.service.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/org-info.types.d.ts +19 -0
- package/lib/types/quote.types.d.ts +8 -0
- package/lib/utils/canvas.utils.d.ts +18 -0
- package/package.json +2 -2
package/index.d.ts
CHANGED
@@ -4,6 +4,7 @@ export { VeloceAuthService } from './lib/services/auth.service';
|
|
4
4
|
export { CatalogAdminApiService } from './lib/services/catalog-admin-api.service';
|
5
5
|
export { CatalogApiService } from './lib/services/catalog-api.service';
|
6
6
|
export { ConfigurationApiService } from './lib/services/configuration-api.service';
|
7
|
+
export { ConfigurationProcessorsApiService } from './lib/services/configuration-processors-api.service';
|
7
8
|
export { ConfigurationSettingsApiService } from './lib/services/configuration-settings-api.service';
|
8
9
|
export { ContextApiService } from './lib/services/context-api.service';
|
9
10
|
export { ContractedPriceApiService } from './lib/services/contracted-price-api.service';
|
@@ -11,12 +12,14 @@ export { DeltaApiService } from './lib/services/delta-api.service';
|
|
11
12
|
export { DocumentAttachmentApiService } from './lib/services/document-attachment-api.service';
|
12
13
|
export { DocumentTemplatesApiService } from './lib/services/document-templates-api.service';
|
13
14
|
export { EndpointsApiService } from './lib/services/endpoints-api.service';
|
15
|
+
export { FlowStateApiService } from './lib/services/flow-state-api';
|
14
16
|
export { FlowsApiService } from './lib/services/flows-api.service';
|
15
17
|
export { GuidedSellingsAdminApiService } from './lib/services/guided-sellings-admin-api.service';
|
16
18
|
export { GuidedSellingApiService } from './lib/services/guided-sellings-api.service';
|
17
19
|
export { OffersApiService } from './lib/services/offers-api.service';
|
18
20
|
export { OrgInfoApiService } from './lib/services/org-info-api.service';
|
19
21
|
export { PicklistsApiService } from './lib/services/picklists-api.service';
|
22
|
+
export { PortalsApiService } from './lib/services/portals-api.service';
|
20
23
|
export { PriceApiService } from './lib/services/price-api.service';
|
21
24
|
export { ProceduresApiService } from './lib/services/procedures-api.service';
|
22
25
|
export { ProductApiService } from './lib/services/product-api.service';
|
@@ -35,6 +38,5 @@ export { StatefulConfigurationApiService } from './lib/services/stateful-configu
|
|
35
38
|
export { UIDefinitionsApiService } from './lib/services/ui-definitions-api.service';
|
36
39
|
export { UITemplatesApiService } from './lib/services/ui-templates-api.service';
|
37
40
|
export { VeloceObjectsApiService } from './lib/services/veloce-objects-api.service';
|
38
|
-
export {
|
39
|
-
export { ConfigurationProcessorsApiService } from './lib/services/configuration-processors-api.service';
|
41
|
+
export { SandboxManagerApiService } from './lib/services/sandbox-manager-api.service';
|
40
42
|
export * from './lib/types';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Account, BaseHttpService, HttpRequestConfigurableOptions, LineItem, Order, Quote } from '@veloceapps/core';
|
1
|
+
import { Account, AccountAssetsState, BaseHttpService, HttpRequestConfigurableOptions, LineItem, Order, Quote } from '@veloceapps/core';
|
2
2
|
import { Observable } from 'rxjs';
|
3
3
|
import { QuerySearchParams } from '../types';
|
4
4
|
import * as i0 from "@angular/core";
|
@@ -9,6 +9,7 @@ export declare class AccountApiService {
|
|
9
9
|
getAccounts$(options?: HttpRequestConfigurableOptions): Observable<Account[]>;
|
10
10
|
searchAccounts$(searchParams?: QuerySearchParams, options?: HttpRequestConfigurableOptions): Observable<Account[]>;
|
11
11
|
getAccount$(id: string, options?: HttpRequestConfigurableOptions): Observable<Account>;
|
12
|
+
getAssetsState(accountId: string, options?: HttpRequestConfigurableOptions): Observable<AccountAssetsState>;
|
12
13
|
getAssets(accountId: string, options?: HttpRequestConfigurableOptions): Observable<LineItem[]>;
|
13
14
|
getOrders(accountId: string, options?: HttpRequestConfigurableOptions): Observable<Order[]>;
|
14
15
|
getQuotes(accountId: string, options?: HttpRequestConfigurableOptions): Observable<Quote[]>;
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import { BaseHttpService, ConfigurationStateExecuteRequest, ConfigurationStateNewRequest, ConfigurationStateStartRequest, FlowState, FlowStateExecutionRequestDTO, FlowStateExecutionResult, FlowStateInitRequest, FlowStateInitResponse } from '@veloceapps/core';
|
2
|
+
import { Observable } from 'rxjs';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class FlowStateApiService {
|
5
|
+
private httpService;
|
6
|
+
private readonly SERVICE_URL;
|
7
|
+
constructor(httpService: BaseHttpService);
|
8
|
+
/**
|
9
|
+
* Initialize flow state
|
10
|
+
* @param request Request
|
11
|
+
* @returns Flow initialization response, which contains session ID and result of selectors
|
12
|
+
*/
|
13
|
+
init(request: FlowStateInitRequest): Observable<FlowStateInitResponse>;
|
14
|
+
/**
|
15
|
+
* Get existing state by ID
|
16
|
+
* @param id ID
|
17
|
+
* @returns Flow State
|
18
|
+
*/
|
19
|
+
get(id: string): Observable<FlowState>;
|
20
|
+
/**
|
21
|
+
* Execute actions/selectors
|
22
|
+
* @param id State ID
|
23
|
+
* @param request Request
|
24
|
+
* @returns Execute result
|
25
|
+
*/
|
26
|
+
execute(id: string, request: FlowStateExecutionRequestDTO): Observable<FlowStateExecutionResult>;
|
27
|
+
/**
|
28
|
+
* Save Quote in the state
|
29
|
+
* @param id State ID
|
30
|
+
*/
|
31
|
+
save(id: string): Observable<{
|
32
|
+
quoteId: string;
|
33
|
+
}>;
|
34
|
+
/**
|
35
|
+
* Submit Quote in the state
|
36
|
+
* @param id State ID
|
37
|
+
*/
|
38
|
+
submit(id: string): Observable<{
|
39
|
+
quoteId: string;
|
40
|
+
}>;
|
41
|
+
/**
|
42
|
+
* Close Flow state
|
43
|
+
* @param id State ID
|
44
|
+
*/
|
45
|
+
cancel(id: string): Observable<void>;
|
46
|
+
/**
|
47
|
+
* Initialize stateful configuration
|
48
|
+
* @param stateId string
|
49
|
+
* @param request Request
|
50
|
+
* @returns Flow initialization response, which contains session ID and result of selectors
|
51
|
+
*/
|
52
|
+
newConfiguration(stateId: string, request: ConfigurationStateNewRequest): Observable<FlowStateExecutionResult>;
|
53
|
+
/**
|
54
|
+
* Start stateful configuration
|
55
|
+
* @param stateId string
|
56
|
+
* @param request Request
|
57
|
+
* @returns Flow initialization response, which contains session ID and result of selectors
|
58
|
+
*/
|
59
|
+
startConfiguration(stateId: string, request: ConfigurationStateStartRequest): Observable<FlowStateExecutionResult>;
|
60
|
+
/**
|
61
|
+
* Execute stateful configuration
|
62
|
+
* @param stateId string
|
63
|
+
* @param configurationId string
|
64
|
+
* @param request Request
|
65
|
+
* @returns Flow initialization response, which contains session ID and result of selectors
|
66
|
+
*/
|
67
|
+
executeConfiguration(stateId: string, configurationId: string, request: ConfigurationStateExecuteRequest): Observable<FlowStateExecutionResult>;
|
68
|
+
/**
|
69
|
+
* Save stateful configuration
|
70
|
+
* @param stateId string
|
71
|
+
* @param configurationId string
|
72
|
+
*/
|
73
|
+
saveConfiguration(stateId: string, configurationId: string): Observable<{
|
74
|
+
quoteId: string;
|
75
|
+
}>;
|
76
|
+
/**
|
77
|
+
* Cancel stateful configuration
|
78
|
+
* @param stateId string
|
79
|
+
* @param configurationId string
|
80
|
+
*/
|
81
|
+
cancelConfiguration(stateId: string, configurationId: string): Observable<void>;
|
82
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FlowStateApiService, never>;
|
83
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FlowStateApiService>;
|
84
|
+
}
|
@@ -6,7 +6,7 @@ export declare class FlowsApiService {
|
|
6
6
|
private configurationSettingsApiService;
|
7
7
|
private readonly flowsKey;
|
8
8
|
constructor(configurationSettingsApiService: ConfigurationSettingsApiService);
|
9
|
-
getFlow(id: string): Observable<Flow
|
9
|
+
getFlow(id: string): Observable<Flow>;
|
10
10
|
fetchFlows(): Observable<Flow[]>;
|
11
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<FlowsApiService, never>;
|
12
12
|
static ɵprov: i0.ɵɵInjectableDeclaration<FlowsApiService>;
|
@@ -1,13 +1,19 @@
|
|
1
|
-
import {
|
1
|
+
import { MessageService } from 'primeng/api';
|
2
2
|
import { Observable } from 'rxjs';
|
3
|
-
import { OrgInfo } from '../types/org-info.types';
|
3
|
+
import { AvailableVersionsInfo, OrgInfo } from '../types/org-info.types';
|
4
4
|
import * as i0 from "@angular/core";
|
5
5
|
export declare class OrgInfoApiService {
|
6
|
-
private
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
private messageService;
|
7
|
+
constructor(messageService: MessageService);
|
8
|
+
getOrgInfo$(): Observable<OrgInfo | undefined>;
|
9
|
+
getAvailableVersionsInfo$(): Observable<AvailableVersionsInfo | undefined>;
|
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;
|
11
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<OrgInfoApiService, never>;
|
12
18
|
static ɵprov: i0.ɵɵInjectableDeclaration<OrgInfoApiService>;
|
13
19
|
}
|
@@ -23,6 +23,7 @@ export declare class ProceduresApiService {
|
|
23
23
|
* @returns
|
24
24
|
*/
|
25
25
|
apply$(body: QuoteDraft): Observable<QuoteDraft>;
|
26
|
+
fetchDefaultPricingSteps$(): Observable<any>;
|
26
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<ProceduresApiService, never>;
|
27
28
|
static ɵprov: i0.ɵɵInjectableDeclaration<ProceduresApiService>;
|
28
29
|
}
|
@@ -1,18 +1,25 @@
|
|
1
1
|
import { BaseHttpService, HttpRequestConfigurableOptions, QuoteDraft } from '@veloceapps/core';
|
2
2
|
import { Dictionary } from 'lodash';
|
3
3
|
import { Observable } from 'rxjs';
|
4
|
+
import { SaveQuoteResponse, SubmitQuoteResponse } from '../types';
|
4
5
|
import * as i0 from "@angular/core";
|
5
6
|
export declare class QuoteApiService {
|
6
7
|
private httpService;
|
7
8
|
private readonly SERVICE_URL;
|
8
9
|
constructor(httpService: BaseHttpService);
|
10
|
+
/**
|
11
|
+
* @deprecated Use getQuoteState instead
|
12
|
+
*/
|
9
13
|
getQuoteDraft(objectId: string, params?: Dictionary<string>, errorHandler?: (error: any) => void): Observable<QuoteDraft>;
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
/**
|
15
|
+
* Comparing to deprecated `getQuoteDraft` this endpoint doesn't include orders and assets
|
16
|
+
* @param objectId quoteId | accountId | opportunityId | orderId
|
17
|
+
* @param params Query params
|
18
|
+
* @param options Request options
|
19
|
+
*/
|
20
|
+
getQuoteState(objectId: string, params?: Dictionary<string>, options?: HttpRequestConfigurableOptions): Observable<QuoteDraft>;
|
21
|
+
upsertQuote(request: QuoteDraft, options?: HttpRequestConfigurableOptions): Observable<SaveQuoteResponse>;
|
22
|
+
submitQuote(request: QuoteDraft, options?: HttpRequestConfigurableOptions): Observable<SubmitQuoteResponse>;
|
16
23
|
attachDocument(id: string, documentName: string, data: any): Observable<void>;
|
17
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<QuoteApiService, never>;
|
18
25
|
static ɵprov: i0.ɵɵInjectableDeclaration<QuoteApiService>;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { NewSalesforceOrganization, SalesforceOrganization } from '@veloceapps/core';
|
2
|
+
import { Dictionary } from 'lodash';
|
3
|
+
import { MessageService } from 'primeng/api';
|
4
|
+
import { Observable } from 'rxjs';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
export declare class SandboxManagerApiService {
|
7
|
+
private messageService;
|
8
|
+
constructor(messageService: MessageService);
|
9
|
+
getSalesforceOrganizations$(): Observable<SalesforceOrganization[]>;
|
10
|
+
getAvailableSalesforceOrganizationSizes$(): Observable<Dictionary<number>>;
|
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;
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SandboxManagerApiService, never>;
|
23
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SandboxManagerApiService>;
|
24
|
+
}
|
@@ -10,7 +10,7 @@ export declare class ScriptsApiService {
|
|
10
10
|
searchScripts$: (expression: Expression, skip?: number, count?: number) => Observable<Script[]>;
|
11
11
|
fetchScript$: (id: string) => Observable<ScriptDetails>;
|
12
12
|
createScript$: (script: NewScript) => Observable<Script>;
|
13
|
-
updateScriptMeta$: (script: Script) => Observable<
|
13
|
+
updateScriptMeta$: (script: Script) => Observable<ScriptDetails>;
|
14
14
|
updateScriptDetails$: (script: ScriptDetails) => Observable<ScriptDetails>;
|
15
15
|
cloneScript$: (cloneRequest: CloneRequest) => Observable<string>;
|
16
16
|
removeScript$: (id: string) => Observable<string>;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { BaseHttpService, ConfigurationExecuteRequest, ConfigurationExecuteResponse,
|
1
|
+
import { BaseHttpService, ConfigurationExecuteRequest, ConfigurationExecuteResponse, QuoteDraft } from '@veloceapps/core';
|
2
2
|
import { Observable } from 'rxjs';
|
3
3
|
import { StatefulConfigurationRequest } from '../types/stateful-configuration.types';
|
4
4
|
import * as i0 from "@angular/core";
|
@@ -17,7 +17,7 @@ export declare class StatefulConfigurationApiService {
|
|
17
17
|
* @param id ID
|
18
18
|
* @returns Configuration State
|
19
19
|
*/
|
20
|
-
get(id: string): Observable<
|
20
|
+
get(id: string): Observable<QuoteDraft>;
|
21
21
|
/**
|
22
22
|
* Execute actions/selectors
|
23
23
|
* @param id State ID
|
@@ -42,6 +42,7 @@ export declare class UITemplatesApiService {
|
|
42
42
|
attachTemplateThumbnail$(templateId: string, file: File): Observable<any>;
|
43
43
|
removeTemplateThumbnail$(templateId: string): Observable<any>;
|
44
44
|
fetchComponentAttachments$: (templateId: string, component: TemplateComponent) => Observable<ComponentAttachments>;
|
45
|
+
fetchComponentsAttachments$: (templateId: string) => Observable<ComponentAttachments[]>;
|
45
46
|
private fetchComponentAttachmentFile$;
|
46
47
|
uploadComponentAttachments$: (templateId: string, componentId: string, attachments: ComponentAttachments) => Observable<void>;
|
47
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<UITemplatesApiService, never>;
|
package/lib/types/index.d.ts
CHANGED
@@ -23,4 +23,23 @@ export interface OrgInfo {
|
|
23
23
|
DefaultDataVersion: string;
|
24
24
|
SelfRegistered: boolean;
|
25
25
|
SelfRegisteredExpireAt: string;
|
26
|
+
Scratch: boolean;
|
27
|
+
}
|
28
|
+
export interface AvailableVersionsInfo {
|
29
|
+
orgId: string;
|
30
|
+
name: string;
|
31
|
+
envId: string;
|
32
|
+
client: string;
|
33
|
+
currentVersion: VersionInfo;
|
34
|
+
availableVersions: VersionInfo[];
|
35
|
+
}
|
36
|
+
export interface VersionInfo {
|
37
|
+
release: string;
|
38
|
+
integrationVersion?: string;
|
39
|
+
componentVersions: ComponentVersionInfo[];
|
40
|
+
}
|
41
|
+
export interface ComponentVersionInfo {
|
42
|
+
name: string;
|
43
|
+
displayName: string;
|
44
|
+
version: string;
|
26
45
|
}
|
@@ -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;
|
package/package.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "@veloceapps/api",
|
3
|
-
"version": "
|
3
|
+
"version": "9.0.0-1",
|
4
4
|
"private": false,
|
5
5
|
"peerDependencies": {
|
6
6
|
"@angular/common": "~15.2.0",
|
7
7
|
"@angular/core": "~15.2.0",
|
8
|
-
"@veloceapps/core": "^
|
8
|
+
"@veloceapps/core": "^9.0.0-0",
|
9
9
|
"lodash": "^4.17.21",
|
10
10
|
"moment": "^2.29.1",
|
11
11
|
"rxjs": "~7.8.0"
|