@sanity/blueprints 0.23.5 → 0.23.6

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.
@@ -33,7 +33,7 @@ import { runValidation } from '../utils/validation.js';
33
33
  export function defineDataset(parameters) {
34
34
  // default dataset name and acl mode
35
35
  const datasetName = parameters.datasetName || parameters.name;
36
- const aclMode = parameters.aclMode || parameters.visibility;
36
+ const aclMode = parameters.aclMode || parameters.visibility || 'public';
37
37
  const datasetResource = {
38
38
  ...parameters,
39
39
  datasetName,
@@ -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,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"}
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,IAAI,QAAQ,CAAA;IAEvE,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"}
@@ -21,11 +21,8 @@ export interface BlueprintDatasetResource extends BlueprintResource<BlueprintPro
21
21
  description?: string;
22
22
  /**
23
23
  * The ACL mode to set for the dataset. Defaults to public.
24
- * @hidden
25
24
  */
26
- aclMode?: AclMode;
27
- /** The visibility to set for the dataset. Defaults to public. */
28
- visibility?: AclMode;
25
+ aclMode: AclMode;
29
26
  /**
30
27
  * The project ID of the project that contains your Dataset.
31
28
  *
@@ -41,10 +38,17 @@ export interface BlueprintDatasetResource extends BlueprintResource<BlueprintPro
41
38
  * @category Resource Types
42
39
  * @interface
43
40
  */
44
- export type BlueprintDatasetConfig = Omit<BlueprintDatasetResource, 'type' | 'datasetName'> & {
41
+ export type BlueprintDatasetConfig = Omit<BlueprintDatasetResource, 'type' | 'datasetName' | 'aclMode'> & {
45
42
  /**
46
43
  * The name of the dataset. Must be unique within a project.
47
44
  * @defaultValue The `name` of the resource
48
45
  */
49
46
  datasetName?: string;
47
+ /**
48
+ * The ACL mode to set for the dataset. Defaults to public.
49
+ * @hidden
50
+ */
51
+ aclMode?: AclMode;
52
+ /** The visibility to set for the dataset. Defaults to public. */
53
+ visibility?: AclMode;
50
54
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/blueprints",
3
- "version": "0.23.5",
3
+ "version": "0.23.6",
4
4
  "description": "Helper methods and type definitions for Sanity Blueprints",
5
5
  "keywords": [
6
6
  "sanity",
@@ -34,7 +34,7 @@ import {runValidation} from '../utils/validation.js'
34
34
  export function defineDataset(parameters: BlueprintDatasetConfig): BlueprintDatasetResource {
35
35
  // default dataset name and acl mode
36
36
  const datasetName = parameters.datasetName || parameters.name
37
- const aclMode = parameters.aclMode || parameters.visibility
37
+ const aclMode = parameters.aclMode || parameters.visibility || 'public'
38
38
 
39
39
  const datasetResource: BlueprintDatasetResource = {
40
40
  ...parameters,
@@ -23,11 +23,8 @@ export interface BlueprintDatasetResource extends BlueprintResource<BlueprintPro
23
23
  description?: string
24
24
  /**
25
25
  * The ACL mode to set for the dataset. Defaults to public.
26
- * @hidden
27
26
  */
28
- aclMode?: AclMode
29
- /** The visibility to set for the dataset. Defaults to public. */
30
- visibility?: AclMode
27
+ aclMode: AclMode
31
28
 
32
29
  /**
33
30
  * The project ID of the project that contains your Dataset.
@@ -45,10 +42,17 @@ export interface BlueprintDatasetResource extends BlueprintResource<BlueprintPro
45
42
  * @category Resource Types
46
43
  * @interface
47
44
  */
48
- export type BlueprintDatasetConfig = Omit<BlueprintDatasetResource, 'type' | 'datasetName'> & {
45
+ export type BlueprintDatasetConfig = Omit<BlueprintDatasetResource, 'type' | 'datasetName' | 'aclMode'> & {
49
46
  /**
50
47
  * The name of the dataset. Must be unique within a project.
51
48
  * @defaultValue The `name` of the resource
52
49
  */
53
50
  datasetName?: string
51
+ /**
52
+ * The ACL mode to set for the dataset. Defaults to public.
53
+ * @hidden
54
+ */
55
+ aclMode?: AclMode
56
+ /** The visibility to set for the dataset. Defaults to public. */
57
+ visibility?: AclMode
54
58
  }