@creatio-devkit/common 0.822.0 → 0.830.0

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/esm2022/lib/base-exports.mjs +1 -1
  3. package/esm2022/lib/internal/models/data-source-load-parameters.mjs +2 -0
  4. package/esm2022/lib/internal/models/index.mjs +4 -1
  5. package/esm2022/lib/internal/models/interface-designer-item/toolbar-view-element-config.mjs +1 -1
  6. package/esm2022/lib/internal/models/lazy-registry-item.mjs +1 -1
  7. package/esm2022/lib/internal/models/transaction/index.mjs +3 -0
  8. package/esm2022/lib/internal/models/transaction/transaction-operation.mjs +2 -0
  9. package/esm2022/lib/internal/models/transaction/transaction.mjs +2 -0
  10. package/esm2022/lib/internal/services/request-handler-registry/request-handler-registry.service.mjs +24 -1
  11. package/esm2022/lib/public/enums/index.mjs +2 -1
  12. package/esm2022/lib/public/enums/process-status.enum.mjs +28 -0
  13. package/esm2022/lib/public/functions/bootstrap-crt-module.mjs +46 -9
  14. package/esm2022/lib/public/models/ai-context/ai-context-part.mjs +2 -0
  15. package/esm2022/lib/public/models/ai-context/index.mjs +2 -0
  16. package/esm2022/lib/public/models/index.mjs +3 -1
  17. package/esm2022/lib/public/models/process-engine/index.mjs +4 -0
  18. package/esm2022/lib/public/models/process-engine/process-parameter-value.model.mjs +2 -0
  19. package/esm2022/lib/public/models/process-engine/run-process-request.model.mjs +12 -0
  20. package/esm2022/lib/public/models/process-engine/run-process-response.model.mjs +2 -0
  21. package/esm2022/lib/public/services/ai-context/ai-context.service.mjs +86 -0
  22. package/esm2022/lib/public/services/ai-context/index.mjs +2 -0
  23. package/esm2022/lib/public/services/index.mjs +3 -1
  24. package/esm2022/lib/public/services/process-engine/index.mjs +2 -0
  25. package/esm2022/lib/public/services/process-engine/process-engine.service.mjs +27 -0
  26. package/esm2022/lib/public/services/sys-values/sys-values.mjs +1 -1
  27. package/fesm2022/creatio-devkit-common.mjs +219 -9
  28. package/fesm2022/creatio-devkit-common.mjs.map +1 -1
  29. package/index.d.ts +260 -0
  30. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -47,6 +47,7 @@ import { ɵDataSchemaAttributeFunctionConfig as DataSchemaAttributeFunctionConfi
47
47
  import { ɵDataSchemaAttributeType as DataSchemaAttributeType } from '@creatio/base';
48
48
  import { ɵDataSchemaAttributeUsageType as DataSchemaAttributeUsageType } from '@creatio/base';
49
49
  import { ɵDataSchemaAttributeValidatorConfig as DataSchemaAttributeValidatorConfig } from '@creatio/base';
50
+ import { ɵDataSchemaAttributeValueMaskingSettings as DataSchemaAttributeValueMaskingSettings } from '@creatio/base';
50
51
  import { ɵDataSchemaType as DataSchemaType } from '@creatio/base';
51
52
  import { ɵDataSchemaValidatorConfig as DataSchemaValidatorConfig } from '@creatio/base';
52
53
  import { ɵDataSourceAggregationConfig as DataSourceAggregationConfig } from '@creatio/base';
@@ -185,6 +186,58 @@ export { AggregationSubQueryExpressionConfig }
185
186
 
186
187
  export { AggregationType }
187
188
 
189
+ /**
190
+ * Service for managing AI context parts and providing a unified context.
191
+ * This service allows adding, retrieving, and removing context parts, which can be
192
+ * either static values, promises, or dynamically provided through a function.
193
+ */
194
+ export declare class AiContextService {
195
+ private _contextParts;
196
+ private static _instance;
197
+ /**
198
+ * Retrieves the singleton instance of the `AiContextService`.
199
+ * If the instance does not exist, it will be created.
200
+ */
201
+ static get instance(): AiContextService;
202
+ /**
203
+ * Generates a unique identifier for a context part.
204
+ * @returns A string representing a unique identifier.
205
+ */
206
+ private _generateId;
207
+ /**
208
+ * @public
209
+ * Adds a new context part to the service.
210
+ * The context part can be a static value, a promise, or a function that provides the value.
211
+ *
212
+ * @param value - The context part to add. It can be one of the following:
213
+ * - `ContextProvider` (a function that provides the context part)
214
+ * @param id - (Optional) A unique identifier for the context part. If not provided, a new ID will be generated.
215
+ * @returns The unique identifier of the added context part.
216
+ */
217
+ setContextPart(value: ContextProvider, id?: string): string;
218
+ /**
219
+ * @public
220
+ * Retrieves all context parts as an array of resolved values.
221
+ * If the context parts include promises or functions, they will be resolved.
222
+ *
223
+ * @returns A promise that resolves to an array of context parts, which can be
224
+ * either `CreatioPageContextPart` or `ConstantValuesContextPart`.
225
+ */
226
+ getContext(): Promise<(CreatioPageContextPart | ConstantValuesContextPart)[]>;
227
+ /**
228
+ * @public
229
+ * Removes a specific context part by its unique identifier.
230
+ *
231
+ * @param id - The unique identifier of the context part to remove.
232
+ */
233
+ removeContextPart(id: string): void;
234
+ /**
235
+ * @public
236
+ * Removes all context parts from the service.
237
+ */
238
+ removeContext(): void;
239
+ }
240
+
188
241
  /* Excluded from this release type: AngularViewElementRegistrationConfig */
189
242
 
190
243
  /* Excluded from this release type: applyLocalizeMetadataFn */
@@ -207,6 +260,14 @@ export { ArithmeticQueryColumn }
207
260
  /* Excluded from this release type: AttributePropertyConfig */
208
261
 
209
262
  /* Excluded from this release type: AttributeValueConfig */
263
+
264
+ /**
265
+ * @public
266
+ */
267
+ export declare interface BaseContextPart {
268
+ type?: string;
269
+ }
270
+
210
271
  export { BaseDataSourceParameter }
211
272
 
212
273
  export { BaseDialogButtonConfig }
@@ -444,6 +505,7 @@ export declare interface BootstrapOptions {
444
505
  */
445
506
  resolveDependency?: ResolveDependencyFn;
446
507
  /* Excluded from this release type: moduleType */
508
+ /* Excluded from this release type: featureValues */
447
509
  /* Excluded from this release type: onContextCreate */
448
510
  /* Excluded from this release type: onContextUpdate */
449
511
  /* Excluded from this release type: onContextDestroy */
@@ -509,8 +571,56 @@ export { ComparisonType }
509
571
 
510
572
  export { ConditionalValueItem }
511
573
 
574
+ /**
575
+ * @public
576
+ */
577
+ export declare interface ConstantValuesContextPart extends BaseContextPart {
578
+ type: 'ConstantValuesContextPart';
579
+ values: Record<string, unknown>;
580
+ }
581
+
512
582
  /* Excluded from this release type: ContexedHandlerScopeConfig */
513
583
 
584
+ /**
585
+ * @public
586
+ */
587
+ export declare interface ContextDataRecord {
588
+ id: string;
589
+ displayColumnValue: string;
590
+ }
591
+
592
+ /**
593
+ * @public
594
+ */
595
+ export declare interface ContextDataSourcePart {
596
+ entitySchemaName: string;
597
+ displayColumnName: string;
598
+ isCollection: boolean;
599
+ isPrimary: boolean;
600
+ records: Array<ContextDataRecord>;
601
+ }
602
+
603
+ /**
604
+ * @public
605
+ */
606
+ export declare type ContextPartAction = 'set' | 'update' | 'remove';
607
+
608
+ /**
609
+ * @public
610
+ * @classdesc Request handler for managing context parts in the AI context service.
611
+ * This handler processes requests to add, remove, or retrieve context parts.
612
+ */
613
+ export declare class ContextPartRequest extends BaseRequest {
614
+ id: string;
615
+ contextPartProvider: ContextProvider;
616
+ action: ContextPartAction;
617
+ }
618
+
619
+ /**
620
+ * @public
621
+ */
622
+ export declare type ContextProvider = () => CreatioPageContextPart | Promise<CreatioPageContextPart> | ConstantValuesContextPart | Promise<ConstantValuesContextPart>;
623
+
514
624
  /**
515
625
  * @public
516
626
  * @description Shape to implementing Converter.
@@ -546,6 +656,15 @@ export declare interface ConverterConfig {
546
656
 
547
657
  /* Excluded from this release type: ConverterRegistryItem */
548
658
 
659
+ /**
660
+ * @public
661
+ */
662
+ export declare interface CreatioPageContextPart extends BaseContextPart {
663
+ type?: 'CreatioPageContextPart';
664
+ pageSchemaName: string;
665
+ dataSources: Array<ContextDataSourcePart>;
666
+ }
667
+
549
668
  /* Excluded from this release type: CrtAngularViewElementConfig */
550
669
 
551
670
  /**
@@ -903,6 +1022,8 @@ export { DataSchemaAttributeUsageType }
903
1022
 
904
1023
  export { DataSchemaAttributeValidatorConfig }
905
1024
 
1025
+ export { DataSchemaAttributeValueMaskingSettings }
1026
+
906
1027
  export { DataSchemaType }
907
1028
 
908
1029
  export { DataSchemaValidatorConfig }
@@ -941,6 +1062,8 @@ export declare interface DataSourceLoadOptions extends ɵDataSourceLoadOptions {
941
1062
  /* Excluded from this release type: isDistinct */
942
1063
  }
943
1064
 
1065
+ /* Excluded from this release type: DataSourceLoadParameters */
1066
+
944
1067
  /* Excluded from this release type: DataSourceLoadType */
945
1068
  export { DataSourcePagingConfig }
946
1069
 
@@ -979,6 +1102,7 @@ export declare interface DefaultRenderConfig {
979
1102
  renderStrategy?: ViewElementRenderStrategy.Default;
980
1103
  }
981
1104
 
1105
+ /* Excluded from this release type: DefaultSizeForGrid */
982
1106
  export { DefaultValueSchema }
983
1107
 
984
1108
  export { DefaultValueSource }
@@ -1457,6 +1581,9 @@ export declare interface ItemCreationConfig extends ɵItemCreationConfig {
1457
1581
 
1458
1582
  export { ItemNotFoundException }
1459
1583
 
1584
+ /* Excluded from this release type: ITransaction */
1585
+
1586
+ /* Excluded from this release type: ITransactionOperation */
1460
1587
  export { JsonArray }
1461
1588
 
1462
1589
  export { JsonData }
@@ -1782,6 +1909,74 @@ export declare interface PreloadSysSettingsResponse extends BaseResponse {
1782
1909
 
1783
1910
  export { PrimaryDisplayFilterDataSourceParameter }
1784
1911
 
1912
+ /**
1913
+ * @public
1914
+ * @class ProcessEngineService
1915
+ * @classdesc Service, used for starting and completing business processes using handler chain
1916
+ * @extends {BaseHandlerChainService}
1917
+ */
1918
+ export declare class ProcessEngineService extends BaseHandlerChainService {
1919
+ /* Excluded from this release type: requestType */
1920
+ /**
1921
+ * Executes process by name.
1922
+ * @param processName Process name.
1923
+ * @param parameters Process parameters.
1924
+ * @param resultParameterNames Resulting process parameters.
1925
+ */
1926
+ executeProcessByName: (processName: string, parameters?: Record<string, unknown>, resultParameterNames?: string[]) => Promise<RunProcessResponse>;
1927
+ /**
1928
+ * Completes process element execution.
1929
+ * @param {Guid} processElementUId Process element unique identifier.
1930
+ * @param {Record<string, JsonData>} parameters Process parameters.
1931
+ */
1932
+ completeExecuting: (processElementUId: Guid, parameters?: Record<string, JsonData>) => Promise<BaseResponse>;
1933
+ }
1934
+
1935
+ /**
1936
+ * @public
1937
+ * @interface
1938
+ * @description Interface representing a process parameter value.
1939
+ * @property {string} name - The name of the process parameter.
1940
+ * @property {string} value - The value of the process parameter.
1941
+ */
1942
+ export declare interface ProcessParameterValue {
1943
+ /**
1944
+ * @description The name of the process parameter.
1945
+ */
1946
+ name: string;
1947
+ /**
1948
+ * @description The value of the process parameter.
1949
+ */
1950
+ value: string;
1951
+ }
1952
+
1953
+ /**
1954
+ * @public
1955
+ * @description Enum representing the status of a process.
1956
+ */
1957
+ export declare enum ProcessStatus {
1958
+ /**
1959
+ * The process is inactive.
1960
+ */
1961
+ Inactive = 0,
1962
+ /**
1963
+ * The process is currently running.
1964
+ */
1965
+ Running = 1,
1966
+ /**
1967
+ * The process has completed successfully.
1968
+ */
1969
+ Completed = 2,
1970
+ /**
1971
+ * The process encountered an error.
1972
+ */
1973
+ Error = 3,
1974
+ /**
1975
+ * The process was cancelled.
1976
+ */
1977
+ Cancelled = 4
1978
+ }
1979
+
1785
1980
  export { QueryMacrosType }
1786
1981
 
1787
1982
  export { QueryOperationType }
@@ -1900,6 +2095,62 @@ export declare class RightsService extends BaseHandlerChainService {
1900
2095
  getCanExecuteOperations: (operationNames: string[]) => Promise<boolean[]>;
1901
2096
  }
1902
2097
 
2098
+ /**
2099
+ * @public
2100
+ * @class
2101
+ * @classdesc Class representing a request to run a process.
2102
+ * @property {Guid} schemaUId - The unique identifier of the process schema.
2103
+ * @property {string} schemaName - The name of the process schema.
2104
+ * @property {ProcessParameterValue[]} parameterValues - The values of the process parameters.
2105
+ * @property {string[]} resultParameterNames - The names of the resulting process parameters.
2106
+ */
2107
+ export declare class RunProcessRequest {
2108
+ /**
2109
+ * @description Represents process schema unique identifier to run.
2110
+ */
2111
+ schemaUId?: Guid;
2112
+ /**
2113
+ * @description Represents process schema name to run.
2114
+ */
2115
+ schemaName?: string;
2116
+ /**
2117
+ * @description Used to pass the parameters to a starting process.
2118
+ */
2119
+ parameterValues?: ProcessParameterValue[];
2120
+ /**
2121
+ * @description Used to specify the names of the result parameters to retrieve on process completion.
2122
+ */
2123
+ resultParameterNames?: string[];
2124
+ }
2125
+
2126
+ /**
2127
+ * @public
2128
+ * @interface
2129
+ * @extends {BaseResponse}
2130
+ * @description Interface representing the response from running a process.
2131
+ * @property {string} message - The message returned from the process execution.
2132
+ * @property {Guid} processId - The unique identifier of the executed process.
2133
+ * @property {Record<string, unknown>} resultParameterValues - The resulting parameter values from the process.
2134
+ */
2135
+ export declare interface RunProcessResponse extends BaseResponse {
2136
+ /**
2137
+ * @description The message returned from the process execution.
2138
+ */
2139
+ message: string;
2140
+ /**
2141
+ * @description The unique identifier of the executed process.
2142
+ */
2143
+ processId: Guid;
2144
+ /**
2145
+ * @description The status of the executed process.
2146
+ */
2147
+ processStatus: ProcessStatus;
2148
+ /**
2149
+ * @description The resulting parameter values from the process execution.
2150
+ */
2151
+ resultParameterValues?: Record<string, unknown>;
2152
+ }
2153
+
1903
2154
  /**
1904
2155
  * @public
1905
2156
  * @description Response for saving system settings
@@ -2071,6 +2322,7 @@ export declare class SysSettingValue {
2071
2322
  * @property {LookupValueWithCode} primaryLanguage - primary language
2072
2323
  * @property {LookupValue} primaryCulture - primary culture
2073
2324
  * @property {LookupValue} userCulture - user culture
2325
+ * @property {string} environmentType - type of the environment
2074
2326
  */
2075
2327
  export declare interface SysValues {
2076
2328
  /**
@@ -2125,6 +2377,10 @@ export declare interface SysValues {
2125
2377
  * @description Freedom UI new schema version
2126
2378
  */
2127
2379
  freedomUiSchemaVersion: number;
2380
+ /**
2381
+ * @description environment type
2382
+ */
2383
+ environmentType: string;
2128
2384
  }
2129
2385
 
2130
2386
  /**
@@ -2159,6 +2415,10 @@ export { toLocalISOString }
2159
2415
 
2160
2416
  /* Excluded from this release type: toNumericFunctionType */
2161
2417
 
2418
+ /* Excluded from this release type: ToolbarDefaultSize */
2419
+
2420
+ /* Excluded from this release type: ToolbarExtraProps */
2421
+
2162
2422
  /* Excluded from this release type: ToolbarViewElementConfig */
2163
2423
 
2164
2424
  /* Excluded from this release type: ToolbarViewElementConfigType */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creatio-devkit/common",
3
- "version": "0.822.0",
3
+ "version": "0.830.0",
4
4
  "description": "Allows developers to create customizations and integrate them to Creatio platform.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "keywords": [
@@ -14,7 +14,7 @@
14
14
  "class-transformer": "^0.5.1",
15
15
  "reflect-metadata": "^0.1.13",
16
16
  "lodash": "^4.17.21",
17
- "@creatio/base": "0.822.0"
17
+ "@creatio/base": "0.830.0"
18
18
  },
19
19
  "sideEffects": false,
20
20
  "module": "fesm2022/creatio-devkit-common.mjs",