@flusys/nestjs-entity-builder 9.1.2 → 9.2.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.
@@ -43,6 +43,7 @@ export interface IDefinitionBundle {
43
43
  export interface IImportBundleRequest {
44
44
  bundle: IDefinitionBundle;
45
45
  deprecateMissingFields?: boolean;
46
+ deactivateMissingFlows?: boolean;
46
47
  confirm?: boolean;
47
48
  expectedChecksum?: string;
48
49
  expectedPlanChecksum?: string;
@@ -52,7 +53,7 @@ export interface IBundleExport {
52
53
  checksum: string;
53
54
  warnings: IMessageRef[];
54
55
  }
55
- export type BundleStepKind = 'update_entity' | 'create_entity' | 'restore_field' | 'rename_field' | 'update_field' | 'add_field' | 'deprecate_field' | 'create_flow' | 'update_flow';
56
+ export type BundleStepKind = 'update_entity' | 'create_entity' | 'restore_field' | 'rename_field' | 'update_field' | 'add_field' | 'deprecate_field' | 'create_flow' | 'update_flow' | 'deactivate_flow';
56
57
  export interface IBundleStep {
57
58
  kind: BundleStepKind;
58
59
  entityCode?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flusys/nestjs-entity-builder",
3
- "version": "9.1.2",
3
+ "version": "9.2.0",
4
4
  "description": "Dynamic entity builder module - runtime entity/field metadata, driven DDL, and generic CRUD",
5
5
  "type": "module",
6
6
  "main": "./fesm/index.js",
@@ -85,8 +85,8 @@
85
85
  "rxjs": "^7.8.0"
86
86
  },
87
87
  "dependencies": {
88
- "@flusys/nestjs-core": "9.1.2",
89
- "@flusys/nestjs-shared": "9.1.2",
88
+ "@flusys/nestjs-core": "9.2.0",
89
+ "@flusys/nestjs-shared": "9.2.0",
90
90
  "quickjs-emscripten": "^0.32.0"
91
91
  }
92
92
  }
@@ -16,6 +16,12 @@ export declare function applyVariables(nodes: IFlowNode[], variables: Record<str
16
16
  nodes: IFlowNode[];
17
17
  missing: string[];
18
18
  };
19
+ export declare function fixedIds(nodes: IFlowNode[]): string[];
20
+ export declare function permissionCodes(flow: Pick<IBundleFlow, 'slug' | 'nodes'>): string[];
21
+ export declare function writtenSecrets(nodes: IFlowNode[]): Array<{
22
+ step: string;
23
+ name: string;
24
+ }>;
19
25
  export declare function calledFlowSlugs(nodes: IFlowNode[]): string[];
20
26
  export declare function orderFlows(flows: IBundleFlow[]): IBundleFlow[];
21
27
  export interface ICurrentEntity {
@@ -1,9 +1,10 @@
1
- import { type ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
1
+ import { type ILoggedUserInfo, type IPermissionActionRegistry } from '@flusys/nestjs-shared/interfaces';
2
2
  import { type ExportBundleDto } from '../dtos/definition-bundle.dto.js';
3
3
  import { type IBundleExport, type IBundleImportPlan, type IBundleImportResult, type IImportBundleRequest } from '../interfaces/definition-bundle.interface.js';
4
4
  import { EntityBuilderConfigService } from './entity-builder-config.service.js';
5
5
  import { EntityBuilderDataSourceProvider } from './entity-builder-datasource.provider.js';
6
6
  import { FlowDefinitionService } from './flow-definition.service.js';
7
+ import { SchemaDialectAdapterService } from './schema-dialect-adapter.service.js';
7
8
  import { SchemaEvolutionService } from './schema-evolution.service.js';
8
9
  import { SchemaSyncService } from './schema-sync.service.js';
9
10
  export declare class DefinitionBundleService {
@@ -12,12 +13,16 @@ export declare class DefinitionBundleService {
12
13
  private readonly schemaSync;
13
14
  private readonly evolution;
14
15
  private readonly flows;
15
- constructor(provider: EntityBuilderDataSourceProvider, config: EntityBuilderConfigService, schemaSync: SchemaSyncService, evolution: SchemaEvolutionService, flows: FlowDefinitionService);
16
+ private readonly dialect;
17
+ private readonly actionRegistry?;
18
+ constructor(provider: EntityBuilderDataSourceProvider, config: EntityBuilderConfigService, schemaSync: SchemaSyncService, evolution: SchemaEvolutionService, flows: FlowDefinitionService, dialect: SchemaDialectAdapterService, actionRegistry?: IPermissionActionRegistry | undefined);
16
19
  private variables;
17
20
  export(dto: ExportBundleDto): Promise<IBundleExport>;
21
+ private leftBehind;
18
22
  private loadEntities;
19
23
  planImport(dto: IImportBundleRequest, user: ILoggedUserInfo | null): Promise<IBundleImportPlan>;
20
24
  private buildPlan;
25
+ private addPermissionWarnings;
21
26
  private relationNotYetCreated;
22
27
  private previewEntityStep;
23
28
  private diffFlows;
@@ -25,8 +30,11 @@ export declare class DefinitionBundleService {
25
30
  private createRequest;
26
31
  private changeRequest;
27
32
  applyImport(dto: IImportBundleRequest, user: ILoggedUserInfo | null): Promise<IBundleImportResult>;
33
+ private withImportLock;
34
+ private runImport;
28
35
  private applyEntityStep;
29
36
  private idIsFree;
30
37
  private freeFieldIds;
31
38
  private applyFlowStep;
39
+ private deactivateFlow;
32
40
  }
@@ -15,11 +15,12 @@ export interface IEntityFlowSource {
15
15
  label: string;
16
16
  fields: IEntityFlowField[];
17
17
  }
18
- type FlowInputLabel = 'id' | 'ids' | 'search';
18
+ type FlowInputLabel = 'id';
19
19
  export interface IEntityFlowTexts {
20
20
  names?: Partial<Record<EntityFlowEndpoint, string>>;
21
21
  inputLabels?: Partial<Record<FlowInputLabel, string>>;
22
22
  noMatchMessage?: string;
23
+ deleteOnlyMessage?: string;
23
24
  }
24
25
  export declare const ENTITY_FLOW_PATHS: Record<EntityFlowEndpoint, string>;
25
26
  export declare const entityFlowSlug: (entityCode: string) => string;
@@ -1,5 +1,6 @@
1
1
  import { type IPermissionActionRegistry } from '@flusys/nestjs-shared';
2
2
  import { EntityDefinition } from '../entities/entity-definition.entity.js';
3
+ export declare const entityPermissionCodes: (entityCode: string) => string[];
3
4
  export declare class EntityPermissionService {
4
5
  private readonly actionRegistry?;
5
6
  constructor(actionRegistry?: IPermissionActionRegistry | undefined);
@@ -13,6 +13,7 @@ import { type IFlowDefinition, type IFlowSnapshot, type IFlowVersion } from '../
13
13
  import { EntityBuilderDataSourceProvider } from './entity-builder-datasource.provider.js';
14
14
  export declare const defaultFlowPermissionCode: (slug: string) => string;
15
15
  export declare const flowPermissions: (endpoint: Pick<IFlowEndpoint, "permissions">, slug: string) => ILogicNode;
16
+ export declare const asksExecutePermission: (endpoint: Pick<IFlowEndpoint, "authMode" | "permissions">) => boolean;
16
17
  export declare const flowNotFound: () => NotFoundException;
17
18
  export declare const isPublished: (flow: Pick<FlowDefinition, "version">) => boolean;
18
19
  export declare function snapshotOf(source: Partial<IFlowSnapshot>): IFlowSnapshot;
@@ -56,7 +57,6 @@ export declare class FlowDefinitionService extends ApiService<CreateFlowDefiniti
56
57
  restoreVersion(flowId: string, version: number, user: ILoggedUserInfo | null): Promise<FlowDefinition>;
57
58
  discardDraft(flowId: string, user: ILoggedUserInfo | null): Promise<FlowDefinition>;
58
59
  private saveDraft;
59
- private clearCaches;
60
60
  protected beforeDeleteOperation(dto: DeleteDto, user: ILoggedUserInfo | null, _qr: QueryRunner): Promise<void>;
61
61
  private provisionPermissions;
62
62
  }
@@ -21,6 +21,7 @@ export declare class FlowRuntimeService {
21
21
  private readonly definitions;
22
22
  constructor(provider: EntityBuilderDataSourceProvider, executor: FlowExecutorService, executions: FlowExecutionService, definitions: FlowDefinitionService);
23
23
  findActive(slug: string): Promise<FlowDefinition | null>;
24
+ tenantScope(): string;
24
25
  handle(flow: FlowDefinition, endpoint: IFlowEndpoint, body: unknown, caller: IFlowCaller, user: ILoggedUserInfo | null): Promise<IFlowRunResult>;
25
26
  testRun(dto: TestFlowDto, user: ILoggedUserInfo | null, caller: IFlowCaller): Promise<{
26
27
  result: IFlowRunResult;
@@ -14,6 +14,7 @@ export interface IGenericQuery {
14
14
  currentPage: number;
15
15
  pageSize: number;
16
16
  };
17
+ withDeleted?: boolean;
17
18
  }
18
19
  export interface IGenericWriteOptions {
19
20
  queryRunner?: QueryRunner;
@@ -29,6 +29,7 @@ export declare class SchemaChangeExecutor {
29
29
  plan: ISchemaChangePlan;
30
30
  outcome: ISchemaChangeOutcome;
31
31
  }>;
32
+ private invalidateDefinitions;
32
33
  private compensate;
33
34
  private withUndo;
34
35
  private logFailure;
@@ -9,5 +9,7 @@ export declare class SchemaDialectAdapterService implements ISchemaDialectAdapte
9
9
  sqlLiteral(value: unknown, driver: SupportedDbDriver): string;
10
10
  lockName(lockKey: string): string;
11
11
  acquireEntityLock(queryRunner: QueryRunner, lockKey: string, driver: SupportedDbDriver): Promise<void>;
12
+ tryAcquireSessionLock(queryRunner: QueryRunner, lockKey: string, driver: SupportedDbDriver): Promise<boolean>;
13
+ releaseSessionLock(queryRunner: QueryRunner, lockKey: string, driver: SupportedDbDriver): Promise<void>;
12
14
  releaseEntityLock(queryRunner: QueryRunner, lockKey: string, driver: SupportedDbDriver): Promise<void>;
13
15
  }