@nixxie-cms/fields-encrypted 1.0.1 → 2.1.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.
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @nixxie-cms/fields-encrypted
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 450043a:
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [0fe028d]
|
|
12
|
+
- Updated dependencies [690e433]
|
|
13
|
+
- Updated dependencies [2c0d28c]
|
|
14
|
+
- Updated dependencies [450043a]
|
|
15
|
+
- @nixxie-cms/core@2.0.0
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export type EncryptedFieldConfig<
|
|
1
|
+
import { type BaseCollectionTypeInfo, type CommonFieldConfig, type FieldTypeFunc, type SimpleFieldTypeInfo } from '@nixxie-cms/core/types';
|
|
2
|
+
export type EncryptedFieldConfig<CollectionTypeInfo extends BaseCollectionTypeInfo> = CommonFieldConfig<CollectionTypeInfo, SimpleFieldTypeInfo<'String'>> & {
|
|
3
3
|
/**
|
|
4
4
|
* Encryption secret. Data is encrypted at rest with AES-256-GCM using a key derived from this
|
|
5
5
|
* value. Store it outside source control (e.g. `process.env.FIELD_ENCRYPTION_KEY`). Rotating it
|
|
@@ -15,6 +15,6 @@ export type EncryptedFieldConfig<ListTypeInfo extends BaseListTypeInfo> = Common
|
|
|
15
15
|
* A field whose value is transparently encrypted (AES-256-GCM) before being written to the
|
|
16
16
|
* database and decrypted when read back through GraphQL. The plaintext never touches disk.
|
|
17
17
|
*/
|
|
18
|
-
export declare function encrypted<
|
|
18
|
+
export declare function encrypted<CollectionTypeInfo extends BaseCollectionTypeInfo>(config: EncryptedFieldConfig<CollectionTypeInfo>): FieldTypeFunc<CollectionTypeInfo>;
|
|
19
19
|
export { encrypt, decrypt, isEncrypted } from "./crypto.js";
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"../../../src","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"../../../src","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAGzB,MAAM,wBAAwB,CAAA;AAG/B,MAAM,MAAM,oBAAoB,CAAC,kBAAkB,SAAS,sBAAsB,IAAI,iBAAiB,CACrG,kBAAkB,EAClB,mBAAmB,CAAC,QAAQ,CAAC,CAC9B,GAAG;IACF;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAA;IACd,EAAE,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC5C,CAAA;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,kBAAkB,SAAS,sBAAsB,EACzE,MAAM,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,GAC/C,aAAa,CAAC,kBAAkB,CAAC,CAiDnC;AAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,oBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nixxie-cms/fields-encrypted",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/nixxie-cms-fields-encrypted.cjs.js",
|
|
6
6
|
"module": "dist/nixxie-cms-fields-encrypted.esm.js",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"react": "^19.2.4",
|
|
27
|
-
"@nixxie-cms/core": "^1.0
|
|
27
|
+
"@nixxie-cms/core": "^2.1.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@nixxie-cms/core": "^
|
|
30
|
+
"@nixxie-cms/core": "^2.0.0",
|
|
31
31
|
"react": "^19.2.4"
|
|
32
32
|
},
|
|
33
33
|
"preconstruct": {
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g } from '@nixxie-cms/core'
|
|
2
2
|
import {
|
|
3
|
-
type
|
|
3
|
+
type BaseCollectionTypeInfo,
|
|
4
4
|
type CommonFieldConfig,
|
|
5
5
|
type FieldTypeFunc,
|
|
6
6
|
type SimpleFieldTypeInfo,
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
} from '@nixxie-cms/core/types'
|
|
10
10
|
import { decrypt, encrypt } from './crypto'
|
|
11
11
|
|
|
12
|
-
export type EncryptedFieldConfig<
|
|
13
|
-
|
|
12
|
+
export type EncryptedFieldConfig<CollectionTypeInfo extends BaseCollectionTypeInfo> = CommonFieldConfig<
|
|
13
|
+
CollectionTypeInfo,
|
|
14
14
|
SimpleFieldTypeInfo<'String'>
|
|
15
15
|
> & {
|
|
16
16
|
/**
|
|
@@ -26,9 +26,9 @@ export type EncryptedFieldConfig<ListTypeInfo extends BaseListTypeInfo> = Common
|
|
|
26
26
|
* A field whose value is transparently encrypted (AES-256-GCM) before being written to the
|
|
27
27
|
* database and decrypted when read back through GraphQL. The plaintext never touches disk.
|
|
28
28
|
*/
|
|
29
|
-
export function encrypted<
|
|
30
|
-
config: EncryptedFieldConfig<
|
|
31
|
-
): FieldTypeFunc<
|
|
29
|
+
export function encrypted<CollectionTypeInfo extends BaseCollectionTypeInfo>(
|
|
30
|
+
config: EncryptedFieldConfig<CollectionTypeInfo>
|
|
31
|
+
): FieldTypeFunc<CollectionTypeInfo> {
|
|
32
32
|
if (!config.secret) {
|
|
33
33
|
throw new Error('@nixxie-cms/fields-encrypted: a `secret` is required')
|
|
34
34
|
}
|
package/views/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"main": "dist/nixxie-cms-fields-encrypted-views.cjs.js",
|
|
3
|
-
"module": "dist/nixxie-cms-fields-encrypted-views.esm.js"
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"main": "dist/nixxie-cms-fields-encrypted-views.cjs.js",
|
|
3
|
+
"module": "dist/nixxie-cms-fields-encrypted-views.esm.js"
|
|
4
|
+
}
|