@sanity/blueprints 0.7.1 → 0.9.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.
Files changed (91) hide show
  1. package/dist/definers/blueprints.d.ts +12 -0
  2. package/dist/definers/blueprints.js +12 -0
  3. package/dist/definers/blueprints.js.map +1 -1
  4. package/dist/definers/cors.d.ts +10 -0
  5. package/dist/definers/cors.js +10 -0
  6. package/dist/definers/cors.js.map +1 -1
  7. package/dist/definers/datasets.d.ts +9 -0
  8. package/dist/definers/datasets.js +9 -0
  9. package/dist/definers/datasets.js.map +1 -1
  10. package/dist/definers/functions.d.ts +85 -1
  11. package/dist/definers/functions.js +108 -4
  12. package/dist/definers/functions.js.map +1 -1
  13. package/dist/definers/resources.d.ts +5 -0
  14. package/dist/definers/resources.js +5 -0
  15. package/dist/definers/resources.js.map +1 -1
  16. package/dist/definers/robots.d.ts +18 -0
  17. package/dist/definers/robots.js +30 -0
  18. package/dist/definers/robots.js.map +1 -0
  19. package/dist/definers/roles.d.ts +36 -0
  20. package/dist/definers/roles.js +39 -0
  21. package/dist/definers/roles.js.map +1 -1
  22. package/dist/definers/webhooks.d.ts +13 -0
  23. package/dist/definers/webhooks.js +13 -0
  24. package/dist/definers/webhooks.js.map +1 -1
  25. package/dist/index.d.ts +3 -0
  26. package/dist/index.js +3 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/types/blueprints.d.ts +5 -5
  29. package/dist/types/cors.d.ts +30 -4
  30. package/dist/types/datasets.d.ts +16 -4
  31. package/dist/types/functions.d.ts +45 -0
  32. package/dist/types/resources.d.ts +47 -1
  33. package/dist/types/robots.d.ts +30 -0
  34. package/dist/types/robots.js +2 -0
  35. package/dist/types/robots.js.map +1 -0
  36. package/dist/types/roles.d.ts +16 -2
  37. package/dist/types/webhooks.d.ts +3 -0
  38. package/dist/utils/validation.d.ts +4 -0
  39. package/dist/utils/validation.js +4 -0
  40. package/dist/utils/validation.js.map +1 -1
  41. package/dist/validation/blueprints.d.ts +5 -0
  42. package/dist/validation/blueprints.js +5 -0
  43. package/dist/validation/blueprints.js.map +1 -1
  44. package/dist/validation/cors.d.ts +6 -1
  45. package/dist/validation/cors.js +7 -1
  46. package/dist/validation/cors.js.map +1 -1
  47. package/dist/validation/datasets.d.ts +6 -1
  48. package/dist/validation/datasets.js +7 -1
  49. package/dist/validation/datasets.js.map +1 -1
  50. package/dist/validation/functions.d.ts +20 -1
  51. package/dist/validation/functions.js +144 -5
  52. package/dist/validation/functions.js.map +1 -1
  53. package/dist/validation/resources.d.ts +9 -1
  54. package/dist/validation/resources.js +55 -1
  55. package/dist/validation/resources.js.map +1 -1
  56. package/dist/validation/robots.d.ts +8 -0
  57. package/dist/validation/robots.js +97 -0
  58. package/dist/validation/robots.js.map +1 -0
  59. package/dist/validation/roles.d.ts +11 -6
  60. package/dist/validation/roles.js +30 -23
  61. package/dist/validation/roles.js.map +1 -1
  62. package/dist/validation/webhooks.d.ts +7 -2
  63. package/dist/validation/webhooks.js +35 -29
  64. package/dist/validation/webhooks.js.map +1 -1
  65. package/package.json +6 -6
  66. package/src/definers/blueprints.ts +12 -0
  67. package/src/definers/cors.ts +10 -0
  68. package/src/definers/datasets.ts +9 -0
  69. package/src/definers/functions.ts +152 -3
  70. package/src/definers/resources.ts +6 -1
  71. package/src/definers/robots.ts +33 -0
  72. package/src/definers/roles.ts +40 -0
  73. package/src/definers/webhooks.ts +13 -0
  74. package/src/index.ts +3 -0
  75. package/src/types/blueprints.ts +5 -5
  76. package/src/types/cors.ts +30 -4
  77. package/src/types/datasets.ts +16 -4
  78. package/src/types/functions.ts +48 -0
  79. package/src/types/resources.ts +54 -1
  80. package/src/types/robots.ts +35 -0
  81. package/src/types/roles.ts +19 -5
  82. package/src/types/webhooks.ts +5 -0
  83. package/src/utils/validation.ts +4 -0
  84. package/src/validation/blueprints.ts +5 -0
  85. package/src/validation/cors.ts +7 -2
  86. package/src/validation/datasets.ts +7 -2
  87. package/src/validation/functions.ts +152 -12
  88. package/src/validation/resources.ts +50 -1
  89. package/src/validation/robots.ts +96 -0
  90. package/src/validation/roles.ts +30 -24
  91. package/src/validation/webhooks.ts +35 -30
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './definers/cors.js';
3
3
  export * from './definers/datasets.js';
