@sanity/blueprints 0.23.4 → 0.23.5

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.
@@ -7,7 +7,7 @@ import { runValidation } from '../utils/validation.js';
7
7
  * defineDataset({
8
8
  * name: 'staging',
9
9
  * datasetName: 'staging-v2',
10
- * aclMode: 'private',
10
+ * visibility: 'private',
11
11
  * project: 'my-project-id',
12
12
  * lifecycle: {deletionPolicy: 'protect'},
13
13
  * })
@@ -31,11 +31,13 @@ import { runValidation } from '../utils/validation.js';
31
31
  * @returns The dataset resource
32
32
  */
33
33
  export function defineDataset(parameters) {
34
- // default dataset name
34
+ // default dataset name and acl mode
35
35
  const datasetName = parameters.datasetName || parameters.name;
36
+ const aclMode = parameters.aclMode || parameters.visibility;
36
37
  const datasetResource = {
37
38
  ...parameters,
38
39
  datasetName,
40
+ aclMode,
39
41
  type: 'sanity.project.dataset',
40
42
  };
41
43
  runValidation(() => validateDataset(datasetResource));
@@ -1 +1 @@
1
- {"version":3,"file":"datasets.js","sourceRoot":"","sources":["../../src/definers/datasets.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6D,eAAe,EAAC,MAAM,aAAa,CAAA;AACvG,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD;;;;;;;;;;;;GAYG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkC;IAC9D,uBAAuB;IACvB,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,IAAI,CAAA;IAE7D,MAAM,eAAe,GAA6B;QAChD,GAAG,UAAU;QACb,WAAW;QACX,IAAI,EAAE,wBAAwB;KAC/B,CAAA;IAED,aAAa,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CAAA;IAErD,OAAO,eAAe,CAAA;AACxB,CAAC"}
1
+ {"version":3,"file":"datasets.js","sourceRoot":"","sources":["../../src/definers/datasets.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6D,eAAe,EAAC,MAAM,aAAa,CAAA;AACvG,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAA;AAEpD;;;;;;;;;;;;GAYG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkC;IAC9D,oCAAoC;IACpC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,IAAI,UAAU,CAAC,IAAI,CAAA;IAC7D,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,IAAI,UAAU,CAAC,UAAU,CAAA;IAE3D,MAAM,eAAe,GAA6B;QAChD,GAAG,UAAU;QACb,WAAW;QACX,OAAO;QACP,IAAI,EAAE,wBAAwB;KAC/B,CAAA;IAED,aAAa,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,CAAA;IAErD,OAAO,eAAe,CAAA;AACxB,CAAC"}
@@ -19,8 +19,13 @@ export interface BlueprintDatasetResource extends BlueprintResource<BlueprintPro
19
19
  datasetName: string;
20
20
  /** The dataset description */
21
21
  description?: string;
22
- /** The ACL mode to set for the new dataset. Defaults to public. */
22
+ /**
23
+ * The ACL mode to set for the dataset. Defaults to public.
24
+ * @hidden
25
+ */
23
26
  aclMode?: AclMode;
27
+ /** The visibility to set for the dataset. Defaults to public. */
28
+ visibility?: AclMode;
24
29
  /**
25
30
  * The project ID of the project that contains your Dataset.
26
31
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/blueprints",
3
- "version": "0.23.4",
3
+ "version": "0.23.5",
4
4
  "description": "Helper methods and type definitions for Sanity Blueprints",
5
5
  "keywords": [
6
6
  "sanity",
@@ -8,7 +8,7 @@ import {runValidation} from '../utils/validation.js'
8
8
  * defineDataset({
9
9
  * name: 'staging',
10
10
  * datasetName: 'staging-v2',
11
- * aclMode: 'private',
11
+ * visibility: 'private',
12
12
  * project: 'my-project-id',
13
13
  * lifecycle: {deletionPolicy: 'protect'},
14
14
  * })
@@ -32,12 +32,14 @@ import {runValidation} from '../utils/validation.js'
32
32
  * @returns The dataset resource
33
33
  */
34
34
  export function defineDataset(parameters: BlueprintDatasetConfig): BlueprintDatasetResource {
35
- // default dataset name
35
+ // default dataset name and acl mode
36
36
  const datasetName = parameters.datasetName || parameters.name
37
+ const aclMode = parameters.aclMode || parameters.visibility
37
38
 
38
39
  const datasetResource: BlueprintDatasetResource = {
39
40
  ...parameters,
40
41
  datasetName,
42
+ aclMode,
41
43
  type: 'sanity.project.dataset',
42
44
  }
43
45
 
@@ -21,8 +21,13 @@ export interface BlueprintDatasetResource extends BlueprintResource<BlueprintPro
21
21
  datasetName: string
22
22
  /** The dataset description */
23
23
  description?: string
24
- /** The ACL mode to set for the new dataset. Defaults to public. */
24
+ /**
25
+ * The ACL mode to set for the dataset. Defaults to public.
26
+ * @hidden
27
+ */
25
28
  aclMode?: AclMode
29
+ /** The visibility to set for the dataset. Defaults to public. */
30
+ visibility?: AclMode
26
31
 
27
32
  /**
28
33
  * The project ID of the project that contains your Dataset.