@creatio-devkit/common 0.831.0 → 0.832.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 (32) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/esm2022/lib/base-exports.mjs +1 -1
  3. package/esm2022/lib/external/file-viewer/file-viewer-factory.service.mjs +26 -0
  4. package/esm2022/lib/external/file-viewer/file-viewer-instance.model.mjs +51 -0
  5. package/esm2022/lib/external/file-viewer/file-viewer-options.model.mjs +2 -0
  6. package/esm2022/lib/external/file-viewer/index.mjs +4 -0
  7. package/esm2022/lib/external/models/file-value.model.mjs +1 -1
  8. package/esm2022/lib/index.mjs +2 -1
  9. package/esm2022/lib/internal/decorators/implement-using-handler-chain/implement-using-handler-chain.decorator.mjs +3 -2
  10. package/esm2022/lib/internal/models/view-element/angular-view-element-registration-config.model.mjs +1 -1
  11. package/esm2022/lib/internal/services/index.mjs +2 -1
  12. package/esm2022/lib/internal/services/request-resolver/base-requests-resolver.mjs +6 -0
  13. package/esm2022/lib/internal/services/request-resolver/index.mjs +3 -0
  14. package/esm2022/lib/internal/services/request-resolver/requests-resolver.mjs +17 -0
  15. package/esm2022/lib/internal/services/view-element-registry/base-view-element-registry.mjs +5 -1
  16. package/esm2022/lib/public/enums/index.mjs +2 -1
  17. package/esm2022/lib/public/enums/view-model-collection-action-type.enum.mjs +24 -0
  18. package/esm2022/lib/public/models/ai-context/ai-context-part.mjs +2 -2
  19. package/esm2022/lib/public/models/index.mjs +11 -11
  20. package/esm2022/lib/public/models/view-model-collection/index.mjs +3 -0
  21. package/esm2022/lib/public/models/view-model-collection/view-model-collection-change.model.mjs +2 -0
  22. package/esm2022/lib/public/models/view-model-collection/view-model-collection.model.mjs +2 -0
  23. package/esm2022/lib/public/services/handler-chain/internal-handler-chain.mjs +1 -1
  24. package/esm2022/lib/public/services/index.mjs +10 -9
  25. package/esm2022/lib/public/services/schema-modal/index.mjs +3 -0
  26. package/esm2022/lib/public/services/schema-modal/schema-modal-config.model.mjs +2 -0
  27. package/esm2022/lib/public/services/schema-modal/schema-modal.service.mjs +23 -0
  28. package/esm2022/lib/public/services/sys-values/sys-values.mjs +1 -1
  29. package/fesm2022/creatio-devkit-common.mjs +600 -454
  30. package/fesm2022/creatio-devkit-common.mjs.map +1 -1
  31. package/index.d.ts +174 -2
  32. package/package.json +14 -2
package/index.d.ts CHANGED
@@ -154,7 +154,6 @@ import { ɵtoLocalISOString as toLocalISOString } from '@creatio/base';
154
154
  import { ɵType as Type } from '@creatio/base';
155
155
  import { ɵUpdateQuery as UpdateQuery } from '@creatio/base';
156
156
  import { ɵValidationUtilities as ValidationUtilities } from '@creatio/base';
157
- import { ɵViewModelCollection as ViewModelCollection } from '@creatio/base';
158
157
  import { ɵViewModelContext as ViewModelContext } from '@creatio/base';
159
158
  import { ɵWindowFunctionColumn as WindowFunctionColumn } from '@creatio/base';
160
159
  import { ɵWindowFunctionExpression as WindowFunctionExpression } from '@creatio/base';
@@ -162,6 +161,7 @@ import { ɵWindowFunctionExpressionConfig as WindowFunctionExpressionConfig } fr
162
161
  import { ɵCompatibleAPIs } from '@creatio/base';
163
162
  import { ɵDataSourceLoadOptions } from '@creatio/base';
164
163
  import { ɵItemCreationConfig } from '@creatio/base';
164
+ import { ɵViewModelCollection } from '@creatio/base';
165
165
 
166
166
  export { AbstractType }
167
167
 
@@ -346,6 +346,8 @@ export declare abstract class BaseRequestHandler<TRequest = BaseRequest, TResult
346
346
  setNext(next: RequestHandler): void;
347
347
  }
348
348
 
349
+ /* Excluded from this release type: BaseRequestsResolver */
350
+
349
351
  /**
350
352
  * @public
351
353
  * @description Shape of response
@@ -1266,6 +1268,12 @@ export declare class FeatureService extends BaseHandlerChainService {
1266
1268
  }
1267
1269
 
1268
1270
  /* Excluded from this release type: FileValue */
1271
+
1272
+ /* Excluded from this release type: FileViewerFactory */
1273
+
1274
+ /* Excluded from this release type: FileViewerInstance */
1275
+
1276
+ /* Excluded from this release type: FileViewerOptions */
1269
1277
  export { FilterGroup }