4
4
  export * from './definers/functions.js';
5
5
  export * from './definers/resources.js';
6
+ export * from './definers/robots.js';
6
7
  export * from './definers/roles.js';
7
8
  export * from './definers/webhooks.js';
8
9
  export * from './types/blueprints.js';
@@ -11,6 +12,7 @@ export * from './types/datasets.js';
11
12
  export * from './types/errors.js';
12
13
  export * from './types/functions.js';
13
14
  export * from './types/resources.js';
15
+ export * from './types/robots.js';
14
16
  export * from './types/roles.js';
15
17
  export * from './types/webhooks.js';
16
18
  export * from './validation/blueprints.js';
@@ -18,5 +20,6 @@ export * from './validation/cors.js';
18
20
  export * from './validation/datasets.js';
19
21
  export * from './validation/functions.js';
20
22
  export * from './validation/resources.js';
23
+ export * from './validation/robots.js';
21
24
  export * from './validation/roles.js';
22
25
  export * from './validation/webhooks.js';
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ export * from './definers/cors.js';
4
4
  export * from './definers/datasets.js';
5
5
  export * from './definers/functions.js';
6
6
  export * from './definers/resources.js';
7
+ export * from './definers/robots.js';
7
8
  export * from './definers/roles.js';
8
9
  export * from './definers/webhooks.js';
9
10
  // TYPES - base types for all resources
@@ -13,6 +14,7 @@ export * from './types/datasets.js';
13
14
  export * from './types/errors.js';
14
15
  export * from './types/functions.js';
15
16
  export * from './types/resources.js';
17
+ export * from './types/robots.js';
16
18
  export * from './types/roles.js';
17
19
  export * from './types/webhooks.js';
18
20
  // VALIDATION - validation for all resources
@@ -21,6 +23,7 @@ export * from './validation/cors.js';
21
23
  export * from './validation/datasets.js';
22
24
  export * from './validation/functions.js';
23
25
  export * from './validation/resources.js';
26
+ export * from './validation/robots.js';
24
27
  export * from './validation/roles.js';
25
28
  export * from './validation/webhooks.js';
26
29
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AAEtC,uCAAuC;AACvC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AAEnC,4CAA4C;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AAEtC,uCAAuC;AACvC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AAEnC,4CAA4C;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA"}
@@ -1,13 +1,16 @@
1
1
  import type { BlueprintResource } from '../index.js';
2
+ /** Additional configuration on a Blueprint that overrides the normal configuration */
2
3
  export interface BlueprintsApiConfig {
3
4
  organizationId: string;
4
5
  projectId: string;
5
6
  stackId: string;
6
7
  }
8
+ /** A key-value pair that will be output from a Blueprint */
7
9
  export interface BlueprintOutput {
8
10
  name: string;
9
11
  value: string;
10
12
  }
