@strapi/data-transfer 5.30.1 → 5.31.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.
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import type { WebSocket, RawData } from 'ws';
3
4
  import type { ValidTransferCommand } from './constants';
4
5
  import type { TransferMethod } from '../constants';
@@ -1 +1 @@
1
- {"version":3,"file":"abstract.d.ts","sourceRoot":"","sources":["../../../../src/strapi/remote/handlers/abstract.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,KAAK,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,OAAO;IAEtB,IAAI,UAAU,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,UAAU,CAAC,EAAE,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE;IAGxC,IAAI,SAAS,IAAI,aAAa,CAAC,WAAW,CAAC,CAAC;IAC5C,IAAI,SAAS,CAAC,EAAE,EAAE,aAAa,CAAC,WAAW,CAAC,EAAE;IAE9C,IAAI,QAAQ,IAA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her } from 'crypto';
2
+ import { Decipheriv } from 'crypto';
3
3
  import { Algorithm } from '../../../types';
4
4
  /**
5
5
  * It creates a cipher instance used for decryption
@@ -7,7 +7,7 @@ import { Algorithm } from '../../../types';
7
7
  * @param key - The decryption key
8
8
  * @param algorithm - The algorithm to use to create the Cipher
9
9
  *
10
- * @returns A {@link Cipher} instance created with the given key & algorithm
10
+ * @returns A {@link Decipheriv} instance created with the given key & algorithm
11
11
  */
12
- export declare const createDecryptionCipher: (key: string, algorithm?: Algorithm) => Cipher;
12
+ export declare const createDecryptionCipher: (key: string, algorithm?: Algorithm) => Decipheriv;
13
13
  //# sourceMappingURL=decrypt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decrypt.d.ts","sourceRoot":"","sources":["../../../src/utils/encryption/decrypt.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAuD,MAAM,QAAQ,CAAC;AACrF,OAAO,EAAkC,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAkC3E;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,QAC5B,MAAM,cACA,SAAS,KACnB,MAEF,CAAC"}
1
+ {"version":3,"file":"decrypt.d.ts","sourceRoot":"","sources":["../../../src/utils/encryption/decrypt.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAuD,MAAM,QAAQ,CAAC;AACzF,OAAO,EAAkC,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAkC3E;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,QAC5B,MAAM,cACA,SAAS,KACnB,UAEF,CAAC"}
@@ -38,7 +38,7 @@ const getDecryptionStrategy = (algorithm)=>{
38
38
  * @param key - The decryption key
39
39
  * @param algorithm - The algorithm to use to create the Cipher
40
40
  *
41
- * @returns A {@link Cipher} instance created with the given key & algorithm
41
+ * @returns A {@link Decipheriv} instance created with the given key & algorithm
42
42
  */ const createDecryptionCipher = (key, algorithm = 'aes-128-ecb')=>{
43
43
  return getDecryptionStrategy(algorithm)(key);
44
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"decrypt.js","sources":["../../../src/utils/encryption/decrypt.ts"],"sourcesContent":["import { Cipher, scryptSync, CipherKey, BinaryLike, createDecipheriv } from 'crypto';\nimport { EncryptionStrategy, Strategies, Algorithm } from '../../../types';\n\n// different key values depending on algorithm chosen\nconst getDecryptionStrategy = (algorithm: Algorithm): EncryptionStrategy => {\n const strategies: Strategies = {\n 'aes-128-ecb'(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 16);\n const initVector: BinaryLike | null = null;\n const securityKey: CipherKey = hashedKey;\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes128(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 32);\n const initVector: BinaryLike | null = hashedKey.slice(16);\n const securityKey: CipherKey = hashedKey.slice(0, 16);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes192(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 40);\n const initVector: BinaryLike | null = hashedKey.slice(24);\n const securityKey: CipherKey = hashedKey.slice(0, 24);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes256(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 48);\n const initVector: BinaryLike | null = hashedKey.slice(32);\n const securityKey: CipherKey = hashedKey.slice(0, 32);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n };\n\n return strategies[algorithm];\n};\n\n/**\n * It creates a cipher instance used for decryption\n *\n * @param key - The decryption key\n * @param algorithm - The algorithm to use to create the Cipher\n *\n * @returns A {@link Cipher} instance created with the given key & algorithm\n */\nexport const createDecryptionCipher = (\n key: string,\n algorithm: Algorithm = 'aes-128-ecb'\n): Cipher => {\n return getDecryptionStrategy(algorithm)(key);\n};\n"],"names":["getDecryptionStrategy","algorithm","strategies","key","hashedKey","scryptSync","initVector","securityKey","createDecipheriv","aes128","slice","aes192","aes256","createDecryptionCipher"],"mappings":";;;;AAGA;AACA,MAAMA,wBAAwB,CAACC,SAAAA,GAAAA;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tD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,uBAAAA,CAAiBP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAClD;AACF,KAAA;IAEA,OAAOJ,UAAU,CAACD,SAAU,CAAA;AAC9B,CAAA;AAEA;;;;;;;AAOC,IACYY,MAAAA,sBAAAA,GAAyB,CACpCV,GAAAA,EACAF,YAAuB,aAAa,GAAA;AAEpC,IAAA,OAAOD,sBAAsBC,SAAWE,CAAAA,CAAAA,GAAAA,CAAAA;AAC1C;;;;"}
1
+ {"version":3,"file":"decrypt.js","sources":["../../../src/utils/encryption/decrypt.ts"],"sourcesContent":["import { Decipheriv, scryptSync, CipherKey, BinaryLike, createDecipheriv } from 'crypto';\nimport { EncryptionStrategy, Strategies, Algorithm } from '../../../types';\n\n// different key values depending on algorithm chosen\nconst getDecryptionStrategy = (algorithm: Algorithm): EncryptionStrategy => {\n const strategies: Strategies = {\n 'aes-128-ecb'(key: string): Decipheriv {\n const hashedKey = scryptSync(key, '', 16);\n const initVector: BinaryLike | null = null;\n const securityKey: CipherKey = hashedKey;\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes128(key: string): Decipheriv {\n const hashedKey = scryptSync(key, '', 32);\n const initVector: BinaryLike | null = hashedKey.slice(16);\n const securityKey: CipherKey = hashedKey.slice(0, 16);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes192(key: string): Decipheriv {\n const hashedKey = scryptSync(key, '', 40);\n const initVector: BinaryLike | null = hashedKey.slice(24);\n const securityKey: CipherKey = hashedKey.slice(0, 24);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes256(key: string): Decipheriv {\n const hashedKey = scryptSync(key, '', 48);\n const initVector: BinaryLike | null = hashedKey.slice(32);\n const securityKey: CipherKey = hashedKey.slice(0, 32);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n };\n\n return strategies[algorithm];\n};\n\n/**\n * It creates a cipher instance used for decryption\n *\n * @param key - The decryption key\n * @param algorithm - The algorithm to use to create the Cipher\n *\n * @returns A {@link Decipheriv} instance created with the given key & algorithm\n */\nexport const createDecryptionCipher = (\n key: string,\n algorithm: Algorithm = 'aes-128-ecb'\n): Decipheriv => {\n return getDecryptionStrategy(algorithm)(key);\n};\n"],"names":["getDecryptionStrategy","algorithm","strategies","key","hashedKey","scryptSync","initVector","securityKey","createDecipheriv","aes128","slice","aes192","aes256","createDecryptionCipher"],"mappings":";;;;AAGA;AACA,MAAMA,wBAAwB,CAACC,SAAAA,GAAAA;AAC7B,IAAA,MAAMC,UAAyB,GAAA;AAC7B,QAAA,aAAA,CAAA,CAAcC,GAAW,EAAA;YACvB,MAAMC,SAAAA,GAAYC,iBAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;AACtC,YAAA,MAAMG,UAAgC,GAAA,IAAA;AACtC,YAAA,MAAMC,WAAyBH,GAAAA,SAAAA;YAC/B,OAAOI,uBAAAA,CAAiBP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAClD,SAAA;AACAG,QAAAA,MAAAA,CAAAA,CAAON,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,iBAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,uBAAAA,CAAiBP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAClD,SAAA;AACAK,QAAAA,MAAAA,CAAAA,CAAOR,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,iBAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,uBAAAA,CAAiBP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAClD,SAAA;AACAM,QAAAA,MAAAA,CAAAA,CAAOT,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,iBAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,uBAAAA,CAAiBP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAClD;AACF,KAAA;IAEA,OAAOJ,UAAU,CAACD,SAAU,CAAA;AAC9B,CAAA;AAEA;;;;;;;AAOC,IACYY,MAAAA,sBAAAA,GAAyB,CACpCV,GAAAA,EACAF,YAAuB,aAAa,GAAA;AAEpC,IAAA,OAAOD,sBAAsBC,SAAWE,CAAAA,CAAAA,GAAAA,CAAAA;AAC1C;;;;"}
@@ -36,7 +36,7 @@ const getDecryptionStrategy = (algorithm)=>{
36
36
  * @param key - The decryption key
37
37
  * @param algorithm - The algorithm to use to create the Cipher
38
38
  *
39
- * @returns A {@link Cipher} instance created with the given key & algorithm
39
+ * @returns A {@link Decipheriv} instance created with the given key & algorithm
40
40
  */ const createDecryptionCipher = (key, algorithm = 'aes-128-ecb')=>{
41
41
  return getDecryptionStrategy(algorithm)(key);
42
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"decrypt.mjs","sources":["../../../src/utils/encryption/decrypt.ts"],"sourcesContent":["import { Cipher, scryptSync, CipherKey, BinaryLike, createDecipheriv } from 'crypto';\nimport { EncryptionStrategy, Strategies, Algorithm } from '../../../types';\n\n// different key values depending on algorithm chosen\nconst getDecryptionStrategy = (algorithm: Algorithm): EncryptionStrategy => {\n const strategies: Strategies = {\n 'aes-128-ecb'(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 16);\n const initVector: BinaryLike | null = null;\n const securityKey: CipherKey = hashedKey;\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes128(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 32);\n const initVector: BinaryLike | null = hashedKey.slice(16);\n const securityKey: CipherKey = hashedKey.slice(0, 16);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes192(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 40);\n const initVector: BinaryLike | null = hashedKey.slice(24);\n const securityKey: CipherKey = hashedKey.slice(0, 24);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes256(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 48);\n const initVector: BinaryLike | null = hashedKey.slice(32);\n const securityKey: CipherKey = hashedKey.slice(0, 32);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n };\n\n return strategies[algorithm];\n};\n\n/**\n * It creates a cipher instance used for decryption\n *\n * @param key - The decryption key\n * @param algorithm - The algorithm to use to create the Cipher\n *\n * @returns A {@link Cipher} instance created with the given key & algorithm\n */\nexport const createDecryptionCipher = (\n key: string,\n algorithm: Algorithm = 'aes-128-ecb'\n): Cipher => {\n return getDecryptionStrategy(algorithm)(key);\n};\n"],"names":["getDecryptionStrategy","algorithm","strategies","key","hashedKey","scryptSync","initVector","securityKey","createDecipheriv","aes128","slice","aes192","aes256","createDecryptionCipher"],"mappings":";;AAGA;AACA,MAAMA,wBAAwB,CAACC,SAAAA,GAAAA;AAC7B,IAAA,MAAMC,UAAyB,GAAA;AAC7B,QAAA,aAAA,CAAA,CAAcC,GAAW,EAAA;YACvB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;AACtC,YAAA,MAAMG,UAAgC,GAAA,IAAA;AACtC,YAAA,MAAMC,WAAyBH,G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;AAOC,IACYY,MAAAA,sBAAAA,GAAyB,CACpCV,GAAAA,EACAF,YAAuB,aAAa,GAAA;AAEpC,IAAA,OAAOD,sBAAsBC,SAAWE,CAAAA,CAAAA,GAAAA,CAAAA;AAC1C;;;;"}
1
+ {"version":3,"file":"decrypt.mjs","sources":["../../../src/utils/encryption/decrypt.ts"],"sourcesContent":["import { Decipheriv, scryptSync, CipherKey, BinaryLike, createDecipheriv } from 'crypto';\nimport { EncryptionStrategy, Strategies, Algorithm } from '../../../types';\n\n// different key values depending on algorithm chosen\nconst getDecryptionStrategy = (algorithm: Algorithm): EncryptionStrategy => {\n const strategies: Strategies = {\n 'aes-128-ecb'(key: string): Decipheriv {\n const hashedKey = scryptSync(key, '', 16);\n const initVector: BinaryLike | null = null;\n const securityKey: CipherKey = hashedKey;\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes128(key: string): Decipheriv {\n const hashedKey = scryptSync(key, '', 32);\n const initVector: BinaryLike | null = hashedKey.slice(16);\n const securityKey: CipherKey = hashedKey.slice(0, 16);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes192(key: string): Decipheriv {\n const hashedKey = scryptSync(key, '', 40);\n const initVector: BinaryLike | null = hashedKey.slice(24);\n const securityKey: CipherKey = hashedKey.slice(0, 24);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n aes256(key: string): Decipheriv {\n const hashedKey = scryptSync(key, '', 48);\n const initVector: BinaryLike | null = hashedKey.slice(32);\n const securityKey: CipherKey = hashedKey.slice(0, 32);\n return createDecipheriv(algorithm, securityKey, initVector);\n },\n };\n\n return strategies[algorithm];\n};\n\n/**\n * It creates a cipher instance used for decryption\n *\n * @param key - The decryption key\n * @param algorithm - The algorithm to use to create the Cipher\n *\n * @returns A {@link Decipheriv} instance created with the given key & algorithm\n */\nexport const createDecryptionCipher = (\n key: string,\n algorithm: Algorithm = 'aes-128-ecb'\n): Decipheriv => {\n return getDecryptionStrategy(algorithm)(key);\n};\n"],"names":["getDecryptionStrategy","algorithm","strategies","key","hashedKey","scryptSync","initVector","securityKey","createDecipheriv","aes128","slice","aes192","aes256","createDecryptionCipher"],"mappings":";;AAGA;AACA,MAAMA,wBAAwB,CAACC,SAAAA,GAAAA;AAC7B,IAAA,MAAMC,UAAyB,GAAA;AAC7B,QAAA,aAAA,CAAA,CAAcC,GAAW,EAAA;YACvB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;AACtC,YAAA,MAAMG,UAAgC,GAAA,IAAA;AACtC,YAAA,MAAMC,WAAyBH,GAAAA,SAAAA;YAC/B,OAAOI,gBAAAA,CAAiBP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAClD,SAAA;AACAG,QAAAA,MAAAA,CAAAA,CAAON,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,gBAAAA,CAAiBP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAClD,SAAA;AACAK,QAAAA,MAAAA,CAAAA,CAAOR,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,gBAAAA,CAAiBP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAClD,SAAA;AACAM,QAAAA,MAAAA,CAAAA,CAAOT,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,gBAAAA,CAAiBP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAClD;AACF,KAAA;IAEA,OAAOJ,UAAU,CAACD,SAAU,CAAA;AAC9B,CAAA;AAEA;;;;;;;AAOC,IACYY,MAAAA,sBAAAA,GAAyB,CACpCV,GAAAA,EACAF,YAAuB,aAAa,GAAA;AAEpC,IAAA,OAAOD,sBAAsBC,SAAWE,CAAAA,CAAAA,GAAAA,CAAAA;AAC1C;;;;"}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { Cipher } from 'crypto';
2
+ import { Cipheriv } from 'crypto';
3
3
  import { Algorithm } from '../../../types';
4
4
  /**
5
5
  * It creates a cipher instance used for encryption
@@ -7,7 +7,7 @@ import { Algorithm } from '../../../types';
7
7
  * @param key - The encryption key
8
8
  * @param algorithm - The algorithm to use to create the Cipher
9
9
  *
10
- * @returns A {@link Cipher} instance created with the given key & algorithm
10
+ * @returns A {@link Cipheriv} instance created with the given key & algorithm
11
11
  */
12
- export declare const createEncryptionCipher: (key: string, algorithm?: Algorithm) => Cipher;
12
+ export declare const createEncryptionCipher: (key: string, algorithm?: Algorithm) => Cipheriv;
13
13
  //# sourceMappingURL=encrypt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"encrypt.d.ts","sourceRoot":"","sources":["../../../src/utils/encryption/encrypt.ts"],"names":[],"mappings":";AAAA,OAAO,EAAkB,MAAM,EAAqC,MAAM,QAAQ,CAAC;AACnF,OAAO,EAAkC,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAkC3E;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,QAC5B,MAAM,cACA,SAAS,KACnB,MAEF,CAAC"}
1
+ {"version":3,"file":"encrypt.d.ts","sourceRoot":"","sources":["../../../src/utils/encryption/encrypt.ts"],"names":[],"mappings":";AAAA,OAAO,EAAkB,QAAQ,EAAqC,MAAM,QAAQ,CAAC;AACrF,OAAO,EAAkC,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAkC3E;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,QAC5B,MAAM,cACA,SAAS,KACnB,QAEF,CAAC"}
@@ -38,7 +38,7 @@ const getEncryptionStrategy = (algorithm)=>{
38
38
  * @param key - The encryption key
39
39
  * @param algorithm - The algorithm to use to create the Cipher
40
40
  *
41
- * @returns A {@link Cipher} instance created with the given key & algorithm
41
+ * @returns A {@link Cipheriv} instance created with the given key & algorithm
42
42
  */ const createEncryptionCipher = (key, algorithm = 'aes-128-ecb')=>{
43
43
  return getEncryptionStrategy(algorithm)(key);
44
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"encrypt.js","sources":["../../../src/utils/encryption/encrypt.ts"],"sourcesContent":["import { createCipheriv, Cipher, scryptSync, CipherKey, BinaryLike } from 'crypto';\nimport { EncryptionStrategy, Strategies, Algorithm } from '../../../types';\n\n// different key values depending on algorithm chosen\nconst getEncryptionStrategy = (algorithm: Algorithm): EncryptionStrategy => {\n const strategies: Strategies = {\n 'aes-128-ecb'(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 16);\n const initVector: BinaryLike | null = null;\n const securityKey: CipherKey = hashedKey;\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes128(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 32);\n const initVector: BinaryLike | null = hashedKey.slice(16);\n const securityKey: CipherKey = hashedKey.slice(0, 16);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes192(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 40);\n const initVector: BinaryLike | null = hashedKey.slice(24);\n const securityKey: CipherKey = hashedKey.slice(0, 24);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes256(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 48);\n const initVector: BinaryLike | null = hashedKey.slice(32);\n const securityKey: CipherKey = hashedKey.slice(0, 32);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n };\n\n return strategies[algorithm];\n};\n\n/**\n * It creates a cipher instance used for encryption\n *\n * @param key - The encryption key\n * @param algorithm - The algorithm to use to create the Cipher\n *\n * @returns A {@link Cipher} instance created with the given key & algorithm\n */\nexport const createEncryptionCipher = (\n key: string,\n algorithm: Algorithm = 'aes-128-ecb'\n): Cipher => {\n return getEncryptionStrategy(algorithm)(key);\n};\n"],"names":["getEncryptionStrategy","algorithm","strategies","key","hashedKey","scryptSync","initVector","securityKey","createCipheriv","aes128","slice","aes192","aes256","createEncryptionCipher"],"mappings":";;;;AAGA;AACA,MAAMA,wBAAwB,CAACC,SAAAA,GAAAA;AAC7B,IAAA,MAAMC,UAAyB,GAAA;AAC7B,QAAA,aAAA,CAAA,CAAcC,GAAW,EAAA;YACvB,MAAMC,SAAAA,GAAYC,iBAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;AACtC,YAAA,MAAMG,UAAgC,GAAA,IAAA;AACtC,YAAA,MAAMC,WAAyBH,GAAAA,SAAAA;YAC/B,OAAOI,qBAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD,SAAA;AACAG,QAAAA,MAAAA,CAAAA,CAAON,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,iBAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,qBAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD,SAAA;AACAK,QAAAA,MAAAA,CAAAA,CAAOR,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,iBAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,qBAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD,SAAA;AACAM,QAAAA,MAAAA,CAAAA,CAAOT,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,iBAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,qBAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD;AACF,KAAA;IAEA,OAAOJ,UAAU,CAACD,SAAU,CAAA;AAC9B,CAAA;AAEA;;;;;;;AAOC,IACYY,MAAAA,sBAAAA,GAAyB,CACpCV,GAAAA,EACAF,YAAuB,aAAa,GAAA;AAEpC,IAAA,OAAOD,sBAAsBC,SAAWE,CAAAA,CAAAA,GAAAA,CAAAA;AAC1C;;;;"}
1
+ {"version":3,"file":"encrypt.js","sources":["../../../src/utils/encryption/encrypt.ts"],"sourcesContent":["import { createCipheriv, Cipheriv, scryptSync, CipherKey, BinaryLike } from 'crypto';\nimport { EncryptionStrategy, Strategies, Algorithm } from '../../../types';\n\n// different key values depending on algorithm chosen\nconst getEncryptionStrategy = (algorithm: Algorithm): EncryptionStrategy => {\n const strategies: Strategies = {\n 'aes-128-ecb'(key: string): Cipheriv {\n const hashedKey = scryptSync(key, '', 16);\n const initVector: BinaryLike | null = null;\n const securityKey: CipherKey = hashedKey;\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes128(key: string): Cipheriv {\n const hashedKey = scryptSync(key, '', 32);\n const initVector: BinaryLike | null = hashedKey.slice(16);\n const securityKey: CipherKey = hashedKey.slice(0, 16);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes192(key: string): Cipheriv {\n const hashedKey = scryptSync(key, '', 40);\n const initVector: BinaryLike | null = hashedKey.slice(24);\n const securityKey: CipherKey = hashedKey.slice(0, 24);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes256(key: string): Cipheriv {\n const hashedKey = scryptSync(key, '', 48);\n const initVector: BinaryLike | null = hashedKey.slice(32);\n const securityKey: CipherKey = hashedKey.slice(0, 32);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n };\n\n return strategies[algorithm];\n};\n\n/**\n * It creates a cipher instance used for encryption\n *\n * @param key - The encryption key\n * @param algorithm - The algorithm to use to create the Cipher\n *\n * @returns A {@link Cipheriv} instance created with the given key & algorithm\n */\nexport const createEncryptionCipher = (\n key: string,\n algorithm: Algorithm = 'aes-128-ecb'\n): Cipheriv => {\n return getEncryptionStrategy(algorithm)(key);\n};\n"],"names":["getEncryptionStrategy","algorithm","strategies","key","hashedKey","scryptSync","initVector","securityKey","createCipheriv","aes128","slice","aes192","aes256","createEncryptionCipher"],"mappings":";;;;AAGA;AACA,MAAMA,wBAAwB,CAACC,SAAAA,GAAAA;AAC7B,IAAA,MAAMC,UAAyB,GAAA;AAC7B,QAAA,aAAA,CAAA,CAAcC,GAAW,EAAA;YACvB,MAAMC,SAAAA,GAAYC,iBAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;AACtC,YAAA,MAAMG,UAAgC,GAAA,IAAA;AACtC,YAAA,MAAMC,WAAyBH,GAAAA,SAAAA;YAC/B,OAAOI,qBAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;A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,IAAA,OAAOD,sBAAsBC,SAAWE,CAAAA,CAAAA,GAAAA,CAAAA;AAC1C;;;;"}
@@ -36,7 +36,7 @@ const getEncryptionStrategy = (algorithm)=>{
36
36
  * @param key - The encryption key
37
37
  * @param algorithm - The algorithm to use to create the Cipher
38
38
  *
39
- * @returns A {@link Cipher} instance created with the given key & algorithm
39
+ * @returns A {@link Cipheriv} instance created with the given key & algorithm
40
40
  */ const createEncryptionCipher = (key, algorithm = 'aes-128-ecb')=>{
41
41
  return getEncryptionStrategy(algorithm)(key);
42
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"encrypt.mjs","sources":["../../../src/utils/encryption/encrypt.ts"],"sourcesContent":["import { createCipheriv, Cipher, scryptSync, CipherKey, BinaryLike } from 'crypto';\nimport { EncryptionStrategy, Strategies, Algorithm } from '../../../types';\n\n// different key values depending on algorithm chosen\nconst getEncryptionStrategy = (algorithm: Algorithm): EncryptionStrategy => {\n const strategies: Strategies = {\n 'aes-128-ecb'(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 16);\n const initVector: BinaryLike | null = null;\n const securityKey: CipherKey = hashedKey;\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes128(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 32);\n const initVector: BinaryLike | null = hashedKey.slice(16);\n const securityKey: CipherKey = hashedKey.slice(0, 16);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes192(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 40);\n const initVector: BinaryLike | null = hashedKey.slice(24);\n const securityKey: CipherKey = hashedKey.slice(0, 24);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes256(key: string): Cipher {\n const hashedKey = scryptSync(key, '', 48);\n const initVector: BinaryLike | null = hashedKey.slice(32);\n const securityKey: CipherKey = hashedKey.slice(0, 32);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n };\n\n return strategies[algorithm];\n};\n\n/**\n * It creates a cipher instance used for encryption\n *\n * @param key - The encryption key\n * @param algorithm - The algorithm to use to create the Cipher\n *\n * @returns A {@link Cipher} instance created with the given key & algorithm\n */\nexport const createEncryptionCipher = (\n key: string,\n algorithm: Algorithm = 'aes-128-ecb'\n): Cipher => {\n return getEncryptionStrategy(algorithm)(key);\n};\n"],"names":["getEncryptionStrategy","algorithm","strategies","key","hashedKey","scryptSync","initVector","securityKey","createCipheriv","aes128","slice","aes192","aes256","createEncryptionCipher"],"mappings":";;AAGA;AACA,MAAMA,wBAAwB,CAACC,SAAAA,GAAAA;AAC7B,IAAA,MAAMC,UAAyB,GAAA;AAC7B,QAAA,aAAA,CAAA,CAAcC,GAAW,EAAA;YACvB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;AACtC,YAAA,MAAMG,UAAgC,GAAA,IAAA;AACtC,YAAA,MAAMC,WAAyBH,GAAAA,SAAAA;YAC/B,OAAOI,cAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD,SAAA;AACAG,QAAAA,MAAAA,CAAAA,CAAON,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,cAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD,SAAA;AACAK,QAAAA,MAAAA,CAAAA,CAAOR,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,cAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD,SAAA;AACAM,QAAAA,MAAAA,CAAAA,CAAOT,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,cAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD;AACF,KAAA;IAEA,OAAOJ,UAAU,CAACD,SAAU,CAAA;AAC9B,CAAA;AAEA;;;;;;;AAOC,IACYY,MAAAA,sBAAAA,GAAyB,CACpCV,GAAAA,EACAF,YAAuB,aAAa,GAAA;AAEpC,IAAA,OAAOD,sBAAsBC,SAAWE,CAAAA,CAAAA,GAAAA,CAAAA;AAC1C;;;;"}
1
+ {"version":3,"file":"encrypt.mjs","sources":["../../../src/utils/encryption/encrypt.ts"],"sourcesContent":["import { createCipheriv, Cipheriv, scryptSync, CipherKey, BinaryLike } from 'crypto';\nimport { EncryptionStrategy, Strategies, Algorithm } from '../../../types';\n\n// different key values depending on algorithm chosen\nconst getEncryptionStrategy = (algorithm: Algorithm): EncryptionStrategy => {\n const strategies: Strategies = {\n 'aes-128-ecb'(key: string): Cipheriv {\n const hashedKey = scryptSync(key, '', 16);\n const initVector: BinaryLike | null = null;\n const securityKey: CipherKey = hashedKey;\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes128(key: string): Cipheriv {\n const hashedKey = scryptSync(key, '', 32);\n const initVector: BinaryLike | null = hashedKey.slice(16);\n const securityKey: CipherKey = hashedKey.slice(0, 16);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes192(key: string): Cipheriv {\n const hashedKey = scryptSync(key, '', 40);\n const initVector: BinaryLike | null = hashedKey.slice(24);\n const securityKey: CipherKey = hashedKey.slice(0, 24);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n aes256(key: string): Cipheriv {\n const hashedKey = scryptSync(key, '', 48);\n const initVector: BinaryLike | null = hashedKey.slice(32);\n const securityKey: CipherKey = hashedKey.slice(0, 32);\n return createCipheriv(algorithm, securityKey, initVector);\n },\n };\n\n return strategies[algorithm];\n};\n\n/**\n * It creates a cipher instance used for encryption\n *\n * @param key - The encryption key\n * @param algorithm - The algorithm to use to create the Cipher\n *\n * @returns A {@link Cipheriv} instance created with the given key & algorithm\n */\nexport const createEncryptionCipher = (\n key: string,\n algorithm: Algorithm = 'aes-128-ecb'\n): Cipheriv => {\n return getEncryptionStrategy(algorithm)(key);\n};\n"],"names":["getEncryptionStrategy","algorithm","strategies","key","hashedKey","scryptSync","initVector","securityKey","createCipheriv","aes128","slice","aes192","aes256","createEncryptionCipher"],"mappings":";;AAGA;AACA,MAAMA,wBAAwB,CAACC,SAAAA,GAAAA;AAC7B,IAAA,MAAMC,UAAyB,GAAA;AAC7B,QAAA,aAAA,CAAA,CAAcC,GAAW,EAAA;YACvB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;AACtC,YAAA,MAAMG,UAAgC,GAAA,IAAA;AACtC,YAAA,MAAMC,WAAyBH,GAAAA,SAAAA;YAC/B,OAAOI,cAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD,SAAA;AACAG,QAAAA,MAAAA,CAAAA,CAAON,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,cAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD,SAAA;AACAK,QAAAA,MAAAA,CAAAA,CAAOR,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,cAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD,SAAA;AACAM,QAAAA,MAAAA,CAAAA,CAAOT,GAAW,EAAA;YAChB,MAAMC,SAAAA,GAAYC,UAAWF,CAAAA,GAAAA,EAAK,EAAI,EAAA,EAAA,CAAA;YACtC,MAAMG,UAAAA,GAAgCF,SAAUM,CAAAA,KAAK,CAAC,EAAA,CAAA;AACtD,YAAA,MAAMH,WAAyBH,GAAAA,SAAAA,CAAUM,KAAK,CAAC,CAAG,EAAA,EAAA,CAAA;YAClD,OAAOF,cAAAA,CAAeP,WAAWM,WAAaD,EAAAA,UAAAA,CAAAA;AAChD;AACF,KAAA;IAEA,OAAOJ,UAAU,CAACD,SAAU,CAAA;AAC9B,CAAA;AAEA;;;;;;;AAOC,IACYY,MAAAA,sBAAAA,GAAyB,CACpCV,GAAAA,EACAF,YAAuB,aAAa,GAAA;AAEpC,IAAA,OAAOD,sBAAsBC,SAAWE,CAAAA,CAAAA,GAAAA,CAAAA;AAC1C;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/data-transfer",
3
- "version": "5.30.1",
3
+ "version": "5.31.0",
4
4
  "description": "Data transfer capabilities for Strapi",
5
5
  "keywords": [
6
6
  "strapi",
@@ -42,9 +42,9 @@
42
42
  "watch": "run -T rollup -c -w"
43
43
  },
44
44
  "dependencies": {
45
- "@strapi/logger": "5.30.1",
46
- "@strapi/types": "5.30.1",
47
- "@strapi/utils": "5.30.1",
45
+ "@strapi/logger": "5.31.0",
46
+ "@strapi/types": "5.31.0",
47
+ "@strapi/utils": "5.31.0",
48
48
  "chalk": "4.1.2",
49
49
  "cli-table3": "0.6.5",
50
50
  "commander": "8.3.0",
@@ -61,12 +61,12 @@
61
61
  "ws": "8.17.1"
62
62
  },
63
63
  "devDependencies": {
64
- "@strapi/database": "5.30.1",
64
+ "@strapi/database": "5.31.0",
65
65
  "@types/fs-extra": "11.0.4",
66
66
  "@types/jest": "29.5.2",
67
67
  "@types/koa": "2.13.4",
68
68
  "@types/lodash": "^4.14.191",
69
- "@types/node": "18.19.24",
69
+ "@types/node": "24.10.0",
70
70
  "@types/semver": "7.5.0",
71
71
  "@types/stream-chain": "2.0.1",
72
72
  "@types/stream-json": "1.7.3",
@@ -79,7 +79,7 @@
79
79
  "typescript": "5.4.4"
80
80
  },
81
81
  "engines": {
82
- "node": ">=18.0.0 <=22.x.x",
82
+ "node": ">=20.0.0 <=24.x.x",
83
83
  "npm": ">=6.0.0"
84
84
  }
85
85
  }