@nixxie-cms/fields-encrypted 1.0.1 → 2.0.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 BaseListTypeInfo, type CommonFieldConfig, type FieldTypeFunc, type SimpleFieldTypeInfo } from '@nixxie-cms/core/types';
2
- export type EncryptedFieldConfig<ListTypeInfo extends BaseListTypeInfo> = CommonFieldConfig<ListTypeInfo, SimpleFieldTypeInfo<'String'>> & {
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<ListTypeInfo extends BaseListTypeInfo>(config: EncryptedFieldConfig<ListTypeInfo>): FieldTypeFunc<ListTypeInfo>;
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,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAGzB,MAAM,wBAAwB,CAAA;AAG/B,MAAM,MAAM,oBAAoB,CAAC,YAAY,SAAS,gBAAgB,IAAI,iBAAiB,CACzF,YAAY,EACZ,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,YAAY,SAAS,gBAAgB,EAC7D,MAAM,EAAE,oBAAoB,CAAC,YAAY,CAAC,GACzC,aAAa,CAAC,YAAY,CAAC,CAiD7B;AAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,oBAAgB"}
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.1",
3
+ "version": "2.0.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.1"
27
+ "@nixxie-cms/core": "^2.0.0"
28
28
  },
29
29
  "peerDependencies": {
30
- "@nixxie-cms/core": "^1.0.1",
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 BaseListTypeInfo,
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<ListTypeInfo extends BaseListTypeInfo> = CommonFieldConfig<
13
- ListTypeInfo,
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<ListTypeInfo extends BaseListTypeInfo>(
30
- config: EncryptedFieldConfig<ListTypeInfo>
31
- ): FieldTypeFunc<ListTypeInfo> {
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
  }
@@ -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
+ }