@impartner/angular-sdk
v5.0.1
Published
This package contains [Angular](https://angular.io/) services and typings to facilitate development and integration of Angular web components written for Impartner host applications.
Maintainers
Keywords
Readme
@impartner/angular-sdk
This package contains Angular services and typings to facilitate development and integration of Angular web components written for Impartner host applications.
Dependencies
Each release of this library targets for a specific minimum version of Angular. Please refer to the below table to see which versions are supported or targeted for a given release.
| @impartner/angular-sdk | Angular | | ---------------------- | -------- | | 1.1.0 | ^14.2.0 | | 2.0.0 | >=17.0.4 | | 3.0.0 | >=18.2.0 | | 4.0.0 | >=20.2.4 | | 5.0.0 | >=22.1.6 |
Getting Started
Add the
@impartner/angular-sdkdependency from npm.Update the application project's
environment.tsandenvironment.prod.tsfiles to include theimpartnerEndpointUrlproperty.- In
environment.ts, set this property value to"/api", or some other unique path segment that will be used in the same project's local-serve proxy configuration to proxy requests to the Impartner PRM. - In
environment.prod.ts, set this property value to an empty string, as it will not be used in production builds.
- In
Import
ImpartnerSdkModuleto the application's root NgModule using theImpartnerSdkModule.forRoot(...)static function, passing the project'senvironmentconstant as the only argument.import { ImpartnerSdkModule } from '@impartner/angular-sdk'; @NgModule({ ... imports: [ ... ImpartnerSdkModule.forRoot(environment), ... ], ... }) export class AppModule { ... }
Available Services
This package provides several discrete services to enable integration with Impartner's front-end client applications, and does so through normal Angular dependency injection.
- ImpartnerConfigService
- ImpartnerEventBusService
- MetadataService
- ObjectService
- ImpartnerMetadataService
- ImpartnerObjectService
- ImpartnerUserService
- IImpartnerHttpClient
- IImpartnerRouter
- IImpartnerLogger
- OrchestrationStudioService
- VendorSystemContext
- PrmServicesScopedDirective
- VendorServicesScopedDirective
- CrmEnvironmentService
- CrmMetadataService
- CrmObjectService
ImpartnerConfigService
| Service Type | DI Token | Provided In |
| ------------------------ | ------------------------ | ----------- |
| ImpartnerConfigService | ImpartnerConfigService | root |
A simple service for synchronously fetching current configuration and context information that may be pertinent to client widget or micro front-end.
Methods
| Name | |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| getConfig | getConfig() => IImpartnerConfigReturns current configuration and context for the client application, including rendered locale, available locales, available features, tenant ID, and the program-default IANA time zone id under timeZoneId. In rare cases where the program's time zone has no IANA equivalent, falls back to the browser's time zone. |
ImpartnerEventBusService
| Service Type | DI Token | Provided In |
| -------------------------- | -------------------------- | ----------- |
| ImpartnerEventBusService | ImpartnerEventBusService | root |
A service for emitting and listening to events available to the Impartner client application and any other widgets or micro front-ends in scope.
Methods
| Name | |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| emit | emit<T>(eventName: string, event: T) => voidSynchronously emits a new bus event for eventName with the provided payload event of generic type T. |
| event$ | event$<T>(eventName: string) => Observable<T>Returns a hot Observable for bus events with name eventName. |
MetadataService
| Service Type | DI Token | Provided In |
| ----------------- | ----------------- | ----------- |
| MetadataService | MetadataService | root |
An abstract base service for fetching vendor system metadata about objects and/or fields, where the shape of the metadata is PRM-like. The default provider is to use the existing ImpartnerMetadataService. Use the [prmServicesScoped] directive on a component to explicitly set the MetadataService provider to be ImpartnerMetadataService and the *vendorServicesScoped structural directive to explicitly set the MetadataService provider to be CrmMetadataService.
Methods
| Name | |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| describeAllObjects | describeAllObjects(profile?: DescribeProfile, context?: DescribeContextTypes, vendorSystem?: IVendorSystem) => Observable<IPrmObjectDefinition[]> Asynchronously fetches object metadata for all objects visible to the user type specified by profile, or for the current user if unspecified. The context parameter determines how much information is provided, All and Sync options return basic information (eg. display name, API name, CRUD capabilities), Extended returns in-depth object metadata in the form of the ExtendedObjectProperties interface. The vendorSystem parameter is used to identify the desired vendor system type and environment id. |
| describeObject | describeObject(objectName: string, profile?: DescribeProfile, vendorSystem?: IVendorSystem) => Observable<IPrmObjectDefinition \| null> Asynchronously fetches basic object metadata for object objectName for user type specified by profile, or for the current user if unspecified. Result may be null if the named object does not exist or if it is inaccessible to the user type. The vendorSystem parameter is used to identify the desired vendor system type and environment id. |
| describeFields | describeFields(objectName: string, profile?: DescribeProfile, context?: DescribeContextTypes, depth?: number, vendorSystem?: IVendorSystem) => Observable<IPrmFieldDefinition[]> Asynchronously fetches field metadata for all fields of an object ojectName for user type specified by profile, or for the current user if unspecified. The context parameter determines how much information is provided, All and Sync options return basic information, Extended returns in-depth field metadata in the form of the ExtendedFieldProperties interface. The depth parameter will recursively populate the foreignFieldDefinitions array for fields with a fieldType of fk. The vendorSystem parameter is used to identify the desired vendor system type and environment id. |
| describeField | describeField(objectName: string, fieldName: string, profile?: DescribeProfile, context?: DescribeContextTypes, depth?: number, vendorSystem?: IVendorSystem) => Observable<IPrmFieldDefinition \| null> Asynchronously fetches field metadata for named field fieldName of an object objectName for user type specified by profile, or for the current user if unspecified. The context parameter determines how much information is provided, All and Sync options return basic information, Extended returns in-depth field metadata in the form of the ExtendedFieldProperties interface. The depth parameter will recursively populate the foreignFieldDefinitions array for fields with a fieldType of fk. The vendorSystem parameter is used to identify the desired vendor system type and environment id. |
| describeFilterEvaluators | describeFilterEvaluators() => Observable<IFilterCriteriaTypeDefinitions> Asynchronously fetches the collection of different an object field data types and the filter operator types available for them. |
| clearCache | Clears the private field and evaluator caches stored in this singleton service so that the service requests the latest object, field or evaluator data from the server on the next request. |
ObjectService
| Service Type | DI Token | Provided In |
| --------------- | --------------- | ----------- |
| ObjectService | ObjectService | root |
An abstract base service for performing CRUD operations with vendor system object records. The default provider is to use the existing ImpartnerObjectService. Use the [prmServicesScoped] directive on a component to explicitly set the ObjectService provider to be ImpartnerObjectService and the *vendorServicesScoped structural directive to explicitly set the ObjectService provider to be CrmObjectService.
Methods
| Name | |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| get | get<T>(objectName: string, id: number \| string, fields?: string[], requestOptions?: ObjectServiceRequestOptions) => Observable<IPrmApiResult<T>> Asynchronously retrieves a record with the provided id of the specified object type objectName, including any fields named in the fields array. Providing a requestOptions value allows for specifying any IHttpClientOptions or a IVendorSystem. |
| getMany | getMany<T>(objectName: string, options?: ISearchOptions, requestOptions?: ObjectServiceRequestOptions) => Observable<IPrmApiResult<IEntitySearchResult<T>>> Asynchronously retrieves many records of the specified object type objectName. Providing an options value allows for specifying additional aspects of the request, including returned record fields, filter criteria, sort order, and skip/take values for pagination. Providing a requestOptions value allows for specifying any IHttpClientOptions or a IVendorSystem. |
| getManyByCriteria | getManyByCriteria<T>(objectName: string, options: ICriteriaSearchOptions, requestOptions?: ObjectServiceRequestOptions) => Observable<IPrmApiResult<IEntitySearchResult<T>>> Asynchronously retrieves many records of the specified object type objectName. Providing an options value allows for specifying additional aspects of the request, including returned record fields, filter criteria, sort order, and skip/take values for pagination. While similar in nature to getMany, the expanded typing of the options argument allows for alternative filtering logic and behavior, including integration with custom logic. Providing a requestOptions value allows for specifying any IHttpClientOptions or a IVendorSystem. |
| update | update<TBody, TResult extends TBody = TBody>(objectName: string, id: number \| string, body: TBody, returnFields?: (string \| keyof TResult)[], requestOptions?: ObjectServiceRequestOptions) => Observable<IPrmApiResult<TResult> Asynchronously updates a single record with the provided id of the specified object type objectName, updating its fields according to the provided values in body. The returned results will include the same fields as those present on body, as well as any additional fields specified by the returnFields array. Providing a requestOptions value allows for specifying any IHttpClientOptions or a IVendorSystem. |
| updateMany | updateMany<TResult = unknown>(objectName: string, body: unknown[], returnFields?: (string \| keyof TResult)[], requestOptions?: ObjectServiceRequestOptions) => Observable<IPrmPatchManyResult<TResult>> Asynchronously updates multiple records of the specified object type objectName, updating their fields according to the partial record values in body. Every record in body must have an id property present. The returned results will include the same fields as those present on their records in body, as well as any additional fields specified by the fields array. Providing a requestOptions value allows for specifying any IHttpClientOptions or a IVendorSystem. |
| delete | delete(objectName: string, id: number \| string, requestOptions?: ObjectServiceRequestOptions) => Observable<IPrmApiResult<{ id: number \| string }>> Asynchronously deletes a record with the provided id of the specified object type objectName. The result will be a plain object with the ID of the deleted record. Providing a requestOptions value allows for specifying any IHttpClientOptions or a IVendorSystem. |
| export | export(objectName: string, criteria: IExportOptions, requestOptions?: ObjectServiceRequestOptions) => Observable<ExportResult> Asynchronously retrieves a file export of records of the specified object type objectName according to the file type, headers, filter criteria, and sort order in criteria. Result is an ExportResult instance that can trigger file download in the browser by invoking the ExportResult's startDownload() method. Providing a requestOptions value allows for specifying any IHttpClientOptions or a IVendorSystem. |
ImpartnerMetadataService
| Service Type | DI Token | Provided In |
| -------------------------- | --------------------------------------------------- | ----------- |
| ImpartnerMetadataService | ImpartnerMetadataService | root |
| -------------------------- | --------------------------------------------------- | ----------- |
| ImpartnerMetadataService | MetadataService | root |
A service for fetching metadata about Impartner PRM objects and/or their fields from the host. The default implementation of MetadataService is to use the existing ImpartnerMetadataService Use the [prmServicesScoped] directive on a component or parent element to explicitly set the MetadataService provider to be ImpartnerMetadataService.
Methods
| Name | |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| describeAllObjects | describeAllObjects(profile?: DescribeProfile, context?: DescribeContextTypes, vendorSystem?: IVendorSystem) => Observable<IPrmObjectDefinition[]> Asynchronously fetches object metadata for all Impartner PRM objects visible to the user type specified by profile, or for the current user if unspecified. The context parameter determines how much information is provided, All and Sync options return basic information (eg. display name, API name, CRUD capabilities), Extended returns in-depth object metadata in the form of the ExtendedObjectProperties interface. The optional vendorSystem parameter will be ignored because the class is for PRM and the current PRM environment. |
| describeObject | describeObject(prmObjectName: string, profile?: DescribeProfile, vendorSystem?: IVendorSystem) => Observable<IPrmObjectDefinition \| null> Asynchronously fetches basic object metadata for Impartner PRM object prmObjectName for user type specified by profile, or for the current user if unspecified. Result may be null if the named Impartner PRM object does not exist or if it is inaccessible to the user type. The optional vendorSystem parameter will be ignored because the class is for PRM and the current PRM environment. |
| describeFields | describeFields(prmObjectName: string, profile?: DescribeProfile, context?: DescribeContextTypes, depth?: number, vendorSystem?: IVendorSystem) => Observable<IPrmFieldDefinition[]> Asynchronously fetches field metadata for all fields of Impartner PRM object prmObjectName for user type specified by profile, or for the current user if unspecified. The context parameter determines how much information is provided, All and Sync options return basic information, Extended returns in-depth field metadata in the form of the ExtendedFieldProperties interface. The depth parameter will recursively populate the foreignFieldDefinitions array for fields with a fieldType of fk. The optional vendorSystem parameter will be ignored because the class is for PRM and the current PRM environment. |
| describeField | describeField(prmObjectName: string, fieldName: string, profile?: DescribeProfile, context?: DescribeContextTypes, depth?: number, vendorSystem?: IVendorSystem) => Observable<IPrmFieldDefinition \| null> Asynchronously fetches field metadata for named field fieldName of Impartner PRM object prmObjectName for user type specified by profile, or for the current user if unspecified. The context parameter determines how much information is provided, All and Sync options return basic information, Extended returns in-depth field metadata in the form of the ExtendedFieldProperties interface. The depth parameter will recursively populate the foreignFieldDefinitions array for fields with a fieldType of fk. The optional vendorSystem parameter will be ignored because the class is for PRM and the current PRM environment. |
| describeFilterEvaluators | describeFilterEvaluators() => Observable<IFilterCriteriaTypeDefinitions> Asynchronously fetches the collection of different Impartner PRM object field data types and the filter operator types available for them. |
| clearCache | Clears the private field and evaluator caches stored in this singleton service so that the service requests the latest object, field or evaluator data from the server on the next request. |
ImpartnerObjectService
| Service type | DI Token | Provided In |
| ------------------------ | ------------------------------------------------ | ----------- |
| ImpartnerObjectService | ImpartnerObjectService | root |
| ------------------------ | ------------------------------------------------ | ----------- |
| ImpartnerObjectService | ObjectService | root |
A service for performing CRUD operations with Impartner PRM object records. The default implementation of ObjectService is to use the existing ImpartnerObjectService. Use the [prmServicesScoped] directive on a component or parent element to explicitly set the ObjectService provider to be ImpartnerObjectService.
Methods
| Name | |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| get | get<T>(objectName: string, id: number \| string, fields?: string[]) => Observable<IPrmApiResult<T>> Asynchronously retrieves a record with the provided id of the specified Impartner PRM object type objectName, including any fields named in the fields array. |
| getMany | getMany<T>(objectName: string, options?: ISearchOptions) => Observable<IPrmApiResult<IEntitySearchResult<T>>> Asynchronously retrieves many records of the specified Impartner PRM object type objectName. Providing an options value allows for specifying additional aspects of the request, including returned record fields, filter criteria, sort order, and skip/take values for pagination. |
| getManyByCriteria | getManyByCriteria<T>(objectName: string, options: ICriteriaSearchOptions) => Observable<IPrmApiResult<IEntitySearchResult<T>>> Asynchronously retrieves many records of the specified Impartner PRM object type objectName. Providing an options value allows for specifying additional aspects of the request, including returned record fields, filter criteria, sort order, and skip/take values for pagination. While similar in nature to getMany, the expanded typing of the options argument allows for alternative filtering logic and behavior, including integration with custom logic. |
| create | create<T>(objectName: string, body: Partial<T>) => Observable<IPrmApiResult<T>> Asynchronously creates a single new record of the specified Impartner PRM object type objectName, setting its field values according to the provided payload in body. The returned result will be the created record, including populated auto-ID fields. |
| createMany | createMany<T>(objectName: string, body: Partial<T>[]) => Observable<IPrmBulkApiResult<T>> Asynchronously creates one or more new records of the specified Impartner PRM object type objectName, setting their field values according to the provided elements for body. The returned result will contain an array of the created records, including populated auto-ID fields. |
| update | update<TBody, TResult extends TBody = TBody>(objectName: string, id: number \| string, body: TBody, returnFields?: (string \| keyof TResult)[]) => Observable<IPrmApiResult<TResult>> Asynchronously updates a single record with the provided id of the specified Impartner PRM object type objectName, updating its fields according to the provided values in body. The returned results will include the same fields as those present on body, as well as any additional fields specified by the fields array. |
| updateMany | updateMany<TResult = unknown>(objectName: string, body: unknown[], returnFields?: (string \| keyof TResult)[]) => Observable<IPrmBulkApiResult<TResult>> Asynchronously updates multiple records of the specified Impartner PRM object type objectName, updating their fields according to the partial record values in body. Every record in body must have an id property present. The returned results will include the same fields as those present on their records in body, as well as any additional fields specified by the fields array. |
| delete | delete(objectName: string, id: number \| string) => Observable<IPrmApiResult<{ id: number \| string }>> Asynchronously deletes a record with the provided id of the specified Impartner PRM object type objectName. The result will be a plain object with the ID of the deleted record. |
| deleteMany | deleteMany(objectName: string, ids: (number \| string)[]) => Observable<IPrmBulkApiResult<{ id: number \| string }[]> Asynchronously deletes one or more records for the provided ids array values of the specified Impartner PRM object type objectName. The result will be an array of plain objects with the IDs of the deleted records. |
| export | export(objectName: string, criteria: IExportOptions) => Observable<ExportResult> Asynchronously retrieves a file export of records of the specified Impartner PRM object type objectName according to the file type, headers, filter criteria, and sort order in criteria. Result is an ExportResult instance that can trigger file download in the browser by invoking the ExportResult's startDownload() method. |
ImpartnerUserService
| Service Type | DI Token | Provided In |
| ---------------------- | ---------------------- | ----------- |
| ImpartnerUserService | ImpartnerUserService | root |
A service for accessing basic information about the current user.
Methods
| Name | |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| getUser | getUser() => IProfile Retrieves the current user's profile, including (but not limited to) id, user type, name, and email address. |
| getUserSegments | getUserSegments() => Observable<IUserSegmentationValues> Asynchronously retrieves segmentation information about the current user. |
| getTimeZoneId | getTimeZoneId() => string Returns the current user's IANA time zone id (e.g. "America/Denver"), falling back to the program default when no user is signed in. In rare cases where the program's time zone has no IANA equivalent, falls back to the browser's time zone. |
Note: PRM stores Date/DateTime values as UTC. On write, the API treats incoming values as being in the current user's PRM time zone and converts them to UTC; on read, it returns them back in that same zone. If the browser's time zone differs from
getTimeZoneId(), reconcile the wall-clock value before display or submission.
IImpartnerHttpClient
| Service Type | DI Token | Provided In |
| ---------------------- | ----------------------------- | --------------------------------- |
| IImpartnerHttpClient | IMPARTNER_HTTP_CLIENT_TOKEN | ImpartnerSdkModule.forRoot(...) |
A service for making HTTP calls to the Impartner PRM host. This service ensures that any additional required information (eg. HTTP headers) are present for calls to Impartner. This service should always be used when attempting to make HTTP-based API calls to the Impartner host.
Methods
| Name | |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| get | get<T, U extends IApiResultBase = IApiResult<T>>(url: string, options?: IHttpClientOptions) => Promise<U> Asynchronously makes an HTTP GET call to the Impartner PRM resource path specified by url. |
| post | post<T, U extends IApiResultBase = IApiResult<T>>(url: string, body: unknown, options?: IHttpClientOptions) => Promise<U> Asynchronously makes an HTTP POST call to the Impartner PRM resource path specified by url, with the body value as its payload. |
| put | put<T, U extends IApiResultBase = IApiResult<T>>(url: string, body: unknown, options?: IHttpClientOptions) => Promise<U> Asynchronously makes an HTTP PUT call to the Impartner PRM resource path specified by url, with the body value as its payload. |
| patch | patch<T, U extends IApiResultBase = IApiResult<T>>(url: string, body: unknown, options?: IHttpClientOptions) => Promise<U> Asynchronously makes an HTTP PATCH call to the Impartner PRM resource path specified by url, with the body value as its payload. |
| delete | delete<T, U extends IApiResultBase = IApiResult<T>>(url: string, body: unknown, options?: IHttpClientOptions) => Promise<U> Asynchronously makes an HTTP DELETE call to the Impartner PRM resource path specified by url. |
IImpartnerRouter
| Service Type | DI Token | Provided In |
| ------------------ | ------------------------ | --------------------------------- |
| IImpartnerRouter | IMPARTNER_ROUTER_TOKEN | ImpartnerSdkModule.forRoot(...) |
A service for accessing and modifying navigation state within the host Impartner front-end application.
Methods
| Name | |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| navigate | navigate(path: string, navigationParams?: INavigationParams, navigationOptions?: INavigationOptions) => Promise<void> Triggers navigation to the specified path within the Impartner client application. |
| getState | getState() => IRouterState Returns current route state within the Impartner client application, including page title, path, and present query string parameters. |
| getContentPageMetadata | getContentPageMetadata() => Promise<IContentPageMetadata[]> Asynchronously retrieves a list of available page routes for navigation. Only applicable within Impartner Portal host applications. |
| getCurrentPageMetadata | getCurrentPageMetadata() => Promise<IContentPageMetadata \| undefined> Asynchronously returns the metadata for the currently loaded portal content page. Only applicable within Impartner Portal host applications. |
IImpartnerLogger
| Service Type | DI Token | Provided In |
| ------------------ | ------------------------ | --------------------------------- |
| IImpartnerLogger | IMPARTNER_LOGGER_TOKEN | ImpartnerSdkModule.forRoot(...) |
A service for simple logging behavior.
Methods
All below methods accept one message argument and an open-ended number of additional objects to be logged - the only difference between them is the message severity, which is denoted by the method name itself.
| Name | |
| ------- | -------------------------------------------------------- |
| trace | trace(message: string, ...argument: unknown[]) => void |
| info | info(message: string, ...argument: unknown[]) => void |
| log | log(message: string, ...argument: unknown[]) => void |
| debug | debug(message: string, ...argument: unknown[]) => void |
| warn | warn(message: string, ...argument: unknown[]) => void |
| error | error(message: string, ...argument: unknown[]) => void |
OrchestrationStudioService
| Service Type | DI Token | Provided In |
| ---------------------------- | ---------------------------- | ----------- |
| OrchestrationStudioService | OrchestrationStudioService | root |
A service for interfacing with Impartner's Orchestration Studio product: getting available flow extension endpoints and making HTTP requests to those flow extension endpoints.
Methods
| Name | |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| getExtensionEndpoints | getExtensionEndpoints() => Observable<Record<string, IExtensionEndpoint>> Returns a dictionary of IExtensionEndpoints by flow API name for the connected PRM environment / tenant. |
| getExtensionEndpoint | getExtensionEndpoint(flowApiName: string): Observable<IExtensionEndpoint \| null> Returns a given flow API name's IExtensionEndpoint (or null). |
| sendGetToExtensionEndpoint | sendGetToExtensionEndpoint<T>(flowApiName: string, params?: IHttpClientOptions): Observable<IApiResult<T>> Sends an HTTP GET request to the flow's extension endpoint by flow API name, optionally including additional IHttpClientOptions. Returns IApiResult<T>, where T is the flow's HTTP response body shape. |
| sendPostToExtensionEndpoint | sendPostToExtensionEndpoint<T, U>(flowApiName: string, body: U, params?: IHttpClientOptions): Observable<IApiResult<T>> Sends an HTTP POST request to the flow's extension endpoint by flow API name, including a POST body (U) and optionally including additional IHttpClientOptions. Returns IApiResult<T>, where T is the flow's HTTP response body shape. |
| sendPutToExtensionEndpoint | sendPutToExtensionEndpoint<T, U>(flowApiName: string, body: U, params?: IHttpClientOptions): Observable<IApiResult<T>> Sends an HTTP PUT request to the flow's extension endpoint by flow API name, including a PUT body (U) and optionally including additional IHttpClientOptions. Returns IApiResult<T>, where T is the flow's HTTP response body shape. |
| getPrmEndpointForExtensionEndpoint | getPrmEndpointForExtensionEndpoint(extensionEndpoint: IExtensionEndpoint): string Gets the relative PRM API endpoint URL used to send HTTP GET and POST requests for an extension endpoint. |
| sendAppEvent | sendAppEvent(eventType: string, payload: unknown): Observable<IAppEventResponse> Dispatches an event of type eventType with value payload that will trigger any active flows using the OnAppEvent component configured to listen for the specified event type. Returns an IAppEventResponse, indicating which matching flows were triggered and/or failed to dispatch. |
VendorSystemContext
| Service Type | DI Token | Provided In |
| --------------------- | --------------------- | ----------- |
| VendorSystemContext | VendorSystemContext | root |
An injectable service for accessing information about the current Impartner PRM or vendor CRM service in context for the current Injector - this context is used within the same injector to resolve implementations for the ObjectService and MetadataService service tokens. The default value is an object with property values { type: 'PRM' }, and can be changed within a component hierarchy using either the [prmServicesScoped] directive to assert ImpartnerObjectService and ImpartnerMetadataService service implementations or with the *vendorServicesScoped structural directive to assert CrmObjectService and CrmMetadataService service implementations for the specified vendor type and ID.
Properties
| Name | |
| ------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| type | vendorSystemType ('PRM' \| 'Salesforce' \| 'Dynamics' \| 'Hubspot' \| 'Harmony') The type of vendor system in scope. |
| id | number The numerical identifier for the specific vendor CRM integration as configured in Impartner. Not applicable when type is 'PRM'. |
PrmServicesScopedDirective
Selector: [prmServicesScoped]
Usage:
<ng-container prmServicesScoped>
<!-- Content -->
</ng-container>A simple directive that sets hierarchical providers for the VendorSystemContext, ObjectService, and MetadataService DI tokens for the decorated element and its children to resolve to implementations tailored specifically for Impartner PRM. The directive has no inputs or outputs, and may be used to decorate any element type.
VendorServicesScopedDirective
Selector: *vendorServicesScoped
Usage:
<ng-container *vendorServicesScoped="'Salesforce'; id: 1234">
<!-- Content -->
</ng-container>A structural directive that sets hierarchical providers for the VendorSystemContext, ObjectService, and MetadataService DI tokens for the decorated element and its children to resolve to implementations configured for the specified vendor PRM/CRM type and ID. Usage of the directive must include a vendorSystemType ('PRM' | 'Salesforce' | 'Dynamics' | 'Hubspot' | 'Harmony') value as an implicit input, and an id value for any vendorSystemType that is not 'PRM'.
Due to the directive's structural nature, it bears reminding that changes to either of the bound inputs will trigger a full re-render of the contents within decorated element.
CrmEnvironmentService
| Service Type | DI Token | Provided In |
| ----------------------- | ----------------------- | ----------- |
| CrmEnvironmentService | CrmEnvironmentService | root |
A service for fetching the CRM environments registered in a PRM program for the active integrated CRM.
Methods
| Name | |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| getCrmEnvironments | getCrmEnvironments() => Observable<ICrmEnvironment[]> Gets all CRM environment registered in a PRM program for the active integrated CRM. |
| getDefaultOrFirstCrmEnvironment | getDefaultOrFirstCrmEnvironment() => Observable<ICrmEnvironment \| undefined> Gets the default CRM environment for the current PRM program and PRM environment (DEV, STAGE or PROD). |
| getCrmEnvironmentEndpointBase | getCrmEnvironmentEndpointBase(vendorSystem?: IVendorSystem) => Observable<string> Get the base API endpoint for the CRM environment for metadata describes and CRUD operations depending on the vendorSystem, or falling back to the default CRM environment. |
CrmMetadataService
| Service Type | DI Token | Provided In |
| -------------------- | --------------------------------------------- | ----------- |
| CrmMetadataService | CrmMetadataService | root |
| -------------------- | --------------------------------------------- | ----------- |
| CrmMetadataService | MetadataService | |
A service for fetching CRM metadata about objects and/or fields, where the shape of the metadata is PRM-like. vendorSystemType values currently supported include 'Salesforce', 'Dynamics', 'Hubspot', and 'Harmony' for administrator profile types and 'Salesforce' for a partner user profile type. Use the *vendorServicesScoped structural directive on a component or parent element to explicitly set the MetadataService provider to be a CrmMetadataService instance configured for a target CRM.
Methods
| Name | |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| describeAllObjects | describeAllObjects(profile?: DescribeProfile, context?: DescribeContextTypes, vendorSystem?: IVendorSystem) => Observable<IPrmObjectDefinition[]> Asynchronously fetches object metadata for all objects visible to the user type specified by profile, or for the current user if unspecified. The context parameter determines how much information is provided, All and Sync options return basic information (eg. display name, API name, CRUD capabilities), Extended returns in-depth object metadata in the form of the ExtendedObjectProperties interface. The vendorSystem parameter is used to identify the desired vendor system type and environment id. If not set, will connect to the default CRM environment. |
| describeObject | describeObject(objectName: string, profile?: DescribeProfile, vendorSystem?: IVendorSystem) => Observable<IPrmObjectDefinition \| null> Asynchronously fetches basic object metadata for object objectName for user type specified by profile, or for the current user if unspecified. Result may be null if the named object does not exist or if it is inaccessible to the user type. The vendorSystem parameter is used to identify the desired vendor system type and environment id. If not set, will connect to the default CRM environment. |
| describeFields | describeFields(objectName: string, profile?: DescribeProfile, context?: DescribeContextTypes, depth?: number, vendorSystem?: IVendorSystem) => Observable<IPrmFieldDefinition[]> Asynchronously fetches field metadata for all fields of an object ojectName for user type specified by profile, or for the current user if unspecified. The context parameter determines how much information is provided, All and Sync options return basic information, Extended returns in-depth field metadata in the form of the ExtendedFieldProperties interface. The depth parameter will recursively populate the foreignFieldDefinitions array for fields with a fieldType of fk. The vendorSystem parameter is used to identify the desired vendor system type and environment id. If not set, will connect to the default CRM environment. |
| describeField | describeField(objectName: string, fieldName: string, profile?: DescribeProfile, context?: DescribeContextTypes, depth?: number, vendorSystem?: IVendorSystem) => Observable<IPrmFieldDefinition \| null> Asynchronously fetches field metadata for named field fieldName of an object objectName for user type specified by profile, or for the current user if unspecified. The context parameter determines how much information is provided, All and Sync options return basic information, Extended returns in-depth field metadata in the form of the ExtendedFieldProperties interface. The depth parameter will recursively populate the foreignFieldDefinitions array for fields with a fieldType of fk. The vendorSystem parameter is used to identify the desired vendor system type and environment id. If not set, will connect to the default CRM environment. |
| describeFilterEvaluators | describeFilterEvaluators() => Observable<IFilterCriteriaTypeDefinitions> Asynchronously fetches the collection of different an object field data types and the filter operator types available for them. |
| clearCache | Clears the private field and evaluator caches stored in this singleton service so that the service requests the latest object, field or evaluator data from the server on the next request. |
CrmObjectService
| Service Type | DI Token | Provided In |
| ------------------ | ------------------------------------------ | ----------- |
| CrmObjectService | CrmObjectService | root |
| ------------------ | ------------------------------------------ | ----------- |
| CrmObjectService | ObjectService | |
A service for performing CRUD operations with vendor system object records. vendorSystemType values currently supported include Salesforce, Dynamics and Harmony for administrator profile types and Salesforce for a partner user profile type. Use the *vendorServicesScoped structural directive on a component or parent element to explicitly set the MetadataService provider to be CrmMetadataService.
Methods
| Name | |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| get | get<T>(objectName: string, id: number \| string, fields?: string[], requestOptions?: ObjectServiceRequestOptions) => Observable<IPrmApiResult<T>> Asynchronously retrieves a record with the provided id of the specified object type objectName, including any fields named in the fields array. Providing a requestOptions value allows for specifying any IHttpClientOptions or a IVendorSystem. |
| getMany | `getMany(objectName: string, options?: ISearchOptio
