From d7682cde3bac4f4a8403b5573bf5feaa4c47172c Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Wed, 9 Jun 2021 16:59:45 +0200 Subject: [PATCH] Move nodeCryptoFunction to jslib-node (#405) * Move nodeCryptoFunction to jslib-node * Fix imports * Fix tests import --- .../src/services/nodeCryptoFunction.service.ts | 9 ++++----- spec/node/services/nodeCryptoFunction.service.spec.ts | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) rename {common => node}/src/services/nodeCryptoFunction.service.ts (97%) diff --git a/common/src/services/nodeCryptoFunction.service.ts b/node/src/services/nodeCryptoFunction.service.ts similarity index 97% rename from common/src/services/nodeCryptoFunction.service.ts rename to node/src/services/nodeCryptoFunction.service.ts index 9e8d9131e6..5fd6b2c5e0 100644 --- a/common/src/services/nodeCryptoFunction.service.ts +++ b/node/src/services/nodeCryptoFunction.service.ts @@ -1,13 +1,12 @@ -import * as constants from 'constants'; import * as crypto from 'crypto'; import * as forge from 'node-forge'; -import { CryptoFunctionService } from '../abstractions/cryptoFunction.service'; +import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service'; -import { Utils } from '../misc/utils'; +import { DecryptParameters } from 'jslib-common/models/domain/decryptParameters'; +import { SymmetricCryptoKey } from 'jslib-common/models/domain/symmetricCryptoKey'; -import { DecryptParameters } from '../models/domain/decryptParameters'; -import { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey'; +import { Utils } from 'jslib-common/misc/utils'; export class NodeCryptoFunctionService implements CryptoFunctionService { pbkdf2(password: string | ArrayBuffer, salt: string | ArrayBuffer, algorithm: 'sha256' | 'sha512', diff --git a/spec/node/services/nodeCryptoFunction.service.spec.ts b/spec/node/services/nodeCryptoFunction.service.spec.ts index 5af53eb009..12b00b6ea8 100644 --- a/spec/node/services/nodeCryptoFunction.service.spec.ts +++ b/spec/node/services/nodeCryptoFunction.service.spec.ts @@ -1,4 +1,4 @@ -import { NodeCryptoFunctionService } from 'jslib-common/services/nodeCryptoFunction.service'; +import { NodeCryptoFunctionService } from 'jslib-node/services/nodeCryptoFunction.service'; import { Utils } from 'jslib-common/misc/utils'; import { SymmetricCryptoKey } from 'jslib-common/models/domain/symmetricCryptoKey';