1270
1278
 
1271
1279
  export { FilterMock }
@@ -1981,6 +1989,14 @@ export declare interface OnViewportRenderConfig {
1981
1989
  };
1982
1990
  }
1983
1991
 
1992
+ declare type OptionChangeSubscribeFn = (listener: OptionsChangeListener) => UnsubscribeFn;
1993
+
1994
+ declare interface OptionChangeSubscription {
1995
+ subscribe: OptionChangeSubscribeFn;
1996
+ }
1997
+
1998
+ declare type OptionsChangeListener = (options: FileViewerOptions) => void;
1999
+
1984
2000
  export { OrderDirection }
1985
2001
 
1986
2002
  export { ParameterExpression }
@@ -2174,6 +2190,8 @@ export { RequestRegistrationConfig }
2174
2190
 
2175
2191
  /* Excluded from this release type: RequestRegistryService */
2176
2192
 
2193
+ /* Excluded from this release type: RequestsResolver */
2194
+
2177
2195
  /* Excluded from this release type: resetGlobals */
2178
2196
  export { ResolveDependencyFn }
2179
2197
 
@@ -2274,6 +2292,74 @@ export declare interface SaveSysSettingsResponse extends BaseResponse {
2274
2292
  }
2275
2293
 
2276
2294
  /* Excluded from this release type: SchemaHandlerSource */
2295
+
2296
+ /**
2297
+ * @public
2298
+ * @description Configuration interface for schema modal dialogs.
2299
+ * @property {string} schemaName - Name of the schema to be displayed in the modal.
2300
+ * @property {ɵModelInPageAction} action - Action to be performed on the model (e.g., create, edit).
2301
+ * @property {string} recordId - Identifier of the record to be edited or viewed.
2302
+ * @property {Array<ɵModelDefaultValue>} defaultValues - Default values to initialize the model with.
2303
+ * @property {Record<string, ɵJsonData>} parameters - Additional parameters for the schema.
2304
+ * @property {boolean} preventDefaultCloseCommand - Flag to prevent the default close command.
2305
+ * @property {object} appearanceSettings - Settings for the appearance of the modal.
2306
+ */
2307
+ export declare interface SchemaModalConfig {
2308
+ /**
2309
+ * @description Name of the schema to be displayed in the modal.
2310
+ */
2311
+ schemaName: string;
2312
+ /**
2313
+ * @description Action to be performed on the model (e.g., create, edit).
2314
+ */
2315
+ action?: ModelInPageAction;
2316
+ /**
2317
+ * @description Identifier of the record to be edited or viewed.
2318
+ */
2319
+ recordId?: string;
2320
+ /**
2321
+ * @description Default values to initialize the model with.
2322
+ */
2323
+ defaultValues?: Array<ModelDefaultValue>;
2324
+ /**
2325
+ * @description Additional parameters for the schema.
2326
+ */
2327
+ parameters?: Record<string, JsonData>;
2328
+ /**
2329
+ * @description Flag to prevent the default close command.
2330
+ */
2331
+ preventDefaultCloseCommand?: boolean;
2332
+ /**
2333
+ * @description Settings for the appearance of the modal.
2334
+ */
2335
+ appearanceSettings?: {
2336
+ /**
2337
+ * @description CSS classes to be applied to the modal panel.
2338
+ */
2339
+ panelClass?: string[];
2340
+ /**
2341
+ * @description Maximum height of the modal.
2342
+ */
2343
+ maxHeight?: number | string;
2344
+ };
2345
+ }
2346
+
2347
+ /**
2348
+ * @public
2349
+ * @class SchemaModalService
2350
+ * @classdesc Service to work with schema modal windows using handler chain.
2351
+ * @extends {BaseHandlerChainService}
2352
+ */
2353
+ export declare class SchemaModalService extends BaseHandlerChainService {
2354
+ /* Excluded from this release type: requestType */
2355
+ /**
2356
+ * @description Method to show schema in the modal window.
2357
+ * @param {SchemaModalConfig} config - Configuration object for the schema modal.
2358
+ * @returns `Promise<void>`
2359
+ */
2360
+ show: (config: SchemaModalConfig) => Promise<void>;
2361
+ }
2362
+
2277
2363
  export { SchemaViewMaskRequest }
2278
2364
 
2279
2365
  export { SchemaViewMaskRequestAction }
