Skip to content

Commit 4c8fca3

Browse files
authored
Move existing type from server-shared to shared to promote reusability in engine (#1651)
Part of OPS-3021.
1 parent b229b7e commit 4c8fca3

File tree

7 files changed

+21
-12
lines changed

7 files changed

+21
-12
lines changed

packages/server/api/src/app/app-connection/app-connection.entity.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
import { EncryptedObject } from '@openops/server-shared';
2-
import { AppConnection, AppConnectionStatus, Project } from '@openops/shared';
1+
import {
2+
AppConnection,
3+
AppConnectionStatus,
4+
EncryptedObject,
5+
Project,
6+
} from '@openops/shared';
37
import { EntitySchema } from 'typeorm';
48
import {
59
BaseColumnSchemaPart,

packages/server/api/src/app/database/migrations/1759242268873-MigrateAiConfigToAppConnection.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { EncryptedObject, encryptUtils, logger } from '@openops/server-shared';
1+
import { encryptUtils, logger } from '@openops/server-shared';
2+
import { EncryptedObject } from '@openops/shared';
23
import { MigrationInterface, QueryRunner } from 'typeorm';
34

45
export class MigrateAiConfigToAppConnection1759242268873

packages/server/api/src/app/flows/step-test-output/flow-step-test-output.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {
22
compressAndEncrypt,
33
decryptAndDecompress,
4-
EncryptedObject,
54
} from '@openops/server-shared';
65
import {
6+
EncryptedObject,
77
FlowStepTestOutput,
88
FlowVersionId,
99
OpenOpsId,

packages/server/shared/src/lib/security/encrypt-compress.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { FileCompression } from '@openops/shared';
1+
import { EncryptedObject, FileCompression } from '@openops/shared';
22
import { fileCompressor } from '../file-compressor';
3-
import { EncryptedObject, encryptUtils } from './encryption';
3+
import { encryptUtils } from './encryption';
44

55
/**
66
* Compress and encrypt an object

packages/server/shared/src/lib/security/encryption.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { assertNotNullOrUndefined, isNil } from '@openops/shared';
1+
import {
2+
assertNotNullOrUndefined,
3+
EncryptedObject,
4+
isNil,
5+
} from '@openops/shared';
26
import * as crypto from 'crypto';
37
import { randomBytes } from 'node:crypto';
48
import { promisify } from 'util';
@@ -9,11 +13,6 @@ let secret: string | null;
913
const algorithm = 'aes-256-cbc';
1014
const ivLength = 16;
1115

12-
export type EncryptedObject = {
13-
iv: string;
14-
data: string;
15-
};
16-
1716
const loadEncryptionKey = async (
1817
queueMode: QueueMode,
1918
): Promise<string | null> => {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export type EncryptedObject = {
2+
iv: string;
3+
data: string;
4+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
export * from './encrypted-object';
12
export * from './permission';

0 commit comments

Comments
 (0)