13
+ /** A representation of a Blueprint document */
11
14
  export interface Blueprint {
12
15
  $schema: string;
13
16
  blueprintVersion: string;
@@ -15,8 +18,5 @@ export interface Blueprint {
15
18
  values?: Record<string, unknown>;
16
19
  outputs?: BlueprintOutput[];
17
20
  }
18
- export type BlueprintModule = ((args?: unknown) => Blueprint) & {
19
- organizationId?: string;
20
- projectId?: string;
21
- stackId?: string;
22
- };
21
+ /** The result of defining a blueprint with `defineBlueprint` */
22
+ export type BlueprintModule = ((args?: unknown) => Blueprint) & Partial<BlueprintsApiConfig>;
@@ -1,15 +1,41 @@
1
- import type { BlueprintResource } from '../index.js';
1
+ import type { BlueprintProjectResourceLifecycle, BlueprintResource } from '../index.js';
2
2
  /**
3
3
  * Represents a CORS Origin resource.
4
+ * @see https://www.sanity.io/docs/content-lake/cors
4
5
  */
5
- export interface BlueprintCorsOriginResource extends BlueprintResource {
6
+ export interface BlueprintCorsOriginResource extends BlueprintResource<BlueprintProjectResourceLifecycle> {
6
7
  type: 'sanity.project.cors';
8
+ /**
9
+ * A CORS origin will be defined using the following format: `protocol://hostname[:port]`
10
+ *
11
+ * The protocol and host name are required while the port is optional. Wildcards (*) are allowed.
12
+ */
7
13
  origin: string;
14
+ /**
15
+ * When adding a CORS origin, you will also need to decide whether or not to allow credentials. If you allow credentials, the origin will be allowed to send authenticated requests using the token or session of a logged in user.
16
+ *
17
+ * If this origin hosts a studio, you will need to allow credentials. Otherwise, you should probably select not to allow credentials.
18
+ *
19
+ * Allowing credentials from wildcard origins is dangerous. Any domain that matches the given pattern will be able to send requests on the user's behalf if they are logged in to your studio.
20
+ */
8
21
  allowCredentials?: boolean;
9
- /** The `project` attribute must be defined if your blueprint is scoped to an organization. */
22
+ /**
23
+ * The project ID of the project that contains your CORS Origin.
24
+ *
25
+ * The `project` attribute must be defined if your blueprint is scoped to an organization. */
10
26
  project?: string;
11
27
  }
12
- /** Configuration for a CORS Origin resource. */
28
+ /**
29
+ * Configuration for a CORS Origin resource.
30
+ * @see https://www.sanity.io/docs/content-lake/cors
31
+ */
13
32
  export type BlueprintCorsOriginConfig = Omit<BlueprintCorsOriginResource, 'type' | 'allowCredentials'> & {
33
+ /**
34
+ * When adding a CORS origin, you will also need to decide whether or not to allow credentials. If you allow credentials, the origin will be allowed to send authenticated requests using the token or session of a logged in user.
35
+ *
36
+ * If this origin hosts a studio, you will need to allow credentials. Otherwise, you should probably select not to allow credentials.
37
+ *
38
+ * Allowing credentials from wildcard origins is dangerous. Any domain that matches the given pattern will be able to send requests on the user's behalf if they are logged in to your studio.
39
+ */
14
40
  allowCredentials?: boolean;
15
41
  };
@@ -1,15 +1,27 @@
1
1
  import type { BlueprintResource } from '../index.js';
2
2
  export type AclMode = 'public' | 'private' | 'custom';
3
- /** Represents a Dataset resource. */
3
+ /**
4
+ * Represents a Dataset resource.
5
+ * @see https://www.sanity.io/docs/content-lake/datasets
6
+ */
4
7
  export interface BlueprintDatasetResource extends BlueprintResource {
5
8
  type: 'sanity.project.dataset';
9
+ /** The name of the dataset. Must be unique within a project. */
6
10
  datasetName: string;
11
+ /** The ACL mode to set for the new dataset. Defaults to public. */
7
12
  aclMode?: AclMode;
8
- /** The `project` attribute must be defined if your blueprint is scoped to an organization. */
13
+ /**
14
+ * The project ID of the project that contains your Dataset.
15
+ *
16
+ * The `project` attribute must be defined if your blueprint is scoped to an organization.
17
+ */
9
18
  project?: string;
10
19
  }
11
- /** Configuration for a Dataset resource. */
20
+ /**
21
+ * Configuration for a Dataset resource.
22
+ * @see https://www.sanity.io/docs/content-lake/datasets
23
+ */
12
24
  export type BlueprintDatasetConfig = Omit<BlueprintDatasetResource, 'type' | 'datasetName'> & {
13
- /** The name of the dataset, defaults to the name of the resource. */
25
+ /** The name of the dataset. Must be unique within a project. Defaults to the name of the resource. */
14
26
  datasetName?: string;
15
27
  };
@@ -1,41 +1,86 @@
1
1
  import type { BlueprintResource } from '../index.js';
2
+ /** Base event configuration shared by document and media library function types */
2
3
  export interface BlueprintFunctionBaseResourceEvent {
4
+ /** Event types that trigger the function. Defaults to ['publish'] */
3
5
  on?: [BlueprintFunctionResourceEventName, ...BlueprintFunctionResourceEventName[]];
6
+ /** GROQ filter expression to match specific documents (e.g., "_type == 'post'") */
4
7
  filter?: string;
8
+ /** GROQ projection to specify which fields to include (e.g., "{_id, title, slug}") */
5
9
  projection?: `{${string}}`;
10
+ /** Include draft documents in addition to published documents */
6
11
  includeDrafts?: boolean;
7
12
  }
13
+ /** Event configuration for document functions */
8
14
  export interface BlueprintDocumentFunctionResourceEvent extends BlueprintFunctionBaseResourceEvent {
15
+ /** Include all versions of documents, not just the current version */
9
16
  includeAllVersions?: boolean;
17
+ /** Optional dataset resource scoping for the function */
10
18
  resource?: BlueprintFunctionResourceEventResourceDataset;
11
19
  }
20
+ /** Event configuration for media library asset functions */
12
21
  export interface BlueprintMediaLibraryFunctionResourceEvent extends BlueprintFunctionBaseResourceEvent {
22
+ /** Media library resource scoping (required for media library functions) */
13
23
  resource: BlueprintFunctionResourceEventResourceMediaLibrary;
14
24
  }
25
+ /** Union type of all function resource event configurations */
15
26
  export type BlueprintFunctionResourceEvent = BlueprintDocumentFunctionResourceEvent | BlueprintMediaLibraryFunctionResourceEvent;
27
+ /**
28
+ * Dataset resource for scoping document functions to specific datasets
29
+ * @example { type: 'dataset', id: 'my-project.production' }
30
+ */
31
+ export interface BlueprintScheduleFunctionExplicitResourceEvent {
32
+ minute: string;
33
+ hour: string;
34
+ dayOfMonth: string;
35
+ month: string;
36
+ dayOfWeek: string;
37
+ }
38
+ export interface BlueprintScheduleFunctionExpressionResourceEvent {
39
+ expression: string;
40
+ }
41
+ export type BlueprintScheduleFunctionResourceEvent = BlueprintScheduleFunctionExplicitResourceEvent | BlueprintScheduleFunctionExpressionResourceEvent;
16
42
  interface BlueprintFunctionResourceEventResourceDataset {
17
43
  type: 'dataset';
18
44
  /** @description A dataset ID in the format <projectId>.<datasetName>. <datasetName> can be `*` to signify "all datasets in project with ID <projectId>." */
19
45
  id: string;
20
46
  }
47
+ /** Media library resource for scoping media library functions */
21
48
  interface BlueprintFunctionResourceEventResourceMediaLibrary {
22
49
  type: 'media-library';
23
50
  id: string;
24
51
  }
52
+ /** Events that can trigger a function */
25
53
  type BlueprintFunctionResourceEventName = 'publish' | 'create' | 'delete' | 'update';
54
+ /** Base function resource with common properties for all function types */
26
55
  export interface BlueprintBaseFunctionResource extends BlueprintResource {
56
+ /** Human-readable display name for the function */
27
57
  displayName?: string;
58
+ /** Path to the function source code */
28
59
  src: string;
60
+ /** Execution timeout in seconds */
29
61
  timeout?: number;
62
+ /** Memory allocation in gigabytes */
30
63
  memory?: number;
64
+ /** Environment variables provided to the function */
31
65
  env?: Record<string, string>;
66
+ /** Token provided during function invocation */
67
+ robotToken?: string;
32
68
  }
69
+ /** A function resource triggered by document events in Sanity datasets */
33
70
  export interface BlueprintDocumentFunctionResource extends BlueprintBaseFunctionResource {
34
71
  type: 'sanity.function.document';
72
+ /** Event configuration specifying when and how the function is triggered */
35
73
  event: BlueprintDocumentFunctionResourceEvent;
36
74
  }
75
+ /** A function resource triggered by media library asset events */
37
76
  export interface BlueprintMediaLibraryAssetFunctionResource extends BlueprintBaseFunctionResource {
38
77
  type: 'sanity.function.media-library.asset';
78
+ /** Event configuration specifying when and how the function is triggered */
39
79
  event: BlueprintMediaLibraryFunctionResourceEvent;
40
80
  }
81
+ export interface BlueprintScheduleFunctionResource extends BlueprintBaseFunctionResource {
82
+ type: 'sanity.function.cron';
83
+ event: BlueprintScheduleFunctionResourceEvent;
84
+ timezone?: string;
85
+ }
41
86
  export {};
@@ -1,7 +1,53 @@
1
+ /**
2
+ * Define deployment behaviour once the policy has been deployed. The following behaviours are allowed:
3
+ *
4
+ * - **retain** If a stack is destroyed, the resource is detached from the stack and will not be destroyed. If the resource is removed from the blueprint, deployment will fail.
5
+ * - **replace** if a stack is deployed, the resource will be destroyed and created instead of performing an update. If the resource is removed from the blueprint, it will be destroyed. If the stack is destroyed, the resource will be destroyed.
6
+ * - **allow** if a stack is destroyed, the resource will be destroyed along with it. If the resource is removed it will be destroyed
7
+ * - **protect** if a stack is deployed the resource will not be updated. If the resource is removed from the blueprint or the stack is destroyed, deployment will fail.
8
+ */
9
+ export type BlueprintResourceDeletionPolicy = 'allow' | 'retain' | 'replace' | 'protect';
10
+ /**
11
+ * An ownership action that will cause the referenced resource to be attached to the current stack.
12
+ */
13
+ export interface BlueprintOwnershipAttachAction {
14
+ type: 'attach';
15
+ /** The identifier of the resource to be attached to the current stack */
16
+ id: string;
17
+ }
18
+ /**
19
+ * A union of all possible ownership actions.
20
+ */
21
+ export type BlueprintOwnershipAction = BlueprintOwnershipAttachAction;
22
+ /**
23
+ * An ownership action that will cause the referenced project-contained resource to be attached to the current stack.
24
+ */
25
+ export interface BlueprintProjectOwnershipAttachAction extends BlueprintOwnershipAttachAction {
26
+ /** The identifier of the project for resources contained in a project */
27
+ projectId: string;
28
+ }
29
+ /**
30
+ * A union of all possible ownership actions for resources belonging to projects.
31
+ */
32
+ export type BlueprintProjectOwnershipAction = BlueprintProjectOwnershipAttachAction;
33
+ /**
34
+ * Defines the lifcycle policy for this resource.
35
+ */
36
+ export interface BlueprintResourceLifecycle {
37
+ deletionPolicy?: BlueprintResourceDeletionPolicy;
38
+ ownershipAction?: BlueprintOwnershipAction;
39
+ }
40
+ /**
41
+ * Defines the lifcycle policy for this resource.
42
+ */
43
+ export interface BlueprintProjectResourceLifecycle extends BlueprintResourceLifecycle {
44
+ ownershipAction?: BlueprintProjectOwnershipAction;
45
+ }
1
46
  /**
2
47
  * The base type for all resources.
3
48
  */
4
- export interface BlueprintResource {
49
+ export interface BlueprintResource<Lifecycle extends BlueprintResourceLifecycle = BlueprintResourceLifecycle> {
5
50
  type: string;
6
51
  name: string;
52
+ lifecycle?: Lifecycle;
7
53
  }
@@ -0,0 +1,30 @@
1
+ import type { BlueprintResource } from './resources';
2
+ /** Resource types that robots can be attached to. */
3
+ export type RobotResourceType = 'organization' | 'project';
4
+ /**
5
+ * Defines the robot's roles within a given resource.
6
+ */
7
+ export interface RobotMembership {
8
+ resourceType: RobotResourceType;
9
+ resourceId: string;
10
+ roleNames: string[];
11
+ }
12
+ /**
13
+ * A robot that provides a token for automated access.
14
+ * @see https://www.sanity.io/docs/content-lake/http-auth#k4c21d7b829fe
15
+ */
16
+ export interface BlueprintRobotResource extends BlueprintResource {
17
+ type: 'sanity.access.robot';
18
+ /** A descriptive label for the robot and its use case */
19
+ label: string;
20
+ memberships: RobotMembership[];
21
+ resourceType?: RobotResourceType;
22
+ resourceId?: string;
23
+ }
24
+ /**
25
+ * Configuration for a robot that provides a token for automated access.
26
+ * @see https://www.sanity.io/docs/content-lake/http-auth#k4c21d7b829fe
27
+ */
28
+ export type BlueprintRobotConfig = Omit<BlueprintRobotResource, 'type' | 'label' | 'token'> & {
29
+ label?: string;
30
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=robots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"robots.js","sourceRoot":"","sources":["../../src/types/robots.ts"],"names":[],"mappings":""}
@@ -1,20 +1,34 @@
1
1
  import type { BlueprintResource } from '../index.js';
2
+ /**
3
+ * A permission definition for a role.
4
+ */
2
5
  export interface RolePermission {
6
+ /** Predefined permission name (e.g., 'sanity-all-documents') */
3
7
  name: string;
8
+ /** Permission action (e.g., 'read', 'mode') */
4
9
  action: string;
10
+ /** Additional parameters for the permission */
5
11
  params?: Record<string, unknown>;
6
12
  }
7
- export interface BlueprintRoleConfig {
8
- name: string;
13
+ /**
14
+ * Configuration for a custom role.
15
+ */
16
+ export interface BlueprintRoleConfig extends Omit<BlueprintResource, 'type'> {
9
17
  title: string;
10
18
  description?: string;
11
19
  appliesToUsers: boolean;
12
20
  appliesToRobots: boolean;
13
21
  permissions: RolePermission[];
14
22
  }
23
+ /**
24
+ * A custom role resource
25
+ */
15
26
  export interface BlueprintRoleResource extends BlueprintRoleConfig, BlueprintResource {
16
27
  type: 'sanity.access.role';
17
28
  }
29
+ /**
30
+ * A custom role resource that is tied to a specific project
31
+ */
18
32
  export interface BlueprintProjectRoleResource extends BlueprintRoleResource {
19
33
  resourceType: 'project';
20
34
  resourceId: string;
@@ -1,5 +1,7 @@
1
1
  import type { BlueprintResource } from '../index.js';
2
+ /** Types of events that can trigger a webhook */
2
3
  export type WebhookTrigger = 'create' | 'update' | 'delete';
4
+ /** A webhook resource definition */
3
5
  export interface BlueprintDocumentWebhookResource extends BlueprintResource {
4
6
  type: 'sanity.project.webhook';
5
7
  project?: string;
@@ -18,4 +20,5 @@ export interface BlueprintDocumentWebhookResource extends BlueprintResource {
18
20
  dataset?: string;
19
21
  apiVersion: string;
20
22
  }
23
+ /** Configuration for a webhook */
21
24
  export type BlueprintDocumentWebhookConfig = Omit<BlueprintDocumentWebhookResource, 'type'>;
@@ -1,2 +1,6 @@
1
1
  import type { BlueprintError } from '../types/errors';
2
+ /**
3
+ * Executes the given validator function and throws a formatted error if any are returned.
4
+ * @param validator A function that returns a list of validation errors.
5
+ */
2
6
  export declare function runValidation(validator: () => BlueprintError[]): void;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Executes the given validator function and throws a formatted error if any are returned.
3
+ * @param validator A function that returns a list of validation errors.
4
+ */
1
5
  export function runValidation(validator) {
2
6
  const errors = validator();
3
7
  if (errors.length > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,aAAa,CAAC,SAAiC;IAC7D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3D,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiC;IAC7D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3D,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC;AACH,CAAC"}
@@ -1,2 +1,7 @@
1
1
  import type { BlueprintError } from '../index.js';
2
+ /**
3
+ * Validates that the given input is a valid Blueprint
4
+ * @param blueprintConfig The blueprint configuration to be validated
5
+ * @returns A list of validation errors
6
+ */
2
7
  export declare function validateBlueprint(blueprintConfig: unknown): BlueprintError[];
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Validates that the given input is a valid Blueprint
3
+ * @param blueprintConfig The blueprint configuration to be validated
4
+ * @returns A list of validation errors
5
+ */
1
6
  export function validateBlueprint(blueprintConfig) {
2
7
  if (!blueprintConfig)
3
8
  return [{ type: 'invalid_value', message: 'blueprint config must be provided' }];
@@ -1 +1 @@
1
- {"version":3,"file":"blueprints.js","sourceRoot":"","sources":["../../src/validation/blueprints.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAAC,eAAwB;IACxD,IAAI,CAAC,eAAe;QAAE,OAAO,CAAC,EAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,mCAAmC,EAAC,CAAC,CAAA;IACpG,IAAI,OAAO,eAAe,KAAK,QAAQ;QAAE,OAAO,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,oCAAoC,EAAC,CAAC,CAAA;IAEvH,MAAM,MAAM,GAAqB,EAAE,CAAA;IAEnC,IAAI,WAAW,IAAI,eAAe,EAAE,CAAC;QACnC,MAAM,EAAC,SAAS,EAAC,GAAG,eAAe,CAAA;QAEnC,IAAI,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,8BAA8B,EAAC,CAAC,CAAA;IAC5H,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
1
+ {"version":3,"file":"blueprints.js","sourceRoot":"","sources":["../../src/validation/blueprints.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,eAAwB;IACxD,IAAI,CAAC,eAAe;QAAE,OAAO,CAAC,EAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,mCAAmC,EAAC,CAAC,CAAA;IACpG,IAAI,OAAO,eAAe,KAAK,QAAQ;QAAE,OAAO,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,oCAAoC,EAAC,CAAC,CAAA;IAEvH,MAAM,MAAM,GAAqB,EAAE,CAAA;IAEnC,IAAI,WAAW,IAAI,eAAe,EAAE,CAAC;QACnC,MAAM,EAAC,SAAS,EAAC,GAAG,eAAe,CAAA;QAEnC,IAAI,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,8BAA8B,EAAC,CAAC,CAAA;IAC5H,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -1,2 +1,7 @@
1
- import type { BlueprintError } from '../index.js';
1
+ import { type BlueprintError } from '../index.js';
2
+ /**
3
+ * Validates that the given resource is a valid CORS origin.
4
+ * @param resource The CORS origin resource
5
+ * @returns A list of validation errors
6
+ */
2
7
  export declare function validateCorsOrigin(resource: unknown): BlueprintError[];
@@ -1,9 +1,15 @@
1
+ import { validateResource } from '../index.js';
2
+ /**
3
+ * Validates that the given resource is a valid CORS origin.
4
+ * @param resource The CORS origin resource
5
+ * @returns A list of validation errors
6
+ */
1
7
  export function validateCorsOrigin(resource) {
2
8
  if (!resource)
3
9
  return [{ type: 'invalid_value', message: 'CORS Origin config must be provided' }];
4
10
  if (typeof resource !== 'object')
5
11
  return [{ type: 'invalid_type', message: 'CORS Origin config must be an object' }];
6
- const errors = [];
12
+ const errors = validateResource(resource, { projectContained: true });
7
13
  if (!('name' in resource) || !resource.name) {
8
14
  errors.push({ type: 'missing_parameter', message: 'CORS Origin name is required' });
9
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cors.js","sourceRoot":"","sources":["../../src/validation/cors.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,QAAiB;IAClD,IAAI,CAAC,QAAQ;QAAE,OAAO,CAAC,EAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,qCAAqC,EAAC,CAAC,CAAA;IAC/F,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,CAAC,EAAC,I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EAAE,mBAAmB,EAAE,OAAO,EAAE,8BAA8B,EAAC,CAAC,CAAA;IACnF,CAAC;SAAM,IAAI,QAAQ,CAAC,IAAI,KAAK,qBAAqB,EAAE,CAAC;QACnD,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,gDAAgD,EAAC,CAAC,CAAA;IACjG,CAAC;IAED,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QAChD,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,6BAA6B,EAAC,CAAC,CAAA;IAClF,CAAC;SAAM,IAAI,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/C,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,kCAAkC,EAAC,CAAC,CAAA;IAClF,CAAC;IAED,IAAI,SAAS,IAAI,QAAQ,EAAE,CAAC;QAC1B,IAAI,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,sCAAsC,EAAC,CAAC,CAAA;QACtF,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -1,2 +1,7 @@
1
- import type { BlueprintError } from '../index.js';
1
+ import { type BlueprintError } from '../index.js';
2
+ /**
3
+ * Validates that the given resource is a valid Dataset.
4
+ * @param resource The Dataset resource
5
+ * @returns A list of validation errors
6
+ */
2
7
  export declare function validateDataset(resource: unknown): BlueprintError[];
@@ -1,9 +1,15 @@
1
+ import { validateResource } from '../index.js';
2
+ /**
3
+ * Validates that the given resource is a valid Dataset.
4
+ * @param resource The Dataset resource
5
+ * @returns A list of validation errors
6
+ */
1
7
  export function validateDataset(resource) {
2
8
  if (!resource)
3
9
  return [{ type: 'invalid_value', message: 'Dataset config must be provided' }];
4
10
  if (typeof resource !== 'object')
5
11
  return [{ type: 'invalid_type', message: 'Dataset config must be an object' }];
6
- const errors = [];
12
+ const errors = validateResource(resource, { projectContained: true });
7
13
  if (!('name' in resource) || !resource.name) {
8
14
  errors.push({ type: 'missing_parameter', message: 'Dataset name is required' });
9
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"datasets.js","sourceRoot":"","sources":["../../src/validation/datasets.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,eAAe,CAAC,QAAiB;IAC/C,IAAI,CAAC,QAAQ;QAAE,OAAO,CAAC,EAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,iCAAiC,EAAC,CAAC,CAAA;IAC3F,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,kCAAkC,EAAC,CAAC,CAAA;IAE9G,MAAM,MAAM,GAAqB,EAAE,CAAA;IAEnC,IAAI,CAAC,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC5C,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,0BAA0B,EAAC,CAAC,CAAA;IAC/E,CAAC;SAAM,IAAI,OAAO,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7C,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,+BAA+B,EAAC,CAAC,CAAA;IAC/E,CAAC;IAED,IAAI,CAAC,CAAC,MAAM,IAAI,QAAQ,CAAC,EAAE,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,0BAA0B,EAAC,CAAC,CAAA;IAC/E,CAAC;SAAM,IAAI,QAAQ,CAAC,IAAI,KAAK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ACxC,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1E,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,iEAAiE,EAAC,CAAC,CAAA;YAClH,CAAC;QACH,CAAC;IACH,CAAC;IAED,+BAA+B;IAC/B,IAAI,SAAS,IAAI,QAAQ,EAAE,CAAC;QAC1B,IAAI,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACzC,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,kCAAkC,EAAC,CAAC,CAAA;QAClF,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -1,4 +1,23 @@
1
- import type { BlueprintError } from '../index.js';
1
+ import { type BlueprintError } from '../index.js';
2
+ /**
3
+ * Validates a document function resource configuration.
4
+ * Checks that the function has a valid event configuration, correct type, and all required base properties.
5
+ * @param functionResource The function resource to validate
6
+ * @returns Array of validation errors, empty if valid
7
+ */
2
8
  export declare function validateDocumentFunction(functionResource: unknown): BlueprintError[];
9
+ /**
10
+ * Validates a media library asset function resource configuration.
11
+ * Checks that the function has a valid event configuration with required resource, correct type, and all required base properties.
12
+ * @param functionResource The function resource to validate
13
+ * @returns Array of validation errors, empty if valid
14
+ */
3
15
  export declare function validateMediaLibraryAssetFunction(functionResource: unknown): BlueprintError[];
16
+ /**
17
+ * Validates base function resource properties.
18
+ * Checks that required fields (name, type) are present and that optional fields have correct types.
19
+ * @param functionResource The function resource to validate
20
+ * @returns Array of validation errors, empty if valid
21
+ */
4
22
  export declare function validateFunction(functionResource: unknown): BlueprintError[];
23
+ export declare function validateScheduleFunction(functionResource: unknown): BlueprintError[];