@@ -2476,6 +2562,10 @@ export declare interface SysValues {
2476
2562
  * @description user culture
2477
2563
  */
2478
2564
  userCulture: LookupValue;
2565
+ /**
2566
+ * @description user
2567
+ */
2568
+ user: LookupValue;
2479
2569
  /**
2480
2570
  * @description core version
2481
2571
  */
@@ -2488,6 +2578,10 @@ export declare interface SysValues {
2488
2578
  * @description environment type
2489
2579
  */
2490
2580
  environmentType: string;
2581
+ /**
2582
+ * @description customer
2583
+ */
2584
+ customer: string;
2491
2585
  }
2492
2586
 
2493
2587
  /**
@@ -2560,6 +2654,8 @@ export declare class TransactionFactoryService extends BaseHandlerChainService i
2560
2654
 
2561
2655
  export { Type }
2562
2656
 
2657
+ declare type UnsubscribeFn = () => void;
2658
+
2563
2659
  /* Excluded from this release type: UnsubscribeListener */
2564
2660
  export { UpdateQuery }
2565
2661
 
@@ -2695,7 +2791,83 @@ export declare interface ViewModelAttributeChangeEventOptionsType {
2695
2791
  /* Excluded from this release type: isMaskedValue */
2696
2792
  }
2697
2793
 
2698
- export { ViewModelCollection }
2794
+ /**
2795
+ * @public
2796
+ * @description Interface for a view model collection that extends the base collection with
2797
+ * on collection change callbacks registration capabilities.
2798
+ *
2799
+ * @template T - The type of view model context that extends ViewModel
2800
+ */
2801
+ export declare interface ViewModelCollection<T extends ViewModelContext> extends ɵViewModelCollection<T> {
2802
+ /**
2803
+ * @description Registers a handler to be called whenever the collection emits a change event.
2804
+ * @param callback Executes when the collection changes and receives change metadata.
2805
+ * @param action Optional action filter; omit to receive all collection change notifications.
2806
+ */
2807
+ registerOnCollectionChangeCallback: (callback: (changes: ViewModelCollectionChange<T>) => void, action?: ViewModelCollectionActionType) => void;
2808
+ /**
2809
+ * @description Removes a previously registered collection change handler.
2810
+ * @param callback Previously registered callback to detach.
2811
+ * @param action Optional action filter, if provided, only detaches the callback for that action type.
2812
+ */
2813
+ unregisterOnCollectionChangeCallback: (callback: (changes: ViewModelCollectionChange<T>) => void, action?: ViewModelCollectionActionType) => void;
2814
+ /**
2815
+ * @description Registers a handler that fires when attributes of any collection item change.
2816
+ * @param callback Executes with the item whose attributes were updated.
2817
+ */
2818
+ registerOnItemAttributesChangesCallback: (callback: (item: T) => void) => void;
2819
+ /**
2820
+ * @description Removes a previously registered item attribute change handler.
2821
+ * @param callback Callback reference to detach from attribute change notifications.
2822
+ */
2823
+ unregisterOnItemAttributesChangesCallback: (callback: (item: T) => void) => void;
2824
+ }
2825
+
2826
+ /**
2827
+ * @public
2828
+ * @description List of actions which can be performed on collection with a public API.
2829
+ */
2830
+ export declare enum ViewModelCollectionActionType {
2831
+ /**
2832
+ * @description Create a collection element.
2833
+ */
2834
+ Add = "add",
2835
+ /**
2836
+ * @description Remove an element from collection.
2837
+ */
2838
+ Remove = "remove",
2839
+ /**
2840
+ * @description Update an element in collection.
2841
+ */
2842
+ Move = "move",
2843
+ /**
2844
+ * @description Reload collection with new elements.
2845
+ */
2846
+ Reload = "reload"
2847
+ }
2848
+
2849
+ /**
2850
+ * @public
2851
+ * @description Interface describes the model of collection change event.
2852
+ */
2853
+ export declare interface ViewModelCollectionChange<T extends ViewModelContext> {
2854
+ /**
2855
+ * @description The array of current collection elements.
2856
+ */
2857
+ collection: T[];
2858
+ /**
2859
+ * @description The array of elements affected by the change.
2860
+ */
2861
+ affectedElements: T[];
2862
+ /**
2863
+ * @description The type of action that triggered the change.
2864
+ */
2865
+ action: ViewModelCollectionActionType;
2866
+ /**
2867
+ * @description The index at which the change occurred, if applicable.
2868
+ */
2869
+ index?: number;
2870
+ }
2699
2871
 
2700
2872
  export { ViewModelContext }
2701
2873
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creatio-devkit/common",
3
- "version": "0.831.0",
3
+ "version": "0.832.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,9 +14,21 @@
14
14
  "class-transformer": "^0.5.1",
15
15
  "reflect-metadata": "^0.1.13",
16
16
  "lodash": "^4.17.21",
17
- "@creatio/base": "0.831.0"
17
+ "@creatio/base": "0.832.0"
18
18
  },
19
19
  "sideEffects": false,
20
+ "overrides": [
21
+ {
22
+ "files": [
23
+ "*.ts"
24
+ ],
25
+ "parserOptions": {
26
+ "project": [
27
+ "libs/devkit/common/tsconfig.*?.json"
28
+ ]
29
+ }
30
+ }
31
+ ],
20
32
  "module": "fesm2022/creatio-devkit-common.mjs",
21
33
  "typings": "index.d.ts",
22
34
  "exports": {